Skip to content

How scheduling works

Scheduling in Minyu defines which time slots exist and when they can be used.

Instead of allowing arbitrary time input, the system generates valid slots from repeating patterns and then applies additional constraints.

The process involves four parts.

1. Sequences generate repeating time units

A sequence defines a repeating pattern such as:

  • every hour
  • every 30 minutes
  • every day at midnight

A sequence only defines repetition and duration.

It does not define availability or business rules.

Example:

Every hour → duration 1 hour

This produces candidate units such as:

08:00–09:00
09:00–10:00
10:00–11:00

These are candidates, not necessarily valid booking times.

2. Schedules filter those units into usable slots

A schedule combines sequences.

One sequence generates the candidates. Other sequences remove candidates that should not exist.

Example:

Base sequence: every hour
Filter sequence: weekdays only

Result:

Monday 08:00–09:00
Monday 09:00–10:00
...
Friday 16:00–17:00

The schedule defines the structure of availability.

3. Schedule bindings decide where schedules apply

A schedule has no effect until it is bound.

Two binding types exist: column binding and row binding.

Column binding

A schedule attached to a time column controls the allowed input values.

This means users must select time from the generated slots instead of entering free-form times.

Example:

Booking.start_time → schedule

Only valid slots appear in the calendar picker.

Row-level schedules

A schedule stored on a row describes availability for that specific entity.

Example:

Employee → Day shift schedule
Room → Evening availability schedule

These schedules represent availability but do not enforce constraints by themselves.

4. Rules determine whether a slot is allowed

Finally, rules determine whether a selected slot is valid.

Rules can compare:

  • bookings
  • availability schedules
  • other reservations
  • business constraints

Example:

Booking must fall within employee working hours
Booking must not overlap another booking

Rules determine whether the operation is allowed.

Summary

Scheduling works by combining four layers.

flowchart TD

A[Sequence generates repeating time units]

B[Schedule filters units into valid slots]

C[Binding defines where schedules apply]

D[Rules decide whether an operation is allowed]

A --> B
B --> C
C --> D

Together these layers allow the system to enforce structured time without manually creating individual time slots.