Refactor event schema to enhance clarity and functionality

Updated attributes, relationships, and data types to improve schema accuracy and flexibility. Added new enums, foreign keys, and reordered fields for better organization. Renamed and adjusted components to reflect evolving business logic.
This commit is contained in:
2025-02-27 19:12:47 +01:00
parent 46fabc38a4
commit 7247190f5f

View File

@@ -9,11 +9,11 @@ erDiagram
string first_name
string last_name
string phone_number
datetime created_at
datetime updated_at
boolean is_active
boolean is_superuser
json preferences
datetime created_at
datetime updated_at
}
EventManager }o--|| Event : "manages"
@@ -21,14 +21,14 @@ erDiagram
uuid id PK
uuid user_id FK
uuid event_id FK
string role
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
uuid assigned_by FK
datetime created_at
datetime updated_at
}
@@ -36,7 +36,7 @@ erDiagram
Event ||--o{ Guest : "invites"
Event ||--o{ GiftItem : "contains"
Event ||--o{ EventMedia : "has"
Event ||--o{ EventUpdate : "has"
Event ||--o{ GiftCategory : "has"
Event }o--|| EventTheme : "uses"
Event {
uuid id PK
@@ -57,8 +57,6 @@ erDiagram
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
@@ -66,26 +64,32 @@ erDiagram
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 {
uuid id PK
uuid event_id FK
uuid invited_by FK
uuid user_id FK "nullable"
string name
string full_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
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 address
json custom_fields
boolean is_blocked
boolean can_bring_guests
datetime created_at
datetime updated_at
}
@@ -94,83 +98,73 @@ erDiagram
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
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
}
GiftItem ||--o{ GiftReservation : "has"
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
string image_url
decimal price
float 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 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_featured
boolean is_public
string alt_text
string credit
datetime upload_date
json metadata
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
@@ -178,81 +172,28 @@ erDiagram
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 {
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 content
boolean is_important
boolean is_pinned
boolean send_notification
boolean notification_sent
datetime notification_sent_at
datetime publish_date
string description
json metadata
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"
User ||--o{ EventManager : "has roles"
Event ||--o{ RSVP : "receives"