client

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{}

Functions

This section is empty.

Types

type Appointment

type Appointment struct {
	ID            int               `json:"id,omitempty"`
	StartAt       schedule.JaneTime `json:"start_at"`
	EndAt         schedule.JaneTime `json:"end_at"`
	Break         bool              `json:"break"`
	LocationID    int               `json:"location_id"`
	StaffMemberID int               `json:"staff_member_id"`
}

type AppointmentRequest

type AppointmentRequest struct {
	Appointment Appointment `json:"appointment"`
	Book        bool        `json:"book"`
}

type Booking

type Booking struct {
	StaffMemberID int               `json:"staff_member_id"`
	TreatmentID   int               `json:"treatment_id"`
	BookerType    string            `json:"booker_type"`
	PatientID     int               `json:"patient_id"`
	StartAt       schedule.JaneTime `json:"start_at"`
	EndAt         schedule.JaneTime `json:"end_at"`
	State         string            `json:"state"`
	Duration      int               `json:"duration"`
	Break         bool              `json:"break"`
	RoomID        int               `json:"room_id"`
}

type BookingRequest

type BookingRequest struct {
	Book        bool    `json:"book"`
	Appointment Booking `json:"appointment"`
}

type CancelRequest added in v1.2.0

type CancelRequest struct {
	WithNotifcations bool   `json:"with_notifications"`
	SendWlns         bool   `json:"send_wlns"`
	CancelledReason  string `json:"cancelled_reason"`
}

type Client

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

func NewClient

func NewClient(
	logger logger.Logger,
	config Config,
	user *domain.User,
	updateAuth func() error,
) (Client, error)

func (Client) BookAppointment

func (client Client) BookAppointment(
	appointment Appointment,
	treatment domain.Treatment,
	patient domain.Patient,
) error

func (Client) BookPatient

func (client Client) BookPatient(
	patient domain.Patient,
	treatment domain.Treatment,
	startTime schedule.JaneTime,
) error

func (Client) CancelAppointment added in v1.2.0

func (client Client) CancelAppointment(appointmentID int, cancelMessage string) error

func (Client) CreateAppointment

func (client Client) CreateAppointment(
	startDate schedule.JaneTime,
	endDate schedule.JaneTime,
	employeeBreak bool,
) (Appointment, error)

func (Client) FetchPatients

func (client Client) FetchPatients(patientName string) ([]domain.Patient, error)

func (Client) FetchSchedule

func (client Client) FetchSchedule(
	startDate schedule.JaneTime,
	endDate schedule.JaneTime,
) (schedule.Schedule, error)

func (Client) FetchTreatments

func (client Client) FetchTreatments() ([]domain.Treatment, error)

func (Client) Login

func (client Client) Login(password string) error

type Config

type Config struct {
	UserFilePath string `yaml:"userFilePath"`
}

type PatientRequest

type PatientRequest struct {
	Autocomplete bool   `json:"autocomplete"`
	Limit        int    `json:"limit"`
	Name         string `json:"q"`
}

Jump to

Keyboard shortcuts

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