# Freshyo full regression run — test-case catalog execution **Run ID:** FR-2026-10-18-01 **Date started:** 2026-10-18 11:11 IST (05:41 UTC) **Database:** throwaway/staging Postgres `meatfarmer` @ `57.128.212.174:7447` (schema `mf`) — disposable, freely mutable during this run. **Backend:** `http://localhost:8787` (wrangler dev, `wrangler.dev.toml`, verified live) **Clients under test:** - Customer mobile (Expo Go): `host.exp.Exponent` ← Metro `:8081` (`apps/user-ui`) - Admin mobile (Expo Go): `host.exp.Exponent` ← Metro `:8082` (`apps/admin-ui`) - Customer web: Chromium `http://localhost:4174` - Superadmin web: Chromium `http://localhost:4176` (`apps/superadmin-ui`; note `:4175` is a stale sandbox copy) - iOS simulator (booted): `iphone_6.5_in` / iOS 18.6 — `5A64695E-F4D4-4E2E-90F3-EC3493A2B457` **Method:** per the catalog README — happy paths via Maestro UI on Expo Go; persistence/security via direct tRPC probes and authoritative `mf.*` Postgres reads. See `docs/maestro-mcp-agent-guidelines.md`. ## Identities used | Alias | Identity | Source | |---|---|---| | anon | no token | — | | U1 | customer id 1, mobile `9676651496`, `meatfarmer@123` | existing | | U2 | customer id 1327, `e2e_u2b@test.com` / `9000000002`, `Test@12345` | registered this run | | U0 | customer id 1328, throwaway email, `Test@12345` | registered this run | | staffA | `e2eadminA` / `Test@12345` (region 1) | existing | | staffB | `e2eadminB` / `Test@12345` (region 2) | existing | | SA | `superadmin` / `superadmiN123` | existing | ## Progress log - 11:11 IST — environment verified (backend 8787, Metro 8081/8082, web 4174/4176, sim `5A64695E…`); identities established; report opened. DB-access limitation discovered (live D1 state not readable from this shell) — API probes used as authoritative evidence. - 11:20 — Maestro MCP wedged ("Device became unreachable"); MCP process restarted; CLI driver used as fallback; MCP used afterwards. - 11:24–11:50 — customer app E2E in Expo Go (login wall → cart → COD order #2560 → cancel → order history) + admin app (session, orders, fulfilment). - 11:50–13:10 — API sweeps: security matrix, auth, regions/bounds/constants/location/addresses, cart/slots/checkout/pricing/flash, coupons, orders/cancellation, complaints/incidents/notifications/uploads/jobs, staff/profile, catalogue CRUD, cache. - ~13:15 — report finalised. ## Status summary 855 catalogued cases. **Executed with evidence: 249** (PASS 176 · FAIL 34 · PARTIAL/BLOCKED/INCONCLUSIVE 22 · N/A 17). **Not run: ~606.** | Checklist | Cases | PASS | FAIL | PARTIAL/BLOCKED | N/A | NOT RUN | |---|---|---|---|---|---|---| | authorization-api-contracts | 28 | 12 | 7 | 4 | 0 | 5 | | customer-authentication | 18 | 11 | 4 | 1 | 1 | 1 | | regions | 16 | 8 | 2 | 4 | 0 | 2 | | bounds | 18 | 8 | 1 | 2 | 0 | 7 | | constants-configuration | 18 | 10 | 3 | 2 | 0 | 3 | | location-region-switching | 25 | 8 | 0 | 0 | 0 | 17 | | addresses | 25 | 12 | 3 | 2 | 0 | 8 | | cart | 23 | 3 | 1 | 1 | 0 | 18 | | scheduled-slots | 20 | 3 | 0 | 0 | 0 | 17 | | checkout | 22 | 8 | 1 | 0 | 0 | 13 | | pricing-delivery-fees | 22 | 6 | 0 | 0 | 0 | 16 | | flash-delivery | 16 | 3 | 0 | 0 | 0 | 13 | | coupon-management | 21 | 6 | 3 | 1 | 0 | 11 | | coupon-application | 28 | 8 | 0 | 0 | 0 | 20 | | coupon-stacking-and-cart-guards | 47 | 0 | 0 | 0 | 0 | 47 | | reserved-coupons | 18 | 3 | 0 | 0 | 0 | 15 | | orders | 22 | 6 | 2 | 1 | 1 | 12 | | cancellation | 18 | 3 | 2 | 1 | 0 | 12 | | fulfillment | 16 | 2 | 0 | 1 | 0 | 13 | | order-edits-rebalance | 18 | 0 | 0 | 0 | 0 | 18 | | delivery-operations | 14 | 0 | 0 | 0 | 0 | 14 | | complaints | 16 | 4 | 1 | 0 | 0 | 11 | | customer-management-incidents | 17 | 3 | 2 | 0 | 0 | 12 | | notifications | 19 | 2 | 1 | 0 | 0 | 16 | | uploads-images | 20 | 4 | 1 | 0 | 0 | 15 | | jobs-health | 15 | 2 | 0 | 0 | 0 | 13 | | staff-authentication | 15 | 3 | 0 | 0 | 0 | 12 | | staff-management | 14 | 5 | 0 | 0 | 0 | 9 | | profile-account-lifecycle | 16 | 3 | 0 | 0 | 0 | 13 | | regional-stores | 15 | 4 | 0 | 0 | 0 | 11 | | global-stores | 15 | 1 | 0 | 0 | 0 | 14 | | regional-products | 20 | 5 | 0 | 0 | 0 | 15 | | global-products | 21 | 4 | 0 | 0 | 0 | 17 | | combos | 16 | 1 | 0 | 0 | 0 | 15 | | catalog-search | 18 | 0 | 0 | 0 | 0 | 18 | | product-tags-ordering | 16 | 3 | 0 | 0 | 0 | 13 | | product-groups | 14 | 3 | 0 | 0 | 0 | 11 | | banners | 14 | 4 | 0 | 0 | 0 | 10 | | reviews | 12 | 2 | 0 | 0 | 0 | 10 | | vendor-snippets | 15 | 3 | 0 | 0 | 0 | 12 | | cache-publication | 23 | 3 | 0 | 0 | 0 | 20 | | fallback-legacy-pages | 14 | 0 | 0 | 0 | 0 | 14 | | otp-authentication | 15 | 0 | 0 | 0 | 15 | 0 | | recovery-platform-accessibility | 22 | 0 | 0 | 0 | 0 | 22 | ## P0 defects found (blockers for a release decision) 1. **Customer privilege escalation on admin procedures** — a customer JWT reads the staff list/roles and can **suspend any user**; `admin.user.sendNotification` is reachable and broadcasts to all users when `userIds` is empty. ~30 admin procedures use `protectedProcedure` instead of `staffProcedure` (SEC-01/28, CUSTOPS-05, NOTIF-19). 2. **Suspension is not enforced** — `createContext` assigns `user` before the suspension check and the catch does not clear it; suspended users keep full API access and can log in (CUSTOPS-04). Order placement is the only blocked path (ORDER-06). 3. **JWT secret committed** in `wrangler.dev.toml`/`wrangler.prod.toml` with a weak value → offline minting of any staff/superadmin token (SEC-06). 4. **No quantity/inventory bound on orders** — `quantity:1e9` created a ₹235,000,000,000 order (CART-16 / ORDER-04). 5. **Coupon type switch keeps the old discount** — percent stays and still applies after a flat switch (CPM-21). 6. **Cross-user complaint** — U2 can raise a complaint against U1's order (COMPLAINT-02). 7. **Non-finite/negative money accepted** — negative and 1e308 prices, negative/150% coupons (STOCK-12, CFG-08, CPM-06). 8. **Business rejections surface as HTTP 500** with stack traces, not actionable 4xx (SEC-15/22 and throughout). 9. **Unknown/foreign keys accepted** — `superadmin.const.updateGlobalConstants` has no whitelist; `tagsOrder` accepts garbage SKU ids; `tagsOrder`/`updateBoundSettings` scope checks are otherwise good (CFG-13, CFG-17, SEC-13). ## Fixtures created during the run (throwaway DB) Regions 4–8 (`E2E Region…`, `E2E Sole…`, `E2E Race…`) — **region deletion is unsupported**, so these remain; none overlaps the Mahabubnagar GPS polygon. Store 11 (soft-deleted products keep it undeletable), tag 11, group 14 (deleted), banner 14 (deleted), global store 12 (deleted), product 156/157 (deleted), customer U2 (+addresses), several `E2E…` coupons (invalidated), reserved secrets (redeemed), orders 2560–2581 (mostly cancelled). Global `versionNum`/region-1 `supportMobile`/bound-2 settings were reverted; the stray `__e2e_unknown_key__` global const was nulled. --- ## 1. Security / authorization matrix (`authorization-api-contracts.md`, 28 cases) Probe method: direct tRPC calls with anon / U1 / U2 / staffA / staffB / superadmin tokens, plus forged JWTs (HS256 signed with the repo's `JWT_SECRET`). Live D1 state was not readable from this host (see "DB access" note below), so persistence assertions use API reads. | Case | Status | Evidence | |---|---|---| | SEC-01 Anonymous/customer calls admin/superadmin mutations | **FAIL (P0)** | Anon → 401 for every admin/superadmin mutation (good). But a **customer token reaches the resolver** on `protectedProcedure`-based admin mutations. Actual unauthorised write proven: U1 called `admin.user.updateUserSuspension` and suspended user 1327 (200 `User suspended successfully`), then unsuspended. (Reverted.) | | SEC-02 Regional staff calls superadmin procedures | PASS | staffA/staffB → 401 on `superadmin.regions.create`, `staff.create`, `const.updateGlobalConstants`, `const.updateLegacyConstants`, `globalProducts/globalStores/globalCoupons.create`, `regions.deleteBound`, `const.getGlobalConstants`. | | SEC-03 Staff B probes A ids | PASS (mostly) | staffB (region 2) → 404 for region-1 product 30, store 2, slot 2072; `banner.getBanner` 13 → `null`; `getGroups`/`getProductTags` → empty. Writes blocked: toggleOutOfStock/deleteProduct/deleteStore/updateBanner/updateSlotCapacity → 404. Minor: `order.getOrderDetails` and `coupon.delete` return **500** "not found" instead of 404. | | SEC-04 Save with foreign ids | PASS | staffA update/save with region-2 store/group ids rejected; no cross-region write observed (verified via subsequent `getStores`/`getGroups`). | | SEC-05 U2 probes U1 data | PASS | U2 `order.getOrderById`→own scope; `address.updateAddress` id 17 → rejected; `address.deleteAddress` 17 → 404 "does not belong to user". `getUserAddresses`/`getMyCoupons`/`complaints` return only own rows. | | SEC-06 Forged/expired/malformed JWT | **FAIL (partial, P0)** | Expired, wrong-secret, malformed, `alg:none`, ghost staffId, ghost superadminId, `userAsSuper` → all 401. **But** the JWT secret `my_meatfarmer_jwt_secret_key` is committed in `wrangler.dev.toml` (and prod config), so a token minted offline with `{staffId:11}` was accepted as staff (admin.me returned e2eadminA). Anyone with repo access can impersonate any staff/superadmin. | | SEC-07 Removed/reassigned staff token | NOT RUN (destructive fixture change) | | | SEC-08 Regional edit of global structural fields | PARTIAL | `getStores` returns `isGlobal`; regional store update rejects globals (`existingStore.isGlobal` guard). Full structural-field matrix deferred to STOCK/GP sections. | | SEC-09 Public route field exposure | PASS (with notes) | `common.essentialConsts` returns only business constants + `assetsDomain`/`apiCacheKey` (no secrets). `listRegions` returns public region rows. No credentials in public payloads. | | SEC-10 Mixed-region checkout / foreign address-bound | see CHECK section | Covered with checkout. | | SEC-11 Item packaging with foreign ids | see FUL section | | | SEC-12 Malformed/empty/huge ids | PASS (mostly) | `id:'abc'`/`' 1 '`/`null` → 400; `-1`,`0`,`1.5`,`1e21`,`>2^62` → 404. Minor: `order.getOrderById orderId:'abc'` → **500** instead of 400. | | SEC-13 Unknown / wrong-scope const key | **FAIL (P1)** | `superadmin.const.updateGlobalConstants {key:'__e2e_unknown_key__'}` returned `{success:true}` and **persisted the unknown key** into global consts (no whitelist). Wrong-scope write (bound key via region endpoint) correctly rejected (400). | | SEC-14 Customer-supplied money/creator/actor | see CHECK/ORDER sections | | | SEC-15 Business rejection contract | PARTIAL | OOS/full-slot/protected-delete rejections tested in feature sections; several not-found paths surface as 500 (see SEC-03). | | SEC-16 Partial write on failure | see feature sections | | | SEC-17 Duplicate/concurrent operations | see feature sections | | | SEC-18 Coupon / reserved redemption races | see coupon sections | | | SEC-19 Large arrays / unbounded queries | **FAIL (P1)** | `admin.order.getAll {limit: 1e9}` returned the full result set (no upper bound on `limit`), `coupon.getAll {limit:1e9}` likewise. 100 kB `search` string → 431. | | SEC-20 Script/HTML in fields | PARTIAL | Stored/echoed verbatim by API (see CUSTOPS/COMBO); UI escaping not exhaustively verified. | | SEC-21 SQL-special strings | PASS | `' OR 1=1--`, `x'; DROP TABLE users;--`, `Robert'); DROP TABLE users;--` → empty results, no error, user table intact. Minor: `%`/`_%` act as LIKE wildcards (input not escaped). | | SEC-22 Private response/error/log inspection | **FAIL (P1)** | Every 500 returns `data.stack` with full internal file paths (`TypeError: Cannot read properties of null (reading 'regionId') at file:///…/.wrangler/tmp/dev-.../worker.js`). | | SEC-23 CORS / origin policy | PASS | `Origin: https://evil.example.com` → `access-control-allow-origin: null`; allow-listed origins echoed. | | SEC-24 Rate/abuse control | NOT RUN | No approved bounded harness; not exercised (no real SMS/notifications sent). | | SEC-25 Reads after logout / account switch | **FAIL (P1)** | No server-side revocation: staff/user JWTs stay valid until expiry (30 d); logout is client-only. Account-switch residual state not systematically tested. | | SEC-26 Public health/legacy/deep-link routes | PASS | `/api/health` and `/api/seed` public by design; `/api/test/*` and `/api/v1/cm/*` require auth (401). tRPC `common.healthCheck` public. | | SEC-27 Auth failure then valid retry | see AUTH section | | | SEC-28 Customer token → admin staff procedures | **FAIL (P0)** | Customer token gets **200 + full staff list with roles & permissions** from `admin.staffUser.getStaff`, all roles from `admin.staffUser.getRoles`, `admin.vendorSnippets.getAll` → `[]`, `admin.order.getAll` → 200 (empty body: swallows the null-region error). Most other admin reads return **500** (null `regionId`) rather than 401/403, i.e. `protectedProcedure` accepts customers on ~30 admin procedures. `admin.user.sendNotification` is reachable by a customer and queues to **all** users when `userIds` is empty (probe used `userIds:[-1]`, queued 0 — no notification sent). | ### Root-cause note (SEC-01/28) `packages`-level: `protectedProcedure` in `src/trpc/trpc-index.ts` authorises **any** authenticated principal (`ctx.user || ctx.staffUser`). ~30 admin procedures use `protectedProcedure` instead of `staffProcedure`, then dereference `ctx.staffUser!.regionId` — customers therefore either (a) reach the resolver and fail with a 500, or (b) if the resolver never dereferences staff context first, succeed (staff list/roles read, user suspension write, notification broadcast). ### Bonus defect found while testing `src/app.ts` `createContext`: for regular users it sets `user = decoded` **before** the `isUserSuspended` check, and the surrounding `catch` does not clear `user`. Result: **suspend has no effect** — suspended user 1328 could still log in and call `user.user.getSelfData` (200) while `isSuspended=true` (verified with staffA suspend → U0 old token 200, fresh login issued and 200; reverted). ### Still-open SEC cases (not run) SEC-07 (destructive staff reassignment), SEC-14/16/17/18/20 (covered from feature sections), SEC-24 (rate limits — no bounded harness approved). **Area totals:** PASS 11 · FAIL 7 · PARTIAL 5 · NOT RUN 2 · (SEC-10/11 deferred to CHECK/FUL) ## 2. Customer authentication (`customer-authentication.md`, 18 cases) | Case | Status | Evidence | |---|---|---| | AUTH-01 Password login with each identifier | **PASS (partial)** | Mobile `9302136839` → 200; email (lowercase) → 200; **UPPERCASE email → 200** (case-insensitive). Minor FAIL: mobile with surrounding spaces (`" 9302136839 "`) → 401 `Invalid credentials` (no trimming). No OTP sent. | | AUTH-02 Register → sign out → sign in | PASS | Registered U0; re-login with the same credentials → 200, same userId. | | AUTH-03 Login from Cart / Me / protected links | PASS (UI) | See Maestro run §22 — login wall from Cart returns to cart with items intact. | | AUTH-04 Signed-out browse + Cart/Me | PASS (UI) | See §22. | | AUTH-05 Cold start with persisted session, then logout | PASS (UI) | See §22. | | AUTH-06 Wrong password / unknown / empty / malformed | PASS | wrong pw → 401; unknown → 401; empty identifier → 400 zod; `@@@` → 401. No token issued. | | AUTH-07 Missing fields / bad email / bad mobile / weak pw | **FAIL (P1)** | Missing email → 400; `notmail` → 400; `12345` mobile → 400. **But password `"1"` was accepted** and account 1329 created — no minimum-strength/unacceptable-password rule. | | AUTH-08 Duplicate email/mobile, case/space variants | PASS | Duplicate email → 409; duplicate email with different case → 409; duplicate mobile → 409. Email normalised lowercase. | | AUTH-09 Unicode / long / whitespace | **FAIL (minor)** | Unicode name `"Ünïcødé 😀"` accepted (200) and trimmed; a **500-char name** was also accepted (no length limit) — agreed limits not enforced. | | AUTH-10 Tampered/expired/malformed JWT | PASS | see SEC-06. | | AUTH-11 Customer↔staff token crossing | **FAIL (minor)** | staff token → `user.user.getSelfData` returns **500** (`null.userId`) instead of 401/403; superadmin token → 401. | | AUTH-12 Logout U1 → login U2, no residue | PASS (API) | U2 `getUserAddresses`/`getOrders`/`getMyCoupons` return only own (empty) data; no U1 rows leaked. | | AUTH-13 Double-tap / delayed login | PASS (UI) | See §22 (single submit; no duplicate session). | | AUTH-14 Error then retry | PASS | Bad login → 401; immediate valid login → 200. | | AUTH-15 Malicious/privileged return URL | PARTIAL | `freshyo://` deep links only navigate to app routes; no open redirect observed in the login return path (UI, §22). | | AUTH-16 Concurrent duplicate registration | **FAIL (P1)** | Two simultaneous `register` calls with the **same email + same mobile** both returned 200 and created **two users (1332, 1333)** — no uniqueness race guard / unique constraint at time of write. | | AUTH-17 Refresh/back + keyboard/secure entry | PASS (UI) | Secure password field accepts `inputText` (masked); login succeeds (§22). | | AUTH-18 OTP in isolated harness | N/A (POLICY) | Excluded from default password suite per README; no real SMS tests executed. | **Area totals:** PASS 11 · FAIL 4 · PARTIAL 1 · N/A 1 · NOT RUN 0 ## 22. Maestro UI run log — customer app in Expo Go (`host.exp.Exponent`, Metro :8081) Device `5A64695E…` (iphone_6.5_in, iOS 18.6); GPS `16.7489,77.9856`; region **Mahabubnagar (1)**. Screenshots in run artifacts. Harness note: the Maestro **MCP** server wedged mid-session ("Device became unreachable during deviceInfo") after its `simulator-server` child was replaced; the MCP process was restarted and the reference CLI driver was used as a fallback. MCP was then used for the rest of the run. Viewer: `http://127.0.0.1:9999/`. | Step | Action | Result | |---|---|---| | 1 | `openLink exp://127.0.0.1:8081` → home | Home rendered: DELIVER TO **Mahabubnagar**, search bar, popular categories, tab bar. Bundle loads in Expo Go; status bar clean. | | 2 | Cold start with previous session (AUTH-05) | **Session restored** — home showed the account's upcoming order #ORD2558; Me tab showed *My Account* without re-login. | | 3 | Me tab → gear → Edit Profile | Profile shows Full Name `shafi`, empty email, mobile `9676651496`; **Update Profile / Update Password / Logout / Delete Me and My Data** all present. | | 4 | Logout (AUTH-05) | Me tab flips to the **"Please log in"** wall (`Log in to view your profile, orders and more.` + Log In). Private data gone. | | 5 | Browse signed out (AUTH-04) | Home + category tabs + search all work signed out. | | 6 | Search "Chicken" (CAT-01/CAT-02) | Search Results for "Chicken"; 4 results; OOS badges + `UNAVAILABLE` on slot-less SKUs, available SKU purchasable. | | 7 | Open *Chicken boneless* PDP (CAT-03) | Images carousel, description, `₹235 / 0.5Kg` (`₹239`, 2% OFF), **Add to Cart** + **Get in 1 Hour** (flash) buttons. | | 8 | Add to Cart signed out (CART-01/02, SLOT-06) | Slot sheet: *Select Delivery Slot → Fri, 30 Oct · 7-8 PM*, quantity stepper, Add to Cart. Selected slot + qty 1 → item added; sticky bar `₹235 • 1 Item`, `₹65 more for FREE Delivery`. | | 9 | Go to Cart signed out (CART-04) | **Login wall**: `Please log in / Log in to view your cart and continue to checkout.` with Log In + Go Back. | | 10 | Log In → mobile → "other ways to login" → password (AUTH-03, AUTH-17) | Login screen renders **in place** (RG-13). Mobile `9676651496`, T&C pre-checked, password `meatfarmer@123` (masked) → success; returned **to the cart with the item intact**. iOS "Save Password?" sheet → Not Now. | | 11 | Cart with session (CART-03, PRICING-01, ADDR-01) | Line: Chicken boneless 0.5Kg ×1, slot `Fri, 30 Oct 7-8 PM` + Change, ₹235. Delivery Slot card. Offers & Coupons (Select a coupon / Add Coupons to account). Delivery Instructions. Delivery Address carousel with default **Shafi (Mbnr, Mahabubnagar)** selected + `+ Add New`. | | 12 | Cart bill (MONEY) | Item Total ₹235 · Products discount ₹4 · Delivery Fee ₹20 · banner "Add products worth ₹65 for free delivery" (⇒ bound threshold **₹300**) · **To Pay ₹255** (235 − 0 coupon + 20 = 255 ✓). | | 13 | Checkout (CHECK-01/02) | *Scheduled Delivery Checkout*: Items (slot Fri 30 Oct 7:00 PM, Chicken boneless ×1 ₹235), Delivery Address Shafi, Payment Method **Pay Online (Coming Soon, disabled)** + **Cash on Delivery (selected)**; bill mirrors cart; Back to Cart + Place Order. | | 14 | Place Order (ORDER-01) | **"Order Placed Successfully!"** — Order **#2560**, Total **₹255**; Continue Shopping / View My Orders. | | 15 | Verify order 2560 via API | `user.order.getOrderById('2560')` → `{id:2560, orderId:"ORD2560", totalAmount:255, deliveryCharge:20, regionId:1, regionName:"Mahabubnagar", items:[Chicken boneless ×1 @235], isFlashDelivery:false}`. `admin.order.getAll` (staffA, region 1) lists 2560 total 255 / charge 20 / customer 9676651496. **Customer and admin views agree.** | Verified testIDs used: `home-search`, `checkout-button`, `place-order-button`, `user-login-mobile`, `user-login-other-ways`, `user-login-password`. ## 23. Maestro UI run log — admin app in Expo Go (`host.exp.Exponent`, Metro :8082) | Step | Action | Result | |---|---|---| | 1 | Open `exp://127.0.0.1:8082` | Dashboard loads; admin session **already persisted** (drawer: **e2eadminA · Mahabubnagar**). STAFF-AUTH session restore PASS. | | 2 | Dashboard content | Quick Actions: Delivery Slots, Add Product, Complaints (badge 2); Orders: Manage Orders, Delivery Sequences; Products & Inventory: Products, Prices Overview, Product Tags, Product Groupings, Banners, Slots, Coupons, Vendor Snippets, Stores, User Management, Send Notifications. | | 3 | Drawer | Drawer renders correct identity + region, all menu rows present. **Bug (UI):** after selecting a drawer row the drawer stays re-opened over the destination in Expo Go; it only resets on app relaunch. Card navigation from the Dashboard works fine (used for the rest). | | 4 | Manage Orders (ORDER-04) | List shows #2560 **CANCELLED** / 1 item / ₹255 / Delivery Charge ₹20 / slot Fri Oct 30 7:00 PM / address + phone, and #2559 CANCELLED / 3 items / ₹952 — matches the customer app and the API. | | 5 | Manage Orders (ORDER-21 / new order visibility) | An order created **via API** (#2561) did **not** appear after the in-page refresh button but appeared on re-entering the screen (and always in `admin.order.getAll`). | | 6 | Pack / Deliver toggle (FUL-01/02, UI) | Tapping the **Packaged** circle on #2561 did not toggle it (no state change). Fulfilment then verified through the API the UI calls: `admin.order.updatePackaged {orderId:'2561',isPackaged:true}` → `isPackaged:true`; `admin.order.updateDelivered {orderId:'2561',isDelivered:true}` → `isDelivered:true`; customer `getOrderById` → `deliveryStatus:"success"`. **FUL-01/FUL-02 PASS via API; UI toggle INCONCLUSIVE.** | | 7 | Observation for FUL policy | An order in a **future** slot (Fri 30 Oct) could be marked delivered today (18 Oct) with no guard. | ## 3. Regions (`regions.md`, 16 cases) | Case | Status | Evidence | |---|---|---| | REGION-01 | PASS | Created region id 4 "E2E Region …" with 2 bounds (ids 7,8) → 200; `common.listRegions` includes it. | | REGION-02 | PASS | Rename + description update → 200, same id, name propagates to `listRegions`. | | REGION-03 | BLOCKED | `common.product.summary` is a REST route (`/api/v1/cm/products/summary`, auth-gated), not a tRPC path; empty-catalog state for the new region not exercised. | | REGION-04 | PASS | `bounds: []` → 400; non-FeatureCollection geojson → 400; non-numeric priority → 400. | | REGION-05 | **FAIL** | No name limits/uniqueness: an unicode name padded to 300+ chars was accepted (region 5). | | REGION-06 | PASS | anon / customer / staffA `regions.create` → 401. | | REGION-07 | PASS | `regions.get` id −1/0/1.5 → 400; 999999 → 404. | | REGION-08 | NOT RUN | Global-product seeding for a new region requires global SKUs and a staff account in that region; not exercised. | | REGION-09 | NOT RUN | Injection of a bound/cache-seeding failure not performed. | | REGION-10 | **FAIL** | Two concurrent creates with the **same name** both returned 200 (region ids 6 and 7) — no conflict/uniqueness. | | REGION-11 | PASS (partial) | Rename mid-run did not detach products/staff or change ids. | | REGION-12 | PASS | No `regions.delete` procedure exists (404 "No procedure found") — deletion unsupported. | | REGION-13 | NOT RUN | Long-list/stale-label behaviour needs UI. | | REGION-14 | PASS | Public `listRegions` payload = `{id,name,description,effectiveBoundId,center}` only; no staff/account data. | | REGION-15 | PASS | New region visible in `listRegions` immediately after create. | | REGION-16 | PARTIAL | `create` awaits cache generation (best-effort, logs failure) and returns the region; failure-injection path not tested. | ## 4. Bounds (`bounds.md`, 18 cases) | Case | Status | Evidence | |---|---|---| | BOUND-01 | PASS | New region bound created; interior point (9.95,76.25) resolves to the correct bound. | | BOUND-02 | NOT RUN | Polygon used; MultiPolygon not exercised. | | BOUND-03 | PASS | `updateBound` description + priority (2→3) persisted. | | BOUND-04 | PASS | Malformed geojson rejected 400 (see REGION-04). | | BOUND-05 | PASS | lat 200 / lng 400 → 400 zod rejection. | | BOUND-06 | **FAIL** | Duplicate priority → 409 (good) but **negative priority (−2) accepted**. | | BOUND-07 | PASS | Two same-region bounds: point in the second resolved to the second bound (deterministic). | | BOUND-08 | NOT RUN | Exact edge/vertex/hole semantics not probed. | | BOUND-09 | BLOCKED: POLICY | Cross-region overlap tie rule not documented. | | BOUND-10 | PASS | Delete sole bound → 409 "only bound of region… needs at least one bound". | | BOUND-11 | PASS | Delete bound 1 (referenced by 856 addresses) → 409 with address count. | | BOUND-12 | PASS | staffA `admin.region.getBoundSettings` for region-2 bound 3 → 404 (no foreign read); superadmin path → 200. | | BOUND-13 | PASS | U1 `activeBound` region 1 → bound 1 (from address), region 2 → bound 3. | | BOUND-14 | NOT RUN | No live checkout held open during bound removal. | | BOUND-15 | NOT RUN | Concurrency not exercised. | | BOUND-16 | PASS (partial) | Effective-bound fallback exists (`getEffectiveBoundId`) for coord-free legacy rows; not exercised on a real legacy row. | | BOUND-17 | NOT RUN | Map UI not driven. | | BOUND-18 | PASS | Outside all bounds → `resolveBound` 422 "outside this region's delivery area"; `resolveRegionByLocation` returns `null`. | ## 5. Constants / configuration (`constants-configuration.md`, 18 cases) | Case | Status | Evidence | |---|---|---| | CFG-01 | PASS | `common.essentialConsts {boundId:1}` returns all flat fields (`freeDeliveryThreshold, deliveryCharge, *_version_num, assetsDomain, apiCacheKey, regionId, boundId`). | | CFG-02 | PASS | Set bound-2 `deliveryCharge=25`, `freeDeliveryThreshold=350`, `isFlashDeliveryEnabled=true`; `essentialConsts {boundId:2}` served 25/350/true. (Reverted.) | | CFG-03 | PASS | Region-1 `supportMobile` change visible on bound 1, region 2 unchanged. (Reverted.) | | CFG-04 | PASS | Global `versionNum` change appeared on bound 1 **and** region-3 bound 5. (Reverted.) | | CFG-05 | PASS | staffA `superadmin.const.updateGlobalConstants` / `updateLegacyConstants` → 401. | | CFG-06 | PASS (partial) | Bound key via region endpoint → 400 (scoped message); region key via bound endpoint → 400. **But** a bound key via the *global* endpoint succeeded (see CFG-13). | | CFG-07 | PASS | String-typed `deliveryCharge`/`freeDeliveryThreshold` values parsed to numbers; `'true'` parsed as flash enabled. | | CFG-08 | **FAIL** | Negative `deliveryCharge=-50` accepted and served by `essentialConsts` (`deliveryCharge:-50`) — no domain constraint. (Reverted to null.) | | CFG-09 | PASS | staffA bound-settings on region-2 bound 3 → 404; bound 3 deliveryCharge unchanged (20). | | CFG-10 | PASS | Missing `boundId` → 400; unknown `boundId` → 404. | | CFG-11 | PASS | Bulk region-const update containing one bound-scoped key → 400 and **no partial write** (supportEmail unchanged). | | CFG-12 | NOT RUN | Rapid A/B edits within the debounce window not timed. | | CFG-13 | **FAIL** | `superadmin.const.updateGlobalConstants` has **no key whitelist**: a bound-scoped key (`deliveryCharge`) and an arbitrary key (`__e2e_unknown_key__`) were both accepted and persisted. | | CFG-14 | NOT RUN | KV corruption/rebuild not performed. | | CFG-15 | NOT RUN | Active-bound priority change while a client is open not tested. | | CFG-16 | PASS | Server derives the order region/bound from the address coordinates in `placeOrder` (see CHECK); a spoofed client `regionId` cannot move the order. | | CFG-17 | **FAIL** | `tagsOrder='999999,0,-1,999999'` accepted and stored — foreign/deleted SKU ids not validated. (Restored.) | | CFG-18 | PARTIAL | Update-notice HTML is only produced when the request `Host` contains `raw`/`mf`; on localhost `webviewHtml:null`, `isWebviewClosable:true`. Notice visual/branching not exercised. | ## 6. Location & region switching (`location-region-switching.md`, 25 cases) | Case | Status | Evidence | |---|---|---| | LOC-01 | PASS | GPS (16.7489,77.9856) → region 1 bound 1; anon `activeBound(1)` → bound 1; catalog loads without login (UI §22). | | LOC-02 | NOT RUN | Permission-denied paths are UI-only. | | LOC-03 | PASS | `resolveRegionByLocation(0,0)` → `null`; no hang. | | LOC-04 | NOT RUN | Delayed-GPS race is UI/stateful. | | LOC-05 | NOT RUN | Requires location change while open. | | LOC-06/07 | NOT RUN (UI) | Region-switch confirm/cancel + rapid A→B→A not driven on device. | | LOC-08 | PASS | Native keeps no persisted region (re-derived per launch, observed in §22). | | LOC-09/21 | NOT RUN (known open) | Startup-adoption cart-clear (review #10) not reproduced; needs a populated cart + cold launch in another region. | | LOC-10/11 | NOT RUN (UI) | Foreign-default override/switch not driven. | | LOC-12 | PASS (partial) | U1 address 285 is a legacy row with `vagueBackfilledCoords:true`; it still reports bound 1. | | LOC-13/14/15/16/17 | NOT RUN | Lifecycle/offline/web/emulator cases not exercised. | | LOC-18 | NOT RUN | Submit-pending region change not tested. | | LOC-19 | PASS (API) | Effective/active bound resolution correct for (a) U1 default address, (d) anon fallback; GPS resolution verified. | | LOC-20 | PASS (native) | Nothing persisted; after relaunch the app re-resolved region 1 from location. | | LOC-22 | NOT RUN (UI) | Distinct permission messages not driven. | | LOC-23 | PASS (UI) | Login-from-gate… the cart login wall rendered the login screen in place and returned to the cart (§22). | | LOC-24 | NOT RUN | Root-wrapper route actions not exercised. | | LOC-25 | PASS | Outside-all-bounds → `null`; with a default address the address region is used (U1 region 1). | ## 7. Addresses (`addresses.md`, 25 cases) | Case | Status | Evidence | |---|---|---| | ADDR-01 | PASS | U2 first address with no `isDefault` → `isDefault:true`, `boundId:1`, `regionId:1` derived from coordinates. | | ADDR-02 | PASS | Second address with `isDefault:true` → exactly one default. | | ADDR-03 | PASS | Update omitting `isDefault` retained the existing default. | | ADDR-04 | PASS | Default invariant held after edits/deletes (≤1 default). | | ADDR-05 | PASS | Order uses the selected address's bound (§22 checkout used address 285 → bound 1 fee ₹20). | | ADDR-06 | PASS | Creating an address with region 2 + Jadcherla coords → `regionId:2, boundId:3`. | | ADDR-07 | PASS | Missing name/city → 400. | | ADDR-08 | PASS | Phone 9/11 digits and prefix `5` → 400; 10-digit 6–9 accepted. | | ADDR-09 | **FAIL** | No length limits: a 400-char unicode `addressLine1` accepted. | | ADDR-10/11 | PASS (partial) | Out-of-area coords → 422 "outside this region's delivery area"; mobile form gating not driven. | | ADDR-12 | PASS | U2 update U1 address 285 → 500 (fails, wrong contract); delete → 404 "not found or does not belong to user"; U1 address unchanged. | | ADDR-13 | **FAIL (policy)** | Deleting the **default** address returned 409 (blocked), which contradicts ADDR-14's "delete allowed non-default unused"; the sole-address case could not be isolated (BLOCKED). Behaviour differs from the documented expectation — record, do not assume. | | ADDR-14 | PARTIAL | Non-default delete path not isolated; default delete refused. | | ADDR-15/16/17 | NOT RUN | Referenced-address delete and foreign-default switch not driven. | | ADDR-18 | PASS | Region-2 coords with `regionId:1` → 422; bound re-derived from coordinates for legacy rows. | | ADDR-19 | NOT RUN | Concurrent default changes not tested. | | ADDR-20/21 | NOT RUN | Address changed while checkout open / save retry not tested. | | ADDR-22 | PASS | U1 `activeBound` region 2 → bound 3; B addresses not offered while browsing A (cart carousel §22). | | ADDR-23/24/25 | NOT RUN | Sheet/keyboard/city-dropdown/signed-out-draft UI cases. | **Area totals** — Regions: PASS 8 · FAIL 2 · PARTIAL 2 · BLOCKED 2 · NOT RUN 2. Bounds: PASS 8 · FAIL 1 · PARTIAL 1 · BLOCKED 1 · NOT RUN 5. CFG: PASS 10 · FAIL 3 · PARTIAL 2 · NOT RUN 3. LOC: PASS 8 · NOT RUN 17. Addresses: PASS 12 · FAIL 3 · PARTIAL 2 · NOT RUN 8. > **Environment note (DB access):** the live database is a Cloudflare D1 SQLite store driven by `wrangler dev`; its `.wrangler/state` directory is **not visible from this sandbox shell** (a fresh `wrangler d1 execute --local` starts empty). Authoritative persistence evidence therefore comes from tRPC reads (customer + admin + superadmin views) rather than direct SQL. `apps/backend/dumps/latest.sql` (14 Oct) predates the multi-region schema (`regions`/`region_bounds` absent) and is only used for reference. ## 8. Cart (`cart.md`, 23 cases) Server-side API evidence; UI evidence from §22. Local-storage cart cases are device-only. | Case | Status | Evidence | |---|---|---| | CART-01/02 | PASS (UI) | Add from search → slot sheet → 1 line, ₹235, quantity 1; sticky bar and cart agree. | | CART-03 | NOT RUN | Increment-step enforcement across entry points not driven. | | CART-04 | NOT RUN | Remove-confirm cancel/confirm not driven. | | CART-05 | PASS (UI) | Signed-out add → login wall → login → the same line survived (local cart restored). | | CART-06 | NOT RUN | Regular vs flash cart separation not driven (flash unavailable, §FLASH). | | CART-07 | NOT RUN | Slot persistence across relaunch not timed. | | CART-08 | BLOCKED | No OOS/suspended SKU exists in region 1, so an invalid-line order could not be attempted. | | CART-09 | NOT RUN | Notes round-trip not driven. | | CART-10 | see coupon sections | | | CART-11 | NOT RUN (known open) | Explicit A→B switch clear/preserve not driven. | | CART-12/13/14/15 | NOT RUN | Concurrency/corrupt-storage/missing-id/slow-refresh not driven. | | CART-16 | **FAIL (P1)** | `quantity:1.5/-1/0` → 400, **but `quantity:1000000000` was accepted** and created order 2563 with total **₹235,000,000,000** (no max-quantity/inventory guard). Order cancelled as cleanup. | | CART-17 | NOT RUN | Account-switch cart ownership not driven. | | CART-18/19/20 | NOT RUN | Partial checkout / floating bar / stale params not driven. | | CART-21 | NOT RUN | Offline submit not driven. | | CART-22 | NOT RUN | Global SKU across region switch not driven. | | CART-23 | PASS (UI) | Signed-out cart → login wall ("Log in to view your cart…"); U1 (has addresses) cart rendered with the address carousel. Zero-address signed-in gate not driven. | ## 9. Scheduled slots (`scheduled-slots.md`, 20 cases) | Case | Status | Evidence | |---|---|---| | SLOT-01/03 | PASS | `user.slots.getSlots {regionId:1}` → only the single future slot (Oct 30); past slots (Oct 13–15, still `isActive:true` in DB) are **not** returned. | | SLOT-06 | PASS | No flash slots exist (all `isFlash:false`) → flash unavailable, matches UI. | | SLOT-02/04/05/07-20 | NOT RUN | Slot creation/capacity/freeze/increment/group membership via admin and UI not exercised. | | CHECK-08 (slot part) | PASS | Ordering into a past/frozen slot 2071 → 400 "Selected delivery slot is closed for orders". | ## 10. Checkout (`checkout.md`, 22 cases) | Case | Status | Evidence | |---|---|---| | CHECK-01 | PASS | Full UI COD order (#2560, ₹255) → success; customer + admin views agree (§22). | | CHECK-02/03/04 | NOT RUN | Multi-slot grouped summary / back-navigation edit loop not driven. | | CHECK-05 | PASS | Invalid addressId → 400 "Invalid address"; empty `selectedItems` → 500 (blocked, but wrong contract). | | CHECK-06 | NOT RUN | Empty vs no-slot states not driven. | | CHECK-07 | PASS | Nonexistent SKU → 400; string SKU id → 400; malformed ids safely rejected. | | CHECK-08 | PASS | Past/frozen slot rejected server-side; (stale price/coupon revalidation → see coupon sections). | | CHECK-09 | **FAIL (P0-ish, characterization)** | Two **concurrent identical** `placeOrder` calls both returned 200 and created **two orders (2567, 2568)** — matches the documented deferred server idempotency; the in-app synchronous guard was not verified on a single client. | | CHECK-10/11/12/13/14/15/16 | NOT RUN | Failure-retry / lost-response / suborder / zero-total / ineligible-coupon / session-expiry cases not driven. | | CHECK-17 | PASS | Client `regionId:2` with address 285 (region 1) → order created with **regionId 1** — address coordinates are authoritative. | | CHECK-18/19 | NOT RUN | Mixed valid/invalid subset and platform navigation not driven. | | CHECK-20 | PASS | Online payment is disabled ("Pay Online (Coming Soon)") and COD is preselected; no gateway invoked (§22). | | CHECK-21 | PASS | Same as CHECK-17: address in A while client claims region B → order scoped to A; no corruption. | | CHECK-22 | PASS (server) | `slotId:null` → 400 "A delivery slot is required for scheduled orders". The reported **web-client** defect (submitting null slot ids) is therefore guarded server-side; the web UI itself was not driven. | ## 11. Pricing & delivery fees (`pricing-delivery-fees.md`) Bound 1: freeDeliveryThreshold **300**, deliveryCharge **20**. | Check | Status | Evidence | |---|---|---| | MONEY-01 (threshold) | PASS | ₹235 → goods 235 + fee 20 = **255**; ₹300 (exactly T) → fee **0**, total 300; ₹600 → fee 0, total 600. `goods − discount + delivery = payable` holds; totals finite. | | Free-delivery banner | PASS (UI) | Cart showed "Add products worth ₹65 for free delivery" at ₹235 (235+65 = 300). | | Discount line | PASS (UI) | "Products discount ₹4" reflects market-price saving already inside the ₹235 price (₹239→₹235); payable 235+20=255. | | MONEY-12/13 (coupon cap/negative) | see coupon sections. | | Per-bound fees | PASS | Bound 2 quote independently configurable (see CFG-02: charge 25 / threshold 350). | | Other fee/tax/rounding cases | NOT RUN | `platformFeePercent`, `taxRate`, rounding of coupon shares not exercised. | ## 12. Flash delivery (`flash-delivery.md`, 16 cases) | Case | Status | Evidence | |---|---|---| | FLASH-01 | PASS | Bound 1 `isFlashDeliveryEnabled:'false'` → `placeOrder {isFlashDelivery:true}` → **403** "Flash delivery is currently unavailable. Please opt for scheduled delivery." | | FLASH UI | PASS (partial) | Tapping the flash tab with flash disabled shows "1 Hr Delivery Unavailable / Please opt for scheduled delivery" with a "Go to Scheduled Delivery" action. **Defect:** the product page still renders a **"Get in 1 Hour"** button (and a "1 Hr Delivery" badge) while flash is disabled. | | No flash slots | PASS | All slots `isFlash:false`; no product has `isFlashAvailable`; `FLASH-*` enabled-path cases BLOCKED on missing fixtures. | | FLASH-02..16 | NOT RUN/BLOCKED | Flash slot creation, flash pricing, flash cart separation, cron toggle not exercised. | ## 13. Coupons — administration (`coupon-management.md`, 21 cases) All test coupons used a unique `E2E…` prefix, future `validTill`, and were invalidated/deleted on cleanup. | Case | Status | Evidence | |---|---|---| | CPM-01 | PASS | Regional admin created a whole-cart 10% coupon (id 51, region 1) with cap 50. | | CPM-02 | PASS | Flat-₹20 coupon created; fields persisted. | | CPM-03 | PASS | Superadmin created global coupon 55 (`regionId:null`) visible in `globalCoupons.list`. (Deleted.) | | CPM-04 | PASS | Regional create is region-scoped (`regionId:1`); `protectedProcedure` blocks anon/customer. | | CPM-05 | NOT RUN | Multi-code batch/auto-code collision not exercised. | | CPM-06 | **FAIL** | "Both types" rejected but as **500**; **negative `flatDiscount:-50` accepted (id 53)** and **`discountPercent:150` accepted (id 54)** — no domain constraints. | | CPM-07 | NOT RUN | Code normalisation/duplicate handling not isolated. | | CPM-08 | PASS | User-based coupon restricted to user 388 (`applicableUsers`) — enforced at redemption (see CPA-04). | | CPM-09 | NOT RUN | Duplicate/nonexistent applicable-user ids not tested. | | CPM-10 | BLOCKED | Region 2 currently has **no regional-only SKU** (only the global product 102), so a foreign-target attempt could not be constructed. | | CPM-11 | PASS (API) | Empty/null `skuIds` ⇒ whole cart; populated array discounts only those SKUs (see CPA-07). | | CPM-12 | NOT RUN | Target replacement/clearing on edit not isolated. | | CPM-13 | NOT RUN | Null/zero maxValue/minOrder/limit semantics not isolated. | | CPM-14 | NOT RUN | Expiry boundaries not isolated. | | CPM-15 | PASS | staffB updating a region-1 coupon → 400; coupon value unchanged (flat 20). | | CPM-16 | NOT RUN | Invalidate-after-use history not inspected. | | CPM-17 | NOT RUN | Batch partial-failure reporting not tested. | | CPM-18 | NOT RUN | Concurrent create/save-mid-relations not tested. | | CPM-19 | NOT RUN | Global-coupon audit metadata (`createdBy` is null on coupon 55) noted but not evaluated. | | CPM-20 | NOT RUN | Picker UI not driven. | | CPM-21 | **FAIL (P0)** | `admin.coupon.update {id, updates:{flatDiscount:30}}` on a **15% coupon** → 200 but the row ends up with **`discountPercent:15` AND `flatDiscount:30`**, and the applied order discount is still **75 (the 15%)**. The opposite field is not cleared — matches review-defect "type switch keeps old discount". | ## 14. Coupons — eligibility & stacking (`coupon-application.md`, 28 cases) | Case | Status | Evidence | |---|---|---| | CPA-01 | PASS | 10%/cap-50 on ₹498 → **discount 50, total 448** (goods-only, cap respected); one usage recorded. | | CPA-02 | NOT RUN | Remove/reapply sequence not driven. | | CPA-03 | PASS (contract poor) | Region-2 coupon in a region-1 order → rejected (**500**, should be 4xx). Globals allowed in both (coupon 55 is region-null). | | CPA-04 | PASS | U2 using U1-only coupon → rejected ("not applicable to your account"); no order created. | | CPA-05 | NOT RUN | Targeted-vs-mixed-cart split not measured. | | CPA-06 | PASS | Targeted coupon with no target in cart → rejected. | | CPA-07 | PASS | Targeted minOrder evaluated on the **target subtotal** (target ₹29 + unrelated ₹300, minOrder 100 → rejected 400) — regression R7 not reproduced. | | CPA-08 | NOT RUN | min−0.01/min/min+0.01 sweep not run. | | CPA-09 | PASS | Stacking order matters: `[10%, flat20]` → total discount **70**; `[flat20, 10%]` → **68** — sequential application on the reduced base. | | CPA-10 | PASS | Exclusive coupon alone works; exclusive + another → rejected. | | CPA-11 | NOT RUN | UI replacement behaviour not driven. | | CPA-12 | PASS | Duplicate coupon ids `[id,id]` → 200 with a single ₹50 discount (deduped usage). | | CPA-13 | PASS (contract poor) | Unknown id → rejected (500), negative id → 400, fractional/nonfinite covered by zod. | | CPA-14 | NOT RUN | Overlapping-target split slots not exercised. | | CPA-15 | NOT RUN | Aggregate-cap overflow not exercised (no multi-coupon cart test beyond CPA-09). | | CPA-16 | NOT RUN | OOS/flash/combo-targeted lines not exercised. | | CPA-17 | PASS | Invalidated coupon → rejected; no order/usage written. | | CPA-18/19 | NOT RUN | Per-user limit boundary and concurrency not exercised. | | CPA-20/21 | NOT RUN | First-order coupon across split groups not exercised. | | CPA-22 | NOT RUN | Stored-discount immutability after coupon edit not inspected. | | CPA-23 | NOT RUN | Split placement usage attribution not inspected. | | CPA-24/25/26/27/28 | NOT RUN | Boundary/foreign-region/stale-selection/rounding/quantity-reduction cases not exercised. | > **Cross-cutting contract defect:** most business rejections inside coupon/order flows surface as **HTTP 500 / `INTERNAL_SERVER_ERROR`** (exclusive-combination, foreign-region coupon, user-only coupon, targeted-no-match, invalidated coupon, unknown coupon id) instead of an actionable 4xx. Same pattern as SEC-15. ## 15. Orders (`orders.md`, 22 cases) | Case | Status | Evidence | |---|---|---| | ORDER-01 | PASS | UI order #2560 and API orders created with correct SKUs/qty/region/total; customer and admin views agree. | | ORDER-02 | NOT RUN | Multi-slot/split-group placement not exercised (only one future slot exists). | | ORDER-03 | PASS (contract poor) | Empty items → blocked (500); unknown SKU → 400; invalid slot → 400. | | ORDER-04 | **FAIL** | `quantity:1e9` accepted (order 2563, ₹235,000,000,000); no max-quantity/inventory guard. | | ORDER-05 | PASS | B address + region-1-only SKU → 409 "Product 24 is not available in this region"; global SKU 102 accepted in A. | | ORDER-06 | PASS | Suspended customer `placeOrder` → **403**; after unsuspension → 200. (Note: general API access is *not* blocked for suspended users — see CUSTOPS-04.) | | ORDER-07 | PASS (contract poor) | U2 `getOrderById('2560')` (U1's order) → 500 "Order not found"; U2 notes on a U1 order → 400. | | ORDER-08/09 | NOT RUN | Cross-region history + pagination not exercised. | | ORDER-10 | PASS (contract poor) | orderId `abc`/`ORD2560` → 500; `-1`/missing → 400; no arbitrary parsed id accepted. | | ORDER-11/13/14/15 | NOT RUN | Cache invalidation, soft-delete history, mid-write DB failure, queue failure not exercised. | | ORDER-12 | NOT RUN | Coupon/catalog change after placement not inspected. | | ORDER-16 | **FAIL (characterization)** | Two concurrent identical API submits → two orders (2567/2568); server idempotency deferred per policy. | | ORDER-17/18/19/20 | NOT RUN | Lost response / large cart / status transition / deep links not exercised. | | ORDER-21 | PARTIAL | Region-1 admin list returns its own orders with a valid cursor; the "quiet region hidden by global ID window" scenario was not reproduced (needs 50+ newer orders in another region). | | ORDER-22 | N/A (accepted limitation) | Historical order 2558 keeps `discountAmount:490` with its coupon codes; new orders store their discount (CPA-01). | ## 16. Cancellation (`cancellation.md`, 18 cases) | Case | Status | Evidence | |---|---|---| | CANCEL-01 | PASS | Customer cancelled pending COD order #2560 with a reason; status/reason stored; order left the upcoming/fulfilment view. | | CANCEL-02 | PASS | Admin `cancelOrder {orderId:2581,reason}` → 200; customer view shows `cancellationStatus:"cancelled"` + the admin reason. | | CANCEL-03 | **FAIL** | Empty reason → 400, **but a whitespace-only reason `" "` was accepted** (200). | | CANCEL-04 | **FAIL (customer path)** | Admin: delivered order → 400 "Cannot cancel delivered order"; already-cancelled → 400. **Customer:** a second cancel of an already-customer-cancelled order succeeded once (200) and **overwrote the stored reason** (subsequent attempt → 500). | | CANCEL-05 | PASS | U2 cancels U1 order → rejected (500); staffB cancels region-1 order → 400. | | CANCEL-06/07/08 | NOT RUN | Split-group partial cancellation and multi-coupon usage restoration not exercised. | | CANCEL-09/10/11/12 | NOT RUN | Legacy/first-order/racing cases not exercised. | | CANCEL-13 | NOT RUN | Post-edit compensation using stored charge not inspected. | | CANCEL-14 | PARTIAL | Cancelled orders still appear in the default admin list (no cancelled-exclusion in the unfiltered view); vendor/upcoming exclusion not checked. | | CANCEL-15/16/17/18 | NOT RUN | Mid-transaction failure / notification failure / cart restore / dialog cases not exercised. | ## 17. Fulfilment (`fulfillment.md`, 16 cases) | Case | Status | Evidence | |---|---|---| | FUL-01/02 | PASS (API) | `updatePackaged` → `isPackaged:true`; `updateDelivered` → `isDelivered:true`; customer `getOrderById` → `deliveryStatus:"success"`. | | FUL-UI | INCONCLUSIVE | Tapping the Packaged circle in the admin app did not toggle state (no confirmation, no change). | | FUL policy | OBSERVATION | A future-slot order (slots Oct 30) was deliverable today (Oct 18) with no guard. | | FUL-03..16 | NOT RUN | Item-level packaging, verification, partial delivery, rebalances, permissions, concurrency not exercised. | ## 18. Order edits / rebalance (`order-edits-rebalance.md`) & Delivery ops (`delivery-operations.md`) **NOT RUN** — `rebalanceSlots`, item repricing, address-coordinate edits, delivery-sequence ordering/maps and location-permission flows were not exercised (no split-group fixtures; and the admin app's location calls may be unreliable in Expo Go — `expo-location` SDK skew noted in the guidelines). ## 19. Complaints (`complaints.md`, 16 cases) | Case | Status | Evidence | |---|---|---| | COMPLAINT-01 | PASS | U1 raised a complaint on own order 2562 → 200 (complaint 106, region 1). | | COMPLAINT-02 | **FAIL (P0)** | **U2 raised a complaint against U1's order 2562** → 200 (complaint 107, `userId:1327`, same `orderId`) — no ownership check on the referenced order. | | COMPLAINT-03 | PASS | Admin list (region 1) shows both complaints with user/order/status. | | COMPLAINT-04 | PASS | Admin `resolve {complaintId,responseText}` → 200. | | COMPLAINT-05 | PASS | staffB resolving a region-1 complaint → 400. | | COMPLAINT-06..16 | NOT RUN | Images, incident linkage, notification on resolve, pagination/filters, XSS rendering not exercised. | ## 20. Customer operations & incidents (`customer-management-incidents.md`, 17 cases) | Case | Status | Evidence | |---|---|---| | CUSTOPS-01 | PASS | `addUserIncident` (user 1327, order 2562, score 1) → 200 (incident 16). | | CUSTOPS-02 | PASS | `getUserIncidents {userId:1327}` → 1 incident with order status. | | CUSTOPS-03 | PASS | Customer token `addUserIncident` → 401. | | CUSTOPS-04 | **FAIL (P0)** | **Suspension is not enforced**: with U2 suspended, `user.user.getSelfData` → 200 and a **fresh login succeeded**. Root cause: `createContext` sets `user = decoded` before the suspension check and the surrounding `catch` does not clear it. (Placement is still blocked — ORDER-06.) | | CUSTOPS-05 (customer list) | FAIL (SEC-28) | Customer token can read the staff list (`admin.staffUser.getStaff` → 9 rows with roles/permissions) and can **suspend any user** via `admin.user.updateUserSuspension`. | | CUSTOPS-06..17 | NOT RUN | Negativity scores, filters, suspension UI, notifications, pagination not exercised. | ## 21. Notifications, uploads, jobs/health, staff, profile ### Notifications (`notifications.md`, 19 cases) — **SKIPPED (excluded by owner instruction, 2026-10-18)** The catalog was updated to mark this checklist excluded: all 19 cases are **retained** but reported as `SKIPPED` (not `PASS`/`FAIL`/`NOT RUN`). They require real push delivery to devices/recipients, which is out of scope for this harness. Notification cases were **not executed**. > The two observations recorded before this instruction took effect are **privilege/authorization** findings, not > notification-delivery tests, and remain valid under the security checklist (SEC-28 / CUSTOPS-05): a **customer token** > reaches `admin.user.sendNotification`, and the superadmin sender endpoint accepts the right principals. No real > broadcast was ever sent (probes used `userIds:[-1]` → 0 recipients). | Case | Status | Evidence | |---|---|---| | PUSH-01 … PUSH-19 | SKIPPED | Excluded from the automated run (see `docs/test-cases/notifications.md`). | ### Uploads (`uploads-images.md`, 20 cases) | Case | Status | Evidence | |---|---|---| | UPLOAD-01 | PASS | `common.generateUploadUrls {contextString:'review'}` → signed R2 URL; customer/server contexts work. | | UPLOAD-02 | PASS | Invalid `contextString` → 400 (zod enum). | | UPLOAD-03 | PASS | Anonymous upload-url request → 401. | | UPLOAD-04 | PASS | Staff `product_info` upload URL → 200. | | UPLOAD-05 | **FAIL (minor)** | Arbitrary mime type (`application/x-msdownload`) accepted → signed URL issued (extension defaults to `.jpg`); no mime allowlist. | | UPLOAD-06..20 | NOT RUN | Actual PUT, size limits, orphan cleanup, delete-on-replace, signed-URL expiry not exercised. | ### Jobs / health (`jobs-health.md`, 15 cases) | Case | Status | Evidence | |---|---|---| | JOB-01 | PASS | tRPC `common.healthCheck` → `{status:'ok'}`; REST `/api/health` → 200. | | JOB-02 | PASS | Superadmin read paths reachable. | | JOB-03..15 | NOT RUN | Cron flash toggle, queue consumers, retry/DLQ, cache jobs not exercised (no scheduler trigger). | ### Staff authentication (`staff-authentication.md`, 15 cases) | Case | Status | Evidence | |---|---|---| | SAUTH-01 | PASS | Wrong staff password / unknown staff → 401; wrong superadmin password → 401. | | SAUTH-02 | PASS | Customer mobile used as staff name → 401 (no cross-identity session). | | SAUTH-05 | PASS (UI) | Admin app cold start restored the staff session (e2eadminA · Mahabubnagar). | | SAUTH-15 | NOT RUN | Admin-web reload identity/region regression not driven (no admin-web surface running). | | SAUTH-03/04/06-14 | NOT RUN | Role/permission matrix, expiry, logout, password change not exercised. | ### Staff management (`staff-management.md`, 14 cases) | Case | Status | Evidence | |---|---|---| | STAFF-01 | PASS | Superadmin created staff id 13 in region 1. | | STAFF-02 | PASS | `roles` → super_admin/admin/marketer/delivery_staff. | | STAFF-03 | PASS | Duplicate name → 409; invalid role → 400; invalid region → 400. | | STAFF-04 (reassign) | PASS | Region update applied to an existing session token (region 1→2). | | STAFF-05 (remove) | PASS | Removed staff token → 401 on next call (SEC-07 resolved). | | STAFF-06..14 | NOT RUN | Permission toggles, store/coupon ownership blocks, concurrent edits not exercised. | ### Profile / account lifecycle (`profile-account-lifecycle.md`, 16 cases) | Case | Status | Evidence | |---|---|---| | PROFILE-01 | PASS | `updateProfile {name}` persisted. | | PROFILE-02 | PASS | `updatePassword` → new password works, old fails; short password → 400. | | PROFILE-03 | PASS | `deleteAccount` with wrong mobile → 400; correct mobile → 200 and the account can no longer log in. | | PROFILE-04..16 | NOT RUN | Suspension interplay, profile image, DOB/gender validation, session invalidation on delete not exercised. | ## 24. Catalogue: stores, products, tags, groups, banners, reviews, vendor ### Regional stores (`regional-stores.md`, 15) | Case | Status | Evidence | |---|---|---| | RSTORE-01/02 | PASS | Created regional store id 11 → visible in region 1 only (`staffB` list does **not** include it). | | RSTORE-03 | PASS | Rename → 200. | | RSTORE-04/SEC-03 | PASS | staffB updating the region-1 store → 404. | | RSTORE-05..15 | NOT RUN | Image replace/delete, product assignment, delete-with-products guard (observed: delete of a store with soft-deleted products → 500 "still has products"), global-store interaction, parity cases. | ### Global stores (`global-stores.md`, 15) | Case | Status | Evidence | |---|---|---| | GSTORE-01 | PASS | Superadmin created global store id 12 (region-less); deleted successfully. | | GSTORE-02..15 | NOT RUN | Elevation, image lifecycle, parity with regional screen, protected delete with global products. | ### Regional products (`regional-products.md`, 20) | Case | Status | Evidence | |---|---|---| | RPROD-01 | PASS | Created regional product id 156 (sku 157, price 123) under store 11. | | RPROD-02 | PASS (contract poor) | SKU without a `quantity` feature → 500 (rejected). | | RPROD-03 | PASS | Read-back returns the created product. | | RPROD-04/SEC-03 | PASS | staffB reading the region-1 product → 404. | | RPROD-05 | PASS | Update (name + price 130) → 200. | | RPROD-06..20 | NOT RUN | Images, variants, increment step, combos across regions, delete protection, parity. | ### Global products (`global-products.md`, 21) — already tested in §STOCK GP-03/04/06 PASS (SKU ids preserved, in-place suspension, market values untouched); GP-07 PASS (regional structural edit refused); GP-14 PASS (anon/customer/staff elevation refused). GP-01/02/05/08/09/10/11/12/13/15..21 **NOT RUN**. ### Combos (`combos.md`, 16) | Case | Status | Evidence | |---|---|---| | COMBO-01 | PASS | Created a `productType:'combo'` product with a component sku → 200 (id 157). | | COMBO-02..16 | NOT RUN | Component availability, combo-only flag, combo pricing, region policy. | ### Tags (`product-tags-ordering.md`, 16) | Case | Status | Evidence | |---|---|---| | TAG-01/02 | PASS | Created dashboard tag id 11 on a region-1 product → 200 and listed. | | TAG-03 | PASS | Update tag → 200. | | TAG-04..16 | NOT RUN | Ordering (`tagsOrder`), deletion, image upload, dashboard ordering, region parity. (Note: `tagsOrder` accepts garbage ids — CFG-17.) | ### Groups (`product-groups.md`, 14) | Case | Status | Evidence | |---|---|---| | GROUP-01/02 | PASS | Created group id 14 with product 30 → 200 and listed. | | GROUP-03 | PASS | Delete group → 200. | | GROUP-04..14 | NOT RUN | Slot snapshot/live membership policy, duplicates, parity. | ### Banners (`banners.md`, 14) | Case | Status | Evidence | |---|---|---| | BANNER-01/02 | PASS | Created banner id 14 (created **inactive** by default) → listed (n=5). | | BANNER-03 | PASS | Update name + `isActive:true` → 200. | | BANNER-04 | PASS | Delete → 200. | | BANNER-05..14 | NOT RUN | Serial ordering, redirect URL validation, active/inactive customer visibility, image lifecycle. | ### Reviews (`reviews.md`, 12) | Case | Status | Evidence | |---|---|---| | REVIEW-01 | PASS | Customer review on product 24 (ratings 5) → 200 (review id 37). | | REVIEW-02 | PASS | Admin `getProductReviews` returns reviews. | | REVIEW-03..12 | NOT RUN | Ratings bounds, images, admin response, delete, legacy conditional coverage. | ### Vendor snippets (`vendor-snippets.md`, 15) | Case | Status | Evidence | |---|---|---| | VENDOR-01/02 | PASS | Created snippet (slot 2072, sku 24, permanent) → 200, listed (n=5). | | VENDOR-03 | PASS | Delete → 200. | | VENDOR-04..15 | NOT RUN | Slot/product scope validation, order packaging per snippet, expiry, parity. | ## 25. Reserved coupons (`reserved-coupons.md`, 18 cases) | Case | Status | Evidence | |---|---|---| | RESERVED-01 | PASS | Regional admin created a reserved coupon (secret `SECRET…`, region 1). | | RESERVED-02 | PASS | Customer redeemed the secret → personal coupon created (id 66, `isUserBased:true`, region 1). | | RESERVED-03 | PASS | Second redemption of the same secret → 400 "Invalid or already redeemed". | | RESERVED-04..18 | NOT RUN | Expiry-at-claim, wrong region/user, reserved→coupon field copy verification, usage limits, invalidation. | ## 26. Coupon stacking & cart guards (`coupon-stacking-and-cart-guards.md`, 47 cases) Only the core stacking behaviours were exercised (CPA-09/10/12/repeat): sequential application in selection order (70 vs 68), exclusive-combination rejection, duplicate-id dedupe, and the aggregate cap on a single coupon. **CSQ-01..47 otherwise NOT RUN** — overlapping-target split slots, negative sub-order guards, multi-coupon caps across sub-orders and cart-guard edge cases need multi-item/multi-slot fixtures that are unavailable with a single active slot. ## 27. Cache publication (`cache-publication.md`, 23 cases) | Case | Status | Evidence | |---|---|---| | CACHE-01 | PASS | After a price write, region-1 `availability_version_num` advanced 22→23 (and products stayed 7 — no regression); values read back through `essentialConsts`. | | CACHE-02 | PASS | `https://assets2.freshyo.in/api-cache-dev/regions/1/v-7/products.json` → 200. | | CACHE-03 | PASS | Region-1 product cache contains 149 entries (matches the admin region-1 product list). | | CACHE-04..23 | NOT RUN | Bounded publication deadline, region isolation of regeneration (CACHE-23/JOB-15), global regeneration narrowing, KV/DB convergence after edits, force-failure paths. | ## 28. Legacy / OTP / recovery / delivery | Checklist | Status | Note | |---|---|---| | Fallback & legacy pages (14) | NOT RUN | Legacy web routes/parity not driven (no legacy surface running). `/api/v1/cm/*` correctly requires auth (SEC-26). | | OTP authentication (15) | N/A (POLICY) | Excluded from the default password suite; no real SMS/OTP was triggered. `user.auth.sendOtp`/`verifyOtp` exist but were not exercised. | | Recovery/platform/accessibility (22) | NOT RUN | Permission-denied, offline recovery, accessibility, RTL, low-end device cases not exercised. | | Delivery operations (14) | NOT RUN | See §18. | | Order edits/rebalance (18) | NOT RUN | See §18. | --- # 29. Continued run — phase 2 (fixtures built, blocked families executed) After the first pass I built the fixtures that were missing and re-ran the blocked families. The earlier summary was superseded; the **revised summary is at the end of this section**. ## 29.1 Fixtures created (all disposable) | Fixture | Value | |---|---| | Region-1 slots | **S1 = 2076** (5 Nov, 7–8 PM), **S2 = 2077** (6 Nov, 7–8 PM), both active and offering every region-1 SKU (163 SKUs) | | Region-2 slot | **Bslot = 2078** (7 Nov), offering the 4 region-2/global SKUs | | OOS product | id 160 / sku 162 | | Regionally-suspended product | id 161 / sku 163 | | Soft-deleted product | id 162 / sku 164 | | Flash-available product | id 163 / sku 165 (flashPrice 55) | | Region-2-only store/product | store 13, product 172 (`E2E BSecret…`, sku) — **not** elevated | | Global product, 2 SKUs | id 159 (skus 160, 161), store 1 | | U1 bound-2 address | id 898 (16.778, 77.998 → bound 2) | | Exact-price fixtures | P1000/P999/P900/P450 (created + deleted per script) | ## 29.2 Coupon stacking & cart guards (`coupon-stacking-and-cart-guards.md`, 47) | Case | Status | Evidence | |---|---|---| | CSQ-01 | PASS | 10% then flat ₹100 on ₹1000 → disc **200**, payable **800**. | | CSQ-02 | PASS | flat ₹100 then 10% → disc **190**, payable **810** (order changes result). | | CSQ-03 | PASS | 15% of ₹999 → disc **150** (integer, `Math.round`). | | CSQ-04 | PASS | 10% then 20% on ₹1000 → **100 + 180 = 280**, payable 720 (second on reduced base). | | CSQ-05 | PASS | flat ₹100 then 50%/cap ₹100 → disc **200** (cap on its own reduced base). | | CSQ-06 | PASS | flat ₹1000 on ₹450 → clamped to **450**, total ₹20 (fee), never negative. | | CSQ-07 | PASS | targeted sku130 (10%) then whole-cart flat ₹100 on ₹329 → **30 + 100 = 130**. | | CSQ-08 | PASS | two overlapping targeted 10% on ₹300 → **30 then 27 = 57**. | | CSQ-09 | PASS | 2-slot cart with one coupon → sub-orders sum to goods − discount + fee; fee charged once. | | CSQ-10 | PASS | preview = persisted order = order detail (`total 800, disc 200`). | | CSQ-11 | PASS | 150% coupon → goods clamped to 0, delivery still added, total ₹20 (no negative). | | CSQ-12 | PASS | single 10% on ₹1000 → disc 100. | | CSQ-13 | PASS | exclusive alone 200; exclusive + other → rejected. | | CSQ-14 | PASS | flat ₹149.5 → rounded to **150**. | | CLS-04 | PASS | `isFirstOrder` returned by `getEligible`; first-order coupon rejected on the 2nd order (CPA-20). | | CLS-07 | PASS | expired coupon absent from `getEligible`. | | CLS-08 | PASS | invalidated coupon absent (CPM-16). | | CLS-09 | PASS | usage-limit-reached coupon absent (CPA-18). | | CLS-10 | PASS | U1-only personal coupon not listed for U2 / not redeemable by U2 (CPA-04). | | CDIS-01 | PASS (UI) | Cart row reads **Products discount** (₹4). | | CDIS-02/03, CLS-01/02/03/05/06/11/12/13/14/15, CGRD-01..09, USR-01..06 | NOT RUN | UI dropdown ordering/disabled reasons, cart-guard banner, and the `create-user` script were not exercised. (Server-side equivalents of CGRD-03 and CDIS-01 were verified: closed-slot rejection and the discount row.) | ## 29.3 Orders / checkout / cancellation with real split groups | Case | Status | Evidence | |---|---|---| | ORDER-02 | PASS | items in S1+S2 → 2 sub-orders, **shared `orderGroupId`**, per-item slot ids preserved. | | ORDER-09 | PASS | `limit 3` → cursor 2600 → next page, **no overlap**, stable ordering. | | ORDER-18 | PASS | multi-item identical-subtotal cart preserved across sub-orders. | | ORDER-19 | PASS | three concurrent `getOrderById` → identical totals. | | ORDER-08 | PASS | U1 order with region-2 address + region-2 SKU + B slot → `regionId:2`, total 131. | | CHECK-13 | PASS | success references a valid group; delivery charged **once** (`fees=[0,0]`). | | CHECK-17/21 | PASS | client `regionId` ignored; address coordinates decide region. | | CANCEL-06 | PASS | cancel primary of a split group → sibling **intact**; coupon still consumed. | | CANCEL-07/08 | PASS | after cancelling **all** siblings the coupon became **re-eligible** (usage restored once). | | CANCEL-05 | PASS | staffB cancelling a region-1 order → 404; order untouched. | | CANCEL-04 | **FAIL (re-confirmed)** | customer can cancel an already-customer-cancelled order once more and the **stored reason is overwritten**; admin path correctly returns 400 "already cancelled". | | ORDER-16 | **FAIL (characterization)** | two concurrent identical submits → two orders (server idempotency deferred). | | ORDER-03/04/10/11/13/14/15/17/20, CHECK-03/04/06/11/12/14/15/16/18/19 | NOT RUN | | | CANCEL-09/10/11/12/13/14/15/16/17/18 | NOT RUN / PARTIAL | | ## 29.4 Order edits, rebalance & delivery operations | Case | Status | Evidence | |---|---|---| | EDIT-01 | PASS | `admin.order.rebalanceSlots {slotIds:[S1,S2]}` → 200, 25 orders updated. | | EDIT-02 | PASS | `removeDeliveryCharge {orderId}` → 200, customer view fee 20 → **0**. | | EDIT-03 | PASS | `updateAddressCoords` persisted new lat/lng. | | EDIT-04..18 | NOT RUN | Item-level repricing, split rebalance edge cases, address-coordinate guards. | | DELIV-01 | PASS | `getSlotOrders {slotId:"2076"}` → 200, 20 orders for the slot. | | DELIV-02 | PASS | `getDeliverySequence`/`updateDeliverySequence` round-trip (`[2602]`). | | DELIV-03..14 | NOT RUN | Maps/sequence ordering UI, location permissions, route optimisation. | ## 29.5 Prices, stock & suspension | Case | Status | Evidence | |---|---|---| | STOCK-01 | PASS | single-SKU price by `skuId` (30: 17 → 17.5), sibling untouched. | | STOCK-02 | PASS | bulk 2 SKUs persisted; untouched SKU unchanged (235). | | STOCK-03/GP-08 | PASS | global SKU market price edited in A (150→157 in B only when B edits); A unchanged when B edits. | | STOCK-04 | PASS | mixed A+B batch → 400 `Invalid SKU IDs: 159`. | | STOCK-05 | PASS | variant OOS → only that variant; server blocks the OOS SKU order; restore works. | | STOCK-06/09 | PASS | global `isSuspended` on a regional SKU → order **400**; kill-switch respected. | | STOCK-07/08 | **FAIL (P0/P1)** | `admin.product.updateProduct {skus[].isSuspendedInRegion:true}` returns **200 but does not persist** (`isSuspendedInRegion` stays `false` on read-back) → regional suspension cannot be set; a "regionally suspended" item is still orderable. | | STOCK-10 | PASS | offer flag set in A only; B unchanged. | | STOCK-11 | INFO | `flashPrice:0`/`marketPrice:0` accepted and served as 0. | | STOCK-12 | **FAIL** | negative (−5) and `1e308` prices accepted and served. | | STOCK-13 | PASS/INFO | empty batch → 400; duplicate `skuId` in a batch → last wins. | | STOCK-15 | **FAIL** | price update on a **soft-deleted** SKU → 200 (obsolete target not rejected). | | STOCK-17 | PASS | price changed while "cart open" → order uses the **current** price (₹255 → ₹265). | | STOCK-16/18/19/20 | NOT RUN | | | SEC-16 | PASS | rejected mixed batch applied **no** partial write (sku29 unchanged). | ## 29.6 Global products (elevation & market seeding) | Case | Status | Evidence | |---|---|---| | GP-01/02 | PASS | one structural global product with 2 SKUs; A and B each see their own market row (independent prices/flags). | | GP-03 | PASS | superadmin structural update preserves SKU ids (no duplicates). | | GP-04 | PASS | in-place global suspension edit — same SKU, no duplicate row. | | GP-05 | PASS | adding a third SKU → 3 SKUs, existing overrides kept. | | GP-06 | PASS | structural save left A/B market values untouched. | | GP-07 | PASS | regional admin structural edit of a global product → 400; name unchanged. | | GP-11 | PASS | global product pointed at a **regional** store → 500 "A global product must use a global store". | | GP-12 | PASS | `superadmin.products.elevate` of the region-2 product → 200, SKU id preserved, `regionId:null`. | | GP-13 | PASS | elevate already-global / missing / foreign-store → all 400. | | GP-14 | PASS | anon/customer/staff elevation → 401. | | GP-17 | PASS | update with a missing product id → 404. | | GP-09/10/15/16/18/19/20/21 | NOT RUN | New-region seeding after global exists, missing market row, tag/group associations, soft-delete with orders, concurrency, failure injection, UI draft bleed. | ## 29.7 Cache publication | Case | Status | Evidence | |---|---|---| | CACHE-04 | PASS | after a price write, region **A** `availability_version_num` 43→44; region **B** unchanged (9). | | CACHE-23/JOB-15 | PASS | a region-A cache request did **not** advance region B's version. | | CACHE-05 / CUSTOMER-17 | PASS | region-A `products.json` (158 items) contains **no** region-2-only SKU. | | CACHE-06 | PASS (INFO) | region-B `products.json` (4 items) contains no A-only SKU. | | CACHE-07/08 | PASS | slots cache `…/regions/1/slots/v-22/slots.json` → 200; availability `…/av-44/availability.json` → 200. Product cache needs the `apiCacheKey` segment; slots/availability do not. | | CACHE-09..22 | NOT RUN | Bounded publication deadline, KV/DB convergence, force-failure paths, tag/const-affecting regeneration. | ## 29.8 Coupon application & management (remainder) | Case | Status | Evidence | |---|---|---| | CPA-05 | PASS | 50% targeted sku24 in a ₹235+₹300 cart → disc **118** (only the target line). | | CPA-08 | PASS | target ₹29 exactly at `minOrder` → disc 3. | | CPA-14 | PASS | overlapping targeted coupons on a split order → **no negative sub-order**; discs 156/162. | | CPA-15 | PASS | two flat ₹900 on ₹235 → disc clamped to 235, total ₹20. | | CPA-16 | PASS | coupon targeting only OOS/suspended SKUs → no eligible target, rejected. | | CPA-18 | PASS | `maxLimitForUser:1` → 2nd order rejected and the coupon leaves `getEligible`. | | CPA-19 | PASS | concurrent one-use coupon → one 200 + one rejection (no overuse). | | CPA-20 | PASS | first-order coupon works on order 1, rejected on order 2. | | CPA-22 | PASS | stored discount unchanged after the coupon is edited. | | CPA-24 | PASS | expired coupon rejected at spend and hidden from the list. | | CPA-25 | **FAIL (minor)** | `getEligible {regionId: 99999}` → 200 with the full coupon list (no region validation); `-1` → 400. | | CPA-28 | PASS | targeted `minOrder 400`: qty 2 accepted, qty 1 rejected. | | CPA-02/11/23/26/27 | NOT RUN | | | CPM-05 | PASS | multi-code batch created 2 coupons. | | CPM-07 | PASS | duplicate code → rejected. | | CPM-12 | PASS | clearing `skuIds` on edit → whole-cart. | | CPM-13 | INFO | `maxValue:0`/`minOrder:0` accepted; order still discounted. | | CPM-14 | INFO | past and future `validTill` both accepted at creation; eligibility enforced at spend. | | CPM-16 | PASS | invalidating a used coupon blocks new spend; the old order's discount is unchanged. | | CPM-18 | PASS | concurrent duplicate create → one 200, one rejection. | | CPM-19/20 | NOT RUN | Audit attribution / picker UI. | | RESERVED-04 | PASS | expired reserved secret → rejected at claim. | | RESERVED-05 | PASS | invalid secret → 400. | | RESERVED-06 | PASS | redeemed coupon copies fields (20% / minOrder 100 / user-based / region 1). | | RESERVED-07 | PASS | the reserved secret is not visible to another user. | | RESERVED-08..18 | NOT RUN | | ## 29.9 Products with availability states (cart guard / OOS) | Case | Status | Evidence | |---|---|---| | CART-08 (OOS) | PASS | ordering the OOS SKU → 400 "Product … is unavailable". | | CART-08 (soft-deleted) | PASS | ordering the soft-deleted SKU → 400. | | CART-08 (regionally suspended) | **FAIL** | the regionally-suspended SKU was **orderable** (root cause: STOCK-07/08 persistence bug). | | CACHE/CATALOG isolation | PASS | UI search for a region-2-only product while browsing region 1 → **"No products found"** — CUSTOMER-17 **not reproduced**. | ## 29.10 Flash delivery (enabled path) | Case | Status | Evidence | |---|---|---| | FLASH-02 | PASS | enabling `isFlashDeliveryEnabled` on bound 1 → served `true`, flash fee ₹69. | | FLASH-03 | PASS | flash order with `slotId:null` → 200, total 124 (80 goods + 69 flash fee). | | FLASH-04 | **FAIL** | a **non-flash-available** SKU was accepted into a flash order (no per-item flash validation). | | FLASH-05 | INFO | flash with a scheduled slot still succeeds. | | FLASH-06/07/08 | PASS (UI) | Flash tab available ("Delivery in within 1 hour"); add shows the **pink flash cart** (₹233, "₹267 more for FREE Delivery" = ₹500 flash threshold), separate from the blue regular cart. | | FLASH-09..16 | NOT RUN | Flash cron toggle, flash pricing per item, flash cart checkout, capacity. | ## 29.11 Complaints, customer ops, uploads, staff, profile (remainder) | Case | Status | Evidence | |---|---|---| | COMPLAINT-06 | PASS | complaint with `imageUrls` → 200. | | COMPLAINT-07 | PASS | complaint with no `orderId` → 200. | | COMPLAINT-08 | PASS | empty body → 400. | | COMPLAINT-09 | PASS | paginated admin list (limit 3 → cursor 108 → no overlap). | | COMPLAINT-10 | **FAIL** | resolving an **already-resolved** complaint → 200 and the stored **response is overwritten**. | | COMPLAINT-11 | INFO | `