Add group-class withdrawal deadline and kind-aware offering form #108

Merged
thatguygriff merged 1 commits from feature/group-class-withdrawal-deadline into main 2026-07-24 19:01:49 +00:00
Owner

Summary

Two changes for the unreleased 1.2.0:

1. Per-class withdrawal deadline

Group classes now carry an optional withdrawal_deadline. Up to that day a student may withdraw themselves from a class they are enrolled in (the group-class page shows a Withdraw button). A timely withdrawal frees the seat and voids any pending payment but never issues an account credit — a clean exit, not a refund. After the deadline self-withdrawal closes (403 withdrawal_closed) and a studio admin must withdraw the student by hand from the student detail page; the admin path is never subject to the deadline. Unlike the enrolment deadline it has no implicit default — a blank deadline keeps self-withdrawal open indefinitely.

  • New nullable us_offerings.withdrawal_deadline column; Offering gains $withdrawalDeadline + isWithdrawalOpen().
  • New POST /enrollments/{id}/withdraw endpoint: deadline-gated, ownership-checked, idempotent for already-cancelled enrolments.
  • Editable per class on the offering form.

2. Kind-aware offering form

The Add/Edit Offering form now shows only the fields relevant to the selected kind — group settings (capacity, dates, times, enrolment/withdrawal deadlines, sessions, schedule note, invite-only) for group classes, and the weekly-reservation option for private lessons. Progressive enhancement: without JS every field still renders.

Notes

  • No USC_VERSION bump. Schema.php changed, but 1.2.0 is unreleased and its other schema features (scheduled billing, credits) accumulated under the same section without bumping; bumping now would misalign the release workflow. Existing sites (on 1.1.1) pick up the column on the 1.2.0 upgrade.

Tests

  • composer test — 596 tests pass
  • composer lint (PHPStan level 10) — clean
  • composer cs (PHPCS) — clean

🤖 Generated with Claude Code

## Summary Two changes for the unreleased 1.2.0: ### 1. Per-class withdrawal deadline Group classes now carry an optional `withdrawal_deadline`. Up to that day a student may withdraw **themselves** from a class they are enrolled in (the group-class page shows a **Withdraw** button). A timely withdrawal frees the seat and voids any pending payment but **never issues an account credit** — a clean exit, not a refund. After the deadline self-withdrawal closes (`403 withdrawal_closed`) and a studio admin must withdraw the student by hand from the student detail page; the admin path is never subject to the deadline. Unlike the enrolment deadline it has no implicit default — a blank deadline keeps self-withdrawal open indefinitely. - New nullable `us_offerings.withdrawal_deadline` column; `Offering` gains `$withdrawalDeadline` + `isWithdrawalOpen()`. - New `POST /enrollments/{id}/withdraw` endpoint: deadline-gated, ownership-checked, idempotent for already-cancelled enrolments. - Editable per class on the offering form. ### 2. Kind-aware offering form The Add/Edit Offering form now shows only the fields relevant to the selected kind — group settings (capacity, dates, times, enrolment/withdrawal deadlines, sessions, schedule note, invite-only) for group classes, and the weekly-reservation option for private lessons. Progressive enhancement: without JS every field still renders. ## Notes - **No `USC_VERSION` bump.** `Schema.php` changed, but 1.2.0 is unreleased and its other schema features (scheduled billing, credits) accumulated under the same section without bumping; bumping now would misalign the release workflow. Existing sites (on 1.1.1) pick up the column on the 1.2.0 upgrade. ## Tests - `composer test` — 596 tests pass - `composer lint` (PHPStan level 10) — clean - `composer cs` (PHPCS) — clean 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 1 commit 2026-07-24 18:57:51 +00:00
Add group-class withdrawal deadline and kind-aware offering form
CI / Tests (PHP 8.1) (pull_request) Successful in 44s
CI / Tests (PHP 8.2) (pull_request) Successful in 59s
CI / No Debug Code (pull_request) Successful in 3s
CI / Coding Standards (pull_request) Successful in 2m53s
CI / PHPStan (pull_request) Successful in 2m55s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m41s
CI / Build Plugin Zip (pull_request) Skipped
2c4b481077
Group classes now carry an optional per-class withdrawal deadline. Up to
that day a student may withdraw themselves from the class; the withdrawal
frees the seat and voids any pending payment but never issues an account
credit. After the deadline self-withdrawal closes and a studio admin must
withdraw the student by hand (the admin path is never subject to the
deadline). A blank deadline keeps self-withdrawal open indefinitely.

Also make the Add/Edit Offering form show only the fields relevant to the
selected kind: group settings for group classes, weekly reservation for
private lessons. Progressive enhancement — without JS every field renders.

- New nullable us_offerings.withdrawal_deadline column; Offering model gains
  $withdrawalDeadline + isWithdrawalOpen().
- New student endpoint POST /enrollments/{id}/withdraw, gated by the deadline
  (403 withdrawal_closed), ownership-checked, idempotent.
- Front-end group-class page shows a Withdraw button while open.
- No USC_VERSION bump: 1.2.0 is unreleased and accumulates schema changes
  under its section, matching the scheduled-billing and credit features.

Tests: composer test (596), composer lint, composer cs all pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
thatguygriff merged commit fae1fd08ba into main 2026-07-24 19:01:49 +00:00
thatguygriff deleted branch feature/group-class-withdrawal-deadline 2026-07-24 19:01:49 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#108