Exemple #1
0
        public async Task SendForeignCompanyInvoiceSucceeds(string countryCode, string taxId)
        {
            var country        = Countries.GetByCode(countryCode).Get();
            var taxpayerNumber = taxId.ToNonEmptyOption().Map(i => TaxpayerIdentificationNumber.Create(country, i).Success.Get());
            var receiver       = Receiver.ForeignCompany(
                name: Name.Create("Foreign test company ltd.").Success.Get(),
                address: CreateAddress(country),
                taxpayerId: taxpayerNumber.GetOrNull()
                );
            var sendInvoicesResult = await SendInvoices(receiver.Success.Get());

            await AssertInvoices(sendInvoicesResult);
        }
Exemple #2
0
        public async Task SendCorrectionForeignCompanyInvoiceSucceeds(string countryCode, string taxId)
        {
            var country        = Countries.GetByCode(countryCode).Get();
            var taxpayerNumber = taxId.ToNonEmptyOption().Map(i => TaxpayerIdentificationNumber.Create(country, i).Success.Get());
            var receiver       = Receiver.ForeignCompany(
                name: Name.Create("Foreign test company ltd.").Success.Get(),
                address: CreateAddress(country),
                taxpayerId: taxpayerNumber.GetOrNull()
                ).Success.Get();
            var invoiceNumber      = InvoiceNumber.Create($"INVOICE-{Guid.NewGuid()}").Success.Get();
            var sendInvoicesResult = await SendInvoices(receiver, invoiceNumber);

            await AssertInvoices(sendInvoicesResult);

            var sendModificationInvoiceResponse = await SendModificationInvoices(receiver, originalInvoiceNumber : invoiceNumber);

            await AssertInvoices(sendModificationInvoiceResponse);
        }