diff options
author | Joris Guyonvarch | 2015-07-20 21:55:52 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-07-20 21:55:52 +0200 |
commit | a271d6034bc4cc631a64476d25d21c83a701fa39 (patch) | |
tree | 89ffa3df69999c5c9ed3cda9f4e4ec04f7a6ae1d /src/client/Update/Payment.elm | |
parent | a40c4825996c90d107901b0d71162f9356f1395a (diff) | |
download | budget-a271d6034bc4cc631a64476d25d21c83a701fa39.tar.gz budget-a271d6034bc4cc631a64476d25d21c83a701fa39.tar.bz2 budget-a271d6034bc4cc631a64476d25d21c83a701fa39.zip |
Add a payment from the UI, it needs polishing however
Diffstat (limited to 'src/client/Update/Payment.elm')
-rw-r--r-- | src/client/Update/Payment.elm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/client/Update/Payment.elm b/src/client/Update/Payment.elm new file mode 100644 index 0000000..129ccde --- /dev/null +++ b/src/client/Update/Payment.elm @@ -0,0 +1,22 @@ +module Update.Payment + ( PaymentAction(..) + , updatePayment + ) where + +import Model.View.PaymentView exposing (..) +import Model.Payment exposing (..) + +type PaymentAction = + UpdateName String + | UpdateCost String + | UpdatePayments Payments + +updatePayment : PaymentAction -> PaymentView -> PaymentView +updatePayment action paymentView = + case action of + UpdateName name -> + { paymentView | name <- name } + UpdateCost cost -> + { paymentView | cost <- cost } + UpdatePayments payments -> + { paymentView | payments <- payments } |