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:
2026-03-26 20:33:11 +01:00
parent f588672894
commit 8b4eaee510
11 changed files with 119 additions and 31 deletions
+3 -1
View File
@@ -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])
}
//////////////////////