- Updated proforma listing behavior to utilize `Criteria filters[]` for managing archived and active proformas. - Removed `archived` query parameter from backend; frontend now manages `archiveView` state. - Implemented new filters for `archived_at` and `status` in the proforma listing API. - Adjusted proforma creation and deletion contracts to reflect changes in archiving logic. - Introduced new utility functions for building proforma listing criteria based on UI state. - Updated frontend components to support new filtering options and maintain state in the URL. - Added SQL index for improved performance on proforma queries. - Created new TypeScript types for managing proforma list filters and criteria.
1.2 KiB
1.2 KiB
Proforma List Contract
UI model
- frontend keeps
archiveView=active|archived|allas semantic UI state - frontend keeps
status=all|draft|sent|approved|rejected|issued archiveViewis not a backend query param
Backend contract
GET /proformas stays based on Criteria:
qpageNumberpageSizeorderByorderfilters[]
Allowed filters
archived_at IS_NULLarchived_at IS_NOT_NULLstatus EQUALS draft|sent|approved|rejected|issued
Scope rules
- active view ->
archived_at IS_NULL - archived view ->
archived_at IS_NOT_NULL - all view -> no
archived_atfilter - status
all-> nostatusfilter - any concrete status ->
status EQUALS <value> qapplies after the scope is defined byfilters[]
Resource visibility
GET /proformasdefaults to active scopeGET /proformas/:idreturns archived proformas too- soft-deleted proformas never appear in list results
- soft-deleted proformas are treated as non-existent by
GET /proformas/:id
Frontend persistence
- URL stores
archiveView - URL stores
status - URL stores
q localStorage["proformas:list:grid"]keeps only table preferences