- Add go.mod (module tanabata/backend, Go 1.21) with uuid dependency - Implement internal/domain: File, Tag, TagRule, Category, Pool, PoolFile, User, Session, Permission, ObjectType, AuditEntry + all pagination types - Add domain error sentinels (ErrNotFound, ErrForbidden, etc.) - Add context helpers WithUser/UserFromContext for JWT propagation - Fix migration: remove redundant DEFAULT on exif jsonb column Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
398 B
Go
22 lines
398 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
|
|
}
|