diff options
-rw-r--r-- | src/client/Model/View/LoggedIn/Account.elm | 2 | ||||
-rw-r--r-- | src/server/Model/Message/Key.hs | 1 | ||||
-rw-r--r-- | src/server/Model/Message/Translations.hs | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/client/Model/View/LoggedIn/Account.elm b/src/client/Model/View/LoggedIn/Account.elm index ab37b81..2bb3ae7 100644 --- a/src/client/Model/View/LoggedIn/Account.elm +++ b/src/client/Model/View/LoggedIn/Account.elm @@ -64,4 +64,4 @@ validateIncome : String -> Translations -> Result String Int validateIncome amount translations = amount |> validateNonEmpty (getMessage "IncomeRequired" translations) - |> flip Result.andThen (validateNumber (getMessage "IncomeMustBeNonNullNumber" translations) ((/=) 0)) + |> flip Result.andThen (validateNumber (getMessage "IncomeMustBePositiveNumber" translations) (\number -> number > 0)) diff --git a/src/server/Model/Message/Key.hs b/src/server/Model/Message/Key.hs index bd2b567..c4ff738 100644 --- a/src/server/Model/Message/Key.hs +++ b/src/server/Model/Message/Key.hs @@ -47,6 +47,7 @@ data Key = | CostMustBeNonNullNumber | IncomeRequired | IncomeMustBeNonNullNumber + | IncomeMustBePositiveNumber -- Payments diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs index f594833..f34cbd2 100644 --- a/src/server/Model/Message/Translations.hs +++ b/src/server/Model/Message/Translations.hs @@ -203,6 +203,11 @@ m l IncomeMustBeNonNullNumber = English -> "The income must be a non-null integer." French -> "Le revenu doit ĂȘtre un entier non nul." +m l IncomeMustBePositiveNumber = + case l of + English -> "The income must be a positive integer." + French -> "Le revenu doit ĂȘtre un entier positif." + -- Payments m l Add = |