Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Appointment ¶
type Appointment struct { ID int64 `json:"id"` TrainerID int64 `json:"trainer_id"` UserID *int64 `json:"user_id"` StartsAt time.Time `json:"starts_at"` EndsAt time.Time `json:"ends_at"` Status AppointmentStatus `json:"appointment_status"` }
Appointment holds relevant appointment information
type AppointmentStatus ¶
type AppointmentStatus string
const ( Open AppointmentStatus = "OPEN" Booked AppointmentStatus = "BOOKED" )
type Repository ¶
type Repository interface { GetAppointmentsByTrainerAndDates(ctx context.Context, trainerID int64, startsAt, endsAt time.Time) ([]Appointment, error) GetBookedAppointments(ctx context.Context, trainerID int64) ([]Appointment, error) UpdateAppointment(ctx context.Context, apptRequest Request) error }
func NewRepository ¶
func NewRepository(opts ...Option) Repository
type Request ¶
Request represents a minimal body for booking an appointmeent. Only the appointmentI ID and UserID are needed to attempt a booking.
type Service ¶
type Service interface { GetAppointmentsByTrainerAndDates(ctx context.Context, trainerID int64, startsAt, endsAt time.Time) ([]Appointment, error) GetBookedAppointments(ctx context.Context, trainerID int64) ([]Appointment, error) UpdateAppointment(ctx context.Context, apptRequest Request) error }
func NewService ¶
func NewService(repo Repository) Service
Click to show internal directories.
Click to hide internal directories.