- Status: Ready for implementation
- Audit snapshot: 2026-07-16
- Documentation repository baseline:
608bb35 - Backend repository baseline:
22e478446e8(origin/master) - Scope:
https://api.alteg.io/api/v2anddocs/en/b2b-v2/openapi.yaml
Expand the published B2B v2 reference without accidentally promoting internal backoffice routes to the public contract.
The next session must:
- publish canonical Location URLs for Tags and Positions;
- refresh and classify the 28-operation documentation gap;
- publish at least the safe Waiting List read surface; and
- publish the complete Waiting List group only when a controlled fixture makes positive write verification safe.
Minimum success increases coverage from 32 of 60 operations to 34 of 60. Target success increases it to 39 of 60.
The backend registers 60 /api/v2 operations in two route files:
- 53 operations in
src/Application/Http/Routing/Routes/api/api_v2.php; - 7 operations in
src/Application/Http/Routing/Routes/api/modules/waiting_list.php.
The published B2B v2 reference contains 22 paths and 32 operations:
| Method | Backend | Published | Gap |
|---|---|---|---|
| GET | 35 | 18 | 17 |
| POST | 10 | 5 | 5 |
| PUT | 6 | 4 | 2 |
| PATCH | 2 | 1 | 1 |
| DELETE | 7 | 4 | 3 |
| Total | 60 | 32 | 28 |
The 28 unpublished operations currently fall into these groups:
| Candidate group | Operations | Initial handling |
|---|---|---|
| Waiting List | 7 | First public expansion candidate |
| Attendance and related statistics | 10 | Classify before publication |
| Attendance Services | 4 | Classify before publication |
| Comer Vehicles | 4 | Treat as internal until proven otherwise |
| Units, Resource Occupations, Custom Fields | 3 | Assess as public reference data |
This is a mechanical route inventory, not proof that all 60 operations belong in the public B2B contract.
- Every request must send
Accept: application/vnd.api.v2+jsonand combined Partner plus Business User authorization. - Backend routes are registered under
/locations/{locationId}. ApiUrlAliasRewriteMiddlewaremaps the compatibility segmentcompaniesto the canonical segmentlocations.- Production currently resolves both Tags and Positions URL forms through the authentication layer.
- The published spec still uses
/companies/{company_id}for the ten Tags and Positions operations. - Canonical prose uses Location, Team Member, Appointment, Booking User, and Business User.
- Literal SDK-facing parameter names such as
company_idremain unchanged and are described with canonical domain terminology. - Literal wire values such as
good,staff,record,activity, andclientmust remain unchanged and be identified as wire values.
An unauthenticated 401 proves route reachability only. It does not prove that two URLs return the same successful contract.
- Work only in B2B v2 files and the related validation workflows.
- Do not document an endpoint merely because it is registered under
/api/v2. - Treat Vue-only consumers, backoffice-specific state, and unstable internal handlers as evidence against public publication.
- Use production behavior as the source of truth, supported by current PHP controllers, transformers, services, and integration tests.
- Preserve literal request keys, response keys, enum values, resource types, and compatibility aliases.
- Do not expose credentials, personal data, or raw production payloads.
- Do not create or modify a Booking User or Waiting List entry without a controlled fixture and an explicit cleanup path.
- Keep documented, source-verified, live-verified, and blocked evidence separate.
Before editing, fetch both repositories and recount from their current default branches. Do not assume the snapshot above is still current.
For every backend operation, record:
- HTTP method and canonical route;
- route name and controller;
- existing OpenAPI operation ID, if any;
- known application consumers;
- authentication and permission middleware;
- integration-test coverage;
- candidate classification:
public,internal, orneeds decision; - evidence level: source-only, integration-tested, route-reachable, or positive production response.
Save the refreshed table in this plan or a sibling dated inventory file. The published coverage denominator must include only approved public operations; also retain the raw 60-operation denominator for engineering visibility.
Perform authenticated read checks for both forms:
/api/v2/locations/{company_id}/tags
/api/v2/companies/{company_id}/tags
/api/v2/locations/{company_id}/positions
/api/v2/companies/{company_id}/positionsIf the canonical Location URLs return the same successful resources:
- publish only
/locations/{company_id}/tagsand/locations/{company_id}/positionsas primary paths; - rename the four path files from
company.*tolocation.*; - preserve the literal
company_idOpenAPI parameter name and describe it as the Location identifier; - keep
/companies/{company_id}in a short compatibility note instead of duplicating ten OpenAPI operations; - keep operation IDs and verified wire payloads stable;
- update any Arazzo or validation reference that hard-codes the old URL.
If an authenticated canonical request fails, stop this step and record the exact production/backend mismatch. Do not change the spec based only on the unauthenticated route check.
The backend exposes:
GET /locations/{location_id}/waiting_list
GET /locations/{location_id}/waiting_list/count
POST /locations/{location_id}/waiting_list
GET /locations/{location_id}/waiting_list/{waiting_list_entry_id}
PUT /locations/{location_id}/waiting_list/{waiting_list_entry_id}
POST /locations/{location_id}/waiting_list/{waiting_list_entry_id}/finish
DELETE /locations/{location_id}/waiting_list/{waiting_list_entry_id}Start with the two collection reads because they do not require mutation:
- verify positive list and count responses in production;
- reconcile the responses with the current controllers, transformers, and integration tests;
- replace stale prose such as Client with Booking User while keeping literal
clientandstaffwire names in code formatting; - add 401, 403, and 404 responses plus the actual validation responses;
- register only the verified GET operations in
docs/en/b2b-v2/openapi.yaml; - add both reads to the safe Arazzo workflow and require
200, never404, as proof of availability.
Minimum acceptance for this step is 34 published operations with no unverified write contract implied by the reference.
Before documenting the remaining five operations as production-verified, confirm all of the following:
- a controlled test Booking User is available;
- create and update cannot change real customer data;
- finish does not send a notification or trigger an unsafe workflow;
- a unique run marker can identify the temporary entry;
- delete is available as cleanup after every post-create failure;
- a final list query can prove that the entry no longer exists.
When those conditions hold:
- run create, read, update, finish, and delete against the controlled fixture;
- capture only sanitized shapes and validation behavior;
- finish the request and response schemas from observed production behavior;
- register all five operations;
- add a self-cleaning Arazzo CRUD workflow with failure cleanup; and
- verify that no temporary entry remains.
If any safety condition is missing, stop at the read-only expansion. Document the exact missing fixture or safety guarantee. Do not substitute a 404 probe for a positive write contract.
Target acceptance for this step is 39 published operations.
After Waiting List, rank the remaining groups using these criteria:
- confirmed external integration use;
- stable controller and transformer contract;
- clear Partner and Business User authorization semantics;
- safe positive production verification;
- canonical domain terminology;
- maintainable Arazzo coverage;
- absence of backoffice-only state or UI coupling.
Recommended investigation order:
- Units, Resource Occupations, and Custom Fields;
- Attendance Services;
- Attendance reads and statistics;
- Comer Vehicles;
- Attendance mutations, pins, and other UI-state operations.
Do not increase the public denominator for routes classified as internal. Record that exclusion explicitly so later audits do not repeatedly rediscover the same routes.
Documentation repository:
docs/en/b2b-v2/openapi.yamldocs/en/paths/tags/v2/*.ymldocs/en/paths/positions/v2/*.ymldocs/en/paths/waiting_list/*.ymldocs/en/schemas/waiting_list/*.ymldocs/api-fast-check-b2b-v2.arazzo.yamldocs/api-crud-check-b2b-v2.arazzo.yamlscripts/check-b2b-v2-arazzo.mjs
Backend repository:
src/Application/Http/Routing/Routes/api/api_v2.phpsrc/Application/Http/Routing/Routes/api/modules/waiting_list.phpsrc/Application/Http/Routing/ApiPathAliasRegistry.phpsrc/Application/Http/Middleware/Api/ApiUrlAliasRewriteMiddleware.php- Waiting List controllers, transformers, services, and integration tests
Read every target file before changing it and search for references before renaming any path file.
Run at minimum:
npm test
./node_modules/.bin/redocly lint docs/en/b2b-v2/openapi.yaml
tools/content-scan.sh
git diff --checkIf Arazzo changes:
make test-api-b2b-v2Also:
- recount source and bundled paths and operations;
- verify every newly published operation has 401, 403, and 404;
- inspect the rendered Tags, Positions, and Waiting List pages;
- search prose for Company, Client, Staff, Record, Good, and Activity, allowing them only as explicitly identified wire literals or compatibility paths;
- report production writes and cleanup separately from lint and source review.
- Tags and Positions publish canonical Location URLs after authenticated proof.
- Compatibility
/companiesURLs remain explained without duplicated methods. - The raw backend inventory and the approved public denominator are both known.
- At least the two Waiting List collection reads are published and live-verified.
- Full Waiting List CRUD is published only when controlled positive verification and cleanup are complete.
- Every remaining route is marked public, internal, or needs decision.
- Redocly reports no B2B v2 warnings and the repository baseline does not regress.
- No credentials, personal data, or temporary fixtures remain.
- The final report states the new numerator and denominator and distinguishes documented, source-verified, live-verified, and blocked operations.
Implement
docs/plans/2026-07-16-b2b-v2-coverage-expansion.md. Refresh both repositories first and preserve unrelated work. Canonicalize Tags and Positions only after authenticated/locationschecks. Rebuild the 60-operation route inventory, classify the 28-operation gap, and publish at least the safe Waiting List list and count reads. Complete Waiting List writes only with a controlled Booking User fixture, notification safety, and guaranteed cleanup. Preserve literal wire values, use canonical prose, run all required lint and Arazzo checks, open a focused PR, and report the final coverage ratio plus documented, live-verified, internal, and blocked operations separately.