From af6cd61ea1b7b6fea83257e3334a46d1cec2f643 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 20 Feb 2022 21:03:05 +0100 Subject: [PATCH] various cleanups --- src/Types/Role.hs | 7 +++---- src/Util.hs | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Types/Role.hs b/src/Types/Role.hs index c0ae7b1..04aa83e 100644 --- a/src/Types/Role.hs +++ b/src/Types/Role.hs @@ -5,8 +5,6 @@ module Types.Role where import qualified Data.Text as T import Data.Aeson -import Data.Time (UTCTime) - import GHC.Generics -- internal imports @@ -17,10 +15,11 @@ import Classes.FromDatabase data Role = Role { roleID :: Int , roleName :: T.Text + -- | Can add new items into the stock of already existing products , roleCanRefillStock :: Bool - -- | paying invoice only adds to user funds + -- | Paying invoice only adds to user funds , roleCanPayInvoice :: Bool - -- | paying out actually removes money from the cashier + -- | Paying out actually removes money from the cashier , roleCanPayOut :: Bool , roleCanManageProducts :: Bool , roleCanManageJournal :: Bool diff --git a/src/Util.hs b/src/Util.hs index 488036e..80c3e4a 100644 --- a/src/Util.hs +++ b/src/Util.hs @@ -31,19 +31,19 @@ import Model import Types printSql :: Default Unpackspec a a => Select a -> IO () -printSql = putStrLn . fromMaybe "Empty query" . showSqlForPostgres +printSql = putStrLn . fromMaybe "Empty query" . showSql initDB :: Connection -> IO () initDB conn = do - execute_ conn initAvatar - execute_ conn initUser - execute_ conn initProduct - execute_ conn initToken - execute_ conn initAuthData - execute_ conn initAmount - execute_ conn initJournal - execute_ conn initRole - execute_ conn initUserToRole + void $ execute_ conn initAvatar + void $ execute_ conn initUser + void $ execute_ conn initProduct + void $ execute_ conn initToken + void $ execute_ conn initAuthData + void $ execute_ conn initAmount + void $ execute_ conn initJournal + void $ execute_ conn initRole + void $ execute_ conn initUserToRole void $ runInsertInitialRoles conn -- This is only a dummy function.