Problem
The codebase uses both "tickets" and "tasks" terminology interchangeably, causing semantic confusion and API duplication. While the database already merged tickets into the task table (migration 20251020105526_merge_tickets_into_tasks), the UI layer and API endpoints still use mixed terminology.
Current Issues:
- Component named
TicketsList but manages tasks
- Variables like
newTicketTitle, creatingTicket but create task records
- Duplicate API endpoints:
/api/tickets/[ticketId] and /api/tasks/[taskId] operating on same database table
- Service layer split: roadmap service for tickets vs direct Prisma for tasks
- Mixed types:
TicketListItem, TicketDetail vs task types
Proposed Solution
1. Rename all "ticket" terminology to "task"
Components:
src/components/features/TicketsList/ → TasksList/
- Component:
TicketsList → TasksList
- Props:
TicketsListProps → TasksListProps
Variables & Functions:
newTicketTitle → newTaskTitle
isCreatingTicket → isCreatingTask
handleCreateTicket → handleCreateTask
handleCancelCreateTicket → handleCancelCreateTask
Types:
TicketListItem → TaskListItem (if not already unified)
TicketDetail → TaskDetail
TicketResponse → TaskResponse
CreateTicketRequest → CreateTaskRequest
UpdateTicketRequest → UpdateTaskRequest
2. Unify API endpoints under /api/tasks
New unified structure:
/api/tasks # List all tasks (with filtering)
/api/tasks/[taskId] # Get/update/delete any task
/api/tasks/reorder # Reorder tasks
/api/features/[featureId]/tasks # Create tasks scoped to a feature
Merge operations:
- Consolidate
/api/tickets/[ticketId] (GET, PATCH, DELETE) into /api/tasks/[taskId]
- Merge roadmap service layer operations with general task operations
- Keep Stakwork workflow integration
- Maintain real-time Pusher broadcasting
Deprecation path:
- Add redirects from
/api/tickets/* to /api/tasks/* for backward compatibility
- Log deprecation warnings
- Remove after 1-2 releases
3. Service layer consolidation
Current:
@/services/roadmap: getTicket, updateTicket, deleteTicket, createTicket
- Direct Prisma: Task workflow operations
Proposed:
- Merge into unified task service:
@/services/tasks
- Include both roadmap operations and workflow operations
- Single source of truth for task CRUD
Benefits
✅ Semantic clarity - One concept, one name
✅ Already aligned with database - Tickets merged into tasks
✅ Simpler API - Single endpoint for task operations
✅ Easier maintenance - No duplicate code paths
✅ Better DX - New developers won't wonder about the difference
✅ Modern terminology - "Tasks" is standard in PM tools
Files Affected (Estimated)
src/components/features/TicketsList/index.tsx
src/app/api/tickets/[ticketId]/route.ts → merge into tasks
src/app/api/tickets/reorder/route.ts → merge into tasks
src/app/api/features/[featureId]/tickets/route.ts → rename to tasks
src/services/roadmap/tickets.ts → merge into unified task service
src/types/roadmap.ts - type definitions
- Various page components using tickets terminology
- Test files referencing tickets
Migration Strategy
- Phase 1: Rename UI components and variables (no API changes)
- Phase 2: Create unified
/api/tasks endpoint with merged functionality
- Phase 3: Add redirects from
/api/tickets to /api/tasks with deprecation warnings
- Phase 4: Update all internal references to use new endpoints
- Phase 5: Remove old
/api/tickets endpoints after deprecation period
Priority
Medium - This is technical debt cleanup that improves maintainability but doesn't block features. Good candidate for including in the feature/simplify-feature-page-cleanup branch or a follow-up PR.
Related
- Migration
20251020105526_merge_tickets_into_tasks already unified database
- Current PR: (feature/simplify-feature-page-cleanup) - could include this work
Problem
The codebase uses both "tickets" and "tasks" terminology interchangeably, causing semantic confusion and API duplication. While the database already merged tickets into the
tasktable (migration20251020105526_merge_tickets_into_tasks), the UI layer and API endpoints still use mixed terminology.Current Issues:
TicketsListbut manages tasksnewTicketTitle,creatingTicketbut create task records/api/tickets/[ticketId]and/api/tasks/[taskId]operating on same database tableTicketListItem,TicketDetailvs task typesProposed Solution
1. Rename all "ticket" terminology to "task"
Components:
src/components/features/TicketsList/→TasksList/TicketsList→TasksListTicketsListProps→TasksListPropsVariables & Functions:
newTicketTitle→newTaskTitleisCreatingTicket→isCreatingTaskhandleCreateTicket→handleCreateTaskhandleCancelCreateTicket→handleCancelCreateTaskTypes:
TicketListItem→TaskListItem(if not already unified)TicketDetail→TaskDetailTicketResponse→TaskResponseCreateTicketRequest→CreateTaskRequestUpdateTicketRequest→UpdateTaskRequest2. Unify API endpoints under
/api/tasksNew unified structure:
Merge operations:
/api/tickets/[ticketId](GET, PATCH, DELETE) into/api/tasks/[taskId]Deprecation path:
/api/tickets/*to/api/tasks/*for backward compatibility3. Service layer consolidation
Current:
@/services/roadmap:getTicket,updateTicket,deleteTicket,createTicketProposed:
@/services/tasksBenefits
✅ Semantic clarity - One concept, one name
✅ Already aligned with database - Tickets merged into tasks
✅ Simpler API - Single endpoint for task operations
✅ Easier maintenance - No duplicate code paths
✅ Better DX - New developers won't wonder about the difference
✅ Modern terminology - "Tasks" is standard in PM tools
Files Affected (Estimated)
src/components/features/TicketsList/index.tsxsrc/app/api/tickets/[ticketId]/route.ts→ merge into taskssrc/app/api/tickets/reorder/route.ts→ merge into taskssrc/app/api/features/[featureId]/tickets/route.ts→ rename to taskssrc/services/roadmap/tickets.ts→ merge into unified task servicesrc/types/roadmap.ts- type definitionsMigration Strategy
/api/tasksendpoint with merged functionality/api/ticketsto/api/taskswith deprecation warnings/api/ticketsendpoints after deprecation periodPriority
Medium - This is technical debt cleanup that improves maintainability but doesn't block features. Good candidate for including in the
feature/simplify-feature-page-cleanupbranch or a follow-up PR.Related
20251020105526_merge_tickets_into_tasksalready unified database