Date: 2026-04-13
Status: Approved approach (Approach 2: dual-read, new-write)
Refactor pricing traveler semantics so that:
childrenWithoutBed becomes children (naming change only; pricing behavior unchanged)childrenWithBed becomes extraMattressCount (pricing-only count)extraMattressCount must not be treated as traveler count and must not participate in traveler display/count semantics.
In-scope:
GET /v1/itinerary/:id/price-details query parsing + response fieldspricingSelection traveler payload handling in POST /v1/bookingstravelerDetailsdocs/pricing-apis.md)Out-of-scope:
children (actual child travelers)extraMattressCount (pricing-only)Temporarily accept both old and new keys in requests/query:
children fallback to childrenWithoutBedextraMattressCount fallback to childrenWithBedReturn only new semantics in pricing selection/traveler sections:
childrenextraMattressCount as a separate pricing field (outside travelerDetails)childrenWithoutBed and childrenWithBedadults + childrenadults, children, infantschildrenextraMattressCountadults + children).normalizedChildren = children ?? childrenWithoutBed ?? max(childrenInput - extraMattressCount, 0)normalizedExtraMattressCount = extraMattressCount ?? childrenWithBed ?? 0Persist and emit:
childrenextraMattressCount (outside travelerDetails)Do not emit legacy key names in new API responses.
Min(0) constraintschildren, extraMattressCount)Add/adjust tests for:
extraMattressCount does not affect slab banding.src/shared/interfaces/traveler-counts.interface.tssrc/modules/itinerary/dto/price-details-query.dto.tssrc/modules/itinerary/dto/pricing-selection.dto.tssrc/modules/itinerary/interface/traveler-details.interface.tssrc/modules/itinerary/itinerary.controller.tssrc/modules/itinerary/itinerary.repository.tssrc/modules/itinerary/itinerary.service.tssrc/modules/bookings/dto/create-booking.dto.ts (if exposed docs/schema needs alignment)src/modules/bookings/bookings.service.tssrc/modules/bookings/bookings.repository.ts (traveler text fallback)docs/pricing-apis.mdchildren + extraMattressCount immediately.