Automatic Booking Association CFE

This CFE allows the user (logged in or guest) to automatically associate new bookings to his customer account.

Automatic Booking Association CFE

This CFE allows the user (logged in or guest) to automatically associate new bookings to his customer account.

Links

<!-- prettier-ignore-start --> | GitLab | https://source.tui/osp/customer/account/automatic-booking-association-cfe | | SIT Env | | | MFE Link | https://mwa-nonprod.tui.com/customer/mwa/tui-cfe-orchestration-bookings-account-test/index.html | | Manifest | https://mwa-nonprod.tui.com/customer/mwa/tui-cfe-orchestration-bookings-account-test/openmfe/manifest.yaml | | Docs | https://mwa-nonprod.tui.com/customer/mwa/tui-cfe-orchestration-bookings-account-test/openmfe/documentation.html | <!-- prettier-ignore-end -->

MFE Integration

This CFE will work shoulder to shoulder with Automatic Booking Association MFE. Please refer to MFE documentation as well.

Example html code:

&lt;tui-automatic-booking-association-cfe
  data-theme=&quot;tui-light&quot;
  locale=&quot;en-GB&quot;
  market=&quot;UK_TH&quot;
  source-market=&quot;VALUE&quot;
  source-market-region=&quot;VALUE&quot;
  lead-passenger-email=&quot;VALUE&quot;
  lead-passenger-first-name=&quot;VALUE&quot;
  lead-passenger-last-name=&quot;VALUE&quot;
  lead-passenger-gender=&quot;VALUE&quot;
  departure-date=&quot;VALUE&quot;
  product-type=&quot;VALUE&quot;
  booking-id=&quot;VALUE&quot;
  brand=&quot;VALUE&quot;
  booking-system-code=&quot;VALUE&quot;
  forgot-password-link=&quot;VALUE&quot;
  post-association-redirect-link=&quot;VALUE&quot;
&gt;
&lt;/tui-automatic-booking-association-cfe&gt;

...

&lt;script async type=&quot;module&quot; src=&quot;https://mwa-nonprod.tui.com/customer/mwa/tui-cfe-orchestration-bookings-account-test/main.js&quot;&gt;&lt;/script&gt;

Lifecycle

graph TB
 subgraph FE
 onSubmitBooking[Submit form]-->validateForm[Validate form];
 validateForm-->ifBookihgType{If BookingType is <br/> ATCOM or TRIPS};
 ifBookihgType-->|No|sendBookingFailureEvent[Send add booking failure <br/> analitycs event]-->showAlternativeLink[Show alternative add booking link];
 ifBookihgType-->|Yes|invokeAssociateBookingMutation[Invoke associateBooking Mutation];
 end;
 subgraph BFF
 invokeAssociateBookingMutation-->|/graph|validateRequestBody[Validate request body]-->getUIDbyIdToken[Get UID by <br/> Gigya REST accounts.getJWTPublicKey];
 getAllUserBooking-->ifBookingAlreadyExists{If booking <br/> already exists <br/> or not found}-->|No|associateBookings[Associate bookings APIGEE <br/> /v1/customerAccounts/$UID/associateBookings];
 ifBookingTypeATCOM-->|Yes|getAtcomBooking[Get ATCOM booking <br/> /sales-display-booking/st3/package]-->verifyATCOMBooking[Verify ATCOM booking]-->getAllUserBooking;
 getUIDbyIdToken-->ifBookingTypeTrips{If booking type is <br/> TRIPS}-->|No|ifBookingTypeATCOM{If booking type is <br/> ATCOM};
 ifBookingTypeTrips-->|Yes|verifyBooking[Verify booking APIGEE <br/> /tui-sales-tda/tuiapiservices/salesorder/v1/verifybooking]-->getAllUserBooking[Get all user booking APIGEE <br/> /v1/customerAccounts/$UID/associateBookings];
 end;
 subgraph FE on response
 ifBookingTypeATCOM-->|No|displayError[Display error message];
 ifBookingAlreadyExists-->|Yes|displayError;
 associateBookings-->sendAddBookingSuccessEvent[Send add booking success <br/> analitycs event]-->sendManualBookingAssociatedEvent[Send booking associated event <br/> tui-auto-booking-association-mfe-automatic-backend-booking-associated];
 end;

Third party integration

Postman Collection:

https://confluence.tuigroup.com/pages/viewpage.action?spaceKey=ONEPF&title=CAS+-+Operations+with+Bookings+via+Postman

Request:

Method: GET

URL: https://tui-nonprod-test.apigee.net/v1/customerAccounts/${UID}/associateBookings

Headers:

