Add a cancellation cutoff so a student can no longer cancel a lesson once it is
too close to its start time. Instructors and studio admins can always cancel,
regardless of the cutoff.
Studio default setting
A studio-wide default cutoff, configured under Studio Settings.
Stored and computed in hours, but always displayed to the admin in days
("Students can cancel up to N days before a lesson").
Sensible default: 1 day (24 hours).
Per-offering override
Each offering may set its own cutoff (a time, in hours).
When an offering's cutoff is not set, it falls back to the studio default.
Enforcement
Student-initiated cancellation (POST /bookings/{id}/cancel) is rejected when now is within the effective cutoff of the slot's start time, returning a clear
message explaining how far in advance cancellations must happen.
Instructor status changes (PATCH /bookings/{id}/status) and studio-admin
student actions are unaffected — they can cancel at any time.
Data model
New nullable column cancellation_cutoff_hours on {prefix}us_offerings.
New option us_cancellation_cutoff_hours (integer hours) for the studio default.
Schema change → bump USC_VERSION and the plugin header.
Tests
composer test, composer lint, composer cs must all pass.
## Summary
Add a cancellation cutoff so a student can no longer cancel a lesson once it is
too close to its start time. Instructors and studio admins can **always** cancel,
regardless of the cutoff.
## Studio default setting
- A studio-wide default cutoff, configured under **Studio Settings**.
- **Stored and computed in hours**, but **always displayed to the admin in days**
("Students can cancel up to N days before a lesson").
- Sensible default: 1 day (24 hours).
## Per-offering override
- Each offering may set its own cutoff (a time, in hours).
- When an offering's cutoff is **not set**, it falls back to the studio default.
## Enforcement
- Student-initiated cancellation (`POST /bookings/{id}/cancel`) is rejected when
`now` is within the effective cutoff of the slot's start time, returning a clear
message explaining how far in advance cancellations must happen.
- Instructor status changes (`PATCH /bookings/{id}/status`) and studio-admin
student actions are unaffected — they can cancel at any time.
## Data model
- New nullable column `cancellation_cutoff_hours` on `{prefix}us_offerings`.
- New option `us_cancellation_cutoff_hours` (integer hours) for the studio default.
- Schema change → bump `USC_VERSION` and the plugin header.
## Tests
- `composer test`, `composer lint`, `composer cs` must all pass.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add a cancellation cutoff so a student can no longer cancel a lesson once it is
too close to its start time. Instructors and studio admins can always cancel,
regardless of the cutoff.
Studio default setting
("Students can cancel up to N days before a lesson").
Per-offering override
Enforcement
POST /bookings/{id}/cancel) is rejected whennowis within the effective cutoff of the slot's start time, returning a clearmessage explaining how far in advance cancellations must happen.
PATCH /bookings/{id}/status) and studio-adminstudent actions are unaffected — they can cancel at any time.
Data model
cancellation_cutoff_hourson{prefix}us_offerings.us_cancellation_cutoff_hours(integer hours) for the studio default.USC_VERSIONand the plugin header.Tests
composer test,composer lint,composer csmust all pass.