aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/elm/Model')
-rw-r--r--src/client/elm/Model/Action.elm22
-rw-r--r--src/client/elm/Model/Action/AccountAction.elm15
-rw-r--r--src/client/elm/Model/Action/AddPaymentAction.elm9
-rw-r--r--src/client/elm/Model/Action/LoggedInAction.elm19
-rw-r--r--src/client/elm/Model/Action/MonthlyAction.elm10
-rw-r--r--src/client/elm/Model/Action/SignInAction.elm6
-rw-r--r--src/client/elm/Model/Communication.elm18
-rw-r--r--src/client/elm/Model/View/LoggedIn/AddPayment.elm (renamed from src/client/elm/Model/View/LoggedIn/Add.elm)2
-rw-r--r--src/client/elm/Model/View/LoggedInView.elm2
9 files changed, 101 insertions, 2 deletions
diff --git a/src/client/elm/Model/Action.elm b/src/client/elm/Model/Action.elm
new file mode 100644
index 0000000..9d5d125
--- /dev/null
+++ b/src/client/elm/Model/Action.elm
@@ -0,0 +1,22 @@
+module Model.Action
+ ( Action(..)
+ ) where
+
+import Time exposing (Time)
+import Signal exposing (Address)
+
+import Model.User exposing (Users, UserId)
+import Model.Payment exposing (Payments)
+import Model.Payer exposing (Payers)
+import Model.Action.SignInAction exposing (SignInAction)
+import Model.Action.LoggedInAction exposing (LoggedInAction)
+import Model.Communication exposing (Communication)
+
+type Action =
+ NoOp
+ | ServerCommunication Communication
+ | UpdateTime Time
+ | GoSignInView
+ | GoLoggedInView Users UserId Payments Payments Int Payers
+ | UpdateSignIn SignInAction
+ | UpdateLoggedIn LoggedInAction
diff --git a/src/client/elm/Model/Action/AccountAction.elm b/src/client/elm/Model/Action/AccountAction.elm
new file mode 100644
index 0000000..feddbea
--- /dev/null
+++ b/src/client/elm/Model/Action/AccountAction.elm
@@ -0,0 +1,15 @@
+module Model.Action.AccountAction
+ ( AccountAction(..)
+ ) where
+
+import Time exposing (Time)
+
+import Model.User exposing (UserId)
+
+type AccountAction =
+ ToggleDetail
+ | UpdatePayer UserId Time Int
+ | ToggleIncomeEdition
+ | UpdateIncomeEdition String
+ | UpdateEditionError String
+ | UpdateIncome Time Int
diff --git a/src/client/elm/Model/Action/AddPaymentAction.elm b/src/client/elm/Model/Action/AddPaymentAction.elm
new file mode 100644
index 0000000..172f35f
--- /dev/null
+++ b/src/client/elm/Model/Action/AddPaymentAction.elm
@@ -0,0 +1,9 @@
+module Model.Action.AddPaymentAction
+ ( AddPaymentAction(..)
+ ) where
+
+type AddPaymentAction =
+ UpdateName String
+ | UpdateCost String
+ | AddError (Maybe String) (Maybe String)
+ | ToggleFrequency
diff --git a/src/client/elm/Model/Action/LoggedInAction.elm b/src/client/elm/Model/Action/LoggedInAction.elm
new file mode 100644
index 0000000..22a7d3d
--- /dev/null
+++ b/src/client/elm/Model/Action/LoggedInAction.elm
@@ -0,0 +1,19 @@
+module Model.Action.LoggedInAction
+ ( LoggedInAction(..)
+ ) where
+
+import Model.Payment exposing (Payments, Payment, PaymentId)
+import Model.Action.MonthlyAction exposing (MonthlyAction)
+import Model.Action.AccountAction exposing (AccountAction)
+import Model.Action.AddPaymentAction exposing (AddPaymentAction)
+
+type LoggedInAction =
+ UpdateAdd AddPaymentAction
+ | UpdatePayments Payments
+ | AddPayment PaymentId String Int
+ | AddMonthlyPayment PaymentId String Int
+ | ToggleEdit PaymentId
+ | DeletePayment Payment
+ | UpdatePage Int
+ | UpdateMonthly MonthlyAction
+ | UpdateAccount AccountAction
diff --git a/src/client/elm/Model/Action/MonthlyAction.elm b/src/client/elm/Model/Action/MonthlyAction.elm
new file mode 100644
index 0000000..d985ccc
--- /dev/null
+++ b/src/client/elm/Model/Action/MonthlyAction.elm
@@ -0,0 +1,10 @@
+module Model.Action.MonthlyAction
+ ( MonthlyAction(..)
+ ) where
+
+import Model.Payment exposing (Payment, PaymentId)
+
+type MonthlyAction =
+ ToggleDetail
+ | AddPayment Payment
+ | DeletePayment PaymentId
diff --git a/src/client/elm/Model/Action/SignInAction.elm b/src/client/elm/Model/Action/SignInAction.elm
new file mode 100644
index 0000000..6673c11
--- /dev/null
+++ b/src/client/elm/Model/Action/SignInAction.elm
@@ -0,0 +1,6 @@
+module Model.Action.SignInAction
+ ( SignInAction(..)
+ ) where
+
+type SignInAction =
+ ErrorLogin String
diff --git a/src/client/elm/Model/Communication.elm b/src/client/elm/Model/Communication.elm
new file mode 100644
index 0000000..dc4d412
--- /dev/null
+++ b/src/client/elm/Model/Communication.elm
@@ -0,0 +1,18 @@
+module Model.Communication
+ ( Communication(..)
+ ) where
+
+import Time exposing (Time)
+
+import Model.User exposing (UserId)
+import Model.Payment exposing (..)
+
+type Communication =
+ NoCommunication
+ | SignIn String
+ | AddPayment String Int
+ | AddMonthlyPayment String Int
+ | SetIncome Time Int
+ | DeletePayment Payment Int
+ | DeleteMonthlyPayment PaymentId
+ | SignOut
diff --git a/src/client/elm/Model/View/LoggedIn/Add.elm b/src/client/elm/Model/View/LoggedIn/AddPayment.elm
index c25c640..b70b0c6 100644
--- a/src/client/elm/Model/View/LoggedIn/Add.elm
+++ b/src/client/elm/Model/View/LoggedIn/AddPayment.elm
@@ -1,4 +1,4 @@
-module Model.View.LoggedIn.Add
+module Model.View.LoggedIn.AddPayment
( AddPayment
, Frequency(..)
, initAddPayment
diff --git a/src/client/elm/Model/View/LoggedInView.elm b/src/client/elm/Model/View/LoggedInView.elm
index 122c4be..712ce2d 100644
--- a/src/client/elm/Model/View/LoggedInView.elm
+++ b/src/client/elm/Model/View/LoggedInView.elm
@@ -6,7 +6,7 @@ module Model.View.LoggedInView
import Model.User exposing (Users, UserId)
import Model.Payment exposing (Payments)
import Model.Payer exposing (Payers)
-import Model.View.LoggedIn.Add exposing (..)
+import Model.View.LoggedIn.AddPayment exposing (..)
import Model.View.LoggedIn.Edition exposing (..)
import Model.View.LoggedIn.Monthly exposing (..)
import Model.View.LoggedIn.Account exposing (..)