42 lines
1.6 KiB
Go
42 lines
1.6 KiB
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"secunda-test/internal/domain"
|
|
)
|
|
|
|
type UserRepository interface {
|
|
Create(ctx context.Context, email, passwordHash, name string) (domain.User, error)
|
|
FindByEmail(ctx context.Context, email string) (domain.User, error)
|
|
FindByID(ctx context.Context, id int64) (domain.User, error)
|
|
}
|
|
|
|
type TeamRepository interface {
|
|
Create(ctx context.Context, name string, createdBy int64) (domain.Team, error)
|
|
AddMember(ctx context.Context, teamID, userID int64, role domain.Role) error
|
|
ListByUser(ctx context.Context, userID int64) ([]domain.Team, error)
|
|
MemberRole(ctx context.Context, teamID, userID int64) (domain.Role, bool, error)
|
|
}
|
|
|
|
type TaskRepository interface {
|
|
Create(ctx context.Context, task domain.Task) (domain.Task, error)
|
|
Get(ctx context.Context, id int64) (domain.Task, error)
|
|
Update(ctx context.Context, task domain.Task, changedBy int64) (domain.Task, error)
|
|
List(ctx context.Context, filter domain.TaskFilter) ([]domain.Task, error)
|
|
History(ctx context.Context, taskID int64) ([]domain.TaskHistory, error)
|
|
TeamSummary(ctx context.Context) ([]domain.TeamSummary, error)
|
|
TopCreators(ctx context.Context) ([]domain.TopCreator, error)
|
|
InvalidAssignees(ctx context.Context) ([]domain.Task, error)
|
|
}
|
|
|
|
type TaskCache interface {
|
|
GetTasks(ctx context.Context, filter domain.TaskFilter) ([]domain.Task, bool, error)
|
|
SetTasks(ctx context.Context, filter domain.TaskFilter, tasks []domain.Task) error
|
|
DeleteTeam(ctx context.Context, teamID int64) error
|
|
}
|
|
|
|
type EmailSender interface {
|
|
SendInvite(ctx context.Context, email, teamName string) error
|
|
}
|