Project Structure
To create a Connector, Travelgate will generate a unique code representing the Connector. This code will be used to set up the GitHub repository for your integration. External developers will receive access to a pre-configured repository.
When you download the repository, it will have the following structure:
Directory Layout​
/src
   /Book  
       /Extensions
       /Models
       BookOperation
   /Cancel  
       /Extensions
       /Models
       CancelOperation
   /CheckBookings 
       CheckBookingsByDate
           /Extensions
           /Models
           CheckBookingsByDateOperation
       CheckBookingsByReference
           /Extensions
           /Models
           CheckBookingsByReferenceOperation
   /Common
       /Constants
   /Metadata
       Metadata File
   /Quote  
       /Extensions
       /Models
       QuoteOperation
   /Search  
       /Extensions
       /Models
       SearchOperation
Binder.cs
Extensions.cs
Program.cs
TgxPlatform.cs
/test
   /MockServer
   /UnitTests
Detailed Explanation of Operations​
1. Search​
- Directory: 
/Search - Purpose: Performs a Search for hotel options based on the client’s criteria.
 - Methods:
- TryValidateModelRequest: Validates client requests for edge cases (e.g., checking specific Metadata constraints).
 - BuildRequests: Converts the Connector's request format into the supplier’s format.
 - TryValidateSupplierResponses: Validates supplier responses for errors or anomalies.
 - ParseResponses: Converts the supplier’s response back into the Connector’s standardized format.
 
 - For more details, see Search.
 
2. Quote​
- Directory: 
/Quote - Purpose: Confirms the details of a selected option, ensuring the data is up-to-date.
 - Methods:
- TryValidateModelRequest: Validates the client’s request for any specific constraints, such as Metadata-based restrictions.
 - BuildRequests: Maps the Connector's Quote request to the supplier’s expected format.
 - TryValidateSupplierResponses: Validates the supplier’s Quote response for consistency and errors.
 - ParseResponses: Transforms the supplier’s Quote response into the Connector’s standardized format.
 
 - For more details, see Quote.
 
3. Book​
- Directory: 
/Book - Purpose: Confirms the booking of a selected option, ensuring all necessary passenger and payment details are included.
 - Methods:
- TryValidateModelRequest: Validates client requests for booking-specific constraints, such as passenger name requirements or payment validation.
 - BuildRequests: Converts the Connector’s booking request into the supplier’s format.
 - TryValidateSupplierResponses: Checks for errors in the supplier’s booking response, such as payment rejections or unavailability.
 - ParseResponses: Converts the supplier’s booking response back into the standardized format, including booking confirmation or failure details.
 
 - For more details, see Book.
 
4. Cancel​
- Directory: 
/Cancel - Purpose: Manages cancellation of a booking using supplier and client locators.
 - Methods:
- TryValidateModelRequest: Validates client requests to ensure required locators are present.
 - BuildRequests: Maps the Connector’s cancellation request to the supplier’s expected format.
 - TryValidateSupplierResponses: Validates supplier responses for errors or issues with the cancellation.
 - ParseResponses: Converts the supplier’s cancellation response into the standardized Connector format, including status and penalties if applicable.
 
 - For more details, see Cancel.
 
5. CheckBookings By Reference​
- Directory: 
/CheckBookings/CheckBookingsByReference - Purpose: Retrieves booking status based on supplier and client locators.
 - Methods:
- TryValidateModelRequest: Validates the request for required locators or edge cases.
 - BuildRequests: Converts the Connector’s request into the supplier’s format.
 - TryValidateSupplierResponses: Ensures supplier responses contain valid booking data.
 - ParseResponses: Converts the supplier’s response back into the standardized format, including detailed booking status.
 
 - For more details, see CheckBookings By Reference.
 
6. CheckBookings By Dates​
- Directory: 
/CheckBookings/CheckBookingsByDate - Purpose: Retrieves booking status for a date range (by check-in or booking date).
 - Methods:
- TryValidateModelRequest: Ensures valid date ranges and required parameters.
 - BuildRequests: Converts the Connector’s request into the supplier’s format.
 - TryValidateSupplierResponses: Validates supplier responses for anomalies.
 - ParseResponses: Maps the supplier’s response to the standardized Connector format, including booking statuses for the date range.
 
 - For more details, see CheckBookings By Dates.
 
Other Key Files​
- Binder.cs: Handles validation of the 
Accessdata, ensuring required fields likeUser,Password, and custom parameters are valid. See Access Data. - Extensions.cs: Configures operations and defines 
PlatformOptions. See View PlatformOptions. - Program.cs: Handles startup configuration; no modifications are typically needed.
 - TgxPlatform.cs: Contains platform constants, such as the unique Connector code.
 
Testing​
- MockServer: Simulates supplier responses for testing purposes. See MockServer.
 - UnitTests: Contains test cases specific to the Connector's implementation.
 
This structure ensures consistency and adherence to Travelgate standards, providing a robust framework for Connector implementation.