Add website special-products source setting for storefronts.

Let businesses choose product vs store_item sourcing, defaulting from the store module, and expose it on tenant resolve and store-specials.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-21 11:57:49 +03:30
co-authored by Cursor
parent 8609d8d4fd
commit b0d4916138
11 changed files with 114 additions and 14 deletions
+11 -3
View File
@@ -1,7 +1,7 @@
# Meshkee CMS API — Project Context
> Living reference for developers and AI assistants working on this codebase.
> Last updated: August 19, 2026
> Last updated: August 21, 2026
## What This Project Is
@@ -261,8 +261,8 @@ All routes are prefixed with `/api/v1`.
| POST | `/auth/send-otp` | Send OTP (Redis-backed) |
| POST | `/auth/verify-otp` | Verify OTP (marks cell verified; no tokens) |
| POST | `/auth/handoff/consume` | One-time SSO ticket → tokens (customer → business dashboard) |
| GET | `/tenants/:host` | Resolve business from domain |
| GET | `/tenants/:host/store-specials` | Active store specials |
| GET | `/tenants/:host` | Resolve business from domain (`specialProductsSource`, `enabledModules`, `homeCharts`, `ePayment`) |
| GET | `/tenants/:host/store-specials` | Active store specials (`source` is `product` or `store_item`) |
| GET | `/tenants/:host/website/category-groups` | Homepage category rows |
| GET | `/tenants/:host/website/brand-groups` | Homepage brand rows |
| GET | `/tenants/:host/website/sliders` | Homepage sliders with slides |
@@ -478,6 +478,14 @@ Store item variants → purchasable SKUs with price/stock per combination (s
- Each variant picks one option per variation; the combination must be unique per store item.
- Cart and orders reference `storeItemVariantId` (not the product directly).
### Website special products source
Stored in `businesses.settings.website.specialProductsSource` (`product` | `store_item`).
- Unset → `store_item` when the store module is enabled, otherwise `product`.
- Dashboard: `PATCH /businesses/:id/settings` with `{ website: { specialProductsSource } }`.
- Public: `GET /tenants/:host` includes `specialProductsSource`; `GET /tenants/:host/store-specials` includes top-level `source`.
**Example — batch create variants for a product:**
```json