Documentation / @facturometro/einvoice / CountryContext
Interface: CountryContext ​
Defined in: packages/validator/src/engine/context.ts:60
The country of the parties, in every variant the Schematron files derive.
The Peppol file's $supplierCountry/$customerCountry prefer the VAT identifier's prefix and fall back to the address (XX when neither is there); the Greek pattern's $accountingSupplierCountry does the same without the tax representative fallback; the Danish and Icelandic patterns concat() the raw address code; the German and Dutch patterns upper-case(normalize-space()) it; the Swedish pattern compares the raw address code inline.
Example ​
import type { CountryContext } from '@facturometro/validator';
const isDanish = (country: CountryContext) => country.supplierAddressRaw === 'DK';Properties ​
accountingSupplier ​
readonlyaccountingSupplier:string
Defined in: packages/validator/src/engine/context.ts:62
$accountingSupplierCountry (GR): VAT prefix, else address, else XX; no tax representative.
customer ​
readonlycustomer:string
Defined in: packages/validator/src/engine/context.ts:64
$customerCountry: customer VAT prefix, else address, else XX.
customerAddress ​
readonlycustomerAddress:string
Defined in: packages/validator/src/engine/context.ts:66
upper-case(normalize-space(customer address code)) (DE, NL); empty when absent.
customerAddressRaw ​
readonlycustomerAddressRaw:string
Defined in: packages/validator/src/engine/context.ts:68
The customer's address country code, raw (DK, IS, SE); empty when absent.
supplier ​
readonlysupplier:string
Defined in: packages/validator/src/engine/context.ts:70
$supplierCountry: supplier VAT prefix, else tax representative VAT prefix, else address, else XX.
supplierAddress ​
readonlysupplierAddress:string
Defined in: packages/validator/src/engine/context.ts:72
upper-case(normalize-space(supplier address code)) (DE, NL); empty when absent.
supplierAddressRaw ​
readonlysupplierAddressRaw:string
Defined in: packages/validator/src/engine/context.ts:74
The supplier's address country code, raw (DK, IS, SE); empty when absent.
taxRepAddress ​
readonlytaxRepAddress:string
Defined in: packages/validator/src/engine/context.ts:76
upper-case(normalize-space(tax representative address code)) (NL); empty when absent.