{-# LANGUAGE DeriveGeneric #-}
module Datatypes where
import Data.ByteString
import Data.Text
import GHC.Generics
import Data.Time
data User = User {
User -> String
nameUser :: String
,User -> String
emailUser :: String
,User -> Bool
isAdminUser :: Bool
} deriving(User -> User -> Bool
(User -> User -> Bool) -> (User -> User -> Bool) -> Eq User
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: User -> User -> Bool
$c/= :: User -> User -> Bool
== :: User -> User -> Bool
$c== :: User -> User -> Bool
Eq, (forall x. User -> Rep User x)
-> (forall x. Rep User x -> User) -> Generic User
forall x. Rep User x -> User
forall x. User -> Rep User x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep User x -> User
$cfrom :: forall x. User -> Rep User x
Generic)
data UserFull = UserFull {
UserFull -> String
name :: String
,UserFull -> String
email :: String
,UserFull -> Text
password :: Text
,UserFull -> String
registrationDate :: String
,UserFull -> Bool
isAdmin :: Bool
} deriving(UserFull -> UserFull -> Bool
(UserFull -> UserFull -> Bool)
-> (UserFull -> UserFull -> Bool) -> Eq UserFull
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserFull -> UserFull -> Bool
$c/= :: UserFull -> UserFull -> Bool
== :: UserFull -> UserFull -> Bool
$c== :: UserFull -> UserFull -> Bool
Eq, Int -> UserFull -> ShowS
[UserFull] -> ShowS
UserFull -> String
(Int -> UserFull -> ShowS)
-> (UserFull -> String) -> ([UserFull] -> ShowS) -> Show UserFull
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserFull] -> ShowS
$cshowList :: [UserFull] -> ShowS
show :: UserFull -> String
$cshow :: UserFull -> String
showsPrec :: Int -> UserFull -> ShowS
$cshowsPrec :: Int -> UserFull -> ShowS
Show, (forall x. UserFull -> Rep UserFull x)
-> (forall x. Rep UserFull x -> UserFull) -> Generic UserFull
forall x. Rep UserFull x -> UserFull
forall x. UserFull -> Rep UserFull x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserFull x -> UserFull
$cfrom :: forall x. UserFull -> Rep UserFull x
Generic)
type ErrorLog = String
data Screen = ExitScreen
| FirstScreen
| StartScreen
| LoginScreen
| LoggedScreen
| AdminScreen
| InsertRoomScreen
| SignUpScreen
| RemoveUserScreen
| ViewUserScreen
| ViewScreen
| ViewRoomScreen
| ViewFilterScreen
| ReportRoomScreen
| ReportDayScreen
| CreateReservationScreen
| EditReservationScreen
| RemoveReservationScreen
deriving (Screen -> Screen -> Bool
(Screen -> Screen -> Bool)
-> (Screen -> Screen -> Bool) -> Eq Screen
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Screen -> Screen -> Bool
$c/= :: Screen -> Screen -> Bool
== :: Screen -> Screen -> Bool
$c== :: Screen -> Screen -> Bool
Eq)
data Room = Room {
Room -> String
code :: String
,Room -> [Reservation]
schedule :: [Reservation]
,Room -> [Resource]
resources :: [Resource]
,Room -> Int
capacity :: Int
,Room -> String
localization :: String
,Room -> RoomCategory
category :: RoomCategory
} deriving (Room -> Room -> Bool
(Room -> Room -> Bool) -> (Room -> Room -> Bool) -> Eq Room
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Room -> Room -> Bool
$c/= :: Room -> Room -> Bool
== :: Room -> Room -> Bool
$c== :: Room -> Room -> Bool
Eq, (forall x. Room -> Rep Room x)
-> (forall x. Rep Room x -> Room) -> Generic Room
forall x. Rep Room x -> Room
forall x. Room -> Rep Room x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Room x -> Room
$cfrom :: forall x. Room -> Rep Room x
Generic)
data Reservation = Reservation {
Reservation -> String
requester :: String
,Reservation -> String
description :: String
,Reservation -> LocalTime
startTime :: LocalTime
,Reservation -> LocalTime
finishTime :: LocalTime
} deriving (Reservation -> Reservation -> Bool
(Reservation -> Reservation -> Bool)
-> (Reservation -> Reservation -> Bool) -> Eq Reservation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Reservation -> Reservation -> Bool
$c/= :: Reservation -> Reservation -> Bool
== :: Reservation -> Reservation -> Bool
$c== :: Reservation -> Reservation -> Bool
Eq, (forall x. Reservation -> Rep Reservation x)
-> (forall x. Rep Reservation x -> Reservation)
-> Generic Reservation
forall x. Rep Reservation x -> Reservation
forall x. Reservation -> Rep Reservation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Reservation x -> Reservation
$cfrom :: forall x. Reservation -> Rep Reservation x
Generic)
data RoomCategory = Laboratory
| Auditorium
| Classroom
| Office
| Warehouse
deriving (RoomCategory -> RoomCategory -> Bool
(RoomCategory -> RoomCategory -> Bool)
-> (RoomCategory -> RoomCategory -> Bool) -> Eq RoomCategory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoomCategory -> RoomCategory -> Bool
$c/= :: RoomCategory -> RoomCategory -> Bool
== :: RoomCategory -> RoomCategory -> Bool
$c== :: RoomCategory -> RoomCategory -> Bool
Eq, Int -> RoomCategory -> ShowS
[RoomCategory] -> ShowS
RoomCategory -> String
(Int -> RoomCategory -> ShowS)
-> (RoomCategory -> String)
-> ([RoomCategory] -> ShowS)
-> Show RoomCategory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoomCategory] -> ShowS
$cshowList :: [RoomCategory] -> ShowS
show :: RoomCategory -> String
$cshow :: RoomCategory -> String
showsPrec :: Int -> RoomCategory -> ShowS
$cshowsPrec :: Int -> RoomCategory -> ShowS
Show, (forall x. RoomCategory -> Rep RoomCategory x)
-> (forall x. Rep RoomCategory x -> RoomCategory)
-> Generic RoomCategory
forall x. Rep RoomCategory x -> RoomCategory
forall x. RoomCategory -> Rep RoomCategory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoomCategory x -> RoomCategory
$cfrom :: forall x. RoomCategory -> Rep RoomCategory x
Generic)
data ResourceKind = Projector
| Microscope
| Desk
| Computer
| Board
| AirConditioner
deriving (ResourceKind -> ResourceKind -> Bool
(ResourceKind -> ResourceKind -> Bool)
-> (ResourceKind -> ResourceKind -> Bool) -> Eq ResourceKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceKind -> ResourceKind -> Bool
$c/= :: ResourceKind -> ResourceKind -> Bool
== :: ResourceKind -> ResourceKind -> Bool
$c== :: ResourceKind -> ResourceKind -> Bool
Eq, Int -> ResourceKind -> ShowS
[ResourceKind] -> ShowS
ResourceKind -> String
(Int -> ResourceKind -> ShowS)
-> (ResourceKind -> String)
-> ([ResourceKind] -> ShowS)
-> Show ResourceKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceKind] -> ShowS
$cshowList :: [ResourceKind] -> ShowS
show :: ResourceKind -> String
$cshow :: ResourceKind -> String
showsPrec :: Int -> ResourceKind -> ShowS
$cshowsPrec :: Int -> ResourceKind -> ShowS
Show, (forall x. ResourceKind -> Rep ResourceKind x)
-> (forall x. Rep ResourceKind x -> ResourceKind)
-> Generic ResourceKind
forall x. Rep ResourceKind x -> ResourceKind
forall x. ResourceKind -> Rep ResourceKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceKind x -> ResourceKind
$cfrom :: forall x. ResourceKind -> Rep ResourceKind x
Generic)
data Resource = Resource {
Resource -> ResourceKind
resourceKind :: ResourceKind
,Resource -> Int
resourceQuantity :: Int
}deriving (Resource -> Resource -> Bool
(Resource -> Resource -> Bool)
-> (Resource -> Resource -> Bool) -> Eq Resource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Resource -> Resource -> Bool
$c/= :: Resource -> Resource -> Bool
== :: Resource -> Resource -> Bool
$c== :: Resource -> Resource -> Bool
Eq, (forall x. Resource -> Rep Resource x)
-> (forall x. Rep Resource x -> Resource) -> Generic Resource
forall x. Rep Resource x -> Resource
forall x. Resource -> Rep Resource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Resource x -> Resource
$cfrom :: forall x. Resource -> Rep Resource x
Generic)