Skip to content

Documentation / @facturometro/validator / 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 ​

ts
import type { CountryContext } from '@facturometro/validator';

const isDanish = (country: CountryContext) => country.supplierAddressRaw === 'DK';

Properties ​

accountingSupplier ​

readonly accountingSupplier: string

Defined in: packages/validator/src/engine/context.ts:62

$accountingSupplierCountry (GR): VAT prefix, else address, else XX; no tax representative.


customer ​

readonly customer: string

Defined in: packages/validator/src/engine/context.ts:64

$customerCountry: customer VAT prefix, else address, else XX.


customerAddress ​

readonly customerAddress: string

Defined in: packages/validator/src/engine/context.ts:66

upper-case(normalize-space(customer address code)) (DE, NL); empty when absent.


customerAddressRaw ​

readonly customerAddressRaw: string

Defined in: packages/validator/src/engine/context.ts:68

The customer's address country code, raw (DK, IS, SE); empty when absent.


supplier ​

readonly supplier: string

Defined in: packages/validator/src/engine/context.ts:70

$supplierCountry: supplier VAT prefix, else tax representative VAT prefix, else address, else XX.


supplierAddress ​

readonly supplierAddress: string

Defined in: packages/validator/src/engine/context.ts:72

upper-case(normalize-space(supplier address code)) (DE, NL); empty when absent.


supplierAddressRaw ​

readonly supplierAddressRaw: string

Defined in: packages/validator/src/engine/context.ts:74

The supplier's address country code, raw (DK, IS, SE); empty when absent.


taxRepAddress ​

readonly taxRepAddress: string

Defined in: packages/validator/src/engine/context.ts:76

upper-case(normalize-space(tax representative address code)) (NL); empty when absent.

MIT licensed. Specification artefacts belong to OpenPEPPOL, CEN and OASIS.