Files
awkawbandClaude Opus 5 46a6ea1322 Pin the response shapes captured from a real server
Twice now a mock written from the upstream source passed while a real server
disagreed — the system-log timestamps and the `/subscriptions/steps` shape —
and `frequency_id` and several empty-string fields were wrong the same way.
Reading the source harder was not going to find the next one.

`tests/fixtures/*.json` hold the *shapes* of real responses: every key, with
its JSON type, and no values at all. `real_shapes.rs` decodes each one and
checks that a decode plus re-serialise loses no key, so a field the models
silently drop now fails a test. It also refuses a fixture holding any real
value, and refuses a fixture that no test reads.

`seed_sample_data.rs` fills a disposable instance with one row of each kind
and `capture_shapes.rs` captures the shapes back out with GET requests only,
so the set can be refreshed when a divergence turns up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-24 21:56:17 -04:00

124 lines
2.9 KiB
JSON

{
"data": [
{
"amount": 0,
"archived_at": 0,
"assigned_user_id": "",
"balance": 0,
"client_id": "",
"created_at": 0,
"custom_surcharge1": 0,
"custom_surcharge2": 0,
"custom_surcharge3": 0,
"custom_surcharge4": 0,
"custom_surcharge_tax1": false,
"custom_surcharge_tax2": false,
"custom_surcharge_tax3": false,
"custom_surcharge_tax4": false,
"custom_value1": "",
"custom_value2": "",
"custom_value3": "",
"custom_value4": "",
"date": "",
"design_id": "",
"discount": 0,
"documents": [],
"due_date": "",
"e_invoice": {},
"entity_type": "",
"exchange_rate": 0,
"footer": "",
"has_expenses": false,
"has_tasks": false,
"id": "",
"invitations": [
{
"archived_at": 0,
"can_sign": false,
"client_contact_id": "",
"created_at": 0,
"email_error": "",
"email_status": "",
"id": "",
"key": "",
"link": "",
"message_id": "",
"opened_date": "",
"sent_date": "",
"updated_at": 0,
"viewed_date": ""
}
],
"invoice_id": "",
"is_amount_discount": false,
"is_deleted": false,
"last_sent_date": "",
"line_items": [
{
"cost": 0,
"custom_value1": "",
"custom_value2": "",
"custom_value3": "",
"custom_value4": "",
"date": "",
"discount": 0,
"expense_id": "",
"gross_line_total": 0,
"income_account_id": "",
"is_amount_discount": false,
"line_total": 0,
"net_cost": 0,
"notes": "",
"product_cost": 0,
"product_key": "",
"quantity": 0,
"sort_id": "",
"tags": "",
"task_id": "",
"tax_amount": 0,
"tax_id": "",
"tax_name1": "",
"tax_name2": "",
"tax_name3": "",
"tax_rate1": 0,
"tax_rate2": 0,
"tax_rate3": 0,
"type_id": "",
"unit_code": ""
}
],
"location_id": "",
"next_send_date": "",
"number": "",
"paid_to_date": 0,
"partial": 0,
"partial_due_date": "",
"po_number": "",
"private_notes": "",
"project_id": "",
"public_notes": "",
"reminder1_sent": "",
"reminder2_sent": "",
"reminder3_sent": "",
"reminder_last_sent": "",
"status_id": "",
"subscription_id": "",
"sync": null,
"tags": [],
"tax_info": {},
"tax_name1": "",
"tax_name2": "",
"tax_name3": "",
"tax_rate1": 0,
"tax_rate2": 0,
"tax_rate3": 0,
"terms": "",
"total_taxes": 0,
"updated_at": 0,
"user_id": "",
"uses_inclusive_taxes": false,
"vendor_id": ""
}
]
}