@endevops/peppol-schema 0.1.0-beta.4 → 0.1.0-beta.5
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 +9 -6
- package/dist/constants.d.ts +51 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +48 -0
- package/dist/constants.js.map +1 -0
- package/dist/eas-codes.generated-D8jjHFij.js.map +1 -1
- package/dist/index-CfjMSrpQ.d.ts +3508 -0
- package/dist/index-CfjMSrpQ.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2613
- package/dist/index.js +3121 -1563
- package/dist/index.js.map +1 -1
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js +18 -0
- package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js.map +1 -0
- package/dist/invoice-response-codes.d.ts +11 -0
- package/dist/invoice-response-codes.d.ts.map +1 -0
- package/dist/invoice-response-codes.js +32 -0
- package/dist/invoice-response-codes.js.map +1 -0
- package/dist/invoice-status-codes.generated-DL-agLdx.d.ts +24 -0
- package/dist/invoice-status-codes.generated-DL-agLdx.d.ts.map +1 -0
- package/dist/message-level-response-profile-id-DBpOW91B.js +9 -0
- package/dist/message-level-response-profile-id-DBpOW91B.js.map +1 -0
- package/dist/peppol-iso-date-string-BXLxzxdz.js +30 -0
- package/dist/peppol-iso-date-string-BXLxzxdz.js.map +1 -0
- package/dist/schematron.d.ts +408 -365
- package/dist/schematron.d.ts.map +1 -1
- package/dist/schematron.js +1975 -1501
- package/dist/schematron.js.map +1 -1
- package/dist/values.d.ts +95 -13218
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +1 -1
- package/dist/vat-dates.generated-CxFvt7m3.d.ts +68 -0
- package/dist/vat-dates.generated-CxFvt7m3.d.ts.map +1 -0
- package/dist/{vatex-codes.generated-BSgP3n5t.js → vatex-codes.generated-N7wsUrLh.js} +8 -9
- package/dist/vatex-codes.generated-N7wsUrLh.js.map +1 -0
- package/package.json +16 -18
- package/src/constants/transport-profile.ts +5 -1
- package/src/decoders/decode-billing.ts +1 -1
- package/src/decoders/decode-credit-note.ts +2 -4
- package/src/decoders/decode-invoice-response.ts +15 -37
- package/src/decoders/decode-invoice.ts +2 -4
- package/src/decoders/decode-message-level-response.ts +21 -48
- package/src/decoders/encode-credit-note.ts +1 -1
- package/src/decoders/encode-invoice-response.ts +7 -4
- package/src/decoders/encode-invoice.ts +1 -1
- package/src/decoders/encode-message-level-response.ts +4 -10
- package/src/decoders/fields/decode-additional-document-references.ts +1 -1
- package/src/decoders/fields/decode-address.ts +1 -1
- package/src/decoders/fields/decode-allowance-charges.ts +7 -15
- package/src/decoders/fields/decode-amount.ts +2 -2
- package/src/decoders/fields/decode-application-response.ts +21 -0
- package/src/decoders/fields/decode-billing-references.ts +1 -1
- package/src/decoders/fields/decode-contact.ts +1 -1
- package/src/decoders/fields/decode-credit-note-lines.ts +7 -15
- package/src/decoders/fields/decode-delivery.ts +1 -1
- package/src/decoders/fields/decode-electronic-address.ts +1 -1
- package/src/decoders/fields/decode-identifier.ts +1 -1
- package/src/decoders/fields/decode-invoice-line-period.ts +1 -1
- package/src/decoders/fields/decode-invoice-lines.ts +6 -14
- package/src/decoders/fields/decode-invoice-message-document-party.ts +2 -2
- package/src/decoders/fields/decode-invoice-message-party.ts +1 -6
- package/src/decoders/fields/decode-invoice-period.ts +7 -13
- package/src/decoders/fields/decode-legal-monetary-total.ts +1 -1
- package/src/decoders/fields/decode-line-allowance-charges.ts +7 -14
- package/src/decoders/fields/decode-line-price.ts +1 -7
- package/src/decoders/fields/decode-line-shared.ts +2 -4
- package/src/decoders/fields/decode-message-level-party.ts +1 -1
- package/src/decoders/fields/decode-node-list.ts +15 -0
- package/src/decoders/fields/decode-order-reference.ts +1 -1
- package/src/decoders/fields/decode-parties-tax-scheme.ts +1 -1
- package/src/decoders/fields/decode-party-legal-entity.ts +1 -1
- package/src/decoders/fields/decode-party-tax-scheme.ts +1 -1
- package/src/decoders/fields/decode-party.ts +3 -14
- package/src/decoders/fields/decode-payee-party.ts +1 -1
- package/src/decoders/fields/decode-payment-means.ts +2 -2
- package/src/decoders/fields/decode-payment-terms.ts +1 -1
- package/src/decoders/fields/decode-price-allowance-charge.ts +1 -7
- package/src/decoders/fields/decode-quantity.ts +1 -6
- package/src/decoders/fields/decode-simple-identifier.ts +1 -1
- package/src/decoders/fields/decode-tax-category.ts +1 -1
- package/src/decoders/fields/decode-tax-representative-party.ts +1 -1
- package/src/decoders/fields/decode-tax-totals.ts +2 -2
- package/src/decoders/fields/encode-additional-document-references.ts +3 -2
- package/src/decoders/fields/encode-address.ts +1 -1
- package/src/decoders/fields/encode-allowance-charges.ts +3 -2
- package/src/decoders/fields/encode-amount.ts +1 -1
- package/src/decoders/fields/encode-billing-references.ts +2 -2
- package/src/decoders/fields/encode-contact.ts +1 -1
- package/src/decoders/fields/encode-credit-note-lines.ts +2 -2
- package/src/decoders/fields/encode-delivery.ts +1 -1
- package/src/decoders/fields/encode-identifier.ts +1 -1
- package/src/decoders/fields/encode-invoice-line-period.ts +1 -1
- package/src/decoders/fields/encode-invoice-lines.ts +2 -2
- package/src/decoders/fields/encode-invoice-period.ts +1 -1
- package/src/decoders/fields/encode-legal-monetary-total.ts +1 -1
- package/src/decoders/fields/encode-line-allowance-charges.ts +2 -2
- package/src/decoders/fields/encode-line-price.ts +1 -1
- package/src/decoders/fields/encode-line-shared.ts +1 -1
- package/src/decoders/fields/encode-message-party.ts +3 -3
- package/src/decoders/fields/encode-order-reference.ts +1 -1
- package/src/decoders/fields/encode-parties-tax-scheme.ts +1 -1
- package/src/decoders/fields/encode-party-tax-scheme.ts +1 -1
- package/src/decoders/fields/encode-party.ts +1 -1
- package/src/decoders/fields/encode-payee-party.ts +1 -1
- package/src/decoders/fields/encode-payment-means.ts +2 -2
- package/src/decoders/fields/encode-payment-terms.ts +1 -1
- package/src/decoders/fields/encode-price-allowance-charges.ts +1 -1
- package/src/decoders/fields/encode-quantity.ts +1 -1
- package/src/decoders/fields/encode-tax-category.ts +1 -1
- package/src/decoders/fields/encode-tax-representative-party.ts +1 -1
- package/src/decoders/fields/encode-tax-totals.ts +4 -4
- package/src/helpers/bool.ts +9 -12
- package/src/helpers/get-prop.ts +2 -4
- package/src/helpers/str-or-und.ts +3 -4
- package/src/helpers/str.ts +12 -8
- package/src/index.ts +56 -6
- package/src/schemas/fields/peppol-additional-document-reference-schema.ts +123 -0
- package/src/schemas/fields/peppol-address-schema.ts +112 -0
- package/src/schemas/fields/peppol-allowance-charge-schema.ts +104 -0
- package/src/schemas/fields/peppol-amount-schema.ts +23 -0
- package/src/schemas/fields/peppol-base-line-schema.ts +141 -0
- package/src/{effect → schemas}/fields/peppol-billing-reference-schema.ts +25 -20
- package/src/schemas/fields/peppol-binary-object-schema.ts +52 -0
- package/src/schemas/fields/peppol-contact-schema.ts +20 -0
- package/src/schemas/fields/peppol-credit-note-line-schema.ts +44 -0
- package/src/schemas/fields/peppol-delivery-schema.ts +109 -0
- package/src/schemas/fields/peppol-identifier-schema.ts +21 -0
- package/src/schemas/fields/peppol-invoice-line-period-schema.ts +35 -0
- package/src/{effect → schemas}/fields/peppol-invoice-line-schema.ts +10 -10
- package/src/schemas/fields/peppol-invoice-period-schema.ts +31 -0
- package/src/schemas/fields/peppol-item-classification-schema.ts +46 -0
- package/src/schemas/fields/peppol-legal-monetary-total-schema.ts +127 -0
- package/src/schemas/fields/peppol-line-allowance-charge-schema.ts +68 -0
- package/src/schemas/fields/peppol-line-item-schema.ts +196 -0
- package/src/schemas/fields/peppol-line-price-allowance-charge-schema.ts +41 -0
- package/src/schemas/fields/peppol-line-price-schema.ts +32 -0
- package/src/schemas/fields/peppol-order-reference-schema.ts +38 -0
- package/src/schemas/fields/peppol-party-base-schema.ts +145 -0
- package/src/schemas/fields/peppol-party-legal-entity-schema.ts +32 -0
- package/src/schemas/fields/peppol-party-tax-scheme-schema.ts +41 -0
- package/src/schemas/fields/peppol-payee-party-schema.ts +119 -0
- package/src/schemas/fields/peppol-payment-means-schema.ts +224 -0
- package/src/schemas/fields/peppol-payment-terms-schema.ts +25 -0
- package/src/schemas/fields/peppol-quantity-schema.ts +22 -0
- package/src/schemas/fields/peppol-reference-schema.ts +9 -0
- package/src/schemas/fields/peppol-tax-category-schema.ts +47 -0
- package/src/schemas/fields/peppol-tax-representative-schema.ts +26 -0
- package/src/{effect → schemas}/fields/peppol-tax-subtotal-category-schema.ts +7 -6
- package/src/schemas/fields/peppol-tax-subtotal-schema.ts +33 -0
- package/src/schemas/fields/peppol-tax-totals-base-schema.ts +28 -0
- package/src/schemas/peppol-billing-base-schema.ts +366 -0
- package/src/schemas/peppol-credit-note-schema.ts +31 -0
- package/src/schemas/peppol-document-response-document-reference-schema.ts +41 -0
- package/src/schemas/peppol-document-response-document-schema.ts +38 -0
- package/src/schemas/peppol-document-response-line-response-content-schema.ts +49 -0
- package/src/schemas/peppol-document-response-line-response-schema.ts +40 -0
- package/src/schemas/peppol-document-schema.ts +120 -0
- package/src/{effect → schemas}/peppol-invoice-response-document-actual-response-schema.ts +25 -16
- package/src/schemas/peppol-invoice-response-document-actual-response-status-schema.ts +63 -0
- package/src/schemas/peppol-invoice-response-schema.ts +176 -0
- package/src/schemas/peppol-invoice-response-status-reason-code-schema.ts +40 -0
- package/src/schemas/peppol-invoice-schema.ts +45 -0
- package/src/schemas/peppol-iso-date-string.ts +20 -0
- package/src/schemas/peppol-message-level-response-document-response-schema.ts +35 -0
- package/src/schemas/peppol-message-level-response-party-schema.ts +20 -0
- package/src/schemas/peppol-message-level-response-schema.ts +98 -0
- package/src/schemas/utils/format-xsd-time.ts +80 -0
- package/src/{effect → schemas}/utils/index.ts +1 -1
- package/src/schemas/utils/is-valid-process.ts +1 -1
- package/src/schemas/utils/opaque.ts +19 -0
- package/src/schemas/utils/peppol-xsd-time-schema.ts +79 -0
- package/src/schemas/utils/quantity-unit-code-to-intl-unit.ts +2 -2
- package/src/schemas/values/credit-note-type-code-schema.ts +3 -5
- package/src/schemas/values/document-type-schemes-schema.ts +3 -5
- package/src/schemas/values/document-type-values-schema.ts +4 -7
- package/src/{effect → schemas}/values/duty-tax-fee-category-schema.ts +3 -3
- package/src/schemas/values/invoice-type-code-schema.ts +4 -8
- package/src/schemas/values/process-from-document-type-schema.ts +10 -12
- package/src/schemas/values/quantity-unit-codes-schema.ts +4 -8
- package/src/schematron/cen/ae/cen-en16931-br-ae-01.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-02.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-03.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-04.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-05.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-06.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-07.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-08.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-09.ts +6 -5
- package/src/schematron/cen/ae/cen-en16931-br-ae-10.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-01.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-02.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-03.ts +6 -10
- package/src/schematron/cen/af/cen-en16931-br-af-04.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-05.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-06.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-07.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-08.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-09.ts +6 -5
- package/src/schematron/cen/af/cen-en16931-br-af-10.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-01.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-02.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-03.ts +6 -10
- package/src/schematron/cen/ag/cen-en16931-br-ag-04.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-05.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-06.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-07.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-08.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-09.ts +6 -5
- package/src/schematron/cen/ag/cen-en16931-br-ag-10.ts +6 -5
- package/src/schematron/cen/b/cen-en16931-br-b-01.ts +6 -5
- package/src/schematron/cen/b/cen-en16931-br-b-02.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-01.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-02.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-03.ts +9 -6
- package/src/schematron/cen/cen-en16931-br-04.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-05.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-06.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-07.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-08.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-09.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-10.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-11.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-12.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-13.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-14.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-15.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-16.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-17.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-18.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-19.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-20.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-21.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-22.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-23.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-24.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-25.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-26.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-27.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-28.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-29.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-30.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-31.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-32.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-33.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-36.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-37.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-38.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-41.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-42.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-43.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-44.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-45.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-46.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-47.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-48.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-49.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-50.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-51.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-52.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-53.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-54.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-55.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-56.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-57.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-61.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-62.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-63.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-64.ts +6 -5
- package/src/schematron/cen/cen-en16931-br-65.ts +6 -5
- package/src/schematron/cen/cl/cen-en16931-br-cl-08.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-03.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-04.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-05.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-06.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-07.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-08.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-09.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-10.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-11.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-12.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-13.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-14.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-15.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-16.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-17.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-18.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-19.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-20.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-21.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-22.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-23.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-24.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-25.ts +6 -5
- package/src/schematron/cen/co/cen-en16931-br-co-26.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-01.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-02.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-05.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-06.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-09.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-10.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-11.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-12.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-13.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-14.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-15.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-16.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-17.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-18.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-19.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-20.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-23.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-24.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-25.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-27.ts +6 -5
- package/src/schematron/cen/dec/cen-en16931-br-dec-28.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-01.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-02.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-03.ts +6 -10
- package/src/schematron/cen/e/cen-en16931-br-e-04.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-05.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-06.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-07.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-08.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-09.ts +6 -5
- package/src/schematron/cen/e/cen-en16931-br-e-10.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-01.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-02.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-03.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-04.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-05.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-06.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-07.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-08.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-09.ts +6 -5
- package/src/schematron/cen/g/cen-en16931-br-g-10.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-01.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-02.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-03.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-04.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-05.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-06.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-07.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-08.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-09.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-10.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-11.ts +6 -5
- package/src/schematron/cen/ic/cen-en16931-br-ic-12.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-01.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-02.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-03.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-04.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-05.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-06.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-07.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-08.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-09.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-10.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-11.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-12.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-13.ts +6 -5
- package/src/schematron/cen/o/cen-en16931-br-o-14.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-01.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-02.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-03.ts +6 -10
- package/src/schematron/cen/s/cen-en16931-br-s-04.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-05.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-06.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-07.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-08.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-09.ts +6 -5
- package/src/schematron/cen/s/cen-en16931-br-s-10.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-01.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-02.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-03.ts +6 -10
- package/src/schematron/cen/z/cen-en16931-br-z-04.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-05.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-06.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-07.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-08.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-09.ts +6 -5
- package/src/schematron/cen/z/cen-en16931-br-z-10.ts +6 -5
- package/src/schematron/de/de-r-001.ts +8 -7
- package/src/schematron/de/de-r-002.ts +8 -7
- package/src/schematron/de/de-r-003.ts +8 -7
- package/src/schematron/de/de-r-004.ts +8 -7
- package/src/schematron/de/de-r-005.ts +8 -7
- package/src/schematron/de/de-r-006.ts +8 -7
- package/src/schematron/de/de-r-007.ts +8 -7
- package/src/schematron/de/de-r-008.ts +8 -7
- package/src/schematron/de/de-r-009.ts +8 -7
- package/src/schematron/de/de-r-010.ts +9 -8
- package/src/schematron/de/de-r-011.ts +9 -8
- package/src/schematron/de/de-r-014.ts +8 -7
- package/src/schematron/de/de-r-015.ts +8 -7
- package/src/schematron/de/de-r-016.ts +9 -8
- package/src/schematron/de/de-r-017.ts +8 -7
- package/src/schematron/de/de-r-018.ts +10 -9
- package/src/schematron/de/de-r-019.ts +8 -7
- package/src/schematron/de/de-r-020.ts +8 -7
- package/src/schematron/de/de-r-022.ts +8 -7
- package/src/schematron/de/de-r-023-1.ts +8 -7
- package/src/schematron/de/de-r-023-2.ts +8 -7
- package/src/schematron/de/de-r-024-1.ts +8 -7
- package/src/schematron/de/de-r-024-2.ts +8 -7
- package/src/schematron/de/de-r-025-1.ts +8 -7
- package/src/schematron/de/de-r-025-2.ts +8 -7
- package/src/schematron/de/de-r-026.ts +9 -8
- package/src/schematron/de/de-r-027.ts +8 -7
- package/src/schematron/de/de-r-028.ts +8 -7
- package/src/schematron/de/de-r-030.ts +9 -8
- package/src/schematron/de/de-r-031.ts +8 -7
- package/src/schematron/dk/dk-r-002.ts +7 -6
- package/src/schematron/dk/dk-r-003.ts +8 -7
- package/src/schematron/dk/dk-r-004.ts +8 -7
- package/src/schematron/dk/dk-r-005.ts +8 -7
- package/src/schematron/dk/dk-r-006.ts +8 -7
- package/src/schematron/dk/dk-r-007.ts +8 -7
- package/src/schematron/dk/dk-r-008.ts +8 -7
- package/src/schematron/dk/dk-r-009.ts +8 -7
- package/src/schematron/dk/dk-r-010.ts +8 -7
- package/src/schematron/dk/dk-r-011.ts +8 -7
- package/src/schematron/dk/dk-r-013.ts +8 -7
- package/src/schematron/dk/dk-r-014.ts +7 -6
- package/src/schematron/dk/dk-r-016.ts +8 -7
- package/src/schematron/dk/dk-r-017.ts +8 -7
- package/src/schematron/errors.ts +17 -0
- package/src/schematron/gr/gr-r-001-1.ts +7 -6
- package/src/schematron/gr/gr-r-001-2.ts +8 -7
- package/src/schematron/gr/gr-r-001-3.ts +14 -9
- package/src/schematron/gr/gr-r-001-4.ts +8 -7
- package/src/schematron/gr/gr-r-001-5.ts +8 -7
- package/src/schematron/gr/gr-r-001-6.ts +7 -6
- package/src/schematron/gr/gr-r-001-7.ts +7 -6
- package/src/schematron/gr/gr-r-002.ts +7 -6
- package/src/schematron/gr/gr-r-003.ts +8 -7
- package/src/schematron/gr/gr-r-004-1.ts +7 -6
- package/src/schematron/gr/gr-r-004-2.ts +7 -6
- package/src/schematron/gr/gr-r-005.ts +7 -6
- package/src/schematron/gr/gr-r-006.ts +8 -7
- package/src/schematron/gr/gr-r-008-2.ts +7 -6
- package/src/schematron/gr/gr-r-008-3.ts +7 -6
- package/src/schematron/gr/gr-r-009.ts +7 -6
- package/src/schematron/gr/gr-r-010.ts +7 -6
- package/src/schematron/gr/gr-s-008-1.ts +7 -6
- package/src/schematron/gr/gr-s-011.ts +8 -7
- package/src/schematron/helpers.ts +36 -11
- package/src/schematron/index.ts +6 -1
- package/src/schematron/is/is-r-001.ts +7 -6
- package/src/schematron/is/is-r-002.ts +7 -6
- package/src/schematron/is/is-r-003.ts +7 -6
- package/src/schematron/is/is-r-004.ts +7 -6
- package/src/schematron/is/is-r-005.ts +7 -6
- package/src/schematron/is/is-r-006.ts +8 -7
- package/src/schematron/is/is-r-007.ts +8 -7
- package/src/schematron/is/is-r-008.ts +8 -7
- package/src/schematron/is/is-r-009.ts +8 -7
- package/src/schematron/is/is-r-010.ts +9 -8
- package/src/schematron/it/it-r-001.ts +7 -6
- package/src/schematron/it/it-r-002.ts +7 -6
- package/src/schematron/it/it-r-003.ts +7 -6
- package/src/schematron/it/it-r-004.ts +7 -6
- package/src/schematron/nl/nl-r-001.ts +7 -6
- package/src/schematron/nl/nl-r-002.ts +7 -6
- package/src/schematron/nl/nl-r-003.ts +8 -7
- package/src/schematron/nl/nl-r-004.ts +7 -6
- package/src/schematron/nl/nl-r-005.ts +8 -7
- package/src/schematron/nl/nl-r-006.ts +8 -7
- package/src/schematron/nl/nl-r-007.ts +8 -7
- package/src/schematron/nl/nl-r-008.ts +7 -6
- package/src/schematron/nl/nl-r-009.ts +8 -7
- package/src/schematron/no/no-r-001.ts +8 -7
- package/src/schematron/no/no-r-002.ts +7 -6
- package/src/schematron/peppol/cl/peppol-en16931-cl001.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl002.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl003.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl006.ts +7 -6
- package/src/schematron/peppol/cl/peppol-en16931-cl007.ts +6 -5
- package/src/schematron/peppol/cl/peppol-en16931-cl008.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r040.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r041.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r042.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r043.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r044.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r045.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r046.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r047.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r049.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r050.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r052.ts +6 -5
- package/src/schematron/peppol/common/peppol-common-r053.ts +6 -5
- package/src/schematron/peppol/f/peppol-en16931-f001.ts +20 -13
- package/src/schematron/peppol/p/peppol-en16931-p0100.ts +8 -7
- package/src/schematron/peppol/p/peppol-en16931-p0101.ts +8 -7
- package/src/schematron/peppol/p/peppol-en16931-p0104.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0105.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0106.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0107.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0108.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0109.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0110.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0111.ts +6 -5
- package/src/schematron/peppol/p/peppol-en16931-p0112.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r001.ts +11 -13
- package/src/schematron/peppol/r/peppol-en16931-r002.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r003.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r004.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r005.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r007.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r008.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r010.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r020.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r040.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r041.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r042.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r043.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r044.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r046.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r051.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r053.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r054.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r055.ts +8 -7
- package/src/schematron/peppol/r/peppol-en16931-r061.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r100.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r101.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r110.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r111.ts +7 -6
- package/src/schematron/peppol/r/peppol-en16931-r120.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r121.ts +6 -5
- package/src/schematron/peppol/r/peppol-en16931-r130.ts +6 -5
- package/src/schematron/run-all-rules.ts +2 -7
- package/src/schematron/schematron.ts +36 -0
- package/src/schematron/se/se-r-001.ts +7 -6
- package/src/schematron/se/se-r-002.ts +7 -6
- package/src/schematron/se/se-r-003.ts +7 -6
- package/src/schematron/se/se-r-004.ts +7 -6
- package/src/schematron/se/se-r-005.ts +8 -7
- package/src/schematron/se/se-r-006.ts +7 -6
- package/src/schematron/se/se-r-007.ts +7 -6
- package/src/schematron/se/se-r-008.ts +7 -6
- package/src/schematron/se/se-r-009.ts +7 -6
- package/src/schematron/se/se-r-010.ts +7 -6
- package/src/schematron/se/se-r-011.ts +7 -6
- package/src/schematron/se/se-r-012.ts +7 -6
- package/src/schematron/se/se-r-013.ts +7 -6
- package/src/values/additional-document-reference-codes.generated.ts +2 -3
- package/src/values/allowance-charge-reason-codes.generated.ts +1 -1
- package/src/values/application-response-type-codes.generated.ts +1 -1
- package/src/values/charge-reason-codes.generated.ts +1 -1
- package/src/values/country-code.generated.ts +1 -1
- package/src/values/credit-notes-type-codes.generated.ts +1 -1
- package/src/values/currency-code.generated.ts +1 -1
- package/src/values/document-type-codes.generated.ts +1 -1
- package/src/values/document-type.generated.ts +2 -2
- package/src/values/duty-tax-fee-categories.generated.ts +1 -1
- package/src/values/eas-codes.generated.ts +1 -1
- package/src/values/icd-codes.generated.ts +7 -7
- package/src/values/invoice-status-codes.generated.ts +1 -1
- package/src/values/invoice-type-codes.generated.ts +1 -1
- package/src/values/item-classification-code.generated.ts +1 -1
- package/src/values/mime-codes.generated.ts +1 -1
- package/src/values/op-status-action.generated.ts +1 -1
- package/src/values/op-status-reason.generated.ts +1 -1
- package/src/values/participant-identifier-schemes.generated.ts +2 -2
- package/src/values/payment-means-codes.generated.ts +1 -1
- package/src/values/processes.generated.ts +1 -1
- package/src/values/quantity-unit-codes.generated.ts +1 -1
- package/src/values/vat-dates.generated.ts +1 -1
- package/src/values/vatex-codes.generated.ts +1 -1
- package/dist/all-union-fields-CxoyKBpI.d.ts +0 -445
- package/dist/all-union-fields-CxoyKBpI.d.ts.map +0 -1
- package/dist/document-DCcObB-a.d.ts +0 -1466
- package/dist/document-DCcObB-a.d.ts.map +0 -1
- package/dist/effect.d.ts +0 -6291
- package/dist/effect.d.ts.map +0 -1
- package/dist/effect.js +0 -3240
- package/dist/effect.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/is-valid-process-CSWL-q9f.js +0 -1590
- package/dist/is-valid-process-CSWL-q9f.js.map +0 -1
- package/dist/quantity-unit-code-to-intl-unit-15EykjMe.d.ts +0 -168
- package/dist/quantity-unit-code-to-intl-unit-15EykjMe.d.ts.map +0 -1
- package/dist/vat-dates.generated-DTVWQAdn.d.ts +0 -4812
- package/dist/vat-dates.generated-DTVWQAdn.d.ts.map +0 -1
- package/dist/vatex-codes.generated-BSgP3n5t.js.map +0 -1
- package/src/decoders/errors.ts +0 -11
- package/src/document-parser.ts +0 -70
- package/src/document.ts +0 -19
- package/src/effect/fields/default-customization-id.ts +0 -1
- package/src/effect/fields/default-profile-id.ts +0 -1
- package/src/effect/fields/peppol-additional-document-reference-schema.ts +0 -114
- package/src/effect/fields/peppol-address-schema.ts +0 -105
- package/src/effect/fields/peppol-allowance-charge-schema.ts +0 -95
- package/src/effect/fields/peppol-amount-schema.ts +0 -22
- package/src/effect/fields/peppol-base-line-schema.ts +0 -138
- package/src/effect/fields/peppol-binary-object-schema.ts +0 -51
- package/src/effect/fields/peppol-contact-schema.ts +0 -18
- package/src/effect/fields/peppol-credit-note-line-schema.ts +0 -42
- package/src/effect/fields/peppol-delivery-schema.ts +0 -100
- package/src/effect/fields/peppol-identifier-schema.ts +0 -19
- package/src/effect/fields/peppol-invoice-line-period-schema.ts +0 -34
- package/src/effect/fields/peppol-invoice-period-schema.ts +0 -30
- package/src/effect/fields/peppol-item-classification-schema.ts +0 -45
- package/src/effect/fields/peppol-legal-monetary-total-schema.ts +0 -126
- package/src/effect/fields/peppol-line-allowance-charge-schema.ts +0 -64
- package/src/effect/fields/peppol-line-item-schema.ts +0 -185
- package/src/effect/fields/peppol-line-price-allowance-charge-schema.ts +0 -38
- package/src/effect/fields/peppol-line-price-schema.ts +0 -31
- package/src/effect/fields/peppol-order-reference-schema.ts +0 -36
- package/src/effect/fields/peppol-party-base-schema.ts +0 -138
- package/src/effect/fields/peppol-party-legal-entity-schema.ts +0 -29
- package/src/effect/fields/peppol-party-tax-scheme-schema.ts +0 -33
- package/src/effect/fields/peppol-payee-party-schema.ts +0 -112
- package/src/effect/fields/peppol-payment-means-schema.ts +0 -210
- package/src/effect/fields/peppol-payment-terms-schema.ts +0 -23
- package/src/effect/fields/peppol-quantity-schema.ts +0 -21
- package/src/effect/fields/peppol-reference-schema.ts +0 -5
- package/src/effect/fields/peppol-tax-category-schema.ts +0 -42
- package/src/effect/fields/peppol-tax-representative-schema.ts +0 -23
- package/src/effect/fields/peppol-tax-subtotal-schema.ts +0 -32
- package/src/effect/fields/peppol-tax-totals-base-schema.ts +0 -25
- package/src/effect/index.ts +0 -56
- package/src/effect/peppol-billing-base-schema.ts +0 -355
- package/src/effect/peppol-credit-note-schema.ts +0 -30
- package/src/effect/peppol-document-response-document-reference-schema.ts +0 -38
- package/src/effect/peppol-document-response-document-schema.ts +0 -35
- package/src/effect/peppol-document-response-line-response-content-schema.ts +0 -44
- package/src/effect/peppol-document-response-line-response-schema.ts +0 -33
- package/src/effect/peppol-document-schema.ts +0 -142
- package/src/effect/peppol-invoice-response-document-actual-response-status-schema.ts +0 -60
- package/src/effect/peppol-invoice-response-schema.ts +0 -168
- package/src/effect/peppol-invoice-response-status-reason-code-schema.ts +0 -31
- package/src/effect/peppol-invoice-schema.ts +0 -42
- package/src/effect/peppol-iso-date-string-schema.ts +0 -19
- package/src/effect/peppol-message-level-response-document-response-schema.ts +0 -33
- package/src/effect/peppol-message-level-response-party-schema.ts +0 -19
- package/src/effect/peppol-message-level-response-schema.ts +0 -97
- package/src/effect/utils/format-quantity-with-unit.ts +0 -1
- package/src/effect/utils/get-credit-note-type-code-description.ts +0 -1
- package/src/effect/utils/get-invoice-type-code-description.ts +0 -1
- package/src/effect/utils/is-valid-credit-note-type-code.ts +0 -1
- package/src/effect/utils/is-valid-invoice-type-code.ts +0 -1
- package/src/effect/utils/is-valid-process.ts +0 -1
- package/src/effect/utils/peppol-xsd-time-schema.ts +0 -13
- package/src/effect/utils/quantity-unit-code-to-intl-unit.ts +0 -2
- package/src/effect/values/credit-note-type-code-schema.ts +0 -23
- package/src/effect/values/document-type-schemes-schema.ts +0 -14
- package/src/effect/values/document-type-values-schema.ts +0 -16
- package/src/effect/values/invoice-type-code-schema.ts +0 -21
- package/src/effect/values/process-from-document-type-schema.ts +0 -26
- package/src/effect/values/quantity-unit-codes-schema.ts +0 -24
- package/src/helpers/errors.ts +0 -6
- package/src/helpers/is-defined.ts +0 -3
- package/src/schemas/billing-base.ts +0 -362
- package/src/schemas/credit-note.ts +0 -28
- package/src/schemas/document-response-document-reference-schema.ts +0 -37
- package/src/schemas/document-response-document-schema.ts +0 -34
- package/src/schemas/document-response-line-response-content.ts +0 -43
- package/src/schemas/document-response-line-response-schema.ts +0 -33
- package/src/schemas/fields/additional-document-reference-schema.ts +0 -112
- package/src/schemas/fields/address-schema.ts +0 -105
- package/src/schemas/fields/allowance-charge-schema.ts +0 -86
- package/src/schemas/fields/amount-schema.ts +0 -21
- package/src/schemas/fields/base-line-schema.ts +0 -136
- package/src/schemas/fields/billing-references-schema.ts +0 -44
- package/src/schemas/fields/binary-object-schema.ts +0 -45
- package/src/schemas/fields/contact-schema.ts +0 -18
- package/src/schemas/fields/credit-note-line-schema.ts +0 -37
- package/src/schemas/fields/date-only-fn.ts +0 -6
- package/src/schemas/fields/date-only-parser.ts +0 -20
- package/src/schemas/fields/delivery-schema.ts +0 -95
- package/src/schemas/fields/identifier-schema.ts +0 -24
- package/src/schemas/fields/invoice-line-period-schema.ts +0 -31
- package/src/schemas/fields/invoice-line-schema.ts +0 -41
- package/src/schemas/fields/invoice-period-schema.ts +0 -27
- package/src/schemas/fields/legal-monetary-total-schema.ts +0 -125
- package/src/schemas/fields/line-allowance-charge-schema.ts +0 -59
- package/src/schemas/fields/line-item-schema.ts +0 -183
- package/src/schemas/fields/line-price-allowance-charge-schema.ts +0 -33
- package/src/schemas/fields/list-identifier-schema.ts +0 -43
- package/src/schemas/fields/order-reference-schema.ts +0 -36
- package/src/schemas/fields/party-base-schema.ts +0 -131
- package/src/schemas/fields/party-legal-entity-schema.ts +0 -29
- package/src/schemas/fields/party-tax-schema.ts +0 -33
- package/src/schemas/fields/payee-party.ts +0 -107
- package/src/schemas/fields/payment-means-schema.ts +0 -209
- package/src/schemas/fields/payment-terms-schema.ts +0 -23
- package/src/schemas/fields/price-schema.ts +0 -31
- package/src/schemas/fields/quantity-schema.ts +0 -21
- package/src/schemas/fields/reference-schema.ts +0 -4
- package/src/schemas/fields/tax-category-schema.ts +0 -41
- package/src/schemas/fields/tax-representative-party-schema.ts +0 -23
- package/src/schemas/fields/tax-subtotal-category-schema.ts +0 -26
- package/src/schemas/fields/tax-subtotal-schema.ts +0 -32
- package/src/schemas/fields/tax-totals.ts +0 -25
- package/src/schemas/fields/time-only.ts +0 -23
- package/src/schemas/invoice-response-document-actual-response-status.ts +0 -58
- package/src/schemas/invoice-response-document-actual-response.ts +0 -73
- package/src/schemas/invoice-response-schema.ts +0 -155
- package/src/schemas/invoice-response-status-reason-code.ts +0 -30
- package/src/schemas/invoice.ts +0 -43
- package/src/schemas/message-level-response-document-response-schema.ts +0 -33
- package/src/schemas/message-level-response-party-schema.ts +0 -18
- package/src/schemas/message-level-response-schema.ts +0 -96
- package/src/schemas/utils/base-64.ts +0 -34
- package/src/schemas/utils/vat-regex.ts +0 -51
- package/src/schemas/utils/xsd-time.ts +0 -9
- package/src/schemas/values/additional-document-reference-code.ts +0 -27
- package/src/schemas/values/allowance-charge-reason-code.ts +0 -29
- package/src/schemas/values/application-response-type-codes.ts +0 -25
- package/src/schemas/values/charge-reason-code.ts +0 -29
- package/src/schemas/values/country-code.ts +0 -36
- package/src/schemas/values/currency-codes.ts +0 -35
- package/src/schemas/values/document-type-codes.ts +0 -25
- package/src/schemas/values/document-type-schema.ts +0 -49
- package/src/schemas/values/duty-tax-fee-cateogries.ts +0 -28
- package/src/schemas/values/eas-codes.ts +0 -35
- package/src/schemas/values/icd-codes.ts +0 -28
- package/src/schemas/values/invoice-status-codes.ts +0 -25
- package/src/schemas/values/item-classification-code-schema.ts +0 -28
- package/src/schemas/values/mime-code.ts +0 -28
- package/src/schemas/values/op-status-action.ts +0 -25
- package/src/schemas/values/op-status-reason.ts +0 -25
- package/src/schemas/values/participant-identifier-code.ts +0 -25
- package/src/schemas/values/payment-means-codes-schema.ts +0 -36
- package/src/schemas/values/process-schema.ts +0 -41
- package/src/schemas/values/process-xml-identifier-schema.ts +0 -27
- package/src/schemas/values/vat-date-code.ts +0 -15
- package/src/schemas/values/vatex-code.ts +0 -28
- package/src/schemas.ts +0 -97
- /package/src/{effect → schemas}/utils/peppol-base-64-schema.ts +0 -0
- /package/src/{effect → schemas}/utils/peppol-vat-regex-schema.ts +0 -0
- /package/src/{effect → schemas}/values/additional-document-reference-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/allowance-charge-reason-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/application-response-type-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/charge-reason-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/currency-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/electronic-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/icd-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/index.ts +0 -0
- /package/src/{effect → schemas}/values/invoice-status-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/item-classification-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/mime-codes-schema.ts +0 -0
- /package/src/{effect → schemas}/values/op-status-action-schema.ts +0 -0
- /package/src/{effect → schemas}/values/op-status-reason-schema.ts +0 -0
- /package/src/{effect → schemas}/values/participant-identifier-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/payment-means-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-country-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-document-type-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-document-type-schema.ts +0 -0
- /package/src/{effect → schemas}/values/peppol-process-schema.ts +0 -0
- /package/src/{effect → schemas}/values/vat-date-code-schema.ts +0 -0
- /package/src/{effect → schemas}/values/vatex-code-schema.ts +0 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { Effect, Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_CUSTOMIZATION_ID } from '#/schemas/fields/default-customization-id';
|
|
4
|
+
import { DEFAULT_PROFILE_ID } from '#/schemas/fields/default-profile-id';
|
|
5
|
+
import { PeppolAdditionalDocumentReference } from '#/schemas/fields/peppol-additional-document-reference-schema';
|
|
6
|
+
import { peppolAllowanceChargeSchema } from '#/schemas/fields/peppol-allowance-charge-schema';
|
|
7
|
+
import { PeppolBillingReference } from '#/schemas/fields/peppol-billing-reference-schema';
|
|
8
|
+
import { PeppolDelivery } from '#/schemas/fields/peppol-delivery-schema';
|
|
9
|
+
import { PeppolInvoicePeriod } from '#/schemas/fields/peppol-invoice-period-schema';
|
|
10
|
+
import { PeppolLegalMonetaryTotal } from '#/schemas/fields/peppol-legal-monetary-total-schema';
|
|
11
|
+
import { PeppolOrderReference } from '#/schemas/fields/peppol-order-reference-schema';
|
|
12
|
+
import { PeppolPartySchema } from '#/schemas/fields/peppol-party-base-schema';
|
|
13
|
+
import { PeppolPayeeParty } from '#/schemas/fields/peppol-payee-party-schema';
|
|
14
|
+
import { PeppolPaymentMeans } from '#/schemas/fields/peppol-payment-means-schema';
|
|
15
|
+
import { PeppolPaymentTerms } from '#/schemas/fields/peppol-payment-terms-schema';
|
|
16
|
+
import { PeppolTaxRepresentative } from '#/schemas/fields/peppol-tax-representative-schema';
|
|
17
|
+
import { PeppolTaxTotalsBase } from '#/schemas/fields/peppol-tax-totals-base-schema';
|
|
18
|
+
import { PeppolIsoDateString } from '#/schemas/peppol-iso-date-string';
|
|
19
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
20
|
+
import { currencyCodeSchema } from '#/schemas/values/currency-code-schema';
|
|
21
|
+
|
|
22
|
+
export class PeppolContractDocumentReference extends opaque<PeppolContractDocumentReference>()(
|
|
23
|
+
Schema.Struct({
|
|
24
|
+
/**
|
|
25
|
+
* @description An identifier of a referenced contract.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* `123Contractref`;
|
|
29
|
+
*
|
|
30
|
+
* @summary Contract reference
|
|
31
|
+
*
|
|
32
|
+
* @name `cbc:ID`
|
|
33
|
+
*/
|
|
34
|
+
id: Schema.String,
|
|
35
|
+
})
|
|
36
|
+
) {}
|
|
37
|
+
|
|
38
|
+
export class PeppolOriginatorDocumentReference extends opaque<PeppolOriginatorDocumentReference>()(
|
|
39
|
+
Schema.Struct({
|
|
40
|
+
/**
|
|
41
|
+
* @description The identification of the call for tender or lot the invoice relates to.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* `PPID-123`;
|
|
45
|
+
*
|
|
46
|
+
* @summary Tender or lot reference
|
|
47
|
+
*
|
|
48
|
+
* @name `cbc:ID`
|
|
49
|
+
*/
|
|
50
|
+
id: Schema.String,
|
|
51
|
+
})
|
|
52
|
+
) {}
|
|
53
|
+
|
|
54
|
+
export class PeppolReceiptDocumentReference extends opaque<PeppolReceiptDocumentReference>()(
|
|
55
|
+
Schema.Struct({
|
|
56
|
+
/**
|
|
57
|
+
* @description An identifier of a referenced receiving advice.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* `rec98`;
|
|
61
|
+
*
|
|
62
|
+
* @summary Receiving advice reference
|
|
63
|
+
*
|
|
64
|
+
* @name `cbc:ID`
|
|
65
|
+
*/
|
|
66
|
+
id: Schema.String,
|
|
67
|
+
})
|
|
68
|
+
) {}
|
|
69
|
+
|
|
70
|
+
export class PeppolDespatchDocumentReference extends opaque<PeppolDespatchDocumentReference>()(
|
|
71
|
+
Schema.Struct({
|
|
72
|
+
/**
|
|
73
|
+
* @description An identifier of a referenced despatch advice.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* `desp98`;
|
|
77
|
+
*
|
|
78
|
+
* @summary Despatch advice reference
|
|
79
|
+
*
|
|
80
|
+
* @name `cbc:ID`
|
|
81
|
+
*/
|
|
82
|
+
id: Schema.String,
|
|
83
|
+
})
|
|
84
|
+
) {}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @description Base schema for a billing document.
|
|
88
|
+
*
|
|
89
|
+
* @see {@link creditNoteSchema} - the credit note schema
|
|
90
|
+
* @see {@link invoiceSchema} - the invoice schema
|
|
91
|
+
*/
|
|
92
|
+
export class PeppolBillingBase extends opaque<PeppolBillingBase>()(
|
|
93
|
+
Schema.Struct({
|
|
94
|
+
/**
|
|
95
|
+
* @description An identification of the specification containing the total set of rules regarding semantic content, cardinalities, and business rules to which
|
|
96
|
+
* the data contained in the intance document conforms.
|
|
97
|
+
*
|
|
98
|
+
* @default `urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0`
|
|
99
|
+
*
|
|
100
|
+
* @summary Specification identifier
|
|
101
|
+
*
|
|
102
|
+
* @cardinality 1..1
|
|
103
|
+
*
|
|
104
|
+
* @name `cbc:CustomizationID`
|
|
105
|
+
*/
|
|
106
|
+
customizationId: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed(DEFAULT_CUSTOMIZATION_ID))).check(
|
|
107
|
+
Schema.isStartsWith('urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0', {
|
|
108
|
+
message:
|
|
109
|
+
"PEPPOL-EN16931-R004: Specification identifier MUST have the value 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'.",
|
|
110
|
+
})
|
|
111
|
+
),
|
|
112
|
+
/**
|
|
113
|
+
* @description Identifies the business process context in which the transaction appears, to enable the Buyer to process the Invoice in an appropriate way.
|
|
114
|
+
*
|
|
115
|
+
* @default `urn:fdc:peppol.eu:2017:poacc:billing:01:1.0`
|
|
116
|
+
*
|
|
117
|
+
* @summary Business process type
|
|
118
|
+
*
|
|
119
|
+
* @name `cbc:ProfileID`
|
|
120
|
+
*/
|
|
121
|
+
profileId: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed(DEFAULT_PROFILE_ID))).check(
|
|
122
|
+
Schema.isPattern(/^urn:fdc:peppol.eu:2017:poacc:billing:(\d{2}):1\.0$/, {
|
|
123
|
+
message:
|
|
124
|
+
"PEPPOL-EN16931-R007: Business process MUST be in the format 'urn:fdc:peppol.eu:2017:poacc:billing:NN:1.0' where NN indicates the process number.",
|
|
125
|
+
})
|
|
126
|
+
),
|
|
127
|
+
/**
|
|
128
|
+
* @description A using identification of the Invoice. The sequential number required in Article 226(2) of the directive 2006/112/EC [2], to uniquely identify
|
|
129
|
+
* the Invoice within the business context, time-frame, operating systems and records of the Seller. No identification scheme is to be used.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* 33445566;
|
|
133
|
+
*
|
|
134
|
+
* @summary Invoice number
|
|
135
|
+
*
|
|
136
|
+
* @name `cbc:ID`
|
|
137
|
+
*/
|
|
138
|
+
id: Schema.String,
|
|
139
|
+
/**
|
|
140
|
+
* @description The date when the invoice was issued.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* `2017-11-01`;
|
|
144
|
+
*
|
|
145
|
+
* @summary Invoice issue date
|
|
146
|
+
*
|
|
147
|
+
* @format `YYYY-MM-DD`
|
|
148
|
+
*
|
|
149
|
+
* @name `cbc:IssueDate`
|
|
150
|
+
*/
|
|
151
|
+
issueDate: PeppolIsoDateString,
|
|
152
|
+
/**
|
|
153
|
+
* @description Invoice note A textual note that gives unstructured information that is relevant to the Credit Note as a whole.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* Please note our new phone number 33 44 55 66
|
|
157
|
+
*
|
|
158
|
+
* @name `cbc:Note`
|
|
159
|
+
*/
|
|
160
|
+
note: Schema.optional(Schema.String),
|
|
161
|
+
/**
|
|
162
|
+
* @description The date when the VAT becomes accountable for the Seller and for the Buyer in so far as that date can be determined and differs from the date
|
|
163
|
+
* of issue of the invoice, according to the VAT directive.This element is required if the Value added tax point date is different from the
|
|
164
|
+
* Invoice issue date.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* 2017 - 11 - 01;
|
|
168
|
+
*
|
|
169
|
+
* @summary Value added tax point date
|
|
170
|
+
*
|
|
171
|
+
* @name `cbc:TaxPointDate`
|
|
172
|
+
*/
|
|
173
|
+
taxPointDate: Schema.optional(PeppolIsoDateString),
|
|
174
|
+
/**
|
|
175
|
+
* @description The currency in which all Invoice amounts are given, except for the Total VAT amount in accounting currency. Only one currency shall be used in
|
|
176
|
+
* the Invoice, except for the VAT accounting currency code (BT-6) and the invoice total VAT amount in accounting currency (BT-111).
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* EUR;
|
|
180
|
+
*
|
|
181
|
+
* @summary Invoice currency code
|
|
182
|
+
*
|
|
183
|
+
* @name `cbc:DocumentCurrencyCode`
|
|
184
|
+
*/
|
|
185
|
+
documentCurrencyCode: currencyCodeSchema,
|
|
186
|
+
/**
|
|
187
|
+
* @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
|
|
188
|
+
* with the Invoice total VAT amount in accounting currency (BT-111), when the VAT accounting currency code differs from the Invoice currency
|
|
189
|
+
* code.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* SEK;
|
|
193
|
+
*
|
|
194
|
+
* @summary VAT accounting currency code
|
|
195
|
+
*
|
|
196
|
+
* @name `cbc:TaxCurrencyCode`
|
|
197
|
+
*/
|
|
198
|
+
taxCurrencyCode: Schema.optional(currencyCodeSchema),
|
|
199
|
+
/**
|
|
200
|
+
* @description A textual value that specifies where to book the relevant data into the Buyer's financial accounts.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* `4217:2323:2323`;
|
|
204
|
+
*
|
|
205
|
+
* @summary Buyer accounting reference
|
|
206
|
+
*
|
|
207
|
+
* @name `cbc:AccountingCost`
|
|
208
|
+
*/
|
|
209
|
+
accountingCost: Schema.optional(Schema.String),
|
|
210
|
+
/**
|
|
211
|
+
* @description An identifier assigned by the Buyer used for internal routing purposes. An invoice must have buyer reference or purchase order reference
|
|
212
|
+
* (BT-13).
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* `abs1234`;
|
|
216
|
+
*
|
|
217
|
+
* @summary Buyer reference
|
|
218
|
+
*
|
|
219
|
+
* @name `cbc:BuyerReference`
|
|
220
|
+
*/
|
|
221
|
+
buyerReference: Schema.optional(Schema.String),
|
|
222
|
+
/**
|
|
223
|
+
* @description A group of business terms providing information on the invoice period. Also called delivery period. If the group is used, the invoiceing period
|
|
224
|
+
* start date and/or end date must be used.
|
|
225
|
+
*
|
|
226
|
+
* @summary DELIVERY OR INVOICE PERIOD
|
|
227
|
+
*
|
|
228
|
+
* @name `cac:InvoicePeriod`
|
|
229
|
+
*/
|
|
230
|
+
invoicePeriod: Schema.optional(PeppolInvoicePeriod),
|
|
231
|
+
/**
|
|
232
|
+
* @summary ORDER AND SALES ORDER REFERENCE
|
|
233
|
+
*
|
|
234
|
+
* @name `cac:OrderReference`
|
|
235
|
+
*/
|
|
236
|
+
orderReference: Schema.optional(PeppolOrderReference),
|
|
237
|
+
/**
|
|
238
|
+
* @summary PRECEDING INVOICE REFERENCE (0..n)
|
|
239
|
+
*
|
|
240
|
+
* @name `cac:BillingReference`
|
|
241
|
+
*/
|
|
242
|
+
billingReferences: Schema.optional(Schema.Array(PeppolBillingReference)),
|
|
243
|
+
/**
|
|
244
|
+
* @summary DESPATCH ADVICE REFERENCE
|
|
245
|
+
*
|
|
246
|
+
* @name `cac:DespatchDocumentReference`
|
|
247
|
+
*/
|
|
248
|
+
despatchDocumentReference: Schema.optional(PeppolDespatchDocumentReference),
|
|
249
|
+
/**
|
|
250
|
+
* @summary RECEIPT ADVICE REFERENCE
|
|
251
|
+
*
|
|
252
|
+
* @name `cac:ReceiptDocumentReference`
|
|
253
|
+
*/
|
|
254
|
+
receiptDocumentReference: Schema.optional(PeppolReceiptDocumentReference),
|
|
255
|
+
/**
|
|
256
|
+
* @summary TENDER OR LOT REFERENCE
|
|
257
|
+
*
|
|
258
|
+
* @name `cac:OriginatorDocumentReference`
|
|
259
|
+
*/
|
|
260
|
+
originatorDocumentReference: Schema.optional(PeppolOriginatorDocumentReference),
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* @summary CONTRACT REFERENCE
|
|
264
|
+
*
|
|
265
|
+
* @name `cac:ContractDocumentReference`
|
|
266
|
+
*/
|
|
267
|
+
contractDocumentReference: Schema.optional(PeppolContractDocumentReference),
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @description A group of business terms providing information about additional supporting documents substantiating the claims made in the Invoice. The
|
|
271
|
+
* additional supporting documents can be used for both referencing a document number which is expected to be known by the receiver, an external
|
|
272
|
+
* document (referenced by a URL) or as an embedded document, Base64 encoded (such as a time report).
|
|
273
|
+
*
|
|
274
|
+
* @summary ADDITIONAL SUPPORTING DOCUMENTS
|
|
275
|
+
*
|
|
276
|
+
* @name `cac:AdditionalDocumentReference`
|
|
277
|
+
*/
|
|
278
|
+
additionalDocumentReferences: Schema.optional(Schema.Array(PeppolAdditionalDocumentReference)),
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* @description A group of business terms providing information about the seller.
|
|
282
|
+
*
|
|
283
|
+
* @summary SELLER
|
|
284
|
+
*
|
|
285
|
+
* @name `cac:AccountingSupplierParty`
|
|
286
|
+
*/
|
|
287
|
+
accountingSupplierParty: PeppolPartySchema,
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @description A group of business terms providing information about the Buyer.
|
|
291
|
+
*
|
|
292
|
+
* @summary BUYER
|
|
293
|
+
*
|
|
294
|
+
* @name `cac:AccountingCustomerParty`
|
|
295
|
+
*/
|
|
296
|
+
accountingCustomerParty: PeppolPartySchema,
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @description A group of business terms providing information about the Payee, i.e. the role that received the payment. Shall be used wwhen the payee is
|
|
300
|
+
* different from the seller.
|
|
301
|
+
*
|
|
302
|
+
* @summary PAYEE
|
|
303
|
+
*
|
|
304
|
+
* @name cac:PayeeParty
|
|
305
|
+
*/
|
|
306
|
+
payeeParty: Schema.optional(PeppolPayeeParty),
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @description SELLER TAX REPRESENTATIVE PARTY.
|
|
310
|
+
*
|
|
311
|
+
* @name cac:TaxRepresentativeParty
|
|
312
|
+
*/
|
|
313
|
+
taxRepresentativeParty: Schema.optional(PeppolTaxRepresentative),
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @description DELIVERY INFORMATION.
|
|
317
|
+
*
|
|
318
|
+
* @name cac:Delivery
|
|
319
|
+
*/
|
|
320
|
+
delivery: Schema.optional(PeppolDelivery),
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* @summary PAYMENT INSTRUCTIONS
|
|
324
|
+
* @summary A group of business terms providing information about the payment.
|
|
325
|
+
*
|
|
326
|
+
* @name cac:PaymentMeans
|
|
327
|
+
*/
|
|
328
|
+
paymentMeans: Schema.optional(Schema.Array(PeppolPaymentMeans)),
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @example
|
|
332
|
+
* Net within 30 days
|
|
333
|
+
*
|
|
334
|
+
* @summary PAYMENT TERMS
|
|
335
|
+
*
|
|
336
|
+
* @name cac:PaymentTerms
|
|
337
|
+
*/
|
|
338
|
+
paymentTerms: Schema.optional(PeppolPaymentTerms),
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* @description A group of business terms providing information about allowances applicable to the Invoice as a whole. A group of business terms providing
|
|
342
|
+
* information about charges and taxes other than VAT, applicable to the Invoice as a whole.
|
|
343
|
+
*
|
|
344
|
+
* @summary DOCUMENT LEVEL ALLOWANCES AND CHARGES
|
|
345
|
+
*
|
|
346
|
+
* @name cac:AllowanceCharge
|
|
347
|
+
*/
|
|
348
|
+
allowanceCharges: Schema.optional(Schema.Array(peppolAllowanceChargeSchema)),
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @description When tax currency code is provided, two instances of the tax total must be present, but only one with tax subtotal.
|
|
352
|
+
*
|
|
353
|
+
* @summary TAX TOTAL
|
|
354
|
+
*
|
|
355
|
+
* @name cac:TaxTotal
|
|
356
|
+
*/
|
|
357
|
+
taxTotals: Schema.Array(PeppolTaxTotalsBase).check(Schema.isMinLength(1), Schema.isMaxLength(2)),
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @summary DOCUMENT TOTALS
|
|
361
|
+
*
|
|
362
|
+
* @name cac:LegalMonetaryTotal
|
|
363
|
+
*/
|
|
364
|
+
legalMonetaryTotal: PeppolLegalMonetaryTotal,
|
|
365
|
+
})
|
|
366
|
+
) {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { PeppolCreditNoteLine } from '#/schemas/fields/peppol-credit-note-line-schema';
|
|
4
|
+
import { PeppolBillingBase } from '#/schemas/peppol-billing-base-schema';
|
|
5
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
6
|
+
import { creditNoteTypeCodeSchema } from '#/schemas/values/credit-note-type-code-schema';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @description Main UBL Credit Note schema (camelCase properties) Effect port of `creditNoteSchema` (`z.extend(billingBaseSchema, ...)` →
|
|
10
|
+
* `PeppolBillingBase.pipe(Schema.fieldsAssign(...))`).
|
|
11
|
+
*/
|
|
12
|
+
export class PeppolCreditNote extends opaque<PeppolCreditNote>()(
|
|
13
|
+
Schema.Struct({
|
|
14
|
+
...PeppolBillingBase.fields,
|
|
15
|
+
/**
|
|
16
|
+
* @description CREDIT NOTE LINE.
|
|
17
|
+
*
|
|
18
|
+
* @name cac:CreditNoteLine (1..n)
|
|
19
|
+
*/
|
|
20
|
+
creditNoteLines: Schema.Array(PeppolCreditNoteLine).check(Schema.isMinLength(1)),
|
|
21
|
+
/**
|
|
22
|
+
* @description Invoice type code A code specifying the functional type of the Credit Note.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* 381;
|
|
26
|
+
*
|
|
27
|
+
* @name cbc:CreditNoteTypeCode
|
|
28
|
+
*/
|
|
29
|
+
creditNoteTypeCode: creditNoteTypeCodeSchema,
|
|
30
|
+
})
|
|
31
|
+
) {}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
4
|
+
import { peppolDocumentTypeCodeSchema } from '#/schemas/values/peppol-document-type-code-schema';
|
|
5
|
+
|
|
6
|
+
export class PeppolDocumentResponseDocumentReference extends opaque<PeppolDocumentResponseDocumentReference>()(
|
|
7
|
+
Schema.Struct({
|
|
8
|
+
/**
|
|
9
|
+
* @description Identifies the document on which the message level response is based.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* `EnvelopeID-12345`;
|
|
13
|
+
*
|
|
14
|
+
* @summary Document identifier
|
|
15
|
+
*
|
|
16
|
+
* @name `cbc:ID`
|
|
17
|
+
*/
|
|
18
|
+
id: Schema.String,
|
|
19
|
+
/**
|
|
20
|
+
* @description The type of the document being referred to, expressed as a code.
|
|
21
|
+
*
|
|
22
|
+
* @summary Document type code
|
|
23
|
+
*
|
|
24
|
+
* @name `cbc:DocumentTypeCode`
|
|
25
|
+
*/
|
|
26
|
+
documentTypeCode: Schema.optional(peppolDocumentTypeCodeSchema),
|
|
27
|
+
/**
|
|
28
|
+
* @description The version of the document that has been identifier with the document identifier.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* `2`;
|
|
32
|
+
*
|
|
33
|
+
* @summary Document version identifier
|
|
34
|
+
*
|
|
35
|
+
* @name `cbc:VersionID`
|
|
36
|
+
*/
|
|
37
|
+
versionId: Schema.optional(Schema.String),
|
|
38
|
+
})
|
|
39
|
+
) {}
|
|
40
|
+
|
|
41
|
+
export type PeppolMessageLevelDocumentResponseDocumentReference = PeppolDocumentResponseDocumentReference;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
4
|
+
import { applicationResponseTypeCodeSchema } from '#/schemas/values/application-response-type-code-schema';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @summary Response information
|
|
8
|
+
*
|
|
9
|
+
* @name `cac:Response`
|
|
10
|
+
*
|
|
11
|
+
* @cardinality (1..1)
|
|
12
|
+
*
|
|
13
|
+
* @see {@link messageLevelResponseDocumentResponseSchema}
|
|
14
|
+
*/
|
|
15
|
+
export class PeppolDocumentResponseDocument extends opaque<PeppolDocumentResponseDocument>()(
|
|
16
|
+
Schema.Struct({
|
|
17
|
+
/**
|
|
18
|
+
* @description An indicator stating whether the referenced message was cleared through validation and advanced to the next step in the process. A negative
|
|
19
|
+
* response states that the document was not processed because of identified issues.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* `RE`;
|
|
23
|
+
*
|
|
24
|
+
* @summary Message response code
|
|
25
|
+
*
|
|
26
|
+
* @name `cbc:ResponseCode`
|
|
27
|
+
*/
|
|
28
|
+
responseCode: applicationResponseTypeCodeSchema,
|
|
29
|
+
/**
|
|
30
|
+
* @description Used to meake any comments or instructions relevant to the response. The use of this element requires manual assessment by the receiver.
|
|
31
|
+
*
|
|
32
|
+
* @summary Response textual notes
|
|
33
|
+
*/
|
|
34
|
+
description: Schema.optional(Schema.String),
|
|
35
|
+
})
|
|
36
|
+
) {}
|
|
37
|
+
|
|
38
|
+
export type PeppolMessageLevelResponseDocumentResponseDocument = PeppolDocumentResponseDocument;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
4
|
+
import { applicationResponseTypeCodeSchema } from '#/schemas/values/application-response-type-code-schema';
|
|
5
|
+
|
|
6
|
+
class PeppolStatus extends opaque<PeppolStatus>()(
|
|
7
|
+
Schema.Struct({
|
|
8
|
+
/**
|
|
9
|
+
* @description A codified version of the issue description that describes the nature of the issue. e.g. Syntax violation, business rule violation, ...
|
|
10
|
+
*
|
|
11
|
+
* @summary Issue type coded
|
|
12
|
+
*
|
|
13
|
+
* @name `cbc:StatusReasonCode`
|
|
14
|
+
*/
|
|
15
|
+
statusReasonCode: Schema.Literals(['BV', 'BW', 'SV']),
|
|
16
|
+
})
|
|
17
|
+
) {}
|
|
18
|
+
|
|
19
|
+
export class PeppolDocumentResponseLineResponseContent extends opaque<PeppolDocumentResponseLineResponseContent>()(
|
|
20
|
+
Schema.Struct({
|
|
21
|
+
/**
|
|
22
|
+
* @description An indicator stating whether the referenced message was cleared through validation and advanced to the next step in the process. A negative
|
|
23
|
+
* response states that the document was not processed because of identified issues.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* `RE`;
|
|
27
|
+
*
|
|
28
|
+
* @summary Line response code
|
|
29
|
+
*
|
|
30
|
+
* @name `cbc:ResponseCode`
|
|
31
|
+
*/
|
|
32
|
+
responseCode: applicationResponseTypeCodeSchema,
|
|
33
|
+
/**
|
|
34
|
+
* @description The description of the issued identifier in the transaction document.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* `Validation gives error [CL-T77-R0002]- Tax categories MUST be coded using UN/ECE 5305 code list`;
|
|
38
|
+
*
|
|
39
|
+
* @summary Issue description
|
|
40
|
+
*
|
|
41
|
+
* @name `cbc:Description`
|
|
42
|
+
*/
|
|
43
|
+
description: Schema.String,
|
|
44
|
+
/**
|
|
45
|
+
* @name `cac:Status`
|
|
46
|
+
*/
|
|
47
|
+
status: PeppolStatus,
|
|
48
|
+
})
|
|
49
|
+
) {}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { PeppolDocumentResponseLineResponseContent } from '#/schemas/peppol-document-response-line-response-content-schema';
|
|
4
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
5
|
+
|
|
6
|
+
class PeppolLineReference extends opaque<PeppolLineReference>()(
|
|
7
|
+
Schema.Struct({
|
|
8
|
+
/**
|
|
9
|
+
* @description Identifies the section of the document to which the reported issue applied. The LineID element mustbe used to indicate where in the business
|
|
10
|
+
* document the error occurred by using XPath to reference the element causing the error. To cater for scenarios where it is not possible to
|
|
11
|
+
* provide XPath, a dummy value must be applied. The dummay value must consist of the characters NA. This is due to that the LineID element is
|
|
12
|
+
* mendatory in the ApplicationResponse message in UBL 2.1 on which the MLR message is based.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* `/Catalogue/cac:CatalogueLine[3]/cac:Item[1]/cac:ClassifiedTaxCategory[1]/cbc:ID[1]`;
|
|
16
|
+
*
|
|
17
|
+
* @summary Section identifier
|
|
18
|
+
*/
|
|
19
|
+
lineId: Schema.String,
|
|
20
|
+
})
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
export class PeppolDocumentResponseLineResponse extends opaque<PeppolDocumentResponseLineResponse>()(
|
|
24
|
+
Schema.Struct({
|
|
25
|
+
/**
|
|
26
|
+
* @description Identifies the line in the business document to which the reported issue applies.
|
|
27
|
+
*
|
|
28
|
+
* @summary Line reference
|
|
29
|
+
*
|
|
30
|
+
* @name `cac:LineReference`
|
|
31
|
+
*/
|
|
32
|
+
lineReference: PeppolLineReference,
|
|
33
|
+
/**
|
|
34
|
+
* @summary Line response information
|
|
35
|
+
*/
|
|
36
|
+
response: PeppolDocumentResponseLineResponseContent,
|
|
37
|
+
})
|
|
38
|
+
) {}
|
|
39
|
+
|
|
40
|
+
export type PeppolMessageLevelDocumentResponseLineResponse = PeppolDocumentResponseLineResponse;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { SchemaAST } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { Effect, Predicate, Schema, SchemaGetter, SchemaIssue } from 'effect';
|
|
4
|
+
import XMLBuilder from 'fast-xml-builder';
|
|
5
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
6
|
+
|
|
7
|
+
import type { XmlNode } from '#/helpers/get-prop';
|
|
8
|
+
import type { PeppolCreditNoteLine } from '#/schemas/fields/peppol-credit-note-line-schema';
|
|
9
|
+
import type { PeppolInvoiceLine } from '#/schemas/fields/peppol-invoice-line-schema';
|
|
10
|
+
|
|
11
|
+
import { INVOICE_RESPONSE_PROFILE_ID } from '#/constants/invoice-response-profile-id';
|
|
12
|
+
import { MESSAGE_LEVEL_RESPONSE_PROFILE_ID } from '#/constants/message-level-response-profile-id';
|
|
13
|
+
import { decodeCreditNote } from '#/decoders/decode-credit-note';
|
|
14
|
+
import { decodeInvoice } from '#/decoders/decode-invoice';
|
|
15
|
+
import { decodeInvoiceResponse } from '#/decoders/decode-invoice-response';
|
|
16
|
+
import { decodeMessageLevelResponse } from '#/decoders/decode-message-level-response';
|
|
17
|
+
import { encodeCreditNote } from '#/decoders/encode-credit-note';
|
|
18
|
+
import { encodeInvoice } from '#/decoders/encode-invoice';
|
|
19
|
+
import { encodeInvoiceResponse } from '#/decoders/encode-invoice-response';
|
|
20
|
+
import { encodeMessageLevelResponse } from '#/decoders/encode-message-level-response';
|
|
21
|
+
import { strOrUnd } from '#/helpers/str-or-und';
|
|
22
|
+
import { PeppolCreditNote } from '#/schemas/peppol-credit-note-schema';
|
|
23
|
+
import { PeppolInvoiceResponse } from '#/schemas/peppol-invoice-response-schema';
|
|
24
|
+
import { PeppolInvoice } from '#/schemas/peppol-invoice-schema';
|
|
25
|
+
import { PeppolMessageLevelResponse } from '#/schemas/peppol-message-level-response-schema';
|
|
26
|
+
import { builderOptions } from '#/xml/builder-options';
|
|
27
|
+
import { parserOptions } from '#/xml/parser-options';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @description Object representation of a PEPPOL document, before the member schemas normalise it (dates stay strings, enums stay loose). This is the shape
|
|
31
|
+
* produced by the legacy `#/decoders/*` functions and consumed by their `#/decoders/encode-*` counterparts.
|
|
32
|
+
*/
|
|
33
|
+
const peppolDocumentObjectSchema = Schema.Union([PeppolInvoice, PeppolCreditNote, PeppolMessageLevelResponse, PeppolInvoiceResponse], {
|
|
34
|
+
mode: 'oneOf',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
type PeppolDocumentObject = typeof peppolDocumentObjectSchema.Encoded;
|
|
38
|
+
|
|
39
|
+
const parseXml = (value: string): XmlNode => new XMLParser({ ...parserOptions, removeNSPrefix: true }).parse(value);
|
|
40
|
+
|
|
41
|
+
export const isPeppolInvoice = Schema.is(PeppolInvoice);
|
|
42
|
+
export const isPeppolCreditNote = Schema.is(PeppolCreditNote);
|
|
43
|
+
export const isPeppolMessageLevelResponse = Schema.is(PeppolMessageLevelResponse);
|
|
44
|
+
export const isPeppolInvoiceResponse = Schema.is(PeppolInvoiceResponse);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @description XML string -> loose document object. Dispatches on the root element; `ApplicationResponse` is further split by its `cbc:ProfileID`.
|
|
48
|
+
*/
|
|
49
|
+
const decodeDocumentXml = Effect.fn('decode-peppol-document-xml')(function* (value: string, options: SchemaAST.ParseOptions) {
|
|
50
|
+
const parsed = parseXml(value);
|
|
51
|
+
|
|
52
|
+
if (Predicate.isNotNullish(parsed.Invoice)) {
|
|
53
|
+
return yield* decodeInvoice(parsed);
|
|
54
|
+
}
|
|
55
|
+
if (Predicate.isNotNullish(parsed.CreditNote)) {
|
|
56
|
+
return yield* decodeCreditNote(parsed);
|
|
57
|
+
}
|
|
58
|
+
if (Predicate.isNotNullish(parsed.ApplicationResponse)) {
|
|
59
|
+
const profileId = yield* strOrUnd(parsed.ApplicationResponse, 'cbc:ProfileID');
|
|
60
|
+
if (profileId === MESSAGE_LEVEL_RESPONSE_PROFILE_ID) {
|
|
61
|
+
return yield* decodeMessageLevelResponse(parsed);
|
|
62
|
+
}
|
|
63
|
+
if (profileId === INVOICE_RESPONSE_PROFILE_ID) {
|
|
64
|
+
return yield* decodeInvoiceResponse(parsed);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const rootNodes = Object.keys(parsed);
|
|
69
|
+
return yield* Effect.fail(new SchemaIssue.InvalidValue({ message: `Unsupported document type: ${rootNodes.join(',')}` }, value, options));
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @description Loose document object -> XML string. Mirrors {@link decodeDocumentXml} by dispatching on the decoded discriminant.
|
|
74
|
+
*/
|
|
75
|
+
const encodeDocumentXml = Effect.fn('encode-peppol-document-xml')(function* (value: PeppolDocumentObject, options: SchemaAST.ParseOptions) {
|
|
76
|
+
let content: unknown;
|
|
77
|
+
|
|
78
|
+
if (isPeppolInvoice(value) || Predicate.hasProperty(value, 'invoiceLines')) {
|
|
79
|
+
content = yield* encodeInvoice(value as never);
|
|
80
|
+
} else if (isPeppolCreditNote(value) || Predicate.hasProperty(value, 'creditNoteLines')) {
|
|
81
|
+
content = yield* encodeCreditNote(value as never);
|
|
82
|
+
} else if (isPeppolMessageLevelResponse(value) || value.profileId === MESSAGE_LEVEL_RESPONSE_PROFILE_ID) {
|
|
83
|
+
content = yield* encodeMessageLevelResponse(value as never);
|
|
84
|
+
} else if (isPeppolInvoiceResponse(value) || value.profileId === INVOICE_RESPONSE_PROFILE_ID) {
|
|
85
|
+
content = yield* encodeInvoiceResponse(value as never);
|
|
86
|
+
} else {
|
|
87
|
+
const rootNodes = Object.keys(value);
|
|
88
|
+
console.log(value, isPeppolInvoice(value), isPeppolCreditNote(value), isPeppolMessageLevelResponse(value), isPeppolInvoiceResponse(value));
|
|
89
|
+
return yield* Effect.fail(
|
|
90
|
+
new SchemaIssue.InvalidValue({ message: `Unsupported document type: ${value.profileId}\n${rootNodes.join(',')}` }, value, options)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return new XMLBuilder(builderOptions).build(content) as string;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @description Union of every supported PEPPOL business document. Members discriminate cleanly: invoice vs credit note via `invoiceLines`/`creditNoteLines`,
|
|
99
|
+
* message-level vs invoice response via the `profileId` literal.
|
|
100
|
+
*/
|
|
101
|
+
export const peppolDocumentSchema = peppolDocumentObjectSchema.pipe(
|
|
102
|
+
Schema.encodeTo(Schema.String, {
|
|
103
|
+
encode: SchemaGetter.transformEffect((value, options) => encodeDocumentXml(value, options)),
|
|
104
|
+
decode: SchemaGetter.transformEffect((value, options) => decodeDocumentXml(value, options)),
|
|
105
|
+
})
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
export type PeppolDocumentEncoded = Schema.Codec.Encoded<typeof peppolDocumentSchema>;
|
|
109
|
+
export type PeppolDocumentDecoded = Schema.Schema.Type<typeof peppolDocumentSchema>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @description This defines the types of documents that are sent/received through the peppol network.
|
|
113
|
+
*/
|
|
114
|
+
export type PeppolDocument = PeppolInvoice | PeppolCreditNote;
|
|
115
|
+
/**
|
|
116
|
+
* @description This defines the types of message that are sent/received through the peppol network.
|
|
117
|
+
*/
|
|
118
|
+
export type PeppolMessage = PeppolMessageLevelResponse | PeppolInvoiceResponse;
|
|
119
|
+
export type PeppolAllDocuments = PeppolDocument | PeppolMessage;
|
|
120
|
+
export type PeppolDocumentLine = PeppolInvoiceLine | PeppolCreditNoteLine;
|