From 176baa5250d57d838cb7cc24f55f59ac2841fdb0 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Tue, 27 Oct 2026 12:44:38 -0600 Subject: [PATCH] test(arap): the role inventory gains bad_debts (P4b S7) B-41 gives the write-off its own expense role (6990 Bad Debt Expense, 8.3.4), so the pinned inventory of control roles has thirteen keys, not twelve; the new role's key, default code and type are checked with the rest. No other role changes. --- crates/ledger-core/tests/spec_roles.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ledger-core/tests/spec_roles.rs b/crates/ledger-core/tests/spec_roles.rs index 09d6fb5..bb37b57 100644 --- a/crates/ledger-core/tests/spec_roles.rs +++ b/crates/ledger-core/tests/spec_roles.rs @@ -48,8 +48,9 @@ fn line(desc: &str, amount: &str) -> DocumentLine { } } -/// The twelve role keys, as the spec lists them (B-23 and `UnknownRole`). -const KEYS: [&str; 12] = [ +/// The thirteen role keys, as the spec lists them (B-23, B-41's +/// bad_debts, and `UnknownRole`). +const KEYS: [&str; 13] = [ "receivables", "revenue", "payables", @@ -62,6 +63,7 @@ const KEYS: [&str; 12] = [ "social_security_payable", "medicare_payable", "other_deductions_payable", + "bad_debts", ]; fn role(key: &str) -> &'static ControlAccount { @@ -248,8 +250,9 @@ fn alice() -> PayrollLine { // ------------------------------------------------------------ the roles -/// Oracle: B-23 names the roles and their default codes; `control_account` -/// finds a role by its `key`; `UnknownRole` lists the twelve keys. +/// Oracle: B-23 (and B-41 for bad_debts) names the roles and their default +/// codes; `control_account` finds a role by its `key`; `UnknownRole` lists +/// the thirteen keys. #[test] fn every_role_has_its_key_default_code_and_type() { use AccountType::*; @@ -258,6 +261,7 @@ fn every_role_has_its_key_default_code_and_type() { ("revenue", "4000", Revenue), ("payables", "2000", Liability), ("general_expense", "6999", Expense), + ("bad_debts", "6990", Expense), ("retained_earnings", "3999", Equity), ("salary_expense", "6100", Expense), ("payroll_tax_expense", "6110", Expense),