Order api: create order schema
This commit is contained in:
@@ -18,5 +18,7 @@ model Account {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now())
|
||||
|
||||
profile Profile?
|
||||
profile Profile? //one-to-one
|
||||
|
||||
orders Order[] //one-to-many
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
enum STATUS {
|
||||
INITIATED
|
||||
CONFIRMED
|
||||
ONGOING
|
||||
DELIVERED
|
||||
CANCELLED
|
||||
}
|
||||
|
||||
enum PAYMENT_TYPE {
|
||||
COD
|
||||
}
|
||||
|
||||
model Order {
|
||||
id String @id @default(uuid())
|
||||
shopAccountId String
|
||||
account Account @relation(fields: [shopAccountId], references: [id], onDelete: Cascade)
|
||||
productPrice Int
|
||||
productQuantity Int
|
||||
productName String
|
||||
status STATUS
|
||||
customerName String
|
||||
customerPhone String
|
||||
customerAddress String
|
||||
customerNote String
|
||||
paymentType PAYMENT_TYPE
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
@@ -9,4 +9,5 @@ model Profile {
|
||||
shopAddress String?
|
||||
shopMapLocation String?
|
||||
shopCategory String?
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user