aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model/View
diff options
context:
space:
mode:
authorJoris2015-09-05 19:03:12 +0200
committerJoris2015-09-05 19:03:12 +0200
commiteb5ecba59887a5d1e74bf6287fabdf8a2979f44c (patch)
tree0e3b61002173fb012ad9ddae18632d391330cb50 /src/client/Model/View
parentcc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a (diff)
Payment frequence choice between either punctual or monthly, UI only
Diffstat (limited to 'src/client/Model/View')
-rw-r--r--src/client/Model/View/Payment/Add.elm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/Model/View/Payment/Add.elm b/src/client/Model/View/Payment/Add.elm
index 5ab7a40..da5d0f2 100644
--- a/src/client/Model/View/Payment/Add.elm
+++ b/src/client/Model/View/Payment/Add.elm
@@ -1,5 +1,6 @@
module Model.View.Payment.Add
( AddPayment
+ , Frequency(..)
, initAddPayment
, validateName
, validateCost
@@ -16,6 +17,7 @@ type alias AddPayment =
, nameError : Maybe String
, cost : String
, costError : Maybe String
+ , frequency : Frequency
}
initAddPayment : AddPayment
@@ -24,6 +26,7 @@ initAddPayment =
, nameError = Nothing
, cost = ""
, costError = Nothing
+ , frequency = Punctual
}
validateName : String -> Translations -> Result String String
@@ -36,3 +39,5 @@ validateCost cost translations =
cost
|> validateNonEmpty (getMessage "CostRequired" translations)
|> flip Result.andThen (validateNumber (getMessage "CostMustBeNumber" translations) (\number -> number >= 0))
+
+type Frequency = Punctual | Monthly