Skip to content

Add scope Booking wrappers#475

Draft
fatestr1ngs wants to merge 1 commit into
bitrix24:devfrom
fatestr1ngs:feature/473-add-booking-scope
Draft

Add scope Booking wrappers#475
fatestr1ngs wants to merge 1 commit into
bitrix24:devfrom
fatestr1ngs:feature/473-add-booking-scope

Conversation

@fatestr1ngs
Copy link
Copy Markdown

Q A
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #473
License MIT

This PR adds support for the Booking scope in the PHP SDK.

  • Added the Booking scope builder and typed services for booking, waitlist, resource, resource type, resource slots, client type, booking client, booking external data, waitlist client, and waitlist external data methods.
  • Added typed result DTOs for Booking entities and operation results.
  • Added integration coverage for CRUD flows and dedicated annotation validation tests for Booking result items.
  • Wired the new Booking tests into the PHPUnit testsuite and Makefile target.
  • Updated the Booking client type contract to match the live API response shape returned by the portal.

Example usage:

$builder = ServiceBuilderFactory::createServiceBuilderFromWebhook($webhookUrl);
$bookingScope = $builder->getBookingScope();

$resourceTypeId = $bookingScope->resourceType()->add([
    'code' => 'room',
    'name' => 'Room',
])->getId();

$resourceId = $bookingScope->resource()->add([
    'typeId' => $resourceTypeId,
    'name' => 'Room A',
])->getId();

$bookingId = $bookingScope->booking()->add([
    'name' => 'Consultation',
    'resourceIds' => [$resourceId],
    'datePeriod' => [
        'from' => ['timestamp' => time() + 3600, 'timezone' => 'Europe/Berlin'],
        'to' => ['timestamp' => time() + 5400, 'timezone' => 'Europe/Berlin'],
    ],
])->getId();

$booking = $bookingScope->booking()->get($bookingId);

Quality-gate checklist

  • make lint-cs-fixer
  • make lint-phpstan
  • make lint-rector
  • make test-unit
  • make test-integration-scope-booking
  • docker-compose run --rm php-cli vendor/bin/phpstan analyse tests/Integration/Services/Booking

Closes #473

@fatestr1ngs fatestr1ngs marked this pull request as draft May 19, 2026 14:39
@fatestr1ngs
Copy link
Copy Markdown
Author

I have created a new "clean" v3-dev branch in accordance with the instructions:
#476

I will close this PR.

@fatestr1ngs fatestr1ngs reopened this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant