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:
co-authored by
Cursor
parent
8609d8d4fd
commit
b0d4916138
+11
-3
@@ -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
|
||||
|
||||
@@ -29,8 +29,8 @@ You are building a **Meshkee business website (storefront)**. You must use the M
|
||||
7. **Partner SMS** (`POST /public/sms/send`) is for external partner backends with an issued `X-Api-Key` only — not for normal storefront UI. See https://api.meshkee.com/docs/website/SMS.md
|
||||
|
||||
### Typical bootstrap sequence
|
||||
1. `GET /tenants/{domain}` → branding + `businessId`
|
||||
2. Homepage: business-info, **static-images**, sliders, category-groups, brand-groups, store-specials
|
||||
1. `GET /tenants/{domain}` → branding + `businessId` + `specialProductsSource` (`product` or `store_item`)
|
||||
2. Homepage: business-info, **static-images**, sliders, category-groups, brand-groups, store-specials (`source` repeats the tenant setting; items are store listings when `source` is `store_item`)
|
||||
3. Catalog: categories, products (`GET /products/{slug}` includes `relatedProducts`: same category then same brand, in-stock first), store-items (`name` instant search: in-stock first, then `updatedAt`), **user-products** (customer stock listings)
|
||||
4. Auth: register/login → store tokens. Optional: `POST /auth/send-otp` then `POST /auth/login-otp` (passwordless) or `POST /auth/reset-password` (forgot password). `POST /auth/verify-otp` only marks the cell verified (no tokens).
|
||||
5. Cart checkout with `addressId` or inline `shippingAddress` + `payment`
|
||||
|
||||
@@ -169,6 +169,14 @@
|
||||
"faviconUrl": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"specialProductsSource": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"product",
|
||||
"store_item"
|
||||
],
|
||||
"description": "Where homepage special-product carousels read from. Defaults to store_item when the store module is enabled, otherwise product."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,7 +331,7 @@
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{ items: StoreSpecial[] } — each special has id, key, title, items[]"
|
||||
"description": "{ source: product|store_item, items: StoreSpecial[] } — source is the business special-products setting; each special has id, key, title, items[]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user