Exemplo n.º 1
0
 public static RoomContractSetAvailability Process(RoomContractSetAvailability availability, CancellationPolicyProcessSettings settings)
 {
     return(new RoomContractSetAvailability(availabilityId: availability.AvailabilityId,
                                            checkInDate: availability.CheckInDate,
                                            checkOutDate: availability.CheckOutDate,
                                            numberOfNights: availability.NumberOfNights,
                                            roomContractSet: RoomContractSetPolicyProcessor.Process(availability.RoomContractSet, availability.CheckInDate,
                                                                                                    settings),
                                            availablePaymentMethods: availability.AvailablePaymentMethods,
                                            accommodation: availability.Accommodation,
                                            countryHtId: availability.CountryHtId,
                                            localityHtId: availability.LocalityHtId,
                                            evaluationToken: availability.EvaluationToken));
 }
        public RoomContractSetAvailability AlignPrices(RoomContractSetAvailability value)
        {
            var roomContractSet = RoomContractSetPriceProcessor.AlignPrices(value.RoomContractSet);

            return(new RoomContractSetAvailability(availabilityId: value.AvailabilityId,
                                                   checkInDate: value.CheckInDate,
                                                   checkOutDate: value.CheckOutDate,
                                                   numberOfNights: value.NumberOfNights,
                                                   roomContractSet: roomContractSet,
                                                   accommodation: value.Accommodation,
                                                   availablePaymentMethods: value.AvailablePaymentMethods,
                                                   countryHtId: value.CountryHtId,
                                                   localityHtId: value.LocalityHtId,
                                                   evaluationToken: value.EvaluationToken));
        }
        private static async ValueTask <RoomContractSetAvailability> ProcessPrices(RoomContractSetAvailability value,
                                                                                   PriceProcessFunction processFunction)
        {
            var roomContractSet = await RoomContractSetPriceProcessor.ProcessPrices(value.RoomContractSet, processFunction);

            return(new RoomContractSetAvailability(availabilityId: value.AvailabilityId,
                                                   checkInDate: value.CheckInDate,
                                                   checkOutDate: value.CheckOutDate,
                                                   numberOfNights: value.NumberOfNights,
                                                   roomContractSet: roomContractSet,
                                                   accommodation: value.Accommodation,
                                                   availablePaymentMethods: value.AvailablePaymentMethods,
                                                   countryHtId: value.CountryHtId,
                                                   localityHtId: value.LocalityHtId,
                                                   evaluationToken: value.EvaluationToken));
        }
 private static Currencies?GetCurrency(RoomContractSetAvailability availabilityDetails)
 => availabilityDetails.RoomContractSet.Rate.Currency == Currencies.NotSpecified
         ? null
         : availabilityDetails.RoomContractSet.Rate.Currency;
 private static MarkupDestinationInfo GetMarkupDestinationInfo(RoomContractSetAvailability availability)
 => new()
 public Task <Result <RoomContractSetAvailability, ProblemDetails> > ConvertCurrencies(RoomContractSetAvailability availabilityDetails)
 => _priceProcessor.ConvertCurrencies(availabilityDetails, ProcessPrices, GetCurrency);
 public Task <RoomContractSetAvailability> ApplyMarkups(RoomContractSetAvailability response, AgentContext agent, Action <MarkupApplicationResult <RoomContractSetAvailability> > logAction)
 => _priceProcessor.ApplyMarkups(agent.ToMarkupSubjectInfo(), response, ProcessPrices, GetMarkupDestinationInfo, logAction);