- 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>
20 lines
402 B
Go
20 lines
402 B
Go
package domain
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
// ObjectType is a reference entity (file, tag, category, pool).
|
|
type ObjectType struct {
|
|
ID int16
|
|
Name string
|
|
}
|
|
|
|
// Permission represents a per-object access entry for a user.
|
|
type Permission struct {
|
|
UserID int16
|
|
UserName string // denormalized
|
|
ObjectTypeID int16
|
|
ObjectID uuid.UUID
|
|
CanView bool
|
|
CanEdit bool
|
|
}
|