Write step B5.4 for the no-negative rule
This commit is contained in:
1 parent
0884b2dca7
commit
d1b6f26222
1 file changed
+5
-9
+5
-9
@@ -298,15 +298,11 @@ transfer may not name the bank. `validation` learns the bank id as an optional p
|
||||
**Verify:** six payloads, clean and rejected, each with its Nynorsk message.
|
||||
|
||||
### B5.4 `ledger.py`
|
||||
Nothing changes here unless the owner answers the question below with "refuse everything". The
|
||||
rule stays as B4.4 wrote it: a `transfer_out` is refused when the kroner do not cover it, with the
|
||||
shortfall named in kroner, and a buy or a cost may overdraw and is shown as a negative balance.
|
||||
**Open:** the owner asked that no account may go negative, but an absolute rule makes the golden
|
||||
example of §6.4 (buys with no kroner income) and a fresh installation (an empty bank) impossible
|
||||
to enter. Refusing everything would also need an opening balance for the bank, which is a new
|
||||
concept.
|
||||
**Verify:** the unit tests, plus a hand check of a transfer that overdraws and one a deposit
|
||||
covers.
|
||||
`_move_kroner()` refuses any payment that would take a real account below zero — a buy, a cost
|
||||
and a transfer alike — with the shortfall named in kroner, and exempts the bank, whose negative
|
||||
balance is how much has been drawn from it (D35).
|
||||
**Verify:** the unit tests, plus a hand check of a buy that overdraws, a deposit from the bank
|
||||
that funds it, and a transfer that overdraws after that.
|
||||
|
||||
### B5.5 `app.py`
|
||||
Allow the bank as the `market_id` or the `to_market_id` of a kroner `transfer_out` (and keep it
|
||||
|
||||
Reference in new issue
Block a user