Add Formats Admin Page with CRUD Operations
complete
George Jabbour
## Description
Add a new "Formats" management page to the admin section (
/admin/formats
) that allows team administrators to create, edit, activate/deactivate, and delete game formats for their team. This should mirror the existing Archetypes admin page (/admin/archetypes
) in terms of functionality and UI patterns.Formats are team-scoped entities that define different ways to play a game (e.g., Standard, Modern, Legacy for MTG). Currently, formats can be managed via the API but lack a dedicated admin UI.
## Technical Context
Backend (Already Complete):
- The Formatmodel exists at/apps/backend/apps/games/models/format.py
- Full CRUD API is available via FormatViewSetat/apps/backend/apps/games/views/format.py
- API endpoints: GET/POST /api/v1/formats/,GET/PUT/PATCH/DELETE /api/v1/formats/{id}/
- Format model fields: name,slug(auto-generated),description,game(FK),is_active
- The model inherits from TenantModel(team-scoped) andActivatableMixin
- Missing:The backend ViewSet does NOT haveactivateanddeactivatecustom actions (unlike ArchetypeViewSet)
Frontend (To Be Created):
- Need new page at /apps/frontend/src/app/(app)/admin/formats/
- Follow the established pattern from /apps/frontend/src/app/(app)/admin/archetypes/
## Acceptance Criteria
- [ ] Backend: FormatViewSethasactivateanddeactivatePOST actions
- [ ] Frontend: /admin/formatspage renders with SSR prefetch
- [ ] Frontend: DataTable displays formats with name, game, description, status columns
- [ ] Frontend: "Create Format" dialog allows adding new formats
- [ ] Frontend: "Edit Format" dialog allows updating name and description
- [ ] Frontend: Activate/Deactivate toggle works with optimistic updates
- [ ] Frontend: Delete confirmation dialog works
- [ ] Frontend: Status filter (Active/Inactive/All) works
- [ ] Navigation: "Formats" tab appears in admin sub-nav
- [ ] Design System: Page follows gaming-inspired design (sharp corners, borders, neon colors)
## Questions for Stakeholder
- Permissions:Should formats management require a newformats.managepermission?
- Delete behavior:Should deleting a format be allowed if decks/archetypes are associated?
- Ordering in nav:Where should "Formats" appear in the admin sub-nav?
## Estimated Complexity
M (Medium)
- Follows established archetype patternGeorge Jabbour
marked this post as
complete
George Jabbour
also add formats inline in New Archetype modal like the new deck modal