Repository navigation
Dev hung - #48
Dev hung#48
Conversation
…ep drafts out of the order list The cart is the server Draft order, and it used to adopt whichever draft came back first — a cart abandoned last week reappeared as if the buyer had left it there minutes ago, priced against a session that has since closed. A draft is now adopted only when its creation date is the current session's trading day (Asia/Ho_Chi_Minh, off the session's closesAt) and that session is still open. No session in view falls back to the newest draft, so a buyer who has not picked a market is not left with an empty cart. The same drafts were also sitting in the buyer's order history: "all" sends no status filter, so the server returns them with everything else. The API has no "except this status" filter and the grouped path crawls every page, so "all" drops drafts from the page it renders and subtracts their count from the total — the pager then stops offering a last page that comes back empty. The trade-off is a page shorter than 20 when the buyer holds drafts. Backend untouched. Note: this slice carries in-flight work already in the tree for the cart, checkout, order tabs and the realtime services these files import — they do not compile apart. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…i.json
Picks up what the backend has added since the last generate: the
`GET /admin/order-groups/{batchId}` detail endpoint, `proofImageUrl` on
`FileClaimRequest`, and `UpdateDraftOrderRequest`, plus the invoices and
claims operations the generator had not seen.
Generated output only — `npm run generate:api`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… the raw client Four things, all in the admin console. **Staff panel.** Who counts as "already assigned" was read off the chợ's whole roster, whatever the role. But a hub-scoped role is assigned to *one* hub — `hub_staff_assignments` is keyed on `(hub_id, user_id)`, so one person may work several. Judging a hub pick by the chợ meant everyone already on the first hub showed as taken, and a chợ's second hub could not be staffed with any of them. The check now reads the selected hub's own roster, changing the hub reloads the candidate list, and picks made against the previous hub are dropped rather than carried over. **Hub-day.** A `DateOnly` parameter is serialised by the generated client as `toISOString().substring(0, 10)`, which is UTC. A `Date` built from local *now* therefore names the previous day anywhere east of Greenwich: before 07:00 in Hanoi the procurement plan asked the hub about yesterday. The day is now chosen in `Asia/Ho_Chi_Minh` and pinned to UTC midnight, which survives the conversion. **Generated client.** `getOrderGroup` and `fileClaim` used `rawApi.send` because the endpoints postdated the checked-in `openapi.json`. They no longer do, so both move onto `adminApi` / `claimsApi` — `proofImageUrl` is now part of `FileClaimRequest`, and the serialiser carries it instead of stripping it as an unknown field. The 404 fallback in `getOrderGroup` stays for older backends. **Restaurants list.** The approve and account-toggle columns come off the table; the approval pill is what reads that rule now. Their tests go with them, and the `isApproved` fallback is re-asserted through `approvalKey`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…n the glyph **Live over SignalR.** `@microsoft/signalr` joins the deps, and the catalog grid and the notification bell hold a connection for as long as they are on screen. A `PriceUpdated` broadcast patches the listing in place — price and stock on hand only, never availability, which the pricing hub does not know: overwriting it with stock-on-hand would quietly offer more than can be ordered. The bell still does its first read, since the hub replays nothing, and re-asks on sign-in because a guest's `connect()` is a no-op. `getValidAccessToken` refreshes an expired token *before* handing it out. HTTP does not need this — the 401 middleware refreshes and retries — but a SignalR negotiate has no second chance, and the client reuses whatever the factory returned for every reconnect, so an expired token would fail until a reload. **Aisle counts.** The landing board counted the whole catalogue through `GET /products`, which is `[Authorize]`-only. A signed-out visitor got 401, every count fell to zero, and the board on the front page of a deliberately open storefront reported no aisles at all. It now counts the selected chợ's own listings through the anonymous market endpoint — the honest number anyway, since a buyer walking into "Thuỷ sản" gets what this chợ sells today — and re-counts when the market changes. No extra request: it reduces the listing already cached. **Badges.** The hand-rolled count spans on the cart, favourites and bell become Material `matBadge`, placed on the icon rather than the button: a `mat-icon-button` is a 48px target around a 24px glyph, so a badge pinned to the button's corner floats away from what it counts. The pop animation follows. **Images** move to `public/images/pages/`, out of the shared background folder. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…art need Both bundles, en and vi: - `orders.tabs.processing` / `awaiting` / `delivered` / `cancelled`, and `orders.tabs.all` widened to "All statuses" — the buyer's list is indexed by stage now, not by each of the eight statuses an order passes through. - `cart.overStock`, for the line the cart shows when it has taken all there is. - `admin.markets.staff.alreadyOnHub`, so a hub-scoped pick says "already on this hub" rather than claiming the person is already on the chợ. The first two belong to work committed earlier in this branch; the keys land here because they share a file with the third. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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.