Introduced new database models to handle email templates, activity logs, and notification logs, including relevant enums and utilities. Updated ER diagram to reflect new relationships and attributes, enhancing event tracking and notification management capabilities.
262 lines
6.8 KiB
Plaintext
262 lines
6.8 KiB
Plaintext
erDiagram
|
|
User ||--o{ Event : "creates"
|
|
User ||--o{ EventManager : "is assigned as"
|
|
User ||--o{ Guest : "can be linked to"
|
|
User ||--o{ ActivityLog : "generates"
|
|
User ||--o{ EmailTemplate : "creates"
|
|
User {
|
|
uuid id PK
|
|
string email UK
|
|
string password_hash
|
|
string first_name
|
|
string last_name
|
|
string phone_number
|
|
boolean is_active
|
|
boolean is_superuser
|
|
json preferences
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
EventManager }o--|| Event : "manages"
|
|
EventManager {
|
|
uuid id PK
|
|
uuid user_id FK
|
|
uuid event_id FK
|
|
uuid assigned_by FK
|
|
enum role "OWNER/ADMIN/MODERATOR/VIEWER"
|
|
boolean can_edit
|
|
boolean can_invite
|
|
boolean can_manage_gifts
|
|
boolean can_send_updates
|
|
boolean can_view_analytics
|
|
datetime assigned_at
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
Event ||--o{ Guest : "invites"
|
|
Event ||--o{ GiftItem : "contains"
|
|
Event ||--o{ EventMedia : "has"
|
|
Event ||--o{ GiftCategory : "has"
|
|
Event ||--o{ EmailTemplate : "has"
|
|
Event ||--o{ NotificationLog : "generates"
|
|
Event ||--o{ ActivityLog : "tracks"
|
|
Event }o--|| EventTheme : "uses"
|
|
Event {
|
|
uuid id PK
|
|
string title
|
|
string slug UK
|
|
string description
|
|
string location_name
|
|
string location_address
|
|
string location_url
|
|
datetime event_date
|
|
time event_start_time
|
|
time event_end_time
|
|
string timezone
|
|
datetime rsvp_deadline
|
|
boolean is_public
|
|
string access_code
|
|
uuid created_by FK
|
|
uuid theme_id FK
|
|
json custom_theme_settings
|
|
json additional_info
|
|
boolean is_active
|
|
boolean rsvp_enabled
|
|
boolean gift_registry_enabled
|
|
boolean updates_enabled
|
|
integer max_guests_per_invitation
|
|
string contact_email
|
|
string contact_phone
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
Guest ||--o{ RSVP : "submits"
|
|
Guest ||--o{ GiftPurchase : "makes"
|
|
Guest ||--o{ NotificationLog : "receives"
|
|
Guest ||--o{ ActivityLog : "generates"
|
|
Guest {
|
|
uuid id PK
|
|
uuid event_id FK
|
|
uuid invited_by FK
|
|
uuid user_id FK "nullable"
|
|
string full_name
|
|
string email
|
|
string phone
|
|
string invitation_code UK
|
|
enum status "INVITED/PENDING/CONFIRMED/DECLINED/WAITLISTED/CANCELLED"
|
|
integer max_additional_guests
|
|
integer actual_additional_guests
|
|
datetime invitation_sent_at
|
|
datetime last_reminded_at
|
|
datetime response_date
|
|
string dietary_restrictions
|
|
string notes
|
|
json custom_fields
|
|
boolean is_blocked
|
|
boolean can_bring_guests
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
RSVP {
|
|
uuid id PK
|
|
uuid guest_id FK
|
|
uuid event_id FK
|
|
enum status "ATTENDING/NOT_ATTENDING/MAYBE"
|
|
integer number_of_guests
|
|
string response_message
|
|
string dietary_requirements
|
|
json additional_info
|
|
datetime response_date
|
|
datetime last_updated
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
GiftCategory ||--o{ GiftItem : "groups"
|
|
GiftCategory {
|
|
uuid id PK
|
|
uuid event_id FK
|
|
uuid created_by FK
|
|
string name
|
|
string description
|
|
string icon
|
|
string color
|
|
integer display_order
|
|
boolean is_visible
|
|
json custom_fields
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
GiftItem ||--o{ GiftPurchase : "tracks"
|
|
GiftItem {
|
|
uuid id PK
|
|
uuid event_id FK
|
|
uuid added_by FK
|
|
uuid category_id FK
|
|
string name
|
|
string description
|
|
float price
|
|
string currency
|
|
integer quantity_requested
|
|
integer quantity_received
|
|
enum status "AVAILABLE/RESERVED/PURCHASED/RECEIVED/REMOVED"
|
|
enum priority "LOW/MEDIUM/HIGH/MUST_HAVE"
|
|
string purchase_url
|
|
string store_name
|
|
string brand
|
|
string model
|
|
string image_url
|
|
integer display_order
|
|
boolean is_visible
|
|
string notes
|
|
json custom_fields
|
|
datetime last_status_change
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
GiftPurchase {
|
|
uuid id PK
|
|
uuid gift_id FK
|
|
uuid guest_id FK
|
|
integer quantity
|
|
datetime purchased_at
|
|
float purchase_price
|
|
string purchase_currency
|
|
string notes
|
|
}
|
|
|
|
EventTheme ||--o{ Event : "applied to"
|
|
EventTheme {
|
|
uuid id PK
|
|
string name
|
|
string description
|
|
string preview_image_url
|
|
json color_palette
|
|
json fonts
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
EventMedia {
|
|
uuid id PK
|
|
uuid event_id FK
|
|
uuid uploaded_by FK
|
|
string file_path
|
|
string original_filename
|
|
enum media_type "IMAGE/VIDEO/DOCUMENT"
|
|
string content_type
|
|
integer file_size
|
|
enum purpose "BANNER/GALLERY/ATTACHMENT"
|
|
boolean is_public
|
|
integer display_order
|
|
string title
|
|
string description
|
|
json metadata
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
EmailTemplate {
|
|
uuid id PK
|
|
string name
|
|
string description
|
|
enum template_type "INVITATION/REMINDER/CONFIRMATION/UPDATE/THANK_YOU/CUSTOM"
|
|
string subject
|
|
text html_content
|
|
text text_content
|
|
json variables
|
|
uuid event_id FK "nullable"
|
|
uuid created_by FK
|
|
boolean is_active
|
|
boolean is_system
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
NotificationLog {
|
|
uuid id PK
|
|
enum notification_type "EMAIL/SMS/PUSH/IN_APP"
|
|
enum status "QUEUED/SENT/DELIVERED/FAILED/OPENED/CLICKED"
|
|
string subject
|
|
string content_preview
|
|
uuid template_id FK
|
|
uuid event_id FK
|
|
uuid guest_id FK "nullable"
|
|
string recipient
|
|
datetime sent_at
|
|
datetime delivered_at
|
|
datetime opened_at
|
|
string error_message
|
|
integer retry_count
|
|
string external_id
|
|
json metadata
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
ActivityLog {
|
|
uuid id PK
|
|
enum activity_type
|
|
text description
|
|
uuid event_id FK "nullable"
|
|
uuid user_id FK "nullable"
|
|
uuid guest_id FK "nullable"
|
|
uuid target_id "generic ID"
|
|
string target_type "type of target"
|
|
string ip_address
|
|
string user_agent
|
|
json data
|
|
datetime created_at
|
|
datetime updated_at
|
|
}
|
|
|
|
EmailTemplate }o--|| NotificationLog : "used for"
|
|
User ||--o{ EventManager : "has roles"
|
|
Event ||--o{ RSVP : "receives"
|