Add approved invoice status with lock after customer acceptance.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-07-28 11:54:16 +03:30
co-authored by Cursor
parent 9455cd9fab
commit 7244b70e90
7 changed files with 241 additions and 6 deletions
+5 -4
View File
@@ -174,7 +174,7 @@ Docker mounts `./database/migrations` into Postgres init — migrations run auto
| `OrderStatus` | `pending`, `confirmed`, `processing`, `shipped`, `delivered`, `cancelled` |
| `OrderSource` | `website`, `admin` |
| `InvoiceOwnerScope` | `platform`, `business` |
| `InvoiceStatus` | `draft`, `issued`, `paid`, `cancelled` |
| `InvoiceStatus` | `draft`, `issued`, `approved`, `paid`, `cancelled` |
| `TechnicalFieldType` | `text`, `textarea`, `select`, `multi_select` |
| `MediaType` | `image`, `video` |
@@ -588,8 +588,9 @@ Super admins issue invoices **to** a business. Schema is ready for future busine
| GET/POST | `/invoice-templates` |
| GET/PATCH/DELETE | `/invoice-templates/:templateId` |
| GET/POST | `/businesses/:businessId/invoices` |
| GET/PATCH/DELETE | `/businesses/:businessId/invoices/:invoiceId` |
| GET | `/public/invoices/:publicId` (no auth; issued/paid only; opaque 12-digit id) |
| GET/PUT/PATCH/DELETE | `/businesses/:businessId/invoices/:invoiceId` (PUT = content; PATCH = status; content locked when `approved`) |
| GET | `/public/invoices/:publicId` (no auth; issued/approved/paid; opaque 12-digit id) |
| POST | `/public/invoices/:publicId/approve` (no auth; `issued``approved`) |
Auth (admin routes): `JwtAuthGuard` + service `assertSuperAdmin`.
@@ -599,7 +600,7 @@ Public HTML viewer lives in the dashboards super-admin SPA (`/invoices/:publicId
Permissions seeded for future business dashboard: `invoices.*`, `invoice_templates.*`.
Module: `src/invoices/` · Migrations: `036``040`
Module: `src/invoices/` · Migrations: `036``041`
---