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>
60 lines
1.4 KiB
JSON
60 lines
1.4 KiB
JSON
{
|
|
"data": [
|
|
{
|
|
"amount": 0,
|
|
"archived_at": 0,
|
|
"assigned_user_id": "",
|
|
"bank_id": "",
|
|
"calculate_tax_by_amount": false,
|
|
"category_id": "",
|
|
"client_id": "",
|
|
"created_at": 0,
|
|
"currency_id": "",
|
|
"custom_value1": "",
|
|
"custom_value2": "",
|
|
"custom_value3": "",
|
|
"custom_value4": "",
|
|
"date": "",
|
|
"documents": [],
|
|
"entity_type": "",
|
|
"exchange_rate": 0,
|
|
"foreign_amount": 0,
|
|
"frequency_id": "",
|
|
"id": "",
|
|
"invoice_currency_id": "",
|
|
"invoice_documents": false,
|
|
"invoice_id": "",
|
|
"is_deleted": false,
|
|
"last_sent_date": "",
|
|
"next_send_date": "",
|
|
"number": "",
|
|
"payment_date": "",
|
|
"payment_type_id": "",
|
|
"private_notes": "",
|
|
"project_id": "",
|
|
"public_notes": "",
|
|
"recurring_dates": [],
|
|
"recurring_expense_currency_id": "",
|
|
"remaining_cycles": 0,
|
|
"should_be_invoiced": false,
|
|
"status_id": "",
|
|
"tags": [],
|
|
"tax_amount1": 0,
|
|
"tax_amount2": 0,
|
|
"tax_amount3": 0,
|
|
"tax_name1": "",
|
|
"tax_name2": "",
|
|
"tax_name3": "",
|
|
"tax_rate1": 0,
|
|
"tax_rate2": 0,
|
|
"tax_rate3": 0,
|
|
"transaction_id": "",
|
|
"transaction_reference": "",
|
|
"updated_at": 0,
|
|
"user_id": "",
|
|
"uses_inclusive_taxes": false,
|
|
"vendor_id": ""
|
|
}
|
|
]
|
|
}
|