Beispiel #1
0
 public void PrePopulateContractAllocations(long ukPrn, IList <SupplementaryDataModel> models, CancellationToken cancellationToken)
 {
     foreach (var model in models)
     {
         var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, cancellationToken);
         _cache.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, cancellationToken, ukPrn);
     }
 }
        public bool IsValid(SupplementaryDataModel model)
        {
            var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, CancellationToken.None);

            if (fcsDeliverableCode == 0)
            {
                return(false);
            }

            var contractAllocation = _referenceDataService.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, CancellationToken.None);

            return(contractAllocation != null);
        }
Beispiel #3
0
        public bool IsValid(SupplementaryDataModel model)
        {
            var year  = model.CalendarYear ?? 0;
            var month = model.CalendarMonth ?? 0;

            if (year == 0 || month == 0 || month < ValidationConstants.CalendarMonthMinValue || month > ValidationConstants.CalendarMonthMaxValue)
            {
                return(false);
            }

            var startDateMonth = new DateTime(year, month, 1);

            var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, CancellationToken.None);
            var contractAllocation = _referenceDataService.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, CancellationToken.None);

            return(contractAllocation == null || contractAllocation.EndDate > startDateMonth);
        }
        public bool Execute(SupplementaryDataModel model)
        {
            var year  = model.CalendarYear ?? 0;
            var month = model.CalendarMonth ?? 0;

            if (year == 0 || month == 0 || month < 1 || month > 12)
            {
                return(false);
            }

            var startDateMonthEnd = new DateTime(year, month, DateTime.DaysInMonth(year, month));

            var fcsDeliverableCode = _mappingHelper.GetFcsDeliverableCode(model, CancellationToken.None);
            var contractAllocation = _referenceDataCache.GetContractAllocation(model.ConRefNumber, fcsDeliverableCode, CancellationToken.None);

            return(contractAllocation != null && contractAllocation.StartDate < startDateMonthEnd);
        }