ENH assault user's face with all errors at once

This commit is contained in:
Nathan Dwarshuis 2023-06-13 20:32:12 -04:00
parent efffda378a
commit 6926003c46
1 changed files with 2 additions and 4 deletions

View File

@ -116,9 +116,7 @@ txPair day from to cur val desc = tx
resolveTx :: (MonadInsertError m, MonadFinance m) => BalTx -> m KeyTx
resolveTx t@Tx {txEntries = ss} =
fmap (\kss -> t {txEntries = kss}) $
combineErrors $
fmap resolveEntry ss
fmap (\kss -> t {txEntries = kss}) $ combineErrors $ fmap resolveEntry ss
insertTx :: MonadSqlQuery m => CommitRId -> KeyTx -> m ()
insertTx c Tx {txDate = d, txDescr = e, txEntries = ss} = do
@ -330,7 +328,7 @@ balanceTxs
=> [(CommitR, RawTx)]
-> m [(CommitR, KeyTx)]
balanceTxs ts = do
bs <- mapM balanceTx $ snd $ L.mapAccumR balanceTxTargets M.empty ts'
bs <- mapErrors balanceTx $ snd $ L.mapAccumR balanceTxTargets M.empty ts'
return $ zip cs bs
where
(cs, ts') = L.unzip $ L.sortOn (txDate . snd) ts