From aad208d839156162181bcb57935996b5f650a6b2 Mon Sep 17 00:00:00 2001 From: Giuseppe Lombardo Date: Wed, 12 Aug 2026 21:33:55 +0000 Subject: [PATCH] Dateien nach "prisma" hochladen --- prisma/schema.prisma | 79 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f18d65d..abaa0c7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -118,6 +118,31 @@ enum InvitationStatus { REVOKED } +enum StorageLocation { + FRIDGE + FREEZER + KITCHEN_CABINET_1 + KITCHEN_CABINET_2 + KITCHEN_CABINET_3 + PANTRY +} + +enum TrashType { + RESTMUELL + BIOMUELL + GELBER_SACK + PAPIER + GLAS +} + +enum DocumentCategory { + HAUSORDNUNG + WLAN + VERTRAG + TUTORIAL + SONSTIGES +} + // ---------------------------------------------------------------------------- // USERS // ---------------------------------------------------------------------------- @@ -152,6 +177,8 @@ model User { guestCodesIssued GuestCode[] notifications Notification[] invitationsSent Invitation[] @relation("InvitationsSent") + storageSlots StorageSlot[] + documentsUploaded Document[] @@map("users") } @@ -366,7 +393,7 @@ model Inventory { purchasePrice Decimal? @map("purchase_price") @db.Decimal(8, 2) condition ItemCondition @default(GOOD) manualPdfUrl String? @map("manual_pdf_url") // Anleitung (z.B. Entkalkung) - photoUrl String? @map("photo_url") + photoUrls String[] @default([]) @map("photo_urls") // mehrere Fotos möglich createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") @@ -521,3 +548,53 @@ model Notification { @@index([userId, sentAt]) @@map("notifications") } + +// ---------------------------------------------------------------------------- +// KÜCHEN-/SCHRANKPLANER & MÜLL-KALENDER +// ---------------------------------------------------------------------------- + +// Ein einzelnes Fach im Kühlschrank/Gefrierfach/Schrank, das sich ein Mieter +// reservieren ("beanspruchen") kann. NULL userId = frei/gemeinschaftlich. +model StorageSlot { + id String @id @default(uuid()) + location StorageLocation + label String // z. B. "Fach 1 oben" + userId String? @map("user_id") + user User? @relation(fields: [userId], references: [id]) + + createdAt DateTime @default(now()) @map("created_at") + updatedAt DateTime @updatedAt @map("updated_at") + + @@map("storage_slots") +} + +// Müll-Kalender: Abholtermine je Mülltyp, für den Vorabend-Push. +model TrashSchedule { + id String @id @default(uuid()) + type TrashType + date DateTime + reminderSentAt DateTime? @map("reminder_sent_at") + + createdAt DateTime @default(now()) @map("created_at") + + @@index([date]) + @@map("trash_schedule") +} + +// ---------------------------------------------------------------------------- +// DOKUMENTEN-SAFE & TUTORIALS +// ---------------------------------------------------------------------------- + +model Document { + id String @id @default(uuid()) + title String + category DocumentCategory @default(SONSTIGES) + url String // Link zur Datei/zum Video (PDF, Bild, YouTube o. Ä.) + description String? + uploadedById String @map("uploaded_by_id") + uploadedBy User @relation(fields: [uploadedById], references: [id]) + + createdAt DateTime @default(now()) @map("created_at") + + @@map("documents") +}