Implement Category API methods (GetAllCategories, GetCategory)

- GetAllCategories returns all categories for a project
- GetCategory returns a single category by ID
- Returns ErrCategoryNotFound for non-existent categories
- Added ErrCategoryNotFound to IsNotFound helper
- Comprehensive test coverage
This commit is contained in:
Oliver Jakoubek 2026-01-15 18:25:12 +01:00
commit fc4577e729
4 changed files with 207 additions and 2 deletions

View file

@ -39,6 +39,9 @@ var (
// ErrCommentNotFound indicates the specified comment was not found.
ErrCommentNotFound = errors.New("comment not found")
// ErrCategoryNotFound indicates the specified category was not found.
ErrCategoryNotFound = errors.New("category not found")
)
// Logic errors
@ -82,7 +85,8 @@ func IsNotFound(err error) bool {
errors.Is(err, ErrProjectNotFound) ||
errors.Is(err, ErrTaskNotFound) ||
errors.Is(err, ErrColumnNotFound) ||
errors.Is(err, ErrCommentNotFound)
errors.Is(err, ErrCommentNotFound) ||
errors.Is(err, ErrCategoryNotFound)
}
// IsUnauthorized returns true if the error indicates an authentication failure.