private static ApiReservationDetailsRequest SetTestData() { var passengers = new List <Passenger> { new Passenger { PassengerName = "Test" } }; var a14ft = new A14FT { UserId = 1234560, ClientId = 123456, InvoiceTypeId = "T", InvoiceUseTypeId = "03", InvoicePaymentType = "PPD", InvoicePaymentMethod = "03", FtMarkups = new[] { 100.50, 200.50, 300.50 }, InvoiceLines = new[] { "Concepto-P01", "Concepto-P02" }, InvoiceAmounts = new[] { 1000.79, 2000.79, 3000.79 } }; var cost = new Cost { Total = 1000, PrimaryTaxAmount = 160 }; var provider = "Another Test"; var PNR = new string('a', 10); var hotels = new Hotel[] { new() { Amount = 123.50, Name = "Hilton", Currency = "USD", ConfirmationNumber = "123456789", } }; var cars = new Car[] { new() { Amount = 123.50, Name = "Hilton", Currency = "USD", ConfirmationNumber = "123456789", } }; var apiRequest = MapperService.MapToApi(passengers, cost, provider, PNR, a14ft); apiRequest.Hotels = hotels; apiRequest.Cars = cars; return(apiRequest); }
public static ApiReservationDetailsRequest MapToApi(IEnumerable <Passenger> passengers, Cost cost, string provider, string PNR, A14FT a14FT) { var apiPassengers = MapToApi(passengers); var apiInvoiceLines = MapToApi(a14FT.InvoiceLines); var apiFtMarkups = MapToApiFtMarkup(a14FT.FtMarkups); var apiInvoiceAmounts = MapToApiInvoiceAmount(a14FT.InvoiceAmounts); return(new ApiReservationDetailsRequest { PNR = PNR, Total = cost.Total, UserId = a14FT.UserId, ProviderName = provider, FtMarkups = apiFtMarkups, ClientId = a14FT.ClientId, Passengers = apiPassengers, IVA = cost.PrimaryTaxAmount, InvoiceLines = apiInvoiceLines, InvoiceTypeId = a14FT.InvoiceTypeId, InvoiceAmounts = apiInvoiceAmounts, InvoicePayment = a14FT.InvoicePaymentType, InvoiceUseTypeId = a14FT.InvoiceUseTypeId, InvoicePaymentMethod = a14FT.InvoicePaymentMethod, }); }