@endevops/peppol-schema 0.1.0-beta.3 → 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.
Files changed (751) hide show
  1. package/README.md +9 -6
  2. package/dist/constants.d.ts +51 -0
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/constants.js +48 -0
  5. package/dist/constants.js.map +1 -0
  6. package/dist/eas-codes.generated-D8jjHFij.js.map +1 -1
  7. package/dist/index-CfjMSrpQ.d.ts +3508 -0
  8. package/dist/index-CfjMSrpQ.d.ts.map +1 -0
  9. package/dist/index.d.ts +2 -2613
  10. package/dist/index.js +3121 -1563
  11. package/dist/index.js.map +1 -1
  12. package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js +18 -0
  13. package/dist/invoice-response-code-not-needs-schema-p_RKKNLc.js.map +1 -0
  14. package/dist/invoice-response-codes.d.ts +11 -0
  15. package/dist/invoice-response-codes.d.ts.map +1 -0
  16. package/dist/invoice-response-codes.js +32 -0
  17. package/dist/invoice-response-codes.js.map +1 -0
  18. package/dist/invoice-status-codes.generated-DL-agLdx.d.ts +24 -0
  19. package/dist/invoice-status-codes.generated-DL-agLdx.d.ts.map +1 -0
  20. package/dist/message-level-response-profile-id-DBpOW91B.js +9 -0
  21. package/dist/message-level-response-profile-id-DBpOW91B.js.map +1 -0
  22. package/dist/peppol-iso-date-string-BXLxzxdz.js +30 -0
  23. package/dist/peppol-iso-date-string-BXLxzxdz.js.map +1 -0
  24. package/dist/schematron.d.ts +408 -365
  25. package/dist/schematron.d.ts.map +1 -1
  26. package/dist/schematron.js +1975 -1501
  27. package/dist/schematron.js.map +1 -1
  28. package/dist/values.d.ts +95 -13218
  29. package/dist/values.d.ts.map +1 -1
  30. package/dist/values.js +1 -1
  31. package/dist/vat-dates.generated-CxFvt7m3.d.ts +68 -0
  32. package/dist/vat-dates.generated-CxFvt7m3.d.ts.map +1 -0
  33. package/dist/{vatex-codes.generated-BSgP3n5t.js → vatex-codes.generated-N7wsUrLh.js} +8 -9
  34. package/dist/vatex-codes.generated-N7wsUrLh.js.map +1 -0
  35. package/package.json +16 -18
  36. package/src/constants/transport-profile.ts +5 -1
  37. package/src/decoders/decode-billing.ts +1 -1
  38. package/src/decoders/decode-credit-note.ts +2 -4
  39. package/src/decoders/decode-invoice-response.ts +15 -37
  40. package/src/decoders/decode-invoice.ts +2 -4
  41. package/src/decoders/decode-message-level-response.ts +21 -48
  42. package/src/decoders/encode-credit-note.ts +1 -1
  43. package/src/decoders/encode-invoice-response.ts +7 -4
  44. package/src/decoders/encode-invoice.ts +1 -1
  45. package/src/decoders/encode-message-level-response.ts +4 -10
  46. package/src/decoders/fields/decode-additional-document-references.ts +1 -1
  47. package/src/decoders/fields/decode-address.ts +1 -1
  48. package/src/decoders/fields/decode-allowance-charges.ts +7 -15
  49. package/src/decoders/fields/decode-amount.ts +2 -2
  50. package/src/decoders/fields/decode-application-response.ts +21 -0
  51. package/src/decoders/fields/decode-billing-references.ts +1 -1
  52. package/src/decoders/fields/decode-contact.ts +1 -1
  53. package/src/decoders/fields/decode-credit-note-lines.ts +7 -15
  54. package/src/decoders/fields/decode-delivery.ts +1 -1
  55. package/src/decoders/fields/decode-electronic-address.ts +1 -1
  56. package/src/decoders/fields/decode-identifier.ts +1 -1
  57. package/src/decoders/fields/decode-invoice-line-period.ts +1 -1
  58. package/src/decoders/fields/decode-invoice-lines.ts +6 -14
  59. package/src/decoders/fields/decode-invoice-message-document-party.ts +2 -2
  60. package/src/decoders/fields/decode-invoice-message-party.ts +1 -6
  61. package/src/decoders/fields/decode-invoice-period.ts +7 -13
  62. package/src/decoders/fields/decode-legal-monetary-total.ts +1 -1
  63. package/src/decoders/fields/decode-line-allowance-charges.ts +7 -14
  64. package/src/decoders/fields/decode-line-price.ts +1 -7
  65. package/src/decoders/fields/decode-line-shared.ts +2 -4
  66. package/src/decoders/fields/decode-message-level-party.ts +1 -1
  67. package/src/decoders/fields/decode-node-list.ts +15 -0
  68. package/src/decoders/fields/decode-order-reference.ts +1 -1
  69. package/src/decoders/fields/decode-parties-tax-scheme.ts +1 -1
  70. package/src/decoders/fields/decode-party-legal-entity.ts +1 -1
  71. package/src/decoders/fields/decode-party-tax-scheme.ts +1 -1
  72. package/src/decoders/fields/decode-party.ts +3 -14
  73. package/src/decoders/fields/decode-payee-party.ts +1 -1
  74. package/src/decoders/fields/decode-payment-means.ts +2 -2
  75. package/src/decoders/fields/decode-payment-terms.ts +1 -1
  76. package/src/decoders/fields/decode-price-allowance-charge.ts +1 -7
  77. package/src/decoders/fields/decode-quantity.ts +1 -6
  78. package/src/decoders/fields/decode-simple-identifier.ts +1 -1
  79. package/src/decoders/fields/decode-tax-category.ts +1 -1
  80. package/src/decoders/fields/decode-tax-representative-party.ts +1 -1
  81. package/src/decoders/fields/decode-tax-totals.ts +2 -2
  82. package/src/decoders/fields/encode-additional-document-references.ts +3 -2
  83. package/src/decoders/fields/encode-address.ts +1 -1
  84. package/src/decoders/fields/encode-allowance-charges.ts +3 -2
  85. package/src/decoders/fields/encode-amount.ts +1 -1
  86. package/src/decoders/fields/encode-billing-references.ts +2 -2
  87. package/src/decoders/fields/encode-contact.ts +1 -1
  88. package/src/decoders/fields/encode-credit-note-lines.ts +2 -2
  89. package/src/decoders/fields/encode-delivery.ts +1 -1
  90. package/src/decoders/fields/encode-identifier.ts +1 -1
  91. package/src/decoders/fields/encode-invoice-line-period.ts +1 -1
  92. package/src/decoders/fields/encode-invoice-lines.ts +2 -2
  93. package/src/decoders/fields/encode-invoice-period.ts +1 -1
  94. package/src/decoders/fields/encode-legal-monetary-total.ts +1 -1
  95. package/src/decoders/fields/encode-line-allowance-charges.ts +2 -2
  96. package/src/decoders/fields/encode-line-price.ts +1 -1
  97. package/src/decoders/fields/encode-line-shared.ts +1 -1
  98. package/src/decoders/fields/encode-message-party.ts +3 -3
  99. package/src/decoders/fields/encode-order-reference.ts +1 -1
  100. package/src/decoders/fields/encode-parties-tax-scheme.ts +1 -1
  101. package/src/decoders/fields/encode-party-tax-scheme.ts +1 -1
  102. package/src/decoders/fields/encode-party.ts +1 -1
  103. package/src/decoders/fields/encode-payee-party.ts +1 -1
  104. package/src/decoders/fields/encode-payment-means.ts +2 -2
  105. package/src/decoders/fields/encode-payment-terms.ts +1 -1
  106. package/src/decoders/fields/encode-price-allowance-charges.ts +1 -1
  107. package/src/decoders/fields/encode-quantity.ts +1 -1
  108. package/src/decoders/fields/encode-tax-category.ts +1 -1
  109. package/src/decoders/fields/encode-tax-representative-party.ts +1 -1
  110. package/src/decoders/fields/encode-tax-totals.ts +4 -4
  111. package/src/helpers/bool.ts +9 -12
  112. package/src/helpers/get-prop.ts +2 -4
  113. package/src/helpers/str-or-und.ts +3 -4
  114. package/src/helpers/str.ts +12 -8
  115. package/src/index.ts +56 -6
  116. package/src/schemas/fields/peppol-additional-document-reference-schema.ts +123 -0
  117. package/src/schemas/fields/peppol-address-schema.ts +112 -0
  118. package/src/schemas/fields/peppol-allowance-charge-schema.ts +104 -0
  119. package/src/schemas/fields/peppol-amount-schema.ts +23 -0
  120. package/src/schemas/fields/peppol-base-line-schema.ts +141 -0
  121. package/src/{effect → schemas}/fields/peppol-billing-reference-schema.ts +25 -20
  122. package/src/schemas/fields/peppol-binary-object-schema.ts +52 -0
  123. package/src/schemas/fields/peppol-contact-schema.ts +20 -0
  124. package/src/schemas/fields/peppol-credit-note-line-schema.ts +44 -0
  125. package/src/schemas/fields/peppol-delivery-schema.ts +109 -0
  126. package/src/schemas/fields/peppol-identifier-schema.ts +21 -0
  127. package/src/schemas/fields/peppol-invoice-line-period-schema.ts +35 -0
  128. package/src/{effect → schemas}/fields/peppol-invoice-line-schema.ts +10 -9
  129. package/src/schemas/fields/peppol-invoice-period-schema.ts +31 -0
  130. package/src/schemas/fields/peppol-item-classification-schema.ts +46 -0
  131. package/src/schemas/fields/peppol-legal-monetary-total-schema.ts +127 -0
  132. package/src/schemas/fields/peppol-line-allowance-charge-schema.ts +68 -0
  133. package/src/schemas/fields/peppol-line-item-schema.ts +196 -0
  134. package/src/schemas/fields/peppol-line-price-allowance-charge-schema.ts +41 -0
  135. package/src/schemas/fields/peppol-line-price-schema.ts +32 -0
  136. package/src/schemas/fields/peppol-order-reference-schema.ts +38 -0
  137. package/src/schemas/fields/peppol-party-base-schema.ts +145 -0
  138. package/src/schemas/fields/peppol-party-legal-entity-schema.ts +32 -0
  139. package/src/schemas/fields/peppol-party-tax-scheme-schema.ts +41 -0
  140. package/src/schemas/fields/peppol-payee-party-schema.ts +119 -0
  141. package/src/schemas/fields/peppol-payment-means-schema.ts +224 -0
  142. package/src/schemas/fields/peppol-payment-terms-schema.ts +25 -0
  143. package/src/schemas/fields/peppol-quantity-schema.ts +22 -0
  144. package/src/schemas/fields/peppol-reference-schema.ts +9 -0
  145. package/src/schemas/fields/peppol-tax-category-schema.ts +47 -0
  146. package/src/schemas/fields/peppol-tax-representative-schema.ts +26 -0
  147. package/src/{effect → schemas}/fields/peppol-tax-subtotal-category-schema.ts +7 -5
  148. package/src/schemas/fields/peppol-tax-subtotal-schema.ts +33 -0
  149. package/src/schemas/fields/peppol-tax-totals-base-schema.ts +28 -0
  150. package/src/schemas/peppol-billing-base-schema.ts +366 -0
  151. package/src/schemas/peppol-credit-note-schema.ts +31 -0
  152. package/src/schemas/peppol-document-response-document-reference-schema.ts +41 -0
  153. package/src/schemas/peppol-document-response-document-schema.ts +38 -0
  154. package/src/schemas/peppol-document-response-line-response-content-schema.ts +49 -0
  155. package/src/schemas/peppol-document-response-line-response-schema.ts +40 -0
  156. package/src/schemas/peppol-document-schema.ts +120 -0
  157. package/src/{effect → schemas}/peppol-invoice-response-document-actual-response-schema.ts +25 -16
  158. package/src/schemas/peppol-invoice-response-document-actual-response-status-schema.ts +63 -0
  159. package/src/schemas/peppol-invoice-response-schema.ts +176 -0
  160. package/src/schemas/peppol-invoice-response-status-reason-code-schema.ts +40 -0
  161. package/src/schemas/peppol-invoice-schema.ts +45 -0
  162. package/src/schemas/peppol-iso-date-string.ts +20 -0
  163. package/src/schemas/peppol-message-level-response-document-response-schema.ts +35 -0
  164. package/src/schemas/peppol-message-level-response-party-schema.ts +20 -0
  165. package/src/schemas/peppol-message-level-response-schema.ts +98 -0
  166. package/src/schemas/utils/format-xsd-time.ts +80 -0
  167. package/src/{effect → schemas}/utils/index.ts +1 -1
  168. package/src/schemas/utils/is-valid-process.ts +1 -1
  169. package/src/schemas/utils/opaque.ts +19 -0
  170. package/src/schemas/utils/peppol-xsd-time-schema.ts +79 -0
  171. package/src/schemas/utils/quantity-unit-code-to-intl-unit.ts +2 -2
  172. package/src/schemas/values/credit-note-type-code-schema.ts +3 -5
  173. package/src/{effect → schemas}/values/currency-code-schema.ts +7 -1
  174. package/src/schemas/values/document-type-schemes-schema.ts +3 -5
  175. package/src/schemas/values/document-type-values-schema.ts +4 -7
  176. package/src/{effect → schemas}/values/duty-tax-fee-category-schema.ts +3 -2
  177. package/src/schemas/values/invoice-type-code-schema.ts +4 -8
  178. package/src/schemas/values/process-from-document-type-schema.ts +10 -12
  179. package/src/schemas/values/quantity-unit-codes-schema.ts +4 -8
  180. package/src/schematron/cen/ae/cen-en16931-br-ae-01.ts +6 -5
  181. package/src/schematron/cen/ae/cen-en16931-br-ae-02.ts +6 -5
  182. package/src/schematron/cen/ae/cen-en16931-br-ae-03.ts +6 -5
  183. package/src/schematron/cen/ae/cen-en16931-br-ae-04.ts +6 -5
  184. package/src/schematron/cen/ae/cen-en16931-br-ae-05.ts +6 -5
  185. package/src/schematron/cen/ae/cen-en16931-br-ae-06.ts +6 -5
  186. package/src/schematron/cen/ae/cen-en16931-br-ae-07.ts +6 -5
  187. package/src/schematron/cen/ae/cen-en16931-br-ae-08.ts +6 -5
  188. package/src/schematron/cen/ae/cen-en16931-br-ae-09.ts +6 -5
  189. package/src/schematron/cen/ae/cen-en16931-br-ae-10.ts +6 -5
  190. package/src/schematron/cen/af/cen-en16931-br-af-01.ts +6 -5
  191. package/src/schematron/cen/af/cen-en16931-br-af-02.ts +6 -5
  192. package/src/schematron/cen/af/cen-en16931-br-af-03.ts +6 -10
  193. package/src/schematron/cen/af/cen-en16931-br-af-04.ts +6 -5
  194. package/src/schematron/cen/af/cen-en16931-br-af-05.ts +6 -5
  195. package/src/schematron/cen/af/cen-en16931-br-af-06.ts +6 -5
  196. package/src/schematron/cen/af/cen-en16931-br-af-07.ts +6 -5
  197. package/src/schematron/cen/af/cen-en16931-br-af-08.ts +6 -5
  198. package/src/schematron/cen/af/cen-en16931-br-af-09.ts +6 -5
  199. package/src/schematron/cen/af/cen-en16931-br-af-10.ts +6 -5
  200. package/src/schematron/cen/ag/cen-en16931-br-ag-01.ts +6 -5
  201. package/src/schematron/cen/ag/cen-en16931-br-ag-02.ts +6 -5
  202. package/src/schematron/cen/ag/cen-en16931-br-ag-03.ts +6 -10
  203. package/src/schematron/cen/ag/cen-en16931-br-ag-04.ts +6 -5
  204. package/src/schematron/cen/ag/cen-en16931-br-ag-05.ts +6 -5
  205. package/src/schematron/cen/ag/cen-en16931-br-ag-06.ts +6 -5
  206. package/src/schematron/cen/ag/cen-en16931-br-ag-07.ts +6 -5
  207. package/src/schematron/cen/ag/cen-en16931-br-ag-08.ts +6 -5
  208. package/src/schematron/cen/ag/cen-en16931-br-ag-09.ts +6 -5
  209. package/src/schematron/cen/ag/cen-en16931-br-ag-10.ts +6 -5
  210. package/src/schematron/cen/b/cen-en16931-br-b-01.ts +6 -5
  211. package/src/schematron/cen/b/cen-en16931-br-b-02.ts +6 -5
  212. package/src/schematron/cen/cen-en16931-br-01.ts +6 -5
  213. package/src/schematron/cen/cen-en16931-br-02.ts +6 -5
  214. package/src/schematron/cen/cen-en16931-br-03.ts +9 -6
  215. package/src/schematron/cen/cen-en16931-br-04.ts +6 -5
  216. package/src/schematron/cen/cen-en16931-br-05.ts +6 -5
  217. package/src/schematron/cen/cen-en16931-br-06.ts +6 -5
  218. package/src/schematron/cen/cen-en16931-br-07.ts +6 -5
  219. package/src/schematron/cen/cen-en16931-br-08.ts +6 -5
  220. package/src/schematron/cen/cen-en16931-br-09.ts +6 -5
  221. package/src/schematron/cen/cen-en16931-br-10.ts +6 -5
  222. package/src/schematron/cen/cen-en16931-br-11.ts +6 -5
  223. package/src/schematron/cen/cen-en16931-br-12.ts +6 -5
  224. package/src/schematron/cen/cen-en16931-br-13.ts +6 -5
  225. package/src/schematron/cen/cen-en16931-br-14.ts +6 -5
  226. package/src/schematron/cen/cen-en16931-br-15.ts +6 -5
  227. package/src/schematron/cen/cen-en16931-br-16.ts +6 -5
  228. package/src/schematron/cen/cen-en16931-br-17.ts +6 -5
  229. package/src/schematron/cen/cen-en16931-br-18.ts +6 -5
  230. package/src/schematron/cen/cen-en16931-br-19.ts +6 -5
  231. package/src/schematron/cen/cen-en16931-br-20.ts +6 -5
  232. package/src/schematron/cen/cen-en16931-br-21.ts +6 -5
  233. package/src/schematron/cen/cen-en16931-br-22.ts +6 -5
  234. package/src/schematron/cen/cen-en16931-br-23.ts +6 -5
  235. package/src/schematron/cen/cen-en16931-br-24.ts +6 -5
  236. package/src/schematron/cen/cen-en16931-br-25.ts +6 -5
  237. package/src/schematron/cen/cen-en16931-br-26.ts +6 -5
  238. package/src/schematron/cen/cen-en16931-br-27.ts +6 -5
  239. package/src/schematron/cen/cen-en16931-br-28.ts +6 -5
  240. package/src/schematron/cen/cen-en16931-br-29.ts +6 -5
  241. package/src/schematron/cen/cen-en16931-br-30.ts +6 -5
  242. package/src/schematron/cen/cen-en16931-br-31.ts +6 -5
  243. package/src/schematron/cen/cen-en16931-br-32.ts +6 -5
  244. package/src/schematron/cen/cen-en16931-br-33.ts +6 -5
  245. package/src/schematron/cen/cen-en16931-br-36.ts +6 -5
  246. package/src/schematron/cen/cen-en16931-br-37.ts +6 -5
  247. package/src/schematron/cen/cen-en16931-br-38.ts +6 -5
  248. package/src/schematron/cen/cen-en16931-br-41.ts +6 -5
  249. package/src/schematron/cen/cen-en16931-br-42.ts +6 -5
  250. package/src/schematron/cen/cen-en16931-br-43.ts +6 -5
  251. package/src/schematron/cen/cen-en16931-br-44.ts +6 -5
  252. package/src/schematron/cen/cen-en16931-br-45.ts +6 -5
  253. package/src/schematron/cen/cen-en16931-br-46.ts +6 -5
  254. package/src/schematron/cen/cen-en16931-br-47.ts +6 -5
  255. package/src/schematron/cen/cen-en16931-br-48.ts +6 -5
  256. package/src/schematron/cen/cen-en16931-br-49.ts +6 -5
  257. package/src/schematron/cen/cen-en16931-br-50.ts +6 -5
  258. package/src/schematron/cen/cen-en16931-br-51.ts +6 -5
  259. package/src/schematron/cen/cen-en16931-br-52.ts +6 -5
  260. package/src/schematron/cen/cen-en16931-br-53.ts +6 -5
  261. package/src/schematron/cen/cen-en16931-br-54.ts +6 -5
  262. package/src/schematron/cen/cen-en16931-br-55.ts +6 -5
  263. package/src/schematron/cen/cen-en16931-br-56.ts +6 -5
  264. package/src/schematron/cen/cen-en16931-br-57.ts +6 -5
  265. package/src/schematron/cen/cen-en16931-br-61.ts +6 -5
  266. package/src/schematron/cen/cen-en16931-br-62.ts +6 -5
  267. package/src/schematron/cen/cen-en16931-br-63.ts +6 -5
  268. package/src/schematron/cen/cen-en16931-br-64.ts +6 -5
  269. package/src/schematron/cen/cen-en16931-br-65.ts +6 -5
  270. package/src/schematron/cen/cl/cen-en16931-br-cl-08.ts +6 -5
  271. package/src/schematron/cen/co/cen-en16931-br-co-03.ts +6 -5
  272. package/src/schematron/cen/co/cen-en16931-br-co-04.ts +6 -5
  273. package/src/schematron/cen/co/cen-en16931-br-co-05.ts +6 -5
  274. package/src/schematron/cen/co/cen-en16931-br-co-06.ts +6 -5
  275. package/src/schematron/cen/co/cen-en16931-br-co-07.ts +6 -5
  276. package/src/schematron/cen/co/cen-en16931-br-co-08.ts +6 -5
  277. package/src/schematron/cen/co/cen-en16931-br-co-09.ts +6 -5
  278. package/src/schematron/cen/co/cen-en16931-br-co-10.ts +6 -5
  279. package/src/schematron/cen/co/cen-en16931-br-co-11.ts +6 -5
  280. package/src/schematron/cen/co/cen-en16931-br-co-12.ts +6 -5
  281. package/src/schematron/cen/co/cen-en16931-br-co-13.ts +6 -5
  282. package/src/schematron/cen/co/cen-en16931-br-co-14.ts +6 -5
  283. package/src/schematron/cen/co/cen-en16931-br-co-15.ts +6 -5
  284. package/src/schematron/cen/co/cen-en16931-br-co-16.ts +6 -5
  285. package/src/schematron/cen/co/cen-en16931-br-co-17.ts +6 -5
  286. package/src/schematron/cen/co/cen-en16931-br-co-18.ts +6 -5
  287. package/src/schematron/cen/co/cen-en16931-br-co-19.ts +6 -5
  288. package/src/schematron/cen/co/cen-en16931-br-co-20.ts +6 -5
  289. package/src/schematron/cen/co/cen-en16931-br-co-21.ts +6 -5
  290. package/src/schematron/cen/co/cen-en16931-br-co-22.ts +6 -5
  291. package/src/schematron/cen/co/cen-en16931-br-co-23.ts +6 -5
  292. package/src/schematron/cen/co/cen-en16931-br-co-24.ts +6 -5
  293. package/src/schematron/cen/co/cen-en16931-br-co-25.ts +6 -5
  294. package/src/schematron/cen/co/cen-en16931-br-co-26.ts +6 -5
  295. package/src/schematron/cen/dec/cen-en16931-br-dec-01.ts +6 -5
  296. package/src/schematron/cen/dec/cen-en16931-br-dec-02.ts +6 -5
  297. package/src/schematron/cen/dec/cen-en16931-br-dec-05.ts +6 -5
  298. package/src/schematron/cen/dec/cen-en16931-br-dec-06.ts +6 -5
  299. package/src/schematron/cen/dec/cen-en16931-br-dec-09.ts +6 -5
  300. package/src/schematron/cen/dec/cen-en16931-br-dec-10.ts +6 -5
  301. package/src/schematron/cen/dec/cen-en16931-br-dec-11.ts +6 -5
  302. package/src/schematron/cen/dec/cen-en16931-br-dec-12.ts +6 -5
  303. package/src/schematron/cen/dec/cen-en16931-br-dec-13.ts +6 -5
  304. package/src/schematron/cen/dec/cen-en16931-br-dec-14.ts +6 -5
  305. package/src/schematron/cen/dec/cen-en16931-br-dec-15.ts +6 -5
  306. package/src/schematron/cen/dec/cen-en16931-br-dec-16.ts +6 -5
  307. package/src/schematron/cen/dec/cen-en16931-br-dec-17.ts +6 -5
  308. package/src/schematron/cen/dec/cen-en16931-br-dec-18.ts +6 -5
  309. package/src/schematron/cen/dec/cen-en16931-br-dec-19.ts +6 -5
  310. package/src/schematron/cen/dec/cen-en16931-br-dec-20.ts +6 -5
  311. package/src/schematron/cen/dec/cen-en16931-br-dec-23.ts +6 -5
  312. package/src/schematron/cen/dec/cen-en16931-br-dec-24.ts +6 -5
  313. package/src/schematron/cen/dec/cen-en16931-br-dec-25.ts +6 -5
  314. package/src/schematron/cen/dec/cen-en16931-br-dec-27.ts +6 -5
  315. package/src/schematron/cen/dec/cen-en16931-br-dec-28.ts +6 -5
  316. package/src/schematron/cen/e/cen-en16931-br-e-01.ts +6 -5
  317. package/src/schematron/cen/e/cen-en16931-br-e-02.ts +6 -5
  318. package/src/schematron/cen/e/cen-en16931-br-e-03.ts +6 -10
  319. package/src/schematron/cen/e/cen-en16931-br-e-04.ts +6 -5
  320. package/src/schematron/cen/e/cen-en16931-br-e-05.ts +6 -5
  321. package/src/schematron/cen/e/cen-en16931-br-e-06.ts +6 -5
  322. package/src/schematron/cen/e/cen-en16931-br-e-07.ts +6 -5
  323. package/src/schematron/cen/e/cen-en16931-br-e-08.ts +6 -5
  324. package/src/schematron/cen/e/cen-en16931-br-e-09.ts +6 -5
  325. package/src/schematron/cen/e/cen-en16931-br-e-10.ts +6 -5
  326. package/src/schematron/cen/g/cen-en16931-br-g-01.ts +6 -5
  327. package/src/schematron/cen/g/cen-en16931-br-g-02.ts +6 -5
  328. package/src/schematron/cen/g/cen-en16931-br-g-03.ts +6 -5
  329. package/src/schematron/cen/g/cen-en16931-br-g-04.ts +6 -5
  330. package/src/schematron/cen/g/cen-en16931-br-g-05.ts +6 -5
  331. package/src/schematron/cen/g/cen-en16931-br-g-06.ts +6 -5
  332. package/src/schematron/cen/g/cen-en16931-br-g-07.ts +6 -5
  333. package/src/schematron/cen/g/cen-en16931-br-g-08.ts +6 -5
  334. package/src/schematron/cen/g/cen-en16931-br-g-09.ts +6 -5
  335. package/src/schematron/cen/g/cen-en16931-br-g-10.ts +6 -5
  336. package/src/schematron/cen/ic/cen-en16931-br-ic-01.ts +6 -5
  337. package/src/schematron/cen/ic/cen-en16931-br-ic-02.ts +6 -5
  338. package/src/schematron/cen/ic/cen-en16931-br-ic-03.ts +6 -5
  339. package/src/schematron/cen/ic/cen-en16931-br-ic-04.ts +6 -5
  340. package/src/schematron/cen/ic/cen-en16931-br-ic-05.ts +6 -5
  341. package/src/schematron/cen/ic/cen-en16931-br-ic-06.ts +6 -5
  342. package/src/schematron/cen/ic/cen-en16931-br-ic-07.ts +6 -5
  343. package/src/schematron/cen/ic/cen-en16931-br-ic-08.ts +6 -5
  344. package/src/schematron/cen/ic/cen-en16931-br-ic-09.ts +6 -5
  345. package/src/schematron/cen/ic/cen-en16931-br-ic-10.ts +6 -5
  346. package/src/schematron/cen/ic/cen-en16931-br-ic-11.ts +6 -5
  347. package/src/schematron/cen/ic/cen-en16931-br-ic-12.ts +6 -5
  348. package/src/schematron/cen/o/cen-en16931-br-o-01.ts +6 -5
  349. package/src/schematron/cen/o/cen-en16931-br-o-02.ts +6 -5
  350. package/src/schematron/cen/o/cen-en16931-br-o-03.ts +6 -5
  351. package/src/schematron/cen/o/cen-en16931-br-o-04.ts +6 -5
  352. package/src/schematron/cen/o/cen-en16931-br-o-05.ts +6 -5
  353. package/src/schematron/cen/o/cen-en16931-br-o-06.ts +6 -5
  354. package/src/schematron/cen/o/cen-en16931-br-o-07.ts +6 -5
  355. package/src/schematron/cen/o/cen-en16931-br-o-08.ts +6 -5
  356. package/src/schematron/cen/o/cen-en16931-br-o-09.ts +6 -5
  357. package/src/schematron/cen/o/cen-en16931-br-o-10.ts +6 -5
  358. package/src/schematron/cen/o/cen-en16931-br-o-11.ts +6 -5
  359. package/src/schematron/cen/o/cen-en16931-br-o-12.ts +6 -5
  360. package/src/schematron/cen/o/cen-en16931-br-o-13.ts +6 -5
  361. package/src/schematron/cen/o/cen-en16931-br-o-14.ts +6 -5
  362. package/src/schematron/cen/s/cen-en16931-br-s-01.ts +6 -5
  363. package/src/schematron/cen/s/cen-en16931-br-s-02.ts +6 -5
  364. package/src/schematron/cen/s/cen-en16931-br-s-03.ts +6 -10
  365. package/src/schematron/cen/s/cen-en16931-br-s-04.ts +6 -5
  366. package/src/schematron/cen/s/cen-en16931-br-s-05.ts +6 -5
  367. package/src/schematron/cen/s/cen-en16931-br-s-06.ts +6 -5
  368. package/src/schematron/cen/s/cen-en16931-br-s-07.ts +6 -5
  369. package/src/schematron/cen/s/cen-en16931-br-s-08.ts +6 -5
  370. package/src/schematron/cen/s/cen-en16931-br-s-09.ts +6 -5
  371. package/src/schematron/cen/s/cen-en16931-br-s-10.ts +6 -5
  372. package/src/schematron/cen/z/cen-en16931-br-z-01.ts +6 -5
  373. package/src/schematron/cen/z/cen-en16931-br-z-02.ts +6 -5
  374. package/src/schematron/cen/z/cen-en16931-br-z-03.ts +6 -10
  375. package/src/schematron/cen/z/cen-en16931-br-z-04.ts +6 -5
  376. package/src/schematron/cen/z/cen-en16931-br-z-05.ts +6 -5
  377. package/src/schematron/cen/z/cen-en16931-br-z-06.ts +6 -5
  378. package/src/schematron/cen/z/cen-en16931-br-z-07.ts +6 -5
  379. package/src/schematron/cen/z/cen-en16931-br-z-08.ts +6 -5
  380. package/src/schematron/cen/z/cen-en16931-br-z-09.ts +6 -5
  381. package/src/schematron/cen/z/cen-en16931-br-z-10.ts +6 -5
  382. package/src/schematron/de/de-r-001.ts +8 -7
  383. package/src/schematron/de/de-r-002.ts +8 -7
  384. package/src/schematron/de/de-r-003.ts +8 -7
  385. package/src/schematron/de/de-r-004.ts +8 -7
  386. package/src/schematron/de/de-r-005.ts +8 -7
  387. package/src/schematron/de/de-r-006.ts +8 -7
  388. package/src/schematron/de/de-r-007.ts +8 -7
  389. package/src/schematron/de/de-r-008.ts +8 -7
  390. package/src/schematron/de/de-r-009.ts +8 -7
  391. package/src/schematron/de/de-r-010.ts +9 -8
  392. package/src/schematron/de/de-r-011.ts +9 -8
  393. package/src/schematron/de/de-r-014.ts +8 -7
  394. package/src/schematron/de/de-r-015.ts +8 -7
  395. package/src/schematron/de/de-r-016.ts +9 -8
  396. package/src/schematron/de/de-r-017.ts +8 -7
  397. package/src/schematron/de/de-r-018.ts +10 -9
  398. package/src/schematron/de/de-r-019.ts +8 -7
  399. package/src/schematron/de/de-r-020.ts +8 -7
  400. package/src/schematron/de/de-r-022.ts +8 -7
  401. package/src/schematron/de/de-r-023-1.ts +8 -7
  402. package/src/schematron/de/de-r-023-2.ts +8 -7
  403. package/src/schematron/de/de-r-024-1.ts +8 -7
  404. package/src/schematron/de/de-r-024-2.ts +8 -7
  405. package/src/schematron/de/de-r-025-1.ts +8 -7
  406. package/src/schematron/de/de-r-025-2.ts +8 -7
  407. package/src/schematron/de/de-r-026.ts +9 -8
  408. package/src/schematron/de/de-r-027.ts +8 -7
  409. package/src/schematron/de/de-r-028.ts +8 -7
  410. package/src/schematron/de/de-r-030.ts +9 -8
  411. package/src/schematron/de/de-r-031.ts +8 -7
  412. package/src/schematron/dk/dk-r-002.ts +7 -6
  413. package/src/schematron/dk/dk-r-003.ts +8 -7
  414. package/src/schematron/dk/dk-r-004.ts +8 -7
  415. package/src/schematron/dk/dk-r-005.ts +8 -7
  416. package/src/schematron/dk/dk-r-006.ts +8 -7
  417. package/src/schematron/dk/dk-r-007.ts +8 -7
  418. package/src/schematron/dk/dk-r-008.ts +8 -7
  419. package/src/schematron/dk/dk-r-009.ts +8 -7
  420. package/src/schematron/dk/dk-r-010.ts +8 -7
  421. package/src/schematron/dk/dk-r-011.ts +8 -7
  422. package/src/schematron/dk/dk-r-013.ts +8 -7
  423. package/src/schematron/dk/dk-r-014.ts +7 -6
  424. package/src/schematron/dk/dk-r-016.ts +8 -7
  425. package/src/schematron/dk/dk-r-017.ts +8 -7
  426. package/src/schematron/errors.ts +17 -0
  427. package/src/schematron/gr/gr-r-001-1.ts +7 -6
  428. package/src/schematron/gr/gr-r-001-2.ts +8 -7
  429. package/src/schematron/gr/gr-r-001-3.ts +14 -9
  430. package/src/schematron/gr/gr-r-001-4.ts +8 -7
  431. package/src/schematron/gr/gr-r-001-5.ts +8 -7
  432. package/src/schematron/gr/gr-r-001-6.ts +7 -6
  433. package/src/schematron/gr/gr-r-001-7.ts +7 -6
  434. package/src/schematron/gr/gr-r-002.ts +7 -6
  435. package/src/schematron/gr/gr-r-003.ts +8 -7
  436. package/src/schematron/gr/gr-r-004-1.ts +7 -6
  437. package/src/schematron/gr/gr-r-004-2.ts +7 -6
  438. package/src/schematron/gr/gr-r-005.ts +7 -6
  439. package/src/schematron/gr/gr-r-006.ts +8 -7
  440. package/src/schematron/gr/gr-r-008-2.ts +7 -6
  441. package/src/schematron/gr/gr-r-008-3.ts +7 -6
  442. package/src/schematron/gr/gr-r-009.ts +7 -6
  443. package/src/schematron/gr/gr-r-010.ts +7 -6
  444. package/src/schematron/gr/gr-s-008-1.ts +7 -6
  445. package/src/schematron/gr/gr-s-011.ts +8 -7
  446. package/src/schematron/helpers.ts +36 -11
  447. package/src/schematron/index.ts +6 -1
  448. package/src/schematron/is/is-r-001.ts +7 -6
  449. package/src/schematron/is/is-r-002.ts +7 -6
  450. package/src/schematron/is/is-r-003.ts +7 -6
  451. package/src/schematron/is/is-r-004.ts +7 -6
  452. package/src/schematron/is/is-r-005.ts +7 -6
  453. package/src/schematron/is/is-r-006.ts +8 -7
  454. package/src/schematron/is/is-r-007.ts +8 -7
  455. package/src/schematron/is/is-r-008.ts +8 -7
  456. package/src/schematron/is/is-r-009.ts +8 -7
  457. package/src/schematron/is/is-r-010.ts +9 -8
  458. package/src/schematron/it/it-r-001.ts +7 -6
  459. package/src/schematron/it/it-r-002.ts +7 -6
  460. package/src/schematron/it/it-r-003.ts +7 -6
  461. package/src/schematron/it/it-r-004.ts +7 -6
  462. package/src/schematron/nl/nl-r-001.ts +7 -6
  463. package/src/schematron/nl/nl-r-002.ts +7 -6
  464. package/src/schematron/nl/nl-r-003.ts +8 -7
  465. package/src/schematron/nl/nl-r-004.ts +7 -6
  466. package/src/schematron/nl/nl-r-005.ts +8 -7
  467. package/src/schematron/nl/nl-r-006.ts +8 -7
  468. package/src/schematron/nl/nl-r-007.ts +8 -7
  469. package/src/schematron/nl/nl-r-008.ts +7 -6
  470. package/src/schematron/nl/nl-r-009.ts +8 -7
  471. package/src/schematron/no/no-r-001.ts +8 -7
  472. package/src/schematron/no/no-r-002.ts +7 -6
  473. package/src/schematron/peppol/cl/peppol-en16931-cl001.ts +6 -5
  474. package/src/schematron/peppol/cl/peppol-en16931-cl002.ts +6 -5
  475. package/src/schematron/peppol/cl/peppol-en16931-cl003.ts +6 -5
  476. package/src/schematron/peppol/cl/peppol-en16931-cl006.ts +7 -6
  477. package/src/schematron/peppol/cl/peppol-en16931-cl007.ts +6 -5
  478. package/src/schematron/peppol/cl/peppol-en16931-cl008.ts +6 -5
  479. package/src/schematron/peppol/common/peppol-common-r040.ts +6 -5
  480. package/src/schematron/peppol/common/peppol-common-r041.ts +6 -5
  481. package/src/schematron/peppol/common/peppol-common-r042.ts +6 -5
  482. package/src/schematron/peppol/common/peppol-common-r043.ts +6 -5
  483. package/src/schematron/peppol/common/peppol-common-r044.ts +6 -5
  484. package/src/schematron/peppol/common/peppol-common-r045.ts +6 -5
  485. package/src/schematron/peppol/common/peppol-common-r046.ts +6 -5
  486. package/src/schematron/peppol/common/peppol-common-r047.ts +6 -5
  487. package/src/schematron/peppol/common/peppol-common-r049.ts +6 -5
  488. package/src/schematron/peppol/common/peppol-common-r050.ts +6 -5
  489. package/src/schematron/peppol/common/peppol-common-r052.ts +6 -5
  490. package/src/schematron/peppol/common/peppol-common-r053.ts +6 -5
  491. package/src/schematron/peppol/f/peppol-en16931-f001.ts +20 -13
  492. package/src/schematron/peppol/p/peppol-en16931-p0100.ts +8 -7
  493. package/src/schematron/peppol/p/peppol-en16931-p0101.ts +8 -7
  494. package/src/schematron/peppol/p/peppol-en16931-p0104.ts +6 -5
  495. package/src/schematron/peppol/p/peppol-en16931-p0105.ts +6 -5
  496. package/src/schematron/peppol/p/peppol-en16931-p0106.ts +6 -5
  497. package/src/schematron/peppol/p/peppol-en16931-p0107.ts +6 -5
  498. package/src/schematron/peppol/p/peppol-en16931-p0108.ts +6 -5
  499. package/src/schematron/peppol/p/peppol-en16931-p0109.ts +6 -5
  500. package/src/schematron/peppol/p/peppol-en16931-p0110.ts +6 -5
  501. package/src/schematron/peppol/p/peppol-en16931-p0111.ts +6 -5
  502. package/src/schematron/peppol/p/peppol-en16931-p0112.ts +7 -6
  503. package/src/schematron/peppol/r/peppol-en16931-r001.ts +11 -13
  504. package/src/schematron/peppol/r/peppol-en16931-r002.ts +6 -5
  505. package/src/schematron/peppol/r/peppol-en16931-r003.ts +6 -5
  506. package/src/schematron/peppol/r/peppol-en16931-r004.ts +6 -5
  507. package/src/schematron/peppol/r/peppol-en16931-r005.ts +7 -6
  508. package/src/schematron/peppol/r/peppol-en16931-r007.ts +6 -5
  509. package/src/schematron/peppol/r/peppol-en16931-r008.ts +6 -5
  510. package/src/schematron/peppol/r/peppol-en16931-r010.ts +6 -5
  511. package/src/schematron/peppol/r/peppol-en16931-r020.ts +6 -5
  512. package/src/schematron/peppol/r/peppol-en16931-r040.ts +6 -5
  513. package/src/schematron/peppol/r/peppol-en16931-r041.ts +6 -5
  514. package/src/schematron/peppol/r/peppol-en16931-r042.ts +6 -5
  515. package/src/schematron/peppol/r/peppol-en16931-r043.ts +6 -5
  516. package/src/schematron/peppol/r/peppol-en16931-r044.ts +6 -5
  517. package/src/schematron/peppol/r/peppol-en16931-r046.ts +6 -5
  518. package/src/schematron/peppol/r/peppol-en16931-r051.ts +6 -5
  519. package/src/schematron/peppol/r/peppol-en16931-r053.ts +6 -5
  520. package/src/schematron/peppol/r/peppol-en16931-r054.ts +6 -5
  521. package/src/schematron/peppol/r/peppol-en16931-r055.ts +8 -7
  522. package/src/schematron/peppol/r/peppol-en16931-r061.ts +6 -5
  523. package/src/schematron/peppol/r/peppol-en16931-r100.ts +6 -5
  524. package/src/schematron/peppol/r/peppol-en16931-r101.ts +6 -5
  525. package/src/schematron/peppol/r/peppol-en16931-r110.ts +7 -6
  526. package/src/schematron/peppol/r/peppol-en16931-r111.ts +7 -6
  527. package/src/schematron/peppol/r/peppol-en16931-r120.ts +6 -5
  528. package/src/schematron/peppol/r/peppol-en16931-r121.ts +6 -5
  529. package/src/schematron/peppol/r/peppol-en16931-r130.ts +6 -5
  530. package/src/schematron/run-all-rules.ts +2 -7
  531. package/src/schematron/schematron.ts +36 -0
  532. package/src/schematron/se/se-r-001.ts +7 -6
  533. package/src/schematron/se/se-r-002.ts +7 -6
  534. package/src/schematron/se/se-r-003.ts +7 -6
  535. package/src/schematron/se/se-r-004.ts +7 -6
  536. package/src/schematron/se/se-r-005.ts +8 -7
  537. package/src/schematron/se/se-r-006.ts +7 -6
  538. package/src/schematron/se/se-r-007.ts +7 -6
  539. package/src/schematron/se/se-r-008.ts +7 -6
  540. package/src/schematron/se/se-r-009.ts +7 -6
  541. package/src/schematron/se/se-r-010.ts +7 -6
  542. package/src/schematron/se/se-r-011.ts +7 -6
  543. package/src/schematron/se/se-r-012.ts +7 -6
  544. package/src/schematron/se/se-r-013.ts +7 -6
  545. package/src/values/additional-document-reference-codes.generated.ts +2 -3
  546. package/src/values/allowance-charge-reason-codes.generated.ts +1 -1
  547. package/src/values/application-response-type-codes.generated.ts +1 -1
  548. package/src/values/charge-reason-codes.generated.ts +1 -1
  549. package/src/values/country-code.generated.ts +1 -1
  550. package/src/values/credit-notes-type-codes.generated.ts +1 -1
  551. package/src/values/currency-code.generated.ts +1 -1
  552. package/src/values/document-type-codes.generated.ts +1 -1
  553. package/src/values/document-type.generated.ts +2 -2
  554. package/src/values/duty-tax-fee-categories.generated.ts +1 -1
  555. package/src/values/eas-codes.generated.ts +1 -1
  556. package/src/values/icd-codes.generated.ts +7 -7
  557. package/src/values/invoice-status-codes.generated.ts +1 -1
  558. package/src/values/invoice-type-codes.generated.ts +1 -1
  559. package/src/values/item-classification-code.generated.ts +1 -1
  560. package/src/values/mime-codes.generated.ts +1 -1
  561. package/src/values/op-status-action.generated.ts +1 -1
  562. package/src/values/op-status-reason.generated.ts +1 -1
  563. package/src/values/participant-identifier-schemes.generated.ts +2 -2
  564. package/src/values/payment-means-codes.generated.ts +1 -1
  565. package/src/values/processes.generated.ts +1 -1
  566. package/src/values/quantity-unit-codes.generated.ts +1 -1
  567. package/src/values/vat-dates.generated.ts +1 -1
  568. package/src/values/vatex-codes.generated.ts +1 -1
  569. package/dist/all-union-fields-CxoyKBpI.d.ts +0 -445
  570. package/dist/all-union-fields-CxoyKBpI.d.ts.map +0 -1
  571. package/dist/document-DCcObB-a.d.ts +0 -1466
  572. package/dist/document-DCcObB-a.d.ts.map +0 -1
  573. package/dist/effect.d.ts +0 -6274
  574. package/dist/effect.d.ts.map +0 -1
  575. package/dist/effect.js +0 -3239
  576. package/dist/effect.js.map +0 -1
  577. package/dist/index.d.ts.map +0 -1
  578. package/dist/is-valid-process-CSWL-q9f.js +0 -1590
  579. package/dist/is-valid-process-CSWL-q9f.js.map +0 -1
  580. package/dist/quantity-unit-code-to-intl-unit-15EykjMe.d.ts +0 -168
  581. package/dist/quantity-unit-code-to-intl-unit-15EykjMe.d.ts.map +0 -1
  582. package/dist/vat-dates.generated-DTVWQAdn.d.ts +0 -4812
  583. package/dist/vat-dates.generated-DTVWQAdn.d.ts.map +0 -1
  584. package/dist/vatex-codes.generated-BSgP3n5t.js.map +0 -1
  585. package/src/decoders/errors.ts +0 -11
  586. package/src/document-parser.ts +0 -70
  587. package/src/document.ts +0 -19
  588. package/src/effect/fields/default-customization-id.ts +0 -1
  589. package/src/effect/fields/default-profile-id.ts +0 -1
  590. package/src/effect/fields/peppol-additional-document-reference-schema.ts +0 -114
  591. package/src/effect/fields/peppol-address-schema.ts +0 -105
  592. package/src/effect/fields/peppol-allowance-charge-schema.ts +0 -94
  593. package/src/effect/fields/peppol-amount-schema.ts +0 -21
  594. package/src/effect/fields/peppol-base-line-schema.ts +0 -138
  595. package/src/effect/fields/peppol-binary-object-schema.ts +0 -51
  596. package/src/effect/fields/peppol-contact-schema.ts +0 -18
  597. package/src/effect/fields/peppol-credit-note-line-schema.ts +0 -41
  598. package/src/effect/fields/peppol-delivery-schema.ts +0 -100
  599. package/src/effect/fields/peppol-identifier-schema.ts +0 -19
  600. package/src/effect/fields/peppol-invoice-line-period-schema.ts +0 -34
  601. package/src/effect/fields/peppol-invoice-period-schema.ts +0 -30
  602. package/src/effect/fields/peppol-item-classification-schema.ts +0 -45
  603. package/src/effect/fields/peppol-legal-monetary-total-schema.ts +0 -126
  604. package/src/effect/fields/peppol-line-allowance-charge-schema.ts +0 -63
  605. package/src/effect/fields/peppol-line-item-schema.ts +0 -185
  606. package/src/effect/fields/peppol-line-price-allowance-charge-schema.ts +0 -38
  607. package/src/effect/fields/peppol-line-price-schema.ts +0 -31
  608. package/src/effect/fields/peppol-order-reference-schema.ts +0 -36
  609. package/src/effect/fields/peppol-party-base-schema.ts +0 -136
  610. package/src/effect/fields/peppol-party-legal-entity-schema.ts +0 -29
  611. package/src/effect/fields/peppol-party-tax-scheme-schema.ts +0 -33
  612. package/src/effect/fields/peppol-payee-party-schema.ts +0 -112
  613. package/src/effect/fields/peppol-payment-means-schema.ts +0 -210
  614. package/src/effect/fields/peppol-payment-terms-schema.ts +0 -23
  615. package/src/effect/fields/peppol-quantity-schema.ts +0 -21
  616. package/src/effect/fields/peppol-reference-schema.ts +0 -5
  617. package/src/effect/fields/peppol-tax-category-schema.ts +0 -42
  618. package/src/effect/fields/peppol-tax-representative-schema.ts +0 -23
  619. package/src/effect/fields/peppol-tax-subtotal-schema.ts +0 -32
  620. package/src/effect/fields/peppol-tax-totals-base-schema.ts +0 -25
  621. package/src/effect/index.ts +0 -56
  622. package/src/effect/peppol-billing-base-schema.ts +0 -355
  623. package/src/effect/peppol-credit-note-schema.ts +0 -30
  624. package/src/effect/peppol-document-response-document-reference-schema.ts +0 -38
  625. package/src/effect/peppol-document-response-document-schema.ts +0 -35
  626. package/src/effect/peppol-document-response-line-response-content-schema.ts +0 -44
  627. package/src/effect/peppol-document-response-line-response-schema.ts +0 -33
  628. package/src/effect/peppol-document-schema.ts +0 -142
  629. package/src/effect/peppol-invoice-response-document-actual-response-status-schema.ts +0 -60
  630. package/src/effect/peppol-invoice-response-schema.ts +0 -168
  631. package/src/effect/peppol-invoice-response-status-reason-code-schema.ts +0 -31
  632. package/src/effect/peppol-invoice-schema.ts +0 -42
  633. package/src/effect/peppol-iso-date-string-schema.ts +0 -19
  634. package/src/effect/peppol-message-level-response-document-response-schema.ts +0 -33
  635. package/src/effect/peppol-message-level-response-party-schema.ts +0 -19
  636. package/src/effect/peppol-message-level-response-schema.ts +0 -97
  637. package/src/effect/utils/format-quantity-with-unit.ts +0 -1
  638. package/src/effect/utils/get-credit-note-type-code-description.ts +0 -1
  639. package/src/effect/utils/get-invoice-type-code-description.ts +0 -1
  640. package/src/effect/utils/is-valid-credit-note-type-code.ts +0 -1
  641. package/src/effect/utils/is-valid-invoice-type-code.ts +0 -1
  642. package/src/effect/utils/is-valid-process.ts +0 -1
  643. package/src/effect/utils/peppol-xsd-time-schema.ts +0 -13
  644. package/src/effect/utils/quantity-unit-code-to-intl-unit.ts +0 -2
  645. package/src/effect/values/credit-note-type-code-schema.ts +0 -23
  646. package/src/effect/values/document-type-schemes-schema.ts +0 -14
  647. package/src/effect/values/document-type-values-schema.ts +0 -16
  648. package/src/effect/values/invoice-type-code-schema.ts +0 -21
  649. package/src/effect/values/process-from-document-type-schema.ts +0 -26
  650. package/src/effect/values/quantity-unit-codes-schema.ts +0 -24
  651. package/src/helpers/errors.ts +0 -6
  652. package/src/helpers/is-defined.ts +0 -3
  653. package/src/schemas/billing-base.ts +0 -362
  654. package/src/schemas/credit-note.ts +0 -28
  655. package/src/schemas/document-response-document-reference-schema.ts +0 -37
  656. package/src/schemas/document-response-document-schema.ts +0 -34
  657. package/src/schemas/document-response-line-response-content.ts +0 -43
  658. package/src/schemas/document-response-line-response-schema.ts +0 -33
  659. package/src/schemas/fields/additional-document-reference-schema.ts +0 -112
  660. package/src/schemas/fields/address-schema.ts +0 -105
  661. package/src/schemas/fields/allowance-charge-schema.ts +0 -86
  662. package/src/schemas/fields/amount-schema.ts +0 -21
  663. package/src/schemas/fields/base-line-schema.ts +0 -136
  664. package/src/schemas/fields/billing-references-schema.ts +0 -44
  665. package/src/schemas/fields/binary-object-schema.ts +0 -45
  666. package/src/schemas/fields/contact-schema.ts +0 -18
  667. package/src/schemas/fields/credit-note-line-schema.ts +0 -37
  668. package/src/schemas/fields/date-only-fn.ts +0 -6
  669. package/src/schemas/fields/date-only-parser.ts +0 -20
  670. package/src/schemas/fields/delivery-schema.ts +0 -95
  671. package/src/schemas/fields/identifier-schema.ts +0 -24
  672. package/src/schemas/fields/invoice-line-period-schema.ts +0 -31
  673. package/src/schemas/fields/invoice-line-schema.ts +0 -41
  674. package/src/schemas/fields/invoice-period-schema.ts +0 -27
  675. package/src/schemas/fields/legal-monetary-total-schema.ts +0 -125
  676. package/src/schemas/fields/line-allowance-charge-schema.ts +0 -59
  677. package/src/schemas/fields/line-item-schema.ts +0 -183
  678. package/src/schemas/fields/line-price-allowance-charge-schema.ts +0 -33
  679. package/src/schemas/fields/list-identifier-schema.ts +0 -43
  680. package/src/schemas/fields/order-reference-schema.ts +0 -36
  681. package/src/schemas/fields/party-base-schema.ts +0 -131
  682. package/src/schemas/fields/party-legal-entity-schema.ts +0 -29
  683. package/src/schemas/fields/party-tax-schema.ts +0 -33
  684. package/src/schemas/fields/payee-party.ts +0 -107
  685. package/src/schemas/fields/payment-means-schema.ts +0 -209
  686. package/src/schemas/fields/payment-terms-schema.ts +0 -23
  687. package/src/schemas/fields/price-schema.ts +0 -31
  688. package/src/schemas/fields/quantity-schema.ts +0 -21
  689. package/src/schemas/fields/reference-schema.ts +0 -4
  690. package/src/schemas/fields/tax-category-schema.ts +0 -41
  691. package/src/schemas/fields/tax-representative-party-schema.ts +0 -23
  692. package/src/schemas/fields/tax-subtotal-category-schema.ts +0 -26
  693. package/src/schemas/fields/tax-subtotal-schema.ts +0 -32
  694. package/src/schemas/fields/tax-totals.ts +0 -25
  695. package/src/schemas/fields/time-only.ts +0 -23
  696. package/src/schemas/invoice-response-document-actual-response-status.ts +0 -58
  697. package/src/schemas/invoice-response-document-actual-response.ts +0 -73
  698. package/src/schemas/invoice-response-schema.ts +0 -155
  699. package/src/schemas/invoice-response-status-reason-code.ts +0 -30
  700. package/src/schemas/invoice.ts +0 -43
  701. package/src/schemas/message-level-response-document-response-schema.ts +0 -33
  702. package/src/schemas/message-level-response-party-schema.ts +0 -18
  703. package/src/schemas/message-level-response-schema.ts +0 -96
  704. package/src/schemas/utils/base-64.ts +0 -34
  705. package/src/schemas/utils/vat-regex.ts +0 -51
  706. package/src/schemas/utils/xsd-time.ts +0 -9
  707. package/src/schemas/values/additional-document-reference-code.ts +0 -27
  708. package/src/schemas/values/allowance-charge-reason-code.ts +0 -29
  709. package/src/schemas/values/application-response-type-codes.ts +0 -25
  710. package/src/schemas/values/charge-reason-code.ts +0 -29
  711. package/src/schemas/values/country-code.ts +0 -36
  712. package/src/schemas/values/currency-codes.ts +0 -35
  713. package/src/schemas/values/document-type-codes.ts +0 -25
  714. package/src/schemas/values/document-type-schema.ts +0 -49
  715. package/src/schemas/values/duty-tax-fee-cateogries.ts +0 -28
  716. package/src/schemas/values/eas-codes.ts +0 -35
  717. package/src/schemas/values/icd-codes.ts +0 -28
  718. package/src/schemas/values/invoice-status-codes.ts +0 -25
  719. package/src/schemas/values/item-classification-code-schema.ts +0 -28
  720. package/src/schemas/values/mime-code.ts +0 -28
  721. package/src/schemas/values/op-status-action.ts +0 -25
  722. package/src/schemas/values/op-status-reason.ts +0 -25
  723. package/src/schemas/values/participant-identifier-code.ts +0 -25
  724. package/src/schemas/values/payment-means-codes-schema.ts +0 -36
  725. package/src/schemas/values/process-schema.ts +0 -41
  726. package/src/schemas/values/process-xml-identifier-schema.ts +0 -27
  727. package/src/schemas/values/vat-date-code.ts +0 -15
  728. package/src/schemas/values/vatex-code.ts +0 -28
  729. package/src/schemas.ts +0 -97
  730. /package/src/{effect → schemas}/utils/peppol-base-64-schema.ts +0 -0
  731. /package/src/{effect → schemas}/utils/peppol-vat-regex-schema.ts +0 -0
  732. /package/src/{effect → schemas}/values/additional-document-reference-code-schema.ts +0 -0
  733. /package/src/{effect → schemas}/values/allowance-charge-reason-code-schema.ts +0 -0
  734. /package/src/{effect → schemas}/values/application-response-type-code-schema.ts +0 -0
  735. /package/src/{effect → schemas}/values/charge-reason-code-schema.ts +0 -0
  736. /package/src/{effect → schemas}/values/electronic-codes-schema.ts +0 -0
  737. /package/src/{effect → schemas}/values/icd-codes-schema.ts +0 -0
  738. /package/src/{effect → schemas}/values/index.ts +0 -0
  739. /package/src/{effect → schemas}/values/invoice-status-code-schema.ts +0 -0
  740. /package/src/{effect → schemas}/values/item-classification-codes-schema.ts +0 -0
  741. /package/src/{effect → schemas}/values/mime-codes-schema.ts +0 -0
  742. /package/src/{effect → schemas}/values/op-status-action-schema.ts +0 -0
  743. /package/src/{effect → schemas}/values/op-status-reason-schema.ts +0 -0
  744. /package/src/{effect → schemas}/values/participant-identifier-code-schema.ts +0 -0
  745. /package/src/{effect → schemas}/values/payment-means-code-schema.ts +0 -0
  746. /package/src/{effect → schemas}/values/peppol-country-code-schema.ts +0 -0
  747. /package/src/{effect → schemas}/values/peppol-document-type-code-schema.ts +0 -0
  748. /package/src/{effect → schemas}/values/peppol-document-type-schema.ts +0 -0
  749. /package/src/{effect → schemas}/values/peppol-process-schema.ts +0 -0
  750. /package/src/{effect → schemas}/values/vat-date-code-schema.ts +0 -0
  751. /package/src/{effect → schemas}/values/vatex-code-schema.ts +0 -0
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-001',
@@ -12,10 +11,12 @@ const rule = {
12
11
 
13
12
  const ALLOWED_CODES = new Set(['380', '381']);
14
13
 
15
- export function validateIsR001(document: PeppolDocument): SchematronRuleResult {
14
+ function evaluateIsR001(document: PeppolDocument): boolean {
16
15
  if (getSupplierCountry(document) !== 'IS') {
17
- return schematronResult(rule, true);
16
+ return true;
18
17
  }
19
18
  const code = 'invoiceTypeCode' in document ? document.invoiceTypeCode : 'creditNoteTypeCode' in document ? document.creditNoteTypeCode : undefined;
20
- return schematronResult(rule, code !== undefined && !code.includes(' ') && ALLOWED_CODES.has(code));
19
+ return code !== undefined && !code.includes(' ') && ALLOWED_CODES.has(code);
21
20
  }
21
+
22
+ export const validateIsR001 = schematronRule(rule, evaluateIsR001);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-002',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IS-R-002]-If seller is icelandic then it shall contain sellers legal id',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR002(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR002(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const companyId = document.accountingSupplierParty.partyLegalEntity.companyId;
18
- return schematronResult(rule, Boolean(companyId?.id) && companyId?.schemeId === '0196');
17
+ return Boolean(companyId?.id) && companyId?.schemeId === '0196';
19
18
  }
19
+
20
+ export const validateIsR002 = schematronRule(rule, evaluateIsR002);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-003',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IS-R-003]-If seller is icelandic then it shall contain his address with street name and zip code',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR003(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR003(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const address = document.accountingSupplierParty.postalAddress;
18
- return schematronResult(rule, Boolean(address.streetName) && Boolean(address.postalZone));
17
+ return Boolean(address.streetName) && Boolean(address.postalZone);
19
18
  }
19
+
20
+ export const validateIsR003 = schematronRule(rule, evaluateIsR003);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getCustomerCountry, getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getCustomerCountry, getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-004',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IS-R-004]-If seller and buyer are icelandic then the invoice shall contain the buyers icelandic legal identifier',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR004(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR004(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS' || getCustomerCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const companyId = document.accountingCustomerParty.partyLegalEntity.companyId;
18
- return schematronResult(rule, Boolean(companyId?.id) && companyId?.schemeId === '0196');
17
+ return Boolean(companyId?.id) && companyId?.schemeId === '0196';
19
18
  }
19
+
20
+ export const validateIsR004 = schematronRule(rule, evaluateIsR004);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getCustomerCountry, getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getCustomerCountry, getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-005',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IS-R-005]-If seller and buyer are icelandic then the invoice shall contain the buyers address with street name and zip code',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR005(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR005(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS' || getCustomerCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const address = document.accountingCustomerParty.postalAddress;
18
- return schematronResult(rule, Boolean(address.streetName) && Boolean(address.postalZone));
17
+ return Boolean(address.streetName) && Boolean(address.postalZone);
19
18
  }
19
+
20
+ export const validateIsR005 = schematronRule(rule, evaluateIsR005);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-006',
@@ -10,17 +9,19 @@ const rule = {
10
9
  message: '[IS-R-006]-If seller is icelandic and payment means code is 9 then a 12 digit account id must exist',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR006(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR006(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const code9Payments = (document.paymentMeans ?? []).filter(payment => payment.paymentMeansCode.code === '9');
18
17
  if (code9Payments.length === 0) {
19
- return schematronResult(rule, true);
18
+ return true;
20
19
  }
21
20
  const passed = code9Payments.every(payment => {
22
21
  const accountId = payment.payeeFinancialAccount?.id;
23
22
  return typeof accountId === 'string' && accountId.trim().length === 12;
24
23
  });
25
- return schematronResult(rule, passed);
24
+ return passed;
26
25
  }
26
+
27
+ export const validateIsR006 = schematronRule(rule, evaluateIsR006);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-007',
@@ -10,17 +9,19 @@ const rule = {
10
9
  message: '[IS-R-007]-If seller is icelandic and payment means code is 42 then a 12 digit account id must exist',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR007(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR007(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const code42Payments = (document.paymentMeans ?? []).filter(payment => payment.paymentMeansCode.code === '42');
18
17
  if (code42Payments.length === 0) {
19
- return schematronResult(rule, true);
18
+ return true;
20
19
  }
21
20
  const passed = code42Payments.every(payment => {
22
21
  const accountId = payment.payeeFinancialAccount?.id;
23
22
  return typeof accountId === 'string' && accountId.trim().length === 12;
24
23
  });
25
- return schematronResult(rule, passed);
24
+ return passed;
26
25
  }
26
+
27
+ export const validateIsR007 = schematronRule(rule, evaluateIsR007);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-008',
@@ -12,17 +11,19 @@ const rule = {
12
11
 
13
12
  const DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
14
13
 
15
- export function validateIsR008(document: PeppolDocument): SchematronRuleResult {
14
+ function evaluateIsR008(document: PeppolDocument): boolean {
16
15
  if (getSupplierCountry(document) !== 'IS') {
17
- return schematronResult(rule, true);
16
+ return true;
18
17
  }
19
18
  const eindagiReferences = (document.additionalDocumentReferences ?? []).filter(ref => ref.documentDescription === 'EINDAGI');
20
19
  if (eindagiReferences.length === 0) {
21
- return schematronResult(rule, true);
20
+ return true;
22
21
  }
23
22
  const passed = eindagiReferences.every(ref => {
24
23
  const id = ref.id.id;
25
24
  return id.length === 10 && DATE_REGEX.test(id) && !Number.isNaN(Date.parse(id));
26
25
  });
27
- return schematronResult(rule, passed);
26
+ return passed;
28
27
  }
28
+
29
+ export const validateIsR008 = schematronRule(rule, evaluateIsR008);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-009',
@@ -10,13 +9,15 @@ const rule = {
10
9
  message: '[IS-R-009]-If seller is icelandic and invoice contains supporting description EINDAGI invoice must have due date',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR009(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR009(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const hasEindagi = (document.additionalDocumentReferences ?? []).some(ref => ref.documentDescription === 'EINDAGI');
18
17
  if (!hasEindagi) {
19
- return schematronResult(rule, true);
18
+ return true;
20
19
  }
21
- return schematronResult(rule, Boolean(document.dueDate));
20
+ return Boolean(document.dueDate);
22
21
  }
22
+
23
+ export const validateIsR009 = schematronRule(rule, evaluateIsR009);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IS-R-010',
@@ -10,21 +9,23 @@ const rule = {
10
9
  message: '[IS-R-010]-If seller is icelandic and invoice contains supporting description EINDAGI the id date must be same or later than due date',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateIsR010(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateIsR010(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IS') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const eindagiReferences = (document.additionalDocumentReferences ?? []).filter(ref => ref.documentDescription === 'EINDAGI');
18
17
  if (eindagiReferences.length === 0) {
19
- return schematronResult(rule, true);
18
+ return true;
20
19
  }
21
20
  const dueDate = document.dueDate;
22
21
  if (!dueDate) {
23
- return schematronResult(rule, false);
22
+ return false;
24
23
  }
25
24
  const passed = eindagiReferences.every(ref => {
26
25
  const id = ref.id.id;
27
26
  return id >= dueDate;
28
27
  });
29
- return schematronResult(rule, passed);
28
+ return passed;
30
29
  }
30
+
31
+ export const validateIsR010 = schematronRule(rule, evaluateIsR010);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IT-R-001',
@@ -10,12 +9,14 @@ const rule = {
10
9
  message: '[IT-R-001] BT-32 (Seller tax registration identifier) - For Italian suppliers BT-32 minimum length 11 and maximum length shall be 16.',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateItR001(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateItR001(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IT') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const companyIds =
18
17
  document.accountingSupplierParty.partyTaxSchemes?.filter(scheme => scheme.taxSchemeId.id !== 'VAT').map(scheme => scheme.companyId) ?? [];
19
18
  const passed = companyIds.every(id => /^[A-Z0-9]{11,16}$/.test(id));
20
- return schematronResult(rule, passed);
19
+ return passed;
21
20
  }
21
+
22
+ export const validateItR001 = schematronRule(rule, evaluateItR001);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IT-R-002',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IT-R-002] BT-35 (Seller address line 1) - Italian suppliers MUST provide the postal address line 1',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateItR002(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateItR002(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IT') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const streetName = document.accountingSupplierParty.postalAddress.streetName;
18
- return schematronResult(rule, typeof streetName === 'string' && streetName.trim() !== '');
17
+ return typeof streetName === 'string' && streetName.trim() !== '';
19
18
  }
19
+
20
+ export const validateItR002 = schematronRule(rule, evaluateItR002);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IT-R-003',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IT-R-003] BT-37 (Seller city) - Italian suppliers MUST provide the postal address city',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateItR003(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateItR003(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IT') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const cityName = document.accountingSupplierParty.postalAddress.cityName;
18
- return schematronResult(rule, typeof cityName === 'string' && cityName.trim() !== '');
17
+ return typeof cityName === 'string' && cityName.trim() !== '';
19
18
  }
19
+
20
+ export const validateItR003 = schematronRule(rule, evaluateItR003);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'IT-R-004',
@@ -10,10 +9,12 @@ const rule = {
10
9
  message: '[IT-R-004] BT-38 (Seller post code) - Italian suppliers MUST provide the postal address post code',
11
10
  } as const satisfies SchematronRule;
12
11
 
13
- export function validateItR004(document: PeppolDocument): SchematronRuleResult {
12
+ function evaluateItR004(document: PeppolDocument): boolean {
14
13
  if (getSupplierCountry(document) !== 'IT') {
15
- return schematronResult(rule, true);
14
+ return true;
16
15
  }
17
16
  const postalZone = document.accountingSupplierParty.postalAddress.postalZone;
18
- return schematronResult(rule, typeof postalZone === 'string' && postalZone.trim() !== '');
17
+ return typeof postalZone === 'string' && postalZone.trim() !== '';
19
18
  }
19
+
20
+ export const validateItR004 = schematronRule(rule, evaluateItR004);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-001',
@@ -11,10 +10,12 @@ const rule = {
11
10
  '[NL-R-001] For suppliers in the Netherlands, if the document is a creditnote, the document MUST contain an invoice reference (cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID)',
12
11
  } as const satisfies SchematronRule;
13
12
 
14
- export function validateNlR001(document: PeppolDocument): SchematronRuleResult {
13
+ function evaluateNlR001(document: PeppolDocument): boolean {
15
14
  if (getSupplierCountry(document) !== 'NL' || !('creditNoteTypeCode' in document)) {
16
- return schematronResult(rule, true);
15
+ return true;
17
16
  }
18
17
  const invoiceReference = document.billingReferences?.some(ref => Boolean(ref.invoiceDocumentReference.id));
19
- return schematronResult(rule, Boolean(invoiceReference));
18
+ return Boolean(invoiceReference);
20
19
  }
20
+
21
+ export const validateNlR001 = schematronRule(rule, evaluateNlR001);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-002',
@@ -11,10 +10,12 @@ const rule = {
11
10
  "[NL-R-002] For suppliers in the Netherlands the supplier's address (cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)",
12
11
  } as const satisfies SchematronRule;
13
12
 
14
- export function validateNlR002(document: PeppolDocument): SchematronRuleResult {
13
+ function evaluateNlR002(document: PeppolDocument): boolean {
15
14
  if (getSupplierCountry(document) !== 'NL') {
16
- return schematronResult(rule, true);
15
+ return true;
17
16
  }
18
17
  const address = document.accountingSupplierParty.postalAddress;
19
- return schematronResult(rule, Boolean(address.streetName) && Boolean(address.cityName) && Boolean(address.postalZone));
18
+ return Boolean(address.streetName) && Boolean(address.cityName) && Boolean(address.postalZone);
20
19
  }
20
+
21
+ export const validateNlR002 = schematronRule(rule, evaluateNlR002);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-003',
@@ -12,13 +11,15 @@ const rule = {
12
11
 
13
12
  const ALLOWED_SCHEMES = new Set(['0106', '0190']);
14
13
 
15
- export function validateNlR003(document: PeppolDocument): SchematronRuleResult {
14
+ function evaluateNlR003(document: PeppolDocument): boolean {
16
15
  if (getSupplierCountry(document) !== 'NL') {
17
- return schematronResult(rule, true);
16
+ return true;
18
17
  }
19
18
  const companyId = document.accountingSupplierParty.partyLegalEntity.companyId;
20
19
  if (!companyId?.id) {
21
- return schematronResult(rule, true);
20
+ return true;
22
21
  }
23
- return schematronResult(rule, Boolean(companyId.schemeId && ALLOWED_SCHEMES.has(companyId.schemeId)));
22
+ return Boolean(companyId.schemeId && ALLOWED_SCHEMES.has(companyId.schemeId));
24
23
  }
24
+
25
+ export const validateNlR003 = schematronRule(rule, evaluateNlR003);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getCustomerCountry, getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getCustomerCountry, getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-004',
@@ -11,10 +10,12 @@ const rule = {
11
10
  '[NL-R-004] For suppliers in the Netherlands, if the customer is in the Netherlands, the customer address (cac:AccountingCustomerParty/cac:Party/cac:PostalAddress) MUST contain the street name (cbc:StreetName), the city (cbc:CityName) and post code (cbc:PostalZone)',
12
11
  } as const satisfies SchematronRule;
13
12
 
14
- export function validateNlR004(document: PeppolDocument): SchematronRuleResult {
13
+ function evaluateNlR004(document: PeppolDocument): boolean {
15
14
  if (getSupplierCountry(document) !== 'NL' || getCustomerCountry(document) !== 'NL') {
16
- return schematronResult(rule, true);
15
+ return true;
17
16
  }
18
17
  const address = document.accountingCustomerParty.postalAddress;
19
- return schematronResult(rule, Boolean(address.streetName) && Boolean(address.cityName) && Boolean(address.postalZone));
18
+ return Boolean(address.streetName) && Boolean(address.cityName) && Boolean(address.postalZone);
20
19
  }
20
+
21
+ export const validateNlR004 = schematronRule(rule, evaluateNlR004);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getCustomerCountry, getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getCustomerCountry, getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-005',
@@ -13,13 +12,15 @@ const rule = {
13
12
 
14
13
  const ALLOWED_SCHEMES = new Set(['0106', '0190']);
15
14
 
16
- export function validateNlR005(document: PeppolDocument): SchematronRuleResult {
15
+ function evaluateNlR005(document: PeppolDocument): boolean {
17
16
  if (getSupplierCountry(document) !== 'NL' || getCustomerCountry(document) !== 'NL') {
18
- return schematronResult(rule, true);
17
+ return true;
19
18
  }
20
19
  const companyId = document.accountingCustomerParty.partyLegalEntity.companyId;
21
20
  if (!companyId?.id) {
22
- return schematronResult(rule, true);
21
+ return true;
23
22
  }
24
- return schematronResult(rule, Boolean(companyId.schemeId && ALLOWED_SCHEMES.has(companyId.schemeId)));
23
+ return Boolean(companyId.schemeId && ALLOWED_SCHEMES.has(companyId.schemeId));
25
24
  }
25
+
26
+ export const validateNlR005 = schematronRule(rule, evaluateNlR005);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-006',
@@ -11,14 +10,16 @@ const rule = {
11
10
  "[NL-R-006] For suppliers in the Netherlands, if the fiscal representative is in the Netherlands, the representative's address (cac:TaxRepresentativeParty/cac:PostalAddress) MUST contain street name (cbc:StreetName), city (cbc:CityName) and post code (cbc:PostalZone)",
12
11
  } as const satisfies SchematronRule;
13
12
 
14
- export function validateNlR006(document: PeppolDocument): SchematronRuleResult {
13
+ function evaluateNlR006(document: PeppolDocument): boolean {
15
14
  if (getSupplierCountry(document) !== 'NL') {
16
- return schematronResult(rule, true);
15
+ return true;
17
16
  }
18
17
  const taxRep = document.taxRepresentativeParty;
19
18
  if (!taxRep || taxRep.postalAddress.countryCode.identificationCode.toUpperCase() !== 'NL') {
20
- return schematronResult(rule, true);
19
+ return true;
21
20
  }
22
21
  const address = taxRep.postalAddress;
23
- return schematronResult(rule, Boolean(address.streetName) && Boolean(address.cityName) && Boolean(address.postalZone));
22
+ return Boolean(address.streetName) && Boolean(address.cityName) && Boolean(address.postalZone);
24
23
  }
24
+
25
+ export const validateNlR006 = schematronRule(rule, evaluateNlR006);
@@ -1,8 +1,7 @@
1
- import type { PeppolDocument } from '#/document';
1
+ import type { PeppolDocument } from '#/schemas/peppol-document-schema';
2
2
  import type { SchematronRule } from '#/schematron/helpers';
3
- import type { SchematronRuleResult } from '#/schematron/types';
4
3
 
5
- import { getSupplierCountry, schematronResult } from '#/schematron/helpers';
4
+ import { getSupplierCountry, schematronRule } from '#/schematron/helpers';
6
5
 
7
6
  const rule = {
8
7
  id: 'NL-R-007',
@@ -11,15 +10,17 @@ const rule = {
11
10
  '[NL-R-007] For suppliers in the Netherlands, the supplier MUST provide a means of payment (cac:PaymentMeans) if the payment is from customer to supplier',
12
11
  } as const satisfies SchematronRule;
13
12
 
14
- export function validateNlR007(document: PeppolDocument): SchematronRuleResult {
13
+ function evaluateNlR007(document: PeppolDocument): boolean {
15
14
  if (getSupplierCountry(document) !== 'NL') {
16
- return schematronResult(rule, true);
15
+ return true;
17
16
  }
18
17
  const payable = document.legalMonetaryTotal.payableAmount.value;
19
18
  const isInvoice = 'invoiceLines' in document;
20
19
  const isCreditNote = 'creditNoteLines' in document;
21
20
  if ((isInvoice && payable <= 0) || (isCreditNote && payable >= 0)) {
22
- return schematronResult(rule, true);
21
+ return true;
23
22
  }
24
- return schematronResult(rule, (document.paymentMeans?.length ?? 0) > 0);
23
+ return (document.paymentMeans?.length ?? 0) > 0;
25
24
  }
25
+
26
+ export const validateNlR007 = schematronRule(rule, evaluateNlR007);