- DomainError struct with Code() string method replaces plain errors.New sentinels; errors.Is() still works via pointer equality - UUIDCreatedAt(uuid.UUID) time.Time helper extracts timestamp from UUID v7 - Add TagOffsetPage, CategoryOffsetPage, PoolOffsetPage - FileListParams fields grouped with comments matching openapi.yaml params - Fix mismatched comment on UserPage Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
568 B
Go
30 lines
568 B
Go
package domain
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Category is a logical grouping of tags.
|
|
type Category struct {
|
|
ID uuid.UUID
|
|
Name string
|
|
Notes *string
|
|
Color *string // 6-char hex
|
|
Metadata json.RawMessage
|
|
CreatorID int16
|
|
CreatorName string // denormalized
|
|
IsPublic bool
|
|
CreatedAt time.Time // extracted from UUID v7 via UUIDCreatedAt
|
|
}
|
|
|
|
// CategoryOffsetPage is an offset-based page of categories.
|
|
type CategoryOffsetPage struct {
|
|
Items []Category
|
|
Total int
|
|
Offset int
|
|
Limit int
|
|
}
|