From 84ccd5e8afa57922cb1b32e4d6ee23d5a0568c46 Mon Sep 17 00:00:00 2001 From: shafi54 <108669266+shafi-aviz@users.noreply.github.com> Date: Sun, 18 Oct 2026 10:59:18 +0530 Subject: [PATCH] enh --- docs/test-cases/README.md | 35 +++++++++++++------ docs/test-cases/addresses.md | 4 +-- .../test-cases/authorization-api-contracts.md | 3 +- docs/test-cases/cache-publication.md | 1 + docs/test-cases/cancellation.md | 10 +++--- docs/test-cases/cart.md | 2 +- docs/test-cases/checkout.md | 5 +-- docs/test-cases/coupon-application.md | 4 +-- docs/test-cases/coupon-management.md | 1 + .../customer-management-incidents.md | 1 + docs/test-cases/global-products.md | 1 + docs/test-cases/global-stores.md | 1 + docs/test-cases/jobs-health.md | 1 + docs/test-cases/location-region-switching.md | 6 ++-- docs/test-cases/notifications.md | 1 + docs/test-cases/orders.md | 8 +++-- docs/test-cases/pricing-delivery-fees.md | 4 +-- docs/test-cases/profile-account-lifecycle.md | 2 +- docs/test-cases/regions.md | 1 + docs/test-cases/staff-authentication.md | 1 + prompts/test.txt | 0 21 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 prompts/test.txt diff --git a/docs/test-cases/README.md b/docs/test-cases/README.md index 07bb14a..1a05d22 100644 --- a/docs/test-cases/README.md +++ b/docs/test-cases/README.md @@ -4,11 +4,11 @@ This folder contains feature-by-feature acceptance and regression checklists for Freshyo's customer mobile/web apps, regional admin mobile/web apps, superadmin web app, backend, cache/jobs, and legacy fallback surfaces. -**All cases are proposed and NOT RUN.** A listed expected result is a requirement to verify, not a claim that the implementation currently satisfies it. Known review defects are intentionally covered. Documentation creation does not authorize running tests, sending notifications, charging payments, deleting data, or applying migrations. +**All cases are proposed and NOT RUN.** A listed expected result is a requirement to verify, not a claim that the implementation currently satisfies it. Known review defects are intentionally covered. Documentation creation does not authorize running tests, placing real orders, sending notifications, deleting data, or applying migrations. -Inventory: **46 feature checklists and 862 uniquely identified cases**, plus this index. Features are grouped by business responsibility; closely related operations share a checklist (for example stock, offer flags and suspension). Reuse the shared boundary/security matrix rather than assuming a finite list can cover every possible input. +Inventory: **45 feature checklists and 855 uniquely identified cases**, plus this index. Features are grouped by business responsibility; closely related operations share a checklist (for example stock, offer flags and suspension). Reuse the shared boundary/security matrix rather than assuming a finite list can cover every possible input. -Sources: current routers/screens/helpers, existing API tests, [sanity plan](../e2e-sanity-test-plan.md), and [branch review](../multi-region-i2-review.md). Older sanity-plan statements that coupons ignore regions/SKUs are superseded here by the newer coupon requirements. Vendor snippets and reviews remain conditional/legacy coverage; online gateway cases are readiness coverage until implementation is enabled. +Sources: current routers/screens/helpers, existing API tests, [sanity plan](../e2e-sanity-test-plan.md), and [branch review](../multi-region-i2-review.md). Older sanity-plan statements that coupons ignore regions/SKUs are superseded here by the newer coupon requirements. Vendor snippets and reviews remain conditional/legacy coverage. Checkout is COD-only; online payment is not part of this release. ## How to use each checklist @@ -33,9 +33,9 @@ Use isolated staging with dedicated DB/KV/assets/queues and sandbox recipients. | Products | A-only P with two SKUs, B-only Q, global G with independent A/B prices; regular-only R; flash F with a distinct price; combo C and combo-only component K. | | Availability | Available, OOS, globally suspended, regionally suspended, soft-deleted variants; preserve a historical order referencing one. | | Slots | Two valid A slots S1/S2, B slot, inactive/frozen/full/past slots, and midnight-boundary times. | -| Addresses | U1 in A1/A2/B1; U2-only address; default and sole-address fixtures; legacy address without a stored bound; a zero-address signed-in customer for the cart gate. Coordinates are mandatory. | +| Addresses | U1 in A1/A2/B1; U2-only address; default and sole-address fixtures; legacy address without a stored bound; a zero-address signed-in customer for the cart gate. Coordinates are required by the current add/edit UI; legacy API-created rows may omit them and fall back to the region's effective bound. | | Coupons | Regional A/B and global; percentage/flat; targeted/whole-cart; capped, min-spend, exclusive, first-order, limited-use, user-only, expired/invalidated, reserved. | -| Orders | Pending COD, packaged, verified, delivered, cancelled, multi-slot group; payment/refund fixtures only in approved sandbox. | +| Orders | Pending COD, packaged, verified, delivered, cancelled, multi-slot group; no online-payment or refund fixtures. | | Money | T = free threshold, D = fee; test T−0.01, T, T+0.01. Example goods: ₹100 targeted + ₹900 unrelated. Separate regular/flash values. | | Content | Tags, groups, active/inactive banners, images, supported notification links, complaints and incident fixtures. | @@ -59,12 +59,12 @@ Use unique run prefixes. Do not delete regions for cleanup: region deletion is u ## Policy checkpoints -- Currency rounding and residual allocation: choose a consistent minor-unit policy; don't assert an invented rounding mode. -- Percentage stacking: confirm whether successive percentages use original or remaining eligible value. Regardless, targets, caps, nonnegative totals, and client/server agreement are mandatory. +- Discounts round to the nearest rupee; per-sub-order shares allocate whole rupees and reconcile exactly to the charged discount. +- Coupons stack sequentially on the remaining eligible amount, in the customer's selection order. Each coupon's cap applies to its own reduced base; reversing the order can change the result. - Global coupon targeting regional products: confirm intended authoring restrictions; never permit a regional author to attach another region's private SKU. - Combo component availability, group-to-slot snapshot/live membership, global-name uniqueness/case normalization, and account-switch cart behavior need explicit decisions where not specified. - No general minimum order value is required by the current policy. Coupon `minOrder` is independent from free-delivery thresholds. -- The browsing region is never persisted: each launch re-derives it from the device location and/or the default address (see [location and switching](location-region-switching.md)). Do not assert a "saved region" survives relaunch. +- **Native** never persists the browsing region: each launch re-derives it from the device location and/or the default address (see [location and switching](location-region-switching.md)). **Web** persists the selected region in `freshyo-region` and validates it against `listRegions`. - UI duplicate-submit prevention is required. Server order-idempotency was previously deferred: record concurrent API behavior and ambiguous-retry exposure, not an assumed guaranteed deduplication. - Define concurrency guarantees for capacity, default-address updates, limited coupons, and reserved redemption. Financial/one-time invariants must not silently be weakened to match observed races. @@ -72,11 +72,24 @@ Use unique run prefixes. Do not delete regions for cleanup: region deletion is u | Review issue | Cases | |---|---| +| Customer search bypasses regional isolation | CUSTOMER-17 | | Web discovery input mismatch | CFG-01, CAT-01, CACHE-01 | | Global SKU ID stripped on edit | GP-03, GP-04 | -| Overlapping coupons/negative sub-orders | CPA-14, MONEY-12 | +| Rejected regional edit deletes global store image | GSTORE-15 | +| Regional cache request narrows a global regeneration | CACHE-23, JOB-15 | +| Web scheduled checkout submits null slot IDs | CHECK-22 | +| New-region cache generation detached from request | REGION-16 | +| Global-product create/edit draft bleed | GP-21 | +| Quiet-region orders hidden by global ID window | ORDER-21 | +| Startup region adoption clears persisted cart | CART-11, LOC-09, LOC-21 | +| Unrelated market edit clears regional suspension | STOCK-07, STOCK-08 | +| Overlapping coupons/negative sub-orders | CPA-14, MONEY-12, CSQ-06, CSQ-11 | | Uncapped mobile preview | CPA-15, MONEY-13 | -| Regional suspension lost on reopen | STOCK-07, STOCK-08 | +| Historical discount backfilled as zero | ORDER-22 (accepted limitation) | +| Global coupon type switch keeps old discount | CPM-21 | +| Admin-web reload loses staff identity/region | SAUTH-15 | +| Superadmin admin notification uses staff-only endpoint | PUSH-19 | +| Customer can reach admin protected procedures | SEC-28 | | Global SKU rejected by bulk prices | STOCK-03, STOCK-04 | | Targeted minOrder uses whole cart in UI | CPA-07, CPA-08 | @@ -95,4 +108,4 @@ Screenshot/log links (redacted): Cleanup / retained evidence / linked defect: ``` -Recommended first pass: AUTH-01, CFG-01, LOC-19, GP-03, STOCK-03, STOCK-07, SLOT-01, CART-01, ADDR-01, CHECK-01, MONEY-01, CPA-01, CPA-07, CPA-14, ORDER-01, FUL-01, CANCEL-01, SEC-01, CACHE-01. Then execute all P0 cases before release and the remaining applicable cases in the full regression run. +Recommended first pass: AUTH-01, CFG-01, LOC-19, CUSTOMER-17, GP-03, GP-21, STOCK-03, STOCK-07, SLOT-01, CART-01, ADDR-01, CHECK-01, CHECK-22, MONEY-01, CPA-01, CPA-07, CPA-14, ORDER-01, FUL-01, CANCEL-01, SEC-01, SEC-28, CACHE-01, CACHE-23, REGION-16. Then execute all P0 cases before release and the remaining applicable cases in the full regression run. diff --git a/docs/test-cases/addresses.md b/docs/test-cases/addresses.md index e1006cc..2fbbc60 100644 --- a/docs/test-cases/addresses.md +++ b/docs/test-cases/addresses.md @@ -1,6 +1,6 @@ # Addresses, defaults and attached location -Scope: customer address CRUD, Me/Cart selectors, checkout summary, region/bound derivation from coordinates. Use disposable address fixtures and U1/U2. Coordinates are mandatory; the region (City) and bound are derived from them, `pincode` no longer exists, and State is fixed to Telangana. +Scope: customer address CRUD, Me/Cart selectors, checkout summary, region/bound derivation from coordinates. Use disposable address fixtures and U1/U2. The current add/edit UI requires coordinates; legacy API clients may omit them and fall back to the region's effective bound. The region (City) and bound are derived from coordinates when present, `pincode` no longer exists, and State is fixed to Telangana in the UI. | ID | Priority | Action / input | Expected result | |---|---|---|---| @@ -30,4 +30,4 @@ Scope: customer address CRUD, Me/Cart selectors, checkout summary, region/bound | ADDR-24 | P1 | Open the add form: City dropdown, State field, Submit before/after attaching a location. | City lists the serviceable regions and pre-selects the current browsing region; State is fixed to Telangana and uneditable; coordinates must fall inside the chosen town (else rejected); Add Address disabled until a location is attached. | | ADDR-25 | P1 | Signed-out user drafts an address, then logs in/registers. | The draft is posted exactly once after authentication (first saved address becomes default); a failed sync keeps the draft for retry. | -Policy checkpoint: coordinates are mandatory and the bound is always derived from them; confirm whether any legacy coordinate-free address may still order, and record the default-clearing vs keep-a-default behaviour rather than assuming both contradictory behaviours. +Policy checkpoint: the current UI requires coordinates and derives the bound from them; legacy coordinate-free rows may still order using the region's effective bound. Record the default-clearing vs keep-a-default behaviour rather than assuming both contradictory behaviours. diff --git a/docs/test-cases/authorization-api-contracts.md b/docs/test-cases/authorization-api-contracts.md index 24186bf..5792986 100644 --- a/docs/test-cases/authorization-api-contracts.md +++ b/docs/test-cases/authorization-api-contracts.md @@ -12,7 +12,7 @@ For **each relevant route**, test anonymous, U1, U2, staff A, staff B, superadmi | SEC-02 | P0 | Regional staff calls superadmin region/staff/global CRUD/config. | No escalation, including legacy global-config endpoints. | | SEC-03 | P0 | Staff B probes A product/store/slot/tag/group/banner/coupon IDs. | Read/write/delete denied; no existence-sensitive private content. | | SEC-04 | P0 | Authorized A object save with B SKU/store/group/related IDs. | Entire invalid association rejected without hidden partial writes. | -| SEC-05 | P0 | U2 probes U1 address/order/complaint/payment/coupon IDs. | Ownership always enforced, including signed payment callbacks. | +| SEC-05 | P0 | U2 probes U1 address/order/complaint/coupon IDs. | Ownership always enforced on every customer-private surface. | | SEC-06 | P0 | Forged/expired/malformed JWT, altered identity/region/role fields. | Verification fails; no default or fallback privilege. | | SEC-07 | P0 | Removed staff/deleted user token; staff reassigned A→B. | Current identity/assignment enforced; old region claim not trusted alone. | | SEC-08 | P0 | Regional edit of global product structural fields/global suspension. | Only authorized market fields writable; globally shared structure protected. | @@ -35,6 +35,7 @@ For **each relevant route**, test anonymous, U1, U2, staff A, staff B, superadmi | SEC-25 | P0 | Reads/mutations after UI logout or account switch with cached queries. | Private stale data cleared; API still denies unauthorized access. | | SEC-26 | P1 | Public health/legacy operational/deep-link routes. | Sensitive operations require intended authority, not merely knowledge of URL. | | SEC-27 | P1 | Authorization failure followed by valid retry. | No poisoned transaction/loading guard; valid request succeeds once. | +| SEC-28 | P0 | Customer token calls admin `getStaff`, `createStaffUser`, `getRoles` and `savePushToken` directly. | Staff-only expectation: denied before any staff/role data or write. If customers are intentionally allowed, document it and downgrade the case. | ## Evidence requirements diff --git a/docs/test-cases/cache-publication.md b/docs/test-cases/cache-publication.md index b900c4b..127a985 100644 --- a/docs/test-cases/cache-publication.md +++ b/docs/test-cases/cache-publication.md @@ -26,5 +26,6 @@ Scope: products/stores/store-detail/banners caches, availability/slot caches, re | CACHE-20 | P2 | Client cache/poll interval, repeated refetch under slow network. | No uncontrolled request storm; bounded retries and accurate status. | | CACHE-21 | P0 | Public JSON/private data inspection. | No user/staff credentials, address/order/complaint leakage in static catalog. | | CACHE-22 | P1 | Deleted/deactivated region metadata or bound priority change. | Correct discovery rebuild and bound-scoped cache key; no stale fee. | +| CACHE-23 | P0 | Request a global regeneration, then make a regional edit inside the same debounce window. | The global “all regions pending” marker wins; every region regenerates. A later regional request cannot narrow the pending set. | Paths must match backend builders, including catalog's API-cache-key prefix and availability/slots paths. Deadline breaches are failures with version evidence, not assumptions based on a UI screenshot. diff --git a/docs/test-cases/cancellation.md b/docs/test-cases/cancellation.md index 339d32b..254f1c5 100644 --- a/docs/test-cases/cancellation.md +++ b/docs/test-cases/cancellation.md @@ -1,24 +1,24 @@ # Order cancellation and group-aware coupon restoration -Scope: customer/admin cancellation, reason/actor/status, group usages, refund eligibility and upcoming/vendor views. +Scope: customer/admin cancellation, reason/actor/status, group usages, COD-only compensation policy and upcoming/vendor views. There is no online payment and no refund record. | ID | Priority | Action / input | Expected result | |---|---|---|---| | CANCEL-01 | P0 | Customer cancels pending COD order with valid reason. | Cancelled status/reason/actor stored; not fulfillable/upcoming; no cash refund owed. | | CANCEL-02 | P0 | Authorized admin cancels pending order. | Admin actor distinguishable; customer/admin see same state. | | CANCEL-03 | P1 | Blank/space/long/Unicode reason. | Agreed required reason/limits; clear validation. | -| CANCEL-04 | P0 | Cancel delivered/already-cancelled/missing order. | Legal-state checks; no duplicate refund/compensation or resurrection. | +| CANCEL-04 | P0 | Cancel delivered/already-cancelled/missing order. | Legal-state checks; no duplicate cancellation/usage restoration or resurrection. | | CANCEL-05 | P0 | U2 cancels U1; B admin cancels A. | Denied; owner order/usage untouched. | | CANCEL-06 | P0 | Cancel primary of split group only. | Other sibling intact; coupon usage still consumed while any effective sibling remains. | | CANCEL-07 | P0 | Cancel nonprimary only, then all remaining siblings. | Usage removed only on complete group cancellation. | | CANCEL-08 | P0 | Multiple coupons on fully cancelled group. | Every group's usage restored once, not just first coupon. | | CANCEL-09 | P1 | Cancel single non-group/legacy order. | Defined legacy restoration; no unrelated group's usages removed. | | CANCEL-10 | P0 | First effective order partially/fully cancelled. | First-order coupon eligibility based on effective groups consistently. | -| CANCEL-11 | P1 | Cancellation racing with second sibling cancellation. | Correct final group restoration; no duplicate compensation/refund. | +| CANCEL-11 | P1 | Cancellation racing with second sibling cancellation. | Correct final group restoration; no duplicate usage restoration or compensation event. | | CANCEL-12 | P0 | Cancellation races packaging/delivery. | Coherent legal transition, no final contradictory statuses. | -| CANCEL-13 | P1 | Cancel after price/coupon/config edits. | Monetary compensation/refund based on stored charge, not current catalog. | +| CANCEL-13 | P1 | Cancel after price/coupon/config edits. | Any approved compensation uses the stored charge, not the current catalog; no online refund record is created. | | CANCEL-14 | P1 | Cancelled order in admin filters, vendor totals and next-order glimpse. | Correct exclusion/inclusion by filter, no production demand for cancelled item. | -| CANCEL-15 | P1 | Cancellation transaction fails midway. | No half-cancelled status/usage/refund state; safe retry. | +| CANCEL-15 | P1 | Cancellation transaction fails midway. | No half-cancelled status/usage state; safe retry. | | CANCEL-16 | P1 | Notification/Telegram fails after cancellation saved. | State persisted and recoverable; no duplicate cancel from retry. | | CANCEL-17 | P1 | Cart after cancellation. | No unexpected automatic cart restoration/duplicate item unless explicit policy. | | CANCEL-18 | P2 | Cancel confirmation/back/error dialog. | Cancel-dialog dismissal does not mutate; errors visible and loading clears. | diff --git a/docs/test-cases/cart.md b/docs/test-cases/cart.md index 4ec8eb8..9ddec95 100644 --- a/docs/test-cases/cart.md +++ b/docs/test-cases/cart.md @@ -14,7 +14,7 @@ Scope: local cart storage, query hooks, quantity/slot reconciliation, floating/e | CART-08 | P0 | One line becomes OOS/suspended/deleted; all lines invalid. | Clearly excluded from pricing/submit; all-invalid checkout blocked. | | CART-09 | P1 | Notes entered, navigate checkout/back, edit again. | Latest notes survive and are submitted; readonly checkout agrees. | | CART-10 | P1 | Apply/remove several coupons, quantity changes. | Eligibility/discount recomputed; no stale invalid selected discount. | -| CART-11 | P0 | Confirm A→B switch (from an already-set region); cancel switch. | Confirm clears regional state/both carts; cancel preserves everything. First region adoption at cold start is not this path and does not clear. | +| CART-11 | P0 | Confirm A→B switch (from an already-set region); cancel switch. | Confirm clears regional state/both carts; cancel preserves everything. First region adoption at cold start is not this path and must not clear. **Known open:** review finding #10 reports startup adoption can still wipe the cart; record a failure rather than assuming the requirement is met. | | CART-12 | P1 | Two rapid adds/different SKU writes and concurrent controls. | No lost storage update or duplicate local ID/negative quantity. | | CART-13 | P1 | Corrupt JSON/storage unavailable/full. | Recoverable state; never order corrupted/unknown quantity. | | CART-14 | P1 | Catalog ID missing after product deletion or region switch. | Useful missing-line state; no zero-priced purchasable phantom. | diff --git a/docs/test-cases/checkout.md b/docs/test-cases/checkout.md index 938471b..7826611 100644 --- a/docs/test-cases/checkout.md +++ b/docs/test-cases/checkout.md @@ -23,7 +23,8 @@ Scope: regular/flash checkout, route params, selected address/slots/coupons/note | CHECK-17 | P0 | Client-supplied regionId/bound differs from the order address coordinates. | Server derives region+bound from the address coordinates and ignores the client override. | | CHECK-18 | P1 | One cart item invalid, several valid; flash eligibility changed. | Summary and submitted item subset/charge agree. | | CHECK-19 | P2 | Android back/iOS swipe/browser refresh/deep link. | No stale cart, lost instruction or login-return loop. | -| CHECK-20 | P1 | Online option in current build. | Clearly disabled until gateway feature enabled; COD invokes no gateway. | +| CHECK-20 | P1 | Online option in current build. | Online payment is intentionally absent/disabled for this release; COD is the only usable method and invokes no gateway. | | CHECK-21 | P0 | Place an order whose address coordinates are in B while the client browsing region is A. | Order is scoped to the address's region/bound (from coordinates); the browsing region is not corrupted. | +| CHECK-22 | P0 | Web scheduled checkout with items assigned to S1 and S2. | Each submitted item carries its own selected slot ID; no scheduled item is sent with `null`, so checkout succeeds and both slots persist. | -Known policy: server order-idempotency is deferred; concurrent raw API submissions are characterization/risk cases, not an assumed deduplicated happy path. +Known policy: checkout is COD-only; the online method is intentionally absent/disabled. Server order-idempotency is deferred; concurrent raw API submissions are characterization/risk cases, not an assumed deduplicated happy path. diff --git a/docs/test-cases/coupon-application.md b/docs/test-cases/coupon-application.md index 596874f..689d69e 100644 --- a/docs/test-cases/coupon-application.md +++ b/docs/test-cases/coupon-application.md @@ -12,7 +12,7 @@ Scope: getEligible/getMyCoupons, cart selection, checkout `couponIds`, shared pr | CPA-06 | P0 | Target P but cart contains only Q; empty target list. | Targeted no-match rejected; untargeted applies to eligible whole cart. | | CPA-07 | P0 | Min ₹200 targeted goods: P ₹50 + unrelated ₹300. | UI disables; server rejects, no consumed usage. Regression R7. | | CPA-08 | P1 | Targeted min−0.01/min/min+0.01; change qty/flash price/stock. | Eligibility based on actual available target subtotal and recomputed. | -| CPA-09 | P0 | Stack percentage and flat coupons in reverse input order. | Defined percentage-first computation; stable per-type ordering/caps. | +| CPA-09 | P0 | Stack percentage and flat coupons in reverse input order. | Each coupon applies to the remaining eligible amount in the supplied selection order; reversing the order can change the total; each coupon's cap applies to its own reduced base. | | CPA-10 | P0 | Exclusive coupon alone, exclusive plus one/another exclusive. | Alone works; all combinations with another coupon rejected. | | CPA-11 | P1 | Select exclusive after nonexclusive and vice versa. | Clear selection/replacement behavior; UI cannot knowingly submit invalid combination. | | CPA-12 | P1 | Duplicate coupon IDs, empty array, many eligible coupons. | Dedupe usages; no imposed coupon-count cap; empty works. | @@ -33,4 +33,4 @@ Scope: getEligible/getMyCoupons, cart selection, checkout `couponIds`, shared pr | CPA-27 | P1 | Small target contribution rounds below minor unit. | Agreed currency rounding/usage behavior; per-order sum reconciles. | | CPA-28 | P1 | Quantity reduction makes selected coupon ineligible before submit. | UI flags/removes invalid discount and submits coherent IDs. | -Policies: percentage original-vs-remaining basis and zero-cap/zero-limit semantics need explicit approval. Caps, targeting, exclusive-only behavior and client/server parity are mandatory. +Policies: coupons stack sequentially on the remaining eligible amount in selection order, rounded to the nearest rupee. Zero-cap/zero-limit semantics still need explicit approval. Caps, targeting, exclusive-only behavior and client/server parity are mandatory. diff --git a/docs/test-cases/coupon-management.md b/docs/test-cases/coupon-management.md index 6fd39a2..4c227ce 100644 --- a/docs/test-cases/coupon-management.md +++ b/docs/test-cases/coupon-management.md @@ -26,5 +26,6 @@ Product targeting model: a coupon's target SKUs live **only** in its own `sku_id | CPM-18 | P1 | Concurrent duplicate creation/save failure mid-relations. | One coherent coupon; no duplicate/orphan target rows. | | CPM-19 | P1 | Global coupon creator has no staff-user row. | Supported author metadata persists without FK error; audit policy explicit. | | CPM-20 | P2 | Product picker with same names, global badges and edit hydration. | Correct SKU IDs retained in `sku_ids`; selection shown on the coupon card and reconstructed on edit. | +| CPM-21 | P0 | Edit a percentage coupon to a flat discount, save, and use it; repeat the reverse switch. Test once as a regional admin and once as superadmin on a global coupon. | The opposite discount field is cleared; only the new discount type is stored and applied. Merely sending one field must not preserve the old percentage/flat value. | Policy checkpoint: global coupons targeting regional-only products and audit attribution for superadmin creation. Do not assume an unimplemented global-coupon UI exists: API cases remain applicable. diff --git a/docs/test-cases/customer-management-incidents.md b/docs/test-cases/customer-management-incidents.md index 5866081..88d7ad5 100644 --- a/docs/test-cases/customer-management-incidents.md +++ b/docs/test-cases/customer-management-incidents.md @@ -20,5 +20,6 @@ Scope: admin user lists/details/essentials, search, updateUserSuspension, user i | CUSTOMER-14 | P1 | Pagination/sorting across many regional customers/orders. | No duplicates, skipped associated customers or foreign-order statistics. | | CUSTOMER-15 | P1 | Incident does not automatically suspend customer. | No undocumented enforcement side effect; actual score/suspension distinct. | | CUSTOMER-16 | P2 | Search slow/error, large details/history, mobile number copy/link. | Useful retry and accurate actionable data, no endless spinner. | +| CUSTOMER-17 | P0 | Admin A and Admin B search by a customer who has an order in the other region; also search a name shared by customers in both regions. | Each admin sees only customers associated with their own region (current search is order-based); no cross-region mobile/name leakage. | Policy checkpoint: which user fields are globally visible to staff, region eligibility for suspension and score rules. Do not equate global customer identity with unrestricted private-data access. diff --git a/docs/test-cases/global-products.md b/docs/test-cases/global-products.md index 377fe18..0acb3d5 100644 --- a/docs/test-cases/global-products.md +++ b/docs/test-cases/global-products.md @@ -24,5 +24,6 @@ Scope: superadmin global product CRUD, regional market-only editing, `superadmin | GP-18 | P1 | Concurrent region creation/global SKU creation/elevation. | One market row per SKU/region; no partial publish or missing seed. | | GP-19 | P1 | Bad upload or failed save/elevation midway. | No partial structural/region change; retry does not duplicate SKUs. | | GP-20 | P2 | Regional readonly badge/details and superadmin image picker. | Ownership obvious; cancel/reload preserves IDs and edits. | +| GP-21 | P1 | Open global-product Create, type a draft, click Edit on another product, then click Create again. | The Edit form shows the selected product; a fresh Create form is empty. Draft state and submitted target never bleed between products. | Policy checkpoint: cross-region regional components in global combos must be explicitly restricted or given a serviceability policy. See [combos](combos.md). diff --git a/docs/test-cases/global-stores.md b/docs/test-cases/global-stores.md index 8a247b8..1a5fdc2 100644 --- a/docs/test-cases/global-stores.md +++ b/docs/test-cases/global-stores.md @@ -18,5 +18,6 @@ Scope: `superadmin.globalStores`, regional read-only global stores and customer | GSTORE-12 | P1 | Concurrent edit/delete or upload failure. | Coherent record and cache outcome; no orphan published product store. | | GSTORE-13 | P2 | Global badge/read-only affordance in regional UI. | Clear ownership and no misleading editable form. | | GSTORE-14 | P1 | Same-name regional/global records if allowed. | Selection uses IDs, not ambiguous label or first match. | +| GSTORE-15 | P0 | Regional admin attempts to edit a global store that has an image; the edit is rejected. | Store and image object remain unchanged; the rejection happens before any asset deletion or partial write. | Related: [global products](global-products.md). diff --git a/docs/test-cases/jobs-health.md b/docs/test-cases/jobs-health.md index e6ad665..ed7a8cd 100644 --- a/docs/test-cases/jobs-health.md +++ b/docs/test-cases/jobs-health.md @@ -18,5 +18,6 @@ Scope: cache creator/store initialization, regional flash schedules, supported q | JOB-12 | P1 | Many regions/SKUs and supported bulk initialization. | All batches processed; no SQL parameter limit truncation. | | JOB-13 | P1 | Regional versions and in-memory store freshness after initialization. | No global singleton leaking another region's product flags. | | JOB-14 | P2 | Logs/alerts on permanent failure. | Actionable redacted error plus scope/event identity; no endless silent retries. | +| JOB-15 | P1 | Global cache request followed by a regional request before the alarm runs; inspect the durable pending state. | The all-regions-pending marker survives the alarm, clears the per-region list, and cannot be overwritten by a regional request. | Health HTTP semantics, job exactly-once/dedup behavior and retry limits must be explicit. Queue acceptance is not evidence of completed downstream delivery. diff --git a/docs/test-cases/location-region-switching.md b/docs/test-cases/location-region-switching.md index 3301c5e..135f45d 100644 --- a/docs/test-cases/location-region-switching.md +++ b/docs/test-cases/location-region-switching.md @@ -12,7 +12,7 @@ Scope: native location store/useRegion, web region gate/store, manual selector, | LOC-06 | P0 | Both A carts populated; request B switch, cancel then confirm. | Cancel preserves all; confirm clears regional carts/slots/coupons/address context and loads B. | | LOC-07 | P0 | Rapid A→B→A with delayed catalog responses. | Region-generation guard rejects stale B/A responses and mixed prices. | | LOC-08 | P1 | Relaunch after the region's service metadata changed/removed. | Region re-derived (nothing persisted); changed metadata revalidated; no stale cached context. | -| LOC-09 | P1 | Cold launch physically in B with A carts. | One-shot resolution follows the anchored startup decision; region adoption does not clear the local cart; no silent mixed-region order. | +| LOC-09 | P1 | Cold launch physically in B with A carts. | One-shot resolution follows the anchored startup decision; region adoption does not clear the local cart; no silent mixed-region order. **Known open:** startup adoption can still wipe the cart (review #10); record a failure if observed. | | LOC-10 | P1 | U1 A/B addresses; default B while browsing A. | No automatic foreign default override; A browsing choice retained. | | LOC-11 | P0 | Explicit foreign-address switch confirm/cancel. | Same safe region-switch behavior and cleared regional state. | | LOC-12 | P1 | Saved address without a stored bound. | Bound is derived from the address coordinates; never a foreign region's bound; warnings accurate. | @@ -23,8 +23,8 @@ Scope: native location store/useRegion, web region gate/store, manual selector, | LOC-17 | P2 | Emulator/mock-location environment vs physical device. | Supported location path without production-only/emulator-only assumptions. | | LOC-18 | P0 | Change region while submit request is pending. | No duplicate order or new-region UI falsely representing old-region order. | | LOC-19 | P0 | Cold launch (a) with a default address in the resolved region, (b) with the location resolving to another serviceable region, (c) with location off/out-of-area and a default address, (d) with no default address. | (a) use the default silently; (b) ask the user to choose; (c) use the default; (d) use the resolved region, else ask. | -| LOC-20 | P1 | Set a region → force-quit → relaunch with location unavailable. | Nothing is persisted: the region is re-derived (default address / location); when neither resolves a chooser appears — a previously set region does not silently survive. | -| LOC-21 | P0 | Cold start adopts the first region while a local cart has items. | Adoption uses the non-clearing path (local cart preserved). Only an explicit switch away from an already-set region confirms and clears regional state. | +| LOC-20 | P1 | Set a region → force-quit → relaunch with location unavailable. | **Native:** nothing is persisted; the region is re-derived from the default address/location and a chooser appears when neither resolves. **Web:** the saved region is validated against `listRegions`; an invalid/deleted saved id falls back to the chooser. | +| LOC-21 | P0 | Cold start adopts the first region while a local cart has items. | Adoption uses the non-clearing path (local cart preserved). Only an explicit switch away from an already-set region confirms and clears regional state. **Known open:** review finding #10 reports this can still clear the cart; record a failure rather than assuming the requirement is met. | | LOC-22 | P1 | Launch with location access denied, then with device location services off, then with permission granted but no fix. | Distinct messages ("access not granted" vs "services off" vs "couldn't get a fix") plus an "Open location settings" action, then an address-chooser fallback. | | LOC-23 | P1 | Signed out, no region resolves (location off/denied/out-of-area). | The chooser shows "Login to get existing addresses." with a Login action. Tapping it shows the login screen **in place** (the gate renders outside the navigator, so no route push), and after a successful login the chooser returns with the account's saved addresses selectable; backing out leaves region/cart untouched. | | LOC-24 | P2 | A region-gate screen (no region yet) offers any "go to another route" action. | The action works without a mounted navigator (inline screen/state change), because `LocationTestWrapper` / `FirstUserWrapper` / `HealthTestWrapper` replace the root ``; a `router.push`/`router.back` there must not silently no-op. | diff --git a/docs/test-cases/notifications.md b/docs/test-cases/notifications.md index 3c34dd7..52502d8 100644 --- a/docs/test-cases/notifications.md +++ b/docs/test-cases/notifications.md @@ -22,5 +22,6 @@ Scope: customer/staff push-token registration, admin targeted sends, order/cance | PUSH-16 | P0 | Sensitive payloads/logs, admin/internal notes. | Only intended content/recipient; no secrets/internal staff notes in customer push. | | PUSH-17 | P1 | Staff deleted/reassigned after token registration. | No private old-region operational messages to stale identity. | | PUSH-18 | P1 | Scheduled/event send delayed past cancellation/deletion. | Safe stale-context behavior; no misleading upcoming-order claim. | +| PUSH-19 | P0 | Superadmin sends “Admin Notifs”; repeat with a staff token and a customer token. | The dedicated superadmin sender succeeds and queues the notification; staff/customer callers are denied and no queue write occurs on denial. | Provider-specific delivery guarantees and deduplication are policy/integration checkpoints. Telegram/event logs must be redacted in reports. diff --git a/docs/test-cases/orders.md b/docs/test-cases/orders.md index 58271f0..b5d21c7 100644 --- a/docs/test-cases/orders.md +++ b/docs/test-cases/orders.md @@ -15,14 +15,16 @@ Scope: placeOrder, getOrders/getOrderById, success routes, upcoming-order glimps | ORDER-09 | P1 | Many orders, page boundaries, filters, empty last page. | Stable order/pagination; no missing/duplicate rows or B-ID cursor skips. | | ORDER-10 | P1 | Missing/malformed/readable-vs-database order ID. | Correct target or clear not-found; no arbitrary parsed ID acceptance. | | ORDER-11 | P1 | Place order while history/upcoming widget already mounted. | Queries invalidated; new order visible without reinstall/manual stale cache. | -| ORDER-12 | P0 | Change coupon/catalog after placement. | Original price/stored discount preserved in all detail views. | +| ORDER-12 | P0 | Change coupon/catalog after placement. | For orders placed after the discount migration, original price/stored discount are preserved in all detail views. Historical pre-migration rows follow the accepted zero-discount limitation in ORDER-22. | | ORDER-13 | P1 | Soft-delete product/variant/store dependency after order. | History still renders purchased identity, qty and charge. | -| ORDER-14 | P0 | Database failure during multi-slot creation. | No partial group/items/status/payment linkage; cart not falsely cleared. | +| ORDER-14 | P0 | Database failure during multi-slot creation. | No partial group/items/status/coupon-usage linkage; cart not falsely cleared. | | ORDER-15 | P1 | Queue/Telegram/push fails after persistence. | Outcome inspectable; no duplicate order on blind retry; delivery integration recoverable. | | ORDER-16 | P0 | Rapid native/web submit twice vs raw concurrent API requests. | In-app guard prevents double tap; record deferred server-idempotency exposure separately. | | ORDER-17 | P1 | Request commits then response lost. | Inspect history before retry; no false claim of guaranteed server deduplication. | | ORDER-18 | P1 | Large supported cart/many slots and identical subtotals. | All items preserved; deterministic primary fee/usage allocation. | | ORDER-19 | P1 | Repeated order-detail fetch during status transition. | Coherent status/amount and group coupons, not mixed partial state. | | ORDER-20 | P2 | Native/browser deep links/back/reload to success/detail. | Correct order identity and navigation; no other user's cached detail. | +| ORDER-21 | P0 | Quiet region A has old orders while region B creates more than `limit + 5` newer orders; page A's admin order list. | A returns its own orders and a valid next cursor; no global-ID window makes the list empty or skips rows. | +| ORDER-22 | P2 | Open a historical pre-migration order whose stored total already included a coupon discount. | Stored/displayed discount is `0`; this is an accepted limitation. New orders must continue to store their discount. | -No general minimum-order value is required. Pending gateway orders are conditional coverage, not a supported online-payment claim. +No general minimum-order value is required. Checkout is COD-only; there are no online-payment orders, gateway states, or refund records. diff --git a/docs/test-cases/pricing-delivery-fees.md b/docs/test-cases/pricing-delivery-fees.md index 778855c..a59fe89 100644 --- a/docs/test-cases/pricing-delivery-fees.md +++ b/docs/test-cases/pricing-delivery-fees.md @@ -22,9 +22,9 @@ Scope: shared cart-pricing helpers, authoritative order pricing, client previews | MONEY-16 | P0 | Client manipulates totals/discount/price fields or bound ID. | Authoritative prices/coupons/address bound used; no client-driven discount. | | MONEY-17 | P0 | Flash SKU price differs greatly from regular. | Flash price drives goods, coupon min/cap and threshold. | | MONEY-18 | P1 | Fully discounted goods with nonzero fee vs free fee. | Correct D or zero total; authoritative zero handled in success UI. | -| MONEY-19 | P0 | Catalog/coupon changes after order placed. | Stored discount/price/detail stable; no recomputation from edited coupon. | +| MONEY-19 | P0 | Catalog/coupon changes after order placed. | Stored discount/price/detail stable; no recomputation from edited coupon. Historical pre-migration rows may show discount `0` under the accepted limitation. | | MONEY-20 | P1 | Missing/invalid market/config values, zero/null cap. | Clear validation/fallback; no NaN/Infinity/negative price. Zero-cap semantics explicitly approved. | | MONEY-21 | P0 | Cancel/remove fee/rebalance after a split order. | Derived monetary changes reconcile without duplicate fee or lost historic discount. | | MONEY-22 | P1 | Large supported quantity/price/cart size. | No overflow, precision loss beyond policy, or dropped discount allocations. | -Policies to resolve before numerical PASS: compound percentage basis, currency rounding and residual allocation, zero maxValue meaning. Sorting percentage coupons before flat coupons is required regardless of percentage basis. +Policies to resolve before numerical PASS: zero maxValue meaning and exact residual allocation for unusual decimals. Coupons stack sequentially on the remaining eligible amount in selection order; each discount rounds to the nearest rupee, and per-sub-order shares reconcile to the charged discount. Sorting coupons into percentage/flat groups is not the current behaviour. diff --git a/docs/test-cases/profile-account-lifecycle.md b/docs/test-cases/profile-account-lifecycle.md index 7941b45..234be58 100644 --- a/docs/test-cases/profile-account-lifecycle.md +++ b/docs/test-cases/profile-account-lifecycle.md @@ -14,7 +14,7 @@ Scope: `getSelfData`, `updateProfile`, `updatePassword`, `deleteAccount`, profil | PROFILE-08 | P1 | Password mismatch/invalid current verification where required. | Rejection leaves usable old credentials. | | PROFILE-09 | P0 | Delete with wrong confirmation mobile, then correct confirmation. | Wrong request has no effect; valid deletion follows retention policy and logs out. | | PROFILE-10 | P0 | Use deleted account's old token and attempt relogin. | No access to deleted account/private data or new orders. | -| PROFILE-11 | P0 | Delete account with historical orders/complaints/payment references. | Required audit/history retained or anonymized by approved policy; no unrelated-user damage. | +| PROFILE-11 | P0 | Delete account with historical orders/complaint references. | Required audit/history retained or anonymized by approved policy; no unrelated-user damage. | | PROFILE-12 | P1 | Concurrent profile edits from two devices. | Coherent final fields; no credential/detail row inconsistency. | | PROFILE-13 | P1 | Upload succeeds but profile save fails. | No false image assignment; retry/cleanup recoverable. | | PROFILE-14 | P1 | Disconnect during password/deletion save. | Determine persisted outcome before retry; no half-account state. | diff --git a/docs/test-cases/regions.md b/docs/test-cases/regions.md index 62a8ea2..9414f73 100644 --- a/docs/test-cases/regions.md +++ b/docs/test-cases/regions.md @@ -19,5 +19,6 @@ Scope: `superadmin.regions`, public region listing and region summary selectors. | REGION-13 | P2 | Large list and a region renamed during the session. | Selected region resolves by ID; stale labels refresh. | | REGION-14 | P0 | Inspect public list payload. | Only intended region/bound discovery metadata, no private staff/account data. | | REGION-15 | P1 | Newly created region publication to fresh/existing customers. | Discoverable within bounded deadline; B unchanged. | +| REGION-16 | P0 | Create a region with a valid bound and inspect the response and cache files immediately; separately force cache generation to fail. | DB creation is transactional/compensated. Cache generation is awaited before the success response; a cache failure is logged and the created region remains usable, not half-seeded. | Related: [bounds](bounds.md), [global products](global-products.md), [cache](cache-publication.md). diff --git a/docs/test-cases/staff-authentication.md b/docs/test-cases/staff-authentication.md index ac5116a..7e26f59 100644 --- a/docs/test-cases/staff-authentication.md +++ b/docs/test-cases/staff-authentication.md @@ -18,5 +18,6 @@ Scope: `admin.staffUser.login`, `superadmin.auth.login/me`, staff auth contexts | SAUTH-12 | P2 | Keyboard/password visibility toggle and accessible errors. | Password protected; input usable on each platform. | | SAUTH-13 | P1 | Same identity uses native/web simultaneously. | Region/role agreement; supported session behavior documented. | | SAUTH-14 | P0 | Login response/log inspection. | No password hashes or signing secrets exposed. | +| SAUTH-15 | P1 | Admin-web reload on a region-scoped screen, specifically Vendor Snippets. | The stored sign-in is restored, staff identity and region are re-fetched, and region-scoped controls such as the slot picker load without another login. | See [authorization](authorization-api-contracts.md) for the complete role matrix. diff --git a/prompts/test.txt b/prompts/test.txt new file mode 100644 index 0000000..e69de29