Add page-view analytics, product counters, SSL expiry, and business renewal.

Auto-count storefront page views with 6-month event retention and lifetime counters, track product visit/cart/sale stats, persist SSL cert expiry with daily probes, and support owner titles plus annual contract renewal.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-26 10:13:06 +03:30
co-authored by Cursor
parent 6cd0b009ef
commit 92601ae729
39 changed files with 1013 additions and 198 deletions
+6 -3
View File
@@ -55,9 +55,12 @@ Public marketplace listings owned by customers — not catalog `products`.
Use product categories from `GET /tenants/{domain}/categories?entityType=product` for filters. Creating/editing listings is customer-dashboard only (`/businesses/.../my-user-products`), not website-facing.
### Analytics (dashboard charts)
Record storefront views so the business home charts can show traffic:
- `POST /tenants/{domain}/analytics/views` body `{ "kind": "website"|"product"|"portfolio"|"blog", "entityId"?: "...", "path"?: "/about" }`
- Call once per page view from the website (product detail, portfolio, blog post, or general pages with `kind: "website"`).
Page views are recorded **automatically** when the website calls the normal public list/detail APIs (blogs, products, portfolios, videos, store-items, and homepage sliders). No extra website code is required for those.
Optional explicit record (e.g. custom home without sliders):
- `POST /tenants/{domain}/analytics/views` body `{ "kind": "home"|"blog_detail"|"product_detail"|..., "entityId"?: "...", "path"?: "/blog/my-post" }`
- `kind` values: `home`, `portfolio_list`, `portfolio_detail`, `product_list`, `product_detail`, `store_item_list`, `store_item_detail`, `blog_list`, `blog_detail`, `video_list`, `video_detail` (legacy aliases `website`/`product`/`portfolio`/`blog` still accepted)
- Events kept ~6 months for charts; lifetime totals kept forever in counters.
### Static images
Named slots the business dashboard can replace. Fetch once per page:
+21 -4
View File
@@ -434,7 +434,7 @@
"post": {
"tags": ["Analytics"],
"summary": "Record a storefront page view",
"description": "Fire-and-forget view counter for business dashboard charts. Call once per page impression from the website (product detail, portfolio, blog post, or general site page). No auth required.",
"description": "Optional explicit view counter. Most page views are recorded automatically when public list/detail APIs are called (blogs, products, portfolios, videos, store-items, homepage sliders). Use this for custom pages. No auth required. Events retained ~6 months; lifetime counters kept forever.",
"parameters": [
{
"$ref": "#/components/parameters/domain"
@@ -450,15 +450,32 @@
"properties": {
"kind": {
"type": "string",
"enum": ["website", "product", "portfolio", "blog"]
"enum": [
"home",
"portfolio_list",
"portfolio_detail",
"product_list",
"product_detail",
"store_item_list",
"store_item_detail",
"blog_list",
"blog_detail",
"video_list",
"video_detail",
"website",
"product",
"portfolio",
"blog"
],
"description": "Canonical kinds preferred. Legacy aliases: website→home, product→product_detail, portfolio→portfolio_detail, blog→blog_detail."
},
"entityId": {
"type": "string",
"description": "Required when kind is product, portfolio, or blog."
"description": "Required for *_detail kinds (product, portfolio, blog, video, store item)."
},
"path": {
"type": "string",
"description": "Optional page path for website visits (e.g. `/`, `/about`)."
"description": "Optional page path (e.g. `/`, `/blog/my-post`)."
}
}
}