From c18a15d454dca4ad91fcbf67732231d80922ea89 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Mon, 16 Nov 2026 19:21:05 +0000 Subject: [PATCH] Add the cost and no-negative work to phase B5 --- docs/TODO.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/TODO.md b/docs/TODO.md index 6f1982b..0daf86b 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -291,16 +291,18 @@ changed to sats. Only the parts that depend on the currency are refreshed (`sync choice stays. ### B5.3 `validation.py` -A kroner `transfer_out` must have the bank on exactly one side: as `market_id` (a deposit) or as -`to_market_id` (a withdrawal). Kroner between two real accounts are rejected, `to_market_id` is -always required, and a sats transfer may not name the bank. `validation` learns the bank id as a -parameter. +A kroner `transfer_out` must have the bank on exactly one side: as `market_id` (a deposit, the +account is the bank and `Til` is the exchange being filled) or as `to_market_id` (a withdrawal). +Kroner between two real accounts are rejected, `to_market_id` is always required, and a sats +transfer may not name the bank. `validation` learns the bank id as an optional parameter. **Verify:** six payloads, clean and rejected, each with its Nynorsk message. ### B5.4 `ledger.py` -Refuse a `trade` buy that overdraws the kroner balance, with the same message as a transfer. -**Verify:** the unit tests, plus a hand check of a buy that overdraws and one that a deposit -covers. +Refuse any transaction that would overdraw an account's kroner, a `trade` buy included, with the +same message as a transfer. The bank is covered by the same rule, so a cost without kroner on the +bank is refused. +**Verify:** the unit tests, plus a hand check of a buy that overdraws, a cost that overdraws the +bank, and one that a deposit covers. ### B5.5 `app.py` Allow the bank as the `market_id` or the `to_market_id` of a kroner `transfer_out` (and keep it