示例#1
0
        public void RemoveCarryOver(string fundingLineCode)
        {
            Guard.IsNullOrWhiteSpace(fundingLineCode, nameof(fundingLineCode), "Funding Line Id cannot be missing");

            CarryOvers ??= new List <ProfilingCarryOver>();
            CarryOvers = CarryOvers.Except(CarryOvers.Where(_ =>
                                                            _.FundingLineCode == fundingLineCode))
                         .ToList();
        }
示例#2
0
        public void AddCarryOver(string fundingLineCode,
                                 ProfilingCarryOverType type,
                                 decimal amount)
        {
            Guard.IsNullOrWhiteSpace(fundingLineCode, nameof(fundingLineCode), "Funding Line Id cannot be missing");
            Guard.Ensure(type != ProfilingCarryOverType.Undefined, $"Unsupported {nameof(ProfilingCarryOverType)}");
            Guard.Ensure(amount > 0, "Carry overs must be greater than zero");

            CarryOvers ??= new List <ProfilingCarryOver>();
            CarryOvers.Add(new ProfilingCarryOver
            {
                FundingLineCode = fundingLineCode,
                Type            = type,
                Amount          = amount
            });
        }
示例#3
0
 public decimal?GetCarryOverTotalForFundingLine(string fundingLineCode)
 => CarryOvers?.Where(_ => _.FundingLineCode == fundingLineCode).Sum(_ => _.Amount);