- Create migration to add rsvpStatus enum and all missing Guest columns
- Add RsvpStatus enum (PENDING, ACCEPTED, DECLINED)
- Add RSVP Core fields: rsvpStatus, houseRulesAcknowledged, houseRulesAcknowledgedAt, declineReason
- Add Party Details: attendingAlone, plusOnesCount
- Add Profile Phase 2 fields: profileCompleted, whosWhoOptIn, relationshipDetails, etc.
- Add Analytics fields: ipCountryCode, ipCity, ipData
- Improve error detection in guest creation to catch all Prisma schema drift errors
- Migration uses IF NOT EXISTS to be safe for production
Fixes production error: 'The column rsvpStatus does not exist in the current database'
- Add defensive create with try-catch to handle missing rsvpStatus column
- Use raw SQL fallback when Prisma create fails due to schema drift
- Generate guest ID using PostgreSQL gen_random_uuid() function
- Fetch created guest with defensive select to handle missing columns
- This fixes 'column rsvpStatus does not exist' error when adding guests
- Define requestId before try block to ensure it's available in catch block
- This prevents undefined requestId errors that could cause malformed JSON responses
- Ensures all error responses are properly logged with request ID
- Update handleSendInvite to safely parse error responses
- Check content-type before attempting JSON parse
- Handle empty responses and non-JSON error messages gracefully
- This fixes 'JSON data line 1 error' when server returns non-JSON responses
- Use z.union to explicitly handle string email, empty string, null, and undefined
- Transform all falsy/empty values to null for consistent database storage
- This ensures validation works correctly in all scenarios (with email, without email, empty string)
- Add requestId to error logs for better traceability
- Include error details in development mode for debugging
- This will help identify the root cause of 500 errors when adding guests
- Fix GuestCreateSchema email validation to properly handle empty strings
- Use refine with transform to allow null/empty email while validating format when provided
- This fixes 500 error when adding guests without email addresses
The previous schema was failing validation on empty strings because .email()
validator was being applied before checking for empty values.
- Fix import paths in admin-rsvp-on-behalf component (use-toast and csrf-client)
- Add defensive Prisma selects to prevent schema drift errors in production
- Update guest/auth route to use explicit selects instead of include
- Update guest/load route with defensive selects and fallbacks
- Add getCSRFToken helper function to admin-rsvp-on-behalf component
This fixes the 'column not available' Prisma errors and build-time module resolution errors.