Use cases
Scenario: Getting fares using company account with one discount
Given The company account Travel Ticket and user TMC_OneDiscount@HexTestAccount.com P@ssw0rd
When The user sends a request to /fares endpoint with all required parameters but without discountCategoryId
Then The discount should be applied automatically
Scenario: Getting fares using company account without discount category
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
When The user sends a request to /fares endpoint with all required parameters but without discountCategoryId
Then The discount shouldn't be applied
Scenario: Getting fares using company account with many discount categories
Given The company account Search Travel and user TMC_MultiDiscount@HexTestAccount.com P@ssw0rd
And List of discount categories and their id from endpoint /discount-category
When The user sends a request to /fares endpoint with all required parameters and with filled discountCategoryId parameter
Then The discount should be applied
Scenario: Scenario: Getting available discounts
Given The company account Search Travel and user TMC_MultiDiscount@HexTestAccount.com P@ssw0rd
When The user sends a request to /discount-categories endpoint
Then List of available discounts is in response
Scenario: Getting fares using company account with few ticket types assigned
Given The company account Flightring and user NoClients_2Tickets@HexTestAccount.com P@ssw0rd
When The user sends a request to /fares endpoint with all required parameters
Then Response should contain only Anytime Day Single 1class and Anytime Day Single tickets
Scenario: Getting fares using company account with no ticket types assigned
Given The company account Choo-choo Travel and user No_Tickets@HexTestAccount.com P@ssw0rd
When The user sends a request to /fares endpoint with all required parameters
Then Response shouldn't contain any records
Scenario: Getting managed clients
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
When The user sends a request to /companies/managed-clients endpoint
Then List of managed clients is in response
Scenario: Creating an order for self-booking
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
And Selected fare from /fares endpoint
When The user sends request only with "FareId" to /order endpoint
Then Order is created
Scenario: Creating an order for a client witht company account
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
And Selected fare from /fares endpoint
And List of managed clients from /companies/managed-clients endpoint
When The user sends request with "FareId", "TravelManagementCompany" and "CompanyAccountId" parameter inside to /order endpoint
Then Order is created
Scenario: Creating an order for a client without company account
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
And Selected fare from /fares endpoint
And List of managed clients from /companies/managed-clients endpoint
When The user sends request with "FareId", "TravelManagementCompany" and "CompanyClientId" parameter inside to /order endpoint
Then Order is created
Scenario: Confirming an order using company with optional questions
Given The company account Search Travel and user TMC_MultiDiscount@HexTestAccount.com P@ssw0rd
And Created order
When The user sends request to orders/{token}/confirmation endpoint without answering for questions
Then Order is confirmed
Scenario: Getting a list of survey questions
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
When The user sends a request to /survey-questions endpoint
Then List of survey questions in response
Scenario: Confirming an order using a company with mandatory questions
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
And Created order
And List of survey questions from /survey-questions endpoint
When The user sends a request to /orders/{token}/answers
And The user sends a request to orders/{token}/confirmation endpoint
Then Order is confirmed
Scenario: Paying for an order using company account with a free credit
Given The company account Wing and Rail and user TMC_NoDiscount@HexTestAccount.com P@ssw0rd
And Confirmed order
When The user pays for on order using /payments/onAccount endpoint
Then The credit balance is reduced by the value of the order
And User can see the ticket using /orders/{token} endpoint
Scenario: Paying for an order using company account with no credit available
Given The company account RailOnline and user No_Credit@HexTestAccount.com P@ssw0rd
And Confirmed order
When The user tries to pay for on order using /payments/onAccount endpoint
Then The user doesn't receive the ticket
And The credit balance is not reduced
Scenario: Paying for an order using company account with disabled on accout payments
Given The company account Railsignal and user No_OnAccount@HexTestAccount.com P@ssw0rd
And Confirmed order
When The user tries to pay for on order using /payments/onAccount endpoint
Then The user gets the message that he can't pay using this payment method
Scenario: Paying for an order using company account with no credit account
Given The company account Interflight and user No_CreditAccount@HexTestAccount.com P@ssw0rd
And Confirmed order
When The user tries to pay for on order using /payments/onAccount endpoint
Then The user gets the message that he can't pay using this payment method