Shopping cart functionality

Aus DRV STRING
Wechseln zu: Navigation, Suche


Use Case: Shopping cart functionality

Module: Handling: Booking administration

Description

We would like to have a shopping cart functionality like in an online shop. From a customer's point of view the the typical workflow would be:

  • While not customer satisfied:
    • Search for products (not necessarily part of this interface)
    • if customer likes search result:
      • add search result to shopping cart.
  • then checkout:
    • book all items in shopping cart.

The shopping cart functionality should be optional. Implementations of the STRING-Interface are not required to implmement it.

Request Data

Changes:

  • Add a BookingMode to StringBookRequest,Component and ComponentVariant with the values
    • BOOK: Perform an actual Book (turn the shopping cart into a booking).
    • QUOTE: Just add the Object(s) in the request to the an existing or new shopping Cart
    • ...other modes like optionBooking,...
  • Add an element BookingRef to StringBookRequest
    • This can be used to refer to an existing shopping cart or booking

Response Data

  • Add an element BookingStatus to StringBookResponse,Component and ComponentVariant with the values
    • OK: Object has been sucessfully booked
    • QUOTED: Object was just added to
    • ...other status like optionBooking, cancelled...

Check whether we can generalize and reuse the attribute ObjectsVariants/ObjectVariant/Room#Status for that purpose

  • Add a Element AvailabilityStatus to Component and ComponentVariant with the values
    • OK: Object is available
    • ON_REQUEST: Object availability can not be confirmed yet
  • Add an element BookingRef to StringBookResponse
    • This can be used to refer to this shopping cart or booking in the next workflow step

Simplified example workflow

Watch for the new elements :-)

<!-- STEP 1 Put hotel on Lummerland into the shopping cart, but do not book it yet -->
<StringBookRequest>
	<BookingMode>QUOTE</BookingMode>
	<Accommodation TourOperatorCode="DER" TravelType="TOUR">
		<Objects>
			<Object ID="01" ProductCode="LUM12345">
				<Stay Nights="14" Start="2017-10-22"/>
			</Object>
		</Objects>
		<ObjectsVariants>
			<ObjectVariant ID="01" ObjectIDRef="01">
				<Room OpCode="DZ" PassengerIdList="01 02" />
			</ObjectVariant>
		</ObjectsVariants>
	</Accommodation>
</StringBookRequest>

<!-- Response contains a bookingRef on the top level -->
<StringBookResponse Success="true" >
	<BookingRef>1234567890</BookingRef>
	<BookingStatus>QUOTED</BookingStatus>
	<Accommodation TourOperatorCode="DER" TravelType="TOUR">
		<Objects>
			<Object PackageIndicator="false" ID="01" ProductCode="LUM12345">
				<BookingStatus>QUOTED</BookingStatus>
			</Object>
		</Objects>
		<ObjectsVariants>
			<ObjectVariant ID="01" ObjectIDRef="01">
				<Room OpCode="DZ" PassengerIdList="01 02" Status="QUOTED">
					<BookingInfos>
						<Price Amount="999.00" Fares="666.66" Taxes="333.33"/>
					</BookingInfos>
				</Room>
			</ObjectVariant>
		</ObjectsVariants>
	</Accommodation>
</StringBookResponse>

<!-- STEP 2 Put hotel in South Park into the the same shopping cart, but do not book it yet -->
<!-- reusing the BookingRef to specify the shopping cart --> 
<StringBookRequest>
	<BookingRef>1234567890</BookingRef>
	<BookingMode>QUOTE</BookingMode>
	<Accommodation TourOperatorCode="DER" TravelType="TOUR">
		<Objects>
			<Object ID="01" ProductCode="SPK54321">
				<Stay Nights="14" Start="2017-11-12"/>
			</Object>
		</Objects>
		<ObjectsVariants>
			<ObjectVariant ID="01" ObjectIDRef="01">
				<Room OpCode="JS" PassengerIdList="01 02" />
			</ObjectVariant>
		</ObjectsVariants>
	</Accommodation>
</StringBookRequest>

<!-- Response contains two accomodation objects now -->
<StringBookResponse Success="true" >
	<BookingRef>1234567890</BookingRef>
	<BookingStatus>QUOTED</BookingStatus>
	<Accommodation TourOperatorCode="DER" TravelType="TOUR">
		<Objects>
			<Object PackageIndicator="false" ID="01" ProductCode="LUM12345">
				<BookingStatus>QUOTED</BookingStatus>
			</Object>
			<Object PackageIndicator="false" ID="02" ProductCode="SPK54321">
				<BookingStatus>QUOTED</BookingStatus>
			</Object>
		</Objects>
		<ObjectsVariants>
			<ObjectVariant ID="01" ObjectIDRef="01">
				<Room OpCode="DZ" PassengerIdList="01 02" Status="QUOTED">
					<BookingInfos>
						<Price Amount="999.00" Fares="666.66" Taxes="333.33"/>
					</BookingInfos>
				</Room>
			</ObjectVariant>
			<ObjectVariant ID="02" ObjectIDRef="02">
				<Room OpCode="JS" PassengerIdList="01 02" Status="QUOTED">
					<BookingInfos>
						<Price Amount="300.00" Fares="200.00" Taxes="100.00"/>
					</BookingInfos>
				</Room>
			</ObjectVariant>
		</ObjectsVariants>
	</Accommodation>
</StringBookResponse>


<!-- STEP 3 Check out: Book all items in the cart -->
<!--if objects are omitted all items int the cart are booked with the given booking mode --> 

<StringBookRequest>
	<BookingRef>1234567890</BookingRef>
	<BookingMode>BOOK</BookingMode>
</StringBookRequest>

<!-- Response now contains two BOOKED accomodation objects -->
<StringBookResponse Success="true" >
	<BookingRef>1234567890</BookingRef>
	<BookingStatus>OK</OK>
	<Accommodation TourOperatorCode="DER" TravelType="TOUR">
		<Objects>
			<Object PackageIndicator="false" ID="01" ProductCode="LUM12345">
				<BookingStatus>OK</BookingStatus>
			</Object>
			<Object PackageIndicator="false" ID="02" ProductCode="SPK54321">
				<BookingStatus>OK</BookingStatus>
			</Object>
		</Objects>
		<ObjectsVariants>
			<ObjectVariant ID="01" ObjectIDRef="01">
				<Room OpCode="DZ" PassengerIdList="01 02" Status="OK">
					<BookingInfos>
						<Price Amount="999.00" Fares="666.66" Taxes="333.33"/>
					</BookingInfos>
				</Room>
			</ObjectVariant>
			<ObjectVariant ID="02" ObjectIDRef="02">
				<Room OpCode="JS" PassengerIdList="01 02" Status="OK">
					<BookingInfos>
						<Price Amount="300.00" Fares="200.00" Taxes="100.00"/>
					</BookingInfos>
				</Room>
			</ObjectVariant>
		</ObjectsVariants>
	</Accommodation>
</StringBookResponse>