diff options
author | Joris | 2016-11-13 00:49:32 +0100 |
---|---|---|
committer | Joris | 2016-11-13 00:49:32 +0100 |
commit | 86a96decdb8892b10c5314eb916ef15a64204450 (patch) | |
tree | 6f41742d0466f77948680964188144fbff036902 /src/server/Model/Database.hs | |
parent | bf6a0a0b32a7efb88f75c2e89b84d6907aeb10bc (diff) |
Send weekly activity at start of week about previous week
Diffstat (limited to 'src/server/Model/Database.hs')
-rw-r--r-- | src/server/Model/Database.hs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/server/Model/Database.hs b/src/server/Model/Database.hs index 6a2fefe..7f8326e 100644 --- a/src/server/Model/Database.hs +++ b/src/server/Model/Database.hs @@ -22,8 +22,11 @@ import Data.Int (Int64) import Database.Persist.Sqlite import Database.Persist.TH +import Resource (Resource, createdAt, editedAt, deletedAt) + import Model.Frequency -import Model.JobKind + +import Job.Kind share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| User @@ -51,7 +54,7 @@ SignIn UniqSignInToken token deriving Show Job - kind JobKind + kind Kind lastExecution UTCTime Maybe lastCheck UTCTime Maybe UniqJobName kind @@ -66,6 +69,16 @@ Income deriving Show |] +instance Resource Payment where + createdAt = paymentCreatedAt + editedAt = paymentEditedAt + deletedAt = paymentDeletedAt + +instance Resource Income where + createdAt = incomeCreatedAt + editedAt = incomeEditedAt + deletedAt = incomeDeletedAt + type Persist a = SqlPersistT (ResourceT (NoLoggingT IO)) a runDb :: Persist a -> IO a |