feat: add Payment model for yookassa integration

This commit is contained in:
Kirill
2026-05-20 17:49:14 +05:00
parent 585c565b7b
commit 7bba78b4c0
2 changed files with 41 additions and 0 deletions
+18
View File
@@ -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