示例#1
0
        public Revenue(LimitedDecimal netValue, TaxType taxType, LimitedDecimal vatValue, IEnumerable <ItemIncomeClassification> incomeClassifications, PositiveInt lineNumber = null, VatExemptionType?vatExemption = null, CityTax cityTax = null)
        {
            NetValue = netValue ?? throw new ArgumentNullException(nameof(netValue));
            TaxType  = taxType;
            VatValue = vatValue ?? throw new ArgumentNullException(nameof(vatValue));
            IncomeClassifications = incomeClassifications ?? throw new ArgumentNullException(nameof(incomeClassifications));
            LineNumber            = lineNumber ?? new PositiveInt(1);
            VatExemption          = vatExemption;
            CityTax = cityTax;

            if (taxType == TaxType.Vat0 && !vatExemption.HasValue)
            {
                throw new ArgumentException($"{nameof(VatExemption)} must be specified when TaxType is {taxType}");
            }

            if (incomeClassifications.Count() == 0)
            {
                throw new ArgumentException($"Minimal count of {nameof(incomeClassifications)} is 1.");
            }
        }
示例#2
0
 public Payment(LimitedDecimal amount, PaymentType paymentType)
 {
     Amount      = amount ?? throw new ArgumentNullException(nameof(amount));
     PaymentType = paymentType;
 }
示例#3
0
 public ItemIncomeClassification(ClassificationType classificationType, ClassificationCategory classificationCategory, LimitedDecimal amount)
 {
     ClassificationType     = classificationType;
     ClassificationCategory = classificationCategory;
     Amount = amount ?? throw new ArgumentNullException(nameof(Amount));
 }