Skip to content

feat: add event, rsvp, and user preference schema with migration#106

Merged
kevinrutledge merged 1 commit intodevelopfrom
feat/event-user-preference-schema
Apr 5, 2026
Merged

feat: add event, rsvp, and user preference schema with migration#106
kevinrutledge merged 1 commit intodevelopfrom
feat/event-user-preference-schema

Conversation

@kevinrutledge
Copy link
Copy Markdown
Collaborator

Developer

Kevin Rutledge

What changed?

Added Prisma schema and migration for events, RSVP tracking, and user notification preferences.

  1. Event model - stores title, description, location, start/end dates, RSVP deadline, event type (social/networking/volunteer/meeting), creator (ownerid), and optional group association. Foreign key to contact_group with SET NULL on delete (same pattern as Message.groupId).

  2. EventRsvp model - tracks per-member RSVP status (going/maybe/declined) for each event. Unique constraint on (eventId, memberId) prevents duplicate RSVPs. Cascades on event delete.

  3. UserPreference model - stores global notification defaults per member (notifyEmailDefault, notifySmsDefault). Separate from the per-group notifyEmail/notifySms on ContactGroupMember. One row per member (unique constraint on memberId).

  4. EventType and RsvpStatus enums following the existing EmailSuppressionReason pattern.

All models follow existing conventions: Int autoincrement primary keys, camelCase Prisma fields with @Map snake_case DB columns, ownerid as plain Int (member data lives in external Portal API), and minimal indexes for tables under 1000 rows.

How to test

  1. Run npx prisma generate - client generates without errors
  2. Run npm run build - succeeds
  3. Start Docker (npm run docker:up) and run npx prisma migrate dev - migration applies cleanly
  4. Run npx prisma studio - verify event, event_rsvp, and user_preference tables exist with correct columns

Checklist

@kevinrutledge kevinrutledge requested a review from suesuee April 5, 2026 06:16
@kevinrutledge kevinrutledge self-assigned this Apr 5, 2026
@kevinrutledge kevinrutledge merged commit b6e7e69 into develop Apr 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant