feat: Instant Book: Added strategy where busy intervals are retrieved from calendar feed#434
Merged
Merged
Conversation
…d deprecation output in phpunit output
…ings when the resource allows double bookings
Bad values now throw InvalidArgumentException (→ 500) on first instantiation instead of NotAcceptableException (→ 406) at action time. The match default arm is dropped as unreachable given the constructor guard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Null feed, null feed source, and non-calendar feed type on the slide are admin-fixable data issues, not Accept-header negotiation failures. Replaced NotAcceptableException with Symfony's UnprocessableEntityHttpException so they surface as 422 without a custom exception class or yaml mapping. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The resources used here are not configured to block conflicting bookings at the Graph API level — a POST that conflicts will simply succeed rather than return 409. The pre-check is the actual safeguard; the 409 catch is just a backstop for resources whose AutomateProcessing setting does reject conflicts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The cache wrapping getBusyIntervals() used a fixed key, so concurrent requests with different watched resources or time windows could read each other's data — a second slide would see the first slide's resources and report unbooked rooms as free for up to 15 minutes. Extracted the cached path into getBusyIntervalsCached() and built the key from the sorted resource set plus from/to at minute precision. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extracted the live-Graph pre-check from quickBook() into assertSlotFree() so the conflict-throw branch can be exercised without standing up the full quickBook plumbing (spam-protect cache, validateResourceAccess, getToken). Added two tests: a busy schedule overlapping the requested window must throw ConflictException; an empty schedule must pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Local review follow-upWorked through the review findings on this branch. Five commits pushed on top of the original head ( Fixed
Verified safe (no change needed)
Out of scope / FYI
Tooling: validated via |
turegjorup
approved these changes
May 27, 2026
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.
NB! Builds on #433
Link to issue
#436
Link to ticket
https://leantime.itkdev.dk/#/tickets/showTicket/7208
Description
Checklist