module LoggedIn.Income.Update
  ( update
  ) where

import Effects exposing (Effects)
import Form exposing (Form)

import LoggedData exposing (LoggedData)

import LoggedIn.Income.Model as IncomeModel
import LoggedIn.Income.Action as IncomeAction

update : LoggedData -> IncomeAction.Action -> IncomeModel.Model -> (IncomeModel.Model, Effects IncomeAction.Action)
update loggedData action model =
  case action of

    IncomeAction.NoOp ->
      ( model
      , Effects.none
      )

    IncomeAction.AddIncomeAction formAction ->
      ( { model | addIncome = Form.update formAction model.addIncome }
      , Effects.none
      )