Add Offerings domain and studio-admin capabilities #10

Merged
thatguygriff merged 1 commits from feature/offerings into main 2026-06-05 13:49:38 +00:00
Owner

Implements #1 (Offerings) plus the capability slice of #9 (Studio Admin role).

What's included

  • src/Offering/ domainOffering value object, OfferingRepository (CRUD + filters), OfferingEndpoint (REST), OfferingController + templates/admin/offerings.php
  • us_offerings table in Schema.php (kind, title, duration, price/currency, billing_mode one_time/full_term, allow_weekly, capacity, term dates, schedule_note, is_active)
  • Studio admin caps in Auth/RoleManager — new us_studio_admin role and capability strings (manage_instructors, manage_offerings, manage_questions, manage_policies, manage_billing, view_all_payments, view_own_payments, export_payments); instructor granted manage_offerings
  • WiringPlugin, RestRegistrar, AdminMenu register the new components; Offerings admin menu page

REST API

Method Endpoint Permission
GET /offerings public (active only)
POST /offerings manage_offerings
PATCH /offerings/{id} manage_offerings + owner/studio-admin
DELETE /offerings/{id} manage_offerings + owner/studio-admin

Tests

  • tests/Unit/Offering/ — value object + repository (14 tests)
  • Studio-admin case added to RoleManagerTest
  • composer test (44 tests), composer cs, and PHPStan level 6 all pass

Note: composer lint needs --memory-limit=512M on some machines (default 128M crashes the parallel worker).

Refs #1 #9

🤖 Generated with Claude Code

Implements **#1 (Offerings)** plus the capability slice of **#9 (Studio Admin role)**. ## What's included - **`src/Offering/` domain** — `Offering` value object, `OfferingRepository` (CRUD + filters), `OfferingEndpoint` (REST), `OfferingController` + `templates/admin/offerings.php` - **`us_offerings` table** in `Schema.php` (kind, title, duration, price/currency, billing_mode `one_time`/`full_term`, allow_weekly, capacity, term dates, schedule_note, is_active) - **Studio admin caps** in `Auth/RoleManager` — new `us_studio_admin` role and capability strings (`manage_instructors`, `manage_offerings`, `manage_questions`, `manage_policies`, `manage_billing`, `view_all_payments`, `view_own_payments`, `export_payments`); instructor granted `manage_offerings` - **Wiring** — `Plugin`, `RestRegistrar`, `AdminMenu` register the new components; **Offerings** admin menu page ## REST API | Method | Endpoint | Permission | |---|---|---| | GET | `/offerings` | public (active only) | | POST | `/offerings` | `manage_offerings` | | PATCH | `/offerings/{id}` | `manage_offerings` + owner/studio-admin | | DELETE | `/offerings/{id}` | `manage_offerings` + owner/studio-admin | ## Tests - `tests/Unit/Offering/` — value object + repository (14 tests) - Studio-admin case added to `RoleManagerTest` - `composer test` (44 tests), `composer cs`, and PHPStan level 6 all pass > Note: `composer lint` needs `--memory-limit=512M` on some machines (default 128M crashes the parallel worker). Refs #1 #9 🤖 Generated with [Claude Code](https://claude.com/claude-code)
thatguygriff added 1 commit 2026-06-05 13:35:27 +00:00
Add Offerings domain and studio-admin capabilities
CI / Coding Standards (pull_request) Successful in 55s
CI / PHPStan (pull_request) Successful in 1m0s
CI / Tests (PHP 8.1) (pull_request) Successful in 50s
CI / Tests (PHP 8.2) (pull_request) Successful in 46s
CI / Tests (PHP 8.3) (pull_request) Successful in 50s
CI / No Debug Code (pull_request) Successful in 2s
36331388d1
Implements the offerings catalog (#1): private-lesson types and group
classes carrying pricing, billing mode (one_time/full_term), duration,
capacity, and term details. Adds the src/Offering/ domain (value object,
repository, REST endpoint, admin controller + template), the us_offerings
table, and an Offerings admin page.

Also lands the capability slice of #9: registers the us_studio_admin role
and the new capability strings (manage_instructors, manage_offerings,
manage_questions, manage_policies, manage_billing, view_all_payments,
view_own_payments, export_payments) so offering management gates correctly.

Tests: tests/Unit/Offering/ (value object + repository) and a studio-admin
case in RoleManagerTest. composer test, cs, and PHPStan level 6 all pass.

Refs #1 #9

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
thatguygriff merged commit 5b6cc4e89b into main 2026-06-05 13:49:38 +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#10