Skip to content

OTST_TS_SNCF_EXCHANGE_EXCH_01

Sami Rmili edited this page Oct 28, 2025 · 8 revisions

Description

The Scenario will request offers to create a booking based on trip requirements or search requirements (including multi-leg trips), fulfill the booking then attempt to exchange this offer for another (any trip) and re-fulfill this same booking and perform checks to ensure the previous offer has been successfully exchanged, that the new offer information (exchangePrice and fulfillment to exchange) are consistent

PS: the scenario will not include partial refunds yet, nor adding new passengers in the exchange process

Scenario

  1. Generate and send a post offer request with a trip specification/ trip search

  2. Generate and send a post booking request

  3. Generate and send a post fulfillment request (maybe perform patch updates on passengers)

  4. Generate and send a get booking request

  5. Generate and send a post exchange offers request

  6. Generate and send a post exchange operations request

  7. Get the booking back

  8. Generate and send a post fulfillment request

  9. Generate and send a get booking request

Suggested Validations per step

  1. Steps 1 - 4:
    1. Perform same validation as done on previous scenarios
    2. When getting the booking, if the offerParts are not exchangeable (offerPart.exchangeable is 'NO'), the test suite should stop with a explicit error. The scenario should be supplied with information allowing exchange.
  2. Step 5: Get exchange offers
    1. In the request:
      1. Pass all fulfillment ids of the booking
      2. Pass an overrule code if provided in scenario data_file
      3. Anonymous passenger specs should be the same as previous offer
{
  "fulfillmentIds": <list_of_all_fulfillment_ids from_booking>,
  "tripSearchCriteria": <scenario_exchange_trip_search_criteria>,
  "tripSpecifications": <scenario_exchange_trip_specs>, # Use one of the two
  "anonymousPassengerSpecifications": [ # Same as previous booking
    {
      "externalRef": ...,
      "dateOfBirth": ...,
    }
  ],
  "offerSearchCriteria": {
    "offerMode": <scenario_offerMode>,
    "currency": <scenario_currency>
  },
  "overruleCode": <scenario_overruleCode>
}
  1. In response:
    1. Check that the returned impacted fulfillments in response are the same as those requested when getting exchange offers
    2. Exchange offers : exchangePrice (price of new offer + exchangeFees - price of previous offer) and exchangeFees and refundableAmount (if the new offer price + fees is less than previous offer).
    3. Check that exchangeFees are consistent with the afterSalesConditions for the previously sold offer
    4. These checks should be performed on all the returned offers
  2. Step 6: Create the exchange operations
    1. Ensure the created exchange operation contains the requested offer with same information as before, impacting the demanded fulfillments
  3. Step 7: Get booking
    1. The previous fulfillment’s status should be EXCHANGE_ONGOING
    2. The provisional amount of the booking should be equal to the exchangePrice (if previous offer is more expensive, we should check provisionalRefundableAMount)
    3. exchangeOperations contains the new exchange operation

Confirm the exchange offer

  1. Step 8: POST fulfillments
    1. New fulfillment should be at least CONFIRMED
    2. Previous fulfillments should be exchanged
  2. Step 9: Get booking
    1. Check that the new offerParts' status is at least CONFIRMED and previous one are EXCHANGED

Delete the exchange offer

  1. Step 8: DELETE exchange operation /bookings/{bookingId}/exchange-operations/{exchangeOperationId}
    1. Check that it returns a 204 with no content
  2. Step 9: Get booking
    1. Check that the original offerParts status is back to FULFILLED
    2. Original fulfillments status also back to FULFILLED

Clone this wiki locally