services

package
v0.0.0-...-ff3b7a6 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxWeight = 3000
	MinWeight = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSeedingService

type DataSeedingService struct {
	// contains filtered or unexported fields
}

func NewDataSeedingService

func NewDataSeedingService(lc fx.Lifecycle,
	cfg *config.Configuration,
	logger *zap.SugaredLogger,
	users *UsersService,
	exercises *ExercisesService,
	workouts *WorkoutsService,
	workoutPlans *WorkoutPlansService,
	store *infrastructure.Store) (*DataSeedingService, error)

type ExercisesService

type ExercisesService struct {
	// contains filtered or unexported fields
}

func NewExercisesService

func NewExercisesService(exerciseRepository *repositories.ExercisesRepository) (*ExercisesService, error)

func (*ExercisesService) CreateExercise

func (us *ExercisesService) CreateExercise(exercise models.Exercise) (*models.Exercise, error)

func (*ExercisesService) DeleteExerciseById

func (us *ExercisesService) DeleteExerciseById(exerciseId string) error

func (*ExercisesService) GetExerciseById

func (us *ExercisesService) GetExerciseById(exerciseId string) (*models.Exercise, error)

func (*ExercisesService) GetExercises

func (us *ExercisesService) GetExercises() ([]*models.Exercise, error)

func (*ExercisesService) UpdateExercise

func (us *ExercisesService) UpdateExercise(exercise models.Exercise) (*models.Exercise, error)

type TokenService

type TokenService struct {
	// contains filtered or unexported fields
}

func NewTokenService

func NewTokenService(configuration *config.Configuration) (*TokenService, error)

func (*TokenService) CreateToken

func (t *TokenService) CreateToken(user *models.User) (string, error)

func (*TokenService) ParseToken

func (t *TokenService) ParseToken(accessToken string) (*models.Claims, error)

type UserStatisticService

type UserStatisticService struct {
	// contains filtered or unexported fields
}

func NewUserStatisticService

func NewUserStatisticService(userStatisticRepository *repositories.UserWeightMeasurementRepository) (*UserStatisticService, error)

func (*UserStatisticService) CreateUserWeightMeasurement

func (us *UserStatisticService) CreateUserWeightMeasurement(userWeight models.UserWeight) (*models.UserWeight, error)

func (*UserStatisticService) DeleteWeightMeasurementById

func (us *UserStatisticService) DeleteWeightMeasurementById(weightMeasurementId string) error

func (*UserStatisticService) GetGeneralStatisticForUser

func (us *UserStatisticService) GetGeneralStatisticForUser(userId string) (*models.UserStatistic, error)

func (*UserStatisticService) UpdateUserWeightMeasurement

func (us *UserStatisticService) UpdateUserWeightMeasurement(userWeight models.UserWeight) (*models.UserWeight, error)

type UserWorkoutsCalendarGenerator

type UserWorkoutsCalendarGenerator struct {
	// contains filtered or unexported fields
}

func NewUserWorkoutsCalendarGenerator

func NewUserWorkoutsCalendarGenerator(lc fx.Lifecycle,
	logger *zap.SugaredLogger,
	zapLoggerOriginal *zap.Logger,
	calendarService *UserWorkoutsCalendarService) (*UserWorkoutsCalendarGenerator, error)

type UserWorkoutsCalendarService

type UserWorkoutsCalendarService struct {
	// contains filtered or unexported fields
}

func NewUserWorkoutsCalendarService

func NewUserWorkoutsCalendarService(logger *zap.SugaredLogger,
	workoutsStatisticRepository *repositories.WorkoutsStatisticRepository,
	workoutsService *WorkoutsService,
	userWorkoutsRepository *repositories.UserWorkoutsRepository) (*UserWorkoutsCalendarService, error)

func (*UserWorkoutsCalendarService) ConfirmVisit

func (us *UserWorkoutsCalendarService) ConfirmVisit(confirmModel models.ConfirmVisit) (*models.WorkoutStatistic, error)

func (*UserWorkoutsCalendarService) CreateCalendarForRepeatableActiveUserWorkouts

func (us *UserWorkoutsCalendarService) CreateCalendarForRepeatableActiveUserWorkouts() error

func (*UserWorkoutsCalendarService) CreateCalendarForUserWorkout

