Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data Person = Person {
- personId :: UUID,
- firstName :: String,
- lastName :: String,
- phoneNumber :: String,
- mobileNumber :: String,
- mobileNumber2 :: String,
- birthDate :: Day,
- -- image :: ByteString,
- nationalCode :: String,
- postalCode :: String,
- address :: String
- } deriving (Show, Generic)
- data Account = Account {
- accountId :: UUID,
- cityId :: Maybe Int,
- userTypeId :: Maybe Int,
- userName :: String,
- password :: String,
- email :: Maybe String,
- pushToken :: Maybe String,
- active :: Maybe Bool,
- registerDate :: Maybe Day,
- verificationCode :: Maybe String,
- verified :: Bool,
- referrerId :: UUID,
- person :: DefaultKey Person
- } deriving Generic
- deriving instance Show Account
- data Vehicle = Vehicle {
- vehicleId :: UUID,
- vehicleCapacity :: Int,
- vehicleModel :: String,
- plateNumber :: String,
- imei :: String,
- rate :: Double,
- imei2 :: String,
- workHours :: String,
- -- bankAccountInfo :: Object,
- appVersion :: Int,
- account :: DefaultKey Account
- }
- addVehicle :: Pool Postgresql -> Vehicle -> IO (AutoKey Vehicle)
- addVehicle pool v = do
- pid <- nextRandom
- aid <- nextRandom
- let v = v {account = (account v) {accountId = aid} }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement