command

package
v0.0.0-...-56ef6d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApproveTrainingRescheduleHandler

func NewApproveTrainingRescheduleHandler(
	repo training.Repository,
	userService UserService,
	trainerService TrainerService,
	logger *logrus.Entry,
	metricsClient decorator.MetricsClient,
) decorator.CommandHandler[ApproveTrainingReschedule]

func NewCancelTrainingHandler

func NewCancelTrainingHandler(
	repo training.Repository,
	userService UserService,
	trainerService TrainerService,
	logger *logrus.Entry,
	metricsClient decorator.MetricsClient,
) decorator.CommandHandler[CancelTraining]

Types

type ApproveTrainingReschedule

type ApproveTrainingReschedule struct {
	TrainingUUID string
	User         training.User
}

type CancelTraining

type CancelTraining struct {
	TrainingUUID string
	User         training.User
}

type RejectTrainingReschedule

type RejectTrainingReschedule struct {
	TrainingUUID string
	User         training.User
}

type RejectTrainingRescheduleHandler

type RejectTrainingRescheduleHandler decorator.CommandHandler[RejectTrainingReschedule]

func NewRejectTrainingRescheduleHandler

func NewRejectTrainingRescheduleHandler(
	repo training.Repository,
	logger *logrus.Entry,
	metricsClient decorator.MetricsClient,
) RejectTrainingRescheduleHandler

type RequestTrainingReschedule

type RequestTrainingReschedule struct {
	TrainingUUID string
	NewTime      time.Time

	User training.User

	NewNotes string
}

type RequestTrainingRescheduleHandler

type RequestTrainingRescheduleHandler decorator.CommandHandler[RequestTrainingReschedule]

func NewRequestTrainingRescheduleHandler

func NewRequestTrainingRescheduleHandler(
	repo training.Repository,
	logger *logrus.Entry,
	metricsClient decorator.MetricsClient,
) RequestTrainingRescheduleHandler

type RescheduleTraining

type RescheduleTraining struct {
	TrainingUUID string
	NewTime      time.Time

	User training.User

	NewNotes string
}

type RescheduleTrainingHandler

type RescheduleTrainingHandler decorator.CommandHandler[RescheduleTraining]

func NewRescheduleTrainingHandler

func NewRescheduleTrainingHandler(
	repo training.Repository,
	userService UserService,
	trainerService TrainerService,
	logger *logrus.Entry,
	metricsClient decorator.MetricsClient,
) RescheduleTrainingHandler

type ScheduleTraining

type ScheduleTraining struct {
	TrainingUUID string

	UserUUID string
	UserName string

	TrainingTime time.Time
	Notes        string
}

type ScheduleTrainingHandler

type ScheduleTrainingHandler decorator.CommandHandler[ScheduleTraining]

func NewScheduleTrainingHandler

func NewScheduleTrainingHandler(
	repo training.Repository,
	userService UserService,
	trainerService TrainerService,
	logger *logrus.Entry,
	metricsClient decorator.MetricsClient,
) ScheduleTrainingHandler

type TrainerService

type TrainerService interface {
	ScheduleTraining(ctx context.Context, trainingTime time.Time) error
	CancelTraining(ctx context.Context, trainingTime time.Time) error

	MoveTraining(
		ctx context.Context,
		newTime time.Time,
		originalTrainingTime time.Time,
	) error
}

type UserService

type UserService interface {
	UpdateTrainingBalance(ctx context.Context, userID string, amountChange int) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL