feat(r3): complete order and payment flow
This commit is contained in:
@@ -56,8 +56,19 @@ model Product {
|
||||
name String
|
||||
categoryId String?
|
||||
price Decimal @db.Decimal(10, 2)
|
||||
originalPrice Decimal? @db.Decimal(10, 2)
|
||||
leadTime String @default("7-10 个工作日")
|
||||
subtitle String?
|
||||
tone Int[]
|
||||
tags String[]
|
||||
specs Json?
|
||||
mask Json?
|
||||
story String?
|
||||
scene String?
|
||||
iconImg String?
|
||||
images String[]
|
||||
description String?
|
||||
sort Int @default(0)
|
||||
status ProductStatus @default(DRAFT)
|
||||
category Category? @relation(fields: [categoryId], references: [id])
|
||||
orderItems OrderItem[]
|
||||
@@ -127,6 +138,10 @@ model Order {
|
||||
status OrderStatus @default(PENDING)
|
||||
totalAmount Decimal @db.Decimal(10, 2)
|
||||
addressSnapshot Json
|
||||
requestId String?
|
||||
paidAt DateTime?
|
||||
// 待付款订单的固定截止时刻;创建后 30 分钟不可再支付。
|
||||
paymentExpiresAt DateTime?
|
||||
// 关联的设计清单(R4 下单后 WCD 派单据此读取 designData)
|
||||
designListId String?
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
@@ -139,7 +154,9 @@ model Order {
|
||||
|
||||
@@index([userId])
|
||||
@@index([status])
|
||||
@@index([paymentExpiresAt])
|
||||
@@index([designListId])
|
||||
@@unique([userId, requestId])
|
||||
}
|
||||
|
||||
enum OrderStatus {
|
||||
@@ -149,6 +166,7 @@ enum OrderStatus {
|
||||
SHIPPED
|
||||
COMPLETED
|
||||
CANCELLED
|
||||
PAYMENT_EXPIRED
|
||||
}
|
||||
|
||||
model OrderItem {
|
||||
|
||||
Reference in New Issue
Block a user