M&M Travels: Architecture and API Change Log (So Far)

This document summarizes what has been implemented so far for the M&M bundle-pricing architecture, what changed in existing APIs, and what new APIs were introduced.

1) Architecture: Old vs New

Old Architecture

New Architecture (Implemented Direction)

Data Model Changes Introduced

2) Existing API Changes

Itinerary Price Details APIs (Enhanced)

Updated controller: src/modules/itinerary/itinerary.controller.ts

Now supports optional query params on GET price-details:

Purpose split:

availableCategories in price-details response:

Hotel-to-Itinerary Mapping API (Payload Enhanced)

Updated DTO/controller/service:

Existing endpoint:

New optional payload fields added:

Purpose: support primary scoping and category-aware hotel mapping for itinerary bundle architecture.

Booking Create API (Payload Enhanced)

Updated DTO/service:

Existing endpoint: booking create flow now requires pricingSelection (b2c), including bundle selectors:

Purpose: booking calculation can be performed from bundle matrix + selected capacity bucket.

Day-wise Itinerary Details Response Shape (Changed)

Updated service: src/modules/days/days.service.ts

Existing endpoint behavior changed to:

instead of embedding hotels/transfers inside each day.

3) New APIs Introduced

All added in src/modules/itinerary/itinerary.controller.ts.

A) Upsert Pricing Table (all scenarios in one endpoint)

Note: The previously documented PUT /v1/itinerary/:id/default-category, PUT /v1/itinerary/:id/bundle-pricing, and GET /v1/itinerary/:id/bundle-pricing endpoints were never added to the controller and do not exist in the live codebase. Do not call them.

B) Full Import API (Single Call)

This API is designed for the "import all at once" requirement and supports:

4) Import Behavior Implemented (Full Import API)

Implemented in src/modules/itinerary/itinerary.service.ts:

5) Publish Validation (New Architecture)

Implemented in publish toggle flow (src/modules/itinerary/itinerary.service.ts + src/modules/itinerary/itinerary.repository.ts).

Validation now follows scenario-specific rules:

Also aligned:

6) Supporting Internal Behavior Updates

7) Notes for Consumers

8) Current Status