qe-fe-automation
Version:
FE test automation framework using cypress
458 lines (456 loc) • 12.3 kB
text/typescript
import { generateRandomCurrency } from '@commerce-lib/shared';
import { localizationData } from '@fixtures/commerce/localization_data';
import * as Console from 'console';
const randomCurrency = generateRandomCurrency();
const tfGST = localizationData.flight.TF_GST;
const tfBoarding = localizationData.flight.tf_priorityBoarding;
const totalAmount = tfGST.totalAmount;
const deVAT = localizationData.flight.de_VAT;
export const ledgerRequests = {
TF_GST: {
booking_uuid: tfGST.bookingUuID,
booking_id: tfGST.bookingID,
ticket_number: 'RI4OVKC',
total_amount: randomCurrency,
total_currency: 'USD',
supplier_total: {
amount: 3695.0516,
currency: 'USD',
amount_in_usd: 44.2785,
supplier_amount: randomCurrency,
supplier_currency: 'AUD'
},
base_amount: randomCurrency,
base_currency: 'USD',
supplier_base: {
amount: randomCurrency,
currency: 'USD',
amount_in_usd: 33.0697,
supplier_amount: totalAmount,
supplier_currency: 'AUD'
},
equivalent_amount: null,
equivalent_currency: null,
supplier_equivalent: null,
collected_amount: null,
collected_currency: null,
supplier_collected: null,
commission_amount: null,
commission_percentage_rate: null,
commission_currency: null,
supplier_commission: null,
total_tax_amount: 335.7218,
tax_currency: 'USD',
supplier_total_tax: {
amount: 11.7218,
currency: 'USD',
amount_in_usd: 11.2088,
supplier_amount: 17.72,
supplier_currency: 'AUD'
},
associated_ticket_number: null,
traveler_first_name: null,
traveler_last_name: null,
issue_date: null,
fare_calculation: null,
ticket_json: null,
provider_type: 'TRAVELFUSION',
inventory_type: 'FLIGHT',
ticket_type: 'TICKET',
ticket_taxes: [
{
tax_code: 'IIMP',
tax_amount: 3.1627,
tax_text: 'IIMP',
currency: 'USD',
tax_amount_in_usd: 3.1627,
supplier_amount: 5.0,
supplier_currency: 'AUD',
tax_rate: null
},
{
tax_code: 'GST',
tax_amount: 335.7218,
tax_text: 'Goods and Services Tax',
currency: 'USD',
tax_amount_in_usd: 4.023,
supplier_amount: 6.36,
supplier_currency: 'AUD',
tax_rate: null
}
],
coupons: [
{
origin_location_code: 'SYD',
destination_location_code: 'AVV',
airline_code: 'JQ',
marketing_airline_code: 'JQ',
fare_basis_code: 'ELECOE2',
flight_number: '609',
status_code: null,
travel_date: '2024-06-20',
departure_time: null,
arrival_time: null,
class_of_service: null
}
],
ticket_payment_methods: [
{
masked_card_number: 'XXXXXXXXXXXX0005',
expiry_date: '0132',
card_type: 'AX',
payment_method_type: 'CC',
payment_method_nickname: null,
charged_amount: randomCurrency,
charged_amount_currency: 'USD',
charged_amount_in_usd: 44.7719
}
],
price_includes_tax: false,
currency_conversion_rates: [
{
conversion_rate: 83.450259,
currency: 'USD'
}
],
additional_charges: [
{
type: 'CREDIT_CARD_FEE',
amount: 0.4934,
currency: 'USD',
amount_in_usd: 0.4934,
excluded_from_total_price: true,
supplier_charge: {
amount: 0.4934,
currency: 'USD',
amount_in_usd: 0.4934,
supplier_amount: 0.78,
supplier_currency: 'AUD'
}
}
],
metadata: [
{
name: 'supplier_to_agency_conversion_rate',
value: '52.786451161140183806343589707908'
}
]
},
de_VAT: {
booking_uuid: deVAT.bookingUuID,
booking_id: deVAT.bookingID,
ticket_number: deVAT.ticketNumber,
total_amount: 96.4,
total_currency: 'GBP',
supplier_total: null,
base_amount: deVAT.baseAmount,
base_currency: 'GBP',
supplier_base: {
amount: 39.0,
currency: 'EUR',
amount_in_usd: null,
supplier_amount: null,
supplier_currency: null
},
equivalent_amount: null,
equivalent_currency: null,
supplier_equivalent: null,
collected_amount: 96.4,
collected_currency: 'GBP',
supplier_collected: null,
commission_amount: null,
commission_percentage_rate: null,
commission_currency: null,
supplier_commission: null,
total_tax_amount: 62.4,
tax_currency: 'GBP',
supplier_total_tax: null,
associated_ticket_number: null,
traveler_first_name: null,
traveler_last_name: null,
issue_date: '2023-10-06',
fare_calculation: null,
ticket_json: null,
provider_type: 'FARELOGIX',
inventory_type: 'FLIGHT',
ticket_type: 'TICKET',
ticket_taxes: [
{
tax_code: 'YQ',
tax_amount: 7.8,
tax_text: 'YQI LH CARRIER IMPOSED MISC FEE',
currency: 'GBP',
tax_amount_in_usd: null,
supplier_amount: null,
supplier_currency: null,
tax_rate: null
},
{
tax_code: 'DE',
tax_amount: 10.3,
tax_text: 'AIRPORT SECURITY CHARGE',
currency: 'GBP',
tax_amount_in_usd: null,
supplier_amount: null,
supplier_currency: null,
tax_rate: null
},
{
tax_code: 'OY',
tax_amount: 13.1,
tax_text: 'AIR TRANSPORT TAX',
currency: 'GBP',
tax_amount_in_usd: null,
supplier_amount: null,
supplier_currency: null,
tax_rate: null
},
{
tax_code: 'RD',
tax_amount: 0.5,
tax_text: 'PASSENGER SERVICE CHARGE DOMESTIC ARRIVAL',
currency: 'GBP',
tax_amount_in_usd: null,
supplier_amount: null,
supplier_currency: null,
tax_rate: null
},
{
tax_code: 'RD',
tax_amount: 30.7,
tax_text: 'PASSENGER SERVICE CHARGE DOMESTIC DEPARTURE',
currency: 'GBP',
tax_amount_in_usd: null,
supplier_amount: null,
supplier_currency: null,
tax_rate: null
}
],
coupons: [
{
origin_location_code: 'FRA',
destination_location_code: 'BER',
airline_code: 'LH',
marketing_airline_code: 'LH',
fare_basis_code: 'LDELGTG9',
flight_number: '182',
status_code: 'OPEN',
travel_date: '2024-02-14',
departure_time: '2025-02-14T10:45:00Z',
arrival_time: '2025-02-14T11:55:00Z',
class_of_service: 'L'
}
],
ticket_payment_methods: [
{
masked_card_number: 'XXXXXXXXXXXX0004',
expiry_date: '0139',
card_type: 'CA',
payment_method_type: 'CC',
payment_method_nickname: null,
charged_amount: 96.4,
charged_amount_currency: 'GBP',
charged_amount_in_usd: null
}
],
price_includes_tax: null,
currency_conversion_rates: null,
additional_charges: [],
metadata: [
{
name: 'supplier_to_agency_conversion_rate',
value: '0.86618427'
}
]
},
TF_BOARDING: {
booking_uuid: tfBoarding.bookingUuID,
booking_id: tfBoarding.bookingID,
ticket_number: 'HIF2AOS-EB01',
total_amount: 2194.4525,
total_currency: 'INR',
supplier_total: {
amount: 2194.4525,
currency: 'INR',
amount_in_usd: tfBoarding.priorityBoardingAmount,
supplier_amount: tfBoarding.priorityBoardingAmount,
supplier_currency: 'USD'
},
base_amount: 2194.4525,
base_currency: 'INR',
supplier_base: {
amount: 2194.4525,
currency: 'INR',
amount_in_usd: tfBoarding.priorityBoardingAmount,
supplier_amount: tfBoarding.priorityBoardingAmount,
supplier_currency: 'USD'
},
equivalent_amount: null,
equivalent_currency: null,
supplier_equivalent: null,
collected_amount: null,
collected_currency: null,
supplier_collected: null,
comission_amount: null,
comission_percentage_rate: null,
comission_currency: null,
supplier_commission: null,
total_tax_amount: 0.0,
tax_currency: 'INR',
supplier_total_tax: {
amount: 0.0,
currency: 'INR',
amount_in_usd: 0.0,
supplier_amount: 0.0,
supplier_currency: 'USD'
},
associated_ticket_number: null,
traveler_first_name: null,
traveler_last_name: null,
issue_date: null,
fare_calculation: null,
ticket_json: null,
provider_type: 'TRAVELFUSION',
inventory_type: 'FLIGHT',
ticket_type: 'PRIORITY_BOARDING',
ticket_taxes: null,
coupons: [
{
origin_location_code: 'STN',
destination_location_code: 'BER',
airline_code: 'FR',
marketing_airline_code: 'FR',
fare_basis_code: 'D',
flight_number: '176',
status_code: null,
travel_date: '2024-02-21',
departure_time: null,
arrival_time: null,
class_of_service: null
}
],
ticket_payment_methods: null,
price_includes_tax: true,
currency_conversion_rates: [
{
conversion_rate: 83.02885,
currency: 'INR'
}
],
additional_charges: null,
metadata: [
{
name: 'supplier_to_agency_conversion_rate',
value: '83.028850000000000000000000000000'
}
]
},
TF_BOOKING: {
booking_uuid: tfBoarding.bookingUuID,
booking_id: tfBoarding.bookingID,
ticket_number: 'HIF2AOS',
total_amount: 2232.6458,
total_currency: 'INR',
supplier_total: {
amount: 2232.6458,
currency: 'INR',
amount_in_usd: tfBoarding.totalAmount,
supplier_amount: tfBoarding.totalAmount,
supplier_currency: 'USD'
},
base_amount: 2232.6458,
base_currency: 'INR',
supplier_base: {
amount: 2232.6458,
currency: 'INR',
amount_in_usd: tfBoarding.totalAmount,
supplier_amount: tfBoarding.totalAmount,
supplier_currency: 'USD'
},
equivalent_amount: null,
equivalent_currency: null,
supplier_equivalent: null,
comission_percentage_rate: null,
comission_currency: null,
supplier_commission: null,
collected_amount: null,
collected_currency: null,
supplier_collected: null,
comission_amount: null,
total_tax_amount: 0.0,
tax_currency: 'INR',
supplier_total_tax: {
amount: 0.0,
currency: 'INR',
amount_in_usd: 0.0,
supplier_amount: 0.0,
supplier_currency: 'USD'
},
associated_ticket_number: null,
traveler_first_name: null,
traveler_last_name: null,
issue_date: null,
fare_calculation: null,
ticket_json: null,
provider_type: 'TRAVELFUSION',
inventory_type: 'FLIGHT',
ticket_type: 'TICKET',
ticket_taxes: [],
coupons: [
{
origin_location_code: 'STN',
destination_location_code: 'BER',
airline_code: 'FR',
marketing_airline_code: 'FR',
fare_basis_code: 'D',
flight_number: '176',
status_code: null,
travel_date: '2024-02-21',
departure_time: null,
arrival_time: null,
class_of_service: null
}
],
ticket_payment_methods: [
{
masked_card_number: 'XXXXXXXXXXXX0005',
expiry_date: '0132',
card_type: 'AX',
payment_method_type: 'CC',
payment_method_nickname: null,
charged_amount: 4557.4536,
charged_amount_currency: 'INR',
charged_amount_in_usd: 54.89
}
],
price_includes_tax: true,
currency_conversion_rates: [
{
conversion_rate: 83.02885,
currency: 'INR'
}
],
additional_charges: [
{
type: 'CREDIT_CARD_FEE',
amount: 130.3553,
currency: 'INR',
amount_in_usd: 1.57,
excluded_from_total_price: true,
supplier_charge: {
amount: 130.3553,
currency: 'INR',
amount_in_usd: 1.57,
supplier_amount: 1.57,
supplier_currency: 'USD'
}
}
],
metadata: [
{
name: 'supplier_to_agency_conversion_rate',
value: '83.028850000000000000000000000000'
}
]
}
};