Fix API Error before M5

This commit is contained in:
Nông Đức Huy
2026-08-13 23:20:23 +07:00
parent d5cacc1208
commit 7688657d3c
13 changed files with 315 additions and 36 deletions
+12 -5
View File
@@ -269,13 +269,13 @@ the variant model under real concurrency.
Everything below was run, not assumed:
- `pnpm lint` · `pnpm typecheck` · `pnpm test` · `pnpm build` — 26/26 Turborepo tasks pass;
- `pnpm lint` · `pnpm typecheck` · `pnpm test` · `pnpm build` — 27/27 Turborepo tasks pass;
`pnpm format:check` clean
- 5 migrations, 32 tables; seed loads 36 permissions, 6 roles, 3 brands, 8 categories,
- 6 migrations, 32 tables; seed loads 36 permissions, 6 roles, 3 brands, 8 categories,
3 collections, 12 products, **155 variants**, 64 uploaded images and 3 dev accounts
- **44 tests** — RBAC guards, password hashing, translation fallback, `Accept-Language`, the
variant matrix planner, the HTTP client's fetch receiver and retry recursion, and the inventory
list's variant-driven projection
- **48 tests** — RBAC guards, password hashing, translation fallback, `Accept-Language`, the
variant matrix planner, the HTTP client's fetch receiver and retry recursion, the inventory
list's variant-driven projection, and the two admin-schema defects that caused silent data loss
- Catalog: listings with filters/facets/cursor paging, PDP, navigation — correctly localised in
both `vi` and `en`; money formats per locale from one integer (`690.000 ₫` / `₫690,000`)
- Storefront: every route 200 in both locales; `/en/products/<vi-slug>` → 307 →
@@ -303,6 +303,13 @@ through Chrome with the console and network panel open:
media library upload driven from the browser (presign → PUT to MinIO → register, 400×500 PNG
landed at 10,962 bytes with a date-partitioned UUID key); inventory adjustment from the table
wrote a ledger entry and the storefront went `OUT_OF_STOCK` → `IN_STOCK` on the next request
- **Catalog write correctness**, each reproduced before the fix and re-run after: a product
authored in one language is accepted; renaming a product no longer clears its gender/sport
targeting, collections or attributes; adding a size inherits the sibling price and the stored
SKU prefix (`VEL-NOC-BLACK-S` at 1.590.000 ₫, not `AO-GIO-…-S` at 0 ₫); a sale price above the
regular price is rejected; two products with the same name get distinct per-locale slugs; a
retired colourway leaves both the filter and the facet count; 404s no longer write junk keys
into Redis
- **Listing controls (M4):** sort menu changes the order and the URL together
(`?sort=price_asc`), and is shareable; "load more" appends the next page in place without
touching the address bar, updates "showing N of M", and disappears when the set is exhausted;