private InvoicePartyInfo(NonNegativeInt?branch = null, TaxpayerIdentificationNumber taxIdentifier = null, string name = null, Address address = null) { Branch = branch ?? NonNegativeInt.Zero(); TaxIdentifier = taxIdentifier.ToOption(); Name = name.ToOption(); Address = address.ToOption(); }
internal static InvoiceParty CreateInvoiceParty(Country country, string taxNumber, string name = null, Address address = null) { return(InvoiceParty.Create( info: InvoicePartyInfo.Create(NonNegativeInt.Zero(), TaxpayerIdentificationNumber.Create(country, taxNumber).Success.Get(), name, address).Success.Get(), country: country ).Success.Get()); }
public static ITry <InvoicePartyInfo, INonEmptyEnumerable <Error> > Create(NonNegativeInt?branch = null, TaxpayerIdentificationNumber taxpayerNumber = null, string name = null, Address address = null) { return(ObjectValidations.NotNull(branch).Map(b => new InvoicePartyInfo(b ?? NonNegativeInt.Zero(), taxpayerNumber, name, address))); }