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.
|
**Verify:** six payloads, clean and rejected, each with its Nynorsk message.
|
||||||
|
|
||||||
### B5.4 `ledger.py`
|
### B5.4 `ledger.py`
|
||||||
Nothing changes here unless the owner answers the question below with "refuse everything". The
|
`_move_kroner()` refuses any payment that would take a real account below zero — a buy, a cost
|
||||||
rule stays as B4.4 wrote it: a `transfer_out` is refused when the kroner do not cover it, with the
|
and a transfer alike — with the shortfall named in kroner, and exempts the bank, whose negative
|
||||||
shortfall named in kroner, and a buy or a cost may overdraw and is shown as a negative balance.
|
balance is how much has been drawn from it (D35).
|
||||||
**Open:** the owner asked that no account may go negative, but an absolute rule makes the golden
|
**Verify:** the unit tests, plus a hand check of a buy that overdraws, a deposit from the bank
|
||||||
example of §6.4 (buys with no kroner income) and a fresh installation (an empty bank) impossible
|
that funds it, and a transfer that overdraws after that.
|
||||||
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.
|
|
||||||
|
|
||||||
### B5.5 `app.py`
|
### B5.5 `app.py`
|
||||||
Allow the bank as the `market_id` or the `to_market_id` of a kroner `transfer_out` (and keep it
|
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