- 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>
34 lines
626 B
Go
34 lines
626 B
Go
package domain
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Pool is an ordered collection of files.
|
|
type Pool struct {
|
|
ID uuid.UUID
|
|
Name string
|
|
Notes *string
|
|
Metadata json.RawMessage
|
|
CreatorID int16
|
|
CreatorName string // denormalized
|
|
IsPublic bool
|
|
FileCount int
|
|
CreatedAt time.Time // extracted from UUID v7
|
|
}
|
|
|
|
// PoolFile is a File with its ordering position within a pool.
|
|
type PoolFile struct {
|
|
File
|
|
Position int
|
|
}
|
|
|
|
// PoolFilePage is the result of a cursor-based pool file listing.
|
|
type PoolFilePage struct {
|
|
Items []PoolFile
|
|
NextCursor *string
|
|
}
|