41 lines
1.0 KiB
Go

package episode
import (
"context"
"errors"
"time"
)
var (
ErrNotFound = errors.New("episode not found")
ErrInvalidStartTime = errors.New("invalid start_time (expected HH:MM:SS)")
ErrEmptyIDs = errors.New("ids must not be empty")
)
// Episode represents a single show/episode in the system.
type Episode struct {
Id int
EpNum int
EpTitle string
SeasonName string
StartTime string
PlaybackLength string
DateCreated time.Time
}
// MoveResult describes what happened during an archive move operation.
type MoveResult struct {
MovedIDs []int64
DeletedIDs []int64
SkippedIDs []int64
}
// Repository is the storage port that the application layer depends on.
type Repository interface {
GetCurrent(ctx context.Context) (Episode, error)
SetCurrent(ctx context.Context, id int64, startHHMMSS string) error
MoveToArchive(ctx context.Context, ids []int64) (MoveResult, error)
ListAll(ctx context.Context) ([]Episode, error)
Delete(ctx context.Context, id int64) error
}