feat(cart): update CartItem model to use composite key and adjust related logic
fix(cart): ensure cart item updates and deletions are based on cartId and itemId feat(buy): implement balance checks and updates during purchase process fix(sellable): ensure cart items are deleted when a sellable is removed feat(user): add conflict checks for shop creation to prevent ID collisions
This commit is contained in:
@@ -117,12 +117,14 @@ model Cart {
|
||||
}
|
||||
|
||||
model CartItem {
|
||||
itemId String @id
|
||||
itemId String
|
||||
quantity Int
|
||||
cartId String
|
||||
|
||||
cart Cart @relation(fields: [cartId], references: [userId], onDelete: Cascade, onUpdate: Cascade)
|
||||
sellable Sellable @relation(fields: [itemId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
||||
|
||||
@@id([cartId, itemId])
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
|
||||
Reference in New Issue
Block a user