Implement UiTDatabank event synchronization and upgrade UiTPAS to v2 API#45
Implement UiTDatabank event synchronization and upgrade UiTPAS to v2 API#45Copilot wants to merge 10 commits into
Conversation
- Add OAuth2 client credentials authentication support to UitDatabankService - Implement event synchronization in UitDBEvents using Entry API v3 (JSON) - Upgrade UiTPASVerifier to support new UiTPAS JSON API v2 with fallback to legacy XML API - Add new environment URLs for UiTPAS API and OAuth2 auth endpoints - Update config and .env.example with new UITDB_CLIENT_ID and UITDB_CLIENT_SECRET settings - Update UitDBService contract with getEventService method - Update readme documentation to reflect new capabilities - Add unit tests for new functionality
|
@copilot add support for uploading images / photos to uitdatabank |
Implemented in commit |
|
@copilot add github CI integration to run the tests |
Added in |
|
@copilot fix github ci testrunner (by making sure you are using docker-compose and the migrations run) |
Fixed. The CI workflow now uses |
|
@copilot fix |
The CI runner doesn't have the standalone |
|
@copilot fix |
The webserver container was crashing because the |
Events should sync to UiTDatabank automatically, and the UiTPAS integration needs to move from the legacy OAuth1/XML API to the newer OAuth2/JSON API (v2).
Changes
OAuth2 client credentials auth —
UitDatabankServicegainsgetOAuth2Token()with expiration-aware caching, plusentryApiRequest()anduitpasApiRequest()helpers for the new APIs. New env URLs forapi.uitpas.beandaccount.uitid.be.Event synchronization (
UitDBEvents) — Replaces the stubupload()with a real implementation that creates/updates events via Entry API v3. Builds JSON payload with calendar (single/multiple subEvents), location, description, and priceInfo from ticket categories. Persistsuitdb_event_idon successful creation.Image/photo upload — After creating or updating an event, the
upload()method automatically syncs the event's poster and logo images to UiTDatabank. Images are uploaded viaPOST /images(media object by URL) and then linked to the event viaPOST /events/{id}/images.UiTPAS v2 (
UiTPASVerifier) — New JSON-based methods for tariff lookup (GET /events/{id}/tariffs), ticket sale registration (POST /ticket-sales), cancellation (DELETE /ticket-sales/{id}), and check-in (POST /events/{id}/checkins). Legacy XML/OAuth1 methods retained as fallback when client credentials aren't configured.Config — Added
UITDB_CLIENT_IDandUITDB_CLIENT_SECRETto.env.exampleandconfig/services.php. System auto-selects v2 when these are present.GitHub Actions CI — Added
.github/workflows/tests.ymlthat usesdocker compose(v2 plugin) to build and start the application and MySQL containers, runs database migrations, then executes PHPUnit tests inside the webserver container.