Search by

helsingborg-stad / api-internal-events-manager

sebastianthulin

Creates an api for internal offerings such as courses, workshops and bookable activities for schools.

Package info

github.com/helsingborg-stad/api-internal-events-manager

Type:wordpress-plugin

pkg:composer/helsingborg-stad/api-internal-events-manager

Statistics

Installs: 13

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.5 2026-12-02 09:36 UTC

This package is auto-updated.

Last update: 2026-12-02 09:36:46 UTC


README

Working name. The final name is decided before production.

WordPress plugin that creates an API for internal offerings such as courses, workshops and bookable activities for schools. It is built like api-event-manager and runs on a Municipio site.

Data model

Post type offering, available at /wp-json/wp/v2/offerings.

Everything that should be filterable is a taxonomy, since the WordPress REST API filters on taxonomies out of the box, e.g. /wp/v2/offerings?school-form=12&subject=4.

Taxonomy Purpose
offering-type Upcoming dates or on demand
school-form Preschool, F-3, 4-6, 7-9, upper secondary …
participants With or without students
staff-role Teachers, school leaders, student health …
subject School subjects
label E.g. digital, limited number of seats
organization Organizers

The remaining data are ACF fields, returned under acf in the REST response (add acf_format=standard for formatted dates and term objects):

  • Presentation: images, video, url
  • Place: attendancemode (offline, online, mixed), locationType, locationName, locationAddress, onlineAttendenceUrl
  • Time: occasions (date, startTime, endTime, description), availabilityText, availableFrom, availableUntil, bookingPeriod
  • Registration: registrationDeadlines, registrationMethod, registrationUrl, registrationEmail, registrationInfo
  • Price: isFree, pricesList (priceLabel, price, unit), priceInfo

Fields that also exist in api-event-manager use the same names (url, images, attendancemode, locationName, locationAddress, onlineAttendenceUrl, occasions, pricesList), so the event mappers in schema.org-transformer can be reused.

Field groups live in source/php/AcfFields/ and are loaded with acf-export-manager.

Development

composer install
composer test
composer php:lint

Translations:

composer make-pot && composer update-po && composer make-mo

Test data

Seeds the pilot examples on a local site (replaces earlier seeded posts):

wp eval-file wp-content/plugins/api-internal-events-manager/scripts/seed-test-data.php --url=localhost:8080/pc/

Deploy

Releases follow the same flow as api-sponsor-manager. Pushes to main and manual runs of Publish Composer release create semantic-versioned releases from Git history (GitVersion). The workflow updates the version in the plugin header, runs the tests and publishes api-internal-events-manager-<version>.zip. Version commits do not trigger another release.

The ZIP is for Composer, not direct WordPress installation. It contains the runtime source and translations, but no vendor/ directory: the consuming project installs the PHP dependencies, so shared packages such as wpservice are loaded once, in the same version as the theme. Load the project's Composer autoloader before WordPress loads this plugin (municipio-deployment does this in wp-config.php). A source checkout uses its own vendor/autoload.php after composer install.

The package must be registered on Packagist. After a release, check that it is indexed with bash scripts/check_packagist_release.sh <version>.

Release tooling tests:

python3 -m unittest discover -s scripts -p 'test_*.py'

License

MIT