Communication Interfaces - DistributedTravels/Documentation GitHub Wiki
Services
Offers
Commands
GetOffersEvent - command, which request a list of offers fulfilling search criteria, this command starts getting offers orchestrator
GetTripsFromDatabaseEvent - command, which request a list of records about saved trips from Offers database
SaveOffersToDatabaseEvent - command, which saves given list of trips to the Offers database
Responses
GetOffersReplyEvent - data message, a response to GetOffersEvent, contains a list of composed offers
GetTripsFromDatabaseReplyEvent - data message, a response to GetTripsFromDatabaseEvent, contains a list of trips extracted from Offers database
Reservations
Commands
AskForReservationStatusEvent - command which checks current reservation status
ReserveOfferEvent - command which initiates the saga
GetReservationsFromDatabaseEvent - command for getting reservations created for the specified user
Responses
AskForReservationStatusReplyEvent - contains current reservation status
ReserveOfferReplyEvent - simple response letting the one who asked that the saga has begun, contains correlationId for further communication
PaymentInformationForReservationReplyEvent - simple response for event (just letting the one who asked know, that the event was received)
GetReservationsFromDatabaseReplyEvent - reply containing reservations created for the specified user
Events
PaymentInformationForReservationEvent - event which let's saga get information for payments service
ReservationTimeoutEvent - event for cancelling temporarily reserved offers after a minute
Hotels
Commands
GetHotelsEvent - command, which request a list of hotels fulfilling search criteria (by country; if parameter "any" is given, then the list of all hotels is returned)
GetInfoFromHotelEvent - command, which requests information if there is a possibility of making a reservation in specified hotels with certain parameters and what price would be for this reservation.
The parameters are:
Id of a hotel, in which a possibility of a reservation is checked,
begin and end date of a reservation period,
number of each type of room which should be available in searched period,
facilities, which searched hotel should offer (breakfast, wifi)
ReserveRoomsEvent - command, which reserves certain rooms in required hotels if the criteria given in the request are fulfilled (these are the same parameters as in GetInfoFromHotelEvent). Moreover, Ids of user and reservation should be given to identify reservations.
UnreserveRoomsEvent - command, which lifts a reservation for certain rooms in a hotel. Id of removed reservation is a parameter.
Responses
GetHotelsEventReply - data message, a response to GetHotelsEvent, contains a list of searched hotels.
GetInfoFromHotelEventReply - data message, a response to GetInfoFromHotelEvent, contains an information about possibility of making a reservation and a cost, if reservation is possible (if impossible, the cost is 0).
ReserveRoomsEventReply - data message, a response to ReserveRoomsEvent, contains information if reservation was made, and calculated cost (if reservation was not made, the cost is 0).
UnreserveRoomsEventReply - data message, a response to UnreserveRoomsEvent, is sent to signalize, that the unreserving operation has ended.
Transports
Commands
BookTravelEvent - command, which marks seats as purchased for an existing reservation of seats.
GetAvailableDestinationsEvent - command, which requests a list of available destinations by provided by Tour Operator transport means (here flights).
GetAvailableSourcesEvent - command, which requests a list of available departure cities.
GetAvailableTravelsEvent - command, which requests available travels for given criteria and responds with a list of travels that match the criteria. Possible criteria are: departure time, source, destination, available seats or specific travel id to request specific travel's details.
ReserveTravelEvent - command, which marks specified number of seats in specified travel as reserved till a purchase is made or reservation is lifted.
UnbookTravelEvent - command, which retracts a purchase of seats for a flight.
UnreserveTravelEvent - command, which lifts a reservation for seats for specified flight
Responses
GetAvailableDestinationsReplyEvent - data message, a response to GetAvailableDestinationsEvent command, transferring names of available destinations.
GetAvailableSourcesReplyEvent - data message, a response to GetAvailableSourcesEvent command, transferring names of available departure cities.
GetAvailableTravelsReplyEvent - data message, a response to GetAvailableTravelsEvent command, transferring data about travels that met the criteria, the transferred data is: travel id, source, destination, departure time, available seats and price.
ReserveTravelReplyEvent - data message, a response to ReserveTravelEvent command, transferring status of reservation (success or failure) and price for seats in reserved travel.
Payments
Commands
ProcessPaymentEvent - command, which begins payment simulation, it requires credit card credentials as information together with the price to be charged
Responses
ProcessPaymentReplyEvent - data message, a response to ProcessPaymentEvent, returns the state of completeness of payment. Possible states are: ACCEPTED, INVALID_CARD_CREDENTIALS, LIMITS_TOO_LOW.
WebAPI
RESTful Endpoints
Post Auth - used for authenticating user in service
Get GetOffers - used for sending request to obtain offers list
Get CheckOfferAvailability - used for check if specified offer is still available
Post SendInformation - used to exchenge information about payment made by user
Post Reserve - used to reserve offer and begin reservation saga
Get CheckReservationStatus - used to check status of reservation
Get GetReservations - used to list user's reservations