Problem/Motivation
Found by the release audit of 1.x at e9bcd460, with a method-body clone detector run over the whole module (tests included) and a second pass grouping entity queries by their conditions.
- An allotment's release lead is put into words six times: "Held until taken" or "an interval before the slot", in
ResourceAllotmentListBuilderandPresetAllotmentListBuilder(byte-identical methods),SlotAllotmentsController,ResourceAllotmentsController,PresetTariffsController(which says "before each slot") andApplyTariffPresetForm. - The grades a tariff prices are read twice:
VenueAvailabilityBound::getGradeIds()andPlaceTariffMatcher::getGradeIds(). - Grant purges are written for each kind of grant: deleting lapsed grants on cron, and the grants naming a row being deleted, in
ManagerHooksand again inOperatorHooks. - The optional guarantee amount is built, checked and stored twice, in
CaptureGuaranteeActionandReleaseGuaranteeAction. - Opening a signed link to its order is written twice:
TicketController::getOrderForToken()andCancelController::getOrderForToken(). - A venue's sections as options are written twice:
VenuePlaceFilterForm::getSectionOptions()repeatsVenuePlaceOptionsTrait::getSectionOptions(), and the filter form asks it twice per build. - Three method names in the docs no longer exist:
heldQuantities()in cart.md isgetHeldQuantities(),messageSettingValue()in booker-messages.md isgetMessageSettingValue(),BookingWorkflowStarter::onHeld()in resource-type-design.md isstart(). - The resource type page still reads as a plan. It says types and tenants have no admin forms yet (both have them), keeps an open decision between a config and a content entity (a config entity shipped), and lists migration and phasing steps for work that has shipped.
- "Delete the records naming these" is written in seven places: the child cascades of
BookingResource,BookingSlot,BookingResourceTariffandBookingTariffPreset, the order's bookings inBookingHooks::yoyakuTransactionPredelete(), and the grant purges of D3. - The refusal "still has records (type: n, type: n)" is built three times:
ReferencingRecords::refuseDeletionWhileNamed(),BookingResource::preDelete()andTenant::preDelete(). - Ten entity getters re-implement
EntityIntegerValueTrait::getIntegerValue(): the order's hold times, the slot's start, end and opening, the allotments' release, the order's archive time and the place's position. - The booking operations are mapped to the booking manager three times:
BookingsForm::getCoreActions(),BookingOverviewFormandBookingOperationController::run(). - An order's bookings are queried by hand beside
TransactionLookup::getBookings(), inLocalBookingClient::buildOrderArray()andBookingHooks::yoyakuTransactionPredelete().
Proposed resolution
Give each computation one owner and call it from every place, correct the three names, and rewrite the resource type page as a description of what exists. Regenerate docs/metrics.md last.
Remaining tasks
Write the merge request.
User interface changes
Every allotment screen says the release lead as "@interval before each slot". The resource and preset allotment lists said "before the slot".
API changes
BookingManagerInterface gains applyOperation(), which matches a booking operation name to its method. PlaceTariffMatcher::getGradeIds() is static. PlacementPartitions and VenuePlacementProvider no longer take the tariff matcher, and LocalBookingClient and the ResourceManagers audience take the transaction lookup.
AI-Generated: Yes (Claude Code was used to run this audit and draft this issue. I reviewed it before posting.)
Issue fork yoyaku-3631964
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mably commentedComment #4
mably commentedComment #6
mably commented