feat: member portal Sprint 11 — Memories / Gallery
- GalleryAlbum + GalleryItem models + migration (publish gate, cover image, ordered items) - GalleryModule: admin CRUD for albums + items - Member endpoints: GET /my/memories (published albums w/ cover + count), GET /my/memories/:id (album + photos) - /my/memories page: album grid with cover thumbnails - /my/memories/[id] page: photo grid with captions - Memories nav item; register GalleryModule Completes Phase 2 (Intelligence) of the member portal — Sprints 9-11. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,8 @@ model Tenant {
|
||||
askAIQueries AskAIQuery[]
|
||||
knowledgeBoards KnowledgeBoard[]
|
||||
knowledgeItems KnowledgeItem[]
|
||||
galleryAlbums GalleryAlbum[]
|
||||
galleryItems GalleryItem[]
|
||||
}
|
||||
|
||||
enum AdminRole {
|
||||
@@ -799,3 +801,39 @@ model KnowledgeItem {
|
||||
@@index([tenantId, status])
|
||||
@@index([boardId, status])
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Memories / Gallery
|
||||
// ============================================================================
|
||||
|
||||
model GalleryAlbum {
|
||||
id String @id @default(cuid())
|
||||
tenantId String
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
title String
|
||||
description String?
|
||||
coverUrl String?
|
||||
isPublished Boolean @default(false)
|
||||
createdBy String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
items GalleryItem[]
|
||||
|
||||
@@index([tenantId, isPublished])
|
||||
}
|
||||
|
||||
model GalleryItem {
|
||||
id String @id @default(cuid())
|
||||
albumId String
|
||||
album GalleryAlbum @relation(fields: [albumId], references: [id], onDelete: Cascade)
|
||||
tenantId String
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
mediaUrl String
|
||||
caption String?
|
||||
sortOrder Int @default(0)
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([albumId])
|
||||
@@index([tenantId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user