shiftcalc

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

type Calculator interface {
	RotationShifts(ctx context.Context, start, end time.Time, rotationID string) ([]RotationShift, error)
	ScheduleAssignments(ctx context.Context, start, end time.Time, scheduleID string) ([]ScheduleAssignment, error)
	ScheduleFinalShifts(ctx context.Context, start, end time.Time, scheduleID string) ([]Shift, error)
	ScheduleFinalShiftsWithOverrides(ctx context.Context, start, end time.Time, scheduleID string) ([]Shift, error)
}

type RotationShift

type RotationShift struct {
	Start  time.Time `json:"start_time"`
	End    time.Time `json:"end_time"`
	PartID string    `json:"participant_id"`
}

type ScheduleAssignment

type ScheduleAssignment struct {
	Target     assignment.Target `json:"target"`
	ScheduleID string            `json:"schedule_id"`
	Rules      []rule.Rule       `json:"rules"`
	Shifts     []Shift           `json:"shifts"`
}

type Shift

type Shift struct {
	Start  time.Time `json:"start_time"`
	End    time.Time `json:"end_time"`
	UserID string    `json:"user_id"`
}

func (Shift) String

func (s Shift) String() string

type ShiftCalculator

type ShiftCalculator struct {
	RuleStore  rule.Store
	SchedStore *schedule.Store
	RotStore   rotation.Store
	OStore     override.Store
}

func (*ShiftCalculator) RotationShifts

func (r *ShiftCalculator) RotationShifts(ctx context.Context, start, end time.Time, rotationID string) ([]RotationShift, error)

func (*ShiftCalculator) ScheduleAssignments

func (c *ShiftCalculator) ScheduleAssignments(ctx context.Context, start, end time.Time, schedID string) ([]ScheduleAssignment, error)

func (*ShiftCalculator) ScheduleFinalShifts

func (c *ShiftCalculator) ScheduleFinalShifts(ctx context.Context, start, end time.Time, schedID string) ([]Shift, error)

func (*ShiftCalculator) ScheduleFinalShiftsWithOverrides

func (c *ShiftCalculator) ScheduleFinalShiftsWithOverrides(ctx context.Context, start, end time.Time, schedID string) ([]Shift, error)

ScheduleFinalShiftsWithOverrides will calculate the final set of on-call shifts for the schedule during the given time frame.

Jump to

Keyboard shortcuts

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