This commit is contained in:
54CHA
2025-07-29 18:55:09 +03:00
parent 94ed190869
commit 08f76a7633
14 changed files with 2869 additions and 16 deletions

View File

@ -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