@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
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
import type { PeppolMessageLevelResponseParty } from '#/schemas/message-level-response-party-schema';
|
|
3
|
+
import type { PeppolInvoiceDocumentResponseParty, PeppolInvoiceResponseParty } from '#/schemas/peppol-invoice-response-schema';
|
|
4
|
+
import type { PeppolMessageLevelResponseParty } from '#/schemas/peppol-message-level-response-party-schema';
|
|
5
5
|
|
|
6
6
|
import { encodeContact } from '#/decoders/fields/encode-contact';
|
|
7
7
|
import { encodeIdentifier } from '#/decoders/fields/encode-identifier';
|
|
8
8
|
import { encodePartyLegalEntity } from '#/decoders/fields/encode-party-legal-entity';
|
|
9
9
|
|
|
10
10
|
export const encodeMessageParty = Effect.fn(function* (
|
|
11
|
-
party?: PeppolMessageLevelResponseParty |
|
|
11
|
+
party?: PeppolMessageLevelResponseParty | PeppolInvoiceResponseParty | PeppolInvoiceDocumentResponseParty
|
|
12
12
|
) {
|
|
13
13
|
if (Predicate.isNullish(party)) return undefined;
|
|
14
14
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolOrderReference } from '#/schemas/fields/order-reference-schema';
|
|
3
|
+
import type { PeppolOrderReference } from '#/schemas/fields/peppol-order-reference-schema';
|
|
4
4
|
|
|
5
5
|
export const encodeOrderReference = Effect.fn(function* (orderReference: PeppolOrderReference | undefined) {
|
|
6
6
|
if (Predicate.isNullish(orderReference)) return undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
3
|
import type { XmlNode } from '#/helpers/get-prop';
|
|
4
|
-
import type { PeppolPartyTaxSchema } from '#/schemas/fields/party-tax-schema';
|
|
4
|
+
import type { PeppolPartyTaxSchema } from '#/schemas/fields/peppol-party-tax-scheme-schema';
|
|
5
5
|
|
|
6
6
|
import { encodePartyTaxScheme } from '#/decoders/fields/encode-party-tax-scheme';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
3
|
import type { XmlNode } from '#/helpers/get-prop';
|
|
4
|
-
import type { PeppolPartyTaxSchema } from '#/schemas/fields/party-tax-schema';
|
|
4
|
+
import type { PeppolPartyTaxSchema } from '#/schemas/fields/peppol-party-tax-scheme-schema';
|
|
5
5
|
|
|
6
6
|
import { encodeSimpleIdentifier } from '#/decoders/fields/encode-simple-identifier';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolPartySchema } from '#/schemas/fields/party-base-schema';
|
|
3
|
+
import type { PeppolPartySchema } from '#/schemas/fields/peppol-party-base-schema';
|
|
4
4
|
|
|
5
5
|
import { encodeAddress } from '#/decoders/fields/encode-address';
|
|
6
6
|
import { encodeContact } from '#/decoders/fields/encode-contact';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolPayeeParty } from '#/schemas/fields/payee-party';
|
|
3
|
+
import type { PeppolPayeeParty } from '#/schemas/fields/peppol-payee-party-schema';
|
|
4
4
|
|
|
5
5
|
import { encodeIdentifier } from '#/decoders/fields/encode-identifier';
|
|
6
6
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolPaymentMeans } from '#/schemas/fields/payment-means-schema';
|
|
3
|
+
import type { PeppolPaymentMeans } from '#/schemas/fields/peppol-payment-means-schema';
|
|
4
4
|
|
|
5
5
|
import { encodeSimpleIdentifier } from '#/decoders/fields/encode-simple-identifier';
|
|
6
6
|
|
|
7
|
-
export const encodePaymentMeans = Effect.fn(function* (pms:
|
|
7
|
+
export const encodePaymentMeans = Effect.fn(function* (pms: ReadonlyArray<PeppolPaymentMeans> | undefined) {
|
|
8
8
|
if (Predicate.isNullish(pms)) return undefined;
|
|
9
9
|
|
|
10
10
|
return yield* Effect.forEach(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolPaymentTerms } from '#/schemas/fields/payment-terms-schema';
|
|
3
|
+
import type { PeppolPaymentTerms } from '#/schemas/fields/peppol-payment-terms-schema';
|
|
4
4
|
|
|
5
5
|
export const encodePaymentTerms = Effect.fn(function* (paymentTerms: PeppolPaymentTerms | undefined) {
|
|
6
6
|
if (Predicate.isNullish(paymentTerms)) return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolLinePriceAllowanceCharge } from '#/schemas/fields/line-price-allowance-charge-schema';
|
|
3
|
+
import type { PeppolLinePriceAllowanceCharge } from '#/schemas/fields/peppol-line-price-allowance-charge-schema';
|
|
4
4
|
|
|
5
5
|
import { encodeAmount } from '#/decoders/fields/encode-amount';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolQuantity } from '#/schemas/fields/quantity-schema';
|
|
3
|
+
import type { PeppolQuantity } from '#/schemas/fields/peppol-quantity-schema';
|
|
4
4
|
|
|
5
5
|
export const encodeQuantity = Effect.fn(function* (quantity?: PeppolQuantity) {
|
|
6
6
|
if (Predicate.isNullish(quantity)) return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolAllowanceCharge } from '#/schemas/fields/allowance-charge-schema';
|
|
3
|
+
import type { PeppolAllowanceCharge } from '#/schemas/fields/peppol-allowance-charge-schema';
|
|
4
4
|
|
|
5
5
|
import { encodeSimpleIdentifier } from '#/decoders/fields/encode-simple-identifier';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
3
|
import type { XmlNode } from '#/helpers/get-prop';
|
|
4
|
-
import type { PeppolTaxRepresentativeParty } from '#/schemas/fields/tax-representative-
|
|
4
|
+
import type { PeppolTaxRepresentativeParty } from '#/schemas/fields/peppol-tax-representative-schema';
|
|
5
5
|
|
|
6
6
|
import { encodeAddress } from '#/decoders/fields/encode-address';
|
|
7
7
|
import { encodePartyTaxScheme } from '#/decoders/fields/encode-party-tax-scheme';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import type { PeppolTaxSubTotal } from '#/schemas/fields/tax-subtotal-schema';
|
|
4
|
-
import type { PeppolTaxTotal } from '#/schemas/fields/tax-totals';
|
|
3
|
+
import type { PeppolTaxSubTotal } from '#/schemas/fields/peppol-tax-subtotal-schema';
|
|
4
|
+
import type { PeppolTaxTotal } from '#/schemas/fields/peppol-tax-totals-base-schema';
|
|
5
5
|
|
|
6
6
|
import { encodeAmount } from '#/decoders/fields/encode-amount';
|
|
7
7
|
import { encodeSimpleIdentifier } from '#/decoders/fields/encode-simple-identifier';
|
|
8
8
|
|
|
9
|
-
export const encodeTaxTotals = Effect.fn(function* (taxTotals:
|
|
9
|
+
export const encodeTaxTotals = Effect.fn(function* (taxTotals: ReadonlyArray<PeppolTaxTotal>) {
|
|
10
10
|
return yield* Effect.forEach(
|
|
11
11
|
taxTotals,
|
|
12
12
|
Effect.fn(function* (taxTotal: PeppolTaxTotal) {
|
|
@@ -15,7 +15,7 @@ export const encodeTaxTotals = Effect.fn(function* (taxTotals: Array<PeppolTaxTo
|
|
|
15
15
|
);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const encodeTaxSubtotals = Effect.fn(function* (taxSubtotals:
|
|
18
|
+
const encodeTaxSubtotals = Effect.fn(function* (taxSubtotals: ReadonlyArray<PeppolTaxSubTotal> | undefined) {
|
|
19
19
|
if (Predicate.isNullish(taxSubtotals)) return undefined;
|
|
20
20
|
|
|
21
21
|
return yield* Effect.forEach(
|
package/src/helpers/bool.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { Effect, Predicate } from 'effect';
|
|
1
|
+
import { Effect, Predicate, SchemaIssue } from 'effect';
|
|
2
2
|
|
|
3
3
|
import type { XmlNode } from '#/helpers/get-prop';
|
|
4
4
|
|
|
5
|
-
import { PeppolNodeError } from '#/helpers/errors';
|
|
6
5
|
import { getProp } from '#/helpers/get-prop';
|
|
7
|
-
import { isDefined } from '#/helpers/is-defined';
|
|
8
6
|
|
|
9
|
-
export const bool = Effect.fn(function* <const T extends boolean = boolean>(
|
|
10
|
-
node
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
7
|
+
export const bool = Effect.fn(function* <const T extends boolean = boolean>(node: XmlNode, ...path: Array<string>) {
|
|
8
|
+
const val = yield* getProp(node, ...path).pipe(
|
|
9
|
+
Effect.filterOrFail(
|
|
10
|
+
val => Predicate.isNotNullish(val),
|
|
11
|
+
() => new SchemaIssue.MissingKey({ message: `Unable to find ${path.join('->')} into ${node}` })
|
|
12
|
+
)
|
|
13
|
+
);
|
|
17
14
|
if (Predicate.isBoolean(val)) return val as T;
|
|
18
15
|
if (Predicate.isObject(val) && Predicate.hasProperty(val, '#text') && Predicate.isNotUndefined(val['#text'])) return val['#text'] as T;
|
|
19
|
-
return yield* new
|
|
16
|
+
return yield* Effect.fail(new SchemaIssue.MissingKey({ message: `Unable to find ${path.join('->')} into ${node}` }));
|
|
20
17
|
});
|
package/src/helpers/get-prop.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Effect, Predicate } from 'effect';
|
|
2
2
|
|
|
3
|
-
import { isDefined } from '#/helpers/is-defined';
|
|
4
|
-
|
|
5
3
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
6
4
|
export type XmlNode = any;
|
|
7
5
|
|
|
@@ -15,14 +13,14 @@ export const getProp = Effect.fn(function* (node: XmlNode, ...path: Array<string
|
|
|
15
13
|
let currentNode = node;
|
|
16
14
|
for (const key of path) {
|
|
17
15
|
const newNode = currentNode[key];
|
|
18
|
-
if (
|
|
16
|
+
if (Predicate.isNotNullish(newNode)) {
|
|
19
17
|
currentNode = newNode;
|
|
20
18
|
continue;
|
|
21
19
|
}
|
|
22
20
|
if (key.includes(':')) {
|
|
23
21
|
const [, localKey] = key.split(':') as [string, string, ...Array<string>];
|
|
24
22
|
currentNode = currentNode[localKey];
|
|
25
|
-
if (
|
|
23
|
+
if (Predicate.isNullish(currentNode)) {
|
|
26
24
|
return undefined;
|
|
27
25
|
}
|
|
28
26
|
} else {
|
|
@@ -3,15 +3,14 @@ import { Effect, Predicate } from 'effect';
|
|
|
3
3
|
import type { XmlNode } from '#/helpers/get-prop';
|
|
4
4
|
|
|
5
5
|
import { getProp } from '#/helpers/get-prop';
|
|
6
|
-
import { isDefined } from '#/helpers/is-defined';
|
|
7
6
|
|
|
8
|
-
export const strOrUnd = Effect.fn(function* <const T extends string = string>(
|
|
7
|
+
export const strOrUnd = Effect.fn('str-or-und')(function* <const T extends string = string>(
|
|
9
8
|
node: XmlNode,
|
|
10
9
|
...path: Array<string>
|
|
11
10
|
): Effect.fn.Return<T | undefined> {
|
|
12
11
|
const val = yield* getProp(node, ...path);
|
|
13
|
-
if (
|
|
14
|
-
if (!Predicate.isObject(val)) return val.toString();
|
|
12
|
+
if (Predicate.isNullish(val)) return undefined;
|
|
13
|
+
if (!Predicate.isObject(val)) return (val as { toString(): T }).toString();
|
|
15
14
|
const raw = val as XmlNode;
|
|
16
15
|
if (Predicate.isUndefined(raw['#text'])) return undefined;
|
|
17
16
|
return raw['#text'].toString();
|
package/src/helpers/str.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { Effect, Predicate } from 'effect';
|
|
1
|
+
import { Effect, Predicate, SchemaIssue } from 'effect';
|
|
2
2
|
|
|
3
3
|
import type { XmlNode } from '#/helpers/get-prop';
|
|
4
4
|
|
|
5
|
-
import { PeppolNodeError } from '#/helpers/errors';
|
|
6
5
|
import { strOrUnd } from '#/helpers/str-or-und';
|
|
7
6
|
|
|
8
|
-
export const str = Effect.fn(function* (node: XmlNode, ...path: Array<string>)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
export const str = Effect.fn(function* (node: XmlNode, ...path: Array<string>) {
|
|
8
|
+
return yield* strOrUnd(node, ...path).pipe(
|
|
9
|
+
Effect.filterOrFail(
|
|
10
|
+
val => Predicate.isNotNullish(val),
|
|
11
|
+
() => new SchemaIssue.MissingKey({ message: `Unable to find ${path.join('->')} into ${node}` })
|
|
12
|
+
),
|
|
13
|
+
Effect.filterOrFail(
|
|
14
|
+
val => Predicate.isString(val),
|
|
15
|
+
() => new SchemaIssue.InvalidValue({ message: `Invalid node ${path.join('->')} into ${node}` })
|
|
16
|
+
)
|
|
17
|
+
);
|
|
14
18
|
});
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './schemas';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
1
|
+
export * from './schemas/peppol-iso-date-string';
|
|
2
|
+
export * from './schemas/peppol-billing-base-schema';
|
|
3
|
+
export * from './schemas/peppol-invoice-schema';
|
|
4
|
+
export * from './schemas/peppol-credit-note-schema';
|
|
5
|
+
export * from './schemas/peppol-message-level-response-party-schema';
|
|
6
|
+
export * from './schemas/peppol-document-response-document-reference-schema';
|
|
7
|
+
export * from './schemas/peppol-document-response-document-schema';
|
|
8
|
+
export * from './schemas/peppol-document-response-line-response-content-schema';
|
|
9
|
+
export * from './schemas/peppol-document-response-line-response-schema';
|
|
10
|
+
export * from './schemas/peppol-message-level-response-document-response-schema';
|
|
11
|
+
export * from './schemas/peppol-message-level-response-schema';
|
|
12
|
+
export * from './schemas/peppol-invoice-response-status-reason-code-schema';
|
|
13
|
+
export * from './schemas/peppol-invoice-response-document-actual-response-status-schema';
|
|
14
|
+
export * from './schemas/peppol-invoice-response-document-actual-response-schema';
|
|
15
|
+
export * from './schemas/peppol-invoice-response-schema';
|
|
16
|
+
export * from './schemas/peppol-document-schema';
|
|
17
|
+
|
|
18
|
+
export * from './schemas/fields/peppol-additional-document-reference-schema';
|
|
19
|
+
export * from './schemas/fields/peppol-address-schema';
|
|
20
|
+
export * from './schemas/fields/peppol-allowance-charge-schema';
|
|
21
|
+
export * from './schemas/fields/peppol-amount-schema';
|
|
22
|
+
export * from './schemas/fields/peppol-base-line-schema';
|
|
23
|
+
export * from './schemas/fields/peppol-billing-reference-schema';
|
|
24
|
+
export * from './schemas/fields/peppol-binary-object-schema';
|
|
25
|
+
export * from './schemas/fields/peppol-contact-schema';
|
|
26
|
+
export * from './schemas/fields/peppol-credit-note-line-schema';
|
|
27
|
+
export * from './schemas/fields/default-customization-id';
|
|
28
|
+
export * from './schemas/fields/default-profile-id';
|
|
29
|
+
export * from './schemas/fields/peppol-delivery-schema';
|
|
30
|
+
export * from './schemas/fields/peppol-identifier-schema';
|
|
31
|
+
export * from './schemas/fields/peppol-invoice-line-period-schema';
|
|
32
|
+
export * from './schemas/fields/peppol-invoice-line-schema';
|
|
33
|
+
export * from './schemas/fields/peppol-invoice-period-schema';
|
|
34
|
+
export * from './schemas/fields/peppol-legal-monetary-total-schema';
|
|
35
|
+
export * from './schemas/fields/peppol-line-allowance-charge-schema';
|
|
36
|
+
export * from './schemas/fields/peppol-line-item-schema';
|
|
37
|
+
export * from './schemas/fields/peppol-line-price-allowance-charge-schema';
|
|
38
|
+
export * from './schemas/fields/peppol-item-classification-schema';
|
|
39
|
+
export * from './schemas/fields/peppol-order-reference-schema';
|
|
40
|
+
export * from './schemas/fields/peppol-party-base-schema';
|
|
41
|
+
export * from './schemas/fields/peppol-party-legal-entity-schema';
|
|
42
|
+
export * from './schemas/fields/peppol-party-tax-scheme-schema';
|
|
43
|
+
export * from './schemas/fields/peppol-payee-party-schema';
|
|
44
|
+
export * from './schemas/fields/peppol-payment-means-schema';
|
|
45
|
+
export * from './schemas/fields/peppol-payment-terms-schema';
|
|
46
|
+
export * from './schemas/fields/peppol-line-price-schema';
|
|
47
|
+
export * from './schemas/fields/peppol-quantity-schema';
|
|
48
|
+
export * from './schemas/fields/peppol-reference-schema';
|
|
49
|
+
export * from './schemas/fields/peppol-tax-category-schema';
|
|
50
|
+
export * from './schemas/fields/peppol-tax-representative-schema';
|
|
51
|
+
export * from './schemas/fields/peppol-tax-subtotal-category-schema';
|
|
52
|
+
export * from './schemas/fields/peppol-tax-subtotal-schema';
|
|
53
|
+
export * from './schemas/fields/peppol-tax-totals-base-schema';
|
|
54
|
+
|
|
55
|
+
export * from './schemas/utils/index';
|
|
56
|
+
export * from './schemas/values/index';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { PeppolBinaryObject } from '#/schemas/fields/peppol-binary-object-schema';
|
|
4
|
+
import { PeppolIdentifier } from '#/schemas/fields/peppol-identifier-schema';
|
|
5
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
6
|
+
import { additionalDocumentReferenceCodeSchema } from '#/schemas/values/additional-document-reference-code-schema';
|
|
7
|
+
|
|
8
|
+
class PeppolAttachmentExternalReference extends opaque<PeppolAttachmentExternalReference>()(
|
|
9
|
+
Schema.Struct({
|
|
10
|
+
/**
|
|
11
|
+
* @description The URL (Uniform Resource Locator) that identifies where the external document is located. A means of locating the resource, including its
|
|
12
|
+
* primary access mechanism, e.g. http:// or ftp://.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* `http://www.example.com/index.html`;
|
|
16
|
+
*
|
|
17
|
+
* @summary External document location
|
|
18
|
+
*
|
|
19
|
+
* @name `cbc:URI`
|
|
20
|
+
*/
|
|
21
|
+
uri: Schema.String,
|
|
22
|
+
})
|
|
23
|
+
) {}
|
|
24
|
+
|
|
25
|
+
class PeppolAttachment extends opaque<PeppolAttachment>()(
|
|
26
|
+
Schema.Struct({
|
|
27
|
+
/**
|
|
28
|
+
* @description An attached document embedded as binary object (Base64) or sent together with the invoice.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```base64
|
|
32
|
+
* aHR0cHM6Ly90ZXN0LXZlZmEuZGlmaS5uby9wZXBwb2xiaXMvcG9hY2MvYmlsbGluZy8zLjAvYmlzLw==
|
|
33
|
+
* ```;
|
|
34
|
+
*
|
|
35
|
+
* @summary Attached document
|
|
36
|
+
*
|
|
37
|
+
* @name `cbc:EmbeddedDocumentBinaryObject`
|
|
38
|
+
*/
|
|
39
|
+
embeddedDocumentBinaryObject: Schema.optional(PeppolBinaryObject),
|
|
40
|
+
/**
|
|
41
|
+
* @summary EXTERNAL REFERENCE
|
|
42
|
+
*
|
|
43
|
+
* @name `cac:ExternalReference`
|
|
44
|
+
*/
|
|
45
|
+
externalReference: Schema.optional(PeppolAttachmentExternalReference),
|
|
46
|
+
})
|
|
47
|
+
) {}
|
|
48
|
+
|
|
49
|
+
class PeppolId extends opaque<PeppolId>()(
|
|
50
|
+
Schema.Struct({
|
|
51
|
+
/**
|
|
52
|
+
* @description An identifier for an object on which the invoice is based (with DocumentTypeCode=130), given by the Seller, the identifier for the supporting
|
|
53
|
+
* document or the project reference identifier (DocumentTypeCode=50).
|
|
54
|
+
*
|
|
55
|
+
* @summary Invoiced object identifier, Supporting document reference or project reference
|
|
56
|
+
*
|
|
57
|
+
* @name `#text`
|
|
58
|
+
*/
|
|
59
|
+
id: Schema.String,
|
|
60
|
+
/**
|
|
61
|
+
* @description The identification scheme identifier of the Invoiced object identifier.
|
|
62
|
+
*
|
|
63
|
+
* @summary Scheme identifier
|
|
64
|
+
*
|
|
65
|
+
* @name `@schemeID`
|
|
66
|
+
*/
|
|
67
|
+
schemeId: Schema.optional(additionalDocumentReferenceCodeSchema),
|
|
68
|
+
})
|
|
69
|
+
) {}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @description A group of business terms providing information about additional supporting documents substantiating the claims made in the Invoice. The additional
|
|
73
|
+
* supporting documents can be used for both referencing a document number which is expected to be known by the receiver, an external document
|
|
74
|
+
* (referenced by a URL) or as an embedded document, Base64 encoded (such as a time report).
|
|
75
|
+
*
|
|
76
|
+
* @summary ADDITIONAL SUPPORTING DOCUMENTS
|
|
77
|
+
*
|
|
78
|
+
* @name `cac:AdditionalDocumentReference`
|
|
79
|
+
*/
|
|
80
|
+
export class PeppolAdditionalDocumentReference extends opaque<PeppolAdditionalDocumentReference>()(
|
|
81
|
+
PeppolIdentifier.pipe(
|
|
82
|
+
Schema.fieldsAssign({
|
|
83
|
+
/**
|
|
84
|
+
* @description An identifier for an object on which the invoice is based (with DocumentTypeCode=130), given by the Seller, the identifier for the supporting
|
|
85
|
+
* document or the project reference identifier (DocumentTypeCode=50).
|
|
86
|
+
*
|
|
87
|
+
* @summary Invoiced object identifier, Supporting document reference or project reference
|
|
88
|
+
*
|
|
89
|
+
* @name `cbc:ID`
|
|
90
|
+
*/
|
|
91
|
+
id: PeppolId,
|
|
92
|
+
/**
|
|
93
|
+
* @remarks
|
|
94
|
+
* Code "130" MUST be used to indicate an invoice object reference and code "50" for project reference. Element is not used for other
|
|
95
|
+
* additional documents.
|
|
96
|
+
*
|
|
97
|
+
* @default 130
|
|
98
|
+
*
|
|
99
|
+
* @summary Document type code
|
|
100
|
+
*
|
|
101
|
+
* @name `cbc:DocumentTypeCode`
|
|
102
|
+
*/
|
|
103
|
+
documentTypeCode: Schema.optional(Schema.String),
|
|
104
|
+
/**
|
|
105
|
+
* @description A description of the supporting document, such as timesheet, usage report, etc.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* Time list
|
|
109
|
+
*
|
|
110
|
+
* @summary Supporting document description
|
|
111
|
+
*
|
|
112
|
+
* @name `cbc:DocumentDescription`
|
|
113
|
+
*/
|
|
114
|
+
documentDescription: Schema.optional(Schema.String),
|
|
115
|
+
/**
|
|
116
|
+
* @summary Attachment
|
|
117
|
+
*
|
|
118
|
+
* @name `cac:Attachment`
|
|
119
|
+
*/
|
|
120
|
+
attachment: Schema.optional(PeppolAttachment),
|
|
121
|
+
})
|
|
122
|
+
)
|
|
123
|
+
) {}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
4
|
+
import { peppolCountryCodeSchema } from '#/schemas/values/peppol-country-code-schema';
|
|
5
|
+
|
|
6
|
+
class PeppolAddressLine extends opaque<PeppolAddressLine>()(
|
|
7
|
+
Schema.Struct({
|
|
8
|
+
/**
|
|
9
|
+
* @description An additional address line in an address that can be used to give further details supplementing the main line.
|
|
10
|
+
*
|
|
11
|
+
* @summary Address line 3
|
|
12
|
+
*
|
|
13
|
+
* @name `cbc:Line`
|
|
14
|
+
*/
|
|
15
|
+
line: Schema.String,
|
|
16
|
+
})
|
|
17
|
+
) {}
|
|
18
|
+
|
|
19
|
+
class PeppolCountryCode extends opaque<PeppolCountryCode>()(
|
|
20
|
+
Schema.Struct({
|
|
21
|
+
/**
|
|
22
|
+
* @description A code that identifies the country.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* GB;
|
|
26
|
+
*
|
|
27
|
+
* @summary Country code
|
|
28
|
+
*
|
|
29
|
+
* @name `cbc:IdentificationCode`
|
|
30
|
+
*/
|
|
31
|
+
identificationCode: peppolCountryCodeSchema,
|
|
32
|
+
})
|
|
33
|
+
) {}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @summary Postal address
|
|
37
|
+
*
|
|
38
|
+
* @name `cac:PostalAddress`
|
|
39
|
+
*/
|
|
40
|
+
export class PeppolAddress extends opaque<PeppolAddress>()(
|
|
41
|
+
Schema.Struct({
|
|
42
|
+
/**
|
|
43
|
+
* @description The main address line in an address.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* Main Street 1
|
|
47
|
+
*
|
|
48
|
+
* @summary Address line 1
|
|
49
|
+
*
|
|
50
|
+
* @name `cbc:StreetName`
|
|
51
|
+
*/
|
|
52
|
+
streetName: Schema.optional(Schema.String),
|
|
53
|
+
/**
|
|
54
|
+
* @description An additional address line in an address that can be used to give further details supplementing the main line.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* Po Box 351
|
|
58
|
+
*
|
|
59
|
+
* @summary Address line 2
|
|
60
|
+
*
|
|
61
|
+
* @name `cbc:AdditionalStreetName`
|
|
62
|
+
*/
|
|
63
|
+
additionalStreetName: Schema.optional(Schema.String),
|
|
64
|
+
/**
|
|
65
|
+
* @description The common name of the city, town or village, where the address is located.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* London;
|
|
69
|
+
*
|
|
70
|
+
* @summary Seller city
|
|
71
|
+
*
|
|
72
|
+
* @name `cbc:CityName`
|
|
73
|
+
*/
|
|
74
|
+
cityName: Schema.optional(Schema.String),
|
|
75
|
+
/**
|
|
76
|
+
* @description The identifier for an addressable group of properties according to the relevant postal service.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* W1G 8LZ
|
|
80
|
+
*
|
|
81
|
+
* @summary post code
|
|
82
|
+
*
|
|
83
|
+
* @name `cbc:PostalZone`
|
|
84
|
+
*/
|
|
85
|
+
postalZone: Schema.optional(Schema.String),
|
|
86
|
+
/**
|
|
87
|
+
* @description The subdivision of a country.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* Region A
|
|
91
|
+
*
|
|
92
|
+
* @summary Seller country subdivision
|
|
93
|
+
*
|
|
94
|
+
* @name `cbc:CountrySubentity`
|
|
95
|
+
*/
|
|
96
|
+
countrySubentity: Schema.optional(Schema.String),
|
|
97
|
+
/**
|
|
98
|
+
* @example
|
|
99
|
+
* GB;
|
|
100
|
+
*
|
|
101
|
+
* @name `cac:Country`
|
|
102
|
+
*/
|
|
103
|
+
countryCode: PeppolCountryCode,
|
|
104
|
+
/**
|
|
105
|
+
* @example
|
|
106
|
+
* Building 23
|
|
107
|
+
*
|
|
108
|
+
* @name `cac:AddressLine`
|
|
109
|
+
*/
|
|
110
|
+
addressLine: Schema.optional(PeppolAddressLine),
|
|
111
|
+
})
|
|
112
|
+
) {}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Effect, Schema } from 'effect';
|
|
2
|
+
|
|
3
|
+
import { BaseLineAllowanceCharge } from '#/schemas/fields/peppol-line-allowance-charge-schema';
|
|
4
|
+
import { PeppolTaxCategory } from '#/schemas/fields/peppol-tax-category-schema';
|
|
5
|
+
import { opaque } from '#/schemas/utils/opaque';
|
|
6
|
+
import { allowanceChargeReasonCodeSchema } from '#/schemas/values/allowance-charge-reason-code-schema';
|
|
7
|
+
import { chargeReasonCodeSchema } from '#/schemas/values/charge-reason-code-schema';
|
|
8
|
+
import { peppolDutyTaxFeeCategorySchema } from '#/schemas/values/duty-tax-fee-category-schema';
|
|
9
|
+
|
|
10
|
+
export class PeppolTaxCategoryTaxSchemeId extends opaque<PeppolTaxCategoryTaxSchemeId>()(
|
|
11
|
+
Schema.Struct({
|
|
12
|
+
/**
|
|
13
|
+
* @description Mandatory element. Use "VAT"
|
|
14
|
+
*
|
|
15
|
+
* @name `cbc:ID`
|
|
16
|
+
*/
|
|
17
|
+
id: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed('VAT'))),
|
|
18
|
+
})
|
|
19
|
+
) {}
|
|
20
|
+
|
|
21
|
+
export class BaseAllowanceCharge extends opaque<BaseAllowanceCharge>()(
|
|
22
|
+
Schema.Struct({
|
|
23
|
+
...BaseLineAllowanceCharge.fields,
|
|
24
|
+
/**
|
|
25
|
+
* @summary TAX CATEGORY
|
|
26
|
+
*
|
|
27
|
+
* @name cac:TaxCategory
|
|
28
|
+
*/
|
|
29
|
+
taxCategory: Schema.optional(
|
|
30
|
+
PeppolTaxCategory.pipe(
|
|
31
|
+
Schema.fieldsAssign({
|
|
32
|
+
/**
|
|
33
|
+
* @description A coded identification of what VAT category applies to the document level allowance or charge.
|
|
34
|
+
*
|
|
35
|
+
* @summary Document level allowance or charge VAT category code
|
|
36
|
+
*
|
|
37
|
+
* @name `cbc:ID`
|
|
38
|
+
*/
|
|
39
|
+
id: peppolDutyTaxFeeCategorySchema,
|
|
40
|
+
/**
|
|
41
|
+
* @description The VAT rate, represented as percentage that applies to the document level allowance or charge.
|
|
42
|
+
*
|
|
43
|
+
* @summary Document level allowance or charge VAT rate
|
|
44
|
+
*
|
|
45
|
+
* @name `cbc:Percent`
|
|
46
|
+
*/
|
|
47
|
+
percent: Schema.optional(Schema.Finite),
|
|
48
|
+
/**
|
|
49
|
+
* @default VAT
|
|
50
|
+
*
|
|
51
|
+
* @name `cac:TaxScheme`
|
|
52
|
+
*/
|
|
53
|
+
taxSchemeId: PeppolTaxCategoryTaxSchemeId,
|
|
54
|
+
})
|
|
55
|
+
)
|
|
56
|
+
),
|
|
57
|
+
})
|
|
58
|
+
) {}
|
|
59
|
+
|
|
60
|
+
export class PeppolAllowance extends opaque<PeppolAllowance>()(
|
|
61
|
+
Schema.Struct({
|
|
62
|
+
...BaseAllowanceCharge.fields,
|
|
63
|
+
/**
|
|
64
|
+
* @name cbc:AllowanceChargeReasonCode
|
|
65
|
+
*/
|
|
66
|
+
allowanceChargeReasonCode: Schema.optional(allowanceChargeReasonCodeSchema),
|
|
67
|
+
/**
|
|
68
|
+
* @name cbc:ChargeIndicator
|
|
69
|
+
*
|
|
70
|
+
* @value `false`
|
|
71
|
+
*/
|
|
72
|
+
chargeIndicator: Schema.Literal(false).annotate({
|
|
73
|
+
message: "PEPPOL-EN16931-R043: Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'",
|
|
74
|
+
}),
|
|
75
|
+
})
|
|
76
|
+
) {}
|
|
77
|
+
|
|
78
|
+
export class PeppolCharge extends opaque<PeppolCharge>()(
|
|
79
|
+
Schema.Struct({
|
|
80
|
+
...BaseAllowanceCharge.fields,
|
|
81
|
+
/**
|
|
82
|
+
* @name cbc:AllowanceChargeReasonCode
|
|
83
|
+
*/
|
|
84
|
+
allowanceChargeReasonCode: Schema.optional(chargeReasonCodeSchema),
|
|
85
|
+
/**
|
|
86
|
+
* @name cbc:ChargeIndicator
|
|
87
|
+
*
|
|
88
|
+
* @value `true`
|
|
89
|
+
*/
|
|
90
|
+
chargeIndicator: Schema.Literal(true).annotate({
|
|
91
|
+
message: "PEPPOL-EN16931-R043: Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'",
|
|
92
|
+
}),
|
|
93
|
+
})
|
|
94
|
+
) {}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @summary Allowance/Charge
|
|
98
|
+
*
|
|
99
|
+
* @name cac:AllowanceCharge
|
|
100
|
+
*/
|
|
101
|
+
export const peppolAllowanceChargeSchema = Schema.Union([PeppolAllowance, PeppolCharge]).annotate({ message: 'unable to decode allowance charge' });
|
|
102
|
+
|
|
103
|
+
export type PeppolAllowanceCharge = Schema.Schema.Type<typeof peppolAllowanceChargeSchema>;
|
|
104
|
+
export type PeppolAllowanceChargeEncoded = Schema.Codec.Encoded<typeof peppolAllowanceChargeSchema>;
|