schedule

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAppointment = Appointment{}

Functions

This section is empty.

Types

type Appointment

type Appointment struct {
	ID        int             `json:"id"`
	PatientID int             `json:"patient_id"`
	StartAt   JaneTime        `json:"start_at"`
	EndAt     JaneTime        `json:"end_at"`
	State     AppointmentType `json:"state"`
	Patient   domain.Patient  `json:"patient"`
}

func (Appointment) HasPassed added in v1.1.0

func (appointment Appointment) HasPassed() bool

func (Appointment) ToString

func (appointment Appointment) ToString() string

type AppointmentType added in v1.1.0

type AppointmentType string
const (
	Booked      AppointmentType = "booked"
	Arrived     AppointmentType = "arrived"
	Break       AppointmentType = "break"
	Unscheduled AppointmentType = "unscheduled"
)

type JaneTime

type JaneTime struct {
	time.Time
}

func NewJaneTime

func NewJaneTime(input time.Time) JaneTime

func (JaneTime) HumanDate

func (janeTime JaneTime) HumanDate() string

func (JaneTime) HumanDateTime added in v1.2.0

func (janeTime JaneTime) HumanDateTime() string

func (JaneTime) MarshalJSON

func (janeTime JaneTime) MarshalJSON() ([]byte, error)

func (JaneTime) NextDay added in v1.2.0

func (janeTime JaneTime) NextDay() JaneTime

func (JaneTime) PreviousDay added in v1.2.0

func (janeTime JaneTime) PreviousDay() JaneTime

func (JaneTime) ThisDay added in v1.2.0

func (janeTime JaneTime) ThisDay() JaneTime

func (*JaneTime) UnmarshalJSON

func (janeTime *JaneTime) UnmarshalJSON(bytes []byte) error

type Schedule

type Schedule struct {
	Appointments []Appointment `json:"appointments"`
	Shifts       []Shift       `json:"shifts"`
	// contains filtered or unexported fields
}

func New added in v1.1.0

func New() Schedule

func (Schedule) OnlyInclude added in v1.1.0

func (schedule Schedule) OnlyInclude(include []AppointmentType) Schedule

func (Schedule) ShowAll added in v1.1.0

func (schedule Schedule) ShowAll() Schedule

func (Schedule) ToString

func (schedule Schedule) ToString() string

type Shift

type Shift struct {
	StartAt JaneTime `json:"start_at"`
	EndAt   JaneTime `json:"end_at"`
}

TODO: Extract into its own file and have it deserialized

Jump to

Keyboard shortcuts

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