aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Model
diff options
context:
space:
mode:
authorJoris2016-04-08 09:46:34 +0200
committerJoris2016-04-08 09:46:34 +0200
commit06ccc38b65f0f4da2046ac97de447cd1ad061425 (patch)
treefa39341fd3b054603c6ca3ac4a7b01650dfb9a2e /src/client/elm/Model
parent6541fa5316816d6f97a87a370775cfe278e7eeb8 (diff)
Add total payment partition
Diffstat (limited to 'src/client/elm/Model')
-rw-r--r--src/client/elm/Model/Payer.elm13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/elm/Model/Payer.elm b/src/client/elm/Model/Payer.elm
index a7ce5fa..72f13b1 100644
--- a/src/client/elm/Model/Payer.elm
+++ b/src/client/elm/Model/Payer.elm
@@ -4,7 +4,6 @@ module Model.Payer
, ExceedingPayer
, getOrderedExceedingPayers
, useIncomesFrom
- , getPostPaymentPayer
) where
import Json.Decode as Json exposing (..)
@@ -29,6 +28,12 @@ type alias Payer =
, incomes : List Income
}
+type alias PostPaymentPayer =
+ { preIncomePaymentSum : Int
+ , cumulativeIncome : Int
+ , ratio : Float
+ }
+
type alias ExceedingPayer =
{ userId : UserId
, amount : Int
@@ -118,12 +123,6 @@ exceedingPayersFromAmounts userAmounts =
)
|> List.filter (\payer -> payer.amount > 0)
-type alias PostPaymentPayer =
- { preIncomePaymentSum : Int
- , cumulativeIncome : Int
- , ratio : Float
- }
-
getPostPaymentPayer : Time -> Time -> Payer -> PostPaymentPayer
getPostPaymentPayer currentTime since payer =
let cumulativeIncome = cumulativeIncomesSince currentTime since payer.incomes