27 lines
779 B
Go
27 lines
779 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"datarush/internal/competition/domain"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
|
|
type ListCompetitionsOptions struct {
|
|
Page int
|
|
PageSize int
|
|
State *domain.CompetitionState
|
|
IsParticipating *bool
|
|
SearchQuery *string
|
|
}
|
|
|
|
type CompetitionRepository interface {
|
|
Create(ctx context.Context, competition *domain.Competition) error
|
|
Get(ctx context.Context, id uuid.UUID) (*domain.Competition, error)
|
|
Update(ctx context.Context, competition *domain.Competition) error
|
|
Delete(ctx context.Context, id uuid.UUID) error
|
|
List(ctx context.Context, opts ListCompetitionsOptions) ([]domain.Competition, int, error)
|
|
ChangeState(ctx context.Context, id uuid.UUID, state domain.CompetitionState) (*domain.Competition, error)
|
|
}
|