diff --git a/lib/Internal/Insert.hs b/lib/Internal/Insert.hs index 597ebd6..a91fe9b 100644 --- a/lib/Internal/Insert.hs +++ b/lib/Internal/Insert.hs @@ -105,6 +105,17 @@ withDates dp f = do -------------------------------------------------------------------------------- -- budget +-- each budget (designated at the top level by a 'name') is processed in the +-- following steps +-- 1. expand all transactions given the desired date range and date patterns for +-- each directive in the budget +-- 2. sort all transactions by date +-- 3. propagate all balances forward, and while doing so assign values to each +-- transaction (some of which depend on the 'current' balance of the +-- target account) +-- 4. assign shadow transactions (TODO) +-- 5. insert all transactions + insertBudget :: MonadFinance m => Budget -> SqlPersistT m [InsertError] insertBudget Budget {budgetLabel = name, income = is, transfers = es} = do res1 <- mapM (insertIncome name) is