aboutsummaryrefslogtreecommitdiff
path: root/src/client/Update/Payment.elm
blob: 129ccde5bda0b771fedebac11084d0c8f51a3acd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 }