feat: migrate watchlist module to modular domain pattern

This commit is contained in:
2026-05-13 10:33:24 +02:00
parent c32ffd54de
commit c94a2fed04
6 changed files with 256 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package domain
import (
"context"
"mal/internal/db"
)
type WatchlistEntry = db.WatchListEntry
type UserWatchListRow = db.GetUserWatchListRow
type WatchlistService interface {
UpdateEntry(ctx context.Context, userID string, animeID int64, status string) error
RemoveEntry(ctx context.Context, userID string, animeID int64) error
GetWatchlist(ctx context.Context, userID string) ([]UserWatchListRow, error)
DeleteContinueWatching(ctx context.Context, userID string, animeID int64) error
}
type WatchlistRepository interface {
UpsertAnime(ctx context.Context, arg db.UpsertAnimeParams) (db.Anime, error)
GetAnime(ctx context.Context, id int64) (db.Anime, error)
UpsertWatchListEntry(ctx context.Context, arg db.UpsertWatchListEntryParams) (db.WatchListEntry, error)
DeleteWatchListEntry(ctx context.Context, arg db.DeleteWatchListEntryParams) error
GetUserWatchList(ctx context.Context, userID string) ([]db.GetUserWatchListRow, error)
DeleteContinueWatchingEntry(ctx context.Context, arg db.DeleteContinueWatchingEntryParams) error
SaveWatchProgress(ctx context.Context, arg db.SaveWatchProgressParams) error
}