@@ -65,24 +65,24 @@ enum MessageStatus {
6565}
6666
6767model User {
68- id String @id @default (uuid () )
69- name String
70- dob DateTime
71- mobile_number String @unique
72- email String ? @unique
73- gender Gender @default (Unspecified )
74- profile_pic String ?
75- preferred_language Language @default (English )
76- verification_status VerificationStatus @default (unverified )
77- created_at DateTime @default (now () )
68+ id String @id @default (uuid () )
69+ name String
70+ dob DateTime
71+ mobile_number String @unique
72+ email String ? @unique
73+ gender Gender @default (Unspecified )
74+ profile_pic String ?
75+ preferred_language Language @default (English )
76+ verification_status VerificationStatus @default (unverified )
77+ created_at DateTime @default (now () )
7878
7979 // Relations
80- hostedEvents Event [] @relation (" HostEvents " )
80+ hostedEvents Event [] @relation (" HostEvents " )
8181 guestRecords Guest []
82- coHostedEvents Event [] @relation (" CoHostEvents " )
83- createdGuestGroups GuestGroup [] @relation (" CreatedGuestGroups " )
84- guestGroupMemberships GuestGroupUsers [] @relation (" GroupMember " )
85- addedToGroups GuestGroupUsers [] @relation (" AddedBy " )
82+ coHostedEvents Event [] @relation (" CoHostEvents " )
83+ createdGuestGroups GuestGroup [] @relation (" CreatedGuestGroups " )
84+ guestGroupMemberships GuestGroupUsers [] @relation (" GroupMember " )
85+ addedToGroups GuestGroupUsers [] @relation (" AddedBy " )
8686 createdInviteLinks InviteLink []
8787}
8888
@@ -98,8 +98,8 @@ model Event {
9898 created_at DateTime @default (now () )
9999 start_date_time DateTime
100100 end_date_time DateTime ?
101- hostId String
102- host User @relation (" HostEvents " , fields : [hostId ] , references : [id ] )
101+ hostId String
102+ host User @relation (" HostEvents " , fields : [hostId ] , references : [id ] )
103103
104104 weddingDetails WeddingEvent ?
105105 birthdayDetails BirthdayEvent ?
@@ -110,11 +110,11 @@ model Event {
110110 otherDetails OtherEvent ?
111111
112112 // Relations
113- co_hosts User [] @relation (" CoHostEvents " )
114- sub_events SubEvent [] @relation (" ParentEvent " )
115- guests Guest []
116- messages Message []
117- invites Invite []
113+ co_hosts User [] @relation (" CoHostEvents " )
114+ sub_events SubEvent [] @relation (" ParentEvent " )
115+ guests Guest []
116+ messages Message []
117+ invites Invite []
118118 guestGroups EventGuestGroup []
119119}
120120
@@ -131,6 +131,7 @@ model WeddingEvent {
131131 // Relation back to the main Event
132132 event Event @relation (fields : [id ] , references : [id ] , onDelete : Cascade )
133133}
134+
134135model BirthdayEvent {
135136 id String @id // This ID must match the Event's ID
136137 person_image String ?
@@ -165,7 +166,7 @@ model TravelEvent {
165166}
166167
167168model CorporateEvent {
168- id String @id // This ID must match the Event's ID
169+ id String @id // This ID must match the Event's ID
169170 event_details String
170171 terms String ?
171172
@@ -174,7 +175,7 @@ model CorporateEvent {
174175}
175176
176177model CollegeEvent {
177- id String @id // This ID must match the Event's ID
178+ id String @id // This ID must match the Event's ID
178179 event_details String
179180 terms String ?
180181
@@ -183,7 +184,7 @@ model CollegeEvent {
183184}
184185
185186model OtherEvent {
186- id String @id // This ID must match the Event's ID
187+ id String @id // This ID must match the Event's ID
187188 event_details String
188189 terms String ?
189190
@@ -207,29 +208,32 @@ model SubEvent {
207208 guests String []
208209 messages String []
209210}
211+
210212model Guest {
211- id String @id @default (uuid () )
212- rsvp RSVP @default (no_response )
213- food String ?
213+ id String @id @default (uuid () )
214+ rsvp RSVP @default (no_response )
215+ food String ?
214216 // HIGHLIGHT: Changed alcohol from String? to Boolean?
215- alcohol Boolean ?
216- count Int @default (1 )
217+ alcohol Boolean ?
218+ count Int @default (1 )
217219
218220 // HIGHLIGHT: Removed accommodation and added new transport fields
219221 pickup_date_time DateTime ?
220222 pickup_location String ?
221223 dropoff_date_time DateTime ?
222224 dropoff_location String ?
223-
225+
224226 // Make user_id optional for unlinked web RSVPs
225- user_id String ?
226- event_id String
227- group_id String ?
228-
227+ user_id String ?
228+ event_id String
229+ group_id String ?
230+
229231 // Add contact fields for unlinked guests
230- name String ?
231- phone_no String ?
232- email String ?
232+ name String ?
233+ phone_no String ?
234+ email String ?
235+ // Optional personal note left by the guest while filling RSVP
236+ personal_note String ?
233237
234238 user User ? @relation (fields : [user_id ] , references : [id ] )
235239 event Event @relation (fields : [event_id ] , references : [id ] )
@@ -238,35 +242,36 @@ model Guest {
238242
239243 @@unique ([user_id , event_id ] )
240244}
245+
241246model GuestGroup {
242- id String @id @default (uuid () )
247+ id String @id @default (uuid () )
243248 name String
244249 createdBy String
245-
246- creator User @relation (" CreatedGuestGroups " , fields : [createdBy ] , references : [id ] )
247- members GuestGroupUsers []
248- guests Guest []
249- inviteLinks InviteLink []
250- invites Invite []
251- events EventGuestGroup []
250+
251+ creator User @relation (" CreatedGuestGroups " , fields : [createdBy ] , references : [id ] )
252+ members GuestGroupUsers []
253+ guests Guest []
254+ inviteLinks InviteLink []
255+ invites Invite []
256+ events EventGuestGroup []
252257}
253258
254259model EventGuestGroup {
255260 event_id String
256261 guest_group_id String
257262
258263 // RSVP Global Settings (applied to all groups in this event)
259- rsvp_lock_date DateTime ? // Lock RSVP response datetime
260- collect_food Boolean ? @default (false ) // Food preferences
261- collect_alcohol Boolean ? @default (false ) // Alcohol preference
264+ rsvp_lock_date DateTime ? // Lock RSVP response datetime
265+ collect_food Boolean ? @default (false ) // Food preferences
266+ collect_alcohol Boolean ? @default (false ) // Alcohol preference
262267 global_additional_details String ? // Additional details for all groups
263268
264269 // Group-specific RSVP Settings
265270 allow_additional_guests Boolean ? @default (false ) // Additional guests allowed
266271 collect_accommodation Boolean ? @default (false ) // Accommodation preference
267- accommodation_details String ? // Accommodation details if collect_accommodation is true
272+ accommodation_details String ? // Accommodation details if collect_accommodation is true
268273 collect_transport Boolean ? @default (false ) // Transport preference
269- transport_details String ? // Transportation details if collect_transport is true
274+ transport_details String ? // Transportation details if collect_transport is true
270275
271276 created_at DateTime @default (now () )
272277 updated_at DateTime @updatedAt
@@ -303,12 +308,12 @@ model InviteLink {
303308}
304309
305310model Invite {
306- id String @id @default (uuid () )
311+ id String @id @default (uuid () )
307312 name String
308313 email String ?
309314 phone_no String
310- rsvp_status RSVP @default (no_response )
311- additional_guest_count Int @default (0 )
315+ rsvp_status RSVP @default (no_response )
316+ additional_guest_count Int @default (0 )
312317 food_preference FoodPreference ?
313318 alcohol_preference Boolean ?
314319 pickup_date_time DateTime ?
@@ -317,7 +322,7 @@ model Invite {
317322 dropoff_location String ?
318323 event_id String
319324 group_id String
320- created_at DateTime @default (now () )
325+ created_at DateTime @default (now () )
321326 message_status MessageStatus ?
322327
323328 event Event @relation (fields : [event_id ] , references : [id ] , onDelete : Cascade )
@@ -327,8 +332,7 @@ model Invite {
327332}
328333
329334model Message {
330-
331- id String @id @default (uuid () )
335+ id String @id @default (uuid () )
332336 message String
333337 time DateTime @default (now () )
334338 event_id String
@@ -337,7 +341,8 @@ model Message {
337341 event Event @relation (fields : [event_id ] , references : [id ] , onDelete : Cascade )
338342 guest Guest @relation (fields : [guest_id ] , references : [id ] )
339343}
344+
340345model VerifiedPhone {
341346 phone String @id
342347 created_at DateTime @default (now () )
343- }
348+ }
0 commit comments