Description:
Set up the standard API endpoints for the Category model and implement a custom endpoint to aggregate task data.
Acceptance Criteria & Steps:
Create ViewSet: Implement CategoryViewSet inheriting from DRF's ModelViewSet to handle standard CRUD operations.
Configure Routing: Register the new viewset with the application's router to expose the URL endpoints.
Add Custom Action: Use the @action decorator to create a custom detail endpoint (count_tasks). This endpoint must calculate and return the total number of tasks linked to the specific category.
Description:
Set up the standard API endpoints for the Category model and implement a custom endpoint to aggregate task data.
Acceptance Criteria & Steps:
Create ViewSet: Implement CategoryViewSet inheriting from DRF's ModelViewSet to handle standard CRUD operations.
Configure Routing: Register the new viewset with the application's router to expose the URL endpoints.
Add Custom Action: Use the @action decorator to create a custom detail endpoint (count_tasks). This endpoint must calculate and return the total number of tasks linked to the specific category.