aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorJoris2015-09-09 21:35:29 +0200
committerJoris2015-09-09 21:35:29 +0200
commit984356c796963bcba44dcbe261e460bd37385c35 (patch)
tree093c6ede90a77ca6f497aa23c7c13e95f6f2040b /src/server
parent0e85e2815f5bb0ab8b5fb8156bd772b4a7743f13 (diff)
Authorizing refunds (negative payments) but stop authorizing null payments
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Design/Global.hs4
-rw-r--r--src/server/Main.hs3
-rw-r--r--src/server/Model/Message/Key.hs2
-rw-r--r--src/server/Model/Message/Translations.hs6
4 files changed, 8 insertions, 7 deletions
diff --git a/src/server/Design/Global.hs b/src/server/Design/Global.hs
index 53a73eb..ec75287 100644
--- a/src/server/Design/Global.hs
+++ b/src/server/Design/Global.hs
@@ -190,7 +190,9 @@ global = do
".cell" ? do
display tableCell
".category" & width (pct 40)
- ".cost" & width (pct 17)
+ ".cost" & do
+ width (pct 17)
+ ".refund" & color C.greenSuccess
".user" & width (pct 20)
".date" & do
width (pct 20)
diff --git a/src/server/Main.hs b/src/server/Main.hs
index 1c2bc08..1a151fc 100644
--- a/src/server/Main.hs
+++ b/src/server/Main.hs
@@ -22,15 +22,14 @@ import Config
main :: IO ()
main = do
+ runMigrations
_ <- forkIO monthlyPaymentJobListener
eitherConfig <- getConfig "config.txt"
case eitherConfig of
Left errorMessage ->
TIO.putStrLn errorMessage
Right config -> do
- runMigrations
scotty (port config) $ do
-
middleware $
staticPolicy (noDots >-> addBase "public")
diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs
index 163a21f..3d915b9 100644
--- a/src/server/Model/Message/Key.hs
+++ b/src/server/Model/Message/Key.hs
@@ -45,7 +45,7 @@ data Key =
| CategoryRequired
| CostRequired
- | CostMustBeNumber
+ | CostMustBeNonNullNumber
-- Payments
diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs
index a3603b8..79d177f 100644
--- a/src/server/Model/Message/Translations.hs
+++ b/src/server/Model/Message/Translations.hs
@@ -178,10 +178,10 @@ m l CostRequired =
English -> "Type a cost."
French -> "Entre un coût."
-m l CostMustBeNumber =
+m l CostMustBeNonNullNumber =
case l of
- English -> "The cost must be a positive natural number."
- French -> "Le coût doit être un entier positif."
+ English -> "The cost must be a non-null integer."
+ French -> "Le coût doit être un entier non nul."
-- Payments