Repository navigation
Releases
v4.0.1 - ClubReservation accepts numeric fields
USAG sends ClubContactID, MeetContactID, ClubContactPhone and MeetContactPhone as JSON numbers. ClubReservation::fromArray() passed them unchanged into ?string parameters, so reservations()->clubs() threw a TypeError for every live sanction.
Fixed
v3.1.2 - ClubReservation accepts numeric fields
USAG sends ClubContactID, MeetContactID, ClubContactPhone and MeetContactPhone as JSON numbers. ClubReservation::fromArray() passed them unchanged into ?string parameters, so reservations()->clubs() threw a TypeError for every live sanction.
Fixed
- Every
ClubReservationtext field now casts JSON numbers to strings. Empty values ('',null,0) staynull, as before. (#6, #7)
Backport to the 3.x line (release/3.x). No breaking changes from v3.1.1.
v4.0.0 - Graceful handling of unrecognized MemberType/MemberStatus codes
Breaking change
AthleteReservation, CoachReservation, JudgeReservation, GroupReservation, and VerificationResult previously used Enum::from() to parse MemberType/MemberStatus from the API, which throws \ValueError on any code the SDK doesn't enumerate. USAG's live vocabulary is wider than what's modeled — deprecated codes like PRO/JPRO are still returned in production, and the same person can get different MemberType codes from different endpoints. One unrecognized code failed the entire response collection, not just that row, and since \ValueError implements \Throwable, a consumer's catch (\Throwable) wrapper would misreport it as an API outage.
What changed:
->memberTypeand->statusare now?MemberType/?MemberStatus—nullwhen USAG returns a code this SDK doesn't model, instead of throwing.DisciplineData::toEnum()now returns?Disciplineinstead of throwing on an unrecognized code.- New
memberTypeRaw/statusRawstring properties are added alongside every widened field, always populated with the original API value — so you can still see or log a code the SDK doesn't recognize yet. canCompete()/canParticipate()-style methods treat anullstatus as "cannot compete" rather than throwing.
Migration: any code reading ->memberType or ->status (or calling DisciplineData::toEnum()) without a null check will need one — e.g. $athlete->status?->canParticipate() ?? false.
Fixes #4
Also investigated, not changed
The issue's side-note claiming RateLimitException is unreachable dead code doesn't hold up — UsaGymException::fromResponse() is called from ResolvesDtoOrThrows, which is used by all four Resources classes, so it is reachable via the normal request flow.
v3.1.0 - TrampolineApparatus enum & typed HTTP exceptions
Added
Enums\Apparatus\TrampolineApparatus(TR/DM/TU) andDiscipline::apparatusEnumClass(), mirroring the existingLevels\*discipline-scoped enum convention.fromApi()accepts both the code and display form and throws on anything unrecognised;tryFromApi()is the non-throwing variant.
Fixed
- Resources now route through
resolveDto()instead of Saloon'sdtoOrFail(), so failed HTTP responses raise the SDK's typed exception hierarchy (AuthenticationException,NotFoundException,ValidationException,RateLimitException,ApiException) carrying the real HTTP status, instead of a generic "unable to create DTO" error that hid it. UsaGymException::fromResponse()no longer fatals when the failing response body isn't parseable JSON (e.g. an emptytext/html500).
Behavioral note
Code that previously caught \LogicException from dtoOrFail() will now receive a UsaGymException subclass instead.
Full diff: v3.0.0...v3.1.0
v2.3.0
What's Changed
- Added
Genderenum with flexible parsing for athlete gender data - Added
genderproperty toAthleteReservationdata class - Fixed composer.json for proper Packagist version detection
Full Changelog: v2.2.0...v2.3.0
v2.2.0 - PHP 8.3+ Required
Breaking Change
PHP 8.3+ is now required.
This aligns the package requirements with:
- Pest v4 (test framework) which requires PHP 8.3+
- CI test matrix which runs on PHP 8.3 and 8.4
If you need PHP 8.1/8.2 support, use v2.1.x.
Full Changelog: v2.1.4...v2.2.0
v2.1.4 - CI/CD & README Badges
What's New
GitHub Actions CI/CD
Added automated testing workflow that runs on every push and pull request:
- Test Matrix: PHP 8.1, 8.2, and 8.3
- Static Analysis: PHPStan checks
README Badges
Added status badges to the README:
Full Changelog: v2.1.3...v2.1.4
v2.1.3 - Fix Clubs Endpoint
Bug Fix
Fixed the clubs reservations endpoint URL:
- Before:
/sanction/{id}/reservations/club(404 error) - After:
/sanction/{id}/reservations/clubs(works correctly)
The API documentation specifies the plural form /reservations/clubs, but the SDK was incorrectly using the singular form.
Full Changelog: v2.1.2...v2.1.3
v2.1.2 - Unique Athlete Counts & Graceful 404 Handling
What's New
Unique Athlete Counts
The usagym:test command now displays unique athletes by member ID, since athletes may have multiple registrations for different events:
Athlete Reservations: 186 unique athletes (541 registrations)
Sample athletes (first 5 unique):
┌───────────┬───────────────┬───────┬─────────────┐
│ Member ID │ Name │ Level │ Can Compete │
├───────────┼───────────────┼───────┼─────────────┤
│ 2426288 │ Seth Astorga │ 5 │ Yes │
│ 2299938 │ Travis Greene │ 8 │ Yes │
...
Graceful Handling of Unavailable Endpoints
The clubs endpoint returns 404 for some sanction types (e.g., MAG). This is now handled gracefully with a "SKIP" status instead of failing:
Club reservations endpoint not available for this sanction type.
+----------------------+--------+------------------------------------------------+
| Test | Status | Details |
+----------------------+--------+------------------------------------------------+
| Club Reservations | SKIP | Endpoint not available for this sanction type |
...
Full Changelog: v2.1.1...v2.1.2
v2.1.1 - Debug Flag & Improved Error Handling
What's New
Debug Mode
Added --debug flag to the usagym:test command for troubleshooting API connection issues:
php artisan usagym:test --debugShows detailed request/response information:
- HTTP method and URL
- Request headers (Authorization header partially masked)
- Response status code
- Response headers
- Response body (first 500 characters)
Improved Error Handling
- Better error messages when API requests fail
- Shows actual HTTP status code and response body
- Catches all exceptions to prevent uncaught errors
Full Changelog: v2.1.0...v2.1.1