func (us *UserWorkoutsCalendarService) CreateCalendarForUserWorkout(userWorkout *models.UserWorkout) error

func (*UserWorkoutsCalendarService) DeleteScheduledWorkoutsForUserWorkout

func (us *UserWorkoutsCalendarService) DeleteScheduledWorkoutsForUserWorkout(userWorkoutId string) error

func (*UserWorkoutsCalendarService) GetCalendarForUser

func (us *UserWorkoutsCalendarService) GetCalendarForUser(userId string) (*models.WorkoutsCalendar, error)

func (*UserWorkoutsCalendarService) GetWorkoutStatisticById

func (us *UserWorkoutsCalendarService) GetWorkoutStatisticById(statisticId string) (*models.WorkoutStatistic, error)

type UserWorkoutsService

type UserWorkoutsService struct {
	// contains filtered or unexported fields
}

func NewUserWorkoutsService

func NewUserWorkoutsService(logger *zap.SugaredLogger,
	userWorkoutsRepository *repositories.UserWorkoutsRepository,
	calendarService *UserWorkoutsCalendarService,
	workoutPlansService *WorkoutPlansService) (*UserWorkoutsService, error)

func (*UserWorkoutsService) CreateUserWorkout

func (us *UserWorkoutsService) CreateUserWorkout(userWorkout models.UserWorkout) (*models.UserWorkout, error)

func (*UserWorkoutsService) DeactivateWorkoutForUser

func (us *UserWorkoutsService) DeactivateWorkoutForUser(userId string) (*models.UserWorkout, error)

type UsersService

type UsersService struct {
	// contains filtered or unexported fields
}

func NewUsersService

func NewUsersService(userRepository *repositories.UsersRepository) (*UsersService, error)

func (*UsersService) CreateUser

func (us *UsersService) CreateUser(user models.User) (*models.User, error)

func (*UsersService) GetUserByUsername

func (us *UsersService) GetUserByUsername(username string) (*models.User, error)

type WorkoutPlansService

type WorkoutPlansService struct {
	// contains filtered or unexported fields
}

func NewWorkoutPlansService

func NewWorkoutPlansService(workoutPlanRepository *repositories.WorkoutPlansRepository) (*WorkoutPlansService, error)

func (*WorkoutPlansService) CreateWorkoutPlan

func (ws *WorkoutPlansService) CreateWorkoutPlan(workoutPlan models.WorkoutPlan) (*models.WorkoutPlan, error)

func (*WorkoutPlansService) DeleteWorkoutPlanById

func (ws *WorkoutPlansService) DeleteWorkoutPlanById(workoutPlanId string) error

func (*WorkoutPlansService) GetWorkoutPlanById

func (ws *WorkoutPlansService) GetWorkoutPlanById(workoutPlanId string) (*models.WorkoutPlan, error)

func (*WorkoutPlansService) GetWorkoutPlans

func (ws *WorkoutPlansService) GetWorkoutPlans() ([]*models.WorkoutPlan, error)

func (*WorkoutPlansService) UpdateWorkoutPlan

func (ws *WorkoutPlansService) UpdateWorkoutPlan(workoutPlan models.WorkoutPlan) (*models.WorkoutPlan, error)

type WorkoutsService

type WorkoutsService struct {
	// contains filtered or unexported fields
}

func NewWorkoutsService

func NewWorkoutsService(workoutRepository *repositories.WorkoutsRepository) (*WorkoutsService, error)

func (*WorkoutsService) CreateWorkout

func (ws *WorkoutsService) CreateWorkout(workout models.Workout) (*models.Workout, error)

func (*WorkoutsService) DeleteWorkoutById

func (ws *WorkoutsService) DeleteWorkoutById(workoutId string) error

func (*WorkoutsService) GetWorkoutById

func (ws *WorkoutsService) GetWorkoutById(workoutId string) (*models.Workout, error)

func (*WorkoutsService) GetWorkouts

func (ws *WorkoutsService) GetWorkouts() ([]*models.Workout, error)

func (*WorkoutsService) UpdateWorkout

func (ws *WorkoutsService) UpdateWorkout(workout models.Workout) (*models.Workout, error)

Jump to

Keyboard shortcuts

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