test(mcp): exercise the write-off in the happy path (P4b S7)
spec_mcp's inv1 walks every tool once and fails on any the books never answered: the happy path now creates an invoice that will not be paid, uploads the collection letter, and writes it off with the evidence in the same call, so books.write_off_invoice's output schema is checked like every other tool's.
This commit is contained in:
1 parent
0322778683
commit
e801908a88
1 file changed
+14
@@ -896,6 +896,20 @@ fn happy_path(name: &str) -> Mcp {
|
|||||||
json!({"kind": "invoices", "status": "all"}),
|
json!({"kind": "invoices", "status": "all"}),
|
||||||
);
|
);
|
||||||
m.ok("books.document", json!({"ref": format!("invoice:{inv}")}));
|
m.ok("books.document", json!({"ref": format!("invoice:{inv}")}));
|
||||||
|
// P4b S7: a bad debt, its evidence uploaded and filed with it.
|
||||||
|
let bad = m.ok(
|
||||||
|
"books.create_invoice",
|
||||||
|
json!({"party_id": customer, "date": "2026-02-03", "due_date": "2026-03-03",
|
||||||
|
"lines": [{"description": "Consulting, never paid", "amount": "400.00"}]}),
|
||||||
|
)["id"]
|
||||||
|
.as_u64()
|
||||||
|
.unwrap();
|
||||||
|
let letter = m.upload(b"Final demand", "letter.txt", "text/plain", "document");
|
||||||
|
m.ok(
|
||||||
|
"books.write_off_invoice",
|
||||||
|
json!({"invoice": bad, "date": "2026-03-01", "reason": "collection exhausted",
|
||||||
|
"upload_id": letter, "confirmed": true}),
|
||||||
|
);
|
||||||
|
|
||||||
// Fixed assets.
|
// Fixed assets.
|
||||||
let registered = m.ok(
|
let registered = m.ok(
|
||||||
|
|||||||
Reference in new issue
Block a user