HeaderDescription
correlation-idRequest ID
AuthorizationApigee bearer token

Request Path Parameters:

ParamDescription
UIDUnique user id, received from Gigya JWT

Response Booking Parameters:

ParamDescription
sourcemarketMarket id, possible values: WR, NR, GASP
sourcemarketCountryIdCountry code: DE, PL, SE, etc.
brandBooking brand: TUI-FLY, VIP-BE, TUIFLY_MA, etc.
bookingIdUnique booking id
ownershipRoleUser booking role: OWNER or GUEST
associationMethodAssociation booking method: AUTOMATIC, MANUAL, MATCHING
initiatingChannelBooking channel: TDA, SALES-WEBSITE, BOOKING-SYSTEM
timestampCreation date
packageTypeBooking type: EXCURSION, FLIGHT, ACCOMMODATION, CRUISE, INSURANCE, etc.
bookingTypeBooking code: LEGACY, TRIPS
airportCodeAirport code
originalDepartureDateDeparture date
originalReturnDateReturn date

TUI Sales API Verify Bookings

Postman Collection:

https://confluence.tuigroup.com/pages/viewpage.action?spaceKey=ONEPF&title=CAS+-+Operations+with+Bookings+via+Postman

Customer Account API Associate Booking

This REST API endpoint uses for associating user to booking.

APIGEE:

https://apigee.com/platform/tui-nonprod/proxies/customer-group-customerAccount/overview/7

Postman Collection:

https://confluence.tuigroup.com/pages/viewpage.action?spaceKey=ONEPF&title=CAS+-+Operations+with+Bookings+via+Postman

Request:

Method: POST

URL: https://tui-nonprod-test.apigee.net/v1/customerAccounts/${UID}/associateBookings

Headers:

HeaderDescription
correlation-idRequest ID
AuthorizationApigee bearer token

Request Path Parameters:

ParamDescription
UIDUnique user id, received from Gigya JWT

Body Request Parameters:

Body request contains array of AssociateBooking

Associate Trips Booking Body

ParamDescription
sourcemarketHardcode value: WR
sourcemarketCountryIdCountry code: DE, PL, SE, etc.
brandBooking brand: TUI-FLY, VIP-BE, TUIFLY_MA, etc.
bookingIdUnique booking id
ownershipRoleHardcode value: OWNER
associationMethodHardcode value: MANUAL
packageTypeBooking type: EXCURSION, FLIGHT, ACCOMMODATION, CRUISE, INSURANCE, etc.
departureDateDeparture date
returnDateReturn date

Associate Atcom Booking Body

ParamDescription
sourcemarketHardcode value: NR
sourcemarketCountryIdCountry code: DE, PL, SE, etc.
brandBooking brand: TUI-FLY, VIP-BE, TUIFLY_MA, etc.
bookingIdUnique booking id
ownershipRoleHardcode value: OWNER
associationMethodHardcode value: AUTOMATIC
bookingTypeHardcode value: LEGACY
initiatingChannelHardcode value: BOOKING_SYSTEM
packageTypeBooking type: EXCURSION, FLIGHT, ACCOMMODATION, CRUISE, INSURANCE, etc.
departureDateDeparture date
returnDateReturn date
flightFromLocalized airport name
flightFromIataCodeIata code
flightToLocalized airport name
flightToIataCodeIata code
airportCodeAirport code
airportNameLocalized airport name

Response

ParamDescription
timestampHardcode value: NR
bookingsArray of associated bookings
bookings.bookingReturns sended booking object
bookings.codeBooking code
bookings.messageBooking message

ATCOM API Get Booking

This API endpoint uses for check if ATCOM booking exist. If booking does not exist API throws an error.

Request:

Method: POST

URL: https://test.api.tui/sales-display-booking/st3/package

Headers:

HeaderDescription
correlation-idRequest ID
AuthorizationApigee bearer token

Request Parameters:

Body wrapped in DisplayBookingRequest object.

ParamDescription
Adm.ReqIdColleation id
CltInfo.LocaleHadrcode value: en_EN
CltInfo.CltSysContextHardcode value: 3
CltInfo.TermCodeHardcode value: VTX
CltInfo.User_NameUser name
CltInfo.Exp_NoHardcode value: WEB
CltInfo.ChanHardcode value: 1100
CltInfo.User_RoleHardcode value: INTERNAL
BkgNum.BkgIdBooking reference

Manifest contract


Screenshots

CFE rendering for a successful booking association to an existing account (logged in user)
CFE rendering for a successful booking association to an existing account (not logged in user)
CFE rendering (Login MFE) for a successful booking association to an existing account (user clicks 'Log in to myTUI account' button)
CFE rendering for a successful booking association to a non existing account (newly created by booking api)

