35 lines
1.3 KiB
Go
35 lines
1.3 KiB
Go
package port
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.threesix.ai/jordan/persona-community-2/pkg/album"
|
|
)
|
|
|
|
// AlbumRepository defines persistence operations for albums.
|
|
// It extends album.AlbumUpdater so implementations satisfy both interfaces.
|
|
type AlbumRepository interface {
|
|
album.AlbumUpdater
|
|
|
|
// Create persists a new album. Sets ID, CreatedAt, UpdatedAt.
|
|
Create(ctx context.Context, a *album.Album) error
|
|
|
|
// Get returns an album by ID. Returns ErrAlbumNotFound if not found.
|
|
Get(ctx context.Context, id album.AlbumID, userID string) (*album.Album, error)
|
|
|
|
// List returns all albums for a user, ordered by CreatedAt DESC.
|
|
List(ctx context.Context, userID string) ([]album.Album, error)
|
|
|
|
// Delete removes an album and all its shots. Does NOT delete stored images.
|
|
Delete(ctx context.Context, id album.AlbumID, userID string) error
|
|
|
|
// ResetShot clears a shot's ImageURL, JobID, Error, and sets Status to pending.
|
|
ResetShot(ctx context.Context, id album.AlbumID, userID string, shotIndex int) error
|
|
|
|
// UpdateAnchorJobID sets the AnchorJobID when the anchor generation job is enqueued.
|
|
UpdateAnchorJobID(ctx context.Context, id album.AlbumID, userID, jobID string) error
|
|
|
|
// UpdateShotJobID sets the shot's JobID when a shot generation job is enqueued.
|
|
UpdateShotJobID(ctx context.Context, id album.AlbumID, userID string, shotIndex int, jobID string) error
|
|
}
|