fix #2126 filter commonsbooking_isCurrentUserAdmin not granting edit permissions - #36
Open
datengraben wants to merge 171 commits into
Open
fix #2126 filter commonsbooking_isCurrentUserAdmin not granting edit permissions#36datengraben wants to merge 171 commits into
datengraben wants to merge 171 commits into
Conversation
…nting edit permissions
…e-2143 wielebenwir#2143 filter hook for gbfs feed announcement
…e-2156 GBFS: refactor every response to go through same validation function
…ork for uneven amount of days
…or uneven amount of days
wielebenwir#2158 BookingRule::checkMaxBookingDays does not work for uneven amount of days
…#2167) Bumps [@wordpress/env](https://github.com/WordPress/gutenberg/tree/HEAD/packages/env) from 11.3.0 to 11.4.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/env/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/env@11.4.0/packages/env) --- updated-dependencies: - dependency-name: "@wordpress/env" dependency-version: 11.4.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.13.1 to 15.14.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](cypress-io/cypress@v15.13.1...v15.14.0) --- updated-dependencies: - dependency-name: cypress dependency-version: 15.14.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [grunt](https://github.com/gruntjs/grunt) from 1.6.1 to 1.6.2. - [Release notes](https://github.com/gruntjs/grunt/releases) - [Changelog](https://github.com/gruntjs/grunt/blob/main/CHANGELOG) - [Commits](gruntjs/grunt@v1.6.1...v1.6.2) --- updated-dependencies: - dependency-name: grunt dependency-version: 1.6.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [prettier](https://github.com/prettier/prettier) from 3.8.1 to 3.8.3. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](prettier/prettier@3.8.1...3.8.3) --- updated-dependencies: - dependency-name: prettier dependency-version: 3.8.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sass](https://github.com/sass/dart-sass) from 1.97.3 to 1.99.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](sass/dart-sass@1.97.3...1.99.0) --- updated-dependencies: - dependency-name: sass dependency-version: 1.99.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [vue](https://github.com/vuejs/core) from 3.5.30 to 3.5.33. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](vuejs/core@v3.5.30...v3.5.33) --- updated-dependencies: - dependency-name: vue dependency-version: 3.5.33 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…-tests tests/gbfs route tests
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.14.0 to 15.14.1. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](cypress-io/cypress@v15.14.0...v15.14.1) --- updated-dependencies: - dependency-name: cypress dependency-version: 15.14.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…at were not a question before for consistency. Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…esBookingCodes().
* Revert "fix wielebenwir#2204: api routes could not be validated when api key was present" This reverts commit 617cef5. * wielebenwir#2251 support passing apikey by header * wielebenwir#2251 make independent from existence of apache getallheaders fn
Bumps [cypress](https://github.com/cypress-io/cypress) from 15.17.0 to 15.18.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md) - [Commits](cypress-io/cypress@v15.17.0...v15.18.0) --- updated-dependencies: - dependency-name: cypress dependency-version: 15.18.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v5...v6) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ng offset is set
wielebenwir#2253 fix available_until incorrect when booking offset is defined
…booking-extensibility-plan-pi6u5y
Audits the current hook/filter surface, identifies the booking lifecycle as the critical extensibility gap, and proposes a phased catalog of actions and filters so third parties can adapt CommonsBooking to their specific booking use case (smart locks, vehicle sharing, custom pricing) without forking core or overriding templates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Introduces action hooks so extensions can react to the booking lifecycle
without overriding templates or forking core:
* commonsbooking_booking_created - once, when a booking first
enters a real status
* commonsbooking_booking_confirmed - when a booking becomes confirmed
* commonsbooking_booking_cancelled - when a booking is cancelled
* commonsbooking_booking_status_changed - on every status transition
created/confirmed/status_changed are dispatched from a new
Service\BookingLifecycle listening on WordPress' transition_post_status,
so they fire once per real transition regardless of origin (frontend
calendar, admin backend, REST API, WP-CLI). Cancellation writes the status
directly to the database to preserve meta, so it is owned by
Model\Booking::cancel(), which fires commonsbooking_booking_cancelled.
Each hook passes the booking ID and the Model\Booking instance
(status_changed also passes old and new status). This addresses the
long-standing request for a post-booking action hook (e.g. smart-lock
integrations).
Adds PHPUnit coverage for each hook and documents them (EN + DE).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations override the default booking cancellation policy (e.g. enforce a notice period or allow a custom role). Passes the default decision and the Model\Booking instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations adjust or add meta data on the post array just before a booking is inserted or updated. Passes the wp_insert/update_post array and the existing Model\Booking (or null for a new booking). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations add custom booking-window rules on top of the default advance-booking-days check. Passes the default decision and the Model\Timeframe instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations add, remove or adjust the bookable slots computed for a single day (e.g. to reflect an external availability source). Passes the slots array and the Model\Day instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations restrict or extend which timeframes are offered for booking. Passes the bookable timeframes and the location/item IDs the query was scoped to. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations adjust the data array that drives the frontend booking calendar (and its AJAX endpoint) before it is rendered or returned as JSON. Passes the calendar data and the item and location it is for. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations add or adjust fields exposed for an item in the CommonsAPI. Passes the prepared item object and the source WP_Post. Gives the CommonsAPI item response the same extensibility GBFS feeds already have. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Lets integrations adjust the availability slots exposed through the CommonsAPI (e.g. to reflect an external booking source). Passes the slots array and the requested item ID (or null for all items). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can both forbid an otherwise-allowed cancellation and allow one that is denied by default, and that it receives the Model\Booking instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can add meta that is persisted with a newly created booking, and that it receives null as the existing-booking argument for a new booking. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can override the default bookable decision and receives the Model\Timeframe instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can adjust the slots computed for a day and receives the Model\Day instance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the returned timeframe list is exactly what the filter produces and that the filter receives the location/item scope of the query. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter's change to the calendar data is reflected in the returned payload and that the filter receives the item and location. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can change an item field returned by the CommonsAPI and receives the source WP_Post. Modifies an in-schema field so response validation still passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Asserts the filter can clear the availability slots returned by the CommonsAPI and receives the requested item ID. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Registers CommonsBooking as an Uncanny Automator integration with a single anonymous trigger, "A booking is confirmed", built on the commonsbooking_booking_confirmed lifecycle action. This lets site owners build no-code recipes (send an email, call a webhook, program a smart lock) when a booking is confirmed, exposing tokens for the booking ID, item, location, start/end, booking code, user email and booking URL. The integration is an optional compatibility layer: it lives outside the PSR-4 src/ tree and only loads on Automator's automator_add_integration hook behind a class_exists guard, so it adds no overhead and no hard dependency when Automator is not installed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
Adds a second Automator trigger, "A booking is cancelled", built on the existing commonsbooking_booking_cancelled action, so cancellations can be routed to any messaging gateway Automator supports (Twilio SMS, Slack, Telegram, …) — e.g. alerting the volunteer team that an item has freed up. Shared token definition/hydration is extracted into a Booking_Tokens trait used by both the confirmed and cancelled triggers, and a new CB_BOOKING_USER_PHONE token is exposed so recipes can send SMS to the booking user (read from the CommonsBooking 'phone' user meta). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtwgtNchR1acXMrTMSw9zo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.