Documentation ¶
Index ¶
- func NewAppointmentRepository(db *sql.DB) domain.AppointmentRepository
- type AppointmentRepository
- func (r *AppointmentRepository) Cancel(ctx context.Context, id uuid.UUID, req *domain.CancelAppointmentRequest) (*domain.Appointment, error)
- func (r *AppointmentRepository) CheckAvailability(ctx context.Context, req *domain.CheckAvailabilityRequest) (bool, error)
- func (r *AppointmentRepository) Create(ctx context.Context, appointment *domain.Appointment) error
- func (r *AppointmentRepository) GetByDoctorID(ctx context.Context, doctorID uuid.UUID, page, limit int) ([]domain.Appointment, int64, error)
- func (r *AppointmentRepository) GetByID(ctx context.Context, id uuid.UUID) (*domain.Appointment, error)
- func (r *AppointmentRepository) GetByUserID(ctx context.Context, userID uuid.UUID, page, limit int) ([]domain.Appointment, int64, error)
- func (r *AppointmentRepository) Reschedule(ctx context.Context, id uuid.UUID, date time.Time, timeSlot string) error
- func (r *AppointmentRepository) Update(ctx context.Context, appointment *domain.Appointment) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAppointmentRepository ¶
func NewAppointmentRepository(db *sql.DB) domain.AppointmentRepository
Types ¶
type AppointmentRepository ¶
type AppointmentRepository struct {
// contains filtered or unexported fields
}
func (*AppointmentRepository) Cancel ¶
func (r *AppointmentRepository) Cancel(ctx context.Context, id uuid.UUID, req *domain.CancelAppointmentRequest) (*domain.Appointment, error)
Cancel cancels an appointment
func (*AppointmentRepository) CheckAvailability ¶
func (r *AppointmentRepository) CheckAvailability(ctx context.Context, req *domain.CheckAvailabilityRequest) (bool, error)
CheckAvailability checks if a time slot is available for a doctor
func (*AppointmentRepository) Create ¶
func (r *AppointmentRepository) Create(ctx context.Context, appointment *domain.Appointment) error
Create creates a new appointment
func (*AppointmentRepository) GetByDoctorID ¶
func (r *AppointmentRepository) GetByDoctorID(ctx context.Context, doctorID uuid.UUID, page, limit int) ([]domain.Appointment, int64, error)
GetByDoctorID gets appointments for a doctor with pagination
func (*AppointmentRepository) GetByID ¶
func (r *AppointmentRepository) GetByID(ctx context.Context, id uuid.UUID) (*domain.Appointment, error)
GetByID gets an appointment by ID with related data
func (*AppointmentRepository) GetByUserID ¶
func (r *AppointmentRepository) GetByUserID(ctx context.Context, userID uuid.UUID, page, limit int) ([]domain.Appointment, int64, error)
GetByUserID gets appointments for a user with pagination
func (*AppointmentRepository) Reschedule ¶
func (r *AppointmentRepository) Reschedule(ctx context.Context, id uuid.UUID, date time.Time, timeSlot string) error
Reschedule updates appointment date and time, and increments reschedule count
func (*AppointmentRepository) Update ¶
func (r *AppointmentRepository) Update(ctx context.Context, appointment *domain.Appointment) error
Update updates an appointment
Click to show internal directories.
Click to hide internal directories.