@endevops/peppol-schema 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/constants.d.ts +131 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +114 -1
- package/dist/constants.js.map +1 -1
- package/dist/{index-BBzPjq7o.d.ts → index-CILtZytZ.d.ts} +1710 -669
- package/dist/index-CILtZytZ.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1234 -187
- package/dist/index.js.map +1 -1
- package/dist/invoice-response-code-not-needs-schema-DNrfKYLh.js +36 -0
- package/dist/invoice-response-code-not-needs-schema-DNrfKYLh.js.map +1 -0
- package/dist/invoice-response-codes.d.ts +28 -0
- package/dist/invoice-response-codes.d.ts.map +1 -1
- package/dist/invoice-response-codes.js +11 -1
- package/dist/invoice-response-codes.js.map +1 -1
- package/dist/{is-valid-abn-160i38PG.js → is-valid-abn-D7eSygBG.js} +115 -2
- package/dist/is-valid-abn-D7eSygBG.js.map +1 -0
- package/dist/{is-valid-mod97-0208-CzMOXMO-.js → is-valid-mod97-0208-CjR324eG.js} +11 -1
- package/dist/is-valid-mod97-0208-CjR324eG.js.map +1 -0
- package/dist/message-level-response-profile-id-B9c0A7S_.js +27 -0
- package/dist/message-level-response-profile-id-B9c0A7S_.js.map +1 -0
- package/dist/{nodable-parser-CyDZtLCK.js → nodable-parser-CupS2H55.js} +31 -1
- package/dist/nodable-parser-CupS2H55.js.map +1 -0
- package/dist/schematron.d.ts +57 -1
- package/dist/schematron.d.ts.map +1 -1
- package/dist/schematron.js +453 -2
- package/dist/schematron.js.map +1 -1
- package/dist/validations.d.ts +132 -0
- package/dist/validations.d.ts.map +1 -1
- package/dist/validations.js +11 -2
- package/dist/validations.js.map +1 -1
- package/dist/values.d.ts +67 -2
- package/dist/values.d.ts.map +1 -1
- package/dist/xml.d.ts +30 -0
- package/dist/xml.d.ts.map +1 -1
- package/dist/xml.js +10 -1
- package/dist/xml.js.map +1 -1
- package/package.json +3 -2
- package/src/constants/credit-note-doctype-id.ts +9 -0
- package/src/constants/credit-note-process-id.ts +9 -0
- package/src/constants/document-scheme.ts +9 -0
- package/src/constants/invoice-doctype-id.ts +9 -0
- package/src/constants/invoice-process-id.ts +10 -0
- package/src/constants/invoice-response-doctype-id.ts +10 -0
- package/src/constants/invoice-response-process-id.ts +9 -0
- package/src/constants/invoice-response-profile-id.ts +9 -0
- package/src/constants/message-level-response-doctype-id.ts +10 -0
- package/src/constants/message-level-response-process-id.ts +9 -0
- package/src/constants/message-level-response-profile-id.ts +9 -0
- package/src/constants/participant-scheme.ts +10 -0
- package/src/constants/process-scheme.ts +9 -0
- package/src/constants/transport-profile.ts +10 -0
- package/src/invoice-response-codes/invoice-response-code-needs-schema.ts +9 -0
- package/src/invoice-response-codes/invoice-response-code-not-needs-schema.ts +9 -0
- package/src/invoice-response-codes/invoice-response-codes-order.ts +10 -0
- package/src/peppol-validations/add-piva.ts +12 -0
- package/src/peppol-validations/check-cf.ts +11 -0
- package/src/peppol-validations/check-cf16.ts +12 -0
- package/src/peppol-validations/check-piva-se-it.ts +11 -0
- package/src/peppol-validations/check-piva.ts +11 -0
- package/src/peppol-validations/check-se-orgnr.ts +9 -0
- package/src/peppol-validations/greek-tin-verification.ts +9 -0
- package/src/peppol-validations/is-valid-abn.ts +9 -0
- package/src/peppol-validations/is-valid-gln.ts +10 -0
- package/src/peppol-validations/is-valid-iban.ts +10 -0
- package/src/peppol-validations/is-valid-mod11.ts +9 -0
- package/src/peppol-validations/is-valid-mod97-0208.ts +10 -0
- package/src/peppol-validations/luhn-check.ts +9 -0
- package/src/schemas/fields/default-customization-id.ts +9 -0
- package/src/schemas/fields/default-profile-id.ts +9 -0
- package/src/schemas/fields/peppol-additional-document-reference-schema.ts +41 -2
- package/src/schemas/fields/peppol-address-schema.ts +25 -2
- package/src/schemas/fields/peppol-allowance-charge-schema.ts +65 -9
- package/src/schemas/fields/peppol-amount-schema.ts +15 -2
- package/src/schemas/fields/peppol-base-line-schema.ts +12 -2
- package/src/schemas/fields/peppol-billing-reference-schema.ts +13 -0
- package/src/schemas/fields/peppol-binary-object-schema.ts +12 -4
- package/src/schemas/fields/peppol-contact-schema.ts +11 -0
- package/src/schemas/fields/peppol-credit-note-line-schema.ts +7 -2
- package/src/schemas/fields/peppol-delivery-schema.ts +44 -2
- package/src/schemas/fields/peppol-identifier-schema.ts +8 -0
- package/src/schemas/fields/peppol-invoice-line-period-schema.ts +11 -0
- package/src/schemas/fields/peppol-invoice-line-schema.ts +9 -2
- package/src/schemas/fields/peppol-invoice-period-schema.ts +2 -2
- package/src/schemas/fields/peppol-item-classification-schema.ts +2 -2
- package/src/schemas/fields/peppol-line-allowance-charge-schema.ts +57 -9
- package/src/schemas/fields/peppol-line-item-schema.ts +69 -4
- package/src/schemas/fields/peppol-line-price-allowance-charge-schema.ts +20 -0
- package/src/schemas/fields/peppol-line-price-schema.ts +2 -0
- package/src/schemas/fields/peppol-order-reference-schema.ts +2 -0
- package/src/schemas/fields/peppol-party-base-schema.ts +36 -4
- package/src/schemas/fields/peppol-party-legal-entity-schema.ts +13 -0
- package/src/schemas/fields/peppol-party-tax-scheme-schema.ts +5 -0
- package/src/schemas/fields/peppol-payee-party-schema.ts +2 -2
- package/src/schemas/fields/peppol-payment-means-schema.ts +62 -2
- package/src/schemas/fields/peppol-payment-terms-schema.ts +2 -0
- package/src/schemas/fields/peppol-quantity-schema.ts +4 -2
- package/src/schemas/fields/peppol-reference-schema.ts +20 -1
- package/src/schemas/fields/peppol-tax-category-schema.ts +12 -2
- package/src/schemas/fields/peppol-tax-representative-schema.ts +5 -0
- package/src/schemas/fields/peppol-tax-subtotal-category-schema.ts +3 -0
- package/src/schemas/fields/peppol-tax-subtotal-schema.ts +2 -0
- package/src/schemas/fields/peppol-tax-totals-base-schema.ts +5 -0
- package/src/schemas/peppol-billing-base-schema.ts +47 -7
- package/src/schemas/peppol-credit-note-schema.ts +2 -2
- package/src/schemas/peppol-document-response-document-reference-schema.ts +15 -2
- package/src/schemas/peppol-document-response-document-schema.ts +8 -3
- package/src/schemas/peppol-document-response-line-response-content-schema.ts +22 -2
- package/src/schemas/peppol-document-response-line-response-schema.ts +26 -0
- package/src/schemas/peppol-document-schema.ts +74 -9
- package/src/schemas/peppol-invoice-response-document-actual-response-schema.ts +58 -5
- package/src/schemas/peppol-invoice-response-document-actual-response-status-schema.ts +25 -2
- package/src/schemas/peppol-invoice-response-schema.ts +57 -4
- package/src/schemas/peppol-invoice-response-status-reason-code-schema.ts +37 -10
- package/src/schemas/peppol-invoice-schema.ts +30 -2
- package/src/schemas/peppol-message-level-response-document-response-schema.ts +10 -0
- package/src/schemas/peppol-message-level-response-party-schema.ts +10 -0
- package/src/schemas/peppol-message-level-response-schema.ts +18 -0
- package/src/schemas/utils/format-quantity-with-unit.ts +19 -0
- package/src/schemas/utils/get-credit-note-type-code-description.ts +12 -0
- package/src/schemas/utils/get-invoice-type-code-description.ts +12 -0
- package/src/schemas/utils/is-valid-credit-note-type-code.ts +13 -0
- package/src/schemas/utils/is-valid-invoice-type-code.ts +13 -0
- package/src/schemas/utils/is-valid-process.ts +13 -0
- package/src/schemas/utils/peppol-base-64-schema.ts +14 -4
- package/src/schemas/utils/peppol-vat-regex-schema.ts +38 -30
- package/src/schemas/utils/peppol-xsd-time-schema.ts +12 -2
- package/src/schemas/utils/quantity-unit-code-to-intl-unit.ts +34 -0
- package/src/schemas/values/additional-document-reference-code-schema.ts +9 -15
- package/src/schemas/values/allowance-charge-reason-code-schema.ts +12 -14
- package/src/schemas/values/application-response-type-code-schema.ts +10 -14
- package/src/schemas/values/charge-reason-code-schema.ts +12 -14
- package/src/schemas/values/credit-note-type-code-schema.ts +8 -14
- package/src/schemas/values/currency-code-schema.ts +13 -16
- package/src/schemas/values/document-type-schemes-schema.ts +9 -5
- package/src/schemas/values/document-type-values-schema.ts +5 -6
- package/src/schemas/values/duty-tax-fee-category-schema.ts +15 -13
- package/src/schemas/values/electronic-codes-schema.ts +10 -12
- package/src/schemas/values/icd-codes-schema.ts +8 -12
- package/src/schemas/values/invoice-status-code-schema.ts +10 -12
- package/src/schemas/values/invoice-type-code-schema.ts +10 -12
- package/src/schemas/values/item-classification-codes-schema.ts +10 -12
- package/src/schemas/values/mime-codes-schema.ts +12 -14
- package/src/schemas/values/op-status-action-schema.ts +10 -12
- package/src/schemas/values/op-status-reason-schema.ts +10 -12
- package/src/schemas/values/participant-identifier-code-schema.ts +10 -13
- package/src/schemas/values/payment-means-code-schema.ts +10 -12
- package/src/schemas/values/peppol-country-code-schema.ts +10 -9
- package/src/schemas/values/peppol-document-type-code-schema.ts +10 -12
- package/src/schemas/values/peppol-document-type-schema.ts +12 -21
- package/src/schemas/values/peppol-process-schema.ts +19 -15
- package/src/schemas/values/process-from-document-type-schema.ts +3 -3
- package/src/schemas/values/quantity-unit-codes-schema.ts +10 -12
- package/src/schemas/values/vat-date-code-schema.ts +12 -5
- package/src/schemas/values/vatex-code-schema.ts +8 -12
- package/src/schematron/errors.ts +14 -0
- package/src/schematron/helpers.ts +451 -0
- package/src/schematron/run-all-rules.ts +10 -0
- package/src/schematron/schematron.ts +25 -0
- package/src/xml/builder-options.ts +9 -0
- package/src/xml/common-xml-options.ts +9 -0
- package/src/xml/nodable-parser.ts +12 -0
- package/src/xml/parser-options.ts +9 -0
- package/dist/index-BBzPjq7o.d.ts.map +0 -1
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js +0 -18
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js.map +0 -1
- package/dist/is-valid-abn-160i38PG.js.map +0 -1
- package/dist/is-valid-mod97-0208-CzMOXMO-.js.map +0 -1
- package/dist/message-level-response-profile-id-DBpOW91B.js +0 -9
- package/dist/message-level-response-profile-id-DBpOW91B.js.map +0 -1
- package/dist/nodable-parser-CyDZtLCK.js.map +0 -1
- package/dist/vat-dates.generated-CxFvt7m3.d.ts +0 -68
- package/dist/vat-dates.generated-CxFvt7m3.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import { n as INVOICE_RESPONSE_PROFILE_ID, t as MESSAGE_LEVEL_RESPONSE_PROFILE_ID } from "./message-level-response-profile-id-
|
|
1
|
+
import { n as INVOICE_RESPONSE_PROFILE_ID, t as MESSAGE_LEVEL_RESPONSE_PROFILE_ID } from "./message-level-response-profile-id-B9c0A7S_.js";
|
|
2
2
|
import { n as opaque, t as PeppolIsoDateString } from "./peppol-iso-date-string-BXLxzxdz.js";
|
|
3
3
|
import { c as chargeReasonCodesKeys, f as currencyCodesKeys, i as vatDateCodesKeys, m as mimeCodesKeys, n as electronicAddressCodesKeys, o as countryCodesKeys, u as allowanceChargeReasonCodesKeys } from "./eas-codes.generated-D8jjHFij.js";
|
|
4
4
|
import { A as invoiceTypeCodes, C as opStatusActionKeys, D as documentTypeCodesKeys, F as itemClassificationCodesKeys, L as paymentMeansCodesKeys, M as quantityUnitCodes, N as quantityUnitCodesKeys, O as creditNoteTypeCodes, T as applicationResponseTypeCodesKeys, U as additionalDocumentReferenceCodesKeys, V as dutyTaxFeeCategoriesKeys, _ as processesKeys, a as participantIdentifierSchemesKeys, c as invoiceStatusCodesKeys, d as documentTypesProcessIds, f as documentTypesScheme, g as processes, j as invoiceTypeCodesKeys, k as creditNoteTypeCodesKeys, m as documentTypesTableKeys, n as vatexCodesKeys, p as documentTypesTable, v as processesList, x as opStatusReasonKeys, z as icdCodesKeys } from "./vatex-codes.generated-N7wsUrLh.js";
|
|
5
|
-
import { n as invoiceResponseCodeNeedsSchema, t as invoiceResponseCodeNotNeedsSchema } from "./invoice-response-code-not-needs-schema-
|
|
6
|
-
import { n as builderOptions, t as parseXmlNodable } from "./nodable-parser-
|
|
7
|
-
import { t as isValidMod97_0208 } from "./is-valid-mod97-0208-
|
|
5
|
+
import { n as invoiceResponseCodeNeedsSchema, t as invoiceResponseCodeNotNeedsSchema } from "./invoice-response-code-not-needs-schema-DNrfKYLh.js";
|
|
6
|
+
import { n as builderOptions, t as parseXmlNodable } from "./nodable-parser-CupS2H55.js";
|
|
7
|
+
import { t as isValidMod97_0208 } from "./is-valid-mod97-0208-CjR324eG.js";
|
|
8
8
|
import { Clock, DateTime, Effect, Option, Predicate, Record, Schema, SchemaGetter, SchemaIssue, Struct } from "effect";
|
|
9
9
|
import XMLBuilder from "fast-xml-builder";
|
|
10
10
|
//#region src/schemas/fields/default-customization-id.ts
|
|
11
|
+
/**
|
|
12
|
+
* @description The default PEPPOL BIS Billing 3.0 customization identifier, which identifies the EN 16931 compliant billing rule set. Used as the decoding default
|
|
13
|
+
* for the `customizationId` field of {@link PeppolBillingBase}.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* DEFAULT_CUSTOMIZATION_ID; // 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'
|
|
18
|
+
* ```;
|
|
19
|
+
*/
|
|
11
20
|
const DEFAULT_CUSTOMIZATION_ID = "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0";
|
|
12
21
|
//#endregion
|
|
13
22
|
//#region src/schemas/fields/default-profile-id.ts
|
|
23
|
+
/**
|
|
24
|
+
* @description The default PEPPOL BIS Billing 3.0 profile identifier, which identifies the billing process the document follows. Used as the decoding default for
|
|
25
|
+
* the `profileId` field of {@link PeppolBillingBase}.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* DEFAULT_PROFILE_ID; // 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0'
|
|
30
|
+
* ```;
|
|
31
|
+
*/
|
|
14
32
|
const DEFAULT_PROFILE_ID = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0";
|
|
15
33
|
//#endregion
|
|
16
34
|
//#region src/schemas/utils/peppol-base-64-schema.ts
|
|
@@ -18,27 +36,42 @@ const BASE64_RE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=
|
|
|
18
36
|
/**
|
|
19
37
|
* @description RFC 4648 base64 string (PEM / MIME / XML line endings tolerated). Effect port of `base64Schema` (`z.string().check(z.refine(...))`): strips CRLF /
|
|
20
38
|
* LF line endings before testing the quantum regex.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const value = 'SGVsbG8=';
|
|
43
|
+
* ```;
|
|
21
44
|
*/
|
|
22
|
-
|
|
45
|
+
var PeppolBase64 = class extends opaque()(Schema.String.check(Schema.makeFilter((val) => BASE64_RE.test(val.replace(/\r?\n/g, "")))).annotate({ message: "Invalid base64" })) {};
|
|
23
46
|
//#endregion
|
|
24
47
|
//#region src/schemas/values/mime-codes-schema.ts
|
|
25
48
|
/**
|
|
26
|
-
* @description
|
|
27
|
-
*
|
|
28
|
-
* @param error - The custom error message to use when validation fails.
|
|
49
|
+
* @description A MIME media type from the PEPPOL MIME code list.
|
|
29
50
|
*
|
|
30
|
-
* @
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* 'text/csv';
|
|
54
|
+
* ```;
|
|
31
55
|
*
|
|
32
56
|
* @validations
|
|
33
57
|
* - PEPPOL-EN16931-CL001: Attachment (MIME) type MUST come from the allowed list.
|
|
34
58
|
*
|
|
35
59
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/MimeCode/
|
|
60
|
+
* @see {@link mimeCodesKeys}
|
|
36
61
|
*/
|
|
37
|
-
|
|
62
|
+
var PeppolMimeCode = class extends opaque()(Schema.Literals(mimeCodesKeys).pipe(Schema.brand("PeppolMimeCode")).annotate({ documentation: "PEPPOL-EN16931-CL001: Mime code must be according to subset of IANA code list." })) {};
|
|
38
63
|
//#endregion
|
|
39
64
|
//#region src/schemas/fields/peppol-binary-object-schema.ts
|
|
40
65
|
const base64UrlSchema = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9\-_]+={0,2}$/)).annotate({ message: "Invalid base64url" });
|
|
41
66
|
/**
|
|
67
|
+
* @description An attached document embedded in the Invoice as a Base64 encoded binary object, together with its MIME type and file name. Wraps the
|
|
68
|
+
* `cbc:EmbeddedDocumentBinaryObject` element.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* { content: 'aHR0cHM6Ly90ZXN0LXZlZmEuZGlmaS5uby9wZXBwb2xiaXM=', mimeCode: 'text/csv', filename: 'Hours - spent.csv' }
|
|
73
|
+
* ```;
|
|
74
|
+
*
|
|
42
75
|
* @summary Binary object for attachments
|
|
43
76
|
*
|
|
44
77
|
* @name cbc:EmbeddedDocumentBinaryObject (+ @mimeCode, @filename)
|
|
@@ -54,7 +87,7 @@ var PeppolBinaryObject = class extends opaque()(Schema.Struct({
|
|
|
54
87
|
*
|
|
55
88
|
* @name `#text` (Base64 content)
|
|
56
89
|
*/
|
|
57
|
-
content: Schema.Union([
|
|
90
|
+
content: Schema.Union([PeppolBase64, base64UrlSchema]),
|
|
58
91
|
/**
|
|
59
92
|
* @description The mime code of the attached document.
|
|
60
93
|
*
|
|
@@ -65,7 +98,7 @@ var PeppolBinaryObject = class extends opaque()(Schema.Struct({
|
|
|
65
98
|
*
|
|
66
99
|
* @name `@mimeCode`
|
|
67
100
|
*/
|
|
68
|
-
mimeCode:
|
|
101
|
+
mimeCode: PeppolMimeCode,
|
|
69
102
|
/**
|
|
70
103
|
* @description The file name of the attached document.
|
|
71
104
|
*
|
|
@@ -81,6 +114,14 @@ var PeppolBinaryObject = class extends opaque()(Schema.Struct({
|
|
|
81
114
|
//#endregion
|
|
82
115
|
//#region src/schemas/fields/peppol-identifier-schema.ts
|
|
83
116
|
/**
|
|
117
|
+
* @description A generic identifier paired with an optional identification scheme identifier. Wraps a `cbc:ID` element and its optional `@schemeID` attribute, and
|
|
118
|
+
* is reused across document references.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* { id: '99887766', schemeId: '0088' }
|
|
123
|
+
* ```;
|
|
124
|
+
*
|
|
84
125
|
* @summary Identifier with optional scheme
|
|
85
126
|
*
|
|
86
127
|
* @name `cbc:ID (+ optional @schemeID)`
|
|
@@ -98,18 +139,30 @@ var PeppolIdentifier = class extends opaque()(Schema.Struct({
|
|
|
98
139
|
//#endregion
|
|
99
140
|
//#region src/schemas/values/additional-document-reference-code-schema.ts
|
|
100
141
|
/**
|
|
101
|
-
* @description
|
|
102
|
-
*
|
|
103
|
-
* @param error - The custom error message to use when validation fails. Defaults to the generic message.
|
|
142
|
+
* @description An additional document reference code from the PEPPOL subset of UNCL 1153 (invoiced object identifier scheme).
|
|
104
143
|
*
|
|
105
|
-
* @
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* 'AAA';
|
|
147
|
+
* ```;
|
|
106
148
|
*
|
|
107
149
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL1153/
|
|
108
150
|
* @see {@link additionalDocumentReferenceCodesKeys}
|
|
109
151
|
*/
|
|
110
|
-
|
|
152
|
+
var PeppolAdditionalDocumentReferenceCode = class extends opaque()(Schema.Literals(additionalDocumentReferenceCodesKeys).pipe(Schema.brand("PeppolAdditionalDocumentReferenceCode"))) {};
|
|
111
153
|
//#endregion
|
|
112
154
|
//#region src/schemas/fields/peppol-additional-document-reference-schema.ts
|
|
155
|
+
/**
|
|
156
|
+
* @description A reference to a supporting document that is stored outside the Invoice, identified by a URI. Wraps the `cac:ExternalReference` element of an
|
|
157
|
+
* attachment group.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* { uri: 'http://www.example.com/index.html' }
|
|
162
|
+
* ```;
|
|
163
|
+
*
|
|
164
|
+
* @see {@link PeppolAttachment}
|
|
165
|
+
*/
|
|
113
166
|
var PeppolAttachmentExternalReference = class extends opaque()(Schema.Struct({
|
|
114
167
|
/**
|
|
115
168
|
* @description The URL (Uniform Resource Locator) that identifies where the external document is located. A means of locating the resource, including its
|
|
@@ -123,6 +176,23 @@ var PeppolAttachmentExternalReference = class extends opaque()(Schema.Struct({
|
|
|
123
176
|
* @name `cbc:URI`
|
|
124
177
|
*/
|
|
125
178
|
uri: Schema.String })) {};
|
|
179
|
+
/**
|
|
180
|
+
* @description The attachment of a supporting document to the Invoice, either embedded as a Base64 binary object or referenced by URI. Wraps the `cac:Attachment`
|
|
181
|
+
* element of an additional supporting document.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* {
|
|
186
|
+
* embeddedDocumentBinaryObject: {
|
|
187
|
+
* content: 'aHR0cHM6Ly90ZXN0LXZlZmEuZGlmaS5uby9wZXBwb2xiaXM=',
|
|
188
|
+
* mimeCode: 'text/csv',
|
|
189
|
+
* filename: 'Hours - spent.csv'
|
|
190
|
+
* }
|
|
191
|
+
* }
|
|
192
|
+
* ```;
|
|
193
|
+
*
|
|
194
|
+
* @see {@link PeppolAdditionalDocumentReference}
|
|
195
|
+
*/
|
|
126
196
|
var PeppolAttachment = class extends opaque()(Schema.Struct({
|
|
127
197
|
/**
|
|
128
198
|
* @description An attached document embedded as binary object (Base64) or sent together with the invoice.
|
|
@@ -144,6 +214,17 @@ var PeppolAttachment = class extends opaque()(Schema.Struct({
|
|
|
144
214
|
*/
|
|
145
215
|
externalReference: Schema.optional(PeppolAttachmentExternalReference)
|
|
146
216
|
})) {};
|
|
217
|
+
/**
|
|
218
|
+
* @description The identifier of an additional supporting document, an invoiced object reference or a project reference, together with an optional identification
|
|
219
|
+
* scheme identifier.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```ts
|
|
223
|
+
* { id: '9873242' }
|
|
224
|
+
* ```;
|
|
225
|
+
*
|
|
226
|
+
* @see {@link PeppolAdditionalDocumentReference}
|
|
227
|
+
*/
|
|
147
228
|
var PeppolId = class extends opaque()(Schema.Struct({
|
|
148
229
|
/**
|
|
149
230
|
* @description An identifier for an object on which the invoice is based (with DocumentTypeCode=130), given by the Seller, the identifier for the supporting
|
|
@@ -161,7 +242,7 @@ var PeppolId = class extends opaque()(Schema.Struct({
|
|
|
161
242
|
*
|
|
162
243
|
* @name `@schemeID`
|
|
163
244
|
*/
|
|
164
|
-
schemeId: Schema.optional(
|
|
245
|
+
schemeId: Schema.optional(PeppolAdditionalDocumentReferenceCode)
|
|
165
246
|
})) {};
|
|
166
247
|
/**
|
|
167
248
|
* @description A group of business terms providing information about additional supporting documents substantiating the claims made in the Invoice. The additional
|
|
@@ -221,21 +302,31 @@ var PeppolAdditionalDocumentReference = class extends opaque()(PeppolIdentifier.
|
|
|
221
302
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ISO4217/
|
|
222
303
|
*/
|
|
223
304
|
/**
|
|
224
|
-
* @description
|
|
225
|
-
*
|
|
226
|
-
* @param error - The custom error message to use when validation fails.
|
|
305
|
+
* @description An ISO 4217 currency code from the PEPPOL codelist.
|
|
227
306
|
*
|
|
228
|
-
* @
|
|
307
|
+
* @example
|
|
308
|
+
* ```ts
|
|
309
|
+
* 'AED';
|
|
310
|
+
* ```;
|
|
229
311
|
*
|
|
230
312
|
* @validations
|
|
231
313
|
* - PEPPOL-EN16931-CL007: Currency codes MUST be valid ISO 4217 codes.
|
|
232
314
|
*
|
|
233
315
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ISO4217/
|
|
316
|
+
* @see {@link currencyCodesKeys}
|
|
234
317
|
*/
|
|
235
|
-
|
|
318
|
+
var PeppolCurrencyCode = class extends opaque()(Schema.Literals(currencyCodesKeys).pipe(Schema.brand("PeppolCurrencyCode"))) {};
|
|
236
319
|
//#endregion
|
|
237
320
|
//#region src/schemas/fields/peppol-amount-schema.ts
|
|
238
321
|
/**
|
|
322
|
+
* @description A monetary amount paired with the currency it is expressed in. Wraps a `cbc:*` amount element whose `@currencyID` attribute names the currency and
|
|
323
|
+
* whose text is the value.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```ts
|
|
327
|
+
* { currencyId: 'EUR', value: 4500.0 }
|
|
328
|
+
* ```;
|
|
329
|
+
*
|
|
239
330
|
* @summary Monetary amount with mandatory currency
|
|
240
331
|
*
|
|
241
332
|
* @name cbc:* (+ @currencyID)
|
|
@@ -244,7 +335,7 @@ var PeppolAmount = class extends opaque()(Schema.Struct({
|
|
|
244
335
|
/**
|
|
245
336
|
* @name \@currencyID
|
|
246
337
|
*/
|
|
247
|
-
currencyId:
|
|
338
|
+
currencyId: PeppolCurrencyCode,
|
|
248
339
|
/**
|
|
249
340
|
* @name #text (value)
|
|
250
341
|
*/
|
|
@@ -252,6 +343,16 @@ var PeppolAmount = class extends opaque()(Schema.Struct({
|
|
|
252
343
|
})) {};
|
|
253
344
|
//#endregion
|
|
254
345
|
//#region src/schemas/fields/peppol-line-price-allowance-charge-schema.ts
|
|
346
|
+
/**
|
|
347
|
+
* @description A price level allowance or charge applied to the item price, expressed as an amount and a charge indicator.
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* ```ts
|
|
351
|
+
* { amount: { value: 200, currencyId: 'EUR' }, chargeIndicator: false }
|
|
352
|
+
* ```;
|
|
353
|
+
*
|
|
354
|
+
* @see {@link PeppolLinePriceAllowanceCharge}
|
|
355
|
+
*/
|
|
255
356
|
var PriceAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
256
357
|
/**
|
|
257
358
|
* @example
|
|
@@ -274,39 +375,64 @@ var PriceAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
|
274
375
|
*/
|
|
275
376
|
chargeIndicator: Schema.Boolean
|
|
276
377
|
})) {};
|
|
378
|
+
/**
|
|
379
|
+
* @description A price level allowance on the item price. Only allowances are allowed at price level, so the charge indicator is fixed to false.
|
|
380
|
+
*
|
|
381
|
+
* @example
|
|
382
|
+
* ```ts
|
|
383
|
+
* { amount: { value: 200, currencyId: 'EUR' }, chargeIndicator: false }
|
|
384
|
+
* ```;
|
|
385
|
+
*
|
|
386
|
+
* @see {@link PeppolLinePrice}
|
|
387
|
+
*/
|
|
277
388
|
var PeppolLinePriceAllowanceCharge = class extends opaque()(PriceAllowanceCharge.pipe(Schema.fieldsAssign({ chargeIndicator: Schema.Literal(false).annotate({ message: "PEPPOL-EN16931-R044: Charge on price level is NOT allowed. Only value 'false' allowed." }) }))) {};
|
|
278
389
|
//#endregion
|
|
279
390
|
//#region src/schemas/values/allowance-charge-reason-code-schema.ts
|
|
280
391
|
/**
|
|
281
|
-
* @description
|
|
392
|
+
* @description An allowance or charge reason code from the PEPPOL subset of UNCL 5189 (D.16B).
|
|
282
393
|
*
|
|
283
|
-
* @
|
|
284
|
-
*
|
|
285
|
-
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```ts
|
|
396
|
+
* '41';
|
|
397
|
+
* ```;
|
|
286
398
|
*
|
|
287
399
|
* @validations
|
|
288
400
|
* - PEPPOL-EN16931-CL002: Document allowance reason code MUST be according to the subset of UNCL 5189 D.16B.
|
|
289
401
|
*
|
|
290
402
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5189/
|
|
403
|
+
* @see {@link allowanceChargeReasonCodesKeys}
|
|
291
404
|
*/
|
|
292
|
-
|
|
405
|
+
var PeppolAllowanceChargeReasonCode = class extends opaque()(Schema.Literals(allowanceChargeReasonCodesKeys).pipe(Schema.brand("PeppolAllowanceChargeReasonCode")).annotate({ documentation: "PEPPOL-EN16931-CL002: Reason code MUST be according to subset of UNCL 5189 D.16B." })) {};
|
|
293
406
|
//#endregion
|
|
294
407
|
//#region src/schemas/values/charge-reason-code-schema.ts
|
|
295
408
|
/**
|
|
296
|
-
* @description
|
|
409
|
+
* @description A charge reason code from the PEPPOL subset of UNCL 7161 (D.16B).
|
|
297
410
|
*
|
|
298
|
-
* @
|
|
299
|
-
*
|
|
300
|
-
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```ts
|
|
413
|
+
* 'AA';
|
|
414
|
+
* ```;
|
|
301
415
|
*
|
|
302
416
|
* @validations
|
|
303
417
|
* - PEPPOL-EN16931-CL003: Charge reason code MUST be according to UNCL 7161 D.16B.
|
|
304
418
|
*
|
|
305
419
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL7161/
|
|
420
|
+
* @see {@link chargeReasonCodesKeys}
|
|
306
421
|
*/
|
|
307
|
-
|
|
422
|
+
var PeppolChargeReasonCode = class extends opaque()(Schema.Literals(chargeReasonCodesKeys).pipe(Schema.brand("PeppolChargeReasonCode")).annotate({ documentation: "PEPPOL-EN16931-CL003: Reason code MUST be according to UNCL 7161 D.16B." })) {};
|
|
308
423
|
//#endregion
|
|
309
424
|
//#region src/schemas/fields/peppol-line-allowance-charge-schema.ts
|
|
425
|
+
/**
|
|
426
|
+
* @description Shared fields for an allowance or charge applied to an Invoice line. Extends the price level allowance and charge fields with the reason text and
|
|
427
|
+
* the multiplier factor used to calculate the amount.
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* ```ts
|
|
431
|
+
* { amount: { value: 200, currencyId: 'EUR' }, chargeIndicator: false, allowanceChargeReason: 'Discount' }
|
|
432
|
+
* ```;
|
|
433
|
+
*
|
|
434
|
+
* @see {@link PeppolLineAllowanceCharge}
|
|
435
|
+
*/
|
|
310
436
|
var BaseLineAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
311
437
|
...PriceAllowanceCharge.fields,
|
|
312
438
|
allowanceChargeReason: Schema.optional(Schema.String),
|
|
@@ -318,12 +444,23 @@ var BaseLineAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
|
318
444
|
*/
|
|
319
445
|
multiplierFactorNumeric: Schema.optional(Schema.Finite)
|
|
320
446
|
})) {};
|
|
447
|
+
/**
|
|
448
|
+
* @description An allowance applied to an Invoice line, marked by a `cbc:ChargeIndicator` of `false`. Adds an allowance reason code to the shared line allowance
|
|
449
|
+
* and charge fields.
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```ts
|
|
453
|
+
* { amount: { value: 200, currencyId: 'EUR' }, chargeIndicator: false, allowanceChargeReasonCode: '95' }
|
|
454
|
+
* ```;
|
|
455
|
+
*
|
|
456
|
+
* @see {@link PeppolLineAllowanceCharge}
|
|
457
|
+
*/
|
|
321
458
|
var PeppolLineAllowance = class extends opaque()(Schema.Struct({
|
|
322
459
|
...BaseLineAllowanceCharge.fields,
|
|
323
460
|
/**
|
|
324
461
|
* @name cbc:AllowanceChargeReasonCode
|
|
325
462
|
*/
|
|
326
|
-
allowanceChargeReasonCode: Schema.optional(
|
|
463
|
+
allowanceChargeReasonCode: Schema.optional(PeppolAllowanceChargeReasonCode),
|
|
327
464
|
/**
|
|
328
465
|
* @name cbc:ChargeIndicator
|
|
329
466
|
*
|
|
@@ -331,12 +468,23 @@ var PeppolLineAllowance = class extends opaque()(Schema.Struct({
|
|
|
331
468
|
*/
|
|
332
469
|
chargeIndicator: Schema.Literal(false).annotate({ message: "PEPPOL-EN16931-R043: Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'" })
|
|
333
470
|
})) {};
|
|
471
|
+
/**
|
|
472
|
+
* @description A charge applied to an Invoice line, marked by a `cbc:ChargeIndicator` of `true`. Adds a charge reason code to the shared line allowance and charge
|
|
473
|
+
* fields.
|
|
474
|
+
*
|
|
475
|
+
* @example
|
|
476
|
+
* ```ts
|
|
477
|
+
* { amount: { value: 25, currencyId: 'EUR' }, chargeIndicator: true, allowanceChargeReasonCode: 'AA' }
|
|
478
|
+
* ```;
|
|
479
|
+
*
|
|
480
|
+
* @see {@link PeppolLineAllowanceCharge}
|
|
481
|
+
*/
|
|
334
482
|
var PeppolLineCharge = class extends opaque()(Schema.Struct({
|
|
335
483
|
...BaseLineAllowanceCharge.fields,
|
|
336
484
|
/**
|
|
337
485
|
* @name cbc:AllowanceChargeReasonCode
|
|
338
486
|
*/
|
|
339
|
-
allowanceChargeReasonCode: Schema.optional(
|
|
487
|
+
allowanceChargeReasonCode: Schema.optional(PeppolChargeReasonCode),
|
|
340
488
|
/**
|
|
341
489
|
* @name cbc:ChargeIndicator
|
|
342
490
|
*
|
|
@@ -344,24 +492,47 @@ var PeppolLineCharge = class extends opaque()(Schema.Struct({
|
|
|
344
492
|
*/
|
|
345
493
|
chargeIndicator: Schema.Literal(true).annotate({ message: "PEPPOL-EN16931-R043: Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'" })
|
|
346
494
|
})) {};
|
|
347
|
-
|
|
495
|
+
/**
|
|
496
|
+
* @description An allowance or charge applied to an Invoice line, selected by the `cbc:ChargeIndicator` value: `false` selects an allowance, `true` selects a
|
|
497
|
+
* charge.
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```ts
|
|
501
|
+
* { amount: { value: 25, currencyId: 'EUR' }, chargeIndicator: true, allowanceChargeReasonCode: 'AA', allowanceChargeReason: 'Advertising' }
|
|
502
|
+
* ```;
|
|
503
|
+
*
|
|
504
|
+
* @see {@link PeppolLineAllowance}
|
|
505
|
+
*/
|
|
506
|
+
var PeppolLineAllowanceCharge = class extends opaque()(Schema.Union([PeppolLineAllowance, PeppolLineCharge]).annotate({ message: "unable to decode line allowance charge" })) {};
|
|
348
507
|
//#endregion
|
|
349
508
|
//#region src/schemas/values/duty-tax-fee-category-schema.ts
|
|
350
509
|
/**
|
|
351
|
-
* @description
|
|
352
|
-
*
|
|
353
|
-
* @param error - The custom error message to use when validation fails.
|
|
510
|
+
* @description A duty, tax or fee category code from the PEPPOL subset of UNCL 5305 (VAT category code).
|
|
354
511
|
*
|
|
355
|
-
* @
|
|
512
|
+
* @example
|
|
513
|
+
* ```ts
|
|
514
|
+
* 'AE';
|
|
515
|
+
* ```;
|
|
356
516
|
*
|
|
357
517
|
* @validations
|
|
358
518
|
* - BR-CL-17 / BR-CL-18: VAT category code MUST be a valid UNCL 5305 code.
|
|
359
519
|
*
|
|
360
520
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/
|
|
521
|
+
* @see {@link dutyTaxFeeCategoriesKeys}
|
|
361
522
|
*/
|
|
362
|
-
|
|
523
|
+
var PeppolDutyTaxFeeCategoryCode = class extends opaque()(Schema.Literals(dutyTaxFeeCategoriesKeys).pipe(Schema.brand("PeppolDutyTaxFeeCategoryCode"))) {};
|
|
363
524
|
//#endregion
|
|
364
525
|
//#region src/schemas/fields/peppol-tax-category-schema.ts
|
|
526
|
+
/**
|
|
527
|
+
* @description The tax scheme identifier for a tax category, defaulting to `VAT` when the element is absent.
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```ts
|
|
531
|
+
* { id: 'VAT' }
|
|
532
|
+
* ```;
|
|
533
|
+
*
|
|
534
|
+
* @see {@link PeppolTaxCategory}
|
|
535
|
+
*/
|
|
365
536
|
var PeppolTaxSchemeId = class extends opaque()(Schema.Struct({
|
|
366
537
|
/**
|
|
367
538
|
* @name `cbc:ID`
|
|
@@ -382,7 +553,7 @@ var PeppolTaxCategory = class extends opaque()(Schema.Struct({
|
|
|
382
553
|
*
|
|
383
554
|
* @name `cbc:ID`
|
|
384
555
|
*/
|
|
385
|
-
id:
|
|
556
|
+
id: PeppolDutyTaxFeeCategoryCode,
|
|
386
557
|
/**
|
|
387
558
|
* @description The VAT rate, represented as percentage that applies to the invoiced item.
|
|
388
559
|
*
|
|
@@ -400,6 +571,16 @@ var PeppolTaxCategory = class extends opaque()(Schema.Struct({
|
|
|
400
571
|
})) {};
|
|
401
572
|
//#endregion
|
|
402
573
|
//#region src/schemas/fields/peppol-allowance-charge-schema.ts
|
|
574
|
+
/**
|
|
575
|
+
* @description The identifier of the tax scheme that applies to a document level allowance or charge. Defaults to `VAT` when the value is absent.
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* ```ts
|
|
579
|
+
* { id: 'VAT' }
|
|
580
|
+
* ```;
|
|
581
|
+
*
|
|
582
|
+
* @see {@link PeppolTaxCategory}
|
|
583
|
+
*/
|
|
403
584
|
var PeppolTaxCategoryTaxSchemeId = class extends opaque()(Schema.Struct({
|
|
404
585
|
/**
|
|
405
586
|
* @description Mandatory element. Use "VAT"
|
|
@@ -407,6 +588,22 @@ var PeppolTaxCategoryTaxSchemeId = class extends opaque()(Schema.Struct({
|
|
|
407
588
|
* @name `cbc:ID`
|
|
408
589
|
*/
|
|
409
590
|
id: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed("VAT"))) })) {};
|
|
591
|
+
/**
|
|
592
|
+
* @description Shared fields for a document level allowance or charge. Combines the common line allowance and charge fields with the tax category that applies to
|
|
593
|
+
* the document level amount.
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
* ```ts
|
|
597
|
+
* {
|
|
598
|
+
* amount: { value: 25, currencyId: 'EUR' },
|
|
599
|
+
* chargeIndicator: true,
|
|
600
|
+
* allowanceChargeReason: 'Insurance',
|
|
601
|
+
* taxCategory: { id: 'S', percent: 25, taxSchemeId: { id: 'VAT' } }
|
|
602
|
+
* }
|
|
603
|
+
* ```;
|
|
604
|
+
*
|
|
605
|
+
* @see {@link PeppolAllowanceCharge}
|
|
606
|
+
*/
|
|
410
607
|
var BaseAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
411
608
|
...BaseLineAllowanceCharge.fields,
|
|
412
609
|
/**
|
|
@@ -422,7 +619,7 @@ var BaseAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
|
422
619
|
*
|
|
423
620
|
* @name `cbc:ID`
|
|
424
621
|
*/
|
|
425
|
-
id:
|
|
622
|
+
id: PeppolDutyTaxFeeCategoryCode,
|
|
426
623
|
/**
|
|
427
624
|
* @description The VAT rate, represented as percentage that applies to the document level allowance or charge.
|
|
428
625
|
*
|
|
@@ -439,12 +636,23 @@ var BaseAllowanceCharge = class extends opaque()(Schema.Struct({
|
|
|
439
636
|
taxSchemeId: PeppolTaxCategoryTaxSchemeId
|
|
440
637
|
})))
|
|
441
638
|
})) {};
|
|
639
|
+
/**
|
|
640
|
+
* @description A document level allowance, marked by a `cbc:ChargeIndicator` of `false`. Adds an allowance reason code to the shared document level allowance and
|
|
641
|
+
* charge fields.
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* ```ts
|
|
645
|
+
* { amount: { value: 200, currencyId: 'EUR' }, chargeIndicator: false, allowanceChargeReasonCode: '95' }
|
|
646
|
+
* ```;
|
|
647
|
+
*
|
|
648
|
+
* @see {@link PeppolAllowanceCharge}
|
|
649
|
+
*/
|
|
442
650
|
var PeppolAllowance = class extends opaque()(Schema.Struct({
|
|
443
651
|
...BaseAllowanceCharge.fields,
|
|
444
652
|
/**
|
|
445
653
|
* @name cbc:AllowanceChargeReasonCode
|
|
446
654
|
*/
|
|
447
|
-
allowanceChargeReasonCode: Schema.optional(
|
|
655
|
+
allowanceChargeReasonCode: Schema.optional(PeppolAllowanceChargeReasonCode),
|
|
448
656
|
/**
|
|
449
657
|
* @name cbc:ChargeIndicator
|
|
450
658
|
*
|
|
@@ -452,12 +660,23 @@ var PeppolAllowance = class extends opaque()(Schema.Struct({
|
|
|
452
660
|
*/
|
|
453
661
|
chargeIndicator: Schema.Literal(false).annotate({ message: "PEPPOL-EN16931-R043: Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'" })
|
|
454
662
|
})) {};
|
|
663
|
+
/**
|
|
664
|
+
* @description A document level charge, marked by a `cbc:ChargeIndicator` of `true`. Adds a charge reason code to the shared document level allowance and charge
|
|
665
|
+
* fields.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```ts
|
|
669
|
+
* { amount: { value: 25, currencyId: 'EUR' }, chargeIndicator: true, allowanceChargeReasonCode: 'AA' }
|
|
670
|
+
* ```;
|
|
671
|
+
*
|
|
672
|
+
* @see {@link PeppolAllowanceCharge}
|
|
673
|
+
*/
|
|
455
674
|
var PeppolCharge = class extends opaque()(Schema.Struct({
|
|
456
675
|
...BaseAllowanceCharge.fields,
|
|
457
676
|
/**
|
|
458
677
|
* @name cbc:AllowanceChargeReasonCode
|
|
459
678
|
*/
|
|
460
|
-
allowanceChargeReasonCode: Schema.optional(
|
|
679
|
+
allowanceChargeReasonCode: Schema.optional(PeppolChargeReasonCode),
|
|
461
680
|
/**
|
|
462
681
|
* @name cbc:ChargeIndicator
|
|
463
682
|
*
|
|
@@ -466,13 +685,26 @@ var PeppolCharge = class extends opaque()(Schema.Struct({
|
|
|
466
685
|
chargeIndicator: Schema.Literal(true).annotate({ message: "PEPPOL-EN16931-R043: Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'" })
|
|
467
686
|
})) {};
|
|
468
687
|
/**
|
|
688
|
+
* @description A document level allowance or charge, selected by the `cbc:ChargeIndicator` value: `false` selects an allowance, `true` selects a charge.
|
|
689
|
+
*
|
|
469
690
|
* @summary Allowance/Charge
|
|
470
691
|
*
|
|
471
692
|
* @name cac:AllowanceCharge
|
|
472
693
|
*/
|
|
473
|
-
|
|
694
|
+
var PeppolAllowanceCharge = class extends opaque()(Schema.Union([PeppolAllowance, PeppolCharge]).annotate({ message: "unable to decode allowance charge" })) {};
|
|
474
695
|
//#endregion
|
|
475
696
|
//#region src/schemas/fields/peppol-billing-reference-schema.ts
|
|
697
|
+
/**
|
|
698
|
+
* @description A reference to an Invoice that was previously sent by the Seller, carrying the preceding invoice number and, when the number is not unique, its
|
|
699
|
+
* issue date. Wraps the `cac:InvoiceDocumentReference` element.
|
|
700
|
+
*
|
|
701
|
+
* @example
|
|
702
|
+
* ```ts
|
|
703
|
+
* { id: 'inv123', issueDate: '2017-09-15' }
|
|
704
|
+
* ```;
|
|
705
|
+
*
|
|
706
|
+
* @see {@link PeppolBillingReference}
|
|
707
|
+
*/
|
|
476
708
|
var PeppolInvoiceDocumentReference = class extends opaque()(Schema.Struct({
|
|
477
709
|
/**
|
|
478
710
|
* @description The identification of an Invoice that was previously sent by the seller.
|
|
@@ -500,6 +732,8 @@ var PeppolInvoiceDocumentReference = class extends opaque()(Schema.Struct({
|
|
|
500
732
|
issueDate: Schema.optional(PeppolIsoDateString)
|
|
501
733
|
})) {};
|
|
502
734
|
/**
|
|
735
|
+
* @description A reference to a preceding Invoice, used when the Invoice corrects or replaces an earlier one. Wraps the `cac:BillingReference` element.
|
|
736
|
+
*
|
|
503
737
|
* @summary PRECEDING INVOICE REFERENCE (0..n)
|
|
504
738
|
*
|
|
505
739
|
* @name cac:BillingReference
|
|
@@ -517,18 +751,20 @@ invoiceDocumentReference: PeppolInvoiceDocumentReference })) {};
|
|
|
517
751
|
//#endregion
|
|
518
752
|
//#region src/schemas/values/icd-codes-schema.ts
|
|
519
753
|
/**
|
|
520
|
-
* @description
|
|
754
|
+
* @description An ISO 6523 ICD code from the PEPPOL codelist.
|
|
521
755
|
*
|
|
522
|
-
* @
|
|
523
|
-
*
|
|
524
|
-
*
|
|
756
|
+
* @example
|
|
757
|
+
* ```ts
|
|
758
|
+
* '0002';
|
|
759
|
+
* ```;
|
|
525
760
|
*
|
|
526
761
|
* @validations
|
|
527
762
|
* - BR-CL-10 / BR-CL-11 / BR-CL-21: Identifier scheme MUST be a valid ISO 6523 ICD code.
|
|
528
763
|
*
|
|
529
764
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ICD/
|
|
765
|
+
* @see {@link icdCodesKeys}
|
|
530
766
|
*/
|
|
531
|
-
|
|
767
|
+
var PeppolIcdCode = class extends opaque()(Schema.Literals(icdCodesKeys).pipe(Schema.brand("PeppolIcdCode"))) {};
|
|
532
768
|
//#endregion
|
|
533
769
|
//#region src/schemas/values/peppol-country-code-schema.ts
|
|
534
770
|
/**
|
|
@@ -540,17 +776,32 @@ const icdCodesSchema = Schema.Literals(icdCodesKeys).pipe(Schema.brand("PeppolIc
|
|
|
540
776
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ISO3166/
|
|
541
777
|
*/
|
|
542
778
|
/**
|
|
543
|
-
* @description
|
|
544
|
-
*
|
|
779
|
+
* @description A two character ISO 3166-1 alpha-2 country code from the PEPPOL codelist. The literal union enforces the length.
|
|
780
|
+
*
|
|
781
|
+
* @example
|
|
782
|
+
* ```ts
|
|
783
|
+
* 'AD';
|
|
784
|
+
* ```;
|
|
545
785
|
*
|
|
546
786
|
* @validations
|
|
547
787
|
* - BR-CL-14 / BR-CL-15: Country code MUST be a valid ISO 3166-1 alpha-2 code.
|
|
548
788
|
*
|
|
549
789
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ISO3166/
|
|
790
|
+
* @see {@link countryCodesKeys}
|
|
550
791
|
*/
|
|
551
|
-
|
|
792
|
+
var PeppolCountryCodeValue = class extends opaque()(Schema.Literals(countryCodesKeys).pipe(Schema.brand("PeppolCountryCodeValue"))) {};
|
|
552
793
|
//#endregion
|
|
553
794
|
//#region src/schemas/fields/peppol-address-schema.ts
|
|
795
|
+
/**
|
|
796
|
+
* @description An additional address line that supplements the main address line. Wraps the `cac:AddressLine` element, whose `cbc:Line` value carries the text.
|
|
797
|
+
*
|
|
798
|
+
* @example
|
|
799
|
+
* ```ts
|
|
800
|
+
* { line: 'Building 23' }
|
|
801
|
+
* ```;
|
|
802
|
+
*
|
|
803
|
+
* @see {@link PeppolAddress}
|
|
804
|
+
*/
|
|
554
805
|
var PeppolAddressLine = class extends opaque()(Schema.Struct({
|
|
555
806
|
/**
|
|
556
807
|
* @description An additional address line in an address that can be used to give further details supplementing the main line.
|
|
@@ -560,6 +811,16 @@ var PeppolAddressLine = class extends opaque()(Schema.Struct({
|
|
|
560
811
|
* @name `cbc:Line`
|
|
561
812
|
*/
|
|
562
813
|
line: Schema.String })) {};
|
|
814
|
+
/**
|
|
815
|
+
* @description The country of an address, expressed as a two-letter ISO 3166-1 alpha-2 code. Wraps the `cac:Country` element and its `cbc:IdentificationCode`.
|
|
816
|
+
*
|
|
817
|
+
* @example
|
|
818
|
+
* ```ts
|
|
819
|
+
* { identificationCode: 'GB' }
|
|
820
|
+
* ```;
|
|
821
|
+
*
|
|
822
|
+
* @see {@link PeppolAddress}
|
|
823
|
+
*/
|
|
563
824
|
var PeppolCountryCode = class extends opaque()(Schema.Struct({
|
|
564
825
|
/**
|
|
565
826
|
* @description A code that identifies the country.
|
|
@@ -571,8 +832,11 @@ var PeppolCountryCode = class extends opaque()(Schema.Struct({
|
|
|
571
832
|
*
|
|
572
833
|
* @name `cbc:IdentificationCode`
|
|
573
834
|
*/
|
|
574
|
-
identificationCode:
|
|
835
|
+
identificationCode: PeppolCountryCodeValue })) {};
|
|
575
836
|
/**
|
|
837
|
+
* @description The postal address of a party, used for the seller, buyer, payee and delivery locations. Carries the street lines, city, postal zone, country
|
|
838
|
+
* subdivision, country code and optional additional address lines.
|
|
839
|
+
*
|
|
576
840
|
* @summary Postal address
|
|
577
841
|
*
|
|
578
842
|
* @name `cac:PostalAddress`
|
|
@@ -650,6 +914,16 @@ var PeppolAddress = class extends opaque()(Schema.Struct({
|
|
|
650
914
|
})) {};
|
|
651
915
|
//#endregion
|
|
652
916
|
//#region src/schemas/fields/peppol-delivery-schema.ts
|
|
917
|
+
/**
|
|
918
|
+
* @description The name of the party to which the goods and services are delivered. Wraps the `cac:PartyName` element of the delivery party.
|
|
919
|
+
*
|
|
920
|
+
* @example
|
|
921
|
+
* ```ts
|
|
922
|
+
* { name: 'Delivery party Name' }
|
|
923
|
+
* ```;
|
|
924
|
+
*
|
|
925
|
+
* @see {@link PeppolDeliveryParty}
|
|
926
|
+
*/
|
|
653
927
|
var PeppolDeliveryPartyPartyName = class extends opaque()(Schema.Struct({
|
|
654
928
|
/**
|
|
655
929
|
* @description The name of the party to which the goods and services are delivered.
|
|
@@ -659,6 +933,16 @@ var PeppolDeliveryPartyPartyName = class extends opaque()(Schema.Struct({
|
|
|
659
933
|
* @name `cbc:Name`
|
|
660
934
|
*/
|
|
661
935
|
name: Schema.String })) {};
|
|
936
|
+
/**
|
|
937
|
+
* @description The party to which the goods and services are delivered, when it differs from the Buyer. Wraps the `cac:DeliveryParty` element.
|
|
938
|
+
*
|
|
939
|
+
* @example
|
|
940
|
+
* ```ts
|
|
941
|
+
* { partyName: { name: 'Delivery party Name' } }
|
|
942
|
+
* ```;
|
|
943
|
+
*
|
|
944
|
+
* @see {@link PeppolDelivery}
|
|
945
|
+
*/
|
|
662
946
|
var PeppolDeliveryParty = class extends opaque()(Schema.Struct({
|
|
663
947
|
/**
|
|
664
948
|
* @summary PARTY NAME
|
|
@@ -666,6 +950,17 @@ var PeppolDeliveryParty = class extends opaque()(Schema.Struct({
|
|
|
666
950
|
* @name `cac:PartyName`
|
|
667
951
|
*/
|
|
668
952
|
partyName: PeppolDeliveryPartyPartyName })) {};
|
|
953
|
+
/**
|
|
954
|
+
* @description The location at which the goods and services are delivered, identified by an identifier and an optional address. Wraps the `cac:DeliveryLocation`
|
|
955
|
+
* element.
|
|
956
|
+
*
|
|
957
|
+
* @example
|
|
958
|
+
* ```ts
|
|
959
|
+
* { id: { id: '9483759475923478', schemeId: '0088' }, address: { cityName: 'Stockholm', countryCode: { identificationCode: 'SE' } } }
|
|
960
|
+
* ```;
|
|
961
|
+
*
|
|
962
|
+
* @see {@link PeppolDelivery}
|
|
963
|
+
*/
|
|
669
964
|
var PeppolDeliveryLocation = class extends opaque()(Schema.Struct({
|
|
670
965
|
/**
|
|
671
966
|
* @description An identifier for the location at which the goods and services are delivered.
|
|
@@ -696,7 +991,7 @@ var PeppolDeliveryLocation = class extends opaque()(Schema.Struct({
|
|
|
696
991
|
*
|
|
697
992
|
* @name `@schemeID`
|
|
698
993
|
*/
|
|
699
|
-
schemeId: Schema.optional(
|
|
994
|
+
schemeId: Schema.optional(PeppolIcdCode)
|
|
700
995
|
}))),
|
|
701
996
|
/**
|
|
702
997
|
* @description A groupd of business terms providing infomation about the address to which goods and services invoiced were or are delivered.
|
|
@@ -707,6 +1002,17 @@ var PeppolDeliveryLocation = class extends opaque()(Schema.Struct({
|
|
|
707
1002
|
*/
|
|
708
1003
|
address: Schema.optional(PeppolAddress)
|
|
709
1004
|
})) {};
|
|
1005
|
+
/**
|
|
1006
|
+
* @description Information about the delivery of the goods and services, such as the actual delivery date, the delivery location and the delivery party. Wraps the
|
|
1007
|
+
* `cac:Delivery` element.
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* ```ts
|
|
1011
|
+
* { actualDeliveryDate: '2017-11-01', deliveryLocation: { id: { id: '9483759475923478' } } }
|
|
1012
|
+
* ```;
|
|
1013
|
+
*
|
|
1014
|
+
* @see {@link PeppolDeliveryLocation}
|
|
1015
|
+
*/
|
|
710
1016
|
var PeppolDelivery = class extends opaque()(Schema.Struct({
|
|
711
1017
|
/**
|
|
712
1018
|
* @description Th edate on which the supply of goods or services was made or completed.
|
|
@@ -734,6 +1040,17 @@ var PeppolDelivery = class extends opaque()(Schema.Struct({
|
|
|
734
1040
|
})) {};
|
|
735
1041
|
//#endregion
|
|
736
1042
|
//#region src/schemas/fields/peppol-invoice-line-period-schema.ts
|
|
1043
|
+
/**
|
|
1044
|
+
* @description The period relevant for an Invoice line, given by an optional start date and end date. Wraps the `cac:InvoicePeriod` element as used on a line; the
|
|
1045
|
+
* document level period extends this shape in {@link PeppolInvoicePeriod}.
|
|
1046
|
+
*
|
|
1047
|
+
* @example
|
|
1048
|
+
* ```ts
|
|
1049
|
+
* { startDate: '2017-10-01', endDate: '2017-10-31' }
|
|
1050
|
+
* ```;
|
|
1051
|
+
*
|
|
1052
|
+
* @see {@link PeppolInvoicePeriod}
|
|
1053
|
+
*/
|
|
737
1054
|
var PeppolInvoiceLinePeriod = class extends opaque()(Schema.Struct({
|
|
738
1055
|
/**
|
|
739
1056
|
* @description The date when the Invoice period for this Invoice line ends. Format ="YYYY-MM-DD"
|
|
@@ -765,10 +1082,20 @@ var PeppolInvoiceLinePeriod = class extends opaque()(Schema.Struct({
|
|
|
765
1082
|
//#endregion
|
|
766
1083
|
//#region src/schemas/values/vat-date-code-schema.ts
|
|
767
1084
|
/**
|
|
1085
|
+
* @description A VAT date code from the PEPPOL subset of UNCL 2005 (invoice period description code).
|
|
1086
|
+
*
|
|
1087
|
+
* @example
|
|
1088
|
+
* ```ts
|
|
1089
|
+
* '3';
|
|
1090
|
+
* ```;
|
|
1091
|
+
*
|
|
768
1092
|
* @validations
|
|
769
1093
|
* - PEPPOL-EN16931-CL006: Invoice period description code must be according to UNCL 2005 D.16B.
|
|
1094
|
+
*
|
|
1095
|
+
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL2005/
|
|
1096
|
+
* @see {@link vatDateCodesKeys}
|
|
770
1097
|
*/
|
|
771
|
-
|
|
1098
|
+
var PeppolVatDateCode = class extends opaque()(Schema.Literals(vatDateCodesKeys)) {};
|
|
772
1099
|
//#endregion
|
|
773
1100
|
//#region src/schemas/fields/peppol-invoice-period-schema.ts
|
|
774
1101
|
/**
|
|
@@ -790,7 +1117,7 @@ var PeppolInvoicePeriod = class extends opaque()(PeppolInvoiceLinePeriod.pipe(Sc
|
|
|
790
1117
|
*
|
|
791
1118
|
* @name `cbc:DescriptionCode`
|
|
792
1119
|
*/
|
|
793
|
-
descriptionCode: Schema.optional(
|
|
1120
|
+
descriptionCode: Schema.optional(PeppolVatDateCode) }))) {};
|
|
794
1121
|
//#endregion
|
|
795
1122
|
//#region src/schemas/fields/peppol-legal-monetary-total-schema.ts
|
|
796
1123
|
/**
|
|
@@ -916,6 +1243,8 @@ var PeppolLegalMonetaryTotal = class extends opaque()(Schema.Struct({
|
|
|
916
1243
|
//#endregion
|
|
917
1244
|
//#region src/schemas/fields/peppol-order-reference-schema.ts
|
|
918
1245
|
/**
|
|
1246
|
+
* @description A reference to the purchase order or sales order that the invoice relates to.
|
|
1247
|
+
*
|
|
919
1248
|
* @summary ORDER AND SALES ORDER REFERENCE
|
|
920
1249
|
*
|
|
921
1250
|
* @name cac:OrderReference
|
|
@@ -949,6 +1278,17 @@ var PeppolOrderReference = class extends opaque()(Schema.Struct({
|
|
|
949
1278
|
})) {};
|
|
950
1279
|
//#endregion
|
|
951
1280
|
//#region src/schemas/fields/peppol-contact-schema.ts
|
|
1281
|
+
/**
|
|
1282
|
+
* @description A contact point for a party, such as the person responsible for receiving the Invoice. Wraps the `cac:Contact` element with an optional name,
|
|
1283
|
+
* telephone number and electronic mail address.
|
|
1284
|
+
*
|
|
1285
|
+
* @example
|
|
1286
|
+
* ```ts
|
|
1287
|
+
* { name: 'Lisa Johnson', telephone: '23434234', electronicMail: 'lj@buyer.se' }
|
|
1288
|
+
* ```;
|
|
1289
|
+
*
|
|
1290
|
+
* @see {@link PeppolPartySchema}
|
|
1291
|
+
*/
|
|
952
1292
|
var PeppolContact = class extends opaque()(Schema.Struct({
|
|
953
1293
|
/**
|
|
954
1294
|
* @name cbc:ElectronicMail
|
|
@@ -965,6 +1305,16 @@ var PeppolContact = class extends opaque()(Schema.Struct({
|
|
|
965
1305
|
})) {};
|
|
966
1306
|
//#endregion
|
|
967
1307
|
//#region src/schemas/fields/peppol-party-legal-entity-schema.ts
|
|
1308
|
+
/**
|
|
1309
|
+
* @description The legal entity details of a party, including the registered name and optional company identifiers.
|
|
1310
|
+
*
|
|
1311
|
+
* @example
|
|
1312
|
+
* ```ts
|
|
1313
|
+
* { registrationName: 'SupplierOfficialName Ltd', companyId: { id: 'GB983294' } }
|
|
1314
|
+
* ```;
|
|
1315
|
+
*
|
|
1316
|
+
* @see {@link PeppolPartySchema}
|
|
1317
|
+
*/
|
|
968
1318
|
var PeppolPartyLegalEntity = class extends opaque()(Schema.Struct({
|
|
969
1319
|
/**
|
|
970
1320
|
* @example
|
|
@@ -998,6 +1348,8 @@ var PeppolTaxSchemeId$1 = class extends opaque()(Schema.Struct({
|
|
|
998
1348
|
*/
|
|
999
1349
|
id: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed("VAT"))) })) {};
|
|
1000
1350
|
/**
|
|
1351
|
+
* @description The Seller tax registration details, combining a tax identifier such as a VAT number with the tax scheme.
|
|
1352
|
+
*
|
|
1001
1353
|
* @name cac:PartyTaxScheme (0..2)
|
|
1002
1354
|
*/
|
|
1003
1355
|
var PeppolPartyTaxScheme = class extends opaque()(Schema.Struct({
|
|
@@ -1029,20 +1381,32 @@ var PeppolPartyTaxScheme = class extends opaque()(Schema.Struct({
|
|
|
1029
1381
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/
|
|
1030
1382
|
*/
|
|
1031
1383
|
/**
|
|
1032
|
-
* @description
|
|
1033
|
-
*
|
|
1034
|
-
* @param error - The custom error message to use when validation fails.
|
|
1384
|
+
* @description An electronic address scheme (EAS) code from the PEPPOL Electronic Address Identifier Scheme codelist.
|
|
1035
1385
|
*
|
|
1036
|
-
* @
|
|
1386
|
+
* @example
|
|
1387
|
+
* ```ts
|
|
1388
|
+
* '0002';
|
|
1389
|
+
* ```;
|
|
1037
1390
|
*
|
|
1038
1391
|
* @validations
|
|
1039
1392
|
* - PEPPOL-EN16931-CL008: Electronic address identifier scheme MUST be from the codelist "Electronic Address Identifier Scheme".
|
|
1040
1393
|
*
|
|
1041
1394
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/
|
|
1395
|
+
* @see {@link electronicAddressCodesKeys}
|
|
1042
1396
|
*/
|
|
1043
|
-
|
|
1397
|
+
var PeppolElectronicAddressCode = class extends opaque()(Schema.Literals(electronicAddressCodesKeys).pipe(Schema.brand("PeppolElectronicAddressCode"))) {};
|
|
1044
1398
|
//#endregion
|
|
1045
1399
|
//#region src/schemas/fields/peppol-party-base-schema.ts
|
|
1400
|
+
/**
|
|
1401
|
+
* @description A name by which the Buyer or Seller is known, other than its registered name.
|
|
1402
|
+
*
|
|
1403
|
+
* @example
|
|
1404
|
+
* ```ts
|
|
1405
|
+
* { name: 'SupplierTradingName Ltd.' }
|
|
1406
|
+
* ```;
|
|
1407
|
+
*
|
|
1408
|
+
* @see {@link PeppolPartySchema}
|
|
1409
|
+
*/
|
|
1046
1410
|
var PeppolPartyName = class extends opaque()(Schema.Struct({
|
|
1047
1411
|
/**
|
|
1048
1412
|
* @description A name by which the Buyer/Seller is known, other than Buyer/Seller name (also known as Business name).
|
|
@@ -1053,6 +1417,16 @@ var PeppolPartyName = class extends opaque()(Schema.Struct({
|
|
|
1053
1417
|
* @summary Buyer/Seller trading name
|
|
1054
1418
|
*/
|
|
1055
1419
|
name: Schema.String })) {};
|
|
1420
|
+
/**
|
|
1421
|
+
* @description An identifier of the Buyer or Seller, with an optional identification scheme.
|
|
1422
|
+
*
|
|
1423
|
+
* @example
|
|
1424
|
+
* ```ts
|
|
1425
|
+
* { id: { id: '99887766', schemeId: '0088' } }
|
|
1426
|
+
* ```;
|
|
1427
|
+
*
|
|
1428
|
+
* @see {@link PeppolPartySchema}
|
|
1429
|
+
*/
|
|
1056
1430
|
var PeppolPartyIdentification = class extends opaque()(Schema.Struct({
|
|
1057
1431
|
/**
|
|
1058
1432
|
* @description An identifier of the Buyer/seller.
|
|
@@ -1080,8 +1454,18 @@ id: PeppolIdentifier.pipe(Schema.fieldsAssign({
|
|
|
1080
1454
|
*
|
|
1081
1455
|
* @name `@schemeID`
|
|
1082
1456
|
*/
|
|
1083
|
-
schemeId: Schema.optional(
|
|
1457
|
+
schemeId: Schema.optional(PeppolIcdCode)
|
|
1084
1458
|
})) })) {};
|
|
1459
|
+
/**
|
|
1460
|
+
* @description The Buyer or Seller electronic address to which the application level response to the invoice may be delivered.
|
|
1461
|
+
*
|
|
1462
|
+
* @example
|
|
1463
|
+
* ```ts
|
|
1464
|
+
* { id: '9482348239847239874', schemeId: '0088' }
|
|
1465
|
+
* ```;
|
|
1466
|
+
*
|
|
1467
|
+
* @see {@link PeppolPartySchema}
|
|
1468
|
+
*/
|
|
1085
1469
|
var PeppolPartyEndpointId = class extends opaque()(PeppolIdentifier.pipe(Schema.fieldsAssign({
|
|
1086
1470
|
/**
|
|
1087
1471
|
* @description Identifies the Seller/buyer's electronic address to which the application level response to the invoice may be delivered.
|
|
@@ -1101,9 +1485,11 @@ var PeppolPartyEndpointId = class extends opaque()(PeppolIdentifier.pipe(Schema.
|
|
|
1101
1485
|
*
|
|
1102
1486
|
* @name `@schemeID`
|
|
1103
1487
|
*/
|
|
1104
|
-
schemeId:
|
|
1488
|
+
schemeId: PeppolElectronicAddressCode
|
|
1105
1489
|
}))) {};
|
|
1106
1490
|
/**
|
|
1491
|
+
* @description The common party substructure shared by the supplier, customer, and other party roles.
|
|
1492
|
+
*
|
|
1107
1493
|
* @summary Party common substructure
|
|
1108
1494
|
*
|
|
1109
1495
|
* @name cac:Party
|
|
@@ -1193,7 +1579,7 @@ companyId: Schema.optional(PeppolIdentifier.pipe(Schema.fieldsAssign({
|
|
|
1193
1579
|
*
|
|
1194
1580
|
* @name `@schemeID`
|
|
1195
1581
|
*/
|
|
1196
|
-
schemeId: Schema.optional(
|
|
1582
|
+
schemeId: Schema.optional(PeppolIcdCode)
|
|
1197
1583
|
}))) })) {};
|
|
1198
1584
|
var PeppolPartyIdentification$1 = class extends opaque()(Schema.Struct({
|
|
1199
1585
|
/**
|
|
@@ -1266,20 +1652,32 @@ var PeppolPayeeParty = class extends opaque()(Schema.Struct({
|
|
|
1266
1652
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4461/
|
|
1267
1653
|
*/
|
|
1268
1654
|
/**
|
|
1269
|
-
* @description
|
|
1270
|
-
*
|
|
1271
|
-
* @param error - The custom error message to use when validation fails.
|
|
1655
|
+
* @description A payment means code from the PEPPOL subset of UNCL 4461.
|
|
1272
1656
|
*
|
|
1273
|
-
* @
|
|
1657
|
+
* @example
|
|
1658
|
+
* ```ts
|
|
1659
|
+
* '1';
|
|
1660
|
+
* ```;
|
|
1274
1661
|
*
|
|
1275
1662
|
* @validations
|
|
1276
1663
|
* - BR-CL-16: Payment means code MUST be a valid UNCL 4461 code.
|
|
1277
1664
|
*
|
|
1278
1665
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4461/
|
|
1666
|
+
* @see {@link paymentMeansCodesKeys}
|
|
1279
1667
|
*/
|
|
1280
|
-
|
|
1668
|
+
var PeppolPaymentMeansCodeValue = class extends opaque()(Schema.Literals(paymentMeansCodesKeys).pipe(Schema.brand("PeppolPaymentMeansCodeValue"))) {};
|
|
1281
1669
|
//#endregion
|
|
1282
1670
|
//#region src/schemas/fields/peppol-payment-means-schema.ts
|
|
1671
|
+
/**
|
|
1672
|
+
* @description The account to be debited by a direct debit.
|
|
1673
|
+
*
|
|
1674
|
+
* @example
|
|
1675
|
+
* ```ts
|
|
1676
|
+
* { id: '12345676543' }
|
|
1677
|
+
* ```;
|
|
1678
|
+
*
|
|
1679
|
+
* @see {@link PeppolPaymentMandate}
|
|
1680
|
+
*/
|
|
1283
1681
|
var PeppolPaymentMandatePayerFinancialAccountId = class extends opaque()(Schema.Struct({
|
|
1284
1682
|
/**
|
|
1285
1683
|
* @description The account to be debited by the direct debit.
|
|
@@ -1292,6 +1690,16 @@ var PeppolPaymentMandatePayerFinancialAccountId = class extends opaque()(Schema.
|
|
|
1292
1690
|
* @name `cbc:ID`
|
|
1293
1691
|
*/
|
|
1294
1692
|
id: Schema.String })) {};
|
|
1693
|
+
/**
|
|
1694
|
+
* @description A group of business terms to specify a direct debit, including the mandate reference and the debited account.
|
|
1695
|
+
*
|
|
1696
|
+
* @example
|
|
1697
|
+
* ```ts
|
|
1698
|
+
* { id: 'MandateReference', payerFinancialAccountId: { id: '12345676543' } }
|
|
1699
|
+
* ```;
|
|
1700
|
+
*
|
|
1701
|
+
* @see {@link PeppolPaymentMeans}
|
|
1702
|
+
*/
|
|
1295
1703
|
var PeppolPaymentMandate = class extends opaque()(Schema.Struct({
|
|
1296
1704
|
/**
|
|
1297
1705
|
* @description Unique identifier assigned by the Payee for referencing the direct debit mandate. Used in order to pre-notify the Buyer of a SEPA direct debit.
|
|
@@ -1313,6 +1721,16 @@ var PeppolPaymentMandate = class extends opaque()(Schema.Struct({
|
|
|
1313
1721
|
*/
|
|
1314
1722
|
payerFinancialAccountId: Schema.optional(PeppolPaymentMandatePayerFinancialAccountId)
|
|
1315
1723
|
})) {};
|
|
1724
|
+
/**
|
|
1725
|
+
* @description The payment service provider where the payee payment account is held, such as a BIC or national clearing code.
|
|
1726
|
+
*
|
|
1727
|
+
* @example
|
|
1728
|
+
* ```ts
|
|
1729
|
+
* { id: 'BIC324098' }
|
|
1730
|
+
* ```;
|
|
1731
|
+
*
|
|
1732
|
+
* @see {@link PeppolPayeeFinancialAccount}
|
|
1733
|
+
*/
|
|
1316
1734
|
var PeppolPayeeFinancialAccountFinancialInstitutionBranch = class extends opaque()(Schema.Struct({
|
|
1317
1735
|
/**
|
|
1318
1736
|
* @description An identifier for the payment service provider where a payment account is located. Such as a BIC or a national clearing code where required. No
|
|
@@ -1326,6 +1744,16 @@ var PeppolPayeeFinancialAccountFinancialInstitutionBranch = class extends opaque
|
|
|
1326
1744
|
* @name `cac:FinancialInstitutionBranch`
|
|
1327
1745
|
*/
|
|
1328
1746
|
id: Schema.String })) {};
|
|
1747
|
+
/**
|
|
1748
|
+
* @description The payment account to which payment should be made, such as an IBAN or BBAN, including the financial institution branch.
|
|
1749
|
+
*
|
|
1750
|
+
* @example
|
|
1751
|
+
* ```ts
|
|
1752
|
+
* { id: 'IBAN32423940', name: 'AccountName' }
|
|
1753
|
+
* ```;
|
|
1754
|
+
*
|
|
1755
|
+
* @see {@link PeppolPaymentMeans}
|
|
1756
|
+
*/
|
|
1329
1757
|
var PeppolPayeeFinancialAccount = class extends opaque()(Schema.Struct({
|
|
1330
1758
|
/**
|
|
1331
1759
|
* @description An identifier for the payment service provider where a payment account is located. Such as a BIC or a national clearing code where required. No
|
|
@@ -1356,6 +1784,16 @@ var PeppolPayeeFinancialAccount = class extends opaque()(Schema.Struct({
|
|
|
1356
1784
|
*/
|
|
1357
1785
|
name: Schema.optional(Schema.String)
|
|
1358
1786
|
})) {};
|
|
1787
|
+
/**
|
|
1788
|
+
* @description The card used for payment, including the card holder name and the primary account number.
|
|
1789
|
+
*
|
|
1790
|
+
* @example
|
|
1791
|
+
* ```ts
|
|
1792
|
+
* { networkId: 'VISA', primaryAccountNumberId: '1234' }
|
|
1793
|
+
* ```;
|
|
1794
|
+
*
|
|
1795
|
+
* @see {@link PeppolPaymentMeans}
|
|
1796
|
+
*/
|
|
1359
1797
|
var PeppolCardAccount = class extends opaque()(Schema.Struct({
|
|
1360
1798
|
/**
|
|
1361
1799
|
* @description The name of the payment card holder.
|
|
@@ -1384,6 +1822,16 @@ var PeppolCardAccount = class extends opaque()(Schema.Struct({
|
|
|
1384
1822
|
*/
|
|
1385
1823
|
primaryAccountNumberId: Schema.String
|
|
1386
1824
|
})) {};
|
|
1825
|
+
/**
|
|
1826
|
+
* @description The means by which a payment is expected to be or has been settled, expressed as a UNCL 4461 code and optional text.
|
|
1827
|
+
*
|
|
1828
|
+
* @example
|
|
1829
|
+
* ```ts
|
|
1830
|
+
* { code: '30', name: 'Credit transfer' }
|
|
1831
|
+
* ```;
|
|
1832
|
+
*
|
|
1833
|
+
* @see {@link PeppolPaymentMeans}
|
|
1834
|
+
*/
|
|
1387
1835
|
var PeppolPaymentMeansCode = class extends opaque()(Schema.Struct({
|
|
1388
1836
|
/**
|
|
1389
1837
|
* @description The means, expressed as code, for how a payment is expected to be or has been settled.
|
|
@@ -1395,7 +1843,7 @@ var PeppolPaymentMeansCode = class extends opaque()(Schema.Struct({
|
|
|
1395
1843
|
*
|
|
1396
1844
|
* @name `#text`
|
|
1397
1845
|
*/
|
|
1398
|
-
code:
|
|
1846
|
+
code: PeppolPaymentMeansCodeValue,
|
|
1399
1847
|
/**
|
|
1400
1848
|
* @description The means, expressed as text, for how a payment is expected to be or has been settled.
|
|
1401
1849
|
*
|
|
@@ -1479,6 +1927,8 @@ var PeppolPaymentMeans = class extends opaque()(Schema.Struct({
|
|
|
1479
1927
|
//#endregion
|
|
1480
1928
|
//#region src/schemas/fields/peppol-payment-terms-schema.ts
|
|
1481
1929
|
/**
|
|
1930
|
+
* @description A textual description of the payment terms that apply to the amount due for payment.
|
|
1931
|
+
*
|
|
1482
1932
|
* @summary PAYMENT TERMS
|
|
1483
1933
|
*
|
|
1484
1934
|
* @name cac:PaymentTerms
|
|
@@ -1499,6 +1949,8 @@ note: Schema.String })) {};
|
|
|
1499
1949
|
//#endregion
|
|
1500
1950
|
//#region src/schemas/fields/peppol-tax-representative-schema.ts
|
|
1501
1951
|
/**
|
|
1952
|
+
* @description The party acting as the Seller tax representative, including its name, postal address, and tax scheme.
|
|
1953
|
+
*
|
|
1502
1954
|
* @summary SELLER TAX REPRESENTATIVE PARTY
|
|
1503
1955
|
*
|
|
1504
1956
|
* @name cac:TaxRepresentativeParty
|
|
@@ -1541,6 +1993,8 @@ var PeppolTaxSubTotalCategory = class extends opaque()(Schema.Struct({
|
|
|
1541
1993
|
//#endregion
|
|
1542
1994
|
//#region src/schemas/fields/peppol-tax-subtotal-schema.ts
|
|
1543
1995
|
/**
|
|
1996
|
+
* @description A VAT breakdown line for a single tax category, giving the taxable amount and the tax amount.
|
|
1997
|
+
*
|
|
1544
1998
|
* @summary VAT breakdown (TaxSubtotal)
|
|
1545
1999
|
*
|
|
1546
2000
|
* @name cac:TaxSubtotal
|
|
@@ -1568,6 +2022,8 @@ var PeppolTaxSubTotal = class extends opaque()(Schema.Struct({
|
|
|
1568
2022
|
//#endregion
|
|
1569
2023
|
//#region src/schemas/fields/peppol-tax-totals-base-schema.ts
|
|
1570
2024
|
/**
|
|
2025
|
+
* @description The total tax amount for the document, with an optional breakdown into tax subtotals.
|
|
2026
|
+
*
|
|
1571
2027
|
* @summary TAX TOTAL
|
|
1572
2028
|
*
|
|
1573
2029
|
* @name cac:TaxTotal (1..2)
|
|
@@ -1587,6 +2043,16 @@ var PeppolTaxTotalsBase = class extends opaque()(Schema.Struct({
|
|
|
1587
2043
|
})) {};
|
|
1588
2044
|
//#endregion
|
|
1589
2045
|
//#region src/schemas/peppol-billing-base-schema.ts
|
|
2046
|
+
/**
|
|
2047
|
+
* @description Wraps the `cac:ContractDocumentReference` element: an identifier of a contract that the billing document references.
|
|
2048
|
+
*
|
|
2049
|
+
* @example
|
|
2050
|
+
* ```ts
|
|
2051
|
+
* { id: '123Contractref' }
|
|
2052
|
+
* ```;
|
|
2053
|
+
*
|
|
2054
|
+
* @see {@link PeppolBillingBase}
|
|
2055
|
+
*/
|
|
1590
2056
|
var PeppolContractDocumentReference = class extends opaque()(Schema.Struct({
|
|
1591
2057
|
/**
|
|
1592
2058
|
* @description An identifier of a referenced contract.
|
|
@@ -1599,6 +2065,16 @@ var PeppolContractDocumentReference = class extends opaque()(Schema.Struct({
|
|
|
1599
2065
|
* @name `cbc:ID`
|
|
1600
2066
|
*/
|
|
1601
2067
|
id: Schema.String })) {};
|
|
2068
|
+
/**
|
|
2069
|
+
* @description Wraps the `cac:OriginatorDocumentReference` element: the identification of the call for tender or lot the invoice relates to.
|
|
2070
|
+
*
|
|
2071
|
+
* @example
|
|
2072
|
+
* ```ts
|
|
2073
|
+
* { id: 'PPID-123' }
|
|
2074
|
+
* ```;
|
|
2075
|
+
*
|
|
2076
|
+
* @see {@link PeppolBillingBase}
|
|
2077
|
+
*/
|
|
1602
2078
|
var PeppolOriginatorDocumentReference = class extends opaque()(Schema.Struct({
|
|
1603
2079
|
/**
|
|
1604
2080
|
* @description The identification of the call for tender or lot the invoice relates to.
|
|
@@ -1611,6 +2087,16 @@ var PeppolOriginatorDocumentReference = class extends opaque()(Schema.Struct({
|
|
|
1611
2087
|
* @name `cbc:ID`
|
|
1612
2088
|
*/
|
|
1613
2089
|
id: Schema.String })) {};
|
|
2090
|
+
/**
|
|
2091
|
+
* @description Wraps the `cac:ReceiptDocumentReference` element: an identifier of a referenced receiving advice.
|
|
2092
|
+
*
|
|
2093
|
+
* @example
|
|
2094
|
+
* ```ts
|
|
2095
|
+
* { id: 'rec98' }
|
|
2096
|
+
* ```;
|
|
2097
|
+
*
|
|
2098
|
+
* @see {@link PeppolBillingBase}
|
|
2099
|
+
*/
|
|
1614
2100
|
var PeppolReceiptDocumentReference = class extends opaque()(Schema.Struct({
|
|
1615
2101
|
/**
|
|
1616
2102
|
* @description An identifier of a referenced receiving advice.
|
|
@@ -1623,6 +2109,16 @@ var PeppolReceiptDocumentReference = class extends opaque()(Schema.Struct({
|
|
|
1623
2109
|
* @name `cbc:ID`
|
|
1624
2110
|
*/
|
|
1625
2111
|
id: Schema.String })) {};
|
|
2112
|
+
/**
|
|
2113
|
+
* @description Wraps the `cac:DespatchDocumentReference` element: an identifier of a referenced despatch advice.
|
|
2114
|
+
*
|
|
2115
|
+
* @example
|
|
2116
|
+
* ```ts
|
|
2117
|
+
* { id: 'desp98' }
|
|
2118
|
+
* ```;
|
|
2119
|
+
*
|
|
2120
|
+
* @see {@link PeppolBillingBase}
|
|
2121
|
+
*/
|
|
1626
2122
|
var PeppolDespatchDocumentReference = class extends opaque()(Schema.Struct({
|
|
1627
2123
|
/**
|
|
1628
2124
|
* @description An identifier of a referenced despatch advice.
|
|
@@ -1638,8 +2134,8 @@ id: Schema.String })) {};
|
|
|
1638
2134
|
/**
|
|
1639
2135
|
* @description Base schema for a billing document.
|
|
1640
2136
|
*
|
|
1641
|
-
* @see {@link
|
|
1642
|
-
* @see {@link
|
|
2137
|
+
* @see {@link PeppolCreditNote} - the credit note schema
|
|
2138
|
+
* @see {@link PeppolInvoice} - the invoice schema
|
|
1643
2139
|
*/
|
|
1644
2140
|
var PeppolBillingBase = class extends opaque()(Schema.Struct({
|
|
1645
2141
|
/**
|
|
@@ -1723,7 +2219,7 @@ var PeppolBillingBase = class extends opaque()(Schema.Struct({
|
|
|
1723
2219
|
*
|
|
1724
2220
|
* @name `cbc:DocumentCurrencyCode`
|
|
1725
2221
|
*/
|
|
1726
|
-
documentCurrencyCode:
|
|
2222
|
+
documentCurrencyCode: PeppolCurrencyCode,
|
|
1727
2223
|
/**
|
|
1728
2224
|
* @description The currency used for VAT accounting and reporting purposes as accepted or required in the country of the Seller. Shall be used in combination
|
|
1729
2225
|
* with the Invoice total VAT amount in accounting currency (BT-111), when the VAT accounting currency code differs from the Invoice currency
|
|
@@ -1736,7 +2232,7 @@ var PeppolBillingBase = class extends opaque()(Schema.Struct({
|
|
|
1736
2232
|
*
|
|
1737
2233
|
* @name `cbc:TaxCurrencyCode`
|
|
1738
2234
|
*/
|
|
1739
|
-
taxCurrencyCode: Schema.optional(
|
|
2235
|
+
taxCurrencyCode: Schema.optional(PeppolCurrencyCode),
|
|
1740
2236
|
/**
|
|
1741
2237
|
* @description A textual value that specifies where to book the relevant data into the Buyer's financial accounts.
|
|
1742
2238
|
*
|
|
@@ -1876,7 +2372,7 @@ var PeppolBillingBase = class extends opaque()(Schema.Struct({
|
|
|
1876
2372
|
*
|
|
1877
2373
|
* @name cac:AllowanceCharge
|
|
1878
2374
|
*/
|
|
1879
|
-
allowanceCharges: Schema.optional(Schema.Array(
|
|
2375
|
+
allowanceCharges: Schema.optional(Schema.Array(PeppolAllowanceCharge)),
|
|
1880
2376
|
/**
|
|
1881
2377
|
* @description When tax currency code is provided, two instances of the tax total must be present, but only one with tax subtotal.
|
|
1882
2378
|
*
|
|
@@ -1895,18 +2391,20 @@ var PeppolBillingBase = class extends opaque()(Schema.Struct({
|
|
|
1895
2391
|
//#endregion
|
|
1896
2392
|
//#region src/schemas/values/item-classification-codes-schema.ts
|
|
1897
2393
|
/**
|
|
1898
|
-
* @description
|
|
1899
|
-
*
|
|
1900
|
-
* @param error - The custom error message to use when validation fails.
|
|
2394
|
+
* @description An item classification code from the PEPPOL subset of UNCL 7143.
|
|
1901
2395
|
*
|
|
1902
|
-
* @
|
|
2396
|
+
* @example
|
|
2397
|
+
* ```ts
|
|
2398
|
+
* 'AA';
|
|
2399
|
+
* ```;
|
|
1903
2400
|
*
|
|
1904
2401
|
* @validations
|
|
1905
2402
|
* - BR-CL-13: Item classification scheme MUST be a valid UNTDID 7143 code.
|
|
1906
2403
|
*
|
|
1907
2404
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL7143/
|
|
2405
|
+
* @see {@link itemClassificationCodesKeys}
|
|
1908
2406
|
*/
|
|
1909
|
-
|
|
2407
|
+
var PeppolItemClassificationCode = class extends opaque()(Schema.Literals(itemClassificationCodesKeys).pipe(Schema.brand("PeppolItemClassificationCode"))) {};
|
|
1910
2408
|
//#endregion
|
|
1911
2409
|
//#region src/schemas/fields/peppol-item-classification-schema.ts
|
|
1912
2410
|
/**
|
|
@@ -1935,7 +2433,7 @@ var PeppolItemClassification = class extends opaque()(Schema.Struct({
|
|
|
1935
2433
|
*
|
|
1936
2434
|
* @name `@listID`
|
|
1937
2435
|
*/
|
|
1938
|
-
listId:
|
|
2436
|
+
listId: PeppolItemClassificationCode,
|
|
1939
2437
|
/**
|
|
1940
2438
|
* @description The identification scheme version identifier of the Item classification identifier.
|
|
1941
2439
|
*
|
|
@@ -1950,6 +2448,16 @@ var PeppolItemClassification = class extends opaque()(Schema.Struct({
|
|
|
1950
2448
|
})) {};
|
|
1951
2449
|
//#endregion
|
|
1952
2450
|
//#region src/schemas/fields/peppol-line-item-schema.ts
|
|
2451
|
+
/**
|
|
2452
|
+
* @description An additional property of the item, expressed as an attribute name and value pair.
|
|
2453
|
+
*
|
|
2454
|
+
* @example
|
|
2455
|
+
* ```ts
|
|
2456
|
+
* { name: 'Colour', value: 'Blue' }
|
|
2457
|
+
* ```;
|
|
2458
|
+
*
|
|
2459
|
+
* @see {@link PeppolLineItem}
|
|
2460
|
+
*/
|
|
1953
2461
|
var PeppolAdditionalItemProperties = class extends opaque()(Schema.Struct({
|
|
1954
2462
|
/**
|
|
1955
2463
|
* @description The name of the attribute or property of the item.
|
|
@@ -1968,6 +2476,16 @@ var PeppolAdditionalItemProperties = class extends opaque()(Schema.Struct({
|
|
|
1968
2476
|
*/
|
|
1969
2477
|
value: Schema.String
|
|
1970
2478
|
})) {};
|
|
2479
|
+
/**
|
|
2480
|
+
* @description A code classifying the item by its type or nature, identified by a scheme such as CPV.
|
|
2481
|
+
*
|
|
2482
|
+
* @example
|
|
2483
|
+
* ```ts
|
|
2484
|
+
* { itemClassification: { id: '09348023', listId: 'STI' } }
|
|
2485
|
+
* ```;
|
|
2486
|
+
*
|
|
2487
|
+
* @see {@link PeppolItemClassification}
|
|
2488
|
+
*/
|
|
1971
2489
|
var PeppolCommodityClassifications = class extends opaque()(Schema.Struct({
|
|
1972
2490
|
/**
|
|
1973
2491
|
* @description A code for classifying the item by its type or nature.
|
|
@@ -1980,6 +2498,16 @@ var PeppolCommodityClassifications = class extends opaque()(Schema.Struct({
|
|
|
1980
2498
|
* @name `cbc:ItemClassificationCode`
|
|
1981
2499
|
*/
|
|
1982
2500
|
itemClassification: PeppolItemClassification })) {};
|
|
2501
|
+
/**
|
|
2502
|
+
* @description The country from which the item originates, identified by an ISO 3166-1 country code.
|
|
2503
|
+
*
|
|
2504
|
+
* @example
|
|
2505
|
+
* ```ts
|
|
2506
|
+
* { identificationCode: 'NO' }
|
|
2507
|
+
* ```;
|
|
2508
|
+
*
|
|
2509
|
+
* @see {@link PeppolLineItem}
|
|
2510
|
+
*/
|
|
1983
2511
|
var PeppolOriginCountryCode = class extends opaque()(Schema.Struct({
|
|
1984
2512
|
/**
|
|
1985
2513
|
* @description The code identifying the country from which the item originates.
|
|
@@ -1988,7 +2516,17 @@ var PeppolOriginCountryCode = class extends opaque()(Schema.Struct({
|
|
|
1988
2516
|
*
|
|
1989
2517
|
* @name `cbc:IdentificationCode`
|
|
1990
2518
|
*/
|
|
1991
|
-
identificationCode:
|
|
2519
|
+
identificationCode: PeppolCountryCodeValue })) {};
|
|
2520
|
+
/**
|
|
2521
|
+
* @description An item identifier based on a registered scheme, such as a GTIN or EAN.
|
|
2522
|
+
*
|
|
2523
|
+
* @example
|
|
2524
|
+
* ```ts
|
|
2525
|
+
* { id: { id: '21382183120983', schemeId: '0088' } }
|
|
2526
|
+
* ```;
|
|
2527
|
+
*
|
|
2528
|
+
* @see {@link PeppolIdentifier}
|
|
2529
|
+
*/
|
|
1992
2530
|
var PeppolStandardItemIdentification = class extends opaque()(Schema.Struct({
|
|
1993
2531
|
/**
|
|
1994
2532
|
* @description An item identifier based on a registered scheme.
|
|
@@ -2013,8 +2551,18 @@ id: PeppolIdentifier.pipe(Schema.fieldsAssign({
|
|
|
2013
2551
|
*
|
|
2014
2552
|
* @name `@schemeID`
|
|
2015
2553
|
*/
|
|
2016
|
-
schemeId:
|
|
2554
|
+
schemeId: PeppolIcdCode
|
|
2017
2555
|
})) })) {};
|
|
2556
|
+
/**
|
|
2557
|
+
* @description An identifier assigned by the Seller for the item.
|
|
2558
|
+
*
|
|
2559
|
+
* @example
|
|
2560
|
+
* ```ts
|
|
2561
|
+
* { id: '987323' }
|
|
2562
|
+
* ```;
|
|
2563
|
+
*
|
|
2564
|
+
* @see {@link PeppolLineItem}
|
|
2565
|
+
*/
|
|
2018
2566
|
var PeppolSellersItemIdentification = class extends opaque()(Schema.Struct({
|
|
2019
2567
|
/**
|
|
2020
2568
|
* @description An identifier, assigned by the Seller, for the item.
|
|
@@ -2027,6 +2575,16 @@ var PeppolSellersItemIdentification = class extends opaque()(Schema.Struct({
|
|
|
2027
2575
|
* @name `cbc:ID`
|
|
2028
2576
|
*/
|
|
2029
2577
|
id: Schema.String })) {};
|
|
2578
|
+
/**
|
|
2579
|
+
* @description An identifier assigned by the Buyer for the item.
|
|
2580
|
+
*
|
|
2581
|
+
* @example
|
|
2582
|
+
* ```ts
|
|
2583
|
+
* { id: '12345' }
|
|
2584
|
+
* ```;
|
|
2585
|
+
*
|
|
2586
|
+
* @see {@link PeppolLineItem}
|
|
2587
|
+
*/
|
|
2030
2588
|
var PeppolBuyersItemIdentification = class extends opaque()(Schema.Struct({
|
|
2031
2589
|
/**
|
|
2032
2590
|
* @description An identifier, assigned by the Buyer, for the item.
|
|
@@ -2040,6 +2598,8 @@ var PeppolBuyersItemIdentification = class extends opaque()(Schema.Struct({
|
|
|
2040
2598
|
*/
|
|
2041
2599
|
id: Schema.String })) {};
|
|
2042
2600
|
/**
|
|
2601
|
+
* @description The item details for an invoice or credit note line, including its name, identifiers, classification, and line VAT category.
|
|
2602
|
+
*
|
|
2043
2603
|
* @summary Item details on invoice/credit-note line
|
|
2044
2604
|
*
|
|
2045
2605
|
* @name cac:Item
|
|
@@ -2111,21 +2671,25 @@ var PeppolLineItem = class extends opaque()(Schema.Struct({
|
|
|
2111
2671
|
//#endregion
|
|
2112
2672
|
//#region src/schemas/values/quantity-unit-codes-schema.ts
|
|
2113
2673
|
/**
|
|
2114
|
-
* @description
|
|
2674
|
+
* @description A unit of measure code from the PEPPOL subset of UN/ECE Recommendation 20.
|
|
2115
2675
|
*
|
|
2116
|
-
* @
|
|
2117
|
-
*
|
|
2118
|
-
*
|
|
2676
|
+
* @example
|
|
2677
|
+
* ```ts
|
|
2678
|
+
* '10';
|
|
2679
|
+
* ```;
|
|
2119
2680
|
*
|
|
2120
2681
|
* @validations
|
|
2121
2682
|
* - BR-CL-23: Unit of measure code MUST be a valid UN/ECE Rec 20 code.
|
|
2122
2683
|
*
|
|
2123
2684
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNECERec20/
|
|
2685
|
+
* @see {@link quantityUnitCodesKeys}
|
|
2124
2686
|
*/
|
|
2125
|
-
|
|
2687
|
+
var PeppolQuantityUnitCode = class extends opaque()(Schema.Literals(quantityUnitCodesKeys).pipe(Schema.brand("PeppolQuantityUnitCode"))) {};
|
|
2126
2688
|
//#endregion
|
|
2127
2689
|
//#region src/schemas/fields/peppol-quantity-schema.ts
|
|
2128
2690
|
/**
|
|
2691
|
+
* @description A quantity value with an optional unit of measure code.
|
|
2692
|
+
*
|
|
2129
2693
|
* @summary Quantity with optional unit code
|
|
2130
2694
|
*
|
|
2131
2695
|
* @name `cbc:* (+ @unitCode)`
|
|
@@ -2134,7 +2698,7 @@ var PeppolQuantity = class extends opaque()(Schema.Struct({
|
|
|
2134
2698
|
/**
|
|
2135
2699
|
* @name `@unitCode`
|
|
2136
2700
|
*/
|
|
2137
|
-
unitCode: Schema.optional(
|
|
2701
|
+
unitCode: Schema.optional(PeppolQuantityUnitCode),
|
|
2138
2702
|
/**
|
|
2139
2703
|
* @name `#text (value)`
|
|
2140
2704
|
*/
|
|
@@ -2143,6 +2707,8 @@ var PeppolQuantity = class extends opaque()(Schema.Struct({
|
|
|
2143
2707
|
//#endregion
|
|
2144
2708
|
//#region src/schemas/fields/peppol-line-price-schema.ts
|
|
2145
2709
|
/**
|
|
2710
|
+
* @description The price details of an invoice or credit note line, including the price amount and any price level allowance.
|
|
2711
|
+
*
|
|
2146
2712
|
* @summary Price details on invoice line
|
|
2147
2713
|
*
|
|
2148
2714
|
* @name cac:Price
|
|
@@ -2167,6 +2733,16 @@ var PeppolLinePrice = class extends opaque()(Schema.Struct({
|
|
|
2167
2733
|
})) {};
|
|
2168
2734
|
//#endregion
|
|
2169
2735
|
//#region src/schemas/fields/peppol-base-line-schema.ts
|
|
2736
|
+
/**
|
|
2737
|
+
* @description A reference to the order line that the Invoice line fulfils. Wraps the `cac:OrderLineReference` element and its `cbc:LineID`.
|
|
2738
|
+
*
|
|
2739
|
+
* @example
|
|
2740
|
+
* ```ts
|
|
2741
|
+
* { lineId: '123' }
|
|
2742
|
+
* ```;
|
|
2743
|
+
*
|
|
2744
|
+
* @see {@link PeppolBaseLine}
|
|
2745
|
+
*/
|
|
2170
2746
|
var PeppolOrderLineReference = class extends opaque()(Schema.Struct({ lineId: Schema.String })) {};
|
|
2171
2747
|
/**
|
|
2172
2748
|
* @description Base of the invoice line and credit note line schemas.
|
|
@@ -2194,7 +2770,7 @@ var PeppolBaseLine = class extends opaque()(Schema.Struct({
|
|
|
2194
2770
|
*
|
|
2195
2771
|
* @cardinality 0..n
|
|
2196
2772
|
*/
|
|
2197
|
-
allowanceCharges: Schema.optional(Schema.Array(
|
|
2773
|
+
allowanceCharges: Schema.optional(Schema.Array(PeppolLineAllowanceCharge)),
|
|
2198
2774
|
/**
|
|
2199
2775
|
* @summary Line object identifier
|
|
2200
2776
|
*
|
|
@@ -2291,6 +2867,8 @@ documentTypeCode: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succe
|
|
|
2291
2867
|
//#endregion
|
|
2292
2868
|
//#region src/schemas/fields/peppol-invoice-line-schema.ts
|
|
2293
2869
|
/**
|
|
2870
|
+
* @description A line of the Invoice, extending the common line fields with the invoiced quantity. Wraps the `cac:InvoiceLine` element.
|
|
2871
|
+
*
|
|
2294
2872
|
* @summary Invoice line
|
|
2295
2873
|
*
|
|
2296
2874
|
* @name cac:InvoiceLine
|
|
@@ -2321,23 +2899,53 @@ var PeppolInvoiceLine = class extends opaque()(Schema.Struct({
|
|
|
2321
2899
|
*
|
|
2322
2900
|
* @see {@link quantityUnitCodes}
|
|
2323
2901
|
*/
|
|
2324
|
-
unitCode:
|
|
2902
|
+
unitCode: PeppolQuantityUnitCode }))
|
|
2325
2903
|
})) {};
|
|
2326
2904
|
//#endregion
|
|
2327
2905
|
//#region src/schemas/values/invoice-type-code-schema.ts
|
|
2328
2906
|
/**
|
|
2329
|
-
* @description
|
|
2907
|
+
* @description An invoice type code from the PEPPOL subset of UNCL 1001.
|
|
2330
2908
|
*
|
|
2331
|
-
* @
|
|
2332
|
-
*
|
|
2333
|
-
*
|
|
2909
|
+
* @example
|
|
2910
|
+
* ```ts
|
|
2911
|
+
* '71';
|
|
2912
|
+
* ```;
|
|
2334
2913
|
*
|
|
2335
2914
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL1001-inv/
|
|
2915
|
+
* @see {@link invoiceTypeCodesKeys}
|
|
2336
2916
|
*/
|
|
2337
|
-
|
|
2917
|
+
var PeppolInvoiceTypeCode = class extends opaque()(Schema.Literals(invoiceTypeCodesKeys).pipe(Schema.brand("PeppolInvoiceTypeCode"))) {};
|
|
2338
2918
|
//#endregion
|
|
2339
2919
|
//#region src/schemas/peppol-invoice-schema.ts
|
|
2920
|
+
/**
|
|
2921
|
+
* @description Wraps the `cac:ProjectReference` element on an invoice: an identifier of the project the invoice relates to.
|
|
2922
|
+
*
|
|
2923
|
+
* @example
|
|
2924
|
+
* ```ts
|
|
2925
|
+
* { id: 'project-123' }
|
|
2926
|
+
* ```;
|
|
2927
|
+
*
|
|
2928
|
+
* @see {@link PeppolInvoice}
|
|
2929
|
+
*/
|
|
2340
2930
|
var PeppolProjectReference = class extends opaque()(Schema.Struct({ id: Schema.String })) {};
|
|
2931
|
+
/**
|
|
2932
|
+
* @description UBL `Invoice` for PEPPOL BIS Billing 3.0. Extends {@link PeppolBillingBase} with the due date, type code, lines and project reference.
|
|
2933
|
+
*
|
|
2934
|
+
* @example
|
|
2935
|
+
* ```ts
|
|
2936
|
+
* {
|
|
2937
|
+
* customizationId: 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0',
|
|
2938
|
+
* profileId: 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
|
|
2939
|
+
* id: '33445566',
|
|
2940
|
+
* issueDate: '2017-11-01',
|
|
2941
|
+
* documentCurrencyCode: 'EUR',
|
|
2942
|
+
* invoiceTypeCode: '380'
|
|
2943
|
+
* }
|
|
2944
|
+
* ```;
|
|
2945
|
+
*
|
|
2946
|
+
* @see {@link PeppolBillingBase}
|
|
2947
|
+
* @see {@link PeppolCreditNote}
|
|
2948
|
+
*/
|
|
2341
2949
|
var PeppolInvoice = class extends opaque()(Schema.Struct({
|
|
2342
2950
|
...PeppolBillingBase.fields,
|
|
2343
2951
|
/**
|
|
@@ -2363,7 +2971,7 @@ var PeppolInvoice = class extends opaque()(Schema.Struct({
|
|
|
2363
2971
|
*
|
|
2364
2972
|
* @name cbc:InvoiceTypeCode
|
|
2365
2973
|
*/
|
|
2366
|
-
invoiceTypeCode:
|
|
2974
|
+
invoiceTypeCode: PeppolInvoiceTypeCode,
|
|
2367
2975
|
/**
|
|
2368
2976
|
* @summary PROJECT REFERENCE
|
|
2369
2977
|
*
|
|
@@ -2400,19 +3008,21 @@ creditedQuantity: PeppolQuantity.pipe(Schema.fieldsAssign({
|
|
|
2400
3008
|
*
|
|
2401
3009
|
* @see {@link quantityUnitCodes}
|
|
2402
3010
|
*/
|
|
2403
|
-
unitCode:
|
|
3011
|
+
unitCode: PeppolQuantityUnitCode })) }))) {};
|
|
2404
3012
|
//#endregion
|
|
2405
3013
|
//#region src/schemas/values/credit-note-type-code-schema.ts
|
|
2406
3014
|
/**
|
|
2407
|
-
* @description
|
|
2408
|
-
*
|
|
2409
|
-
* @param error - The custom error message to use when validation fails.
|
|
3015
|
+
* @description A credit note type code from the PEPPOL subset of UNCL 1001 (credit note).
|
|
2410
3016
|
*
|
|
2411
|
-
* @
|
|
3017
|
+
* @example
|
|
3018
|
+
* ```ts
|
|
3019
|
+
* '81';
|
|
3020
|
+
* ```;
|
|
2412
3021
|
*
|
|
2413
3022
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL1001-cn/
|
|
3023
|
+
* @see {@link creditNoteTypeCodesKeys}
|
|
2414
3024
|
*/
|
|
2415
|
-
|
|
3025
|
+
var PeppolCreditNoteTypeCode = class extends opaque()(Schema.Literals(creditNoteTypeCodesKeys)) {};
|
|
2416
3026
|
//#endregion
|
|
2417
3027
|
//#region src/schemas/peppol-credit-note-schema.ts
|
|
2418
3028
|
/**
|
|
@@ -2435,10 +3045,20 @@ var PeppolCreditNote = class extends opaque()(Schema.Struct({
|
|
|
2435
3045
|
*
|
|
2436
3046
|
* @name cbc:CreditNoteTypeCode
|
|
2437
3047
|
*/
|
|
2438
|
-
creditNoteTypeCode:
|
|
3048
|
+
creditNoteTypeCode: PeppolCreditNoteTypeCode
|
|
2439
3049
|
})) {};
|
|
2440
3050
|
//#endregion
|
|
2441
3051
|
//#region src/schemas/peppol-message-level-response-party-schema.ts
|
|
3052
|
+
/**
|
|
3053
|
+
* @description Party used as `cac:SenderParty` or `cac:ReceiverParty` on a message level response, holding the party's electronic address.
|
|
3054
|
+
*
|
|
3055
|
+
* @example
|
|
3056
|
+
* ```ts
|
|
3057
|
+
* { endpointId: { id: '7300010000001', schemeId: '0088' } }
|
|
3058
|
+
* ```;
|
|
3059
|
+
*
|
|
3060
|
+
* @see {@link PeppolMessageLevelResponse}
|
|
3061
|
+
*/
|
|
2442
3062
|
var PeppolMessageLevelResponseParty = class extends opaque()(Schema.Struct({
|
|
2443
3063
|
/**
|
|
2444
3064
|
* @description Identifies the sender party's electronic address.
|
|
@@ -2454,17 +3074,29 @@ endpointId: Schema.optional(PeppolIdentifier) })) {};
|
|
|
2454
3074
|
//#endregion
|
|
2455
3075
|
//#region src/schemas/values/peppol-document-type-code-schema.ts
|
|
2456
3076
|
/**
|
|
2457
|
-
* @description
|
|
3077
|
+
* @description A document type code from the PEPPOL subset of UNCL 1001.
|
|
2458
3078
|
*
|
|
2459
|
-
* @
|
|
2460
|
-
*
|
|
2461
|
-
*
|
|
3079
|
+
* @example
|
|
3080
|
+
* ```ts
|
|
3081
|
+
* '1';
|
|
3082
|
+
* ```;
|
|
2462
3083
|
*
|
|
2463
3084
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL1001/
|
|
3085
|
+
* @see {@link documentTypeCodesKeys}
|
|
2464
3086
|
*/
|
|
2465
|
-
|
|
3087
|
+
var PeppolDocumentTypeCode = class extends opaque()(Schema.Literals(documentTypeCodesKeys).pipe(Schema.brand("PeppolDocumentTypeCode"))) {};
|
|
2466
3088
|
//#endregion
|
|
2467
3089
|
//#region src/schemas/peppol-document-response-document-reference-schema.ts
|
|
3090
|
+
/**
|
|
3091
|
+
* @description Wraps `cac:DocumentReference` inside a message level response: identifies the business document the response is based on.
|
|
3092
|
+
*
|
|
3093
|
+
* @example
|
|
3094
|
+
* ```ts
|
|
3095
|
+
* { id: 'EnvelopeID-12345', versionId: '2' }
|
|
3096
|
+
* ```;
|
|
3097
|
+
*
|
|
3098
|
+
* @see {@link PeppolMessageLevelResponseDocumentResponse}
|
|
3099
|
+
*/
|
|
2468
3100
|
var PeppolDocumentResponseDocumentReference = class extends opaque()(Schema.Struct({
|
|
2469
3101
|
/**
|
|
2470
3102
|
* @description Identifies the document on which the message level response is based.
|
|
@@ -2484,7 +3116,7 @@ var PeppolDocumentResponseDocumentReference = class extends opaque()(Schema.Stru
|
|
|
2484
3116
|
*
|
|
2485
3117
|
* @name `cbc:DocumentTypeCode`
|
|
2486
3118
|
*/
|
|
2487
|
-
documentTypeCode: Schema.optional(
|
|
3119
|
+
documentTypeCode: Schema.optional(PeppolDocumentTypeCode),
|
|
2488
3120
|
/**
|
|
2489
3121
|
* @description The version of the document that has been identifier with the document identifier.
|
|
2490
3122
|
*
|
|
@@ -2500,25 +3132,29 @@ var PeppolDocumentResponseDocumentReference = class extends opaque()(Schema.Stru
|
|
|
2500
3132
|
//#endregion
|
|
2501
3133
|
//#region src/schemas/values/application-response-type-code-schema.ts
|
|
2502
3134
|
/**
|
|
2503
|
-
* @description
|
|
2504
|
-
*
|
|
2505
|
-
* @param error - The custom error message to use when validation fails.
|
|
3135
|
+
* @description An application response type code from the PEPPOL subset of UNCL 4343.
|
|
2506
3136
|
*
|
|
2507
|
-
* @
|
|
3137
|
+
* @example
|
|
3138
|
+
* ```ts
|
|
3139
|
+
* 'AB';
|
|
3140
|
+
* ```;
|
|
2508
3141
|
*
|
|
2509
3142
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4343/
|
|
3143
|
+
* @see {@link applicationResponseTypeCodesKeys}
|
|
2510
3144
|
*/
|
|
2511
|
-
|
|
3145
|
+
var PeppolApplicationResponseTypeCode = class extends opaque()(Schema.Literals(applicationResponseTypeCodesKeys)) {};
|
|
2512
3146
|
//#endregion
|
|
2513
3147
|
//#region src/schemas/peppol-document-response-document-schema.ts
|
|
2514
3148
|
/**
|
|
3149
|
+
* @description Wraps `cac:Response` inside a message level response: the overall response code and an optional textual note.
|
|
3150
|
+
*
|
|
2515
3151
|
* @summary Response information
|
|
2516
3152
|
*
|
|
2517
3153
|
* @name `cac:Response`
|
|
2518
3154
|
*
|
|
2519
3155
|
* @cardinality (1..1)
|
|
2520
3156
|
*
|
|
2521
|
-
* @see {@link
|
|
3157
|
+
* @see {@link PeppolMessageLevelResponseDocumentResponse}
|
|
2522
3158
|
*/
|
|
2523
3159
|
var PeppolDocumentResponseDocument = class extends opaque()(Schema.Struct({
|
|
2524
3160
|
/**
|
|
@@ -2532,7 +3168,7 @@ var PeppolDocumentResponseDocument = class extends opaque()(Schema.Struct({
|
|
|
2532
3168
|
*
|
|
2533
3169
|
* @name `cbc:ResponseCode`
|
|
2534
3170
|
*/
|
|
2535
|
-
responseCode:
|
|
3171
|
+
responseCode: PeppolApplicationResponseTypeCode,
|
|
2536
3172
|
/**
|
|
2537
3173
|
* @description Used to meake any comments or instructions relevant to the response. The use of this element requires manual assessment by the receiver.
|
|
2538
3174
|
*
|
|
@@ -2542,6 +3178,16 @@ var PeppolDocumentResponseDocument = class extends opaque()(Schema.Struct({
|
|
|
2542
3178
|
})) {};
|
|
2543
3179
|
//#endregion
|
|
2544
3180
|
//#region src/schemas/peppol-document-response-line-response-content-schema.ts
|
|
3181
|
+
/**
|
|
3182
|
+
* @description Wraps `cac:Status` inside a line response: the coded reason for an issue found in the document.
|
|
3183
|
+
*
|
|
3184
|
+
* @example
|
|
3185
|
+
* ```ts
|
|
3186
|
+
* { statusReasonCode: 'SV' }
|
|
3187
|
+
* ```;
|
|
3188
|
+
*
|
|
3189
|
+
* @see {@link PeppolDocumentResponseLineResponseContent}
|
|
3190
|
+
*/
|
|
2545
3191
|
var PeppolStatus = class extends opaque()(Schema.Struct({
|
|
2546
3192
|
/**
|
|
2547
3193
|
* @description A codified version of the issue description that describes the nature of the issue. e.g. Syntax violation, business rule violation, ...
|
|
@@ -2555,6 +3201,16 @@ statusReasonCode: Schema.Literals([
|
|
|
2555
3201
|
"BW",
|
|
2556
3202
|
"SV"
|
|
2557
3203
|
]) })) {};
|
|
3204
|
+
/**
|
|
3205
|
+
* @description A response to a particular line in the business document: the line response code, a description of the issue and its coded status.
|
|
3206
|
+
*
|
|
3207
|
+
* @example
|
|
3208
|
+
* ```ts
|
|
3209
|
+
* { responseCode: 'RE', description: 'Validation gives error [CL-T77-R0002]', status: { statusReasonCode: 'SV' } }
|
|
3210
|
+
* ```;
|
|
3211
|
+
*
|
|
3212
|
+
* @see {@link PeppolDocumentResponseLineResponse}
|
|
3213
|
+
*/
|
|
2558
3214
|
var PeppolDocumentResponseLineResponseContent = class extends opaque()(Schema.Struct({
|
|
2559
3215
|
/**
|
|
2560
3216
|
* @description An indicator stating whether the referenced message was cleared through validation and advanced to the next step in the process. A negative
|
|
@@ -2567,7 +3223,7 @@ var PeppolDocumentResponseLineResponseContent = class extends opaque()(Schema.St
|
|
|
2567
3223
|
*
|
|
2568
3224
|
* @name `cbc:ResponseCode`
|
|
2569
3225
|
*/
|
|
2570
|
-
responseCode:
|
|
3226
|
+
responseCode: PeppolApplicationResponseTypeCode,
|
|
2571
3227
|
/**
|
|
2572
3228
|
* @description The description of the issued identifier in the transaction document.
|
|
2573
3229
|
*
|
|
@@ -2586,6 +3242,16 @@ var PeppolDocumentResponseLineResponseContent = class extends opaque()(Schema.St
|
|
|
2586
3242
|
})) {};
|
|
2587
3243
|
//#endregion
|
|
2588
3244
|
//#region src/schemas/peppol-document-response-line-response-schema.ts
|
|
3245
|
+
/**
|
|
3246
|
+
* @description Wraps `cac:LineReference` inside a line response: an XPath pointing at the element that caused the reported issue.
|
|
3247
|
+
*
|
|
3248
|
+
* @example
|
|
3249
|
+
* ```ts
|
|
3250
|
+
* { lineId: '/Invoice/cac:InvoiceLine[1]' }
|
|
3251
|
+
* ```;
|
|
3252
|
+
*
|
|
3253
|
+
* @see {@link PeppolDocumentResponseLineResponse}
|
|
3254
|
+
*/
|
|
2589
3255
|
var PeppolLineReference = class extends opaque()(Schema.Struct({
|
|
2590
3256
|
/**
|
|
2591
3257
|
* @description Identifies the section of the document to which the reported issue applied. The LineID element mustbe used to indicate where in the business
|
|
@@ -2599,6 +3265,19 @@ var PeppolLineReference = class extends opaque()(Schema.Struct({
|
|
|
2599
3265
|
* @summary Section identifier
|
|
2600
3266
|
*/
|
|
2601
3267
|
lineId: Schema.String })) {};
|
|
3268
|
+
/**
|
|
3269
|
+
* @description Wraps `cac:LineResponse` inside a message level response: pairs a line reference with the response for that line.
|
|
3270
|
+
*
|
|
3271
|
+
* @example
|
|
3272
|
+
* ```ts
|
|
3273
|
+
* {
|
|
3274
|
+
* lineReference: { lineId: '/Invoice/cac:InvoiceLine[1]' },
|
|
3275
|
+
* response: { responseCode: 'RE', description: 'Invalid tax category', status: { statusReasonCode: 'SV' } }
|
|
3276
|
+
* }
|
|
3277
|
+
* ```;
|
|
3278
|
+
*
|
|
3279
|
+
* @see {@link PeppolMessageLevelResponseDocumentResponse}
|
|
3280
|
+
*/
|
|
2602
3281
|
var PeppolDocumentResponseLineResponse = class extends opaque()(Schema.Struct({
|
|
2603
3282
|
/**
|
|
2604
3283
|
* @description Identifies the line in the business document to which the reported issue applies.
|
|
@@ -2615,6 +3294,16 @@ var PeppolDocumentResponseLineResponse = class extends opaque()(Schema.Struct({
|
|
|
2615
3294
|
})) {};
|
|
2616
3295
|
//#endregion
|
|
2617
3296
|
//#region src/schemas/peppol-message-level-response-document-response-schema.ts
|
|
3297
|
+
/**
|
|
3298
|
+
* @description Wraps `cac:DocumentResponse` inside a message level response: the response, the document reference and any per-line responses.
|
|
3299
|
+
*
|
|
3300
|
+
* @example
|
|
3301
|
+
* ```ts
|
|
3302
|
+
* { response: { responseCode: 'RE' }, documentReference: { id: 'EnvelopeID-12345' }, lineResponse: [] }
|
|
3303
|
+
* ```;
|
|
3304
|
+
*
|
|
3305
|
+
* @see {@link PeppolMessageLevelResponse}
|
|
3306
|
+
*/
|
|
2618
3307
|
var PeppolMessageLevelResponseDocumentResponse = class extends opaque()(Schema.Struct({
|
|
2619
3308
|
/**
|
|
2620
3309
|
* @summary Response information
|
|
@@ -2725,9 +3414,14 @@ const numberFromString = (value) => {
|
|
|
2725
3414
|
/**
|
|
2726
3415
|
* @description Parse a timezone offset from a string. The string must be in the format `(+|-)HH:MM` where `HH` and `MM` are two digits.
|
|
2727
3416
|
*
|
|
2728
|
-
* @
|
|
3417
|
+
* @example
|
|
3418
|
+
* ```ts
|
|
3419
|
+
* parseZoneOffsetFromString('+01:00'); // a +01:00 zone offset
|
|
3420
|
+
* ```;
|
|
3421
|
+
*
|
|
3422
|
+
* @param tz - The timezone offset string.
|
|
2729
3423
|
*
|
|
2730
|
-
* @returns
|
|
3424
|
+
* @returns A `DateTime.Zone` offset built from the parsed hours and minutes, or `undefined` when `tz` does not match the offset pattern.
|
|
2731
3425
|
*
|
|
2732
3426
|
* @internal
|
|
2733
3427
|
*/
|
|
@@ -2740,6 +3434,11 @@ const parseZoneOffsetFromString = (tz) => {
|
|
|
2740
3434
|
/**
|
|
2741
3435
|
* @description XSD `time` lexical value (`HH:MM:SS` with optional fractional seconds and timezone). Effect port of `xsdTime` (`z.string().check(z.regex(...))`):
|
|
2742
3436
|
* keeps the value as a plain string and only validates the shape.
|
|
3437
|
+
*
|
|
3438
|
+
* @example
|
|
3439
|
+
* ```ts
|
|
3440
|
+
* const value = '12:30:45+01:00';
|
|
3441
|
+
* ```;
|
|
2743
3442
|
*/
|
|
2744
3443
|
var PeppolXsdTime = class extends opaque()(Schema.String.check(Schema.isPattern(/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,9})?(?:Z|-0[1-9]|-1\d|-2[0-3]|-00:?(?:0[1-9]|[1-5]\d)|\+[01]\d|\+2[0-3])?(?:|:?[0-5]\d)$/).annotate({ message: "Invalid ISO time" })).pipe(Schema.decodeTo(Schema.DateTimeUtc, {
|
|
2745
3444
|
decode: SchemaGetter.transformEffect((input, options) => Clock.currentTimeMillis.pipe(Effect.map((millis) => DateTime.make(millis)), Effect.flatMap((option) => Effect.fromOption(option)), Effect.map((date) => DateTime.withDate(date, (date) => {
|
|
@@ -2759,6 +3458,24 @@ var PeppolXsdTime = class extends opaque()(Schema.String.check(Schema.isPattern(
|
|
|
2759
3458
|
})).annotate({ message: "Invalid ISO time" })) {};
|
|
2760
3459
|
//#endregion
|
|
2761
3460
|
//#region src/schemas/peppol-message-level-response-schema.ts
|
|
3461
|
+
/**
|
|
3462
|
+
* @description UBL `ApplicationResponse` message level response for PEPPOL BIS Billing 3.0 (profile `urn:fdc:peppol.eu:poacc:bis:mlr:3`).
|
|
3463
|
+
*
|
|
3464
|
+
* @example
|
|
3465
|
+
* ```ts
|
|
3466
|
+
* {
|
|
3467
|
+
* customizationId: 'urn:fdc:peppol.eu:poacc:trns:mlr:3',
|
|
3468
|
+
* profileId: 'urn:fdc:peppol.eu:poacc:bis:mlr:3',
|
|
3469
|
+
* id: '23',
|
|
3470
|
+
* issueDate: '2017-11-01',
|
|
3471
|
+
* senderParty: {},
|
|
3472
|
+
* receiverParty: {},
|
|
3473
|
+
* documentResponse: { response: { responseCode: 'RE' }, documentReference: { id: 'EnvelopeID-12345' }, lineResponse: [] }
|
|
3474
|
+
* }
|
|
3475
|
+
* ```;
|
|
3476
|
+
*
|
|
3477
|
+
* @see {@link PeppolInvoiceResponse}
|
|
3478
|
+
*/
|
|
2762
3479
|
var PeppolMessageLevelResponse = class extends opaque()(Schema.Struct({
|
|
2763
3480
|
/**
|
|
2764
3481
|
* @description Identifies the specification of content and rules that apply to the transaction.
|
|
@@ -2849,31 +3566,45 @@ var PeppolMessageLevelResponse = class extends opaque()(Schema.Struct({
|
|
|
2849
3566
|
//#endregion
|
|
2850
3567
|
//#region src/schemas/values/op-status-action-schema.ts
|
|
2851
3568
|
/**
|
|
2852
|
-
* @description
|
|
3569
|
+
* @description An OpenPeppol operation status action code from the OPStatusAction codelist.
|
|
2853
3570
|
*
|
|
2854
|
-
* @
|
|
2855
|
-
*
|
|
2856
|
-
*
|
|
3571
|
+
* @example
|
|
3572
|
+
* ```ts
|
|
3573
|
+
* 'NOA';
|
|
3574
|
+
* ```;
|
|
2857
3575
|
*
|
|
2858
3576
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/OPStatusAction/
|
|
3577
|
+
* @see {@link opStatusActionKeys}
|
|
2859
3578
|
*/
|
|
2860
|
-
|
|
3579
|
+
var PeppolOpStatusAction = class extends opaque()(Schema.Literals(opStatusActionKeys).pipe(Schema.brand("PeppolOpStatusAction"))) {};
|
|
2861
3580
|
//#endregion
|
|
2862
3581
|
//#region src/schemas/values/op-status-reason-schema.ts
|
|
2863
3582
|
/**
|
|
2864
|
-
* @description
|
|
3583
|
+
* @description An OpenPeppol operation status reason code from the OPStatusReason codelist.
|
|
2865
3584
|
*
|
|
2866
|
-
* @
|
|
2867
|
-
*
|
|
2868
|
-
*
|
|
3585
|
+
* @example
|
|
3586
|
+
* ```ts
|
|
3587
|
+
* 'NON';
|
|
3588
|
+
* ```;
|
|
2869
3589
|
*
|
|
2870
3590
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/OPStatusReason/
|
|
3591
|
+
* @see {@link opStatusReasonKeys}
|
|
2871
3592
|
*/
|
|
2872
|
-
|
|
3593
|
+
var PeppolOpStatusReason = class extends opaque()(Schema.Literals(opStatusReasonKeys).pipe(Schema.brand("PeppolOpStatusReason"))) {};
|
|
2873
3594
|
//#endregion
|
|
2874
3595
|
//#region src/schemas/peppol-invoice-response-status-reason-code-schema.ts
|
|
3596
|
+
/**
|
|
3597
|
+
* @description Status clarification reason (`cbc:StatusReasonCode` with `@listId="OPStatusReason"`), a value from the OPStatusReason code list.
|
|
3598
|
+
*
|
|
3599
|
+
* @example
|
|
3600
|
+
* ```ts
|
|
3601
|
+
* { value: 'REF', listId: 'OPStatusReason' }
|
|
3602
|
+
* ```;
|
|
3603
|
+
*
|
|
3604
|
+
* @see {@link PeppolInvoiceResponseStatusReasonCode}
|
|
3605
|
+
*/
|
|
2875
3606
|
var PeppolInvoiceResponseStatusReasonCodeReason = class extends opaque()(Schema.Struct({
|
|
2876
|
-
value:
|
|
3607
|
+
value: PeppolOpStatusReason,
|
|
2877
3608
|
/**
|
|
2878
3609
|
* @description List identifier for clarification.
|
|
2879
3610
|
*
|
|
@@ -2883,8 +3614,18 @@ var PeppolInvoiceResponseStatusReasonCodeReason = class extends opaque()(Schema.
|
|
|
2883
3614
|
*/
|
|
2884
3615
|
listId: Schema.Literal("OPStatusReason")
|
|
2885
3616
|
})) {};
|
|
3617
|
+
/**
|
|
3618
|
+
* @description Status clarification action (`cbc:StatusReasonCode` with `@listId="OPStatusAction"`), a value from the OPStatusAction code list.
|
|
3619
|
+
*
|
|
3620
|
+
* @example
|
|
3621
|
+
* ```ts
|
|
3622
|
+
* { value: 'PIN', listId: 'OPStatusAction' }
|
|
3623
|
+
* ```;
|
|
3624
|
+
*
|
|
3625
|
+
* @see {@link PeppolInvoiceResponseStatusReasonCode}
|
|
3626
|
+
*/
|
|
2886
3627
|
var PeppolInvoiceResponseStatusReasonCodeAction = class extends opaque()(Schema.Struct({
|
|
2887
|
-
value:
|
|
3628
|
+
value: PeppolOpStatusAction,
|
|
2888
3629
|
/**
|
|
2889
3630
|
* @description List identifier for clarification.
|
|
2890
3631
|
*
|
|
@@ -2894,9 +3635,29 @@ var PeppolInvoiceResponseStatusReasonCodeAction = class extends opaque()(Schema.
|
|
|
2894
3635
|
*/
|
|
2895
3636
|
listId: Schema.Literal("OPStatusAction")
|
|
2896
3637
|
})) {};
|
|
2897
|
-
|
|
3638
|
+
/**
|
|
3639
|
+
* @description Union of the accepted status clarification reasons and actions on an invoice response.
|
|
3640
|
+
*
|
|
3641
|
+
* @example
|
|
3642
|
+
* ```ts
|
|
3643
|
+
* { value: 'REF', listId: 'OPStatusReason' }
|
|
3644
|
+
* ```;
|
|
3645
|
+
*
|
|
3646
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponseStatus}
|
|
3647
|
+
*/
|
|
3648
|
+
var PeppolInvoiceResponseStatusReasonCode = class extends opaque()(Schema.Union([PeppolInvoiceResponseStatusReasonCodeAction, PeppolInvoiceResponseStatusReasonCodeReason])) {};
|
|
2898
3649
|
//#endregion
|
|
2899
3650
|
//#region src/schemas/peppol-invoice-response-document-actual-response-status-schema.ts
|
|
3651
|
+
/**
|
|
3652
|
+
* @description Wraps `cac:Condition` inside a status: a detail code and its optional value that further explains the clarification.
|
|
3653
|
+
*
|
|
3654
|
+
* @example
|
|
3655
|
+
* ```ts
|
|
3656
|
+
* { attributeId: 'BT-75', description: 'EU123456789' }
|
|
3657
|
+
* ```;
|
|
3658
|
+
*
|
|
3659
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponseStatus}
|
|
3660
|
+
*/
|
|
2900
3661
|
var PeppolInvoiceResponseCondition = class extends opaque()(Schema.Struct({
|
|
2901
3662
|
/**
|
|
2902
3663
|
* @description A code defining the type of the detail.
|
|
@@ -2921,6 +3682,16 @@ var PeppolInvoiceResponseCondition = class extends opaque()(Schema.Struct({
|
|
|
2921
3682
|
*/
|
|
2922
3683
|
description: Schema.optional(Schema.String)
|
|
2923
3684
|
})) {};
|
|
3685
|
+
/**
|
|
3686
|
+
* @description Wraps `cac:Status` inside an invoice response: an optional clarification code and description plus any condition details.
|
|
3687
|
+
*
|
|
3688
|
+
* @example
|
|
3689
|
+
* ```ts
|
|
3690
|
+
* { statusReasonCode: { value: 'REF', listId: 'OPStatusReason' }, statusReason: 'TAX reference not found' }
|
|
3691
|
+
* ```;
|
|
3692
|
+
*
|
|
3693
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponse}
|
|
3694
|
+
*/
|
|
2924
3695
|
var PeppolInvoiceResponseDocumentActualResponseStatus = class extends opaque()(Schema.Struct({
|
|
2925
3696
|
/**
|
|
2926
3697
|
* @description A code defining a clarification given for the invoice status.
|
|
@@ -2929,7 +3700,7 @@ var PeppolInvoiceResponseDocumentActualResponseStatus = class extends opaque()(S
|
|
|
2929
3700
|
*
|
|
2930
3701
|
* @name `cbc:StatusReasonCode`
|
|
2931
3702
|
*/
|
|
2932
|
-
statusReasonCode: Schema.optional(
|
|
3703
|
+
statusReasonCode: Schema.optional(PeppolInvoiceResponseStatusReasonCode),
|
|
2933
3704
|
/**
|
|
2934
3705
|
* @description The description of the clarification given for the invoice status.
|
|
2935
3706
|
*
|
|
@@ -2950,8 +3721,38 @@ var PeppolInvoiceResponseDocumentActualResponseStatus = class extends opaque()(S
|
|
|
2950
3721
|
})) {};
|
|
2951
3722
|
//#endregion
|
|
2952
3723
|
//#region src/schemas/peppol-invoice-response-document-actual-response-schema.ts
|
|
3724
|
+
/**
|
|
3725
|
+
* @description Response codes that require a clarification in `cac:Status`: `UQ`, `RE` and `CA`.
|
|
3726
|
+
*
|
|
3727
|
+
* @example
|
|
3728
|
+
* ```ts
|
|
3729
|
+
* withStatusCodes; // Schema.Literals(['UQ', 'RE', 'CA'])
|
|
3730
|
+
* ```;
|
|
3731
|
+
*
|
|
3732
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponseWithStatus}
|
|
3733
|
+
*/
|
|
2953
3734
|
const withStatusCodes = Schema.Literals(invoiceResponseCodeNeedsSchema);
|
|
3735
|
+
/**
|
|
3736
|
+
* @description Response codes that do not require a clarification in `cac:Status`: `AB`, `AP`, `IP` and `PD`.
|
|
3737
|
+
*
|
|
3738
|
+
* @example
|
|
3739
|
+
* ```ts
|
|
3740
|
+
* withoutStatusCodes; // Schema.Literals(['AB', 'AP', 'IP', 'PD'])
|
|
3741
|
+
* ```;
|
|
3742
|
+
*
|
|
3743
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponseWithoutStatus}
|
|
3744
|
+
*/
|
|
2954
3745
|
const withoutStatusCodes = Schema.Literals(invoiceResponseCodeNotNeedsSchema);
|
|
3746
|
+
/**
|
|
3747
|
+
* @description Invoice response for statuses that do not require a clarification; the `cac:Status` group is optional.
|
|
3748
|
+
*
|
|
3749
|
+
* @example
|
|
3750
|
+
* ```ts
|
|
3751
|
+
* { responseCode: 'AP', effectiveDate: '2018-08-02' }
|
|
3752
|
+
* ```;
|
|
3753
|
+
*
|
|
3754
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponse}
|
|
3755
|
+
*/
|
|
2955
3756
|
var PeppolInvoiceResponseDocumentActualResponseWithoutStatus = class extends opaque()(Schema.Struct({
|
|
2956
3757
|
/**
|
|
2957
3758
|
* @summary A code stating the status of the invoice in the process.
|
|
@@ -2980,6 +3781,16 @@ var PeppolInvoiceResponseDocumentActualResponseWithoutStatus = class extends opa
|
|
|
2980
3781
|
*/
|
|
2981
3782
|
status: Schema.optional(Schema.Array(PeppolInvoiceResponseDocumentActualResponseStatus))
|
|
2982
3783
|
})) {};
|
|
3784
|
+
/**
|
|
3785
|
+
* @description Invoice response for statuses that require a clarification; at least one `cac:Status` group is mandatory.
|
|
3786
|
+
*
|
|
3787
|
+
* @example
|
|
3788
|
+
* ```ts
|
|
3789
|
+
* { responseCode: 'RE', status: [{ statusReason: 'TAX reference not found' }] }
|
|
3790
|
+
* ```;
|
|
3791
|
+
*
|
|
3792
|
+
* @see {@link PeppolInvoiceResponseDocumentActualResponse}
|
|
3793
|
+
*/
|
|
2983
3794
|
var PeppolInvoiceResponseDocumentActualResponseWithStatus = class extends opaque()(Schema.Struct({
|
|
2984
3795
|
/**
|
|
2985
3796
|
* @remarks
|
|
@@ -3011,9 +3822,29 @@ var PeppolInvoiceResponseDocumentActualResponseWithStatus = class extends opaque
|
|
|
3011
3822
|
*/
|
|
3012
3823
|
status: Schema.Array(PeppolInvoiceResponseDocumentActualResponseStatus).check(Schema.isMinLength(1))
|
|
3013
3824
|
})) {};
|
|
3014
|
-
|
|
3825
|
+
/**
|
|
3826
|
+
* @description Union of the invoice response variants selected by `cbc:ResponseCode`: one that requires a clarification and one that does not.
|
|
3827
|
+
*
|
|
3828
|
+
* @example
|
|
3829
|
+
* ```ts
|
|
3830
|
+
* { responseCode: 'AP', effectiveDate: '2018-08-02' }
|
|
3831
|
+
* ```;
|
|
3832
|
+
*
|
|
3833
|
+
* @see {@link PeppolInvoiceResponseDocumentResponse}
|
|
3834
|
+
*/
|
|
3835
|
+
var PeppolInvoiceResponseDocumentActualResponse = class extends opaque()(Schema.Union([PeppolInvoiceResponseDocumentActualResponseWithStatus, PeppolInvoiceResponseDocumentActualResponseWithoutStatus])) {};
|
|
3015
3836
|
//#endregion
|
|
3016
3837
|
//#region src/schemas/peppol-invoice-response-schema.ts
|
|
3838
|
+
/**
|
|
3839
|
+
* @description Wraps `cac:PartyName` for the seller or buyer on an invoice response: the party's legal or trading name.
|
|
3840
|
+
*
|
|
3841
|
+
* @example
|
|
3842
|
+
* ```ts
|
|
3843
|
+
* { name: 'Seller Business Name AS' }
|
|
3844
|
+
* ```;
|
|
3845
|
+
*
|
|
3846
|
+
* @see {@link PeppolInvoiceResponseDocumentResponseParty}
|
|
3847
|
+
*/
|
|
3017
3848
|
var PeppolInvoiceResponseDocumentResponsePartyName = class extends opaque()(Schema.Struct({
|
|
3018
3849
|
/**
|
|
3019
3850
|
* @description - The party that issued the reference invoice
|
|
@@ -3024,6 +3855,16 @@ var PeppolInvoiceResponseDocumentResponsePartyName = class extends opaque()(Sche
|
|
|
3024
3855
|
* @name `cbc:Name`
|
|
3025
3856
|
*/
|
|
3026
3857
|
name: Schema.String })) {};
|
|
3858
|
+
/**
|
|
3859
|
+
* @description Party used for the sender and receiver of an invoice response. Extends {@link PeppolMessageLevelResponseParty}.
|
|
3860
|
+
*
|
|
3861
|
+
* @example
|
|
3862
|
+
* ```ts
|
|
3863
|
+
* { partyLegalEntity: { registrationName: 'Seller Business Name AS' } }
|
|
3864
|
+
* ```;
|
|
3865
|
+
*
|
|
3866
|
+
* @see {@link PeppolInvoiceResponse}
|
|
3867
|
+
*/
|
|
3027
3868
|
var PeppolInvoiceResponseParty = class extends opaque()(PeppolMessageLevelResponseParty.pipe(Schema.fieldsAssign({
|
|
3028
3869
|
/**
|
|
3029
3870
|
* @summary Party partyIdentification
|
|
@@ -3031,6 +3872,16 @@ var PeppolInvoiceResponseParty = class extends opaque()(PeppolMessageLevelRespon
|
|
|
3031
3872
|
partyIdentification: Schema.optional(PeppolIdentifier),
|
|
3032
3873
|
partyLegalEntity: PeppolPartyLegalEntity.mapFields(Struct.pick(["registrationName"]))
|
|
3033
3874
|
}))) {};
|
|
3875
|
+
/**
|
|
3876
|
+
* @description Sender party of an invoice response. Extends {@link PeppolInvoiceResponseParty} with optional `cac:Contact` details.
|
|
3877
|
+
*
|
|
3878
|
+
* @example
|
|
3879
|
+
* ```ts
|
|
3880
|
+
* { partyLegalEntity: { registrationName: 'Seller Business Name AS' } }
|
|
3881
|
+
* ```;
|
|
3882
|
+
*
|
|
3883
|
+
* @see {@link PeppolInvoiceResponse}
|
|
3884
|
+
*/
|
|
3034
3885
|
var PeppolInvoiceResponseSenderParty = class extends opaque()(PeppolInvoiceResponseParty.pipe(Schema.fieldsAssign({
|
|
3035
3886
|
/**
|
|
3036
3887
|
* @summary Contact information
|
|
@@ -3054,6 +3905,16 @@ var PeppolInvoiceResponseDocumentResponseParty = class extends opaque()(Schema.S
|
|
|
3054
3905
|
*/
|
|
3055
3906
|
partyName: PeppolInvoiceResponseDocumentResponsePartyName
|
|
3056
3907
|
})) {};
|
|
3908
|
+
/**
|
|
3909
|
+
* @description Wraps `cac:DocumentReference` inside an invoice response: identifies the invoice the status applies to.
|
|
3910
|
+
*
|
|
3911
|
+
* @example
|
|
3912
|
+
* ```ts
|
|
3913
|
+
* { id: 'inv-99876', issueDate: '2018-08-01', documentTypeCode: '380' }
|
|
3914
|
+
* ```;
|
|
3915
|
+
*
|
|
3916
|
+
* @see {@link PeppolInvoiceResponseDocumentResponse}
|
|
3917
|
+
*/
|
|
3057
3918
|
var PeppolInvoiceResponseDocumentReference = class extends opaque()(Schema.Struct({
|
|
3058
3919
|
/**
|
|
3059
3920
|
* @description An identifier for the invoice that the status applies to. The invoice identifier must be of the main invoice number that appears in the invoice
|
|
@@ -3084,8 +3945,18 @@ var PeppolInvoiceResponseDocumentReference = class extends opaque()(Schema.Struc
|
|
|
3084
3945
|
*
|
|
3085
3946
|
* @summary Identifier type code
|
|
3086
3947
|
*/
|
|
3087
|
-
documentTypeCode:
|
|
3948
|
+
documentTypeCode: PeppolDocumentTypeCode
|
|
3088
3949
|
})) {};
|
|
3950
|
+
/**
|
|
3951
|
+
* @description Wraps `cac:DocumentResponse` inside an invoice response: the response, the referenced invoice and optional parties.
|
|
3952
|
+
*
|
|
3953
|
+
* @example
|
|
3954
|
+
* ```ts
|
|
3955
|
+
* { response: { responseCode: 'AP', effectiveDate: '2018-08-02' }, documentReference: { id: 'inv-99876', documentTypeCode: '380' } }
|
|
3956
|
+
* ```;
|
|
3957
|
+
*
|
|
3958
|
+
* @see {@link PeppolInvoiceResponse}
|
|
3959
|
+
*/
|
|
3089
3960
|
var PeppolInvoiceResponseDocumentResponse = class extends opaque()(Schema.Struct({
|
|
3090
3961
|
/**
|
|
3091
3962
|
* @summary Response information
|
|
@@ -3094,7 +3965,7 @@ var PeppolInvoiceResponseDocumentResponse = class extends opaque()(Schema.Struct
|
|
|
3094
3965
|
*
|
|
3095
3966
|
* @cardinality (1..1)
|
|
3096
3967
|
*/
|
|
3097
|
-
response:
|
|
3968
|
+
response: PeppolInvoiceResponseDocumentActualResponse,
|
|
3098
3969
|
/**
|
|
3099
3970
|
* @summary Document reference
|
|
3100
3971
|
*
|
|
@@ -4604,9 +5475,49 @@ const peppolDocumentObjectSchema = Schema.Union([
|
|
|
4604
5475
|
PeppolInvoiceResponse
|
|
4605
5476
|
], { mode: "oneOf" });
|
|
4606
5477
|
const parseXml = (value) => parseXmlNodable(value);
|
|
5478
|
+
/**
|
|
5479
|
+
* @description Type guard that returns `true` when a decoded value is a {@link PeppolInvoice}.
|
|
5480
|
+
*
|
|
5481
|
+
* @example
|
|
5482
|
+
* ```ts
|
|
5483
|
+
* isPeppolInvoice(doc); // true for a UBL Invoice
|
|
5484
|
+
* ```;
|
|
5485
|
+
*
|
|
5486
|
+
* @see {@link PeppolDocumentSchema}
|
|
5487
|
+
*/
|
|
4607
5488
|
const isPeppolInvoice = Schema.is(PeppolInvoice);
|
|
5489
|
+
/**
|
|
5490
|
+
* @description Type guard that returns `true` when a decoded value is a {@link PeppolCreditNote}.
|
|
5491
|
+
*
|
|
5492
|
+
* @example
|
|
5493
|
+
* ```ts
|
|
5494
|
+
* isPeppolCreditNote(doc); // true for a UBL CreditNote
|
|
5495
|
+
* ```;
|
|
5496
|
+
*
|
|
5497
|
+
* @see {@link PeppolDocumentSchema}
|
|
5498
|
+
*/
|
|
4608
5499
|
const isPeppolCreditNote = Schema.is(PeppolCreditNote);
|
|
5500
|
+
/**
|
|
5501
|
+
* @description Type guard that returns `true` when a decoded value is a {@link PeppolMessageLevelResponse}.
|
|
5502
|
+
*
|
|
5503
|
+
* @example
|
|
5504
|
+
* ```ts
|
|
5505
|
+
* isPeppolMessageLevelResponse(doc); // true for an MLR ApplicationResponse
|
|
5506
|
+
* ```;
|
|
5507
|
+
*
|
|
5508
|
+
* @see {@link PeppolDocumentSchema}
|
|
5509
|
+
*/
|
|
4609
5510
|
const isPeppolMessageLevelResponse = Schema.is(PeppolMessageLevelResponse);
|
|
5511
|
+
/**
|
|
5512
|
+
* @description Type guard that returns `true` when a decoded value is a {@link PeppolInvoiceResponse}.
|
|
5513
|
+
*
|
|
5514
|
+
* @example
|
|
5515
|
+
* ```ts
|
|
5516
|
+
* isPeppolInvoiceResponse(doc); // true for an invoice response ApplicationResponse
|
|
5517
|
+
* ```;
|
|
5518
|
+
*
|
|
5519
|
+
* @see {@link PeppolDocumentSchema}
|
|
5520
|
+
*/
|
|
4610
5521
|
const isPeppolInvoiceResponse = Schema.is(PeppolInvoiceResponse);
|
|
4611
5522
|
/**
|
|
4612
5523
|
* @description XML string -> loose document object. Dispatches on the root element; `ApplicationResponse` is further split by its `cbc:ProfileID`.
|
|
@@ -4640,18 +5551,52 @@ const encodeDocumentXml = Effect.fn("encode-peppol-document-xml")(function* (val
|
|
|
4640
5551
|
});
|
|
4641
5552
|
/**
|
|
4642
5553
|
* @description Union of every supported PEPPOL business document. Members discriminate cleanly: invoice vs credit note via `invoiceLines`/`creditNoteLines`,
|
|
4643
|
-
* message-level vs invoice response via the `profileId` literal.
|
|
5554
|
+
* message-level vs invoice response via the `profileId` literal. Decodes and encodes XML strings by dispatching on the root element;
|
|
5555
|
+
* `ApplicationResponse` is split on `cbc:ProfileID`.
|
|
5556
|
+
*
|
|
5557
|
+
* @example
|
|
5558
|
+
* ```ts
|
|
5559
|
+
* const doc = Schema.decodeUnknownSync(PeppolDocumentSchema)(xml); // decoded document union
|
|
5560
|
+
* ```;
|
|
5561
|
+
*
|
|
5562
|
+
* @see {@link PeppolDocumentDecoded}
|
|
5563
|
+
* @see {@link PeppolDocumentEncoded}
|
|
4644
5564
|
*/
|
|
4645
|
-
|
|
5565
|
+
var PeppolDocumentSchema = class extends opaque()(peppolDocumentObjectSchema.pipe(Schema.encodeTo(Schema.String, {
|
|
4646
5566
|
encode: SchemaGetter.transformEffect((value, options) => encodeDocumentXml(value, options)),
|
|
4647
5567
|
decode: SchemaGetter.transformEffect((value, options) => decodeDocumentXml(value, options))
|
|
4648
|
-
}));
|
|
5568
|
+
}))) {};
|
|
4649
5569
|
//#endregion
|
|
4650
5570
|
//#region src/schemas/fields/peppol-reference-schema.ts
|
|
5571
|
+
/**
|
|
5572
|
+
* @description A reference identifier, such as an order or sales order reference.
|
|
5573
|
+
*
|
|
5574
|
+
* @example
|
|
5575
|
+
* ```ts
|
|
5576
|
+
* { id: '123' }
|
|
5577
|
+
* ```;
|
|
5578
|
+
*/
|
|
4651
5579
|
var PeppolReferenceId = class extends opaque()(Schema.Struct({ id: Schema.String })) {};
|
|
5580
|
+
/**
|
|
5581
|
+
* @description A schema for an optional reference identifier, accepting either {@link PeppolReferenceId} or `undefined`.
|
|
5582
|
+
*
|
|
5583
|
+
* @example
|
|
5584
|
+
* ```ts
|
|
5585
|
+
* peppolReferenceSchema; // Schema.Union([PeppolReferenceId, Schema.Undefined])
|
|
5586
|
+
* ```;
|
|
5587
|
+
*/
|
|
4652
5588
|
const peppolReferenceSchema = Schema.Union([PeppolReferenceId, Schema.Undefined]);
|
|
4653
5589
|
//#endregion
|
|
4654
5590
|
//#region src/schemas/utils/quantity-unit-code-to-intl-unit.ts
|
|
5591
|
+
/**
|
|
5592
|
+
* @description Maps UN/ECE Rec 20 quantity unit codes to `Intl.NumberFormat` unit identifiers. Unmapped codes are omitted.
|
|
5593
|
+
*
|
|
5594
|
+
* @example
|
|
5595
|
+
* ```ts
|
|
5596
|
+
* quantityToIntlUnitMap.KGM; // 'kilogram'
|
|
5597
|
+
* quantityToIntlUnitMap.KMH; // 'kilometer-per-hour'
|
|
5598
|
+
* ```;
|
|
5599
|
+
*/
|
|
4655
5600
|
const quantityToIntlUnitMap = {
|
|
4656
5601
|
CMT: "centimeter",
|
|
4657
5602
|
MTR: "meter",
|
|
@@ -4717,11 +5662,45 @@ const quantityToIntlUnitMap = {
|
|
|
4717
5662
|
"4U": "pound-per-hour",
|
|
4718
5663
|
"4M": "gram-per-hour"
|
|
4719
5664
|
};
|
|
5665
|
+
/**
|
|
5666
|
+
* @description Looks up the `Intl.NumberFormat` unit identifier for a UN/ECE Rec 20 quantity unit code.
|
|
5667
|
+
*
|
|
5668
|
+
* @example
|
|
5669
|
+
* ```ts
|
|
5670
|
+
* quantityUnitCodeToIntlUnit('KGM'); // 'kilogram'
|
|
5671
|
+
* quantityUnitCodeToIntlUnit('EA'); // undefined
|
|
5672
|
+
* ```;
|
|
5673
|
+
*
|
|
5674
|
+
* @param code - A quantity unit code, typed as {@link PeppolQuantityUnitCode} but accepting any string.
|
|
5675
|
+
*
|
|
5676
|
+
* @returns The matching {@link IntlUnit}, or `undefined` when the code has no `Intl` unit mapping.
|
|
5677
|
+
*
|
|
5678
|
+
* @see {@link quantityToIntlUnitMap}
|
|
5679
|
+
*/
|
|
4720
5680
|
function quantityUnitCodeToIntlUnit(code) {
|
|
4721
5681
|
return quantityToIntlUnitMap[code];
|
|
4722
5682
|
}
|
|
4723
5683
|
//#endregion
|
|
4724
5684
|
//#region src/schemas/utils/format-quantity-with-unit.ts
|
|
5685
|
+
/**
|
|
5686
|
+
* @description Formats a quantity and its unit code for a locale. Uses `Intl.NumberFormat` for mapped codes, otherwise the code list name.
|
|
5687
|
+
*
|
|
5688
|
+
* @example
|
|
5689
|
+
* ```ts
|
|
5690
|
+
* formatQuantityWithUnit(5, 'KGM', 'en-US', 'long'); // '5 kilograms'
|
|
5691
|
+
* formatQuantityWithUnit(10, 'EA'); // '10 each'
|
|
5692
|
+
* ```;
|
|
5693
|
+
*
|
|
5694
|
+
* @param value - The numeric quantity to format.
|
|
5695
|
+
* @param code - The UN/ECE Rec 20 unit code to render, for example `KGM` or `MTR`.
|
|
5696
|
+
* @param locale - BCP 47 locale tag passed to `Intl.NumberFormat`. Defaults to `'en-US'`.
|
|
5697
|
+
* @param unitDisplay - `Intl` unit display style: `'short'`, `'narrow'`, or `'long'`. Defaults to `'short'`.
|
|
5698
|
+
*
|
|
5699
|
+
* @returns The formatted quantity and unit, for example `'5 kilograms'`. Falls back to `<number> <name>` when the code has no `Intl` unit or `Intl`
|
|
5700
|
+
* rejects the unit.
|
|
5701
|
+
*
|
|
5702
|
+
* @see {@link quantityUnitCodeToIntlUnit}
|
|
5703
|
+
*/
|
|
4725
5704
|
function formatQuantityWithUnit(value, code, locale = "en-US", unitDisplay = "short") {
|
|
4726
5705
|
const intlUnit = quantityToIntlUnitMap[code];
|
|
4727
5706
|
if (intlUnit) try {
|
|
@@ -4735,26 +5714,89 @@ function formatQuantityWithUnit(value, code, locale = "en-US", unitDisplay = "sh
|
|
|
4735
5714
|
}
|
|
4736
5715
|
//#endregion
|
|
4737
5716
|
//#region src/schemas/utils/get-credit-note-type-code-description.ts
|
|
5717
|
+
/**
|
|
5718
|
+
* @description Returns the human-readable description of a PEPPOL credit note type code (UNCL1001 subset).
|
|
5719
|
+
*
|
|
5720
|
+
* @example
|
|
5721
|
+
* ```ts
|
|
5722
|
+
* getCreditNoteTypeCodeDescription('381'); // 'Credit note'
|
|
5723
|
+
* ```;
|
|
5724
|
+
*
|
|
5725
|
+
* @param code - A valid {@link PeppolCreditNoteTypeCode}, for example `'381'`.
|
|
5726
|
+
*
|
|
5727
|
+
* @returns The description registered for the code, for example `'Credit note'`.
|
|
5728
|
+
*/
|
|
4738
5729
|
function getCreditNoteTypeCodeDescription(code) {
|
|
4739
5730
|
return creditNoteTypeCodes[code];
|
|
4740
5731
|
}
|
|
4741
5732
|
//#endregion
|
|
4742
5733
|
//#region src/schemas/utils/get-invoice-type-code-description.ts
|
|
5734
|
+
/**
|
|
5735
|
+
* @description Returns the human-readable description of a PEPPOL invoice type code (UNCL1001 subset).
|
|
5736
|
+
*
|
|
5737
|
+
* @example
|
|
5738
|
+
* ```ts
|
|
5739
|
+
* getInvoiceTypeCodeDescription('380'); // 'Commercial invoice'
|
|
5740
|
+
* ```;
|
|
5741
|
+
*
|
|
5742
|
+
* @param code - A valid {@link PeppolInvoiceTypeCode}, for example `'380'`.
|
|
5743
|
+
*
|
|
5744
|
+
* @returns The description registered for the code, for example `'Commercial invoice'`.
|
|
5745
|
+
*/
|
|
4743
5746
|
function getInvoiceTypeCodeDescription(code) {
|
|
4744
5747
|
return invoiceTypeCodes[code];
|
|
4745
5748
|
}
|
|
4746
5749
|
//#endregion
|
|
4747
5750
|
//#region src/schemas/utils/is-valid-credit-note-type-code.ts
|
|
5751
|
+
/**
|
|
5752
|
+
* @description Type guard for PEPPOL credit note type codes (UNCL1001 subset).
|
|
5753
|
+
*
|
|
5754
|
+
* @example
|
|
5755
|
+
* ```ts
|
|
5756
|
+
* isValidCreditNoteTypeCode('381'); // true
|
|
5757
|
+
* isValidCreditNoteTypeCode('UNKNOWN'); // false
|
|
5758
|
+
* ```;
|
|
5759
|
+
*
|
|
5760
|
+
* @param code - The string to test.
|
|
5761
|
+
*
|
|
5762
|
+
* @returns `true` when `code` is a known credit note type code, narrowing it to {@link PeppolCreditNoteTypeCode}; otherwise `false`.
|
|
5763
|
+
*/
|
|
4748
5764
|
function isValidCreditNoteTypeCode(code) {
|
|
4749
5765
|
return code in creditNoteTypeCodes;
|
|
4750
5766
|
}
|
|
4751
5767
|
//#endregion
|
|
4752
5768
|
//#region src/schemas/utils/is-valid-invoice-type-code.ts
|
|
5769
|
+
/**
|
|
5770
|
+
* @description Type guard for PEPPOL invoice type codes (UNCL1001 subset).
|
|
5771
|
+
*
|
|
5772
|
+
* @example
|
|
5773
|
+
* ```ts
|
|
5774
|
+
* isValidInvoiceTypeCode('380'); // true
|
|
5775
|
+
* isValidInvoiceTypeCode('UNKNOWN'); // false
|
|
5776
|
+
* ```;
|
|
5777
|
+
*
|
|
5778
|
+
* @param code - The string to test.
|
|
5779
|
+
*
|
|
5780
|
+
* @returns `true` when `code` is a known invoice type code, narrowing it to {@link PeppolInvoiceTypeCode}; otherwise `false`.
|
|
5781
|
+
*/
|
|
4753
5782
|
function isValidInvoiceTypeCode(code) {
|
|
4754
5783
|
return code in invoiceTypeCodes;
|
|
4755
5784
|
}
|
|
4756
5785
|
//#endregion
|
|
4757
5786
|
//#region src/schemas/utils/is-valid-process.ts
|
|
5787
|
+
/**
|
|
5788
|
+
* @description Type guard for PEPPOL business process identifiers of the form `<scheme>::<value>`.
|
|
5789
|
+
*
|
|
5790
|
+
* @example
|
|
5791
|
+
* ```ts
|
|
5792
|
+
* isValidProcess('cenbii-procid-ubl::urn:fdc:peppol.eu:2017:poacc:billing:01:1.0'); // true
|
|
5793
|
+
* isValidProcess('cenbii-procid-ubl::urn:not:a:process'); // false
|
|
5794
|
+
* ```;
|
|
5795
|
+
*
|
|
5796
|
+
* @param code - The process identifier to test.
|
|
5797
|
+
*
|
|
5798
|
+
* @returns `true` when `code` appears in {@link processesList}, narrowing it to {@link PeppolProcesses}; otherwise `false`.
|
|
5799
|
+
*/
|
|
4758
5800
|
function isValidProcess(code) {
|
|
4759
5801
|
return processesList.includes(code);
|
|
4760
5802
|
}
|
|
@@ -4768,8 +5810,13 @@ const belgianVat = Schema.String.check(Schema.isStartsWith("BE"), Schema.isLengt
|
|
|
4768
5810
|
/**
|
|
4769
5811
|
* @description EU VAT identification number (one member per member-state prefix/pattern). Effect port of `vatRegexSchema` (`z.union([...])` of
|
|
4770
5812
|
* `z.string().check(...)` members): each member keeps its original prefix + pattern checks as `Schema.String.check` filters.
|
|
5813
|
+
*
|
|
5814
|
+
* @example
|
|
5815
|
+
* ```ts
|
|
5816
|
+
* const value = 'DE123456789';
|
|
5817
|
+
* ```;
|
|
4771
5818
|
*/
|
|
4772
|
-
|
|
5819
|
+
var PeppolVatRegex = class extends opaque()(Schema.Union([
|
|
4773
5820
|
belgianVat,
|
|
4774
5821
|
Schema.String.check(Schema.isStartsWith("AT"), Schema.isPattern(/^ATU\d{8}$/)),
|
|
4775
5822
|
Schema.String.check(Schema.isStartsWith("BG"), Schema.isPattern(/^BG\d{9,10}$/)),
|
|
@@ -4798,20 +5845,15 @@ const peppolVatRegexSchema = Schema.Union([
|
|
|
4798
5845
|
Schema.String.check(Schema.isStartsWith("SE"), Schema.isPattern(/^SE\d{12}$/)),
|
|
4799
5846
|
Schema.String.check(Schema.isStartsWith("SI"), Schema.isPattern(/^SI\d{8}$/)),
|
|
4800
5847
|
Schema.String.check(Schema.isStartsWith("SK"), Schema.isPattern(/^SK\d{10}$/))
|
|
4801
|
-
]);
|
|
5848
|
+
])) {};
|
|
4802
5849
|
//#endregion
|
|
4803
5850
|
//#region src/schemas/values/peppol-document-type-schema.ts
|
|
4804
5851
|
/**
|
|
4805
|
-
* @description
|
|
4806
|
-
* and the full identifier must exist in the document type table (checked via a filter).
|
|
4807
|
-
*
|
|
4808
|
-
* @param error - The custom error message to use when validation fails. Defaults to `'invalid peppol document type'`.
|
|
4809
|
-
*
|
|
4810
|
-
* @returns An Effect schema that matches a valid `scheme::value` document type identifier.
|
|
5852
|
+
* @description A full PEPPOL document type identifier in `<scheme>::<value>` form. The scheme prefix and value must both be known.
|
|
4811
5853
|
*
|
|
4812
5854
|
* @see {@link documentTypesTable}
|
|
4813
5855
|
*/
|
|
4814
|
-
|
|
5856
|
+
var PeppolDocumentType = class extends opaque()(Schema.TemplateLiteral([
|
|
4815
5857
|
Schema.Literals(documentTypesTableKeys),
|
|
4816
5858
|
Schema.Literal("::"),
|
|
4817
5859
|
Schema.String
|
|
@@ -4820,66 +5862,69 @@ const peppolDocumentTypeSchema = Schema.TemplateLiteral([
|
|
|
4820
5862
|
if (Predicate.isNullish(prefix) || !documentTypesTableKeys.includes(prefix)) return false;
|
|
4821
5863
|
const info = documentTypesTable[prefix];
|
|
4822
5864
|
return Predicate.isNotNullish(info) && info.some((v) => v === suffix.join("::"));
|
|
4823
|
-
}));
|
|
5865
|
+
}))) {};
|
|
4824
5866
|
//#endregion
|
|
4825
5867
|
//#region src/schemas/values/document-type-schemes-schema.ts
|
|
4826
5868
|
/**
|
|
4827
|
-
* @description
|
|
5869
|
+
* @description A PEPPOL document type scheme, for example `busdox-docid-qns` or `peppol-doctype-wildcard`.
|
|
4828
5870
|
*
|
|
4829
|
-
* @
|
|
4830
|
-
*
|
|
4831
|
-
*
|
|
5871
|
+
* @example
|
|
5872
|
+
* ```ts
|
|
5873
|
+
* 'busdox-docid-qns';
|
|
5874
|
+
* ```;
|
|
4832
5875
|
*
|
|
4833
5876
|
* @see {@link documentTypesScheme}
|
|
4834
5877
|
*/
|
|
4835
|
-
|
|
5878
|
+
var PeppolDocumentTypeScheme = class extends opaque()(Schema.Literals(documentTypesScheme)) {};
|
|
4836
5879
|
//#endregion
|
|
4837
5880
|
//#region src/schemas/values/document-type-values-schema.ts
|
|
4838
5881
|
const values = Record.values(documentTypesTable).flat();
|
|
4839
5882
|
/**
|
|
4840
|
-
* @description
|
|
4841
|
-
*
|
|
4842
|
-
* @param error - The error message to use when validation fails. Defaults to `'invalid Peppol document type value'`.
|
|
4843
|
-
*
|
|
4844
|
-
* @returns An Effect schema that accepts only valid document type values.
|
|
5883
|
+
* @description The value part of a PEPPOL document type identifier (the portion after the scheme prefix) from the known document type table.
|
|
4845
5884
|
*
|
|
4846
5885
|
* @see {@link documentTypesTable}
|
|
4847
5886
|
*/
|
|
4848
|
-
|
|
5887
|
+
var PeppolDocumentTypeValue = class extends opaque()(Schema.String.check(Schema.makeFilter((val) => values.includes(val)))) {};
|
|
4849
5888
|
//#endregion
|
|
4850
5889
|
//#region src/schemas/values/invoice-status-code-schema.ts
|
|
4851
5890
|
/**
|
|
4852
|
-
* @description
|
|
5891
|
+
* @description An invoice status code from the PEPPOL subset of UNCL 4343 (T111).
|
|
4853
5892
|
*
|
|
4854
|
-
* @
|
|
4855
|
-
*
|
|
4856
|
-
*
|
|
5893
|
+
* @example
|
|
5894
|
+
* ```ts
|
|
5895
|
+
* 'AB';
|
|
5896
|
+
* ```;
|
|
4857
5897
|
*
|
|
4858
5898
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4343-T111/
|
|
5899
|
+
* @see {@link invoiceStatusCodesKeys}
|
|
4859
5900
|
*/
|
|
4860
|
-
|
|
5901
|
+
var PeppolInvoiceStatusCodes = class extends opaque()(Schema.Literals(invoiceStatusCodesKeys).pipe(Schema.brand("PeppolInvoiceStatusCodes"))) {};
|
|
4861
5902
|
//#endregion
|
|
4862
5903
|
//#region src/schemas/values/participant-identifier-code-schema.ts
|
|
4863
5904
|
/**
|
|
4864
|
-
* @description
|
|
5905
|
+
* @description A PEPPOL participant identifier scheme from the participant identifier schemes codelist.
|
|
4865
5906
|
*
|
|
4866
|
-
* @
|
|
5907
|
+
* @example
|
|
5908
|
+
* ```ts
|
|
5909
|
+
* '0002';
|
|
5910
|
+
* ```;
|
|
4867
5911
|
*
|
|
4868
|
-
* @
|
|
5912
|
+
* @see {@link participantIdentifierSchemesKeys}
|
|
4869
5913
|
*/
|
|
4870
|
-
|
|
5914
|
+
var PeppolParticipantIdentifierCode = class extends opaque()(Schema.Literals(participantIdentifierSchemesKeys).pipe(Schema.brand("PeppolParticipantIdentifierCode"))) {};
|
|
4871
5915
|
//#endregion
|
|
4872
5916
|
//#region src/schemas/values/peppol-process-schema.ts
|
|
4873
5917
|
/**
|
|
4874
|
-
* @description
|
|
4875
|
-
*
|
|
4876
|
-
* @param error - The custom error message to use when validation fails. Defaults to `'invalid peppol process identifier'`.
|
|
5918
|
+
* @description A full PEPPOL business process identifier in `<scheme>::<value>` form from the known processes table.
|
|
4877
5919
|
*
|
|
4878
|
-
* @
|
|
5920
|
+
* @example
|
|
5921
|
+
* ```ts
|
|
5922
|
+
* 'cenbii-procid-ubl::urn:fdc:peppol.eu:2017:poacc:billing:01:1.0';
|
|
5923
|
+
* ```;
|
|
4879
5924
|
*
|
|
4880
5925
|
* @see {@link processes}
|
|
4881
5926
|
*/
|
|
4882
|
-
|
|
5927
|
+
var PeppolProcess = class extends opaque()(Schema.TemplateLiteral([
|
|
4883
5928
|
Schema.Literals(processesKeys),
|
|
4884
5929
|
Schema.Literal("::"),
|
|
4885
5930
|
Schema.String
|
|
@@ -4888,7 +5933,7 @@ const peppolProcessSchema = Schema.TemplateLiteral([
|
|
|
4888
5933
|
if (prefix === void 0 || suffix === void 0) return false;
|
|
4889
5934
|
const info = processes[prefix];
|
|
4890
5935
|
return info !== void 0 && info.some((v) => v === suffix);
|
|
4891
|
-
}));
|
|
5936
|
+
}))) {};
|
|
4892
5937
|
//#endregion
|
|
4893
5938
|
//#region src/schemas/values/process-from-document-type-schema.ts
|
|
4894
5939
|
/**
|
|
@@ -4899,31 +5944,33 @@ const peppolProcessSchema = Schema.TemplateLiteral([
|
|
|
4899
5944
|
*
|
|
4900
5945
|
* @returns An Effect schema that matches only processes allowed for the given document type.
|
|
4901
5946
|
*
|
|
4902
|
-
* @see {@link
|
|
5947
|
+
* @see {@link PeppolProcess}
|
|
4903
5948
|
* @see {@link documentTypesProcessIds}
|
|
4904
5949
|
*/
|
|
4905
5950
|
function processFromDocumentTypeSchema(documentType, error = "invalid process type for document type") {
|
|
4906
5951
|
const allowed = documentTypesProcessIds[documentType];
|
|
4907
|
-
if (allowed === void 0) return
|
|
5952
|
+
if (allowed === void 0) return PeppolProcess;
|
|
4908
5953
|
const values = allowed.map((p) => `${p.scheme}::${p.value}`);
|
|
4909
5954
|
return Schema.String.check(Schema.makeFilter((val) => values.includes(val))).annotate({ message: error });
|
|
4910
5955
|
}
|
|
4911
5956
|
//#endregion
|
|
4912
5957
|
//#region src/schemas/values/vatex-code-schema.ts
|
|
4913
5958
|
/**
|
|
4914
|
-
* @description
|
|
5959
|
+
* @description A VAT exemption reason code from the CEF VATEX codelist.
|
|
4915
5960
|
*
|
|
4916
|
-
* @
|
|
4917
|
-
*
|
|
4918
|
-
*
|
|
5961
|
+
* @example
|
|
5962
|
+
* ```ts
|
|
5963
|
+
* 'VATEX-EU-79-C';
|
|
5964
|
+
* ```;
|
|
4919
5965
|
*
|
|
4920
5966
|
* @validations
|
|
4921
5967
|
* - BR-CL-22: VAT exemption reason code MUST be a valid CEF VATEX code.
|
|
4922
5968
|
*
|
|
4923
5969
|
* @see https://docs.peppol.eu/poacc/billing/3.0/codelist/vatex/
|
|
5970
|
+
* @see {@link vatexCodesKeys}
|
|
4924
5971
|
*/
|
|
4925
|
-
|
|
5972
|
+
var PeppolVatexCode = class extends opaque()(Schema.Literals(vatexCodesKeys).pipe(Schema.brand("PeppolVatexCode"))) {};
|
|
4926
5973
|
//#endregion
|
|
4927
|
-
export { BaseAllowanceCharge, BaseLineAllowanceCharge, DEFAULT_CUSTOMIZATION_ID, DEFAULT_PROFILE_ID, PeppolAdditionalDocumentReference, PeppolAdditionalItemProperties, PeppolAddress, PeppolAddressLine, PeppolAllowance, PeppolAmount, PeppolAttachment, PeppolAttachmentExternalReference, PeppolBaseLine, PeppolBillingBase, PeppolBillingReference, PeppolBinaryObject, PeppolBuyersItemIdentification, PeppolCardAccount, PeppolCharge, PeppolCommodityClassifications, PeppolContact, PeppolContractDocumentReference, PeppolCountryCode, PeppolCreditNote, PeppolCreditNoteLine, PeppolDelivery, PeppolDeliveryLocation, PeppolDeliveryParty, PeppolDeliveryPartyPartyName, PeppolDespatchDocumentReference, PeppolDocumentResponseDocument, PeppolDocumentResponseDocumentReference, PeppolDocumentResponseLineResponse, PeppolDocumentResponseLineResponseContent, PeppolId, PeppolIdentifier, PeppolInvoice, PeppolInvoiceDocumentReference, PeppolInvoiceLine, PeppolInvoiceLinePeriod, PeppolInvoicePeriod, PeppolInvoiceResponse, PeppolInvoiceResponseCondition, PeppolInvoiceResponseDocumentActualResponseStatus, PeppolInvoiceResponseDocumentActualResponseWithStatus, PeppolInvoiceResponseDocumentActualResponseWithoutStatus, PeppolInvoiceResponseDocumentReference, PeppolInvoiceResponseDocumentResponse, PeppolInvoiceResponseDocumentResponseParty, PeppolInvoiceResponseDocumentResponsePartyName, PeppolInvoiceResponseParty, PeppolInvoiceResponseSenderParty, PeppolInvoiceResponseStatusReasonCodeAction, PeppolInvoiceResponseStatusReasonCodeReason, PeppolIsoDateString, PeppolItemClassification, PeppolLegalMonetaryTotal, PeppolLineAllowance, PeppolLineCharge, PeppolLineItem, PeppolLinePrice, PeppolLinePriceAllowanceCharge, PeppolLineReference, PeppolMessageLevelResponse, PeppolMessageLevelResponseDocumentResponse, PeppolMessageLevelResponseParty, PeppolOrderLineReference, PeppolOrderReference, PeppolOriginCountryCode, PeppolOriginatorDocumentReference, PeppolPartyEndpointId, PeppolPartyIdentification, PeppolPartyLegalEntity, PeppolPartyName, PeppolPartySchema, PeppolPartyTaxScheme, PeppolPayeeFinancialAccount, PeppolPayeeFinancialAccountFinancialInstitutionBranch, PeppolPayeeParty, PeppolPaymentMandate, PeppolPaymentMandatePayerFinancialAccountId, PeppolPaymentMeans, PeppolPaymentMeansCode, PeppolPaymentTerms, PeppolProjectReference, PeppolQuantity, PeppolReceiptDocumentReference, PeppolReferenceId, PeppolSellersItemIdentification, PeppolStandardItemIdentification, PeppolStatus, PeppolTaxCategory, PeppolTaxCategoryTaxSchemeId, PeppolTaxRepresentative, PeppolTaxSchemeId, PeppolTaxSubTotal, PeppolTaxSubTotalCategory, PeppolTaxTotalsBase,
|
|
5974
|
+
export { BaseAllowanceCharge, BaseLineAllowanceCharge, DEFAULT_CUSTOMIZATION_ID, DEFAULT_PROFILE_ID, PeppolAdditionalDocumentReference, PeppolAdditionalDocumentReferenceCode, PeppolAdditionalItemProperties, PeppolAddress, PeppolAddressLine, PeppolAllowance, PeppolAllowanceCharge, PeppolAllowanceChargeReasonCode, PeppolAmount, PeppolApplicationResponseTypeCode, PeppolAttachment, PeppolAttachmentExternalReference, PeppolBase64, PeppolBaseLine, PeppolBillingBase, PeppolBillingReference, PeppolBinaryObject, PeppolBuyersItemIdentification, PeppolCardAccount, PeppolCharge, PeppolChargeReasonCode, PeppolCommodityClassifications, PeppolContact, PeppolContractDocumentReference, PeppolCountryCode, PeppolCountryCodeValue, PeppolCreditNote, PeppolCreditNoteLine, PeppolCreditNoteTypeCode, PeppolCurrencyCode, PeppolDelivery, PeppolDeliveryLocation, PeppolDeliveryParty, PeppolDeliveryPartyPartyName, PeppolDespatchDocumentReference, PeppolDocumentResponseDocument, PeppolDocumentResponseDocumentReference, PeppolDocumentResponseLineResponse, PeppolDocumentResponseLineResponseContent, PeppolDocumentSchema, PeppolDocumentType, PeppolDocumentTypeCode, PeppolDocumentTypeScheme, PeppolDocumentTypeValue, PeppolDutyTaxFeeCategoryCode, PeppolElectronicAddressCode, PeppolIcdCode, PeppolId, PeppolIdentifier, PeppolInvoice, PeppolInvoiceDocumentReference, PeppolInvoiceLine, PeppolInvoiceLinePeriod, PeppolInvoicePeriod, PeppolInvoiceResponse, PeppolInvoiceResponseCondition, PeppolInvoiceResponseDocumentActualResponse, PeppolInvoiceResponseDocumentActualResponseStatus, PeppolInvoiceResponseDocumentActualResponseWithStatus, PeppolInvoiceResponseDocumentActualResponseWithoutStatus, PeppolInvoiceResponseDocumentReference, PeppolInvoiceResponseDocumentResponse, PeppolInvoiceResponseDocumentResponseParty, PeppolInvoiceResponseDocumentResponsePartyName, PeppolInvoiceResponseParty, PeppolInvoiceResponseSenderParty, PeppolInvoiceResponseStatusReasonCode, PeppolInvoiceResponseStatusReasonCodeAction, PeppolInvoiceResponseStatusReasonCodeReason, PeppolInvoiceStatusCodes, PeppolInvoiceTypeCode, PeppolIsoDateString, PeppolItemClassification, PeppolItemClassificationCode, PeppolLegalMonetaryTotal, PeppolLineAllowance, PeppolLineAllowanceCharge, PeppolLineCharge, PeppolLineItem, PeppolLinePrice, PeppolLinePriceAllowanceCharge, PeppolLineReference, PeppolMessageLevelResponse, PeppolMessageLevelResponseDocumentResponse, PeppolMessageLevelResponseParty, PeppolMimeCode, PeppolOpStatusAction, PeppolOpStatusReason, PeppolOrderLineReference, PeppolOrderReference, PeppolOriginCountryCode, PeppolOriginatorDocumentReference, PeppolParticipantIdentifierCode, PeppolPartyEndpointId, PeppolPartyIdentification, PeppolPartyLegalEntity, PeppolPartyName, PeppolPartySchema, PeppolPartyTaxScheme, PeppolPayeeFinancialAccount, PeppolPayeeFinancialAccountFinancialInstitutionBranch, PeppolPayeeParty, PeppolPaymentMandate, PeppolPaymentMandatePayerFinancialAccountId, PeppolPaymentMeans, PeppolPaymentMeansCode, PeppolPaymentMeansCodeValue, PeppolPaymentTerms, PeppolProcess, PeppolProjectReference, PeppolQuantity, PeppolQuantityUnitCode, PeppolReceiptDocumentReference, PeppolReferenceId, PeppolSellersItemIdentification, PeppolStandardItemIdentification, PeppolStatus, PeppolTaxCategory, PeppolTaxCategoryTaxSchemeId, PeppolTaxRepresentative, PeppolTaxSchemeId, PeppolTaxSubTotal, PeppolTaxSubTotalCategory, PeppolTaxTotalsBase, PeppolVatDateCode, PeppolVatRegex, PeppolVatexCode, PeppolXsdTime, PriceAllowanceCharge, formatQuantityWithUnit, getCreditNoteTypeCodeDescription, getInvoiceTypeCodeDescription, isPeppolCreditNote, isPeppolInvoice, isPeppolInvoiceResponse, isPeppolMessageLevelResponse, isValidCreditNoteTypeCode, isValidInvoiceTypeCode, isValidProcess, peppolReferenceSchema, processFromDocumentTypeSchema, quantityToIntlUnitMap, quantityUnitCodeToIntlUnit, withStatusCodes, withoutStatusCodes };
|
|
4928
5975
|
|
|
4929
5976
|
//# sourceMappingURL=index.js.map
|