# ThrillWiki Implementation Plan ## User Review Required > [!IMPORTANT] > **Measurement Unit System**: The backend will store all values in **Metric**. The Frontend (`useUnits` composable) will handle conversion to Imperial based on user preference. > **Sacred Pipeline Enforcement**: All user edits create `Submission` records (stored as JSON). No direct database edits are allowed for non-admin users. ## Proposed Changes ### Backend (Django + DRF) #### 1. Core & Auth Infrastructure - [x] **`apps.core`**: Implement `TrackedModel` using `pghistory` for all core entities to support Edit History and Versioning (Section 15). - [x] **`apps.accounts`**: - `User` & `UserProfile` models (Bio, Location, Home Park). - **Settings Support**: Endpoints for changing Email, Password, MFA, and Sessions (Section 9.1-9.2). - **Privacy**: Fields for `public_profile`, `show_location`, etc. (Section 9.3). - **Data Export**: Endpoint to generate JSON dump of all user data (Section 9.6). - **Account Deletion**: `UserDeletionRequest` model with 7-day grace period (Section 9.6). #### 2. Entity Models & Logic ("Live" Data) - [x] **`apps.parks`**: `Park` (with Operator/Owner FKs, Geolocation). - [x] **`apps.rides`**: `Ride` (Status FSM), `RideModel`, `Manufacturer`, `Designer`. - [x] **`apps.rides` (Credits)**: `RideCredit` Through-Model with `count`, `rating`, `date`, `notes`. Constraint: Unique(user, ride). - [x] **`apps.companies`**: `Company` model with types (`Manufacturer`, `Designer`, `Operator`, `Owner`). - [x] **`apps.lists`**: `UserList` (Ranking System) and `UserListItem`. - [x] **`apps.reviews`**: `Review` model (GenericFK) with Aggregation Logic. #### 3. The Sacred Pipeline (`apps.moderation`) - [x] **Submission Model**: Stores `changes` (JSON), `status` (State Machine), `moderator_note`. - [x] **Submission Serializers**: Handle validation of "Proposed Data" vs "Live Data". - [x] **Queue Endpoints**: `list_pending`, `claim`, `approve`, `reject`, `activity_log`, `stats`. - [x] **Reports**: `Report` model and endpoints. ### Frontend (Nuxt 4) #### 1. Initial Setup & Core - [x] **Composables**: `useUnits` (Metric/Imperial), `useAuth` (MFA, Session), `useApi`. - [x] **Layouts**: Standard Layout (Hero, Tabs), Auth Layout. #### 2. Discovery & Search (Section 1 & 6) - [x] **Global Search**: Hero Search with Autocomplete (Parks, Rides, Companies). - [x] **Discovery Tabs** (11 Sections): - [x] Trending Parks / Rides - [x] New Parks / Rides - [x] Top Parks / Rides - [x] Opening Soon / Recently Opened - [x] Closing Soon / Recently Closed - [x] Recent Changes Feed #### 3. Content Pages (Read-Only Views) - [ ] **Park Detail**: Tabs (Overview, Rides, Reviews, Photos, History). - [ ] **Ride Detail**: Tabs (Overview, Specifications, Reviews, Photos, History). - [ ] **Company Pages**: Manufacturer, Designer, Operator, Property Owner details. - [ ] **Maps**: Interactive "Parks Nearby" map. #### 4. The Sacred Submission Pipeline (Write Views) - [ ] **Submission Forms** (Multi-step Wizards): - [ ] **Park Form**: Location, Dates, Media, Relations. - [ ] **Ride Form**: Specs (with Unit Toggle), Relations, Park selection. - [ ] **Company Form**: Type selection, HQ, details. - [ ] **Photo Upload**: Bulk upload, captioning, crop. - [ ] **Editing**: Load existing data into form -> Submit as JSON Diff. #### 5. Moderation Interface (Section 16) - [ ] **Dashboard**: Queue stats, Assignments. - [ ] **Queues**: - [ ] **Pending Queue**: Filter by Type, Submitter, Date. - [ ] **Reports Queue**. - [ ] **Audit Log**. - [ ] **Review Workspace**: - [ ] **Diff Viewer**: Visual Old vs New comparison. - [ ] **Actions**: Claim, Approve, Reject (with reason), Edit. #### 6. User Experience & Settings - [ ] **User Profile**: Activity Feed, Credits Tab, Lists Tab, Reviews Tab. - [ ] **Ride Credits Management**: Add/Edit Credit (Date, Count, Notes). - [ ] **Settings Area** (6 Tabs): - [ ] Account & Profile (Edit generic info). - [ ] Security (MFA setup, Active Sessions). - [ ] Privacy (Visibility settings). - [ ] Notifications. - [ ] Location & Info (Timezone, Home Park). - [ ] Data & Export (JSON Download, Delete Account). #### 7. Lists System - [ ] **List Management**: Create/Edit Lists (Public/Private). - [ ] **List Editor**: Search items, Add to list, Drag-and-drop reorder, Add notes. ## Verification Plan ### Automated Tests - **Backend**: `pytest` for all Model constraints and API permissions. - Test Submission State Machine: `Pending -> Claimed -> Approved`. - Test Versioning: Ensure `pghistory` tracks changes on approval. - **Frontend**: `vitest` for Unit Tests (Composables). ### Manual Verification Flows 1. **Sacred Pipeline Flow**: - **User**: Submit a change to "Top Thrill 2" (add stats). - **Moderator**: Go to Queue -> Claim -> Verify Diff -> Approve. - **Public**: Verify "Top Thrill 2" page shows new stats and "Last Updated" is now. - **History**: Verify "History" tab shows the update event. 2. **Ride Credits**: - Go to "Iron Gwazi" page. - Click "Add to Credits" -> Enter `Count: 5`, `Rating: 4.5`. - Go to Profile -> Ride Credits. Verify Iron Gwazi is listed with correct data. 3. **Data Privacy & Export**: - Go to Settings -> Privacy -> Toggle "Private Profile". - Open Profile URL in Incognito -> Verify 404 or "Private" message. - Go to Settings -> Data -> "Download Data" -> Verify JSON structure.