Usage

Add the following script tag to your web page to load the microfrontend. Note: This is required only once per webpage, even when you embed multiple instances of the microfrontend.

<script src="https://mwa-nonprod.tui.com/customer/mwa/tui-cfe-orchestration-bookings-account-test/main.js" defer></script>

Add the following HTML code anywhere in your webpage at the position where you want the microfrontend to show. You can create multiple instances of the microfrontend.

<tui-automatic-booking-association-cfe
data-theme="VALUE"
locale="VALUE"
market="VALUE"
source-market="VALUE"
source-market-region="VALUE"
booking-system-code="VALUE"
brand="VALUE"
booking-id="VALUE"
product-type="VALUE"
lead-passenger-email="VALUE"
first-name="VALUE"
last-name="VALUE"
gender="VALUE"
departure-date="VALUE"
forgot-password-link="VALUE"
post-association-redirect-link="VALUE">

</tui-automatic-booking-association-cfe>

Examples

  • Shows the ABBA CFE in English

    <tui-automatic-booking-association-cfe
    data-theme="tui-light"
    locale="en-GB"
    market="UK_TH"
    source-market="GB"
    source-market-region="NR"
    booking-system-code="ATCOMRES"
    brand="TUI_GB"
    booking-id="1234567890"
    product-type="ACCOMMODATION_ONLY"
    lead-passenger-email="email@test.com"
    first-name="John"
    last-name="Doe"
    gender="MALE"
    departure-date="2024-12-31"
    forgot-password-link="/myTUI/forgot-password/"
    post-association-redirect-link="/myTUI/">

    </tui-automatic-booking-association-cfe>

Attributes

This microfrontend accepts the following attributes:

NameDescriptionValuesDefaultRequired
data-theme

This is the theme attribute that will be used to add the brand styles

tui, tui-light, firstchoice, musementyes
locale

This is the attribute that will be used to render the CFE in a specific language

en-GB, nl-NL, nl-BE, fr-FR, sv-SE, nn-NO, nb-NO, da-DK, fi-FIyes
is-b2b

This is the attribute that will be used to set the MFE in B2B mode, its using in case if auth integration layer url is not provided on the page

no
market

This is the TUI market where the CFE will be consumed

UK, UK_TH, UK_FC, UK_FJ, NL, BE, BE_FO, FR_FO, MA_FO, SE, NO, DK, FI, DE, MMyes
source-market

This is the TUI market where the booking was made

DE, PL, AT, CH, GB, IE, SE, DK, FI, NO, BE, NL, FR, MA, XXyes
source-market-region

This is the region ID where the booking was made

CR, NR, WR, M3, MMyes
booking-system-code

This is the booking system to be used in association

ATCOMRES, ATCOMRESR1, BIBE, CTS, JUMP, MDCAMPER, MDCAMPRJ, MDCAR, MDCARPRJ, MDINSPRJ, MDINSURE, MUSEMENT, NSKTF, TOR, TRIPS, TRS, UNKNOWN, VSN, WHEELSyes
brand

This is the brand to be used in association

TUI_NL, TUI_BE, VIP_BE, TUIFLY_BE, TUIFLY_MA, TUIFLY_FR, TUIFLY_NL, TUI_GB, FIRSTCHOICE_GB, FIRSTCHOICE_NL, FIRSTCHOICE_BE, TUI_IE, TUI_SE, TUI_DK, TUI_NO, TUI_FI, TUI_DE, TUI_CH, TUI_AT, TUI_PL, CRYSTAL_GB, CRYSTAL_IE, TUI_XX, ROBINSON_DE, ROBINSON_GB, ROBINSON_XX, MAGICLIFE_DE, MAGICLIFE_GB, TUIBLUE_DE, TUIBLUE_GB, TUIBLUE_XXyes
booking-id

This is the booking ID

yes
product-type

This is the product type to be used in association

ACCOMMODATION_ONLY, CARHIRE, CRUISE, EXCURSION, FLIGHT_ONLY, FLY_AND_STAY, INSURANCE, MULTICENTRE, OTHER, SKI, TOURSyes
lead-passenger-email

This is the email of the lead passenger

yes
first-name

This is the attribute for lead passenger first name

yes
last-name

This is the attribute for lead passenger last name

yes
gender

This is the attribute for lead passenger gender

FEMALE, MALE, UNKNOWNyes
departure-date

This is the booking's departure date

yes
forgot-password-link

This is the link to the forgot password page

yes
post-association-redirect-link

This is the url that user will be redirected to upon clicking on 'Go to myTUI account' button

yes