"feat: add EventItem, EventReview models with seed data and mock files, update User and Event schemas"

This commit is contained in:
louiscklaw
2025-06-03 15:29:05 +08:00
parent a0a4ffcb4e
commit 24920fb313
52 changed files with 2140 additions and 56 deletions

View File

@@ -46,6 +46,9 @@ model Session {
model User {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
//
name String?
username String? @unique
email String @unique
@@ -54,8 +57,6 @@ model User {
image String?
bucketImage String?
admin Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
accounts Account[]
sessions Session[]
info Json?
@@ -70,6 +71,9 @@ model VerificationToken {
@@unique([identifier, token])
}
// ----------------------------------------------------------------
// frontend/src/_mock/_user.ts
// ----------------------------------------------------------------
// REQ0044/near_by_page
@@ -99,6 +103,9 @@ model Member {
music String[] @default([])
pets String[] @default([])
character String[] @default([])
//
avatar String @default("")
sex String @default("")
}
model Order {
@@ -118,7 +125,7 @@ model Event {
id Int @id @default(autoincrement())
eventDate DateTime
title String
joinMembers Member[] // Assuming Member model exists
joinMembers Json[] // Assuming Member model exists
price Float
currency String
duration_m Int
@@ -127,6 +134,8 @@ model Event {
location String
avatar String // Assuming avatar is stored as a file path or URL
Order Order[]
Member Member? @relation(fields: [memberId], references: [id])
memberId Int?
}
// cms_backend
@@ -537,6 +546,8 @@ model UserItem {
//
username String
password String
//
isAdmin Boolean @default(false)
}
model UserAccountBillingHistory {
@@ -1078,3 +1089,96 @@ model Kanban {
columns KanbanColumn[]
tasks KanbanTask[]
}
// mapped to IEventReview
model EventReview {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
//
name String
rating Float
comment String
helpful Float
avatarUrl String
postedAt DateTime @default(now()) // Assuming IDateValue maps to DateTime
isPurchased Boolean
attachments String[]
//
EventItem EventItem? @relation(fields: [eventItemId], references: [id])
eventItemId String?
}
// mapped to IEventItem
model EventItem {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
//
sku String
name String
code String
price Float
taxes Float
tags String[]
sizes String[]
publish String
gender String[]
coverUrl String
images String[]
colors String[]
quantity Int
category String
available Int
totalSold Int
description String
totalRatings Float
totalReviews Int
inventoryType String
subDescription String
priceSale Float?
newLabel Json
saleLabel Json
ratings Json[]
//
eventDate DateTime @default(now())
joinMembers Json[]
title String
currency String
duration_m Float
ageBottom Float
ageTop Float
location String
avatar String[]
//
reviews EventReview[]
}
model AppLog {
id String @id @default(uuid())
timestamp DateTime @default(now())
//
level Int? @default(1)
message String? @default("")
//
module String?
userId String?
metadata Json?
@@index([timestamp])
@@index([level])
@@index([module])
}
model AccessLog {
id String @id @default(uuid())
timestamp DateTime @default(now())
//
userId String? @default("")
message String? @default("")
//
metadata Json?
@@index([timestamp])
@@index([userId])
}