Uecko_ERP/docs/customer-invoices/proforma-archive-contract.md
2026-07-29 14:40:59 +02:00

34 lines
1.2 KiB
Markdown

# Proforma archive contract
## Rules
- Archive uses `archived_at` and does not change `status`.
- Only `draft` and `rejected` proformas can be archived in V1.
- Only `draft` and `rejected` archived proformas can be unarchived in V1.
- Archived proformas remain available through `GET /proformas/:id`.
- Deleted proformas remain excluded from every flow.
- Numbering is never reused and `document_series.next_number` is untouched.
## Endpoints
- `PATCH /proformas/:proforma_id/archive`
- `PATCH /proformas/:proforma_id/unarchive`
Both endpoints:
- return `200` with the updated proforma snapshot
- return `404` when the proforma does not exist, belongs to another company, or is deleted
- return `409` when the state is not allowed, when the proforma is already archived/non-archived, or when it is linked to an issued invoice
## Listing behavior
- `GET /proformas` excludes archived proformas by default
- `GET /proformas?archived=false` lists only active proformas
- `GET /proformas?archived=true` lists only archived proformas
## Notes
- `archived` is a visibility dimension, not a business status
- V1 does not support archiving `sent`, `approved`, or `issued`
- V1 does not add `archived_by` or `archive_reason`