Function: calculateExtraChaperones()
function calculateExtraChaperones(input: CalculateExtraChaperonesInput): number;Defined in: server/capacity/chaperone-calculation.ts:39
Extra (paid) chaperones beyond the free ratio-based allotment (PLA-137).
Pure function — no Prisma, no Rules/Conditions — mirrors the shape of
getBookingQuantity (src/server/bookings/pricing-glue.ts), the
established idiom for a derived pricing quantity: a consumer feeds the
result into a normal per-unit pricing calculation via a getQuantity
resolver, same as that function does.
Rounding is CEILING — confirmed with product/design 2026-07-21,
overriding an initial floor recommendation (see the PLA-137 ticket's
Design Decision section). Isolated to the one Math.ceil call below so
it's trivial to flip back to floor if product revisits the decision.
Never negative — a group with fewer chaperones than its free allotment owes nothing extra, it doesn't earn a credit.
Parameters
| Parameter | Type |
|---|---|
input | CalculateExtraChaperonesInput |
Returns
number