pravki
This commit is contained in:
@ -797,6 +797,43 @@ enum DiscountCodeType {
|
||||
PROMOCODE
|
||||
}
|
||||
|
||||
// Cart models for backend cart storage
|
||||
model Cart {
|
||||
id String @id @default(cuid())
|
||||
clientId String @unique // Can be authenticated client ID or anonymous session ID
|
||||
items CartItem[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@map("carts")
|
||||
}
|
||||
|
||||
model CartItem {
|
||||
id String @id @default(cuid())
|
||||
cartId String
|
||||
productId String? // For internal products
|
||||
offerKey String? // For external products (AutoEuro)
|
||||
name String
|
||||
description String
|
||||
brand String
|
||||
article String
|
||||
price Float
|
||||
currency String @default("RUB")
|
||||
quantity Int
|
||||
stock Int?
|
||||
deliveryTime String?
|
||||
warehouse String?
|
||||
supplier String?
|
||||
isExternal Boolean @default(false)
|
||||
image String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
cart Cart @relation(fields: [cartId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@map("cart_items")
|
||||
}
|
||||
|
||||
enum DeliveryType {
|
||||
COURIER
|
||||
PICKUP
|
||||
|
Reference in New Issue
Block a user