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."); } }
public Payment(LimitedDecimal amount, PaymentType paymentType) { Amount = amount ?? throw new ArgumentNullException(nameof(amount)); PaymentType = paymentType; }
public ItemIncomeClassification(ClassificationType classificationType, ClassificationCategory classificationCategory, LimitedDecimal amount) { ClassificationType = classificationType; ClassificationCategory = classificationCategory; Amount = amount ?? throw new ArgumentNullException(nameof(Amount)); }