ENH assault user's face with all errors at once
This commit is contained in:
parent
efffda378a
commit
6926003c46
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue