feat: Category Feature - Service Layer (#86) #91

Merged
shoko merged 1 commits from feature/category-service into main 2026-04-09 12:44:18 +02:00
Owner

Summary

Add category service layer methods (Issue #86).

Changes

Category Management

  • add_category() - Create a new category (admin only, validates slug format)
  • delete_category() - Soft delete a category (admin only)
  • list_categories() - List all active categories
  • get_category() - Get a category by slug

Category-to-Bounty Association

  • add_category_to_bounty() - Add a category to a bounty (admin only)
  • remove_category_from_bounty() - Remove a category from a bounty (admin only)
  • update_bounty_categories() - Replace all categories on a bounty (admin only)

Validation

  • Slug format validated: lowercase alphabetic only (e.g., 'bug', 'feature')
  • Duplicate slug check on create
  • Permission checks for all admin-only operations
  • Existence validation for categories and bounties

Testing

All 96 existing tests pass.

## Summary Add category service layer methods (Issue #86). ## Changes ### Category Management - `add_category()` - Create a new category (admin only, validates slug format) - `delete_category()` - Soft delete a category (admin only) - `list_categories()` - List all active categories - `get_category()` - Get a category by slug ### Category-to-Bounty Association - `add_category_to_bounty()` - Add a category to a bounty (admin only) - `remove_category_from_bounty()` - Remove a category from a bounty (admin only) - `update_bounty_categories()` - Replace all categories on a bounty (admin only) ## Validation - Slug format validated: lowercase alphabetic only (e.g., 'bug', 'feature') - Duplicate slug check on create - Permission checks for all admin-only operations - Existence validation for categories and bounties ## Testing All 96 existing tests pass.
shoko added 1 commit 2026-04-09 12:38:29 +02:00
Service layer for category feature (Issue #86):

Category Management:
- add_category() - Create category (admin only, validates slug format)
- delete_category() - Soft delete category (admin only)
- list_categories() - List active categories
- get_category() - Get category by slug

Category-to-Bounty Association:
- add_category_to_bounty() - Add category to bounty (admin only)
- remove_category_from_bounty() - Remove category from bounty (admin only)
- update_bounty_categories() - Replace all categories on bounty (admin only)

All methods properly validate permissions, slug format, and existence.
Soft delete preserves category data for bounties that reference it.
han approved these changes 2026-04-09 12:44:00 +02:00
han left a comment
Collaborator

lgtm

lgtm
shoko merged commit 44680dcb4c into main 2026-04-09 12:44:18 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jigaido#91