test(bookspec): each write-off in an example files its own notice

Under P6's dedup (one record per bytes) the adapter's constant letter
made the example's second write-off of the same invoice reuse the first
write-off's record, which a receipt's one-entry rule (B-38) refuses, and
the write-off now refuses that before anything is journaled (the S7/P6
integration fix). The example's two write-offs have two notices, which
is what it describes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-29 05:25:22 -06:00
1 parent 9351f89d38
commit 6c26160e26
1 file changed
+9 -1
+9 -1
View File
@@ -1180,6 +1180,14 @@ impl<'a> Books<'a> {
.outstanding
}
};
// Each write-off's own notice: identical bytes would be one
// record (plan P6 step 4), and a receipt evidences one entry
// (B-38), so a second write-off with the first's letter is
// refused before anything is journaled.
let letter = format!(
"%PDF-1.4\nFinal demand for invoice {invoice}: {}\n%%EOF\n",
w.reason
);
self.store
.write_off_invoice(
invoice,
@@ -1189,7 +1197,7 @@ impl<'a> Books<'a> {
Some(ledger_store::WriteOffEvidence::File {
file_name: "collection-letter.pdf",
mime_type: "application/pdf",
bytes: b"%PDF-1.4\nFinal demand\n%%EOF\n",
bytes: letter.as_bytes(),
description: Some("Evidence of worthlessness"),
}),
)