feat: implement user profile, order history, and address book with checkout integration

This commit is contained in:
Your Name committed 2026-06-07 18:48:56 +07:00
1 parent bae945b9d4
commit 0c3c450e1f
9 files changed
+1109 -32

No files matched your search

+22 -5
View File
@@ -76,17 +76,34 @@ model User {
}
model Customer {
id Int @id @default(autoincrement())
lineUserId String @unique
id Int @id @default(autoincrement())
lineUserId String @unique
displayName String?
pictureUrl String?
email String?
phone String?
points Int @default(0)
points Int @default(0)
orders Order[]
reviews Review[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
addresses CustomerAddress[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model CustomerAddress {
id Int @id @default(autoincrement())
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
recipientName String
phone String
addressLine String // บ้านเลขที่ หมู่บ้าน ถนน ซอย
subdistrict String // แขวง/ตำบล
district String // เขต/อำเภอ
province String // จังหวัด
zipcode String // รหัสไปรษณีย์
isDefault Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Hero {