feat: member portal Sprint 4 — Events + RSVP
- Event + EventRsvp models + migration (RsvpStatus enum: GOING/MAYBE/NOT_GOING) - EventsModule: admin CRUD (create/update/delete/publish) + RSVP list - GET /my/events + POST /my/events/:id/rsvp in MyController/MyService - Admin BFF routes: GET/POST /api/admin/events, PATCH/DELETE /api/admin/events/[id] - Member BFF routes: GET /api/my/events, POST /api/my/events/[id]/rsvp - /my/events page: upcoming/past split, RSVP button (client component, optimistic) - Register DigestModule, OrgModule, ThreadsModule, EventsModule in AppModule - Add EVENT_CREATED/DELETED/UPDATED and DIGEST_SENT to AuditAction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,7 @@ model Tenant {
|
||||
groupAccesses GroupAccess[]
|
||||
digestConfig DigestConfig?
|
||||
digests Digest[]
|
||||
events Event[]
|
||||
}
|
||||
|
||||
enum AdminRole {
|
||||
@@ -387,6 +388,7 @@ model TowerUser {
|
||||
optOuts MemberOptOut[]
|
||||
sessions TowerSession[]
|
||||
messages Message[] @relation("senderTowerUser")
|
||||
rsvps EventRsvp[]
|
||||
|
||||
@@unique([tenantId, phoneHash])
|
||||
@@index([phoneHash])
|
||||
@@ -528,3 +530,48 @@ model Digest {
|
||||
@@unique([tenantId, digestDate])
|
||||
@@index([tenantId])
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Events + RSVP
|
||||
// ============================================================================
|
||||
|
||||
enum RsvpStatus {
|
||||
GOING
|
||||
NOT_GOING
|
||||
MAYBE
|
||||
}
|
||||
|
||||
model Event {
|
||||
id String @id @default(cuid())
|
||||
tenantId String
|
||||
tenant Tenant @relation(fields: [tenantId], references: [id])
|
||||
title String
|
||||
description String?
|
||||
location String?
|
||||
startsAt DateTime
|
||||
endsAt DateTime?
|
||||
createdBy String
|
||||
isPublished Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
rsvps EventRsvp[]
|
||||
|
||||
@@index([tenantId, startsAt])
|
||||
@@index([tenantId, isPublished])
|
||||
}
|
||||
|
||||
model EventRsvp {
|
||||
id String @id @default(cuid())
|
||||
eventId String
|
||||
event Event @relation(fields: [eventId], references: [id], onDelete: Cascade)
|
||||
userId String
|
||||
user TowerUser @relation(fields: [userId], references: [id])
|
||||
status RsvpStatus
|
||||
note String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([eventId, userId])
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user