feat(admin): order management
Sprint 23. New features/admin/orders/ module, same container/facade/service split as admin/products and admin/categories. - AdminOrder model + AdminOrdersLocalGateway seeding 24 deterministic synthetic orders (no real order data source exists anywhere in this repo - explicitly a placeholder, not a mock of production volume) - list: search, status filter, pagination, CSV export (client-side Blob download) - detail: customer/payment/shipping, itemized total, status timeline, change-status dropdown, refund request + cancel (window.confirm-gated), separate customer-facing vs internal notes, print invoice via window.print() with @media print hiding non-invoice chrome - wired into /:lang/backoffice/orders(/:id), replacing the coming-soon placeholder docs/ADMIN.md + docs/BACKEND.md updated; dashboard's Orders/Revenue cards (Sprint 19) remain intentionally un-wired to this mock and still render pending-backend. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -291,6 +291,29 @@ implementation) + `features/backoffice/media/` + the shared
|
||||
API and rebinding the provider; no consumer (`MediaLibraryFacade`,
|
||||
`MediaPickerComponent`, or any of the pickers above) changes.
|
||||
|
||||
## Sprint 23 - Orders (mock/local)
|
||||
|
||||
`features/admin/orders/` (model/gateway/facade/pages), same
|
||||
container/facade/service split as the rest of `admin/*`:
|
||||
|
||||
- **No real data source exists for orders anywhere in this repo** (already
|
||||
called out in Sprint 19's dashboard gap and `docs/BACKEND.md` item 7) -
|
||||
`AdminOrdersLocalGateway` seeds 24 deterministic synthetic orders in
|
||||
memory (cycling through all statuses/customers) rather than reading from
|
||||
`BackofficeDataService`, since there is nothing there to read. This is
|
||||
explicitly a placeholder to unblock the admin UI, not a real mock of
|
||||
production order volume.
|
||||
- List: search (order number/customer/email), status filter, pagination,
|
||||
CSV export (client-side `Blob` download, no server round-trip).
|
||||
- Detail: customer/payment/shipping info, itemized line items + total,
|
||||
status timeline, change-status dropdown, refund request and cancel
|
||||
(both `window.confirm`-gated), customer-visible notes vs internal-only
|
||||
notes (two separate free-text logs), print invoice via `window.print()`
|
||||
with a `@media print` rule hiding all non-invoice chrome (`.no-print`) -
|
||||
no PDF generation library, deliberately minimal.
|
||||
- Wired into `/:lang/backoffice/orders` and `/:lang/backoffice/orders/:id`,
|
||||
replacing the coming-soon placeholder.
|
||||
|
||||
## Known gaps / backend needs
|
||||
|
||||
- **Dashboard metrics endpoint.** Categories/Products counts are computed
|
||||
|
||||
@@ -91,13 +91,13 @@ Backend must also support content moderation/validation on publish (disallow dan
|
||||
|
||||
**Frontend files:** implement `AdminProductsApiGateway` alongside the existing `AdminProductsLocalGateway` and rebind the injection token — `features/admin/products/pages/*` and the facade do not change.
|
||||
|
||||
## 7. Orders / revenue (does not exist at all)
|
||||
## 7. Orders / revenue
|
||||
|
||||
**Current behavior:** no backend or local data model for orders or revenue exists anywhere in the codebase. `features/backoffice/orders` is an empty placeholder. The Admin Dashboard's Orders and Revenue cards intentionally render a `pending-backend` state ("Awaiting backend integration") rather than fabricated numbers or a generic empty state.
|
||||
**Current behavior (Sprint 23):** `features/admin/orders/` now exists as an admin CRUD-ish surface (list/detail, status changes, refund request, cancel, notes, CSV export, print invoice) but runs entirely against `AdminOrdersLocalGateway`, which fabricates 24 synthetic in-memory orders — there is still no real order data anywhere in this system. The dashboard's Orders/Revenue cards (Sprint 19) still correctly render `pending-backend` rather than reading from this mock (they're intentionally not wired to it — the mock is order-management scaffolding, not a real metrics source).
|
||||
|
||||
**Needed:** an order domain (creation, lifecycle, line items, totals) and revenue aggregation, plus endpoints to back a dashboard summary (see item 8) and an admin orders list/detail UI.
|
||||
**Needed:** a real order domain — `AdminOrder` shape is in `src/app/features/admin/orders/models/admin-order.model.ts`. At minimum: order CRUD, status transitions with a timeline/audit trail, payment status, refund workflow, and a revenue aggregation endpoint for the dashboard cards.
|
||||
|
||||
**Frontend files:** `features/admin/dashboard/facade/admin-dashboard.facade.ts` (card status computation), a new `features/admin/orders/` module once the domain exists.
|
||||
**Frontend files:** implement `AdminOrdersApiGateway` against `AdminOrdersGateway` (`services/admin-orders-gateway.interface.ts`) and rebind via an injection token — facade and pages don't change.
|
||||
|
||||
## 8. Dashboard metrics
|
||||
|
||||
|
||||
@@ -40,10 +40,11 @@ Notify user: **from Sprint 20 (Categories) once product↔category link + admin
|
||||
- Commit: `feat(media): reusable media management`
|
||||
- Scoped down from ticket: no interactive crop UI (compression/resize only); folders are a flat tag, not a real folder entity/hierarchy.
|
||||
|
||||
## Sprint 23 — Orders (mock/local, flag backend gap)
|
||||
- [ ] Orders model + local gateway (seed mock data)
|
||||
- [ ] List: filters, search, statuses, timeline, export
|
||||
- [ ] Detail: customer/payment/shipping info, notes/internal notes, refund request, cancel, print invoice
|
||||
## Sprint 23 — Orders (mock/local, flag backend gap) ✅ done
|
||||
- [x] AdminOrder model + local gateway (24 seeded synthetic orders, no real data source existed)
|
||||
- [x] List: search, status filter, pagination, CSV export
|
||||
- [x] Detail: customer/payment/shipping, itemized total, status timeline, change-status, refund request + cancel (confirm-gated), customer notes + internal notes, print invoice (window.print + @media print)
|
||||
- [x] `docs/ADMIN.md` (new Sprint 23 section), `docs/BACKEND.md` item 7 rewritten
|
||||
- Commit: `feat(admin): order management`
|
||||
|
||||
## Sprint 24 — Transactions (mock/local)
|
||||
|
||||
Reference in New Issue
Block a user