aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model/Income.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Model/Income.elm')
-rw-r--r--src/client/Model/Income.elm11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client/Model/Income.elm b/src/client/Model/Income.elm
index 34578c6..aa5f05f 100644
--- a/src/client/Model/Income.elm
+++ b/src/client/Model/Income.elm
@@ -9,17 +9,16 @@ module Model.Income exposing
, cumulativeIncomesSince
)
+import Dict exposing (Dict)
import Json.Decode as Decode exposing (Decoder)
-import Utils.Json as Json
-import Time exposing (Time, hour)
import List exposing (..)
-import Dict exposing (Dict)
+import Maybe.Extra as Maybe
+import Time exposing (Time, hour)
+import Utils.Json as Json
import Model.Date exposing (timeDecoder)
import Model.User exposing (UserId, userIdDecoder)
-import Utils.Maybe as Maybe
-
type alias Incomes = Dict IncomeId Income
type alias IncomeId = Int
@@ -46,7 +45,7 @@ incomeDefinedForAll userIds incomes =
let userIncomes = List.map (\userId -> List.filter ((==) userId << .userId) << Dict.values <| incomes) userIds
firstIncomes = map (head << sortBy .time) userIncomes
in if all Maybe.isJust firstIncomes
- then head << reverse << List.sort << map .time << Maybe.cat <| firstIncomes
+ then head << reverse << List.sort << map .time << Maybe.values <| firstIncomes
else Nothing
userCumulativeIncomeSince : Time -> Time -> Incomes -> UserId -> Int