Beispiel #1
0
        public async Task <ProviderPaymentEvent> GetPaymentEvent(FundingSourcePaymentEvent message)
        {
            var isMonthEnd = await providerPeriodEndService
                             .MonthEndStarted(message.Ukprn, message.CollectionPeriod.AcademicYear, message.CollectionPeriod.Period)
                             .ConfigureAwait(false);

            if (!isMonthEnd)
            {
                return(null);
            }

            paymentLogger.LogVerbose($"Processing Month End for {message.GetType().Name} Ukprn {message.Ukprn} - AcademicYear {message.CollectionPeriod.AcademicYear} - Period {message.CollectionPeriod.Period}");

            var monthEndJobId = await providerPeriodEndService.GetMonthEndJobId(message.Ukprn,
                                                                                message.CollectionPeriod.AcademicYear,
                                                                                message.CollectionPeriod.Period)
                                .ConfigureAwait(false);

            var payment = MapToProviderPaymentEvent(message, monthEndJobId, message.EventId);

            return(payment);
        }