Feature/admin - #29
Conversation
…I spec Regenerated by hand (Docker unavailable) against the current live swagger.json: drops page/pageSize from endpoints the backend no longer paginates (Categories, Markets, DeliveryZones, Units), adds the new required marketId on hub create/update, packingCodeId on products, deliveryWindowDays on operational settings, and wires the new RestaurantFavorites + tax-profile client methods. Removes the now-dead HandoverRequest model. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Catalog now fetches all products across every market once and joins price/quantity from each market's listing, replacing the old price-less /products view; adds a heart toggle wired to the real favorites API, and a tax-profile form on the restaurant onboarding flow. Updates the admin console (hubs, markets, delivery zones, products, units, operational settings) for the pagination/field changes from the API spec sync. Deletes the dead Fuse catalog mock-api scaffold that nothing referenced. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ry addresses; restructure profile into tabs Wires the remaining restaurant-role backend APIs that had no UI: - Orders: checkout now creates and confirms a real order instead of a local-only demo cart; new order history/detail pages with cancel and reorder; the header's order-tracking widget shows the real latest order. - Credit: balance, statements (with PDF download), and transaction ledger. - Invoices: list and detail, rendered generically since the backend declares no response schema. - Notifications: header panel now backed by the real list/mark-read API (no delete or mark-all — the backend doesn't support them). - Delivery addresses: add/edit/delete on the profile page. Restructures `/profile` into a single tabbed area (detail info+credit / order history / invoices) reachable from the header's account menu, and opens it to every role — non-restaurant users get a basic account-info editor instead of the restaurant-specific forms. Removes the now-redundant sidebar nav entries. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add cross-dock, outbound, procurement plan, and orders-by-restaurant read-only views to hub oversight, plus sorting progress on route detail; add a demand heatmap chart to the analytics dashboard. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Retire mock-api and unused Fuse layouts so the shell stays dense+enterprise. Add vận hành/quản trị console switch and local shortcuts. Co-authored-by: Cursor <cursoragent@cursor.com>
…data Header icons get short functional micro-motion per MOTION.md: hover/focus scale on every trigger, a one-shot bell nudge when unread notifications increase, and a pop on the favorites badge when an item is added. Shared styles live in header-icon-motion.scss and are disabled under prefers-reduced-motion. The nudge is opt-in (`microMotion`) so only the storefront header animates, not the admin shell. Branch picker is replaced by a market picker backed by MarketSelectionService; it is mirrored into the mobile header because the desktop top strip is not rendered there and the catalog needs a market to load anything. Catalog, cart, favorites and draft order now read the real API — the demo-data modules and the mocked AI chat reply are gone. Adds theme color tokens plus a contrast check wired into precheck.
Share enterprise layout on /catalog with logo-market grid, sticky logo-primary pin, and pin/route logo motion. Extract header strip, nav row, footer, and quick-buy; fix nav embedded() always-true signal bug. Co-authored-by: Cursor <cursoragent@cursor.com>
…ant modules - Redesign storefront footer (store logos, logo-full) and catalog page (category tree, infinite scroll grid, standalone product card) - Add restaurant onboarding wizard, dashboard, scheduled orders, setup modules - Regenerate API contract (adds Shipping/PackingCodes, drops DeliveryZones) - Rework admin logistics (routes/vehicles) off the removed delivery-zones API - Drop legacy splash-screen animation modules; simplify constants - Update i18n (vi/en) for footer, catalog, and product card strings Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Pre-commit hook's lint-staged auto-fix ran but lost the re-stage race against a concurrent git process; committing the formatted result. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
No restaurant could place an order. `POST /orders/{id}/confirm` requires a
`deliveryAddressId` body, but the snapshot in `src/contract/openapi.json`
predates it and declares no request body — so the generated client sent none
and the backend answered 415 / `'Delivery Address Id' must not be empty`.
Every checkout created a draft it could never confirm, which is why the
restaurant order list filled with drafts and auto-batching kept reporting
`no_eligible_orders`. Confirm and confirm-preview now go through `rawApi`
with the address.
Order API usage audited against the live backend:
- `confirm-preview` matched on none of the real field names. `wouldSucceed`,
`issues` and `remainingCreditAfter` were absent from the alias lists, so
the verdict always fell through to the tolerant `true` default: the gate
never fired and refusal reasons never reached the buyer. Parser extracted
to `orders/confirm-preview.ts`.
- The preview also prices delivery (`subtotalAmount` / `deliveryFee` /
`deliveryDistanceKm` / `vatAmount`), but only when given the address —
without it the route 404s. Checkout now shows the server's own breakdown
instead of an invented 8% VAT and a coupon box with no API behind it, so
the payable matches what is charged to credit (BR-CRE-1).
- `ordering-window` returns `deliveryWindowDays`; the picker hardcoded 7.
- A blocked attempt reused its draft instead of creating a new one per retry.
Admin ▸ order groups: the auto-batch result matched none of the response
either (`batchesCreated` / `ordersBatched` / `itemsAggregated` / `skipped` /
`reason` / `preview`), so the banner showed three zeroes, no reason, and
labelled a dry run "applied". A skipped run now explains itself.
Restaurant approval: `/restaurants/me/approval-status` answers the lifecycle
vocabulary `pending | active | suspended`, not `approved`, so every approved
restaurant fell through to the pending fallback and stayed gated. Mapped once
in `toApprovalStatus`. The approve action itself was gated on `isActive`,
which the API reports as `true` for every restaurant including pending ones,
so "Duyệt" never rendered — it now keys off `restaurantStatus` and is
available from the list as well as the detail page.
Credit limits were unreachable for the same class of reason: the snapshot
always reads back `creditLimit: 0`, which the card treated as "already
configured". `getRestaurantCredit` also skipped `unwrapData`, so every field
read as undefined.
Delivery windows are now one list shared by `/profile/business` (where the
restaurant declares its receiving hours) and `/checkout` (which offers only
those hours, preselecting the window the last order used).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 379 files, which is 279 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (176)
📒 Files selected for processing (379)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review Could Not Complete
|
| Options | Enabled |
|---|---|
| Bug | ✅ |
| Performance | ✅ |
| Security | ✅ |
| Business Logic | ✅ |
No description provided.