mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
This commit isolates the `Work` aggregate into its own package at `internal/domain/work`, following the first step of the refactoring plan in `refactor.md`. - The `Work` struct, related types, and the `WorkRepository` interface have been moved to the new package. - A circular dependency between `domain` and `work` was resolved by moving the `AnalyticsRepository` to the `app` layer. - All references to the moved types have been updated across the entire codebase to fix compilation errors. - Test files, including mocks and integration tests, have been updated to reflect the new structure.
17 lines
658 B
Go
17 lines
658 B
Go
package work
|
|
|
|
import (
|
|
"context"
|
|
"tercul/internal/domain"
|
|
)
|
|
|
|
// WorkRepository defines methods specific to Work.
|
|
type WorkRepository interface {
|
|
domain.BaseRepository[Work]
|
|
FindByTitle(ctx context.Context, title string) ([]Work, error)
|
|
FindByAuthor(ctx context.Context, authorID uint) ([]Work, error)
|
|
FindByCategory(ctx context.Context, categoryID uint) ([]Work, error)
|
|
FindByLanguage(ctx context.Context, language string, page, pageSize int) (*domain.PaginatedResult[Work], error)
|
|
GetWithTranslations(ctx context.Context, id uint) (*Work, error)
|
|
ListWithTranslations(ctx context.Context, page, pageSize int) (*domain.PaginatedResult[Work], error)
|
|
} |