Add splitwise module: equal/exact/percent/share split strategies with largest-remainder paise arithmetic, derived ledger, greedy and exact debt simplification, concurrency control (13 tests, 12 transcripts)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4aCTv6BYCer55YdjZ
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
Bad input is rejected before it touches the ledger
|
||||
==================================================
|
||||
|
||||
exact amounts too small -> InvalidSplitException: exact amounts add up to Rs 90.00 but the expense is Rs 100.00
|
||||
percentages add up to 99.99 -> InvalidSplitException: percentages add up to 99.99 but must add up to 100
|
||||
percentage with 3 decimal places -> InvalidSplitException: percent for asha has more than 2 decimal places: 33.333
|
||||
zero shares -> InvalidSplitException: shares for bala must be positive
|
||||
same person listed twice -> InvalidSplitException: duplicate participant in [asha, asha]
|
||||
nobody to split with -> InvalidSplitException: an equal split needs at least one participant
|
||||
participant outside the group -> IllegalArgumentException: esha is not a member of group Goa trip
|
||||
payer outside the group -> IllegalArgumentException: esha is not a member of group Goa trip
|
||||
zero-rupee expense -> IllegalArgumentException: an expense must be positive, got Rs 0.00
|
||||
paying yourself -> IllegalArgumentException: asha cannot pay themselves
|
||||
amount with three decimals -> IllegalArgumentException: not a whole number of paise: 10.005
|
||||
|
||||
After eleven rejected requests: 5 expenses, balances unchanged = true
|
||||
Reference in New Issue
Block a user