From 2a38b52fc4656d002030702f91f55728c9cd441d Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Thu, 16 Mar 2023 23:55:59 -0400 Subject: [PATCH] ENH sane defaults for income --- dhall/Types.dhall | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/dhall/Types.dhall b/dhall/Types.dhall index 423eb20..3bf6b48 100644 --- a/dhall/Types.dhall +++ b/dhall/Types.dhall @@ -216,17 +216,24 @@ let Allocation = Allocation_ Amount let IntervalAllocation = Allocation_ (TimeAmount Interval) let Income = - { incGross : Decimal - , incCurrency : CurID - , incWhen : DatePat - , incPretax : List Allocation - , incTaxes : List Allocation - , incPosttax : List Allocation - , incFrom : - {- this must be an income AcntID, and is the only place income - accounts may be specified in the entire budget -} - TaggedAcnt - , incToBal : TaggedAcnt + { Type = + { incGross : Decimal + , incCurrency : CurID + , incWhen : DatePat + , incPretax : List Allocation + , incTaxes : List Allocation + , incPosttax : List Allocation + , incFrom : + {- this must be an income AcntID, and is the only place income + accounts may be specified in the entire budget -} + TaggedAcnt + , incToBal : TaggedAcnt + } + , default = + { incPretax = [] : List Allocation + , incTaxes = [] : List Allocation + , incPosttaxx = [] : List Allocation + } } let Transfer = @@ -267,7 +274,7 @@ let ShadowTransfer = let Budget = { budgetLabel : Text - , incomes : List Income + , incomes : List Income.Type , pretax : List IntervalAllocation , tax : List IntervalAllocation , posttax : List IntervalAllocation