feat: add Payment model for yookassa integration
This commit is contained in:
@@ -153,12 +153,30 @@ model Order {
|
||||
|
||||
items OrderItem[]
|
||||
messages OrderMessage[]
|
||||
payments Payment[]
|
||||
messageReadStates UserOrderMessageReadState[]
|
||||
|
||||
@@index([userId, createdAt])
|
||||
@@index([status, updatedAt])
|
||||
}
|
||||
|
||||
model Payment {
|
||||
id String @id @default(cuid())
|
||||
orderId String
|
||||
order Order @relation(fields: [orderId], references: [id], onDelete: Cascade)
|
||||
yookassaPaymentId String @unique
|
||||
status String
|
||||
amountCents Int
|
||||
currency String @default("RUB")
|
||||
confirmationUrl String?
|
||||
expiresAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([orderId])
|
||||
@@index([yookassaPaymentId])
|
||||
}
|
||||
|
||||
model OrderItem {
|
||||
id String @id @default(cuid())
|
||||
qty Int
|
||||
|
||||
Reference in New Issue
Block a user