From 3853811450d4fe801da996eb48825049c3541030 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 6 Sep 2015 16:46:59 +0200 Subject: Renaming PaymentView to LoggedInView --- src/client/Update/LoggedView.elm | 65 ---------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 src/client/Update/LoggedView.elm (limited to 'src/client/Update/LoggedView.elm') diff --git a/src/client/Update/LoggedView.elm b/src/client/Update/LoggedView.elm deleted file mode 100644 index cf6bcb2..0000000 --- a/src/client/Update/LoggedView.elm +++ /dev/null @@ -1,65 +0,0 @@ -module Update.LoggedView - ( LoggedAction(..) - , updateLoggedView - ) where - -import Date -import Dict - -import Model exposing (Model) -import Model.User exposing (UserId) -import Model.Payment exposing (..) -import Model.Payers exposing (..) -import Model.View.LoggedView exposing (..) -import Model.View.Payment.Add exposing (..) - -import Update.LoggedView.Add exposing (..) -import Update.LoggedView.Monthly as UM - -type LoggedAction = - UpdateAdd AddPaymentAction - | UpdatePayments Payments - | AddPayment UserId String Int Payments - | AddMonthlyPayment PaymentId String Int - | ToggleEdit PaymentId - | DeletePayment UserId Int Payments - | UpdatePage Int Payments - | UpdateMonthly UM.MonthlyAction - -updateLoggedView : Model -> LoggedAction -> LoggedView -> LoggedView -updateLoggedView model action loggedView = - case action of - UpdateAdd addPaymentAction -> - { loggedView | add <- updateAddPayment addPaymentAction loggedView.add } - UpdatePayments payments -> - { loggedView | payments <- payments } - AddPayment userId name cost payments -> - { loggedView - | payments <- payments - , currentPage <- 1 - , add <- initAddPayment Punctual - , payers <- updatePayers loggedView.payers userId cost - , paymentsCount <- loggedView.paymentsCount + 1 - } - AddMonthlyPayment id name cost -> - { loggedView - | add <- initAddPayment Monthly - , monthly <- - let payment = Payment id (Date.fromTime model.currentTime) name cost loggedView.me - in UM.updateMonthly (UM.AddPayment payment) loggedView.monthly - } - ToggleEdit id -> - { loggedView | paymentEdition <- if loggedView.paymentEdition == Just id then Nothing else Just id } - DeletePayment userId cost payments -> - { loggedView - | payments <- payments - , payers <- updatePayers loggedView.payers userId -cost - , paymentsCount <- loggedView.paymentsCount - 1 - } - UpdatePage page payments -> - { loggedView - | currentPage <- page - , payments <- payments - } - UpdateMonthly monthlyAction -> - { loggedView | monthly <- UM.updateMonthly monthlyAction loggedView.monthly } -- cgit v1.2.3