add competition service (it`s broken, I will fix it later)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user