mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 09:11:08 -05:00
564 lines
20 KiB
Python
564 lines
20 KiB
Python
"""
|
|
Rich Choice Objects for Accounts Domain
|
|
|
|
This module defines all choice objects used in the accounts domain,
|
|
replacing tuple-based choices with rich, metadata-enhanced choice objects.
|
|
|
|
Last updated: 2025-01-15
|
|
"""
|
|
|
|
from apps.core.choices import RichChoice, ChoiceGroup, register_choices
|
|
|
|
|
|
# =============================================================================
|
|
# USER ROLES
|
|
# =============================================================================
|
|
|
|
user_roles = ChoiceGroup(
|
|
name="user_roles",
|
|
choices=[
|
|
RichChoice(
|
|
value="USER",
|
|
label="User",
|
|
description="Standard user with basic permissions to create content, reviews, and lists",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "user",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"permissions": ["create_content", "create_reviews", "create_lists"],
|
|
"sort_order": 1,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="MODERATOR",
|
|
label="Moderator",
|
|
description="Trusted user with permissions to moderate content and assist other users",
|
|
metadata={
|
|
"color": "green",
|
|
"icon": "shield-check",
|
|
"css_class": "text-green-600 bg-green-50",
|
|
"permissions": ["moderate_content", "review_submissions", "manage_reports"],
|
|
"sort_order": 2,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="ADMIN",
|
|
label="Admin",
|
|
description="Administrator with elevated permissions to manage users and site configuration",
|
|
metadata={
|
|
"color": "purple",
|
|
"icon": "cog",
|
|
"css_class": "text-purple-600 bg-purple-50",
|
|
"permissions": ["manage_users", "site_configuration", "advanced_moderation"],
|
|
"sort_order": 3,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="SUPERUSER",
|
|
label="Superuser",
|
|
description="Full system administrator with unrestricted access to all features",
|
|
metadata={
|
|
"color": "red",
|
|
"icon": "key",
|
|
"css_class": "text-red-600 bg-red-50",
|
|
"permissions": ["full_access", "system_administration", "database_access"],
|
|
"sort_order": 4,
|
|
}
|
|
),
|
|
]
|
|
)
|
|
|
|
|
|
# =============================================================================
|
|
# THEME PREFERENCES
|
|
# =============================================================================
|
|
|
|
theme_preferences = ChoiceGroup(
|
|
name="theme_preferences",
|
|
choices=[
|
|
RichChoice(
|
|
value="light",
|
|
label="Light",
|
|
description="Light theme with bright backgrounds and dark text for daytime use",
|
|
metadata={
|
|
"color": "yellow",
|
|
"icon": "sun",
|
|
"css_class": "text-yellow-600 bg-yellow-50",
|
|
"preview_colors": {
|
|
"background": "#ffffff",
|
|
"text": "#1f2937",
|
|
"accent": "#3b82f6"
|
|
},
|
|
"sort_order": 1,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="dark",
|
|
label="Dark",
|
|
description="Dark theme with dark backgrounds and light text for nighttime use",
|
|
metadata={
|
|
"color": "gray",
|
|
"icon": "moon",
|
|
"css_class": "text-gray-600 bg-gray-50",
|
|
"preview_colors": {
|
|
"background": "#1f2937",
|
|
"text": "#f9fafb",
|
|
"accent": "#60a5fa"
|
|
},
|
|
"sort_order": 2,
|
|
}
|
|
),
|
|
]
|
|
)
|
|
|
|
|
|
# =============================================================================
|
|
# PRIVACY LEVELS
|
|
# =============================================================================
|
|
|
|
privacy_levels = ChoiceGroup(
|
|
name="privacy_levels",
|
|
choices=[
|
|
RichChoice(
|
|
value="public",
|
|
label="Public",
|
|
description="Profile and activity visible to all users and search engines",
|
|
metadata={
|
|
"color": "green",
|
|
"icon": "globe",
|
|
"css_class": "text-green-600 bg-green-50",
|
|
"visibility_scope": "everyone",
|
|
"search_indexable": True,
|
|
"implications": [
|
|
"Profile visible to all users",
|
|
"Activity appears in public feeds",
|
|
"Searchable by search engines",
|
|
"Can be found by username search"
|
|
],
|
|
"sort_order": 1,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="friends",
|
|
label="Friends Only",
|
|
description="Profile and activity visible only to accepted friends",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "users",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"visibility_scope": "friends",
|
|
"search_indexable": False,
|
|
"implications": [
|
|
"Profile visible only to friends",
|
|
"Activity hidden from public feeds",
|
|
"Not searchable by search engines",
|
|
"Requires friend request approval"
|
|
],
|
|
"sort_order": 2,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="private",
|
|
label="Private",
|
|
description="Profile and activity completely private, visible only to you",
|
|
metadata={
|
|
"color": "red",
|
|
"icon": "lock",
|
|
"css_class": "text-red-600 bg-red-50",
|
|
"visibility_scope": "self",
|
|
"search_indexable": False,
|
|
"implications": [
|
|
"Profile completely hidden",
|
|
"No activity in any feeds",
|
|
"Not discoverable by other users",
|
|
"Maximum privacy protection"
|
|
],
|
|
"sort_order": 3,
|
|
}
|
|
),
|
|
]
|
|
)
|
|
|
|
|
|
# =============================================================================
|
|
# TOP LIST CATEGORIES
|
|
# =============================================================================
|
|
|
|
top_list_categories = ChoiceGroup(
|
|
name="top_list_categories",
|
|
choices=[
|
|
RichChoice(
|
|
value="RC",
|
|
label="Roller Coaster",
|
|
description="Top lists for roller coasters and thrill rides",
|
|
metadata={
|
|
"color": "red",
|
|
"icon": "roller-coaster",
|
|
"css_class": "text-red-600 bg-red-50",
|
|
"ride_category": "roller_coaster",
|
|
"typical_list_size": 10,
|
|
"sort_order": 1,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="DR",
|
|
label="Dark Ride",
|
|
description="Top lists for dark rides and indoor attractions",
|
|
metadata={
|
|
"color": "purple",
|
|
"icon": "moon",
|
|
"css_class": "text-purple-600 bg-purple-50",
|
|
"ride_category": "dark_ride",
|
|
"typical_list_size": 10,
|
|
"sort_order": 2,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="FR",
|
|
label="Flat Ride",
|
|
description="Top lists for flat rides and spinning attractions",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "refresh",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"ride_category": "flat_ride",
|
|
"typical_list_size": 10,
|
|
"sort_order": 3,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="WR",
|
|
label="Water Ride",
|
|
description="Top lists for water rides and splash attractions",
|
|
metadata={
|
|
"color": "cyan",
|
|
"icon": "droplet",
|
|
"css_class": "text-cyan-600 bg-cyan-50",
|
|
"ride_category": "water_ride",
|
|
"typical_list_size": 10,
|
|
"sort_order": 4,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="PK",
|
|
label="Park",
|
|
description="Top lists for theme parks and amusement parks",
|
|
metadata={
|
|
"color": "green",
|
|
"icon": "map",
|
|
"css_class": "text-green-600 bg-green-50",
|
|
"entity_type": "park",
|
|
"typical_list_size": 10,
|
|
"sort_order": 5,
|
|
}
|
|
),
|
|
]
|
|
)
|
|
|
|
|
|
# =============================================================================
|
|
# NOTIFICATION TYPES
|
|
# =============================================================================
|
|
|
|
notification_types = ChoiceGroup(
|
|
name="notification_types",
|
|
choices=[
|
|
# Submission related
|
|
RichChoice(
|
|
value="submission_approved",
|
|
label="Submission Approved",
|
|
description="Notification when user's submission is approved by moderators",
|
|
metadata={
|
|
"color": "green",
|
|
"icon": "check-circle",
|
|
"css_class": "text-green-600 bg-green-50",
|
|
"category": "submission",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 1,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="submission_rejected",
|
|
label="Submission Rejected",
|
|
description="Notification when user's submission is rejected by moderators",
|
|
metadata={
|
|
"color": "red",
|
|
"icon": "x-circle",
|
|
"css_class": "text-red-600 bg-red-50",
|
|
"category": "submission",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 2,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="submission_pending",
|
|
label="Submission Pending Review",
|
|
description="Notification when user's submission is pending moderator review",
|
|
metadata={
|
|
"color": "yellow",
|
|
"icon": "clock",
|
|
"css_class": "text-yellow-600 bg-yellow-50",
|
|
"category": "submission",
|
|
"default_channels": ["inapp"],
|
|
"priority": "low",
|
|
"sort_order": 3,
|
|
}
|
|
),
|
|
# Review related
|
|
RichChoice(
|
|
value="review_reply",
|
|
label="Review Reply",
|
|
description="Notification when someone replies to user's review",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "chat-bubble",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"category": "review",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 4,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="review_helpful",
|
|
label="Review Marked Helpful",
|
|
description="Notification when user's review is marked as helpful",
|
|
metadata={
|
|
"color": "green",
|
|
"icon": "thumbs-up",
|
|
"css_class": "text-green-600 bg-green-50",
|
|
"category": "review",
|
|
"default_channels": ["push", "inapp"],
|
|
"priority": "low",
|
|
"sort_order": 5,
|
|
}
|
|
),
|
|
# Social related
|
|
RichChoice(
|
|
value="friend_request",
|
|
label="Friend Request",
|
|
description="Notification when user receives a friend request",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "user-plus",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"category": "social",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 6,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="friend_accepted",
|
|
label="Friend Request Accepted",
|
|
description="Notification when user's friend request is accepted",
|
|
metadata={
|
|
"color": "green",
|
|
"icon": "user-check",
|
|
"css_class": "text-green-600 bg-green-50",
|
|
"category": "social",
|
|
"default_channels": ["push", "inapp"],
|
|
"priority": "low",
|
|
"sort_order": 7,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="message_received",
|
|
label="Message Received",
|
|
description="Notification when user receives a private message",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "mail",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"category": "social",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 8,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="profile_comment",
|
|
label="Profile Comment",
|
|
description="Notification when someone comments on user's profile",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "chat",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"category": "social",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 9,
|
|
}
|
|
),
|
|
# System related
|
|
RichChoice(
|
|
value="system_announcement",
|
|
label="System Announcement",
|
|
description="Important announcements from the ThrillWiki team",
|
|
metadata={
|
|
"color": "purple",
|
|
"icon": "megaphone",
|
|
"css_class": "text-purple-600 bg-purple-50",
|
|
"category": "system",
|
|
"default_channels": ["email", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 10,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="account_security",
|
|
label="Account Security",
|
|
description="Security-related notifications for user's account",
|
|
metadata={
|
|
"color": "red",
|
|
"icon": "shield-exclamation",
|
|
"css_class": "text-red-600 bg-red-50",
|
|
"category": "system",
|
|
"default_channels": ["email", "push", "inapp"],
|
|
"priority": "high",
|
|
"sort_order": 11,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="feature_update",
|
|
label="Feature Update",
|
|
description="Notifications about new features and improvements",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "sparkles",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"category": "system",
|
|
"default_channels": ["email", "inapp"],
|
|
"priority": "low",
|
|
"sort_order": 12,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="maintenance",
|
|
label="Maintenance Notice",
|
|
description="Scheduled maintenance and downtime notifications",
|
|
metadata={
|
|
"color": "yellow",
|
|
"icon": "wrench",
|
|
"css_class": "text-yellow-600 bg-yellow-50",
|
|
"category": "system",
|
|
"default_channels": ["email", "inapp"],
|
|
"priority": "normal",
|
|
"sort_order": 13,
|
|
}
|
|
),
|
|
# Achievement related
|
|
RichChoice(
|
|
value="achievement_unlocked",
|
|
label="Achievement Unlocked",
|
|
description="Notification when user unlocks a new achievement",
|
|
metadata={
|
|
"color": "gold",
|
|
"icon": "trophy",
|
|
"css_class": "text-yellow-600 bg-yellow-50",
|
|
"category": "achievement",
|
|
"default_channels": ["push", "inapp"],
|
|
"priority": "low",
|
|
"sort_order": 14,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="milestone_reached",
|
|
label="Milestone Reached",
|
|
description="Notification when user reaches a significant milestone",
|
|
metadata={
|
|
"color": "purple",
|
|
"icon": "flag",
|
|
"css_class": "text-purple-600 bg-purple-50",
|
|
"category": "achievement",
|
|
"default_channels": ["push", "inapp"],
|
|
"priority": "low",
|
|
"sort_order": 15,
|
|
}
|
|
),
|
|
]
|
|
)
|
|
|
|
|
|
# =============================================================================
|
|
# NOTIFICATION PRIORITIES
|
|
# =============================================================================
|
|
|
|
notification_priorities = ChoiceGroup(
|
|
name="notification_priorities",
|
|
choices=[
|
|
RichChoice(
|
|
value="low",
|
|
label="Low",
|
|
description="Low priority notifications that can be delayed or batched",
|
|
metadata={
|
|
"color": "gray",
|
|
"icon": "arrow-down",
|
|
"css_class": "text-gray-600 bg-gray-50",
|
|
"urgency_level": 1,
|
|
"batch_eligible": True,
|
|
"delay_minutes": 60,
|
|
"sort_order": 1,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="normal",
|
|
label="Normal",
|
|
description="Standard priority notifications sent in regular intervals",
|
|
metadata={
|
|
"color": "blue",
|
|
"icon": "minus",
|
|
"css_class": "text-blue-600 bg-blue-50",
|
|
"urgency_level": 2,
|
|
"batch_eligible": True,
|
|
"delay_minutes": 15,
|
|
"sort_order": 2,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="high",
|
|
label="High",
|
|
description="High priority notifications sent immediately",
|
|
metadata={
|
|
"color": "orange",
|
|
"icon": "arrow-up",
|
|
"css_class": "text-orange-600 bg-orange-50",
|
|
"urgency_level": 3,
|
|
"batch_eligible": False,
|
|
"delay_minutes": 0,
|
|
"sort_order": 3,
|
|
}
|
|
),
|
|
RichChoice(
|
|
value="urgent",
|
|
label="Urgent",
|
|
description="Critical notifications requiring immediate attention",
|
|
metadata={
|
|
"color": "red",
|
|
"icon": "exclamation",
|
|
"css_class": "text-red-600 bg-red-50",
|
|
"urgency_level": 4,
|
|
"batch_eligible": False,
|
|
"delay_minutes": 0,
|
|
"bypass_preferences": True,
|
|
"sort_order": 4,
|
|
}
|
|
),
|
|
]
|
|
)
|
|
|
|
|
|
# =============================================================================
|
|
# REGISTER ALL CHOICE GROUPS
|
|
# =============================================================================
|
|
|
|
# Register each choice group individually
|
|
register_choices("user_roles", user_roles.choices, "accounts", "User role classifications")
|
|
register_choices("theme_preferences", theme_preferences.choices, "accounts", "Theme preference options")
|
|
register_choices("privacy_levels", privacy_levels.choices, "accounts", "Privacy level settings")
|
|
register_choices("top_list_categories", top_list_categories.choices, "accounts", "Top list category types")
|
|
register_choices("notification_types", notification_types.choices, "accounts", "Notification type classifications")
|
|
register_choices("notification_priorities", notification_priorities.choices, "accounts", "Notification priority levels")
|