Add ER diagram for EventSpace schema using Mermaid
This commit introduces a comprehensive Entity Relationship (ER) diagram for the EventSpace schema in Mermaid format. It documents key entities, their attributes, and relationships, providing a clear visualization of the database structure. This will aid in understanding and maintaining the data model.
This commit is contained in:
237
docs/eventspace-er-schema.mermaid
Normal file
237
docs/eventspace-er-schema.mermaid
Normal file
@@ -0,0 +1,237 @@
|
||||
erDiagram
|
||||
User ||--o{ Event : "creates/manages"
|
||||
User {
|
||||
uuid id PK
|
||||
string email
|
||||
string password_hash
|
||||
string first_name
|
||||
string last_name
|
||||
string phone_number
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
boolean is_active
|
||||
boolean is_superuser
|
||||
json preferences
|
||||
}
|
||||
|
||||
Event ||--o{ Guest : "invites"
|
||||
Event ||--o{ GiftItem : "contains"
|
||||
Event ||--o{ EventMedia : "has"
|
||||
Event ||--o{ EventUpdate : "has"
|
||||
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
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
boolean is_active
|
||||
boolean rsvp_enabled
|
||||
boolean gift_registry_enabled
|
||||
boolean updates_enabled
|
||||
integer max_guests_per_invitation
|
||||
string contact_email
|
||||
string contact_phone
|
||||
}
|
||||
|
||||
Guest ||--o{ RSVP : "submits"
|
||||
Guest {
|
||||
uuid id PK
|
||||
uuid event_id FK
|
||||
string name
|
||||
string email
|
||||
string phone
|
||||
string invitation_code UK
|
||||
datetime invited_at
|
||||
boolean email_sent
|
||||
datetime email_sent_at
|
||||
integer reminder_count
|
||||
datetime last_reminder_sent
|
||||
string relationship
|
||||
string notes
|
||||
json address
|
||||
json custom_fields
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
RSVP {
|
||||
uuid id PK
|
||||
uuid guest_id FK
|
||||
uuid event_id FK
|
||||
boolean attending
|
||||
integer number_of_adults
|
||||
integer number_of_children
|
||||
string dietary_restrictions
|
||||
string message
|
||||
string additional_guests_names
|
||||
datetime responded_at
|
||||
string ip_address
|
||||
string user_agent
|
||||
json custom_responses
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
GiftItem ||--o{ GiftReservation : "has"
|
||||
GiftItem {
|
||||
uuid id PK
|
||||
uuid event_id FK
|
||||
string name
|
||||
string description
|
||||
string image_url
|
||||
decimal price
|
||||
string currency
|
||||
string purchase_url
|
||||
integer priority
|
||||
boolean is_group_gift
|
||||
decimal amount_contributed
|
||||
integer quantity_requested
|
||||
integer quantity_remaining
|
||||
boolean is_custom_amount
|
||||
decimal min_custom_amount
|
||||
boolean is_visible
|
||||
json category_tags
|
||||
json additional_details
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
GiftReservation {
|
||||
uuid id PK
|
||||
uuid gift_item_id FK
|
||||
uuid guest_id FK "nullable"
|
||||
string reserver_name
|
||||
string reserver_email
|
||||
string reserver_phone
|
||||
integer quantity
|
||||
decimal amount
|
||||
boolean is_anonymous
|
||||
datetime reserved_at
|
||||
string reservation_code
|
||||
string message
|
||||
boolean is_purchased
|
||||
datetime purchased_at
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
EventMedia {
|
||||
uuid id PK
|
||||
uuid event_id FK
|
||||
string media_type
|
||||
string title
|
||||
string description
|
||||
string file_path
|
||||
string url
|
||||
string thumbnail_url
|
||||
integer display_order
|
||||
boolean is_featured
|
||||
boolean is_public
|
||||
string alt_text
|
||||
string credit
|
||||
datetime upload_date
|
||||
json metadata
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
EventTheme {
|
||||
uuid id PK
|
||||
string name
|
||||
string description
|
||||
string preview_image_url
|
||||
json color_palette
|
||||
json fonts
|
||||
json animations
|
||||
json layout_options
|
||||
json component_styles
|
||||
boolean is_active
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
EventUpdate {
|
||||
uuid id PK
|
||||
uuid event_id FK
|
||||
string title
|
||||
string content
|
||||
boolean is_important
|
||||
boolean is_pinned
|
||||
boolean send_notification
|
||||
boolean notification_sent
|
||||
datetime notification_sent_at
|
||||
datetime publish_date
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
EmailTemplate {
|
||||
uuid id PK
|
||||
string name
|
||||
string subject
|
||||
string html_content
|
||||
string text_content
|
||||
string description
|
||||
string template_type
|
||||
json variables
|
||||
boolean is_active
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
Setting {
|
||||
string key PK
|
||||
string value
|
||||
string description
|
||||
string category
|
||||
datetime created_at
|
||||
datetime updated_at
|
||||
}
|
||||
|
||||
NotificationLog {
|
||||
uuid id PK
|
||||
string notification_type
|
||||
uuid event_id FK
|
||||
uuid guest_id FK "nullable"
|
||||
string recipient
|
||||
string subject
|
||||
string content_preview
|
||||
boolean is_sent
|
||||
string error_message
|
||||
datetime sent_at
|
||||
datetime created_at
|
||||
}
|
||||
|
||||
EventActivity {
|
||||
uuid id PK
|
||||
uuid event_id FK
|
||||
uuid user_id FK "nullable"
|
||||
uuid guest_id FK "nullable"
|
||||
string activity_type
|
||||
string description
|
||||
json context_data
|
||||
string ip_address
|
||||
datetime created_at
|
||||
}
|
||||
|
||||
EventTheme ||--o{ Event : "applied to"
|
||||
Guest ||--o{ GiftReservation : "makes"
|
||||
Event ||--o{ RSVP : "receives"
|
||||
Event ||--o{ EventActivity : "logs"
|
||||
Event ||--o{ NotificationLog : "generates"
|
||||
Reference in New Issue
Block a user