test(core): golden file for the 1099 vendor worksheet
The `books()` fixture's worksheet is now a golden: 2025 and 2026, so the year boundary and both thresholds (600 and 2,000) are pinned. Recomputing it by hand from rules.md B-19 before serializing the report: - Dana: 1,500 bill payment + 700 direct = 2,200 in 2026 (reportable at 2,000); the 300 dated 2025-12-30 counts only in 2025 (under 600). - Ace Rentals: 1,200 in January; the February 1,200 and its reversal net to zero, so 1,200, under 2,000. - Sam: 5,000 charged to 2100, which no cash, financing or business-card method names, so no payment line: paid 0, under. The card exclusion is the fixture's documented "nothing counts" case. - Bigco: 9,000 from the bank while never decided: undetermined, a decision needed, never reportable until one is made. - The untagged 50.00 contract-labor payment is the quieter note. Every field agrees with the hand worksheet in plan/golden-worksheets/1099-worksheet.md. `Vendor1099Report`, `Vendor1099Line` and `Payment1099` gain serde derives so the report can be serialized; no existing golden or assertion changes. Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
1 parent
d075235559
commit
025c0942ee
4 files changed
+373
-3
No files matched your search
@@ -2511,3 +2511,23 @@ fn card_accounts_are_the_company_cards_liabilities() {
|
||||
[m.card]
|
||||
);
|
||||
}
|
||||
|
||||
/// Golden (oracle Layer 1): the worksheet's figures for the hand-verified
|
||||
/// fixture above, every one recomputed from the entries in
|
||||
/// plan/golden-worksheets/1099-worksheet.md before this test was run.
|
||||
/// 2025 and 2026 together pin the year boundary: Dana's 300.00 on
|
||||
/// 2025-12-30 counts in 2025 only, and the threshold moves from 600 to
|
||||
/// 2,000 (rules.md B-19).
|
||||
#[test]
|
||||
fn golden_1099_worksheet() {
|
||||
let l = books();
|
||||
let r2026 = report_for(&l, 2026, None, &[]).unwrap();
|
||||
let r2025 = report_for(&l, 2025, None, &[]).unwrap();
|
||||
let got = serde_json::json!({
|
||||
"2025": serde_json::to_value(&r2025).unwrap(),
|
||||
"2026": serde_json::to_value(&r2026).unwrap(),
|
||||
});
|
||||
let want: serde_json::Value =
|
||||
serde_json::from_str(include_str!("golden/form1099_worksheet.json")).unwrap();
|
||||
assert_eq!(got, want);
|
||||
}
|
||||
Reference in new issue
Block a user