module LoggedIn.Income.Model exposing ( Model , AddIncome , init , initForm ) import Date exposing (Date) import Form exposing (Form) import Form.Validate as Validate exposing (..) import Validation type alias Model = { addIncome : Form String AddIncome } type alias AddIncome = { amount : Int , date : Date } init : Model init = { addIncome = initForm } initForm : Form String AddIncome initForm = Form.initial [] validate validate : Validation String AddIncome validate = form2 AddIncome (get "amount" (int `andThen` (minInt 1))) (get "date" Validation.date)