feat: implement user-scoped receipt aliases with global fallback; enhance alias management in admin panel
Test Suite / test (24.15.0) (push) Has been cancelled
Test Suite / test (24.15.0) (push) Has been cancelled
This commit is contained in:
@@ -26,6 +26,7 @@ model User {
|
||||
ownedProducts Product[]
|
||||
pantryItems PantryItem[]
|
||||
mealPlanEntries MealPlanEntry[]
|
||||
receiptAliases ReceiptAlias[]
|
||||
}
|
||||
|
||||
model Product {
|
||||
@@ -175,10 +176,17 @@ model PantryItem {
|
||||
|
||||
model ReceiptAlias {
|
||||
id Int @id @default(autoincrement())
|
||||
receiptName String @unique // normaliserat kvittonamn (lowercase, trim)
|
||||
receiptName String // normaliserat kvittonamn (lowercase, trim)
|
||||
ownerId Int?
|
||||
owner User? @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
isGlobal Boolean @default(false)
|
||||
productId Int
|
||||
product Product @relation(fields: [productId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([receiptName, ownerId, isGlobal])
|
||||
@@index([ownerId])
|
||||
@@index([isGlobal])
|
||||
}
|
||||
|
||||
model MealPlanEntry {
|
||||
|
||||
Reference in New Issue
Block a user