diff --git a/AGENTS.md b/AGENTS.md
index 349183f..85cf863 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -48,7 +48,7 @@ react-native. They are available in the common-ui as MyText, MyTextInput, MyTouc
- Database: Drizzle ORM with PostgreSQL
## Important Notes
-- Don't do anything with git. Don't do git add or git commit. That will be managed entirely by the user
+- Don't do anything with git unless the user explicitly asks for. Don't do git add or git commit. That will be managed entirely by the user.
## Change Log
- there should be a change log file. unless explicitly specified, assume change-log.txt as the name of the log file. Ensure the file exists. If it doesn't exist create it. Before changing any file which is not a md file or txt file write the change to that file exactly. Write the diff to it and then start making changes. for every change add the current time stamp.
diff --git a/docs/full-product-validation-manual-testing-guide.html b/docs/full-product-validation-manual-testing-guide.html
new file mode 100644
index 0000000..89f057e
--- /dev/null
+++ b/docs/full-product-validation-manual-testing-guide.html
@@ -0,0 +1,558 @@
+
+
+
+
+
+
+Freshyo manual testing guide
+
+
+
+
+
Freshyo manual testing guide
+
This guide is for someone testing Freshyo by using the apps — no technical knowledge needed. You only need to use the screens, buttons and test accounts described here. If the app shows it, you can test it.
+
The reference numbers such as CUST-31, ADM-05 or BR-14 are only for writing down what you tested and reporting a problem. You can ignore them while testing.
+
What this guide covers: the customer app (mobile and web), the admin app (mobile and web), the superadmin website, and the cross-app journeys between them.
+
What it does not cover: checks that are not visible in the apps. Those are handled separately.
+
+
+
Before you test
+
What you need
+
Ask your test coordinator for:
+
Test accounts — a customer account, a second customer account, a brand-new customer account, an admin account for each test area, and a superadmin account.
Sample data — two delivery areas (called A and B in this guide), products, delivery slots, and coupons.
A test phone or browser — the mobile app on a test phone, and the web apps in a browser.
A way to take screenshots — for any failure.
+
Do not use a real customer's account, phone number, address, or payment details. Use only the test accounts and test area given to you.
+
Names used in this guide
+
These are just labels for the test data. Your coordinator may use different names; if so, use theirs.
+
+
Name
What it means
+
+
Customer 1
The main test customer, with saved addresses in area A
+
Customer 2
A second customer, with an address in area B
+
New Customer
A customer with no saved address and no orders
+
Admin A / Admin B
Staff accounts for area A and area B
+
Superadmin
The account that manages areas, staff and global products
+
Area A / Area B
The two delivery areas used for testing
+
Product P / Q / G
Test products: P in A, Q in B, G available in both
+
Slot S1 / S2
Future delivery time slots in area A
+
Coupon 10% / Coupon ₹100
Test coupons used for money checks
+
+
How to write down a result
+
For each check, note:
+
What you did.
What you expected to see.
What you actually saw.
A screenshot, if it failed.
+
Use the reference number from this guide so the team can find the check quickly.
+
If you get stuck
+
If a screen is loading forever, wait up to one minute, then note the screen and try again once.
If data is missing (no products, no slots, no coupons), ask your coordinator; do not change real customer data.
If a test changes money, orders, or customer data, use only the test accounts.
+
+
1. Customer app — mobile and web
+
Use the same steps on the mobile app and on the website unless a step says otherwise.
+
1.1 Sign in, create an account and manage your profile
+
What this tests: signing in, creating an account, staying signed in, signing out, changing details, and what happens when an account is suspended.
+
Steps:
+
Open the customer app without signing in.
Open Cart and Me. Check that you are asked to sign in, and that you can still browse the Home page.
From the Cart sign-in prompt, sign in as Customer 1. Add a product before signing in to check that the cart is still there afterwards.
Sign out, then try a wrong password. Sign in correctly.
Create a new account with the New Customer details.
Try creating an account with an existing mobile/email and with missing fields.
Close and reopen the app. Check that you are still signed in.
Open Me → edit your name/profile photo → save → reopen the app.
Change your password, sign out, and try the old and new passwords.
Sign in as Customer 2. Check that Customer 1's orders, addresses and coupons are not visible.
Ask the admin to suspend Customer 1, then try to place an order. Ask the admin to unsuspend and try again.
On a disposable test account, use Delete Me and My Data and try a wrong confirmation first, then the correct one.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-09
Browsing works signed out; Cart and Me ask you to sign in.
+
CUST-10
You return to the screen you came from; the cart survives sign-in; errors are clear.
+
CUST-11
A wrong password does not sign you in; Customer 2 cannot see Customer 1's data.
+
CUST-12
You stay signed in after reopening; an expired sign-in asks you to sign in again safely.
+
CUST-13
Your name/photo are saved and match what the admin sees.
+
CUST-14
The new password works and the old one does not.
+
CUST-15
Wrong confirmation is rejected; correct confirmation removes access.
+
CUST-16
A suspended customer cannot order; unsuspending allows ordering again.
+
+
1.2 Choose the delivery area
+
What this tests: the app finding the right delivery area, asking you when it cannot, and keeping the right products and cart when you switch areas.
+
Steps:
+
Open the app in area A. Allow location access if asked.
Check the delivery area/address shown on Home.
Close and reopen the app with location denied, location off, and a point outside the service area.
Open the area/address chooser and select area B manually. If a location request arrives late, check that it does not change your choice.
Sign in as Customer 1 and switch between the saved addresses in A1 and A2.
Add products to the regular cart and the 1-hour cart. Switch to B; cancel the switch, then confirm it.
Switch back to A and check the cart.
Close the app with a cart and reopen it.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-01
The correct area loads once; products and slots appear.
+
CUST-02
A saved address is used when location is unavailable; otherwise a chooser explains the problem.
+
CUST-03
A late location result does not override your manual choice.
+
CUST-04
The selected address decides the delivery zone and charges; another area's address is ignored.
+
CUST-05
Cancel keeps everything; confirm clears area A selections and loads B.
+
CUST-06
Each area keeps its own cart; switching back restores it.
+
CUST-07
A cart is not wiped just because the app picks the first area on launch.
+
CUST-08
An empty area shows a friendly empty state, not an error.
+
+
1.3 Home, search, stores and product details
+
What this tests: that area A and area B show the right products, stores, offers and prices, and that product details and add-to-cart work from every entry point.
+
Steps:
+
Open Home in area A. Note the products, offers, stores and delivery slots.
Switch to area B and compare.
Use Search for a product name, an offer/tag, and a store name. Also search for something that does not exist.
Open Stores → a store → a product. Open the global test product G.
Open a product with variants, a combo, and a 1-hour product.
Add the same product from Home, Search, a store and the product page.
Open the quantity selector and try the smallest, largest and an out-of-stock item.
Tap an offer, tag or banner and follow where it goes.
Open the delivery address/area bar and change the address.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-17
Area A shows A + global products; area B shows B + global products; no cross-area products or prices.
+
CUST-18
Loading, empty, error and refresh states make sense; Retry works.
+
CUST-19
Search returns only products/stores for the chosen area; no results shows a clear empty state.
+
CUST-20
Store lists and store pages show the right products; the global store appears in both areas.
+
CUST-21
Product page shows the correct price, variants, stock, combo contents and 1-hour availability.
+
CUST-22
The same product added from different screens gives the same item, quantity and price.
+
CUST-23
You cannot add more than allowed; out-of-stock items cannot be added.
+
CUST-24
Tapping an offer/banner opens the intended product or store.
+
CUST-25
The current address is shown; changing it updates the delivery area and prices.
+
+
1.4 Cart
+
What this tests: adding, changing and removing items, saving the cart, notes, delivery slots, and what happens when an item becomes unavailable.
+
Steps:
+
Add a product. Add it again from the product page.
Increase and decrease the quantity. Remove a line and cancel the removal; then remove it for real.
Close and reopen the app with items in the regular cart and the 1-hour cart.
Assign a delivery slot to each item. Leave the cart, come back, and reopen the app.
Add a note for the order. Go to checkout, come back, and change the note.
Ask your coordinator to mark one test product out of stock or unavailable. Refresh the cart.
Close and reopen with an old saved cart.
Sign out and sign in as Customer 2 with Customer 1's cart still saved.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-26
Adding again merges correctly; changing quantity replaces it; removing affects only that line.
+
CUST-27
Regular and 1-hour carts both come back after reopening.
+
CUST-28
Your slot choice is still there after leaving and returning.
+
CUST-29
Unavailable items are shown clearly and cannot be ordered; if all items are unavailable, checkout is blocked.
+
CUST-30
The latest note is the one shown at checkout and saved with the order.
+
CUST-37
A damaged/old saved cart does not create a fake product or a wrong price.
+
CUST-38
Another customer cannot see or use your cart, address or notes.
+
+
1.5 Coupons
+
What this tests: which coupons you can see, why some are disabled, and how multiple coupons change the bill.
+
Steps:
+
Open the cart with several items and open the coupon list.
Look for eligible coupons, a coupon for the other area, a first-order coupon, a minimum-spend coupon, a product-specific coupon, an expired coupon, a used coupon and another customer's coupon.
Apply a 10% coupon, then a ₹100 coupon. Remove them and apply them in the opposite order.
Change a quantity and check that the discount recalculates.
Try a coupon that gives 100% off and a coupon whose discount is bigger than the cart.
Check the Products discount line in the bill.
Open Me → Coupons and compare the labels with the cart.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-31
Expired, invalid or used-up coupons are not shown. Other coupons show a clear reason when disabled.
+
CUST-32
The bill and each coupon's saving update when you add, remove or change items.
+
CUST-33
Applying the same coupons in a different order can give a different total; the total never goes below zero.
+
CUST-34
The Products discount line appears only when there is a product saving; coupon lines are separate.
+
CUST-36
The cart total, checkout total and saved order total match.
+
CUST-57
The Coupons page agrees with the cart: available, used and expired are labelled correctly.
+
+
1.6 Checkout and placing an order
+
What this tests: choosing an address and slot, applying coupons, paying by cash on delivery, and the safeguards that stop a wrong or duplicate order.
+
Steps:
+
Open the cart, select a saved address in area A, assign slots, and tap Checkout.
Check the address, items, slot, coupon, delivery charge and total.
Look at the payment methods. Cash on Delivery should be selected; Pay Online (Coming Soon) should be disabled.
Go back to the cart, change the address, slot, coupon or note, and return to checkout.
Tap Place Order twice quickly.
Place a valid order.
Note the order number and total on the success screen.
Open My Orders and compare the order.
As the New Customer with no address, open Cart and Checkout.
Try checkout with an item that has no delivery slot.
Place a 1-hour order in area A. Then try the 1-hour flow in area B.
Use the back button, refresh the browser, and open the success/detail link again.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-39
The selected address decides the delivery charge and area.
+
CUST-40
A customer with no address is asked to add one before checkout.
+
CUST-41
Each item carries its own delivery slot; no item is sent without a slot.
+
CUST-42
Only Cash on Delivery is usable; the online option is visibly disabled.
+
CUST-43
The latest address/slot/coupon/note is shown at checkout.
+
CUST-44
A fast double tap places only one order.
+
CUST-45
A failed order shows an error, the button works again, and your cart is kept.
+
CUST-46
If the response is lost, check My Orders before trying again.
+
CUST-48
A multi-slot or zero-total order shows the correct order number and total.
+
CUST-49
1-hour ordering works in A and is blocked in B.
+
CUST-50
Back/refresh/deep links do not create a second order or show another order.
+
CUST-35
An item with no slot, or a slot that has closed, blocks checkout; a 1-hour cart is not blocked by this rule.
+
+
1.7 Orders, cancellation and complaints
+
What this tests: finding orders, reading the bill, cancelling, ordering again, and raising a complaint.
+
Steps:
+
Open Me → My Orders. Look at pending, delivered and cancelled orders.
Open an order. Check items, address, delivery time, bill, status and notes.
Cancel a new order. Enter a reason and confirm.
Try cancelling a delivered order.
On a cancelled/delivered order, use Order Again.
Ask the admin to delete or hide a product you ordered. Open the old order.
Tap Raise Complaint, add a message and an image, and submit.
Ask the admin to reply, then reopen the complaint.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-51
Orders are listed with the correct status and can be scrolled/paged.
+
CUST-52
The order detail matches the bill and what the admin sees.
+
CUST-53
A reason is required; cancelled/delivered orders follow the rules.
+
CUST-54
Order Again adds the available items; unavailable items are handled clearly.
+
CUST-55
The complaint is saved and the admin reply is visible.
+
+
1.8 Addresses
+
What this tests: adding, editing, making default and deleting addresses, and checking that the map location chooses the right delivery area.
+
Steps:
+
Open Me → Addresses.
Add an address using the map and the test area.
Try an address outside the service area.
Add a second address and make it the default.
Edit the address details and move the map pin.
Delete an address that is being used by an open order, then a free address.
Delete the default address, then the last address.
Open the cart and checkout after deleting the last address.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-56
The map location picks the correct area/zone; an outside point is rejected; the first address becomes default; an address used by an open order cannot be deleted.
+
CUST-40
With no address, the app asks you to add one before checkout.
+
+
1.9 Profile, coupons and notifications
+
What this tests: the remaining customer screens and what happens when the connection is poor.
+
Steps:
+
Open Me and visit each item: My Orders, Coupons, Addresses, Help & Complaints, Terms and profile settings.
Turn the phone/browser offline and open Home, cart and checkout.
Allow notifications, add an address, and open a notification link.
Use the app with a small screen/keyboard and check that buttons are reachable.
+
What you should see:
+
+
Check
Expected result
+
+
CUST-58
Notification permission is handled; the link opens the right order/product.
+
CUST-59
Offline screens show a clear error and Retry; no fake success.
+
CUST-60
Keyboard/safe-area/back navigation work; important buttons are readable and reachable.
+
+
+
2. Admin app — mobile and web
+
Use the same steps on the admin mobile app and the admin website. The website may ask you to sign in again after a refresh; that is part of the test.
+
2.1 Sign in and area access
+
What this tests: admin sign-in, staying signed in, and making sure an admin sees only their own area.
+
Steps:
+
Sign in as Admin A. Open the Dashboard.
Refresh the page (web) or reopen the app (mobile).
Sign out and sign in as Admin B.
Use the browser/device back button to return to an Admin A screen.
Try to open an admin screen without signing in.
+
What you should see:
+
+
Check
Expected result
+
+
ADM-01
Admin A signs in, stays signed in, and sees the correct area.
+
ADM-02
Admin A and Admin B see only their own orders, products and counts.
+
ADM-03
After switching to B, Admin A's data is gone and old links are blocked.
+
ADM-04
Signed-out users cannot reach admin screens or actions.
+
+
2.2 Orders
+
What this tests: finding orders, reading details, changing status, cancelling, changing the delivery charge, and arranging delivery order.
+
Steps:
+
Open Manage Orders → Orders. Use the filters and search; scroll to the next page.
Ask Admin B to create several newer orders, then return to Admin A and page through A's orders.
Open an order. Compare the items, bill, address, notes and customer details.
Mark the order Packaged, then Delivered.
Open the customer app and check the status.
Cancel another order with a reason.
Open a delivered order and try to cancel it.
Remove the delivery charge from a test order.
Use Rebalance on a slot and compare the bill.
Open Delivery Sequences, change the order, and update one order's map location.
Add an admin note and check the customer note.
+
What you should see:
+
+
Check
Expected result
+
+
ADM-05
Filters, search and pages show the right orders.
+
ADM-06
Admin A sees all of A's orders even when other areas have newer orders.
+
ADM-07
The order detail matches the customer's bill.
+
ADM-08
Packaged/delivered changes are saved and visible to the customer.
+
ADM-09
Cancellation needs a reason; a delivered order cannot be cancelled by the customer.
+
ADM-10
Rebalancing keeps the total and discount correct.
+
ADM-11
Delivery order and map changes affect only the intended order.
+
ADM-12
Admin and customer notes appear in the right place.
+
+
2.3 Products, prices and stock
+
What this tests: creating and editing products, changing prices/stock, handling global products, and avoiding duplicate variants.
+
Steps:
+
Open Products. Search for Product P and open its details.
Create a new test product with two variants, an image, features and tags.
Open the customer app in area A and find it.
Edit the product's price, stock, offer and 1-hour availability.
Edit the global product G's price/stock/suspension for area A.
Open the customer app in area B and compare.
Suspend a global product in A, reopen it, change only the price, and save.
Ask the superadmin to edit G's variants. Count the variants before and after.
Delete a product that has orders/variants; then delete a free test product.
Open Prices Overview and update a price.
Create/edit/delete a tag, group and combo; assign products.
Upload a product image.
+
What you should see:
+
+
Check
Expected result
+
+
ADM-13
The products list and details show the right area and stock state.
+
ADM-14
The new product is saved and appears only in A.
+
ADM-15
Price/stock/offer changes are saved and visible to the customer.
+
ADM-16
Editing a global product in A changes only A's price/stock.
+
ADM-17
A suspended product stays suspended after an unrelated price change.
+
ADM-18
A product with orders/variants cannot be deleted; a free one can.
+
ADM-19
Price edits are saved and the customer sees the new price.
+
ADM-20
Tags and their order match the customer app.
+
ADM-21
Groups and slots keep the right products.
+
ADM-22
A combo shows the right components and price.
+
ADM-34
Uploaded images appear on the product.
+
+
2.4 Stores and delivery slots
+
What this tests: store details and the delivery slots customers can choose.
+
Steps:
+
Open Stores. Create a store, edit it, and upload an image.
Open the global store and try to edit it.
Delete a store with products/orders, then a free store.
Open Slots. Create a future slot and assign products.
Edit its time, capacity and freeze time.
Fill or freeze the slot and open the customer cart.
Replicate or copy a slot.
+
What you should see:
+
+
Check
Expected result
+
+
ADM-23
Regional stores are editable; the global store is read-only; images are safe.
+
ADM-24
New/edited/full/frozen slots behave correctly for the customer.
+
+
2.5 Coupons, banners and home layout
+
What this tests: regional coupons, banners and the order of items on Home.
+
Steps:
+
Open Coupons. Create a 10% coupon, a ₹100 coupon, one for selected products, and one for selected customers.
Use them in the customer app.
Edit and invalidate a coupon; try it again.
Open Banners. Create, edit, activate, deactivate and reorder banners.
Check the customer Home in A.
Open Customize App and change the Popular Items and All Items order.
+
What you should see:
+
+
Check
Expected result
+
+
ADM-25
Coupons work only in the right area/for the right products/users.
+
ADM-26
Only active banners appear, in the chosen order.
+
ADM-27
The customer Home matches the chosen order.
+
+
2.6 Users, complaints and notifications
+
What this tests: finding customers, suspending them, adding incidents, replying to complaints and sending notifications.
+
Steps:
+
Open User Management. Search by Customer 1's name and mobile.
Sign in as Admin B and search for the same customer.
Open a customer. Suspend, unsuspend, and add an incident note.
Open Complaints, open a customer complaint, reply and resolve it.
Open the customer app and check the reply.
Open Send Notifications, select a test user, and send a test message.
Open Constants and change a test setting; check the customer app.
If Vendor Snippets is enabled for your test, open it, create a snippet, add a product, and open the slot picker. Refresh the website and try again.
Open a screen with no data (for example, a new area with no orders) and use the back/Retry buttons.
+
What you should see:
+
+
Check
Expected result
+
+
ADM-28
Customer details are visible only to the right area.
+
ADM-29
Admin B cannot find Admin A's customers by name or mobile.
+
ADM-30
Suspension and incidents are saved; notifications go only to selected test users.
+
ADM-31
Complaints are area-scoped and the customer sees the reply.
+
ADM-32
Vendor snippets stay in your area and the slot picker still loads after a refresh.
+
ADM-33
The changed setting appears for the customer; the other area is unchanged.
+
ADM-35
Empty/loading/error screens show a clear message; Retry/back works.
+
+
+
3. Superadmin website
+
The superadmin sets up areas, staff, global products and global coupons. Use only the test areas and test accounts given to you.
+
3.1 Sign in and delivery areas
+
What this tests: superadmin access, area setup, and the map/zone used for delivery.
+
Steps:
+
Sign in as Superadmin. Sign out, sign in again, and refresh.
Open Regions. Select area A.
Review the area name, delivery charge, free-delivery amount, 1-hour settings and support details.
If instructed, add a new test area with one delivery zone using the map.
Try to save an area without a zone, or with an invalid/duplicate zone.
Add, edit and delete a test zone. Try deleting the last zone.
Open the customer area chooser and check that the new/edited area appears.
Change an area's settings and check the customer app.
+
What you should see:
+
+
Check
Expected result
+
+
SA-01
Superadmin signs in and stays signed in; staff/customer pages are not accessible.
+
SA-02
A new area can be created and appears for customers.
+
SA-03
Missing/invalid zones are rejected without creating a broken area.
+
SA-04
A zone can be edited/deleted only when allowed.
+
SA-05
A new area gets the right products and prices.
+
SA-06
The new area's products and pages open normally.
+
+
3.2 Staff and global stores
+
What this tests: creating staff, assigning an area, and managing shared stores.
+
Steps:
+
Open Admin Users. Add a test admin for area A and one for area B.
Change an admin's area/role, then sign in as that admin.
Remove a test admin and try to sign in.
Open Global stores. Create, edit and delete a test global store.
Check the store in both customer areas.
Sign in as Admin A and try to edit the global store.
+
What you should see:
+
+
Check
Expected result
+
+
SA-07
Staff get the right area/role; removed staff cannot sign in.
+
SA-08
A global store appears in both areas; regional admins cannot edit it.
+
+
3.3 Global products
+
What this tests: products shared by all areas, with different local prices.
+
Steps:
+
Open Global products. Create a test global product with two variants.
Set different prices for area A and area B.
Check the product in both customer areas.
Edit the product, save, and save again without changes.
Count the variants in the admin/customer screens.
Open Create, then Edit, then Create again; check the form fields.
Suspend the product in one area and check the other.
Use Elevate on a regional product.
Upload a global product image.
+
What you should see:
+
+
Check
Expected result
+
+
SA-09
The global product appears in both areas with the local price.
+
SA-10
Editing does not create duplicate variants.
+
SA-11
The form shows the selected product and resets when you start a new one.
+
SA-12
Suspending in one area does not suspend it in the other.
+
SA-13
An elevated product remains available in its original area.
+
SA-21
The image appears in both areas.
+
+
3.4 Global coupons, settings and notifications
+
What this tests: coupons shared by all areas, global settings, and admin notifications.
+
Steps:
+
Open Global coupons. Create a percentage coupon and a ₹ discount coupon.
Use them in both customer areas.
Edit a 20% coupon to ₹50 and save.
Use it again and check the discount.
Invalidate/delete the coupon and try it again.
Open Constants. Change a global test setting and compare both areas.
Open Complaints and reply to a test complaint.
Open Send Notifications → Admin Notifs and send a test message.
Switch between area tabs and refresh.
Open an empty screen and a delete confirmation; try Cancel and then Confirm on a disposable test item.
+
What you should see:
+
+
Check
Expected result
+
+
SA-14
Global coupons work in both areas.
+
SA-15
Switching from percentage to ₹ discount uses only the new discount.
+
SA-16
Global settings apply everywhere; local settings still win.
+
SA-17
Complaints show the right area and reply.
+
SA-18
Admin Notifs sends successfully as superadmin.
+
SA-19
Staff/customer accounts cannot open superadmin screens.
+
SA-20
Empty/loading/error screens are clear; Cancel does not delete data.
+
SA-22
Area tabs show the right area and refresh after a rename.
+
SA-23
A global edit reaches all areas after a short wait.
+
+
+
4. Cross-app journeys
+
These checks use more than one app. Keep the same test accounts and data.
+
4.1 Full order journey
+
What this tests: the complete path from setup to delivery.
+
Steps:
+
Superadmin: confirm area A exists and create Admin A if needed.
Admin A: create a test store, product P, future slot S1 and a 10% coupon.
Customer 1: open area A, find P, add it, choose S1, apply the coupon and checkout.
Place the order with Cash on Delivery.
Admin A: find the order, compare the items and bill, mark Packaged, then Delivered.
Customer 1: open My Orders and check the status.
Compare the order number and total everywhere.
+
What you should see:E2E-01 — the same order and total appear at every step, and the status ends as Delivered.
+
4.2 Global product in two areas
+
What this tests: one shared product with different local prices.
+
Steps:
+
Superadmin: create global product G with an A price and a B price.
Customer 1 in A: open G and note the price.
Customer 2 in B: open G and note the price.
Admin A: change the A price.
Admin B: change the B price.
Refresh both customer apps.
+
What you should see:E2E-02 — each area keeps its own price; changing A does not change B.
+
4.3 Switching areas with a cart
+
What this tests: that areas do not mix products or carts.
+
Steps:
+
Customer 1: add a regular product and a 1-hour product in area A.
Switch to area B and cancel; check that A is still there.
Switch to B and confirm; add a B product.
Switch back to A; check the A cart.
Switch to B; check the B cart.
Repeat on the website.
Close and reopen the app.
+
What you should see:E2E-03 — no product or price from the other area appears; each cart comes back when you return to its area.
+
4.4 Coupons on the bill
+
What this tests: multiple coupons and the final payable amount.
+
Steps:
+
Build a ₹1000 cart.
Apply 10% then ₹100; note the discount and total.
Reverse the order; note the difference.
Place the order.
Compare the cart, checkout, success screen, My Orders and Admin A's order.
+
What you should see:E2E-04 — the total is the same on every screen and never goes below zero.
+
4.5 1-hour delivery
+
What this tests: 1-hour products, prices and area availability.
+
Steps:
+
In area A, open the 1-hour section and add a 1-hour product.
Check the 1-hour price and delivery charge.
Place a Cash on Delivery order.
Admin A: open the order and confirm it is a 1-hour order.
Customer 2 in area B: try the 1-hour section for the same product.
+
What you should see:E2E-05 — A can order; B is blocked; the admin sees the right type of order.
+
4.6 Two delivery slots in one order
+
What this tests: one order split into two delivery times with one delivery fee.
+
Steps:
+
Add a product for S1 and another for S2 in the same cart.
Checkout and place the order.
Admin A: open the order and check both slots.
Mark one part delivered, then the other.
Customer 1: check both statuses.
+
What you should see:E2E-06 — two delivery parts, one delivery fee, and the correct status for each part.
+
4.7 Cancel and use the coupon again
+
What this tests: cancelling an order and releasing a one-time coupon.
+
Steps:
+
New Customer: place an order with a first-order coupon.
Cancel it with a reason.
Place a new order and use the same coupon.
Place a two-slot order with the coupon and cancel one part.
Cancel the other part.
Try the coupon again.
+
What you should see:E2E-07 — the coupon becomes usable again only when no part of the order remains.
+
4.8 Website checkout with two slots
+
What this tests: the website sends the chosen delivery slot for each item.
+
Steps:
+
On the website, add items for S1 and S2.
Choose both slots in the cart and open Checkout.
Place the order.
Open the order and check both slots.
Try again with one item that has no slot.
+
What you should see:E2E-08 — the order saves both slots; an item without a slot blocks checkout.
+
4.9 Admin search by area
+
What this tests: an admin can find only their own area's customers.
+
Steps:
+
Customer 1 orders in A; Customer 2 orders in B.
Admin A searches for Customer 2's name and mobile.
Admin B searches for Customer 1's name and mobile.
Search for a name that exists in both areas.
+
What you should see:E2E-09 — each admin sees only their own area's customers and mobile numbers.
+
4.10 Global update reaches both areas
+
What this tests: a global product change appears everywhere.
+
Steps:
+
Superadmin: change global product G.
Admin A: immediately change a banner or product in A.
Wait up to two minutes.
Refresh the customer apps in A and B.
+
What you should see:E2E-10 — both areas show the global change; A also shows its local change.
+
4.11 Admin website refresh
+
What this tests: an admin website refresh keeps you signed in and keeps the slot picker working.
+
Steps:
+
Sign in to the admin website and open Vendor Snippets.
Refresh the browser.
Create/edit a snippet and open the slot picker.
Repeat after signing out and in as Admin B.
+
What you should see:E2E-11 — you stay signed in with the right area and the slots load.
+
4.12 Superadmin admin notification
+
What this tests: sending a notification to admins.
+
Steps:
+
Sign in as Superadmin and open Send Notifications → Admin Notifs.
Enter a title and message and send.
Check the success message.
Ask an admin to check for the notification.
+
What you should see:E2E-12 — the message is queued/sent without an error.
+
4.13 Different roles see different things
+
What this tests: customers, admins and superadmins cannot use each other's screens.
+
Steps:
+
Sign in as a customer and try to open an admin screen by typing its web address.
Sign in as an admin and try to open a superadmin screen.
Sign in as a superadmin and check that customer/admin-only screens are not available.
Use the back button after signing out.
+
What you should see:E2E-13 — each role sees only its own screens; old links do not work after sign-out.
+
4.14 Deleted product in old orders
+
What this tests: old orders still show a product after it is removed.
+
Steps:
+
Place an order for a test product.
Admin A: delete or hide the product.
Refresh the customer catalog; the product is gone.
Open the old order as the customer and as Admin A.
Try Order Again.
+
What you should see:E2E-14 — the catalog hides it, but the old order keeps the name, quantity and price; reorder handles it as unavailable.
+
4.15 Address in another area
+
What this tests: the delivery address decides the order's area.
+
Steps:
+
Customer 1 is browsing area A.
Add/select an address inside area B.
Build a cart and open checkout.
Check the delivery charge and place the order.
Admin B: find the order.
Admin A: confirm the order is not there.
+
What you should see:E2E-15 — the order belongs to B and uses B's charges.
+
4.16 Delivered/cancelled messages
+
What this tests: status changes and notification links.
+
Steps:
+
Place an order and note its number.
Admin A: mark it delivered.
Open the customer notification/link.
Cancel another order with a reason.
Open that notification/link.
+
What you should see:E2E-16 — each link opens the correct order with the correct status.
+
+
5. Special regression checks
+
These are the checks that previously found bugs. Run them before the wider testing if you can.
+
BR-01 — Customer search stays inside an area
+
Customer 1 orders in A; Customer 2 orders in B.
Sign in as Admin A and search for Customer 2 by name and mobile.
Sign in as Admin B and search for Customer 1.
Search a name used in both areas.
+
Expected: each admin sees only their own area's customers.
+
BR-02 — Website loads after choosing an area
+
On the website, choose area A.
Check that products, slots and delivery charges load.
Switch to area B and check again.
+
Expected: the page loads normally; no error or blank catalog.
+
BR-03 — Editing a global product does not duplicate variants
+
Superadmin: open a global product with two variants.
Change a price and save.
Save again without changes.
Count the variants.
+
Expected: still two variants; no duplicate appears.
+
BR-04 — Global store image stays after a rejected edit
+
Superadmin: open a global store with an image; note the image.
Admin A: try to edit the global store.
Refresh the store in both apps.
+
Expected: the edit is rejected and the image is still there.
+
BR-05 — Global change plus local change
+
Superadmin: change a global product.
Within 30 seconds, Admin A: change a banner or product in A.
Wait up to two minutes; refresh both areas.
+
Expected: both areas show the global change and A also shows its local change.
+
BR-06 — Website checkout sends slots
+
Website: add items for S1 and S2.
Choose both slots and place the order.
Check the order detail.
+
Expected: both slots are saved; no "slot required" error.
+
BR-07 — New area is usable
+
Superadmin: create a test area with a zone.
Open the customer area chooser and select it.
Check products/slots/delivery charges.
+
Expected: the area is listed and its pages load.
+
BR-08 — Global product form does not keep an old draft
+
Superadmin: Global products → Create; type a name but do not save.
Click Edit on another product.
Click Create again.
+
Expected: Edit shows the selected product; Create is empty.
+
BR-09 — Old orders in a quiet area
+
Area A has several old orders; Area B creates many new orders.
Admin A: open Manage Orders and page through.
+
Expected: all A orders appear; the list is not empty.
+
BR-10 — Cart survives the first area choice (known issue)
+
Add a product to the cart.
Close and reopen the app; let it choose the first area.
Open the cart.
+
Expected: the cart is still there. If it is empty, record it as BR-10 (known issue).
+
BR-11 — Suspension stays after a price change
+
Admin A: suspend a global product in A.
Reopen it, change only the price, and save.
Check the customer app in A and B.
+
Expected: it is still suspended in A; B is unchanged.
+
BR-12 — Coupons never make a total negative
+
Build two cart parts of ₹101 each.
Apply two ₹101 coupons.
Place the order.
+
Expected: each part shows ₹0, not a negative amount; the bill adds up.
+
BR-13 — Old orders and discounts (accepted)
+
Open an old order that used a coupon.
Check the discount line in the customer and admin views.
+
Expected: the discount may show ₹0 for very old orders. This is accepted for now; do not report it as a new bug.
+
BR-14 — Changing a global coupon type (known issue)
+
Superadmin: create a 20% global coupon.
Edit it to ₹50 and save.
Use it in the customer app.
+
Expected: the discount should be ₹50 only. If 20% is still applied, record it as BR-14 (known issue).
+
BR-15 — Admin website after refresh
+
Sign in to the admin website.
Refresh the page.
Open Vendor Snippets and the slot picker.
+
Expected: you stay signed in and the slots load.
+
BR-16 — Superadmin admin notification
+
Superadmin: Send Notifications → Admin Notifs.
Send a test message.
Check the result.
+
Expected: the message sends successfully; no error.
+
BR-17 — Only Cash on Delivery
+
Open checkout.
Look at the payment methods.
Place a test order.
+
Expected: Cash on Delivery is the only usable method; the online option is disabled.
+
BR-18 — No delivery slot
+
Add an item and do not choose a slot.
Try to check out.
+
Expected: checkout is blocked with a clear message.
+
BR-19 — Address decides the area
+
Browse area A, then select an address in area B.
Place an order.
Check Admin A and Admin B order lists.
+
Expected: the order appears in B with B's charges, not in A.
+
BR-20 — Order pages stay stable
+
Create orders in A and B.
Admin A: page through the order list.
Admin B: do the same.
+
Expected: every order appears once; pages do not skip or repeat orders.
+
+
6. Other screens (only if your coordinator says they are active)
+
Some screens are not part of normal testing. Test them only if your coordinator confirms they are in use for this release.
+
6.1 Vendor page
+
Open the vendor page link and sign in with the provided test code.
Open the order list and choose an order.
Mark an item packaged and verified.
Try a different/incorrect test code.
+
What you should see:COND-01 — the vendor sees only their orders and can package them; a wrong code is rejected.
+
6.2 Reviews
+
As a customer, open a delivered order or product and write a review with an image.
As an admin, open Reviews and reply.
Check the customer can see the reply.
+
What you should see:COND-02 — the review and reply are saved and visible. If reviews are not active, skip this check.
+
6.3 One-time password (OTP) sign-in
+
Use the test mobile number and the test code provided by your coordinator.
Request the code and sign in.
Try a wrong/expired code, then the correct one.
+
What you should see:COND-03 — one account is created/signed in, and a wrong code is rejected. Never use a real customer's phone number.
+
6.4 Older fallback pages
+
Open the older login/home/order-details links provided by your coordinator.
Check only the pages your coordinator says are still supported.
Note any page that looks like a demo or is no longer used.
+
What you should see:COND-04 — supported pages work; unsupported pages are recorded as "not applicable" with a reason.
+
+
7. Known issues
+
+
Check
What to expect
+
+
BR-10
A cart may be cleared when the app chooses the first area on launch. Record it; it is known.
+
BR-14
A global coupon changed from 20% to ₹50 may still apply 20% in the current build. Record it; it is known.
+
BR-13
Very old orders may show a ₹0 discount. This is accepted; do not report it as new.
+
+
+
8. Reporting a problem
+
Use this simple format:
+
What I was testing:
+Reference number (for example CUST-31):
+Account used (Customer 1 / Admin A / Superadmin):
+Area (A or B):
+Steps I took:
+What I expected:
+What actually happened:
+Screenshot:
+Date and time:
+
If the problem involves money, write down the item total, discount, delivery charge and final total. If it involves an order, include the order number.
+
+
+
diff --git a/docs/full-product-validation-manual-testing-guide.md b/docs/full-product-validation-manual-testing-guide.md
new file mode 100644
index 0000000..a9e45ed
--- /dev/null
+++ b/docs/full-product-validation-manual-testing-guide.md
@@ -0,0 +1,1143 @@
+# Freshyo manual testing guide
+
+This guide is for someone testing Freshyo by using the apps — no technical
+knowledge needed. You only need to use the screens, buttons and test accounts
+described here. If the app shows it, you can test it.
+
+The reference numbers such as `CUST-31`, `ADM-05` or `BR-14` are only for writing
+down what you tested and reporting a problem. You can ignore them while testing.
+
+**What this guide covers:** the customer app (mobile and web), the admin app
+(mobile and web), the superadmin website, and the cross-app journeys between
+them.
+
+**What it does not cover:** checks that are not visible in the apps. Those are
+handled separately.
+
+---
+
+## Before you test
+
+### What you need
+
+Ask your test coordinator for:
+
+- **Test accounts** — a customer account, a second customer account, a brand-new
+ customer account, an admin account for each test area, and a superadmin
+ account.
+- **Sample data** — two delivery areas (called A and B in this guide), products,
+ delivery slots, and coupons.
+- **A test phone or browser** — the mobile app on a test phone, and the web apps
+ in a browser.
+- **A way to take screenshots** — for any failure.
+
+Do not use a real customer's account, phone number, address, or payment details.
+Use only the test accounts and test area given to you.
+
+### Names used in this guide
+
+These are just labels for the test data. Your coordinator may use different names;
+if so, use theirs.
+
+| Name | What it means |
+|---|---|
+| Customer 1 | The main test customer, with saved addresses in area A |
+| Customer 2 | A second customer, with an address in area B |
+| New Customer | A customer with no saved address and no orders |
+| Admin A / Admin B | Staff accounts for area A and area B |
+| Superadmin | The account that manages areas, staff and global products |
+| Area A / Area B | The two delivery areas used for testing |
+| Product P / Q / G | Test products: P in A, Q in B, G available in both |
+| Slot S1 / S2 | Future delivery time slots in area A |
+| Coupon 10% / Coupon ₹100 | Test coupons used for money checks |
+
+### How to write down a result
+
+For each check, note:
+
+1. What you did.
+2. What you expected to see.
+3. What you actually saw.
+4. A screenshot, if it failed.
+
+Use the reference number from this guide so the team can find the check quickly.
+
+### If you get stuck
+
+- If a screen is loading forever, wait up to one minute, then note the screen and
+ try again once.
+- If data is missing (no products, no slots, no coupons), ask your coordinator;
+ do not change real customer data.
+- If a test changes money, orders, or customer data, use only the test accounts.
+
+---
+
+## 1. Customer app — mobile and web
+
+Use the same steps on the mobile app and on the website unless a step says
+otherwise.
+
+### 1.1 Sign in, create an account and manage your profile
+
+**What this tests:** signing in, creating an account, staying signed in, signing
+out, changing details, and what happens when an account is suspended.
+
+**Steps:**
+
+1. Open the customer app without signing in.
+2. Open **Cart** and **Me**. Check that you are asked to sign in, and that you can
+ still browse the Home page.
+3. From the Cart sign-in prompt, sign in as Customer 1. Add a product before
+ signing in to check that the cart is still there afterwards.
+4. Sign out, then try a wrong password. Sign in correctly.
+5. Create a new account with the **New Customer** details.
+6. Try creating an account with an existing mobile/email and with missing fields.
+7. Close and reopen the app. Check that you are still signed in.
+8. Open **Me** → edit your name/profile photo → save → reopen the app.
+9. Change your password, sign out, and try the old and new passwords.
+10. Sign in as Customer 2. Check that Customer 1's orders, addresses and coupons
+ are not visible.
+11. Ask the admin to suspend Customer 1, then try to place an order. Ask the admin
+ to unsuspend and try again.
+12. On a disposable test account, use **Delete Me and My Data** and try a wrong
+ confirmation first, then the correct one.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-09` | Browsing works signed out; Cart and Me ask you to sign in. |
+| `CUST-10` | You return to the screen you came from; the cart survives sign-in; errors are clear. |
+| `CUST-11` | A wrong password does not sign you in; Customer 2 cannot see Customer 1's data. |
+| `CUST-12` | You stay signed in after reopening; an expired sign-in asks you to sign in again safely. |
+| `CUST-13` | Your name/photo are saved and match what the admin sees. |
+| `CUST-14` | The new password works and the old one does not. |
+| `CUST-15` | Wrong confirmation is rejected; correct confirmation removes access. |
+| `CUST-16` | A suspended customer cannot order; unsuspending allows ordering again. |
+
+### 1.2 Choose the delivery area
+
+**What this tests:** the app finding the right delivery area, asking you when it
+cannot, and keeping the right products and cart when you switch areas.
+
+**Steps:**
+
+1. Open the app in area A. Allow location access if asked.
+2. Check the delivery area/address shown on Home.
+3. Close and reopen the app with location denied, location off, and a point
+ outside the service area.
+4. Open the area/address chooser and select area B manually. If a location request
+ arrives late, check that it does not change your choice.
+5. Sign in as Customer 1 and switch between the saved addresses in A1 and A2.
+6. Add products to the regular cart and the 1-hour cart. Switch to B; cancel the
+ switch, then confirm it.
+7. Switch back to A and check the cart.
+8. Close the app with a cart and reopen it.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-01` | The correct area loads once; products and slots appear. |
+| `CUST-02` | A saved address is used when location is unavailable; otherwise a chooser explains the problem. |
+| `CUST-03` | A late location result does not override your manual choice. |
+| `CUST-04` | The selected address decides the delivery zone and charges; another area's address is ignored. |
+| `CUST-05` | Cancel keeps everything; confirm clears area A selections and loads B. |
+| `CUST-06` | Each area keeps its own cart; switching back restores it. |
+| `CUST-07` | A cart is not wiped just because the app picks the first area on launch. |
+| `CUST-08` | An empty area shows a friendly empty state, not an error. |
+
+### 1.3 Home, search, stores and product details
+
+**What this tests:** that area A and area B show the right products, stores,
+offers and prices, and that product details and add-to-cart work from every entry
+point.
+
+**Steps:**
+
+1. Open Home in area A. Note the products, offers, stores and delivery slots.
+2. Switch to area B and compare.
+3. Use **Search** for a product name, an offer/tag, and a store name. Also search
+ for something that does not exist.
+4. Open **Stores** → a store → a product. Open the global test product G.
+5. Open a product with variants, a combo, and a 1-hour product.
+6. Add the same product from Home, Search, a store and the product page.
+7. Open the quantity selector and try the smallest, largest and an out-of-stock
+ item.
+8. Tap an offer, tag or banner and follow where it goes.
+9. Open the delivery address/area bar and change the address.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-17` | Area A shows A + global products; area B shows B + global products; no cross-area products or prices. |
+| `CUST-18` | Loading, empty, error and refresh states make sense; Retry works. |
+| `CUST-19` | Search returns only products/stores for the chosen area; no results shows a clear empty state. |
+| `CUST-20` | Store lists and store pages show the right products; the global store appears in both areas. |
+| `CUST-21` | Product page shows the correct price, variants, stock, combo contents and 1-hour availability. |
+| `CUST-22` | The same product added from different screens gives the same item, quantity and price. |
+| `CUST-23` | You cannot add more than allowed; out-of-stock items cannot be added. |
+| `CUST-24` | Tapping an offer/banner opens the intended product or store. |
+| `CUST-25` | The current address is shown; changing it updates the delivery area and prices. |
+
+### 1.4 Cart
+
+**What this tests:** adding, changing and removing items, saving the cart, notes,
+delivery slots, and what happens when an item becomes unavailable.
+
+**Steps:**
+
+1. Add a product. Add it again from the product page.
+2. Increase and decrease the quantity. Remove a line and cancel the removal; then
+ remove it for real.
+3. Close and reopen the app with items in the regular cart and the 1-hour cart.
+4. Assign a delivery slot to each item. Leave the cart, come back, and reopen the
+ app.
+5. Add a note for the order. Go to checkout, come back, and change the note.
+6. Ask your coordinator to mark one test product out of stock or unavailable.
+ Refresh the cart.
+7. Close and reopen with an old saved cart.
+8. Sign out and sign in as Customer 2 with Customer 1's cart still saved.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-26` | Adding again merges correctly; changing quantity replaces it; removing affects only that line. |
+| `CUST-27` | Regular and 1-hour carts both come back after reopening. |
+| `CUST-28` | Your slot choice is still there after leaving and returning. |
+| `CUST-29` | Unavailable items are shown clearly and cannot be ordered; if all items are unavailable, checkout is blocked. |
+| `CUST-30` | The latest note is the one shown at checkout and saved with the order. |
+| `CUST-37` | A damaged/old saved cart does not create a fake product or a wrong price. |
+| `CUST-38` | Another customer cannot see or use your cart, address or notes. |
+
+### 1.5 Coupons
+
+**What this tests:** which coupons you can see, why some are disabled, and how
+multiple coupons change the bill.
+
+**Steps:**
+
+1. Open the cart with several items and open the coupon list.
+2. Look for eligible coupons, a coupon for the other area, a first-order coupon,
+ a minimum-spend coupon, a product-specific coupon, an expired coupon, a used
+ coupon and another customer's coupon.
+3. Apply a 10% coupon, then a ₹100 coupon. Remove them and apply them in the
+ opposite order.
+4. Change a quantity and check that the discount recalculates.
+5. Try a coupon that gives 100% off and a coupon whose discount is bigger than
+ the cart.
+6. Check the **Products discount** line in the bill.
+7. Open **Me → Coupons** and compare the labels with the cart.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-31` | Expired, invalid or used-up coupons are not shown. Other coupons show a clear reason when disabled. |
+| `CUST-32` | The bill and each coupon's saving update when you add, remove or change items. |
+| `CUST-33` | Applying the same coupons in a different order can give a different total; the total never goes below zero. |
+| `CUST-34` | The Products discount line appears only when there is a product saving; coupon lines are separate. |
+| `CUST-36` | The cart total, checkout total and saved order total match. |
+| `CUST-57` | The Coupons page agrees with the cart: available, used and expired are labelled correctly. |
+
+### 1.6 Checkout and placing an order
+
+**What this tests:** choosing an address and slot, applying coupons, paying by
+cash on delivery, and the safeguards that stop a wrong or duplicate order.
+
+**Steps:**
+
+1. Open the cart, select a saved address in area A, assign slots, and tap
+ **Checkout**.
+2. Check the address, items, slot, coupon, delivery charge and total.
+3. Look at the payment methods. **Cash on Delivery** should be selected; **Pay
+ Online (Coming Soon)** should be disabled.
+4. Go back to the cart, change the address, slot, coupon or note, and return to
+ checkout.
+5. Tap **Place Order** twice quickly.
+6. Place a valid order.
+7. Note the order number and total on the success screen.
+8. Open **My Orders** and compare the order.
+9. As the New Customer with no address, open Cart and Checkout.
+10. Try checkout with an item that has no delivery slot.
+11. Place a 1-hour order in area A. Then try the 1-hour flow in area B.
+12. Use the back button, refresh the browser, and open the success/detail link
+ again.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-39` | The selected address decides the delivery charge and area. |
+| `CUST-40` | A customer with no address is asked to add one before checkout. |
+| `CUST-41` | Each item carries its own delivery slot; no item is sent without a slot. |
+| `CUST-42` | Only Cash on Delivery is usable; the online option is visibly disabled. |
+| `CUST-43` | The latest address/slot/coupon/note is shown at checkout. |
+| `CUST-44` | A fast double tap places only one order. |
+| `CUST-45` | A failed order shows an error, the button works again, and your cart is kept. |
+| `CUST-46` | If the response is lost, check My Orders before trying again. |
+| `CUST-48` | A multi-slot or zero-total order shows the correct order number and total. |
+| `CUST-49` | 1-hour ordering works in A and is blocked in B. |
+| `CUST-50` | Back/refresh/deep links do not create a second order or show another order. |
+| `CUST-35` | An item with no slot, or a slot that has closed, blocks checkout; a 1-hour cart is not blocked by this rule. |
+
+### 1.7 Orders, cancellation and complaints
+
+**What this tests:** finding orders, reading the bill, cancelling, ordering again,
+and raising a complaint.
+
+**Steps:**
+
+1. Open **Me → My Orders**. Look at pending, delivered and cancelled orders.
+2. Open an order. Check items, address, delivery time, bill, status and notes.
+3. Cancel a new order. Enter a reason and confirm.
+4. Try cancelling a delivered order.
+5. On a cancelled/delivered order, use **Order Again**.
+6. Ask the admin to delete or hide a product you ordered. Open the old order.
+7. Tap **Raise Complaint**, add a message and an image, and submit.
+8. Ask the admin to reply, then reopen the complaint.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-51` | Orders are listed with the correct status and can be scrolled/paged. |
+| `CUST-52` | The order detail matches the bill and what the admin sees. |
+| `CUST-53` | A reason is required; cancelled/delivered orders follow the rules. |
+| `CUST-54` | Order Again adds the available items; unavailable items are handled clearly. |
+| `CUST-55` | The complaint is saved and the admin reply is visible. |
+
+### 1.8 Addresses
+
+**What this tests:** adding, editing, making default and deleting addresses, and
+checking that the map location chooses the right delivery area.
+
+**Steps:**
+
+1. Open **Me → Addresses**.
+2. Add an address using the map and the test area.
+3. Try an address outside the service area.
+4. Add a second address and make it the default.
+5. Edit the address details and move the map pin.
+6. Delete an address that is being used by an open order, then a free address.
+7. Delete the default address, then the last address.
+8. Open the cart and checkout after deleting the last address.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-56` | The map location picks the correct area/zone; an outside point is rejected; the first address becomes default; an address used by an open order cannot be deleted. |
+| `CUST-40` | With no address, the app asks you to add one before checkout. |
+
+### 1.9 Profile, coupons and notifications
+
+**What this tests:** the remaining customer screens and what happens when the
+connection is poor.
+
+**Steps:**
+
+1. Open **Me** and visit each item: My Orders, Coupons, Addresses, Help &
+ Complaints, Terms and profile settings.
+2. Turn the phone/browser offline and open Home, cart and checkout.
+3. Allow notifications, add an address, and open a notification link.
+4. Use the app with a small screen/keyboard and check that buttons are reachable.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `CUST-58` | Notification permission is handled; the link opens the right order/product. |
+| `CUST-59` | Offline screens show a clear error and Retry; no fake success. |
+| `CUST-60` | Keyboard/safe-area/back navigation work; important buttons are readable and reachable. |
+
+---
+
+## 2. Admin app — mobile and web
+
+Use the same steps on the admin mobile app and the admin website. The website may
+ask you to sign in again after a refresh; that is part of the test.
+
+### 2.1 Sign in and area access
+
+**What this tests:** admin sign-in, staying signed in, and making sure an admin
+sees only their own area.
+
+**Steps:**
+
+1. Sign in as Admin A. Open the Dashboard.
+2. Refresh the page (web) or reopen the app (mobile).
+3. Sign out and sign in as Admin B.
+4. Use the browser/device back button to return to an Admin A screen.
+5. Try to open an admin screen without signing in.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `ADM-01` | Admin A signs in, stays signed in, and sees the correct area. |
+| `ADM-02` | Admin A and Admin B see only their own orders, products and counts. |
+| `ADM-03` | After switching to B, Admin A's data is gone and old links are blocked. |
+| `ADM-04` | Signed-out users cannot reach admin screens or actions. |
+
+### 2.2 Orders
+
+**What this tests:** finding orders, reading details, changing status, cancelling,
+changing the delivery charge, and arranging delivery order.
+
+**Steps:**
+
+1. Open **Manage Orders → Orders**. Use the filters and search; scroll to the next
+ page.
+2. Ask Admin B to create several newer orders, then return to Admin A and page
+ through A's orders.
+3. Open an order. Compare the items, bill, address, notes and customer details.
+4. Mark the order **Packaged**, then **Delivered**.
+5. Open the customer app and check the status.
+6. Cancel another order with a reason.
+7. Open a delivered order and try to cancel it.
+8. Remove the delivery charge from a test order.
+9. Use **Rebalance** on a slot and compare the bill.
+10. Open **Delivery Sequences**, change the order, and update one order's map
+ location.
+11. Add an admin note and check the customer note.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `ADM-05` | Filters, search and pages show the right orders. |
+| `ADM-06` | Admin A sees all of A's orders even when other areas have newer orders. |
+| `ADM-07` | The order detail matches the customer's bill. |
+| `ADM-08` | Packaged/delivered changes are saved and visible to the customer. |
+| `ADM-09` | Cancellation needs a reason; a delivered order cannot be cancelled by the customer. |
+| `ADM-10` | Rebalancing keeps the total and discount correct. |
+| `ADM-11` | Delivery order and map changes affect only the intended order. |
+| `ADM-12` | Admin and customer notes appear in the right place. |
+
+### 2.3 Products, prices and stock
+
+**What this tests:** creating and editing products, changing prices/stock,
+handling global products, and avoiding duplicate variants.
+
+**Steps:**
+
+1. Open **Products**. Search for Product P and open its details.
+2. Create a new test product with two variants, an image, features and tags.
+3. Open the customer app in area A and find it.
+4. Edit the product's price, stock, offer and 1-hour availability.
+5. Edit the global product G's price/stock/suspension for area A.
+6. Open the customer app in area B and compare.
+7. Suspend a global product in A, reopen it, change only the price, and save.
+8. Ask the superadmin to edit G's variants. Count the variants before and after.
+9. Delete a product that has orders/variants; then delete a free test product.
+10. Open **Prices Overview** and update a price.
+11. Create/edit/delete a tag, group and combo; assign products.
+12. Upload a product image.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `ADM-13` | The products list and details show the right area and stock state. |
+| `ADM-14` | The new product is saved and appears only in A. |
+| `ADM-15` | Price/stock/offer changes are saved and visible to the customer. |
+| `ADM-16` | Editing a global product in A changes only A's price/stock. |
+| `ADM-17` | A suspended product stays suspended after an unrelated price change. |
+| `ADM-18` | A product with orders/variants cannot be deleted; a free one can. |
+| `ADM-19` | Price edits are saved and the customer sees the new price. |
+| `ADM-20` | Tags and their order match the customer app. |
+| `ADM-21` | Groups and slots keep the right products. |
+| `ADM-22` | A combo shows the right components and price. |
+| `ADM-34` | Uploaded images appear on the product. |
+
+### 2.4 Stores and delivery slots
+
+**What this tests:** store details and the delivery slots customers can choose.
+
+**Steps:**
+
+1. Open **Stores**. Create a store, edit it, and upload an image.
+2. Open the global store and try to edit it.
+3. Delete a store with products/orders, then a free store.
+4. Open **Slots**. Create a future slot and assign products.
+5. Edit its time, capacity and freeze time.
+6. Fill or freeze the slot and open the customer cart.
+7. Replicate or copy a slot.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `ADM-23` | Regional stores are editable; the global store is read-only; images are safe. |
+| `ADM-24` | New/edited/full/frozen slots behave correctly for the customer. |
+
+### 2.5 Coupons, banners and home layout
+
+**What this tests:** regional coupons, banners and the order of items on Home.
+
+**Steps:**
+
+1. Open **Coupons**. Create a 10% coupon, a ₹100 coupon, one for selected
+ products, and one for selected customers.
+2. Use them in the customer app.
+3. Edit and invalidate a coupon; try it again.
+4. Open **Banners**. Create, edit, activate, deactivate and reorder banners.
+5. Check the customer Home in A.
+6. Open **Customize App** and change the Popular Items and All Items order.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `ADM-25` | Coupons work only in the right area/for the right products/users. |
+| `ADM-26` | Only active banners appear, in the chosen order. |
+| `ADM-27` | The customer Home matches the chosen order. |
+
+### 2.6 Users, complaints and notifications
+
+**What this tests:** finding customers, suspending them, adding incidents,
+replying to complaints and sending notifications.
+
+**Steps:**
+
+1. Open **User Management**. Search by Customer 1's name and mobile.
+2. Sign in as Admin B and search for the same customer.
+3. Open a customer. Suspend, unsuspend, and add an incident note.
+4. Open **Complaints**, open a customer complaint, reply and resolve it.
+5. Open the customer app and check the reply.
+6. Open **Send Notifications**, select a test user, and send a test message.
+7. Open **Constants** and change a test setting; check the customer app.
+8. If **Vendor Snippets** is enabled for your test, open it, create a snippet,
+ add a product, and open the slot picker. Refresh the website and try again.
+9. Open a screen with no data (for example, a new area with no orders) and use
+ the back/Retry buttons.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `ADM-28` | Customer details are visible only to the right area. |
+| `ADM-29` | Admin B cannot find Admin A's customers by name or mobile. |
+| `ADM-30` | Suspension and incidents are saved; notifications go only to selected test users. |
+| `ADM-31` | Complaints are area-scoped and the customer sees the reply. |
+| `ADM-32` | Vendor snippets stay in your area and the slot picker still loads after a refresh. |
+| `ADM-33` | The changed setting appears for the customer; the other area is unchanged. |
+| `ADM-35` | Empty/loading/error screens show a clear message; Retry/back works. |
+
+---
+
+## 3. Superadmin website
+
+The superadmin sets up areas, staff, global products and global coupons. Use only
+the test areas and test accounts given to you.
+
+### 3.1 Sign in and delivery areas
+
+**What this tests:** superadmin access, area setup, and the map/zone used for
+delivery.
+
+**Steps:**
+
+1. Sign in as Superadmin. Sign out, sign in again, and refresh.
+2. Open **Regions**. Select area A.
+3. Review the area name, delivery charge, free-delivery amount, 1-hour settings
+ and support details.
+4. If instructed, add a new test area with one delivery zone using the map.
+5. Try to save an area without a zone, or with an invalid/duplicate zone.
+6. Add, edit and delete a test zone. Try deleting the last zone.
+7. Open the customer area chooser and check that the new/edited area appears.
+8. Change an area's settings and check the customer app.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `SA-01` | Superadmin signs in and stays signed in; staff/customer pages are not accessible. |
+| `SA-02` | A new area can be created and appears for customers. |
+| `SA-03` | Missing/invalid zones are rejected without creating a broken area. |
+| `SA-04` | A zone can be edited/deleted only when allowed. |
+| `SA-05` | A new area gets the right products and prices. |
+| `SA-06` | The new area's products and pages open normally. |
+
+### 3.2 Staff and global stores
+
+**What this tests:** creating staff, assigning an area, and managing shared
+stores.
+
+**Steps:**
+
+1. Open **Admin Users**. Add a test admin for area A and one for area B.
+2. Change an admin's area/role, then sign in as that admin.
+3. Remove a test admin and try to sign in.
+4. Open **Global stores**. Create, edit and delete a test global store.
+5. Check the store in both customer areas.
+6. Sign in as Admin A and try to edit the global store.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `SA-07` | Staff get the right area/role; removed staff cannot sign in. |
+| `SA-08` | A global store appears in both areas; regional admins cannot edit it. |
+
+### 3.3 Global products
+
+**What this tests:** products shared by all areas, with different local prices.
+
+**Steps:**
+
+1. Open **Global products**. Create a test global product with two variants.
+2. Set different prices for area A and area B.
+3. Check the product in both customer areas.
+4. Edit the product, save, and save again without changes.
+5. Count the variants in the admin/customer screens.
+6. Open Create, then Edit, then Create again; check the form fields.
+7. Suspend the product in one area and check the other.
+8. Use **Elevate** on a regional product.
+9. Upload a global product image.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `SA-09` | The global product appears in both areas with the local price. |
+| `SA-10` | Editing does not create duplicate variants. |
+| `SA-11` | The form shows the selected product and resets when you start a new one. |
+| `SA-12` | Suspending in one area does not suspend it in the other. |
+| `SA-13` | An elevated product remains available in its original area. |
+| `SA-21` | The image appears in both areas. |
+
+### 3.4 Global coupons, settings and notifications
+
+**What this tests:** coupons shared by all areas, global settings, and admin
+notifications.
+
+**Steps:**
+
+1. Open **Global coupons**. Create a percentage coupon and a ₹ discount coupon.
+2. Use them in both customer areas.
+3. Edit a 20% coupon to ₹50 and save.
+4. Use it again and check the discount.
+5. Invalidate/delete the coupon and try it again.
+6. Open **Constants**. Change a global test setting and compare both areas.
+7. Open **Complaints** and reply to a test complaint.
+8. Open **Send Notifications → Admin Notifs** and send a test message.
+9. Switch between area tabs and refresh.
+10. Open an empty screen and a delete confirmation; try Cancel and then Confirm
+ on a disposable test item.
+
+**What you should see:**
+
+| Check | Expected result |
+|---|---|
+| `SA-14` | Global coupons work in both areas. |
+| `SA-15` | Switching from percentage to ₹ discount uses only the new discount. |
+| `SA-16` | Global settings apply everywhere; local settings still win. |
+| `SA-17` | Complaints show the right area and reply. |
+| `SA-18` | Admin Notifs sends successfully as superadmin. |
+| `SA-19` | Staff/customer accounts cannot open superadmin screens. |
+| `SA-20` | Empty/loading/error screens are clear; Cancel does not delete data. |
+| `SA-22` | Area tabs show the right area and refresh after a rename. |
+| `SA-23` | A global edit reaches all areas after a short wait. |
+
+---
+
+## 4. Cross-app journeys
+
+These checks use more than one app. Keep the same test accounts and data.
+
+### 4.1 Full order journey
+
+**What this tests:** the complete path from setup to delivery.
+
+**Steps:**
+
+1. Superadmin: confirm area A exists and create Admin A if needed.
+2. Admin A: create a test store, product P, future slot S1 and a 10% coupon.
+3. Customer 1: open area A, find P, add it, choose S1, apply the coupon and
+ checkout.
+4. Place the order with Cash on Delivery.
+5. Admin A: find the order, compare the items and bill, mark Packaged, then
+ Delivered.
+6. Customer 1: open My Orders and check the status.
+7. Compare the order number and total everywhere.
+
+**What you should see:** `E2E-01` — the same order and total appear at every step,
+and the status ends as Delivered.
+
+### 4.2 Global product in two areas
+
+**What this tests:** one shared product with different local prices.
+
+**Steps:**
+
+1. Superadmin: create global product G with an A price and a B price.
+2. Customer 1 in A: open G and note the price.
+3. Customer 2 in B: open G and note the price.
+4. Admin A: change the A price.
+5. Admin B: change the B price.
+6. Refresh both customer apps.
+
+**What you should see:** `E2E-02` — each area keeps its own price; changing A does
+not change B.
+
+### 4.3 Switching areas with a cart
+
+**What this tests:** that areas do not mix products or carts.
+
+**Steps:**
+
+1. Customer 1: add a regular product and a 1-hour product in area A.
+2. Switch to area B and cancel; check that A is still there.
+3. Switch to B and confirm; add a B product.
+4. Switch back to A; check the A cart.
+5. Switch to B; check the B cart.
+6. Repeat on the website.
+7. Close and reopen the app.
+
+**What you should see:** `E2E-03` — no product or price from the other area
+appears; each cart comes back when you return to its area.
+
+### 4.4 Coupons on the bill
+
+**What this tests:** multiple coupons and the final payable amount.
+
+**Steps:**
+
+1. Build a ₹1000 cart.
+2. Apply 10% then ₹100; note the discount and total.
+3. Reverse the order; note the difference.
+4. Place the order.
+5. Compare the cart, checkout, success screen, My Orders and Admin A's order.
+
+**What you should see:** `E2E-04` — the total is the same on every screen and never
+goes below zero.
+
+### 4.5 1-hour delivery
+
+**What this tests:** 1-hour products, prices and area availability.
+
+**Steps:**
+
+1. In area A, open the 1-hour section and add a 1-hour product.
+2. Check the 1-hour price and delivery charge.
+3. Place a Cash on Delivery order.
+4. Admin A: open the order and confirm it is a 1-hour order.
+5. Customer 2 in area B: try the 1-hour section for the same product.
+
+**What you should see:** `E2E-05` — A can order; B is blocked; the admin sees the
+right type of order.
+
+### 4.6 Two delivery slots in one order
+
+**What this tests:** one order split into two delivery times with one delivery
+fee.
+
+**Steps:**
+
+1. Add a product for S1 and another for S2 in the same cart.
+2. Checkout and place the order.
+3. Admin A: open the order and check both slots.
+4. Mark one part delivered, then the other.
+5. Customer 1: check both statuses.
+
+**What you should see:** `E2E-06` — two delivery parts, one delivery fee, and the
+correct status for each part.
+
+### 4.7 Cancel and use the coupon again
+
+**What this tests:** cancelling an order and releasing a one-time coupon.
+
+**Steps:**
+
+1. New Customer: place an order with a first-order coupon.
+2. Cancel it with a reason.
+3. Place a new order and use the same coupon.
+4. Place a two-slot order with the coupon and cancel one part.
+5. Cancel the other part.
+6. Try the coupon again.
+
+**What you should see:** `E2E-07` — the coupon becomes usable again only when no
+part of the order remains.
+
+### 4.8 Website checkout with two slots
+
+**What this tests:** the website sends the chosen delivery slot for each item.
+
+**Steps:**
+
+1. On the website, add items for S1 and S2.
+2. Choose both slots in the cart and open Checkout.
+3. Place the order.
+4. Open the order and check both slots.
+5. Try again with one item that has no slot.
+
+**What you should see:** `E2E-08` — the order saves both slots; an item without a
+slot blocks checkout.
+
+### 4.9 Admin search by area
+
+**What this tests:** an admin can find only their own area's customers.
+
+**Steps:**
+
+1. Customer 1 orders in A; Customer 2 orders in B.
+2. Admin A searches for Customer 2's name and mobile.
+3. Admin B searches for Customer 1's name and mobile.
+4. Search for a name that exists in both areas.
+
+**What you should see:** `E2E-09` — each admin sees only their own area's
+customers and mobile numbers.
+
+### 4.10 Global update reaches both areas
+
+**What this tests:** a global product change appears everywhere.
+
+**Steps:**
+
+1. Superadmin: change global product G.
+2. Admin A: immediately change a banner or product in A.
+3. Wait up to two minutes.
+4. Refresh the customer apps in A and B.
+
+**What you should see:** `E2E-10` — both areas show the global change; A also
+shows its local change.
+
+### 4.11 Admin website refresh
+
+**What this tests:** an admin website refresh keeps you signed in and keeps the
+slot picker working.
+
+**Steps:**
+
+1. Sign in to the admin website and open **Vendor Snippets**.
+2. Refresh the browser.
+3. Create/edit a snippet and open the slot picker.
+4. Repeat after signing out and in as Admin B.
+
+**What you should see:** `E2E-11` — you stay signed in with the right area and
+the slots load.
+
+### 4.12 Superadmin admin notification
+
+**What this tests:** sending a notification to admins.
+
+**Steps:**
+
+1. Sign in as Superadmin and open **Send Notifications → Admin Notifs**.
+2. Enter a title and message and send.
+3. Check the success message.
+4. Ask an admin to check for the notification.
+
+**What you should see:** `E2E-12` — the message is queued/sent without an error.
+
+### 4.13 Different roles see different things
+
+**What this tests:** customers, admins and superadmins cannot use each other's
+screens.
+
+**Steps:**
+
+1. Sign in as a customer and try to open an admin screen by typing its web
+ address.
+2. Sign in as an admin and try to open a superadmin screen.
+3. Sign in as a superadmin and check that customer/admin-only screens are not
+ available.
+4. Use the back button after signing out.
+
+**What you should see:** `E2E-13` — each role sees only its own screens; old links
+do not work after sign-out.
+
+### 4.14 Deleted product in old orders
+
+**What this tests:** old orders still show a product after it is removed.
+
+**Steps:**
+
+1. Place an order for a test product.
+2. Admin A: delete or hide the product.
+3. Refresh the customer catalog; the product is gone.
+4. Open the old order as the customer and as Admin A.
+5. Try Order Again.
+
+**What you should see:** `E2E-14` — the catalog hides it, but the old order keeps
+the name, quantity and price; reorder handles it as unavailable.
+
+### 4.15 Address in another area
+
+**What this tests:** the delivery address decides the order's area.
+
+**Steps:**
+
+1. Customer 1 is browsing area A.
+2. Add/select an address inside area B.
+3. Build a cart and open checkout.
+4. Check the delivery charge and place the order.
+5. Admin B: find the order.
+6. Admin A: confirm the order is not there.
+
+**What you should see:** `E2E-15` — the order belongs to B and uses B's charges.
+
+### 4.16 Delivered/cancelled messages
+
+**What this tests:** status changes and notification links.
+
+**Steps:**
+
+1. Place an order and note its number.
+2. Admin A: mark it delivered.
+3. Open the customer notification/link.
+4. Cancel another order with a reason.
+5. Open that notification/link.
+
+**What you should see:** `E2E-16` — each link opens the correct order with the
+correct status.
+
+---
+
+## 5. Special regression checks
+
+These are the checks that previously found bugs. Run them before the wider
+testing if you can.
+
+### BR-01 — Customer search stays inside an area
+
+1. Customer 1 orders in A; Customer 2 orders in B.
+2. Sign in as Admin A and search for Customer 2 by name and mobile.
+3. Sign in as Admin B and search for Customer 1.
+4. Search a name used in both areas.
+
+**Expected:** each admin sees only their own area's customers.
+
+### BR-02 — Website loads after choosing an area
+
+1. On the website, choose area A.
+2. Check that products, slots and delivery charges load.
+3. Switch to area B and check again.
+
+**Expected:** the page loads normally; no error or blank catalog.
+
+### BR-03 — Editing a global product does not duplicate variants
+
+1. Superadmin: open a global product with two variants.
+2. Change a price and save.
+3. Save again without changes.
+4. Count the variants.
+
+**Expected:** still two variants; no duplicate appears.
+
+### BR-04 — Global store image stays after a rejected edit
+
+1. Superadmin: open a global store with an image; note the image.
+2. Admin A: try to edit the global store.
+3. Refresh the store in both apps.
+
+**Expected:** the edit is rejected and the image is still there.
+
+### BR-05 — Global change plus local change
+
+1. Superadmin: change a global product.
+2. Within 30 seconds, Admin A: change a banner or product in A.
+3. Wait up to two minutes; refresh both areas.
+
+**Expected:** both areas show the global change and A also shows its local change.
+
+### BR-06 — Website checkout sends slots
+
+1. Website: add items for S1 and S2.
+2. Choose both slots and place the order.
+3. Check the order detail.
+
+**Expected:** both slots are saved; no "slot required" error.
+
+### BR-07 — New area is usable
+
+1. Superadmin: create a test area with a zone.
+2. Open the customer area chooser and select it.
+3. Check products/slots/delivery charges.
+
+**Expected:** the area is listed and its pages load.
+
+### BR-08 — Global product form does not keep an old draft
+
+1. Superadmin: Global products → Create; type a name but do not save.
+2. Click Edit on another product.
+3. Click Create again.
+
+**Expected:** Edit shows the selected product; Create is empty.
+
+### BR-09 — Old orders in a quiet area
+
+1. Area A has several old orders; Area B creates many new orders.
+2. Admin A: open Manage Orders and page through.
+
+**Expected:** all A orders appear; the list is not empty.
+
+### BR-10 — Cart survives the first area choice (known issue)
+
+1. Add a product to the cart.
+2. Close and reopen the app; let it choose the first area.
+3. Open the cart.
+
+**Expected:** the cart is still there. If it is empty, record it as `BR-10`
+(known issue).
+
+### BR-11 — Suspension stays after a price change
+
+1. Admin A: suspend a global product in A.
+2. Reopen it, change only the price, and save.
+3. Check the customer app in A and B.
+
+**Expected:** it is still suspended in A; B is unchanged.
+
+### BR-12 — Coupons never make a total negative
+
+1. Build two cart parts of ₹101 each.
+2. Apply two ₹101 coupons.
+3. Place the order.
+
+**Expected:** each part shows ₹0, not a negative amount; the bill adds up.
+
+### BR-13 — Old orders and discounts (accepted)
+
+1. Open an old order that used a coupon.
+2. Check the discount line in the customer and admin views.
+
+**Expected:** the discount may show ₹0 for very old orders. This is accepted for
+now; do not report it as a new bug.
+
+### BR-14 — Changing a global coupon type (known issue)
+
+1. Superadmin: create a 20% global coupon.
+2. Edit it to ₹50 and save.
+3. Use it in the customer app.
+
+**Expected:** the discount should be ₹50 only. If 20% is still applied, record it
+as `BR-14` (known issue).
+
+### BR-15 — Admin website after refresh
+
+1. Sign in to the admin website.
+2. Refresh the page.
+3. Open Vendor Snippets and the slot picker.
+
+**Expected:** you stay signed in and the slots load.
+
+### BR-16 — Superadmin admin notification
+
+1. Superadmin: Send Notifications → Admin Notifs.
+2. Send a test message.
+3. Check the result.
+
+**Expected:** the message sends successfully; no error.
+
+### BR-17 — Only Cash on Delivery
+
+1. Open checkout.
+2. Look at the payment methods.
+3. Place a test order.
+
+**Expected:** Cash on Delivery is the only usable method; the online option is
+disabled.
+
+### BR-18 — No delivery slot
+
+1. Add an item and do not choose a slot.
+2. Try to check out.
+
+**Expected:** checkout is blocked with a clear message.
+
+### BR-19 — Address decides the area
+
+1. Browse area A, then select an address in area B.
+2. Place an order.
+3. Check Admin A and Admin B order lists.
+
+**Expected:** the order appears in B with B's charges, not in A.
+
+### BR-20 — Order pages stay stable
+
+1. Create orders in A and B.
+2. Admin A: page through the order list.
+3. Admin B: do the same.
+
+**Expected:** every order appears once; pages do not skip or repeat orders.
+
+---
+
+## 6. Other screens (only if your coordinator says they are active)
+
+Some screens are not part of normal testing. Test them only if your coordinator
+confirms they are in use for this release.
+
+### 6.1 Vendor page
+
+1. Open the vendor page link and sign in with the provided test code.
+2. Open the order list and choose an order.
+3. Mark an item packaged and verified.
+4. Try a different/incorrect test code.
+
+**What you should see:** `COND-01` — the vendor sees only their orders and can
+package them; a wrong code is rejected.
+
+### 6.2 Reviews
+
+1. As a customer, open a delivered order or product and write a review with an
+ image.
+2. As an admin, open **Reviews** and reply.
+3. Check the customer can see the reply.
+
+**What you should see:** `COND-02` — the review and reply are saved and visible.
+If reviews are not active, skip this check.
+
+### 6.3 One-time password (OTP) sign-in
+
+1. Use the test mobile number and the test code provided by your coordinator.
+2. Request the code and sign in.
+3. Try a wrong/expired code, then the correct one.
+
+**What you should see:** `COND-03` — one account is created/signed in, and a wrong
+code is rejected. Never use a real customer's phone number.
+
+### 6.4 Older fallback pages
+
+1. Open the older login/home/order-details links provided by your coordinator.
+2. Check only the pages your coordinator says are still supported.
+3. Note any page that looks like a demo or is no longer used.
+
+**What you should see:** `COND-04` — supported pages work; unsupported pages are
+recorded as "not applicable" with a reason.
+
+---
+
+## 7. Known issues
+
+| Check | What to expect |
+|---|---|
+| `BR-10` | A cart may be cleared when the app chooses the first area on launch. Record it; it is known. |
+| `BR-14` | A global coupon changed from 20% to ₹50 may still apply 20% in the current build. Record it; it is known. |
+| `BR-13` | Very old orders may show a ₹0 discount. This is accepted; do not report it as new. |
+
+---
+
+## 8. Reporting a problem
+
+Use this simple format:
+
+```text
+What I was testing:
+Reference number (for example CUST-31):
+Account used (Customer 1 / Admin A / Superadmin):
+Area (A or B):
+Steps I took:
+What I expected:
+What actually happened:
+Screenshot:
+Date and time:
+```
+
+If the problem involves money, write down the item total, discount, delivery
+charge and final total. If it involves an order, include the order number.
diff --git a/docs/full-product-validation-test-plan.md b/docs/full-product-validation-test-plan.md
new file mode 100644
index 0000000..671d928
--- /dev/null
+++ b/docs/full-product-validation-test-plan.md
@@ -0,0 +1,709 @@
+# Freshyo full-product validation test plan
+
+Status: proposed — **not executed**.
+Branch: `MULTI_REGION_I2` (48 commits ahead of `main`).
+Scope: backend tRPC/API, customer native + web, admin native + web, superadmin web, cache/jobs, and the cross-app order journey.
+
+This is the automation-focused master plan: **311 cases** across seven layers.
+The exhaustive per-feature edge-case catalog lives in
+[`docs/test-cases/`](test-cases/README.md); this file lists the cases that must be
+automated and run for release. A test case is a user journey, an API contract, or
+a cross-app invariant — **not** a component render or prop unit test.
+
+For human reproduction of the app-visible cases, use the companion
+[`full-product-validation-manual-testing-guide.md`](full-product-validation-manual-testing-guide.md)
+or its [self-contained HTML version](full-product-validation-manual-testing-guide.html).
+The manual guide is written for non-technical testers and intentionally excludes
+the backend/API, security, database and cache procedures.
+
+---
+
+## 1. Goals and boundaries
+
+### Must validate
+
+1. Every authorization boundary: anonymous, customer, staff A, staff B, superadmin.
+2. Every money path: cart preview → checkout → persisted order → customer detail → admin detail.
+3. Region/bound isolation: catalog, prices, stock, slots, orders, staff, caches.
+4. Global entities (stores/products/coupons) in every region, with independent market data.
+5. Cache publication: regional vs global regeneration, debounce, versions, bound discovery.
+6. COD-only checkout and the absence of online-payment routes/UI.
+7. The operational chain: superadmin setup → admin catalog/slots → customer order → admin fulfillment → customer status.
+8. Recovery: expired sessions, stale caches, offline, retries, double submits, failed mutations.
+
+### Explicitly out of scope
+
+- Component-level unit tests, prop tests, renderer snapshots, and pure-helper tests
+ (the shared pricing helpers are validated through API/UI money cases).
+- Styling, animation, icon, and layout snapshots.
+- Third-party internals (Expo, Cloudflare, D1, KV, R2, Maestro/Playwright drivers).
+- Live SMS/OTP, real push broadcasts, real object-storage deletes outside staging,
+ and online payment gateways.
+- Drizzle migrations. **Never run migrations as test setup.** The user applies them.
+- Production mutation tests. All mutation/notification cases use staging only.
+- `apps/info-site` is a static marketing site: manual link/uptime smoke only, not part of this suite.
+
+### Definition of a valid case
+
+A case passes only when the observable result is confirmed from the authoritative
+surface, not from a toast:
+
+- Money: `goods − stored discount + delivery = payable`, per sub-order and in total.
+- Cache: DB value, served version and elapsed time all agree within the deadline.
+- Mutations: the intended rows exist **and** no unintended rows/assets changed.
+- Rejections: correct 4xx contract **and** no partial writes.
+- UI: the expected screen was actually open; a success toast alone is not evidence.
+
+---
+
+## 2. Automation layers
+
+| Layer | Tool | What is real | Network | Location |
+|---|---|---|---|---|
+| L1 Backend API | Jest + `ts-jest` + tRPC HTTP client | Backend worker, D1/KV/R2/DO | Real local HTTP | `apps/backend/tests/api/` |
+| L2 Customer UI | Jest + `jest-expo` + React Native Testing Library | Screen, router, providers, stores, storage | Mocked tRPC/axios boundary | `apps/user-ui/tests/flows/` |
+| L3 Admin UI | Jest + `jest-expo` + RNTL | Screen, router, providers, stores | Mocked tRPC/axios boundary | `apps/admin-ui/tests/flows/` |
+| L4 Customer web | Jest + jsdom + React Testing Library | Route, router, providers, localStorage | Mocked tRPC link | `apps/web-ui/tests/flows/` |
+| L5 Admin web | Jest + jsdom + React Testing Library | Route, router, providers, localStorage | Mocked tRPC link | `apps/admin-web/tests/flows/` |
+| L6 Superadmin | Vitest + jsdom + React Testing Library (already configured; the same cases run under Jest if the repo standardizes) | Route, router, providers | Mocked tRPC link | `apps/superadmin-ui/src/**/*.test.tsx` |
+| L7 Cross-app E2E | Maestro (native) + Playwright (web) | Real backend, DB, cache, storage | Real | `tests/e2e/`, `tests/e2e-web/` |
+
+Rules for L2–L6:
+
+- Mount the **route/screen**, not an isolated component.
+- Exercise real navigation, state stores, query invalidation and persisted storage.
+- Mock only the network boundary; keep the app's validation, guards and rendering real.
+- Prefer `testID` / accessible roles over text that changes with copy.
+- One test = one user-visible outcome, not one assertion per element.
+- No shallow rendering, no component prop matrices, no snapshots.
+
+Rules for L1:
+
+- Talk to a running backend over HTTP, exactly like the apps.
+- Create fixtures through the API; add a sanctioned fixture/reset path only if API
+ setup becomes too slow.
+- Tests share data; run serially and use unique name/mobile prefixes.
+- Never point a mutation test at production.
+
+Rules for L7:
+
+- Only the critical journeys below. Do not re-implement the full API suite in E2E.
+- Native: Maestro flows with stable IDs; Web: Playwright Chromium.
+- A coordinator carries region/product/SKU/slot/order IDs between apps.
+- Assert persisted state through the UI plus one authoritative API read.
+
+---
+
+## 3. Environment and fixtures
+
+### Environment
+
+- Isolated staging backend with its own D1/KV/R2/queue/DO namespace and object store.
+- Local commands (for the future test harness; **do not run while authoring**):
+ - backend: `cd apps/backend && bun run dev` (wrangler dev on `:8787`)
+ - backend suite: `cd apps/backend && bun run test:api`
+ - native suites: `cd apps/user-ui && bun run test`, `cd apps/admin-ui && bun run test`
+ - web suites: add `bun test` scripts to `apps/web-ui`, `apps/admin-web`, `apps/superadmin-ui`
+ - E2E: `tests/e2e/run.sh` (Maestro) and `npx playwright test` (web)
+- Web/native unit suites must point at the same staging API version as the backend suite.
+
+### Shared fixtures
+
+| Fixture | Required setup |
+|---|---|
+| Regions | A and B. A has bounds A1/A2 (priority 1/2, different fees); B has B1. Include interior, edge, overlap and outside points. |
+| Identities | anonymous, U1 (addresses in A1/A2), U2 (B1), U0 (new, zero addresses), suspended user, staff A, staff B, superadmin. |
+| Catalog | A-only product P with two SKUs; B-only Q; global G with independent A/B market rows; regular-only R; flash F; combo C with combo-only component K; deleted/OOS/suspended variants. |
+| Stores | regional store A, regional store B, global store GS. |
+| Slots | future S1/S2 in A, B slot; inactive, frozen, full, past and midnight-boundary slots. |
+| Money | per-bound free-delivery threshold T and fee D; flash threshold/fee; T−0.01/T/T+0.01. |
+| Coupons | regional A/B, global, percent, flat, targeted, whole-cart, capped, min-spend, exclusive, first-order, limited-use, personal, expired, invalidated, reserved. |
+| Orders | pending COD, packaged, verified, delivered, cancelled, multi-slot group, flash, historical product-deleted. |
+| Content | tags, groups, banners, upload assets, complaints, notifications, vendor snippets (conditional). |
+| Notifications | sandbox queue and approved test recipients only. |
+
+### Data rules
+
+- Unique run prefix for every created name/mobile/email/code.
+- Never delete a region; neutralize throwaway regions by renaming/shrinking instead.
+- Bounds are deletable only when the region has another bound and no addresses reference them.
+- Product deletion is soft; order history must keep the original name and amount.
+- Clean up only approved disposable rows/assets; keep failing fixtures for diagnosis.
+- Record region/bound IDs, product/SKU IDs, slot IDs and order IDs in the run report.
+
+---
+
+## 4. Priorities and release gates
+
+| Priority | Meaning | Gate |
+|---|---|---|
+| P0 | Authorization, money integrity, core purchasing, region isolation, data loss | Every P0 must pass before any release. |
+| P1 | Normal feature behaviour, important edge cases, parity | Every P1 must pass or be explicitly waived. |
+| P2 | Resilience, presentation, conditional/legacy coverage | Run before major releases; document N/A reasons. |
+
+Release gate:
+
+1. `typecheck` clean for touched apps/packages.
+2. All P0 backend + frontend cases pass on the release candidate.
+3. All P1 cases pass or have a signed waiver.
+4. E2E critical journeys pass against staging.
+5. No P0/P1 open defect without a documented workaround.
+
+---
+
+## 5. Current-branch delta → required coverage
+
+The branch changes are concentrated in multi-region support, global entities,
+bound-based discovery/pricing, cache publication and the COD-only conversion.
+Each change below has dedicated cases in §7.
+
+| # | Change / fixed defect | Regression cases |
+|---|---|---|
+| 1 | Admin customer search must be region-scoped (`or()` grouping) | `BR-01`, `BE-ADMIN-15` |
+| 2 | Web discovery must request `essentialConsts({ boundId })` | `BR-02`, `CUST-01` |
+| 3 | Global-product edit must preserve SKU IDs | `BR-03`, `BE-SA-09` |
+| 4 | Regional edit of a global store must not delete its image | `BR-04`, `BE-ADMIN-08` |
+| 5 | Global cache request must not be narrowed by a regional request | `BR-05`, `BE-CACHE-04` |
+| 6 | Web scheduled checkout must send each line's slot ID | `BR-06`, `CUST-41` |
+| 7 | New-region cache generation must be awaited | `BR-07`, `BE-SA-05` |
+| 8 | Global-product edit form must reset between create/edit | `BR-08`, `SA-12` |
+| 9 | Regional order list must paginate its own rows, not a global ID window | `BR-09`, `BE-ORDER-23`, `ADM-06` |
+| 10 | Startup region adoption must not wipe a persisted cart | `BR-10` (known open) |
+| 11 | Unrelated market edits must preserve regional suspension | `BR-11`, `BE-ADMIN-05` |
+| 12 | Coupon allocation must never make a sub-order negative | `BR-12`, `CUST-33`, `BE-COUP-15` |
+| 13 | Historical `discount_amount` backfill | `BR-13` (accepted limitation) |
+| 14 | Switching a global coupon from percent to flat must clear percent | `BR-14` (known open) |
+| 15 | Admin-web reload must restore staff identity/region | `BR-15`, `ADM-01`, `ADM-32` |
+| 16 | Superadmin "Admin Notifs" must use a superadmin-guarded endpoint | `BR-16`, `SA-18` |
+| 17 | COD-only conversion (no online-payment routes/UI) | `BR-17`, `BE-ORDER-01`, `CUST-42` |
+| 18 | Per-slot web checkout validation (`slotId` non-null for scheduled) | `BR-18`, `BE-ORDER-08` |
+| 19 | Bound-based pricing from the address, not the client region | `BR-19`, `BE-ORDER-11`, `CUST-39` |
+| 20 | Search/order pagination keyset stability | `BR-20`, `BE-ORDER-23` |
+
+---
+
+## 6. Master case inventory
+
+### 6.1 Backend API (L1)
+
+#### Common discovery, regions and bounds
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-COM-01 | P0 | `GET /api/health` and `common.healthCheck`. | 200/ok; no secrets. |
+| BE-COM-02 | P0 | `common.listRegions` as anonymous. | Regions with public discovery metadata only; no staff/account data. |
+| BE-COM-03 | P0 | `resolveRegionByLocation` for A1, A2, B1, overlap, polygon edge. | Correct region/bound; priority wins on overlap; edge follows documented rule. |
+| BE-COM-04 | P0 | `resolveRegionByLocation` outside every polygon and invalid coordinates. | Outside → `null`; invalid → 400. |
+| BE-COM-05 | P0 | `resolveBound` for a valid A point, an outside-A point, and a B point with `regionId=A`. | A point → A bound; outside/foreign → 422; no cross-region fallback. |
+| BE-COM-06 | P1 | `activeBound` signed-out, U1 with A1/A2, U1 with B-only addresses, U0 with none. | Signed-out → effective bound; U1 → lowest-priority A bound; B addresses ignored; U0 → effective bound. |
+| BE-COM-07 | P1 | `regionSettings` for A; region with no bounds; unknown region. | Effective bound settings; 422 for no bounds; 422/404 for unknown. |
+| BE-COM-08 | P0 | `essentialConsts` with `boundId`, missing `boundId`, unknown `boundId`. | Merged global/region/bound payload for the bound; validation error when missing; 404 unknown. |
+| BE-COM-09 | P2 | `essentialConsts` on a `raw`/`mf` host. | Stale-client notice fields present and non-closable; normal hosts omit it. |
+| BE-COM-10 | P1 | `checkLocationInPolygon` inside/outside/invalid. | Boolean for valid points; validation error for invalid. |
+| BE-COM-11 | P0 | `getStoresSummary` as staff A, staff B, customer. | Staff A only A stores; staff B only B; customer denied. |
+
+#### Customer authentication and profile
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-AUTH-01 | P0 | Register a new customer, then log in by mobile and by email. | One user row; both identifiers authenticate; token works. |
+| BE-AUTH-02 | P0 | Duplicate mobile, duplicate email, malformed mobile/email, weak password. | Rejected; no partial user/credential rows. |
+| BE-AUTH-03 | P1 | Login with wrong password/unknown identifier and retry correctly. | Rejected then succeeds; no session from the failure. |
+| BE-AUTH-04 | P0 | Expired, tampered and malformed JWT on a protected query. | 401; no fallback identity/region. |
+| BE-AUTH-05 | P1 | `getSelfData`, `updateProfile`, avatar change, relaunch/read-back. | Values persist; no other user's data. |
+| BE-AUTH-06 | P1 | `updatePassword` with wrong old password, then correct; login old/new. | Wrong rejected; new works; old fails. |
+| BE-AUTH-07 | P1 | `deleteAccount` with wrong confirmation, then correct. | Wrong rejected; correct deletes/revokes access. |
+| BE-AUTH-08 | P0 | Suspended customer places an order with an existing token; unsuspend; retry. | Blocked while suspended; allowed after unsuspend. |
+| BE-AUTH-09 | P0 | User token calls admin/superadmin mutations; staff token calls user/superadmin. | Denied at the procedure; no writes. |
+| BE-AUTH-10 | P0 | Two customers U1/U2 probe each other's profile/address/order/coupon IDs. | Ownership enforced on every surface. |
+| BE-AUTH-11 | P0 | Customer with zero addresses attempts to place an order. | Rejected with a meaningful address error; no order. |
+
+#### Addresses and region/bound attachment
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-ADDR-01 | P0 | Create an address with coordinates inside A1 and inside A2. | Correct region + derived bound; coordinates stored. |
+| BE-ADDR-02 | P0 | Create with coordinates outside every A bound. | 422; no address row. |
+| BE-ADDR-03 | P1 | Create without coordinates (legacy web) and with a Google Maps URL. | Fallback to region effective bound; URL coords parsed when present. |
+| BE-ADDR-04 | P1 | Invalid phone (9 digits, starts 5), missing name/line/city/state. | Validation errors; no row. |
+| BE-ADDR-05 | P1 | First address, then second address with `isDefault=false`, then set it default. | First is default; setting default unsets the previous one. |
+| BE-ADDR-06 | P0 | Update another user's address ID. | Not found/forbidden; no change. |
+| BE-ADDR-07 | P1 | Update coordinates from A1 to A2; update region to B with B coordinates. | Bound re-derived; region/bound/address consistent. |
+| BE-ADDR-08 | P1 | Delete an address used by an ongoing order vs a free address. | Ongoing-order address refused; free address deleted. |
+| BE-ADDR-09 | P1 | Delete the default address while another exists; delete the last address. | Default policy remains coherent; address gate appears for zero addresses. |
+| BE-ADDR-10 | P1 | Create/update address and inspect `user_regions` and notification credentials. | Association inserted/reconciled; token region follows the address region. |
+| BE-ADDR-11 | P0 | Cart/checkout and order use an address whose coordinates are in B while browsing A. | Order is scoped/priced by the address's B region/bound; browsing region unchanged. |
+| BE-ADDR-12 | P1 | `getDefaultAddress` / `getUserAddresses` for U1 and U2. | Only the caller's addresses; default flag correct. |
+
+#### Catalog, stores, search, combos and slots
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-CAT-01 | P0 | Read A catalog containing A-only P, B-only Q and global G. | P and G only; Q absent; G uses A market data. |
+| BE-CAT-02 | P0 | Read B catalog for the same fixture. | Q and G only; P absent; G uses B market data. |
+| BE-CAT-03 | P1 | Product detail for P, Q, G in A and B. | Correct region/market price, flags and variants; foreign product not purchasable. |
+| BE-CAT-04 | P1 | Search by name/tag/store in A. | Only A + global matches; no B results; case/whitespace behaviour documented. |
+| BE-CAT-05 | P1 | Product list with deleted, OOS, globally suspended and regionally suspended SKUs. | Deleted hidden; OOS/suspended flags correct; no orderable invalid SKU. |
+| BE-CAT-06 | P1 | Stores list/detail in A and B, including global store GS. | Regional isolation; GS visible in both; product counts/assets coherent. |
+| BE-CAT-07 | P1 | Banners and tags in A/B. | Region-correct order/visibility; no foreign content. |
+| BE-CAT-08 | P0 | `getSlots` without `regionId`, for A, for B. | Missing → validation error; A/B return only future active slots for that region. |
+| BE-CAT-09 | P1 | Slots that are full, frozen, past, inactive. | Excluded from customer lists; capacity/status correct. |
+| BE-CAT-10 | P1 | Slot membership: SKU not assigned to a slot. | Not orderable into that slot; checkout rejects. |
+| BE-CAT-11 | P1 | Combo C with component K; K unavailable/out of stock. | Combo composition/pricing correct; unavailable component prevents purchase. |
+| BE-CAT-12 | P0 | Flash product F in A (enabled) and B (disabled). | Flash list/price only where enabled; disabled region cannot order. |
+| BE-CAT-13 | P1 | Global product with different A/B market prices and suspension. | Each region sees its own price/stock/suspension only. |
+| BE-CAT-14 | P1 | Product tags/group ordering and popular-items ordering. | Order matches admin configuration; region-scoped. |
+| BE-CAT-15 | P2 | Empty region with no stores/products/slots. | Intentional empty payloads; no crash or cross-region fallback. |
+| BE-CAT-16 | P0 | Catalog response inspection. | No customer/staff private data, addresses, tokens or internal notes. |
+
+#### Coupons and pricing
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-COUP-01 | P0 | Eligible coupon list for U1 in A with regional/global/personal/expired/invalidated/used-up coupons. | Only visible eligible-or-disabled candidates; expired/invalidated/used-up/other-user hidden. |
+| BE-COUP-02 | P0 | Apply a regional A coupon while ordering in B. | Rejected; no usage recorded. |
+| BE-COUP-03 | P0 | First-order-only coupon for U0 and for U1 with an order. | U0 accepted; U1 rejected with the documented message. |
+| BE-COUP-04 | P0 | `minOrder` below, equal and above the eligible subtotal. | Below rejected; equal accepted; reason uses the eligible subtotal. |
+| BE-COUP-05 | P0 | Targeted coupon whose SKUs are present, partially present and absent. | Discount only on targets; absent → no-applicable-items error. |
+| BE-COUP-06 | P0 | Coupon at the per-user usage limit and one below it. | Limit enforced; one-time usage recorded. |
+| BE-COUP-07 | P0 | Exclusive coupon combined with another coupon. | Combination rejected; exclusive alone works. |
+| BE-COUP-08 | P0 | Stack 10% then ₹100 on ₹1000; reverse order. | 200 (800 payable) vs 190 (810 payable); order-sensitive result. |
+| BE-COUP-09 | P0 | 15% on ₹999; 12.5% on ₹1000; exact `.5` rounding. | Discounts round to nearest rupee consistently client/server. |
+| BE-COUP-10 | P1 | Percentage with `maxValue` after a prior coupon; flat above remaining. | Cap applies to its own reduced base; discount clamped to remaining. |
+| BE-COUP-11 | P0 | 100% and 150% coupons. | Goods never below zero; delivery may remain; no negative totals. |
+| BE-COUP-12 | P0 | Delivery with a coupon that crosses the free-delivery threshold. | Coupon base excludes delivery; fee uses the defined post-discount goods subtotal. |
+| BE-COUP-13 | P1 | Targeted + whole-cart coupons across two slots. | Per-sub-order discounts sum exactly; no unrelated goods discounted. |
+| BE-COUP-14 | P0 | Coupon usage persists once per order group; cancellation restores it. | Usage row/one-time invariants correct; cancel frees usage when no sibling remains. |
+| BE-COUP-15 | P0 | ₹101 sub-order ×2 with two ₹101 stackable coupons. | Per-sub-order discounts ≤ goods; totals never negative; exact reconciliation. |
+| BE-COUP-16 | P1 | Coupon invalidated/deleted after being selected but before submit. | Submit rejects; no silently discounted order. |
+| BE-COUP-17 | P1 | Global coupon authored by superadmin used in A and B. | Applies in both; regional coupon does not leak. |
+| BE-COUP-18 | P1 | Global coupon switched from 20% to ₹50 in the superadmin form. | Percentage is cleared; pricing uses ₹50 only (`BR-14`, known open). |
+
+#### Orders, cancellation and fulfillment
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-ORDER-01 | P0 | Valid scheduled COD order with address, slot, notes and coupon. | Correct rows/SKUs/qty/region/amount; COD only; no payment-gateway fields. |
+| BE-ORDER-02 | P0 | Items assigned to S1 and S2 in one checkout. | One sub-order per slot in one group; one delivery fee on the primary; totals sum. |
+| BE-ORDER-03 | P0 | Persisted order read back by customer and admin. | Same items, discount, delivery, total, region and status on both surfaces. |
+| BE-ORDER-04 | P0 | Empty items, unknown SKU, invalid/negative/fractional quantity, duplicate lines. | No empty/invalid order; quantity/duplicate policy enforced. |
+| BE-ORDER-05 | P0 | Foreign-region SKU, slot or address-bound pairing. | Rejected; no cross-region order or fee manipulation. |
+| BE-ORDER-06 | P0 | Deleted, OOS, globally suspended and regionally suspended SKU. | Rejected server-side even with a stale client payload. |
+| BE-ORDER-07 | P0 | Full, frozen, past, inactive or wrong-region slot. | Rejected with the appropriate 4xx; no order. |
+| BE-ORDER-08 | P0 | Scheduled order with `slotId: null` (the old web bug). | Rejected with "slot required"; valid per-line slot IDs succeed. |
+| BE-ORDER-09 | P0 | Slot does not carry one of the ordered SKUs. | Rejected; no partial order. |
+| BE-ORDER-10 | P0 | Address coordinates in B while the client sends `regionId=A`. | Server derives B from coordinates; B pricing/slot/region used. |
+| BE-ORDER-11 | P0 | Bound A1 vs A2 selected address with different fee/threshold. | Address bound drives the fee/threshold; client bound is ignored. |
+| BE-ORDER-12 | P0 | Coupon becomes ineligible between selection and submit. | Server revalidates; rejection or documented repricing; no false success. |
+| BE-ORDER-13 | P1 | User notes and admin notes round-trip. | Persisted and visible on the correct surfaces. |
+| BE-ORDER-14 | P0 | Flash order with a flash price and null slot. | Flash price/flag/fee; no scheduled slot; admin sees flash order. |
+| BE-ORDER-15 | P0 | Flash disabled in the address bound but enabled in the browsing region. | Rejected server-side. |
+| BE-ORDER-16 | P1 | Rapid double tap / duplicate in-app submit. | One in-app request; no duplicate order. |
+| BE-ORDER-17 | P1 | Raw concurrent API submits (characterization). | Record whether two orders are created; known lack of server idempotency is explicit. |
+| BE-ORDER-18 | P1 | Historical order after product/variant/store soft delete. | History keeps original name, quantity and charged amount. |
+| BE-ORDER-19 | P1 | Customer order list pagination and order detail by numeric ID. | Stable order; no duplicates/skips; readable ID rejected if not supported. |
+| BE-ORDER-20 | P0 | U2 reads/cancels/notes U1's order; staff B reads A's order. | Denied; no private payload. |
+| BE-ORDER-21 | P0 | Cancel with reason, without reason, by user and by staff. | Reason required; actor/status correct; coupon usage restoration correct. |
+| BE-ORDER-22 | P1 | Cancel a delivered order; deliver a cancelled order; revert delivered. | Customer cancellation of a delivered order is rejected; staff transitions follow the approved policy. Current gaps (cancelled→delivered, delivered→undelivered) are pinned until the policy changes. |
+| BE-ORDER-23 | P0 | Quiet region A with old orders while B creates many newer orders; page A. | A returns all its rows and a valid cursor; no global-ID window starvation. |
+| BE-ORDER-24 | P1 | Admin marks packaged/verified/delivered; customer detail reflects it. | Status and timestamps agree; no partial item/order state. |
+| BE-ORDER-25 | P1 | Admin removes the delivery charge; rebalances slots/items. | Totals reconcile; historic discount preserved; no duplicate fee. |
+| BE-ORDER-26 | P1 | Admin delivery sequence for a slot and coordinate override. | Sequence/order correct; coordinates update the intended order only. |
+| BE-ORDER-27 | P2 | Order-detail money after migration/backfill. | New orders store discount; historical rows may show 0 (accepted; see `BR-13`). |
+
+#### Admin API and isolation
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-ADMIN-01 | P0 | Staff A/B login, `me`, region-scoped dashboard. | Correct staff/region; no cross-region counters. |
+| BE-ADMIN-02 | P0 | Staff B reads/writes A product, store, slot, tag, group, banner, coupon IDs. | Denied/not found; no writes. |
+| BE-ADMIN-03 | P0 | Regional product CRUD and customer publication. | Created/updated product visible in A only; B unchanged. |
+| BE-ADMIN-04 | P0 | Regional edit of a global product: price, stock, flash, suspension. | Only market rows for A change; global structure and B market untouched. |
+| BE-ADMIN-05 | P0 | Suspend a global SKU in A, reopen/edit an unrelated price, save. | Suspension remains in A; B unaffected (`BR-11`). |
+| BE-ADMIN-06 | P0 | Regional admin edits a global SKU's market data; superadmin edits the structure. | Existing SKU IDs preserved; no duplicate variants; market scope is A only. |
+| BE-ADMIN-07 | P0 | Regional staff edits a global store. | Rejected; regional write never mutates global store data. |
+| BE-ADMIN-08 | P0 | Failed regional edit of a global store with an old image. | Image is not deleted; object storage unchanged (`BR-04`). |
+| BE-ADMIN-09 | P0 | Delete a product/store with dependent rows; delete a free one. | Protected deletes rejected; free deletes soft-delete/hide correctly. |
+| BE-ADMIN-10 | P1 | Product SKU create/edit/delete, features, images, tags, groups, combos. | Correct relations; no orphan rows; duplicate SKU IDs not created. |
+| BE-ADMIN-11 | P1 | Banner CRUD and active/order state; customer sees only active A banners. | Regional isolation and ordering. |
+| BE-ADMIN-12 | P1 | Regional coupon CRUD, targeting, user targeting, invalidation. | Region/targets enforced; invalid coupon rejected for use. |
+| BE-ADMIN-13 | P1 | Slot CRUD, SKU assignment, capacity, freeze/edit. | Customer discovery/checkout reflects changes; full slots disabled. |
+| BE-ADMIN-14 | P1 | Product tags/groups/customize-app ordering in A. | Persisted order and popular/all-items output. |
+| BE-ADMIN-15 | P0 | Search customers by name/mobile in A; same search in B. | Only customers with A/B orders respectively; no cross-region mobile leakage (`BR-01`). |
+| BE-ADMIN-16 | P1 | Customer detail, order history, suspension/unsuspension, incidents. | Region-scoped; suspension blocks ordering; incident audit correct. |
+| BE-ADMIN-17 | P0 | `sendAdminNotification` as staff, customer, anonymous. | Staff allowed; customer/anonymous denied; no queue write on denial. |
+| BE-ADMIN-18 | P1 | Vendor snippet CRUD, order/slot reads, packaging (conditional). | Scoped to staff region; unauthorized IDs denied. |
+| BE-ADMIN-19 | P1 | Complaints list/reply/resolve in A; B complaint invisible. | Region isolation; customer sees the reply. |
+| BE-ADMIN-20 | P1 | Region constants edit and propagation to A bounds. | A customer discovery/pricing changes; B unchanged. |
+| BE-ADMIN-21 | P0 | `getStaff`, `createStaffUser`, `getRoles`, `savePushToken` as customer. | Denied (protectedProcedure is not a staff guard — regression check). |
+| BE-ADMIN-22 | P1 | Image upload URL generation and object round-trip. | Authorized contexts only; stored bytes match; no arbitrary-key delete. |
+
+#### Superadmin API
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-SA-01 | P0 | Superadmin login/me; direct protected route access. | Correct principal; no staff/customer escalation. |
+| BE-SA-02 | P0 | Staff/customer/anonymous calls every superadmin mutation. | Denied before DB/job writes. |
+| BE-SA-03 | P0 | Region list/create/update; duplicate name/invalid bounds. | Valid region; clear conflict; no orphan rows. |
+| BE-SA-04 | P1 | Bound create/update/delete: last bound, referenced bound, valid bound. | Last/referenced refused; valid delete succeeds. |
+| BE-SA-05 | P0 | Create a region with global products present; inspect cache files. | Per-region market rows seeded; cache generation awaited and files exist (`BR-07`). |
+| BE-SA-06 | P1 | Staff list/create/update/remove/roles and region assignment. | Region/role changes effective on next auth; removed staff denied. |
+| BE-SA-07 | P1 | Global store CRUD and customer visibility in all regions. | Shared store visible; regional admin cannot edit it. |
+| BE-SA-08 | P0 | Global product create/edit/delete with two SKUs. | Per-region market rows; customer sees it in A/B. |
+| BE-SA-09 | P0 | Edit an existing global product's SKUs and save. | IDs preserved; no duplicate variants; suspension state coherent (`BR-03`). |
+| BE-SA-10 | P1 | Elevate a regional product to global. | Region becomes null; market rows exist; former region keeps selling. |
+| BE-SA-11 | P0 | Global product suspension/market edits. | Global structural suspension applies where intended; regional overrides independent. |
+| BE-SA-12 | P1 | Global coupon create/edit/delete with percent, flat, targets, users. | Valid coupon; one discount type; superadmin-only. |
+| BE-SA-13 | P1 | Global constants edit; customer discovery in A/B. | Global values propagate; regional/bound overrides win. |
+| BE-SA-14 | P1 | Superadmin complaints list/reply. | Cross-region visibility per policy; no customer-private leakage beyond scope. |
+| BE-SA-15 | P0 | `superadmin.staff.sendAdminNotification` as superadmin/staff/customer. | Superadmin allowed; staff/customer denied; queue write only on success (`BR-16`). |
+| BE-SA-16 | P1 | Region cache files after create/update; served version matches. | Files exist for the new region; no undefined/version-0 paths. |
+| BE-SA-17 | P1 | Staff role/permission checks for global authoring. | Only intended roles can author; server-side enforcement. |
+| BE-SA-18 | P2 | Region rename/priority changes while customers browse. | IDs stable; discovery refreshes within deadline; no data moves. |
+
+#### Cache, jobs and health
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| BE-CACHE-01 | P0 | Regional product/store/tag/banner change in A. | A cache files/version advance; B unchanged. |
+| BE-CACHE-02 | P0 | Price/stock/offer/suspension edit in A. | Availability version/data correct; no stale orderable SKU. |
+| BE-CACHE-03 | P0 | Slot create/update/full/freeze. | Slots/next-delivery/cart choices converge within 120s. |
+| BE-CACHE-04 | P0 | Global change followed by a regional change in the debounce window. | All regions regenerate; regional request cannot narrow (`BR-05`). |
+| BE-CACHE-05 | P1 | Rapid A/B edits in the same window. | Both pending regions publish; final write not lost. |
+| BE-CACHE-06 | P1 | Several same-region writes while generation is running. | Final snapshot is current; no stale final write. |
+| BE-CACHE-07 | P1 | Missing/corrupt discovery KV for a bound. | Rebuilt for the correct bound; no foreign fallback. |
+| BE-CACHE-08 | P0 | Products file ready, availability old/missing/wrong region. | No unsafe zero-price/in-stock or mixed-region purchasable catalog. |
+| BE-CACHE-09 | P1 | Object-storage failure during generation. | Failure recorded; version not falsely complete; retry/repair coherent. |
+| BE-CACHE-10 | P1 | Fresh vs already-open client after publication. | Both converge; no restart/storage-clear requirement. |
+| BE-CACHE-11 | P1 | Product soft-deleted while generation pending. | Live surfaces omit it; order history unaffected. |
+| BE-CACHE-12 | P1 | Cache consistency: every availability entry maps to a product; slot products exist; store counts match. | All cross-file references valid. |
+| BE-JOB-01 | P1 | Store initializer/startup and flash schedule job in an isolated scheduler. | Stores ready; flash enablement boundaries correct; no production cron touched. |
+| BE-JOB-02 | P1 | Queue/notification job failure after order commit. | Order remains; job retryable; no duplicate order. |
+| BE-JOB-03 | P1 | Health check with DB/KV/storage failures. | Explicit degraded status, not false healthy. |
+| BE-UPL-01 | P1 | Upload URL contexts: review, product, store, complaint, profile, tags, notification. | Correct folder/key and MIME; no arbitrary path. |
+| BE-UPL-02 | P0 | Unauthorized upload URL request. | Denied; no signed URL returned. |
+| BE-UPL-03 | P2 | Unsupported MIME/context and oversized payload. | Validation error; no object written. |
+
+### 6.2 Customer frontend flows (L2 native + L4 web)
+
+Run each case on both `user-ui` and `web-ui` unless a platform note says otherwise.
+The expected outcome must match; platform-specific mechanics are noted.
+
+#### Startup, location and region
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| CUST-01 | P0 | Cold start with GPS inside A; signed out, then signed in. | A resolves once; discovery/catalog/slots load; no bound/version errors. Web: saved region is validated against `listRegions`. |
+| CUST-02 | P0 | GPS denied, off, outside service and timed out; with and without a default address. | Default address used when available; otherwise a usable manual chooser with the correct reason; no eternal spinner. |
+| CUST-03 | P0 | Late GPS response after manually choosing B. | Manual choice wins; late response cannot overwrite it. |
+| CUST-04 | P1 | Signed-in U1 with addresses in A1/A2; remove one; select an address. | Active bound is the lowest-priority A address bound; B addresses ignored; checkout uses selected address bound. |
+| CUST-05 | P0 | Explicit region switch A→B: cancel, then confirm. | Cancel preserves region/carts; confirm clears A selections and loads B. |
+| CUST-06 | P1 | Switch A→B→A with populated regular and flash carts. | Each region's cart is restored independently; no cross-region lines/prices. |
+| CUST-07 | P1 | Cold-start adoption of the first region with a populated local cart. | Cart is preserved (known open if it is wiped — `BR-10`). |
+| CUST-08 | P2 | Empty region and region with no slots. | Intentional empty states; no crash or fallback to another region. |
+
+#### Authentication and account
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| CUST-09 | P0 | Browse signed out, open Cart and Me. | Public browsing works; login walls shown without breaking other tabs. |
+| CUST-10 | P0 | Log in from the cart wall, then from the Me wall; register a new account. | Returns to the originating screen; cart survives login; validation errors are clear. |
+| CUST-11 | P0 | Wrong password/unknown identifier, then correct; logout and sign in as U2. | No session on failure; U2 cannot see U1 data; logout restores walls. |
+| CUST-12 | P1 | Session restore after relaunch; expired token during a request. | Valid session restores; expiry forces re-login safely, preserving allowed state. |
+| CUST-13 | P1 | Edit profile and avatar; relaunch; check admin customer detail. | Saved values/images agree. |
+| CUST-14 | P1 | Change password, sign out, old vs new password. | New works; old fails; account data intact. |
+| CUST-15 | P1 | Delete account with wrong/correct confirmation. | Wrong rejected; correct logs out and revokes access. |
+| CUST-16 | P0 | Suspended customer tries to order; admin unsuspends; retry. | Blocked then allowed; no misleading success. |
+
+#### Home, search, stores and product detail
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| CUST-17 | P0 | Home in A vs B with regional/global products, tags, banners, stores and slots. | Only correct region + global content; no cross-region prices/assets. |
+| CUST-18 | P1 | Empty/loading/error/refresh states on Home; pull-to-refresh. | Meaningful states; retry works; no duplicate/stale content. |
+| CUST-19 | P1 | Search by product name/tag/store; no results. | Correct results for the region; clear empty state. |
+| CUST-20 | P1 | Stores list and store detail; global store in both regions. | Correct products/counts; global store visible; no foreign store. |
+| CUST-21 | P0 | Product detail P, Q, G, combo C, flash F. | Correct price/variants/stock/flags/composition; foreign product not reachable. |
+| CUST-22 | P1 | Add to cart from Home, search, store, product detail, order-again. | Same SKU/quantity/price on every entry point. |
+| CUST-23 | P1 | Variant/quantity dialog: minimum, increments, maximum, OOS. | Allowed quantities enforced; OOS cannot be added. |
+| CUST-24 | P1 | Offers/tags/banners deep link to the intended product/store. | Correct destination; no broken/foreign target. |
+| CUST-25 | P2 | Location bar / address switcher opening and closing. | Current location/address shown; selection updates the active bound. |
+
+#### Cart and coupons
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| CUST-26 | P0 | Add, re-add, update quantity, remove, cancel removal. | Merge vs set-quantity semantics correct; only the selected line changes. |
+| CUST-27 | P0 | Populated cart cold start; regular and flash carts separately. | Both restore independently; no silent deletion or cross-cart leak. |
+| CUST-28 | P1 | Assign/change slots; leave/re-enter/relaunch. | Selection persists per policy; no quantity duplication. |
+| CUST-29 | P0 | One line becomes OOS/suspended/deleted; all lines invalid. | Invalid lines excluded from pricing/submit; all-invalid checkout blocked. |
+| CUST-30 | P1 | Notes entered, checkout, back, edit; latest note submitted. | Latest value survives and is persisted. |
+| CUST-31 | P0 | Coupon dropdown: eligible, wrong region, first-order-used, min-order short, no targets, expired, invalidated, used-up, personal. | Eligible first; disabled rows show the exact reason; hidden coupons never appear. |
+| CUST-32 | P0 | Apply/remove stacked coupons; change quantities. | Marginal savings and totals recompute; no stale invalid discount. |
+| CUST-33 | P0 | 10% then ₹100 vs ₹100 then 10%; 15% rounding; 100%+ coupon. | Order-sensitive totals; nearest-rupee rounding; no negative preview. |
+| CUST-34 | P1 | "Products discount" row shown/hidden at >₹1 vs ≤₹1; coupons separate. | Correct label/visibility; bill lines sum to total. |
+| CUST-35 | P0 | Checkout guard: item without slot, selected slot no longer offered, freeze passed, valid slots, flash cart. | Button disabled with the correct message for scheduled; flash exempt; recovery re-enables. |
+| CUST-36 | P0 | Cart preview vs checkout vs persisted order totals. | All three agree: goods − discount + delivery = payable. |
+| CUST-37 | P1 | Corrupt storage, storage full, slow price refresh. | Recoverable state; no phantom/zero-priced purchase; coherent loading. |
+| CUST-38 | P1 | Logout/login U2 with U1's cart; account switch. | Agreed cart-retention policy; no U1 address/coupon/notes leakage. |
+
+#### Checkout and order placement
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| CUST-39 | P0 | Checkout with an address in A1 vs A2 vs B; inspect fee/threshold. | Selected address's bound/region drives pricing; browsing region does not override. |
+| CUST-40 | P0 | Customer with zero addresses opens cart/checkout. | First-address gate appears before cart, even when empty; after saving, cart renders. |
+| CUST-41 | P0 | Scheduled checkout with items assigned to S1/S2. | Each submitted line carries its own slot ID; no null scheduled slot (`BR-06`). |
+| CUST-42 | P0 | Valid COD checkout; inspect payment UI. | COD succeeds; online option is disabled "coming soon"; no gateway invocation. |
+| CUST-43 | P0 | Change coupons/address/slot/notes after returning from cart. | Latest state shown and submitted; no stale route params. |
+| CUST-44 | P0 | Double-tap Place Order; pending rerender. | Synchronous guard sends one in-app request. |
+| CUST-45 | P1 | Mutation fails, then retry; session expires mid-checkout. | Loading released, error shown, state preserved; login return safe. |
+| CUST-46 | P1 | Response lost after commit. | History checked before retry; no false claim of server deduplication. |
+| CUST-47 | P0 | Client tampers with price/discount/region/bound/slot. | Server ignores client money/region and uses authoritative values. |
+| CUST-48 | P1 | Multi-sub-order success and zero-total success. | Success references valid orders/group; authoritative totals/zero handled. |
+| CUST-49 | P1 | Flash checkout in A (enabled) vs B (disabled). | Flash price/fee/null slot in A; rejected in B even via direct route. |
+| CUST-50 | P1 | Android back/iOS swipe/browser refresh/deep link to success. | No duplicate order, lost notes or wrong-order detail. |
+
+#### Orders, profile and support
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| CUST-51 | P0 | My Orders list: pending/delivered/cancelled, split group, pagination. | Correct rows/status/labels; no missing/duplicate pages. |
+| CUST-52 | P1 | Order detail: items, address, slots, bill, status timeline, notes. | Matches persisted order/admin view; discount/delivery/total reconcile. |
+| CUST-53 | P0 | Cancel a fresh order with a reason; cancel a delivered order. | Reason required; allowed/denied transitions correct; coupon restored when applicable. |
+| CUST-54 | P1 | Order again / reorder; historical deleted product. | Valid lines re-added; unavailable lines handled; history remains readable. |
+| CUST-55 | P1 | Raise a complaint with/without image; view admin reply. | Persisted, region-correct, visible reply; no cross-user access. |
+| CUST-56 | P1 | Addresses: add with map coords, edit/default/delete, outside-area point. | Bound/region derived; errors clear; default policy correct. |
+| CUST-57 | P1 | Coupons page: eligible/used/expired labels and empty state. | Agrees with eligibility rules; no hidden coupon shown as available. |
+| CUST-58 | P1 | Push permission/token registration; region sync after address add; notification deep link. | Token stored for the address region; link opens the intended order/product. |
+| CUST-59 | P2 | Offline/network failure on Home/cart/checkout. | Explicit error/retry; no false success; cart preserved. |
+| CUST-60 | P2 | Keyboard, safe area, back navigation and accessibility labels on checkout/cart. | Usable on small screens; no hidden action; controls have accessible names. |
+
+### 6.3 Admin frontend flows (L3 native + L5 web)
+
+Run each case on `admin-ui` and `admin-web`; note platform-specific reload/storage behaviour.
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| ADM-01 | P0 | Staff A login; reload; direct protected route. | Correct staff/region; session restores; no privileged flash before auth. |
+| ADM-02 | P0 | Staff A vs B dashboard/orders/products. | Only own-region data; no B counts/rows. |
+| ADM-03 | P0 | Logout, login as B; browser back to A route. | A data cleared; denied/redirected; no cached private content. |
+| ADM-04 | P0 | Customer/anonymous token on admin mutations. | Denied; UI hiding is not the only guard. |
+| ADM-05 | P0 | Orders list: filters, search, pagination, empty/error, delivered toggle. | Correct filtered rows and counts; keyset pagination stable. |
+| ADM-06 | P0 | Quiet region A with old orders while B has newer orders; load more. | A paginates its own rows; no empty list/starvation (`BR-09`). |
+| ADM-07 | P0 | Order detail: items, bill, address, notes, status, customer. | Matches persisted order; discount/delivery/total reconcile. |
+| ADM-08 | P0 | Mark packaged/verified/delivered; customer sees the change. | Status/timestamps persist; no partial item state. |
+| ADM-09 | P0 | Cancel with reason; cancel delivered; remove delivery charge. | Correct transitions; no duplicate fee; customer view reflects it. |
+| ADM-10 | P1 | Rebalance slots/items; verify pricing and discount preservation. | Items move; totals recompute; historic discount/delivery preserved. |
+| ADM-11 | P1 | Delivery sequence/map: order, coordinates, missing coords. | Stable sequence; coordinate edits scoped to the order. |
+| ADM-12 | P1 | Admin notes and customer notes. | Persist on the correct order; visible to the intended audience. |
+| ADM-13 | P0 | Products list/search/filter; open detail. | Region-correct products; OOS/suspended flags; no foreign items. |
+| ADM-14 | P0 | Create a regional product with two SKUs, features, images, tags. | Product/SKUs persist; customer sees it in A only. |
+| ADM-15 | P0 | Edit a regional product's SKU/price/stock/offer. | Updates one product; no duplicate SKUs; availability cache refreshes. |
+| ADM-16 | P0 | Edit a global product's market price/stock/flash/suspension in A. | Only A market changes; structure/B untouched. |
+| ADM-17 | P0 | Suspend a global SKU in A, reopen, change price, save. | Suspension preserved (`BR-11`). |
+| ADM-18 | P0 | Edit/delete a product with dependent rows. | Delete guards correct; image/asset lifecycle safe. |
+| ADM-19 | P1 | Prices overview and variant stock dialog. | Inline edits persist; invalid values rejected; cache updates. |
+| ADM-20 | P1 | Product tags: create/edit/delete/order; assign products. | Persisted ordering/membership; customer order matches. |
+| ADM-21 | P1 | Product groups: create/edit/delete/membership; assign to slot. | Group/slot semantics consistent; no orphan membership. |
+| ADM-22 | P1 | Combos: create combo and components; check customer detail. | Composition/pricing/flags correct. |
+| ADM-23 | P0 | Stores list/add/edit/delete; global store read-only. | Region isolation; global edit blocked; image preserved on failure. |
+| ADM-24 | P0 | Slots: create with SKUs, edit, capacity, freeze, detail. | Customer discovery/checkout reflects it; full slot blocked. |
+| ADM-25 | P1 | Coupons: list/create/edit/invalidate; targets/users. | Region/targets enforced; invalid coupon cannot be used. |
+| ADM-26 | P1 | Banners: create/edit/delete/order/active. | Customer sees only active A banners in order. |
+| ADM-27 | P1 | Customize app: popular items and all-items ordering. | Persisted order; customer home matches. |
+| ADM-28 | P1 | Users: list, search by name/mobile, detail, suspend/unsuspend. | Search region-scoped; suspension blocks ordering; no cross-region leakage (`BR-01`). |
+| ADM-29 | P0 | Search a U1 mobile from staff B; search same name with A/B customers. | B sees nothing/only B; A sees only A (`BR-01`). |
+| ADM-30 | P1 | User incidents and notifications to selected users. | Incident audit correct; notification queued only for allowed recipients. |
+| ADM-31 | P1 | Complaints list/reply/resolve. | Region-scoped; customer sees the reply. |
+| ADM-32 | P1 | Vendor snippets: create/edit/delete, order/slot reads. | Region-scoped; slot picker works after reload (web, `BR-15`). |
+| ADM-33 | P1 | Region constants edit. | A customer discovery/pricing changes; B unchanged. |
+| ADM-34 | P1 | Upload product/store/banner images. | Upload succeeds; URL persisted; replaced image cleanup safe. |
+| ADM-35 | P2 | Empty/loading/error states across dashboard routes. | Retry/back navigation works; no permanent spinner. |
+
+### 6.4 Superadmin frontend flows (L6)
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| SA-01 | P0 | Login/logout, reload, direct protected route. | Session restores; logout clears; no staff/customer access. |
+| SA-02 | P0 | Regions list; create region with at least one bound. | Region appears; cache files generated; assignments possible. |
+| SA-03 | P0 | Create region without bounds, duplicate priorities, malformed GeoJSON. | Validation/conflict; no half-created region. |
+| SA-04 | P1 | Edit region name/metadata; add/edit/delete bounds. | Stable IDs; last/referenced bound refused; customers converge. |
+| SA-05 | P0 | Region creation with global products. | Per-region market rows seeded; no zero-price sale. |
+| SA-06 | P0 | Region cache generation on create/edit. | Files exist and are served; no `v-undefined` (`BR-07`). |
+| SA-07 | P1 | Staff list/create/update/remove/roles. | Region/role assignment effective; removed staff denied. |
+| SA-08 | P1 | Global stores CRUD. | Visible in all regions; regional admins read-only. |
+| SA-09 | P0 | Global products list/create/edit/delete; two SKUs. | Per-region markets; customer sees in A/B. |
+| SA-10 | P0 | Edit an existing global product; save twice. | SKU IDs preserved; no duplicate variants (`BR-03`). |
+| SA-11 | P0 | Switch create→edit and edit→create in the form. | Form state resets/keyed; no draft bleed (`BR-08`). |
+| SA-12 | P0 | Suspend/edit market data; regional admin view. | Global vs regional flags independent. |
+| SA-13 | P1 | Elevate a regional product. | Region null, market rows, still purchasable. |
+| SA-14 | P1 | Global coupons: create/edit/delete/targets/users. | Valid; one discount type; applies in both regions. |
+| SA-15 | P0 | Change a global coupon from percent to flat and save. | Percent cleared; pricing uses flat only (`BR-14`, known open). |
+| SA-16 | P1 | Global constants edit. | Propagates to A/B discovery; regional overrides win. |
+| SA-17 | P1 | Complaints list/reply; admin notifications. | Correct scope; no private leakage. |
+| SA-18 | P0 | "Admin Notifs": send as superadmin. | Success and queue write; no guard failure (`BR-16`). |
+| SA-19 | P0 | Staff/customer token calls superadmin routes. | Denied; no data. |
+| SA-20 | P1 | Empty/loading/error states and destructive confirmations. | No accidental delete; clear errors. |
+| SA-21 | P1 | Upload global store/product images. | URL persists; shared asset not deleted by regional failure. |
+| SA-22 | P2 | Region tabs and selected-region switching. | Correct context; stale labels refresh by ID. |
+| SA-23 | P1 | Cache status after global edit. | All regions publish within deadline; no regional narrowing. |
+
+### 6.5 Conditional and legacy surfaces
+
+Run only when product/operations confirms support. `N/A` requires a reason.
+
+| ID | P | Case | Expected |
+|---|---|---|---|
+| COND-01 | P2 | Vendor snippet page: login, list orders, open packaging. | Scoped to the snippet/staff region; packaging correct. |
+| COND-02 | P2 | Reviews: create a review with image; admin response. | Persisted/visible if the feature is supported; otherwise N/A. |
+| COND-03 | P2 | OTP login in an isolated provider sandbox. | Account created/authenticated once; no real SMS; otherwise N/A. |
+| COND-04 | P2 | Legacy fallback login/home/order-details pages. | Only supported ownership paths are exercised; demos/unsupported pages are N/A with reason. |
+
+### 6.6 Cross-app E2E journeys (L7)
+
+Only these critical chains use the real backend and real clients.
+
+| ID | P | Journey | Expected |
+|---|---|---|---|
+| E2E-01 | P0 | Superadmin creates region A + bound + staff → staff creates store/product/slot/coupon → customer U1 sees catalog and places COD order → staff packages/delivers → customer sees delivered. | Full chain; IDs and money agree at every step. |
+| E2E-02 | P0 | Superadmin creates global product G with A/B prices → customer sees G in A and B with different prices → regional admin edits A market price → A changes, B does not. | Global structure shared; market data isolated. |
+| E2E-03 | P0 | Customer switches A→B and back on native and web with populated carts. | Region content/carts isolated; explicit switch clears/restores correctly. |
+| E2E-04 | P0 | Coupon stack (10% + ₹100) across web/native checkout; verify persisted order/admin detail. | 200 discount on ₹1000; all surfaces agree; no negative totals. |
+| E2E-05 | P0 | Flash order in A (enabled) and blocked flash attempt in B. | Flash price/flag in A; server rejection in B. |
+| E2E-06 | P0 | Multi-slot order S1/S2 with one delivery fee; admin fulfills both. | One group, two sub-orders, one fee; statuses consistent. |
+| E2E-07 | P0 | Cancel an order using a first-order coupon; verify usage restoration and re-order. | Coupon usable again only when no sibling remains. |
+| E2E-08 | P0 | Web scheduled checkout with items in two slots. | No null-slot rejection; correct slots persisted (`BR-06`). |
+| E2E-09 | P0 | Staff B searches U1's name/mobile; staff A searches same. | B cannot see A customer; A can (`BR-01`). |
+| E2E-10 | P0 | Global product edit → both region caches refresh → customers in A/B see it. | All regions publish; regional edit does not narrow (`BR-05`). |
+| E2E-11 | P1 | Admin-web reload → vendor snippet slot picker. | Slots load; staff/region restored (`BR-15`). |
+| E2E-12 | P1 | Superadmin sends "Admin Notifs" to admins. | Queued, not UNAUTHORIZED (`BR-16`). |
+| E2E-13 | P0 | Authorization probe: customer token against admin/superadmin mutations; staff against superadmin. | Denied at every step; no writes. |
+| E2E-14 | P1 | Product soft-delete after an order; customer/admin order history. | Original name/amount render; catalog removes it. |
+| E2E-15 | P0 | Address with coordinates in B while browsing A; place order. | Order appears in B admin queue and B pricing; A unaffected. |
+| E2E-16 | P1 | Cancelled/delivered transitions and customer notification deep link. | Correct status/link; no duplicate order. |
+
+---
+
+## 7. Current-branch regression pack (release-blocking)
+
+These cases must be automated first; they encode the defects found in the
+`MULTI_REGION_I2` review and the fixes applied during hardening.
+
+| ID | P | Scenario | Expected | Automation |
+|---|---|---|---|---|
+| BR-01 | P0 | Staff A and B search customers by a name/mobile that exists in both regions. | A returns only customers with A orders; B only B; no cross-region mobile leakage. | `apps/backend/tests/api/admin-region-isolation.test.ts` |
+| BR-02 | P0 | Web customer selects region/bound; inspect `essentialConsts` request. | Request sends `{ boundId }`, never `{ regionId }`; catalog/slots enable. | `apps/web-ui/tests/flows/discovery.test.tsx` + E2E |
+| BR-03 | P0 | Superadmin edits a global product with two existing SKUs and saves twice. | SKU IDs preserved; SKU count unchanged; no suspended duplicate. | `apps/backend/tests/api/superadmin.test.ts` |
+| BR-04 | P0 | Regional staff edits a global store with an image; mutation rejected. | Image/object remains; no partial update. | `apps/backend/tests/api/admin-catalog.test.ts` |
+| BR-05 | P0 | Global product edit, then regional banner edit inside the debounce window; inspect caches. | `allRegionsPending` wins; every region regenerates. | `apps/backend/tests/api/cache-region.test.ts` |
+| BR-06 | P0 | Web scheduled checkout with items in S1/S2. | Each item sends its `slotId`; no `slotId: null`; order succeeds. | `apps/web-ui/tests/flows/checkout.test.tsx` + E2E-08 |
+| BR-07 | P0 | Superadmin creates a region with global products. | Cache files exist after the response; `createRegionCacheFiles` awaited. | `apps/backend/tests/api/regions.test.ts` |
+| BR-08 | P1 | Superadmin global products: open create, then edit, then create again. | Form resets/keyed; no draft bleed; submit targets the selected product. | `apps/superadmin-ui/src/routes/global-products.test.tsx` |
+| BR-09 | P0 | Region A has old orders; region B creates > limit + 5 newer orders; page A. | A returns its rows and a valid next cursor; no global-ID window starvation. | `apps/backend/tests/api/admin-orders.test.ts` |
+| BR-10 | P1 | Cold start adopts the first region with a populated persisted cart. | Cart preserved; only an explicit switch away clears it. | `apps/user-ui/tests/flows/region.test.tsx` + `apps/web-ui/tests/flows/cart.test.tsx` — **known open** |
+| BR-11 | P0 | Suspend a global SKU in A; reopen; change only price/stock; save. | Suspension remains `true` in A; B unchanged. | `apps/backend/tests/api/admin-catalog.test.ts` |
+| BR-12 | P0 | Two ₹101 sub-orders + two ₹101 stackable coupons. | Discounts `[101, 101]`; totals `[0, 0]`; no negative; delivery handled separately. | `apps/backend/tests/api/coupon-math.test.ts` + `packages/shared` via API |
+| BR-13 | P2 | Historical order with a coupon-implied discount after migration. | `discount_amount` is `0` (accepted): invoices show no discount; derivation is not required. | `apps/backend/tests/api/order-lifecycle.test.ts` — **accepted limitation** |
+| BR-14 | P1 | Change a global coupon 20% → ₹50 and save. | Percent is cleared; pricing uses ₹50. | `apps/backend/tests/api/coupons.test.ts` — **known open** |
+| BR-15 | P1 | Admin-web reload on the vendor snippet screen. | `admin.staffUser.me` restores staff/region; slots load. | `apps/admin-web/tests/flows/vendor-snippets.test.tsx` |
+| BR-16 | P0 | Superadmin sends an admin notification. | `superadmin.staff.sendAdminNotification` succeeds; staff endpoint still staff-guarded. | `apps/backend/tests/api/admin-ops.test.ts` |
+| BR-17 | P0 | Customer checkout and order detail. | COD only; no online-payment method/routes; disabled "coming soon" card if present. | `apps/backend/tests/api/order-flow.test.ts` + customer UI flows |
+| BR-18 | P0 | Scheduled order with one null slot and one valid slot. | Rejected; no partial order; valid per-line slots succeed. | `apps/backend/tests/api/place-order-edge-cases.test.ts` |
+| BR-19 | P0 | Address in B while client sends A; bound-specific fee. | Address region/bound wins; correct fee/region. | `apps/backend/tests/api/order-rules.test.ts` |
+| BR-20 | P1 | A/B order pagination with interleaved IDs. | Stable keyset pages for each region; no skipped duplicate rows. | `apps/backend/tests/api/admin-orders.test.ts` |
+
+---
+
+## 8. Existing coverage and gaps
+
+### Reuse before writing new files
+
+| Existing suite | Reuse/extend for |
+|---|---|
+| `apps/backend/tests/api/order-flow.test.ts`, `order-rules.test.ts`, `place-order-edge-cases.test.ts` | `BE-ORDER-01`–`BE-ORDER-15`, `BR-18`, `BR-19` |
+| `apps/backend/tests/api/coupon-math.test.ts`, `coupons.test.ts`, `coupon-ux.test.ts`, `order-lifecycle-gaps.test.ts` | `BE-COUP-01`–`BE-COUP-18`, `BR-12`, `BR-14` |
+| `apps/backend/tests/api/admin-orders.test.ts`, `admin-ops.test.ts`, `order-lifecycle.test.ts` | `BE-ORDER-20`–`BE-ORDER-26`, `BR-09`, `BR-20` |
+| `apps/backend/tests/api/authorization.test.ts`, `authorization-matrix.test.ts` | `BE-AUTH-09`, `BE-ADMIN-02`, `BE-ADMIN-21`, `BR-16` |
+| `apps/backend/tests/api/cache-*.test.ts` | `BE-CACHE-01`–`BE-CACHE-12`, `BR-05` |
+| `apps/user-ui/tests/screens/cart-*.test.tsx`, `checkout*.test.tsx`, `order-*.test.tsx` | `CUST-26`–`CUST-55` baseline; replace component assertions with flow assertions where needed |
+| `apps/admin-ui/tests/screens/*` | `ADM-05`–`ADM-35` baseline; add multi-region/global cases |
+| `apps/superadmin-ui/src/lib/bound-rules.test.ts` | Pure bound validation only; keep as-is, add route-level `SA-*` cases |
+
+### Current coverage
+
+| App / suite | Existing | Gaps to fill |
+|---|---|---|
+| `apps/backend/tests/api` | 35 Jest files (~192 describe/it entries), real HTTP, auth/order/coupon/cache/admin basics. | Multi-region/bounds, global products/stores, superadmin, region isolation, keyset pagination, store ownership/image, SKU ID preservation, cache all-regions flag, COD-only regression, web discovery contract, discount history. |
+| `apps/user-ui/tests` | 367 tests, mostly screen/component with mocked network. | Real screen-flow coverage for region adoption/switch, web parity, flash, checkout per-slot payload, account switching, startup cart preservation. |
+| `apps/admin-ui/tests` | 497 tests, screen/component with mocked network. | Multi-region/global market editing, region isolation, order keyset pagination, store image ownership, admin-web parity, cache-visible effects. |
+| `apps/web-ui` | None. | Full L4 route-level harness + flows: discovery, auth, catalog, cart, checkout, orders, profile, flash. |
+| `apps/admin-web` | None. | Full L5 route-level harness + flows; staff restore after reload; parity with admin-ui. |
+| `apps/superadmin-ui` | One unit test (`bound-rules.test.ts`). | L6 route tests for login, regions/bounds, staff, global stores/products/coupons, constants, notifications, cache. |
+| `tests/e2e` | 3 Maestro flows + subflows (add product, add slot, user order). | Region/global journeys, web checkout, coupon money, cancellation, authorization probes, cross-app chain. |
+| `tests/e2e-web` | None. | Playwright critical web journeys. |
+
+Recommended new files:
+
+- Backend: `regions-bounds.test.ts`, `global-catalog.test.ts`, `superadmin.test.ts`, `admin-region-isolation.test.ts`, `cache-region.test.ts`, `payments-removed.test.ts`, `discount-history.test.ts`.
+- Customer native: `tests/flows/region.test.tsx`, `cart-region.test.tsx`, `checkout-slots.test.tsx`, `flash.test.tsx`, `orders.test.tsx`.
+- Admin native: `tests/flows/region-scope.test.tsx`, `global-products.test.tsx`, `order-pagination.test.tsx`, `store-safety.test.tsx`.
+- Customer web: `tests/flows/discovery.test.tsx`, `cart.test.tsx`, `checkout.test.tsx`, `orders.test.tsx`, `auth.test.tsx`.
+- Admin web: `tests/flows/auth-restore.test.tsx`, `orders.test.tsx`, `products-global.test.tsx`, `vendor-snippets.test.tsx`.
+- Superadmin: `src/routes/regions.test.tsx`, `staff.test.tsx`, `global-products.test.tsx`, `global-coupons.test.tsx`, `send-notifications.test.tsx`.
+- E2E: `tests/e2e/multi-region-order.yaml`, `tests/e2e-web/critical-journeys.spec.ts`.
+
+---
+
+## 9. Recommended implementation order
+
+1. **Harness first**: backend fixture helpers for regions/bounds/global entities; web Jest/jsdom config; superadmin Vitest/jsdom config.
+2. **P0 backend**: authorization matrix, region isolation, order placement/money, coupon math, cache all-regions, store/global SKU safety.
+3. **P0 web**: discovery `boundId`, scheduled checkout slots, admin-web reload, superadmin notifications.
+4. **P0 native**: region startup/switch, checkout slot payload, coupon stacking, order/cancel flows.
+5. **P1 backend/admin**: CRUD coverage, fulfillment, pagination, notifications, uploads.
+6. **P1 web/superadmin**: parity flows and global authoring.
+7. **E2E**: only the critical journeys in §6.6, after the lower layers are stable.
+8. **Full regression** before release; run P0 twice (fresh session and already-open session).
+
+CI split:
+
+- PR: typecheck + backend P0 + affected UI flow suites.
+- Nightly: all backend API + web/native flow suites.
+- Pre-release: all P0/P1 + E2E + security matrix + cache deadline checks.
+
+---
+
+## 10. Known open / accepted items
+
+| Item | Status | Handling |
+|---|---|---|
+| Startup region adoption clears a persisted cart (`region-switch.ts`) | **Open** | `BR-10` is expected to fail until fixed; mark as known defect, not a test bug. |
+| Global coupon percent→flat keeps the old percent (`global-coupons.ts`) | **Open** | `BR-14`/`SA-15`/`BE-COUP-18` must fail until fixed. |
+| Historical `discount_amount = 0` backfill | **Accepted** | `BR-13` asserts the accepted behavior; do not block release on it. |
+| Server-side order idempotency | Deferred | Characterize concurrent submits; UI guard is required; do not assert deduplication. |
+| OTP login/SMS | Approval-only | Excluded from default regression; use an isolated provider sandbox. |
+| Reviews, vendor snippets, legacy fallback pages | Conditional | Run only if product/operations confirms support. |
+| Online payments | Removed | Assert COD-only; no gateway routes/UI. |
+| Admin `protectedProcedure` endpoints (`getStaff`, `createStaffUser`, `getRoles`, `savePushToken`) | **Pending decision** | `BE-ADMIN-21` encodes the staff-only expectation; if customers are intentionally allowed, document it and downgrade the case. |
+| No emulator/browser in the authoring environment | Process limitation | Cases are static proposals until a device/browser is available. |
+
+---
+
+## 11. Run report template
+
+```text
+Run ID / date / code revision:
+Environment / verified API host / client build:
+Layer (L1–L7) / case ID / client / identity / region / bound:
+Fixture IDs and relevant pre-state:
+Actions and exact inputs:
+Expected / actual:
+Status: PASS | FAIL | BLOCKED | NOT RUN | N/A
+API status/body, persisted values, versions, timestamps:
+Screenshots/logs (redacted):
+Cleanup / retained evidence / linked defect:
+```
+
+For every failure include the smallest reproduction, the authoritative data read,
+and whether any data was mutated. A `BLOCKED` harness result is never a pass.
diff --git a/docs/impl-plans/README.md b/docs/impl-plans/README.md
deleted file mode 100644
index ca6e69e..0000000
--- a/docs/impl-plans/README.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Global Stores & Products — Implementation Plans
-
-Feature: **global stores and global products** that exist across every region, with
-**per-region market data** (price / stock / offer / region suspension) on
-`product_market_stats`.
-
-Status: **planned, not started.** Do not begin Phase 2 until Phase 1 is verified.
-
-## Confirmed decisions
-
-| Decision | Choice |
-|---|---|
-| Global store admin access | **Read-only for regional admins.** Only superadmins create/edit/delete global stores. |
-| Global product defaults | Superadmin enters initial price/flags on create → **a market-stats row is seeded for every region** (and for future regions when created). |
-| Seeding a new region | On region create, **replicate the least-id region's global data** (its per-region market-stats rows for global SKUs) into the new region. |
-| Suspension | Global `is_suspended` lives on **`product_skus`** (superadmin only). Per-region `is_suspended_in_region` lives on **`product_market_stats`** (that region's admin). The admin "suspend" toggle moves to the region flag in Phase 2. |
-| "Global" representation | `store_info.is_global = 1` **and** `region_id = NULL`; a product is global iff its store is global. |
-| Rollout | **Phased:** backend → admin UI → superadmin UI. |
-| Global SKUs in slots/banners/tags/coupons | Allowed in every region (they resolve as "global"). |
-
-## Phases
-
-1. [Phase 1 — Per-region `product_market_stats`](./phase-1-per-region-market-stats.md)
- *Schema + migration + region-scoped read/write refactor. No "global" yet; existing
- regional behaviour must stay identical.*
-2. [Phase 2 — Global stores & products (backend)](./phase-2-global-stores-and-products-backend.md)
- *`is_global` + nullable region, superadmin routers + seeding, visibility, guards,
- per-region admin writes, cache regen.*
-3. [Phase 3 — Admin UI (RN + web)](./phase-3-admin-ui.md)
- *List global + regional products, separate read-only/global-edit component, read-only
- global stores.*
-4. [Phase 4 — Superadmin UI](./phase-4-superadmin-ui.md)
- *Global store + global product CRUD screens.*
-
-## Cross-cutting ground rules
-
-- **Do not run migrations.** All migration SQL is hand-written and applied by the user.
- Validate migration changes on a **fresh/copy DB** first.
-- **Do not run the test suites** unless asked. `tsc --noEmit` is fine.
-- Log every non-`.md`/`.txt` file change in `change-log.txt` (timestamp + diff) **before**
- editing.
-- Working tree is uncommitted; the user manages git.
-- Local D1 path (used for copies/probes):
- `apps/backend/.wrangler/state/v3/d1/miniflare-D1DatabaseObject/da3a80bd8d2cc8f1f070a313ef55c1800da50af994fa89a51c67a6d3e1f919f2.sqlite`
-
-## Migration strategy — fold schema changes into the pending `0006`
-
-`packages/db_helper_sqlite/drizzle/0006_regions_and_superadmins.sql` is **not applied yet** and
-already **rebuilds** `store_info`, `product_info`, `product_skus`, `product_market_stats`, and
-the rest of the region-ownership FK subgraph through `__new_*` tables.
-
-So instead of writing separate recreate migrations (`0010`/`0011`), **edit `0006`'s `__new_*`
-DDL/copies directly**:
-- Phase 1 (per-region market stats) → edit `__new_product_market_stats`.
-- Phase 2 (global stores/products) → edit `__new_store_info` + `__new_product_info`.
-
-This removes the risky standalone table recreates entirely: `0006` already rebuilds the whole
-connected subgraph in dependency order, so no FK-deferral juggling is needed. See each phase's
-§Migration for the exact edits.
-
-> **Pending-migration set (after the `is_offer` fold).** `0007_addresses_bound_id` and
-> `0008_user_creds_unique_and_min_order_cleanup` are unrelated to these tables and stay as-is.
-> `0009_move_is_offer_to_market_stats` has been **folded into `0006` and deleted** — `0006` now
-> drops `is_offer` from `__new_product_skus` and adds it to `__new_product_market_stats`
-> (backfilled from the old `product_skus`).
-
-> **Why Phases 1–2 are not folded yet.** Phase 1 makes `product_market_stats.region_id` `NOT NULL`;
-> until the Phase 1 write paths set it, the current code (`createProduct`/`updateProduct` insert
-> market stats without a region) would fail. Phase 2's `store_info`/`product_info` changes *are*
-> safe, but they're kept together with Phase 1's edit so the whole per-region/global schema lands
-> in one edit to `0006` when those phases are built.
-
-> **DB state caveat:** the local dev D1 already contains `0006`'s *effects* (no
-> `d1_migrations` table — it was applied by hand). Editing `0006` means the local DB no longer
-> matches the file; validation requires **resetting local D1 and re-applying from `0000`**.
diff --git a/docs/impl-plans/phase-1-per-region-market-stats.md b/docs/impl-plans/phase-1-per-region-market-stats.md
deleted file mode 100644
index 2e3beb7..0000000
--- a/docs/impl-plans/phase-1-per-region-market-stats.md
+++ /dev/null
@@ -1,240 +0,0 @@
-# Phase 1 — Per-region `product_market_stats`
-
-Status: **✅ implemented 2026-10-10** (backend + sqlite helper; migration folded into `0006`).
-Depends on: nothing.
-Blocks: Phases 2–4.
-
-> **Implementation notes**
-> - New `packages/db_helper_sqlite/src/lib/market-stats.ts` (`marketStatsForRegion`,
-> `isMarketStatsSuspended`).
-> - `productSkus.marketStats` is now a `many` relation; every `with: { marketStats: true }`
-> site picks the region row.
-> - `getProductDetailById` / `getProductById` (user + order) derive the region from the SKU's
-> product row; `getAllProductsWithUnits` picks per-SKU region.
-> - `getOrderProductById` now returns a single region-picked `marketStats` object; the order
-> path reads `product.isSuspended` (global) / `product.marketStats?.isSuspendedInRegion`.
-> - Suspension: a SKU is unavailable when `product_skus.is_suspended` (global) **or**
-> `product_market_stats.is_suspended_in_region` (per region) — helper `isSkuSuspended`. The
-> admin product write still sets the **global** `productSkus.isSuspended` in Phase 1; the
-> superadmin/region split lands in Phase 2.
-> - `getAvailabilityForCache` / `getProductAvailability` / `getSuspendedSkuIds` /
-> `updateProductPrices` / `toggleProductOutOfStock` / `updateProduct` / `createProduct` are
-> all region-filtered.
-> - The `0006` copy backfills every pre-existing market-stats row to the seeded region
-> (Mahabubnagar), matching the product backfill — so a fresh apply leaves regions 2+ empty
-> until products are created there (as before).
-> - Verified: `tsc --noEmit` backend/admin-ui/user-ui PASS (web-ui's 12 pre-existing errors
-> unchanged); `0000`→`0006` + data on a fresh DB yields `region_id=1`, `is_offer`,
-> `is_suspended_in_region` correctly.
-
-## 1. Goal
-
-Turn `product_market_stats` from **1 row per SKU** into **1 row per (SKU, region)** so that a
-region's price / stock / offer / suspension live in that region's own row. This phase does
-**not** introduce global products yet — it only makes the market data region-scoped.
-
-**Success criterion:** after Phase 1, the customer caches (`products.json`,
-`availability.json`) and admin product screens for regions 1/2/3 are **identical to today**
-(same prices, stock, availability). No behaviour change for existing regional products.
-
-## 2. Non-goals
-
-- No `is_global`, no `store_info`/`product_info` changes, no superadmin UI.
-- No global products (that's Phase 2). The region a market-stats row belongs to is derived
- from the SKU's product row.
-
-## 3. Data model
-
-### `packages/db_helper_sqlite/src/db/schema.ts`
-
-`productMarketStats` (currently lines ~204–214):
-
-```ts
-export const productMarketStats = sqliteTable('product_market_stats', {
- id: integer().primaryKey({ autoIncrement: true }),
- skuId: integer('sku_id').notNull().references(() => productSkus.id),
- regionId: integer('region_id').notNull().references(() => regions.id),
- marketPrice: numericText('market_price'),
- ourPrice: numericText('our_price').notNull(),
- isFlashAvailable: integer('is_flash_available', { mode: 'boolean' }).notNull().default(false),
- flashPrice: numericText('flash_price'),
- isOutOfStock: integer('is_out_of_stock', { mode: 'boolean' }).notNull().default(false),
- isSuspendedInRegion: integer('is_suspended_in_region', { mode: 'boolean' }).notNull().default(false),
- isOffer: integer('is_offer', { mode: 'boolean' }).notNull().default(false),
-}, (t) => ({
- unq_sku_region: uniqueIndex('product_market_stats_sku_region').on(t.skuId, t.regionId),
-}))
-```
-
-Changes vs today:
-- `skuId` loses `.unique()` (was 1:1).
-- **new** `regionId` (NOT NULL, FK `regions`).
-- **new** `isSuspendedInRegion` (bool, default false). The old market-stats
- `isSuspended` is **removed** — global suspension now lives on the SKU
- (`productSkus.isSuspended`), and its existing values are backfilled there.
-- **new** table-level unique index `(sku_id, region_id)`.
-- `productSkus` gains `isSuspended` (bool, default false) — the global
- (superadmin) kill-switch.
-
-### Relations
-
-- `productSkusRelations`: `marketStats: one(productMarketStats)` → **`many(productMarketStats)`**.
-- `productMarketStatsRelations`: add `region: one(regions, { fields: [productMarketStats.regionId], references: [regions.id] })`.
-
-> A SKU now carries an **array** of market-stats rows. Every consumer must pick the row for
-> its `regionId` (helper below).
-
-## 4. Schema change goes into `0006` (no new migration)
-
-`packages/db_helper_sqlite/drizzle/0006_regions_and_superadmins.sql` is **not applied yet** and
-already rebuilds `product_market_stats` via `__new_product_market_stats`. Fold the per-region
-fields into that rebuild instead of a standalone `0010` recreate — `0006` already rebuilds the
-whole FK subgraph in dependency order, so no extra recreate is required.
-
-### Edits to `0006_regions_and_superadmins.sql`
-
-1. **`CREATE TABLE __new_product_market_stats`** — the `is_offer` column is already folded in
- (from `0009`, see README); now add the region column + FK and the region-suspension flag:
- ```sql
- `region_id` integer NOT NULL,
- ...
- `is_suspended_in_region` integer DEFAULT false NOT NULL,
- ...
- FOREIGN KEY (`region_id`) REFERENCES `regions`(`id`) ON UPDATE no action ON DELETE no action
- ```
-
-2. **Its copy `INSERT INTO __new_product_market_stats … SELECT …`** — add `region_id` and
- `is_suspended_in_region` (the copy already selects `is_offer` and JOINs `product_skus` from the
- `0009` fold). All pre-existing rows are backfilled to Mahabubnagar:
- ```sql
- INSERT INTO `__new_product_market_stats`
- (`id`,`sku_id`,`region_id`,`market_price`,`our_price`,`is_flash_available`,`flash_price`,`is_out_of_stock`,`is_suspended`,`is_suspended_in_region`,`is_offer`)
- SELECT
- ms.`id`, ms.`sku_id`, (SELECT `id` FROM `regions` WHERE `name` = 'Mahabubnagar'),
- ms.`market_price`, ms.`our_price`, ms.`is_flash_available`, ms.`flash_price`,
- ms.`is_out_of_stock`, ms.`is_suspended`, false, COALESCE(ps.`is_offer`, false)
- FROM `product_market_stats` ms
- JOIN `product_skus` ps ON ps.`id` = ms.`sku_id`;
- ```
- - The `JOIN product_skus` (already present from the `0009` fold) prunes **orphan** market-stats
- rows whose SKU no longer exists.
-
-3. **Replace the index** created at the end of `0006`:
- `CREATE UNIQUE INDEX product_market_stats_sku_id_unique ON product_market_stats (sku_id)`
- → `CREATE UNIQUE INDEX product_market_stats_sku_region ON product_market_stats (sku_id, region_id)`.
-
-**Validation:** apply the edited `0006` (from `0000`) to a **fresh** DB copy; confirm
-`pragma table_info(product_market_stats)` shows `region_id` + `is_suspended_in_region`, the new
-unique index exists, and there is exactly one row per SKU with `region_id` = the seeded region.
-
-## 5. Region-aware access helper
-
-Add a small shared helper (e.g. `packages/db_helper_sqlite/src/lib/market-stats.ts`):
-
-```ts
-export type MarketStatsRow = InferSelectModel
-export function marketStatsForRegion(stats: MarketStatsRow[] | undefined, regionId: number): MarketStatsRow | undefined {
- return stats?.find((s) => s.regionId === regionId)
-}
-```
-
-Where a function does not currently receive a `regionId` (see §6), derive it from the SKU's
-product row (`sku.product.regionId`) in this phase.
-
-## 6. Code changes
-
-Every `with: { marketStats: true }` now returns an **array**; every `.marketStats` read must
-pick the region's row and suspension must test **both** flags
-(`!is_suspended && !is_suspended_in_region`).
-
-### `packages/db_helper_sqlite/src/stores/store-helpers.ts`
-| Site | Change |
-|---|---|
-| `getAllProductsForCache` (~121,126,129) | `marketStats` array → `marketStatsForRegion(..., regionId)`; suspension check adds `isSuspendedInRegion`; region filter stays `product.regionId === regionId` (Phase 2 adds global). |
-| `getAvailabilityForCache` (~154) | query is already `productMarketStats.findMany` — add `eq(productMarketStats.regionId, regionId)` and filter `!isSuspended && !isSuspendedInRegion`. |
-| `getAllProductCombosForCache` (~246,274) | `ci.sku.marketStats` → pick region row. |
-| suspended-sku set (~252–260) | add `regionId` to the `where`. |
-| `getAllSlotsWithProductsForCache` (~389,408) | pick region row; suspension filter adds region flag. |
-
-### `packages/db_helper_sqlite/src/user-apis/product.ts`
-| Site | Change |
-|---|---|
-| `getProductDetailById(skuId)` (~12–31) | no region param → derive `sku.product.regionId`; pick row; suspension check both flags. |
-| combo items (~56,68) | pick region row. |
-| `getProductById(skuId)` (~143–165) | derive region from product; pick row. |
-| `getAllProductsWithUnits(tagId?)` (~217) | **no region** — add a `regionId` parameter (see below). |
-| `getSuspendedSkuIds(regionId)` (~271) | add `regionId` filter to the query. |
-| `getAllSkusSummary(regionId)` (~347) | pick region row; suspension check both flags. |
-
-> `getAllProductsWithUnits` is only consumed by the legacy controller
-> `apps/backend/src/apis/common-apis/apis/common-product.controller.ts` (pre-tRPC). Give it a
-> `regionId` param and pass the caller's region there, or note it as legacy if that controller
-> is dead.
-
-### `packages/db_helper_sqlite/src/user-apis/order.ts`
-- `getProductById(skuId)` (~194–219) — derive region from product; pick row. (Phase 2 will add
- an explicit region for global SKUs.)
-
-### `packages/db_helper_sqlite/src/user-apis/stores.ts`
-- `getStoreSummaries(regionId)` (~21,24) — pick region row.
-- `getStoreDetail(regionId, storeId)` (~81,87,90) — pick region row.
-
-### `packages/db_helper_sqlite/src/user-apis/slots.ts`
-- `getProductAvailability(regionId)` (~37–61) — add `eq(productMarketStats.regionId, regionId)`.
-
-### `packages/db_helper_sqlite/src/admin-apis/product.ts` (largest)
-- `mapSku` already takes a `marketStats` arg → callers must pass the region row.
-- `getAllProducts(regionId)` (~211–250): pick region row for `mapSku`; combo-item prices too.
-- `getProductById(regionId, id)` (~252): pick region row.
-- `createProduct` (~382): write `regionId` into the inserted market-stats row.
-- `updateProduct` (~535–556): upsert by `(skuId, regionId)` instead of `skuId`.
-- `updateProductPrices(regionId, …)` (~1118–1136): upsert by `(skuId, regionId)`.
-- `toggleProductOutOfStock(regionId, productId)` (~1143–1173): this is the **admin** toggle →
- it now sets **`is_suspended_in_region`**? *No — see note.* It currently toggles
- `is_out_of_stock`; keep it toggling `isOutOfStock` but scope to the region row.
-- `getProductTagInfoById` / `getAllProductTags` / groups (~670–952): pass region row to `mapSku`.
-
-> **Suspension toggle note:** the admin-facing "suspend SKU" path is `updateProduct` with
-> `isSuspended` today. In this phase keep writing whatever field the admin sends to the region
-> row; Phase 2 changes the admin field to `is_suspended_in_region` and reserves `is_suspended`
-> for superadmins.
-
-### `packages/db_helper_sqlite/src/admin-apis/order.ts`
-- `~652,667,673`: picking the latest price for order items — scope to the order's region row
- (these queries already run in an order/region context; add the region filter).
-
-### `apps/backend/src/trpc/apis/user-apis/apis/order.ts`
-- `~132` `product.marketStats?.isSuspended` — `getOrderProductById` will return a single,
- region-picked stats object after Phase 1; keep reading `isSuspended` and add
- `isSuspendedInRegion` to the unavailability check.
-
-## 7. Cache behaviour
-
-- `scaffoldProducts(regionId)` / `scaffoldAvailability(regionId)` already take a region, so
- once the helpers are region-scoped the per-region caches are correct.
-- **Admin market-data writes must regenerate that region only**: `updateProductPrices` and
- `toggleOutOfStock` already call `createAvailabilityCacheFile(regionId)`; keep that. Full
- `updateProduct` calls `scheduleStoreInitialization(regionId)`. Unchanged.
-
-## 8. Verification
-
-1. `bunx tsc --noEmit` on `apps/backend`, `apps/admin-ui`, `apps/user-ui`, `apps/web-ui`
- (web-ui has ~12 pre-existing unrelated errors — compare counts).
-2. Apply nothing to the dev DB. Validate the **edited `0006`** on a **fresh** DB copy (reset
- local D1 and apply from `0000`): `region_id` + `is_suspended_in_region` present, new unique
- index, one row per (SKU, region), orphans pruned.
-3. Runtime probe (after the user applies the edited `0006`): for a region-1 and a region-2 SKU,
- GET `products.json` + `availability.json` and confirm prices/stock match the pre-change values.
-
-## 9. Risks
-
-- **Relation churn:** 23 `marketStats: true` sites / 33 `.marketStats` reads. Miss one and it
- either silently uses the wrong region's row or reads an array as an object.
-- **Order pricing** (`user-apis/order.ts`, `admin-apis/order.ts`) must keep resolving the right
- region row — a wrong region row = wrong charged price.
-- **Suspension semantics** temporarily live in two places; keep both flags in every filter.
-
-## 10. Out of scope (Phase 2+)
-
-Global products/stores, `is_global`, superadmin seeding, admin UI changes, the
-`is_suspended` vs `is_suspended_in_region` split enforcement.
diff --git a/docs/impl-plans/phase-2-global-stores-and-products-backend.md b/docs/impl-plans/phase-2-global-stores-and-products-backend.md
deleted file mode 100644
index 432e816..0000000
--- a/docs/impl-plans/phase-2-global-stores-and-products-backend.md
+++ /dev/null
@@ -1,194 +0,0 @@
-# Phase 2 — Global stores & products (backend)
-
-Status: **not started.**
-Depends on: **Phase 1 verified.**
-Blocks: Phases 3–4.
-
-## 1. Goal
-
-Introduce stores and products that are shared across **all** regions, created and owned by
-**superadmins**, visible to **every** regional admin, with per-region market data on top of
-Phase 1's `product_market_stats(region_id)`.
-
-## 2. Model
-
-- **Global store:** `store_info.is_global = 1`, `store_info.region_id = NULL`,
- `store_info.owner = NULL` (a superadmin has no `staff_users` row).
-- **Global product:** `product_info.region_id = NULL`, `product_info.store_id` → a global
- store. *A product is global iff its store is global.*
-- **Market data:** a global SKU has one `product_market_stats` row **per region** (created in
- Phase 1's schema). Regional SKUs keep exactly one row (their region).
-- **Suspension:** `product_skus.is_suspended = global` (superadmin only) — kills the SKU in
- every region. `product_market_stats.is_suspended_in_region = per region` (that region's
- admin) — kills it only there.
-
-## 3. Schema changes go into `0006` (no new migration)
-
-`0006_regions_and_superadmins.sql` is **not applied yet** and already rebuilds `store_info` and
-`product_info` through `__new_*` tables (with `owner`/`region_id` `NOT NULL`). Fold the global
-changes into those rebuilds instead of a standalone `0011` recreate — `0006` already rebuilds
-the entire connected FK subgraph in dependency order, so **no FK-deferral juggling is needed**.
-
-### Edits to `0006_regions_and_superadmins.sql`
-
-1. **`CREATE TABLE __new_store_info`**:
- - `owner` → drop `NOT NULL` (global stores have no staff owner).
- - `region_id` → drop `NOT NULL` (global stores are region-less).
- - add `is_global integer DEFAULT false NOT NULL`:
- ```sql
- `owner` integer,
- `region_id` integer,
- `is_global` integer DEFAULT false NOT NULL,
- ```
-2. **Its copy `INSERT INTO __new_store_info (…) SELECT …`**: append `is_global` with value
- `false`.
-3. **`CREATE TABLE __new_product_info`**: `region_id` → drop `NOT NULL` (global products are
- region-less). The copy `SELECT` is unchanged — pre-existing rows still get the Mahabubnagar
- region id via the existing `(SELECT id FROM regions WHERE name = 'Mahabubnagar')` subquery.
-4. Indexes (`idx_store_info_region`, `idx_product_info_region`) are unchanged — a NULL region is
- simply not matched by the region index.
-
-End state: `store_info(owner NULL, region_id NULL, is_global)`, `product_info(region_id NULL)` —
-exactly what `schema.ts` declares.
-
-### Seeding global products per region
-
-On **global product create** (superadmin), for every SKU insert one `product_market_stats` row
-per region using the superadmin's entered values.
-
-**Seeding a new region (decided).** When a **new region** is created, seed it by **replicating
-the least-id region's global data**:
-1. `srcRegion = MIN(regions.id)` (the newly created region has the greatest id, so it is never
- the source).
-2. For every **global** SKU, copy the source region's `product_market_stats` row
- (`region_id = srcRegion`) into a new row with `region_id = `.
-
-Implement inside `createRegionWithBounds`
-(`packages/db_helper_sqlite/src/superadmin-apis/regions.ts`), alongside the region + bounds
-inserts, and honour the D1 compensating-cleanup pattern from FC-19 (a failure must not leave a
-half-seeded region). Global **stores** need no replication — they are region-less
-(`region_id NULL`) and already visible in every region.
-
-## 4. Data helpers
-
-New `packages/db_helper_sqlite/src/superadmin-apis/global-stores.ts` and `global-products.ts`:
-- `listGlobalStores()`, `getGlobalStore(id)`, `createGlobalStore(input)`,
- `updateGlobalStore(id, input)`, `deleteGlobalStore(id)`.
-- `listGlobalProducts()`, `getGlobalProduct(id)`, `createGlobalProduct(input)`,
- `updateGlobalProduct(id, input)`, `deleteGlobalProduct(id)`.
-- `seedGlobalProductMarketStats(skuIds | productId, regions, initialValues)`.
-- `seedRegionMarketStatsForGlobalSkus(regionId)`, called from `createRegionWithBounds`.
-- `isGlobalStore(storeId)` helper.
-
-Export them from `packages/db_helper_sqlite/index.ts` and add to the **explicit** export list
-in `apps/backend/src/sqliteImporter.ts` (`dbService.ts` re-exports it).
-
-## 5. tRPC routers
-
-New `apps/backend/src/trpc/apis/superadmin-apis/apis/global-stores.ts` and `global-products.ts`;
-register in `superadmin-trpc-index.ts`:
-
-```ts
-export const superadminRouter = router({
- auth, regions, staff, const,
- globalStores: superadminGlobalStoresRouter,
- globalProducts: superadminGlobalProductsRouter,
-})
-```
-
-- `globalStores.list/get/create/update/delete` (all `superadminProcedure`).
-- `globalProducts.list/get/create/update/delete` (all `superadminProcedure`).
-- Global structural writes → regenerate **all** regions' caches
- `await scheduleStoreInitialization()` (no region = every region).
-
-## 6. Visibility & guards (make global valid in every region)
-
-### Reads
-- `admin-apis/product.ts`
- - `getAllProducts(regionId)`: include `product.region_id = regionId OR `.
- - `getProductById(regionId, id)`: allow global.
- - `getAllSkusSummary(regionId)` (`user-apis/product.ts`): include global SKUs (admin pickers).
-- `admin-apis/store.ts`
- - `getAllStores(regionId)`: `region_id = regionId OR is_global = 1`.
- - `getStoreById(regionId, id)`: allow global.
-- `stores/store-helpers.ts`
- - `getAllProductsForCache(regionId)`: include global SKUs; use the region's market-stats row.
- - `getAvailabilityForCache(regionId)`: include global SKUs' region rows.
- - `getAllStoresForCache(regionId)`: include global stores.
-- `user-apis/stores.ts` `getStoreSummaries`/`getStoreDetail`: include global stores.
-
-### Guards — accept global, still reject other regions
-- `assertStoreInRegion`, `assertStoreIdsInRegion`,
- `assertSkuIdsInRegion`/`resolveSkuRegions` (`admin-apis/product.ts`).
-- `resolveInRegionProductIds` (`admin-apis/store.ts`).
-- Slot/banner/tag/group/coupon resolvers that validate SKU/store regions
- (`admin-apis/{slots,banner}.ts`, `replaceTagProducts`, coupon create/update).
- **Assumption:** a global SKU/store is valid in every region.
-- `deleteStore`: a global store may only be deleted by a superadmin and only when no products
- reference it.
-
-## 7. Write scoping
-
-- **Admin editing a global product:** accept **only** market-stats fields
- (`price`, `marketPrice`, `flashPrice`, `isFlashAvailable`, `isOutOfStock`,
- `isSuspendedInRegion`, `isOffer`) and apply them to the caller region's row. Reject/ignore
- structural fields (name, descriptions, images, incrementStep, SKUs/features, combos, store,
- productType). Implement in `updateProduct` (branch on `product.region_id == null` /
- global store).
-- **Admin editing a regional product:** unchanged (full edit).
-- **Admin cannot** create/update/delete global stores, nor create/delete global products.
-- `updateProductPrices` / `toggleProductOutOfStock`: already region-scoped (Phase 1) — they
- work for global SKUs too.
-- **Suspension split:** admin product update writes `is_suspended_in_region`; `is_suspended`
- is writable only via the superadmin global-product path.
-- `checkProductExistsByName`: decide scoping — recommend **global names globally unique**,
- regional names unique within their region.
-
-## 8. Region resolution for global SKUs (user-facing)
-
-Once a SKU can be global, functions that resolved a region from the product row must receive
-one explicitly:
-- `getOrderProductById(skuId)` (`user-apis/order.ts`) → add `regionId`; `placeOrderUtil`
- (`apps/backend/src/trpc/apis/user-apis/apis/order.ts`) passes the order region. Verify the
- `isSuspended || isSuspendedInRegion` check (~132) uses the region row.
-- `getProductDetails` / `getProductDetailById` (`apps/backend/src/trpc/apis/user-apis/apis/product.ts`
- + `user-apis/product.ts`): add an optional `regionId`; the app already knows its region
- (`useRegion`). Regional products fall back to the product's own region.
-- `admin-apis/order.ts` price lookups: scope to the order's region row.
-
-## 9. Cache regeneration
-
-| Change | Regen |
-|---|---|
-| Superadmin creates/edits/deletes a global store or global product (structure) | **all regions** — `scheduleStoreInitialization()` |
-| Admin edits market data for a global product | **that region** — `createAvailabilityCacheFile(regionId)` (+ `scheduleStoreInitialization(regionId)` if needed) |
-| Regional product/store change | that region (unchanged) |
-| New region created | seed global SKU rows, then regen that region |
-
-## 10. Verification
-
-1. `bunx tsc --noEmit` (backend + apps).
-2. Edited `0006` validated on a **fresh** DB copy (apply from `0000`): `store_info` accepts
- NULL region/owner and has `is_global`; `product_info` accepts NULL region; existing rows
- intact; indexes present.
-3. Runtime (after the user applies migrations):
- - Superadmin creates a global store + global product → a market-stats row exists for
- **every** region.
- - A region-1 admin sees the global product in `getProducts` and can change its price →
- **only** region 1's `availability.json`/`price` changes; region 2 unchanged.
- - A region-1 admin cannot edit the global product's name/SKUs, nor create/edit/delete the
- global store.
- - `is_suspended` (superadmin) removes it everywhere; `is_suspended_in_region` removes it in
- one region only.
- - Add a global SKU to a region-1 slot → allowed; order for it prices from region 1's row.
-
-## 11. Risks
-
-- **Editing the pending `0006`**: since it is unapplied, edits are safe, but the **local dev D1
- already has its effects** — validation requires a **fresh** DB (reset + re-apply `0000`…).
-- **Global SKU region resolution** in order/detail paths — wrong region = wrong price.
-- **Guard relaxation** must not accidentally allow another region's private rows.
-
-## 12. Out of scope
-
-Admin UI and superadmin UI (Phases 3–4).
diff --git a/docs/impl-plans/phase-3-admin-ui.md b/docs/impl-plans/phase-3-admin-ui.md
deleted file mode 100644
index 6e0fa7c..0000000
--- a/docs/impl-plans/phase-3-admin-ui.md
+++ /dev/null
@@ -1,109 +0,0 @@
-# Phase 3 — Admin UI (React-Native `admin-ui` + web `admin-web`)
-
-Status: **not started.**
-Depends on: **Phase 2 backend.**
-
-## 1. Goal
-
-Let a regional admin:
-1. see **global + regional** products on the Products page;
-2. edit a **global** product's **market data only** (price / stock / offer / region
- suspension) — everything else read-only — via a **separate component**;
-3. see **global stores read-only** (no edit/delete).
-
-## 2. Shared types (`packages/shared/types/*`)
-
-- `Store`: add `isGlobal: boolean`; change `owner` to `number | null`.
-- `AdminProduct` (and `AdminProductWithRelations`): add `isGlobal: boolean` (derived from the
- store) so lists/edits can branch without a second call.
-- No change to `AdminSku` shape (it already carries all market flags).
-
-> Confirm exact files: `packages/shared/types/admin.ts` (`Store`, `AdminProduct`).
-
-## 3. Server contract (from Phase 2 — restate so the UI is built to match)
-
-- `admin.product.getProducts` / `getProductById` return global + regional; each product has
- `isGlobal`.
-- `admin.store.getStores` / `getStoreById` return global stores with `isGlobal: true`,
- `owner: null`.
-- `admin.product.updateProduct` **for a global product** accepts **only** market fields:
- `price`, `marketPrice`, `flashPrice`, `isFlashAvailable`, `isOutOfStock`,
- `isSuspendedInRegion`, `isOffer`. Structural fields are rejected/ignored.
-- `admin.product.updateProductPrices` / `toggleOutOfStock` remain region-scoped and work on
- global SKUs.
-- Admins get 403/error for global store create/update/delete and global product
- create/delete.
-
-## 4. `admin-ui` (Expo / React Native)
-
-### Products list — `app/(drawer)/dashboard/products/index.tsx`
-- Show global + regional products.
-- Add a **Global** badge on global rows/cards.
-- Optionally a filter chip `All / Regional / Global` alongside the existing
- `all / in-stock / out-of-stock` chips (`FilterType`).
-- `onEdit(id)` → navigates to `products/edit?id=…` as today; the edit screen branches.
-
-### Products edit — `app/(drawer)/dashboard/products/edit.tsx`
-- After `trpc.admin.product.getProductById`, branch on `product.isGlobal`:
- - **regional** → existing `ProductForm` (+ add/update flows unchanged).
- - **global** → render the **new `GlobalProductForm`**.
-- Keep the existing image-upload / mutation plumbing for the regional path.
-
-### New component — `src/components/GlobalProductForm.tsx`
-- **Read-only** (rendered as text/locked): name, short/long description, store, increment
- step, product type, per-SKU name + images + features, combo items.
-- **Editable**: a per-SKU market block — `price`, `marketPrice`, `flashPrice`,
- `isFlashAvailable`, `isOutOfStock`, `isOffer`, `isSuspendedInRegion`.
-- Submit → `admin.product.updateProduct` with **only** the market fields (never structural).
-- Show a hint banner: "Global product — shared across regions. You can edit price & stock for
- your region only."
-
-### Products add — `app/(drawer)/dashboard/products/add.tsx`
-- Unchanged (admins cannot create global products). Optionally hide/note global store choices
- in the store picker (a regional product can't be assigned to a global store).
-
-### Stores list — `app/(drawer)/dashboard/stores/index.tsx`
-- Show global stores with a **Global** badge.
-- **Disable edit/delete** for global stores (read-only). Keep them visible.
-
-### Stores edit — `app/(drawer)/dashboard/stores/edit.tsx`
-- If the store `isGlobal`: render read-only (no submit) with a "Global store — managed by a
- superadmin" banner.
-
-### Store picker (in `ProductForm` / `ProductsSelector`)
-- Ensure global stores don't appear as selectable owners/stores for regional product creation
- (or are clearly marked and rejected by the backend).
-
-## 5. `admin-web` (TanStack Router)
-
-Mirror §4:
-- `src/routes/dashboard.products.tsx` — global badge + optional filter.
-- `src/routes/dashboard.products.edit.tsx` — branch to a new
- `src/components/GlobalProductForm.tsx` when `product.isGlobal`.
-- `src/routes/dashboard.products.new.tsx` — unchanged.
-- `src/routes/dashboard.stores.tsx` — global badge, edit/delete disabled.
-- `src/routes/dashboard.stores.edit.tsx` — read-only for global.
-- Reuse the same field rules; share the market-fields type from `@packages/shared` if helpful.
-
-## 6. Verification
-
-1. `bunx tsc --noEmit` on both apps (compare any pre-existing web-ui/admin-web error counts).
-2. Manual/RTL smoke (only if asked — *not* the full suite):
- - Products page lists a seeded global product with a badge.
- - Editing it shows read-only structure + editable market fields; saving changes **only**
- the caller region's price/stock (verify via `availability.json`).
- - Global store rows show a badge and have no edit/delete action.
-3. No migrations, no test-suite run (unless the user asks).
-
-## 7. Risks / notes
-
-- `admin-ui` and `admin-web` both have a `ProductForm`; keep them behaviourally consistent
- but don't force a shared component across the RN/web boundary.
-- The global edit must never send structural fields — the backend rejects them, but avoid
- surfacing false "saved" states.
-- `owner: number | null` change ripples to store display components (`StoreItem`, store
- detail) — handle null ("Global" / "—").
-
-## 8. Out of scope
-
-Superadmin creation/editing of global entities (Phase 4).
diff --git a/docs/impl-plans/phase-4-superadmin-ui.md b/docs/impl-plans/phase-4-superadmin-ui.md
deleted file mode 100644
index c601278..0000000
--- a/docs/impl-plans/phase-4-superadmin-ui.md
+++ /dev/null
@@ -1,85 +0,0 @@
-# Phase 4 — Superadmin UI (`apps/superadmin-ui`)
-
-Status: **not started.**
-Depends on: **Phase 2 backend** (routers + helpers). Phase 3 independent.
-
-## 1. Goal
-
-Give superadmins screens to **create/edit/delete global stores** and **create/edit/delete
-global products**, including the initial per-region market values that get seeded to every
-region.
-
-## 2. App shape (for reference)
-
-- `apps/superadmin-ui` is a **TanStack Router** web app (Vite + Cloudflare).
-- Routes are **file-based** in `src/routes/*.tsx`; `src/routeTree.gen.ts` is **generated** (do
- not hand-edit — it regenerates when Vite runs / builds).
-- Nav lives in `src/components/AppShell.tsx` (`NAV` array, `lucide-react` icons).
-- Auth/context: `src/lib/auth-context.tsx`; tRPC client uses `trpc.superadmin.*`.
-- Existing routes: `dashboard`, `regions`, `staff`, `constants`, `send-notifications`, `login`.
-
-## 3. Backend surface used (Phase 2)
-
-```
-trpc.superadmin.globalStores.list | get | create | update | delete
-trpc.superadmin.globalProducts.list | get | create | update | delete
-```
-
-- Global store `create/update`: `{ name, description?, imageUrl? }` (no owner, no region).
-- Global product `create`: full structure
- `{ name, shortDescription?, longDescription?, storeId (global), incrementStep?, productType?,
- skus: [{ name?, images?, isComboOnly?, features[], comboItems? }] }`
- **plus** initial market values per SKU
- `{ price, marketPrice?, flashPrice?, isFlashAvailable?, isOutOfStock?, isOffer? }`
- which the backend seeds to **every region**.
-- Global product `update`: structural edit (name/SKUs/etc.) — regenerates all regions.
- (Per-region market data is edited by regional admins in Phase 3; optionally expose a
- per-region matrix here too — see §7.)
-
-## 4. New routes / components
-
-- `src/routes/global-stores.tsx` — list + create/edit (inline drawer or a `$id` sub-route
- following the `regions.tsx` pattern) + delete. Reuse the image-upload flow used elsewhere
- (check how `regions.tsx`/banners handle uploads; if none, add a presigned-URL uploader like
- `admin-ui`'s `useUploadToObjectStorage`).
-- `src/routes/global-products.tsx` — list + create/edit + delete.
-- New components under `src/components/`:
- - `GlobalStoreForm.tsx`
- - `GlobalProductForm.tsx` (structure editor + initial market-values block per SKU).
-- `src/components/AppShell.tsx` — add NAV entries:
- ```ts
- { to: '/global-stores', label: 'Global Stores', icon: Store /* or Storefront */ },
- { to: '/global-products', label: 'Global Products', icon: Package /* or Boxes */ },
- ```
- (`lucide-react` icons).
-
-> After adding files under `src/routes/`, run the dev server / build once so `routeTree.gen.ts`
-> regenerates before typecheck.
-
-## 5. Behaviour
-
-- Global store create/edit → backend regens **all** regions' caches.
-- Global product create → seeds market-stats rows for **every** region from the entered values.
-- Global product structural delete → removes the product, its SKUs and all regions' market
- rows; regen all regions.
-- Global product edit → structural changes regen all regions; if a per-region editor is added
- (§7) it must call the same backend scoping as admins.
-
-## 6. Verification
-
-1. `bunx tsc --noEmit` in `apps/superadmin-ui` (confirm `routeTree.gen.ts` is regenerated).
-2. Manual (dev server): create a global store → appears in every region's admin store list
- (Phase 3); create a global product with an initial price → a market-stats row exists for
- each region and `availability.json` shows that price until a region overrides it.
-
-## 7. Optional / follow-ups
-
-- A superadmin **per-region market matrix** (rows = regions, columns = price/stock) on the
- global product screen, backed by a superadmin-scoped market-stats update.
-- Batch "seed/repair" action for regions missing rows for older global SKUs.
-- Note: new regions seed from the **least-id region's** rows (see Phase 2). To change the
- defaults future regions inherit, edit the least-id region's rows first.
-
-## 8. Out of scope
-
-Regional admin editing (Phase 3) and any schema/backend work (Phase 2).