Add website view analytics for dashboard traffic charts.
Track storefront views via POST /tenants/{domain}/analytics/views, expose business activity API, and add product/website/portfolio/blog 30-day chart types for super-admin selection.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
b8f60c5141
commit
3f266a2dcb
@@ -116,6 +116,7 @@ model Business {
|
||||
website_category_groups website_category_groups[]
|
||||
website_image_slots website_image_slots[]
|
||||
website_sliders website_sliders[]
|
||||
websiteContentViews WebsiteContentView[]
|
||||
|
||||
@@map("businesses")
|
||||
}
|
||||
@@ -1636,3 +1637,25 @@ enum UserProductCondition {
|
||||
|
||||
@@map("user_product_condition")
|
||||
}
|
||||
|
||||
enum WebsiteViewKind {
|
||||
website
|
||||
product
|
||||
portfolio
|
||||
blog
|
||||
|
||||
@@map("website_view_kind")
|
||||
}
|
||||
|
||||
model WebsiteContentView {
|
||||
id BigInt @id @default(autoincrement())
|
||||
businessId BigInt @map("business_id")
|
||||
viewKind WebsiteViewKind @map("view_kind")
|
||||
entityId BigInt? @map("entity_id")
|
||||
pagePath String? @map("page_path")
|
||||
viewedAt DateTime @default(now()) @map("viewed_at") @db.Timestamptz(6)
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade, onUpdate: NoAction)
|
||||
|
||||
@@index([businessId, viewKind, viewedAt(sort: Desc)], map: "idx_website_content_views_business_kind_time")
|
||||
@@map("website_content_views")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user