task: #3631964 Eleven computations are written twice or more, and two doc pages name methods that are gone or a plan that has shipped

Closes #3631964. Found by the release audit of 1.x: each computation that was written more than once now has one owner, and every place calls it. The two stale doc pages are corrected. docs/metrics.md is regenerated in the last commit.

One owner per computation

  • An allotment's release lead in words (six places): ReleaseLeadTrait::getReleaseLeadInWords(). Every screen now says "@interval before each slot". The resource and preset allotment lists said "before the slot", and that string is gone.
  • The grades a tariff prices (two): PlaceTariffMatcher::getGradeIds(), now static. VenueAvailabilityBound, PlacementPartitions and VenuePlacementProvider call it, and the last two no longer have the matcher injected.
  • Lapsed grant purges (two): LapsedGrantsTrait::deleteLapsedGrantsOf(), for manager and operator grants.
  • "Delete the records naming these" (nine places): ReferencingRecords::deleteNaming(). It covers the child cascades of resources, tariffs and presets, an order's bookings, both grant purges, and two copies the issue did not list: BookingManager::deleteSlotsWithBookings() (added by !415 (merged)) and PlacementHooks::purgeSettings().
  • "Still has records (type: n)" (three): ReferencingRecords::describeCounts().
  • A guarantee action's optional amount (two): OptionalAmountTrait. It builds the field, checks it (the same money regex), stores it only when set, and reads it back.
  • Opening a signed link to its order (two): OrderLinkTrait::getOrderForToken(). The ticket and cancel controllers each pass their own token kind, and a 404 says nothing about why.
  • A venue's sections and rows as options (two): the place filter form uses VenuePlaceOptionsTrait, and reads the sections once per build instead of twice.
  • Integer entity getters (ten): EntityIntegerValueTrait::getIntegerValue().
  • Booking operation names (three): BookingManagerInterface::applyOperation() matches "confirm", "release", "cancel", "complete" and "mark_unused" to their methods. The bookings tab, the bookings overview batch and the operation links all call it. A name it does not know is refused with a BookingException.
  • An order's bookings (two hand-written queries): TransactionLookup::getBookings(), in LocalBookingClient (sorted by id, as the query was) and the ResourceManagers audience.

Docs

  • cart.md, booker-messages.md and resource-type-design.md named three methods that were renamed.
  • resource-type-design.md read as a plan for work that has shipped. It now describes what exists: the config entity, what a type carries, and how the workflow and payment account are resolved. use-cases.md and no-code-interaction-design.md link to it as such.

Tests

  • BookingManagerTest::testEachOperationNameMovesTheBookingAsItSays: each name moves a booking to its state, and an unknown name is refused. Swapping any two arms of the match, or turning the refusal into a no-op, fails it.
  • VenuePlaceFilterFormTest: the filter reads its sections once per build.
  • TariffPresetAdminTest: the preset tariffs page and the preset allotment list say the release lead in the same words.
  • Mutation checks on the new owners: a slot deleted without its bookings fails BookingManagerTest, and section settings left behind fail ConfigurationSectionTest.

Cost

No path runs more work than before: the same queries are moved into one place. The place filter form saves one sections query per build, and two services lose a dependency they no longer read.


AI-Generated: Yes (Claude Code was used to help write the changes, their tests and this description. I reviewed them, and each new test was confirmed to fail when the code it covers is broken and to pass with it.)

Merge request reports

Loading
Loading