@hub-kit/core 0.3.0

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 (499) hide show
  1. package/README.md +125 -0
  2. package/cli/hub-kit.mjs +112 -0
  3. package/dist/adapters/bank-reconciliation.d.ts +100 -0
  4. package/dist/adapters/bank-reconciliation.js +1 -0
  5. package/dist/adapters/bank-sync-log.d.ts +46 -0
  6. package/dist/adapters/bank-sync-log.js +1 -0
  7. package/dist/adapters/category-rules.d.ts +94 -0
  8. package/dist/adapters/category-rules.js +1 -0
  9. package/dist/adapters/companies.d.ts +85 -0
  10. package/dist/adapters/companies.js +3 -0
  11. package/dist/adapters/customers.d.ts +71 -0
  12. package/dist/adapters/customers.js +1 -0
  13. package/dist/adapters/exclusion-rules.d.ts +34 -0
  14. package/dist/adapters/exclusion-rules.js +15 -0
  15. package/dist/adapters/file-naming.d.ts +36 -0
  16. package/dist/adapters/file-naming.js +1 -0
  17. package/dist/adapters/index.d.ts +24 -0
  18. package/dist/adapters/index.js +1 -0
  19. package/dist/adapters/invoice-detail.d.ts +126 -0
  20. package/dist/adapters/invoice-detail.js +1 -0
  21. package/dist/adapters/invoice-list.d.ts +63 -0
  22. package/dist/adapters/invoice-list.js +1 -0
  23. package/dist/adapters/invoice-upload.d.ts +26 -0
  24. package/dist/adapters/invoice-upload.js +1 -0
  25. package/dist/adapters/manual-bookings.d.ts +56 -0
  26. package/dist/adapters/manual-bookings.js +1 -0
  27. package/dist/adapters/notifications.d.ts +31 -0
  28. package/dist/adapters/notifications.js +1 -0
  29. package/dist/adapters/open-items.d.ts +42 -0
  30. package/dist/adapters/open-items.js +1 -0
  31. package/dist/adapters/opos-whitelist.d.ts +38 -0
  32. package/dist/adapters/opos-whitelist.js +1 -0
  33. package/dist/adapters/outgoing-invoices.d.ts +32 -0
  34. package/dist/adapters/outgoing-invoices.js +1 -0
  35. package/dist/adapters/overview.d.ts +68 -0
  36. package/dist/adapters/overview.js +1 -0
  37. package/dist/adapters/processing-log.d.ts +48 -0
  38. package/dist/adapters/processing-log.js +1 -0
  39. package/dist/adapters/properties.d.ts +87 -0
  40. package/dist/adapters/properties.js +1 -0
  41. package/dist/adapters/supplier-detail.d.ts +64 -0
  42. package/dist/adapters/supplier-detail.js +1 -0
  43. package/dist/adapters/supplier-list.d.ts +21 -0
  44. package/dist/adapters/supplier-list.js +1 -0
  45. package/dist/adapters/team.d.ts +79 -0
  46. package/dist/adapters/team.js +1 -0
  47. package/dist/adapters/trash.d.ts +26 -0
  48. package/dist/adapters/trash.js +1 -0
  49. package/dist/adapters/vat-rules.d.ts +83 -0
  50. package/dist/adapters/vat-rules.js +1 -0
  51. package/dist/components/access/index.d.ts +3 -0
  52. package/dist/components/access/index.js +3 -0
  53. package/dist/components/access/permission-checklist.d.ts +13 -0
  54. package/dist/components/access/permission-checklist.js +19 -0
  55. package/dist/components/access/permission-matrix.d.ts +12 -0
  56. package/dist/components/access/permission-matrix.js +18 -0
  57. package/dist/components/access/types.d.ts +15 -0
  58. package/dist/components/access/types.js +1 -0
  59. package/dist/components/dashboard/date-range-calendar.d.ts +19 -0
  60. package/dist/components/dashboard/date-range-calendar.js +97 -0
  61. package/dist/components/dashboard/index.d.ts +23 -0
  62. package/dist/components/dashboard/index.js +14 -0
  63. package/dist/components/dashboard/kpi-card.d.ts +13 -0
  64. package/dist/components/dashboard/kpi-card.js +7 -0
  65. package/dist/components/dashboard/money-cards-row.d.ts +29 -0
  66. package/dist/components/dashboard/money-cards-row.js +28 -0
  67. package/dist/components/dashboard/money-trend-chart.d.ts +13 -0
  68. package/dist/components/dashboard/money-trend-chart.js +16 -0
  69. package/dist/components/dashboard/panel.d.ts +9 -0
  70. package/dist/components/dashboard/panel.js +5 -0
  71. package/dist/components/dashboard/period-picker.d.ts +25 -0
  72. package/dist/components/dashboard/period-picker.js +82 -0
  73. package/dist/components/dashboard/periods.d.ts +13 -0
  74. package/dist/components/dashboard/periods.js +63 -0
  75. package/dist/components/dashboard/pipeline-stages-panel.d.ts +14 -0
  76. package/dist/components/dashboard/pipeline-stages-panel.js +12 -0
  77. package/dist/components/dashboard/processing-summary-panel.d.ts +34 -0
  78. package/dist/components/dashboard/processing-summary-panel.js +11 -0
  79. package/dist/components/dashboard/ranked-bars.d.ts +15 -0
  80. package/dist/components/dashboard/ranked-bars.js +16 -0
  81. package/dist/components/dashboard/ranked-list-panel.d.ts +14 -0
  82. package/dist/components/dashboard/ranked-list-panel.js +9 -0
  83. package/dist/components/dashboard/stage-tiles.d.ts +15 -0
  84. package/dist/components/dashboard/stage-tiles.js +6 -0
  85. package/dist/components/dashboard/stat-rows-panel.d.ts +25 -0
  86. package/dist/components/dashboard/stat-rows-panel.js +7 -0
  87. package/dist/components/dashboard/stat-tile.d.ts +20 -0
  88. package/dist/components/dashboard/stat-tile.js +9 -0
  89. package/dist/components/feedback/index.d.ts +4 -0
  90. package/dist/components/feedback/index.js +2 -0
  91. package/dist/components/feedback/query-states.d.ts +27 -0
  92. package/dist/components/feedback/query-states.js +38 -0
  93. package/dist/components/feedback/table-pagination.d.ts +20 -0
  94. package/dist/components/feedback/table-pagination.js +15 -0
  95. package/dist/components/invoice-queue/index.d.ts +5 -0
  96. package/dist/components/invoice-queue/index.js +3 -0
  97. package/dist/components/invoice-queue/next-action-cell.d.ts +5 -0
  98. package/dist/components/invoice-queue/next-action-cell.js +9 -0
  99. package/dist/components/invoice-queue/queue-kpi-card.d.ts +19 -0
  100. package/dist/components/invoice-queue/queue-kpi-card.js +31 -0
  101. package/dist/components/invoice-queue/queue-kpi-row.d.ts +22 -0
  102. package/dist/components/invoice-queue/queue-kpi-row.js +12 -0
  103. package/dist/components/notifications/alerts.d.ts +25 -0
  104. package/dist/components/notifications/alerts.js +66 -0
  105. package/dist/components/notifications/bell.d.ts +14 -0
  106. package/dist/components/notifications/bell.js +17 -0
  107. package/dist/components/notifications/highlight.d.ts +4 -0
  108. package/dist/components/notifications/highlight.js +7 -0
  109. package/dist/components/notifications/index.d.ts +7 -0
  110. package/dist/components/notifications/index.js +6 -0
  111. package/dist/components/notifications/reminder-dialog.d.ts +24 -0
  112. package/dist/components/notifications/reminder-dialog.js +54 -0
  113. package/dist/components/notifications/types.d.ts +27 -0
  114. package/dist/components/notifications/types.js +1 -0
  115. package/dist/components/notifications/use-notification-acks.d.ts +7 -0
  116. package/dist/components/notifications/use-notification-acks.js +37 -0
  117. package/dist/components/shell/breadcrumbs.d.ts +7 -0
  118. package/dist/components/shell/breadcrumbs.js +38 -0
  119. package/dist/components/shell/index.d.ts +3 -0
  120. package/dist/components/shell/index.js +3 -0
  121. package/dist/components/shell/shell.d.ts +30 -0
  122. package/dist/components/shell/shell.js +110 -0
  123. package/dist/components/shell/types.d.ts +23 -0
  124. package/dist/components/shell/types.js +3 -0
  125. package/dist/components/tour/find-target.d.ts +1 -0
  126. package/dist/components/tour/find-target.js +3 -0
  127. package/dist/components/tour/index.d.ts +14 -0
  128. package/dist/components/tour/index.js +8 -0
  129. package/dist/components/tour/labels.d.ts +10 -0
  130. package/dist/components/tour/labels.js +9 -0
  131. package/dist/components/tour/seen-store.d.ts +3 -0
  132. package/dist/components/tour/seen-store.js +34 -0
  133. package/dist/components/tour/tour-blocks.d.ts +4 -0
  134. package/dist/components/tour/tour-blocks.js +27 -0
  135. package/dist/components/tour/tour-button.d.ts +4 -0
  136. package/dist/components/tour/tour-button.js +12 -0
  137. package/dist/components/tour/tour-card.d.ts +11 -0
  138. package/dist/components/tour/tour-card.js +7 -0
  139. package/dist/components/tour/tour-context.d.ts +16 -0
  140. package/dist/components/tour/tour-context.js +2 -0
  141. package/dist/components/tour/tour-overlay.d.ts +1 -0
  142. package/dist/components/tour/tour-overlay.js +165 -0
  143. package/dist/components/tour/tour-provider.d.ts +9 -0
  144. package/dist/components/tour/tour-provider.js +80 -0
  145. package/dist/components/tour/types.d.ts +44 -0
  146. package/dist/components/tour/types.js +1 -0
  147. package/dist/components/tour/use-tour.d.ts +3 -0
  148. package/dist/components/tour/use-tour.js +9 -0
  149. package/dist/hooks/use-mobile.d.ts +1 -0
  150. package/dist/hooks/use-mobile.js +15 -0
  151. package/dist/i18n/index.d.ts +15 -0
  152. package/dist/i18n/index.js +15 -0
  153. package/dist/lib/bank-import/classify.d.ts +8 -0
  154. package/dist/lib/bank-import/classify.js +89 -0
  155. package/dist/lib/bank-import/column-guess.d.ts +2 -0
  156. package/dist/lib/bank-import/column-guess.js +40 -0
  157. package/dist/lib/bank-import/csv.d.ts +3 -0
  158. package/dist/lib/bank-import/csv.js +20 -0
  159. package/dist/lib/bank-import/duplicates.d.ts +2 -0
  160. package/dist/lib/bank-import/duplicates.js +21 -0
  161. package/dist/lib/bank-import/index.d.ts +12 -0
  162. package/dist/lib/bank-import/index.js +9 -0
  163. package/dist/lib/bank-import/mapping-storage.d.ts +3 -0
  164. package/dist/lib/bank-import/mapping-storage.js +29 -0
  165. package/dist/lib/bank-import/normalize.d.ts +4 -0
  166. package/dist/lib/bank-import/normalize.js +82 -0
  167. package/dist/lib/bank-import/parse-file.d.ts +7 -0
  168. package/dist/lib/bank-import/parse-file.js +23 -0
  169. package/dist/lib/bank-import/types.d.ts +31 -0
  170. package/dist/lib/bank-import/types.js +1 -0
  171. package/dist/lib/bank-import/xlsx.d.ts +2 -0
  172. package/dist/lib/bank-import/xlsx.js +25 -0
  173. package/dist/lib/class-names.d.ts +2 -0
  174. package/dist/lib/class-names.js +5 -0
  175. package/dist/lib/download.d.ts +2 -0
  176. package/dist/lib/download.js +14 -0
  177. package/dist/lib/formatters.d.ts +6 -0
  178. package/dist/lib/formatters.js +24 -0
  179. package/dist/lib/index.d.ts +9 -0
  180. package/dist/lib/index.js +6 -0
  181. package/dist/lib/opos-whitelist/index.d.ts +2 -0
  182. package/dist/lib/opos-whitelist/index.js +1 -0
  183. package/dist/lib/opos-whitelist/opos.d.ts +14 -0
  184. package/dist/lib/opos-whitelist/opos.js +49 -0
  185. package/dist/lib/query-result.d.ts +12 -0
  186. package/dist/lib/query-result.js +1 -0
  187. package/dist/lib/tour-placeholders/index.d.ts +2 -0
  188. package/dist/lib/tour-placeholders/index.js +1 -0
  189. package/dist/lib/tour-placeholders/overview.d.ts +12 -0
  190. package/dist/lib/tour-placeholders/overview.js +139 -0
  191. package/dist/pages/bank-accounts/BankAccountsPage.d.ts +7 -0
  192. package/dist/pages/bank-accounts/BankAccountsPage.js +21 -0
  193. package/dist/pages/bank-accounts/index.d.ts +4 -0
  194. package/dist/pages/bank-accounts/index.js +2 -0
  195. package/dist/pages/bank-accounts/labels.d.ts +15 -0
  196. package/dist/pages/bank-accounts/labels.js +14 -0
  197. package/dist/pages/bank-import/BankImportWizard.d.ts +9 -0
  198. package/dist/pages/bank-import/BankImportWizard.js +158 -0
  199. package/dist/pages/bank-import/index.d.ts +4 -0
  200. package/dist/pages/bank-import/index.js +2 -0
  201. package/dist/pages/bank-import/labels.d.ts +44 -0
  202. package/dist/pages/bank-import/labels.js +43 -0
  203. package/dist/pages/bank-sync-log/BankSyncLogPage.d.ts +7 -0
  204. package/dist/pages/bank-sync-log/BankSyncLogPage.js +77 -0
  205. package/dist/pages/bank-sync-log/index.d.ts +4 -0
  206. package/dist/pages/bank-sync-log/index.js +2 -0
  207. package/dist/pages/bank-sync-log/labels.d.ts +21 -0
  208. package/dist/pages/bank-sync-log/labels.js +20 -0
  209. package/dist/pages/bank-transactions/BankMatchPanel.d.ts +8 -0
  210. package/dist/pages/bank-transactions/BankMatchPanel.js +75 -0
  211. package/dist/pages/bank-transactions/BankTransactionsPage.d.ts +7 -0
  212. package/dist/pages/bank-transactions/BankTransactionsPage.js +59 -0
  213. package/dist/pages/bank-transactions/badges.d.ts +8 -0
  214. package/dist/pages/bank-transactions/badges.js +24 -0
  215. package/dist/pages/bank-transactions/index.d.ts +6 -0
  216. package/dist/pages/bank-transactions/index.js +4 -0
  217. package/dist/pages/bank-transactions/labels.d.ts +41 -0
  218. package/dist/pages/bank-transactions/labels.js +40 -0
  219. package/dist/pages/bank-transactions/sort-control.d.ts +17 -0
  220. package/dist/pages/bank-transactions/sort-control.js +8 -0
  221. package/dist/pages/bank-transactions/use-table-view.d.ts +23 -0
  222. package/dist/pages/bank-transactions/use-table-view.js +54 -0
  223. package/dist/pages/category-rules/CategoryRulesPage.d.ts +7 -0
  224. package/dist/pages/category-rules/CategoryRulesPage.js +160 -0
  225. package/dist/pages/category-rules/index.d.ts +4 -0
  226. package/dist/pages/category-rules/index.js +2 -0
  227. package/dist/pages/category-rules/labels.d.ts +66 -0
  228. package/dist/pages/category-rules/labels.js +72 -0
  229. package/dist/pages/companies/company-detail-page.d.ts +10 -0
  230. package/dist/pages/companies/company-detail-page.js +184 -0
  231. package/dist/pages/companies/company-form.d.ts +20 -0
  232. package/dist/pages/companies/company-form.js +23 -0
  233. package/dist/pages/companies/company-list-page.d.ts +9 -0
  234. package/dist/pages/companies/company-list-page.js +109 -0
  235. package/dist/pages/companies/known-spellings-card.d.ts +8 -0
  236. package/dist/pages/companies/known-spellings-card.js +65 -0
  237. package/dist/pages/companies/labels.d.ts +105 -0
  238. package/dist/pages/companies/labels.js +104 -0
  239. package/dist/pages/companies/sort-control.d.ts +17 -0
  240. package/dist/pages/companies/sort-control.js +8 -0
  241. package/dist/pages/companies/use-infinite-rows.d.ts +6 -0
  242. package/dist/pages/companies/use-infinite-rows.js +24 -0
  243. package/dist/pages/companies/use-table-view.d.ts +23 -0
  244. package/dist/pages/companies/use-table-view.js +56 -0
  245. package/dist/pages/customers/company-chip.d.ts +6 -0
  246. package/dist/pages/customers/company-chip.js +9 -0
  247. package/dist/pages/customers/copy-button.d.ts +6 -0
  248. package/dist/pages/customers/copy-button.js +31 -0
  249. package/dist/pages/customers/customer-detail-page.d.ts +10 -0
  250. package/dist/pages/customers/customer-detail-page.js +83 -0
  251. package/dist/pages/customers/customer-list-page.d.ts +9 -0
  252. package/dist/pages/customers/customer-list-page.js +65 -0
  253. package/dist/pages/customers/edit-customer-dialog.d.ts +9 -0
  254. package/dist/pages/customers/edit-customer-dialog.js +72 -0
  255. package/dist/pages/customers/form-hints.d.ts +6 -0
  256. package/dist/pages/customers/form-hints.js +9 -0
  257. package/dist/pages/customers/invoice-status-badge.d.ts +10 -0
  258. package/dist/pages/customers/invoice-status-badge.js +22 -0
  259. package/dist/pages/customers/labels.d.ts +116 -0
  260. package/dist/pages/customers/labels.js +117 -0
  261. package/dist/pages/customers/new-customer-dialog.d.ts +6 -0
  262. package/dist/pages/customers/new-customer-dialog.js +93 -0
  263. package/dist/pages/customers/sort-control.d.ts +14 -0
  264. package/dist/pages/customers/sort-control.js +9 -0
  265. package/dist/pages/customers/use-table-view.d.ts +23 -0
  266. package/dist/pages/customers/use-table-view.js +56 -0
  267. package/dist/pages/exclusion-rules/exclusion-rules-page.d.ts +7 -0
  268. package/dist/pages/exclusion-rules/exclusion-rules-page.js +114 -0
  269. package/dist/pages/exclusion-rules/labels.d.ts +53 -0
  270. package/dist/pages/exclusion-rules/labels.js +61 -0
  271. package/dist/pages/file-naming/build-filename.d.ts +3 -0
  272. package/dist/pages/file-naming/build-filename.js +82 -0
  273. package/dist/pages/file-naming/file-naming-page.d.ts +10 -0
  274. package/dist/pages/file-naming/file-naming-page.js +120 -0
  275. package/dist/pages/file-naming/labels.d.ts +44 -0
  276. package/dist/pages/file-naming/labels.js +44 -0
  277. package/dist/pages/index.d.ts +63 -0
  278. package/dist/pages/index.js +48 -0
  279. package/dist/pages/invoice-detail/InvoiceDetailPage.d.ts +11 -0
  280. package/dist/pages/invoice-detail/InvoiceDetailPage.js +292 -0
  281. package/dist/pages/invoice-detail/OutgoingInvoiceFlag.d.ts +26 -0
  282. package/dist/pages/invoice-detail/OutgoingInvoiceFlag.js +16 -0
  283. package/dist/pages/invoice-detail/ReviewBadge.d.ts +15 -0
  284. package/dist/pages/invoice-detail/ReviewBadge.js +23 -0
  285. package/dist/pages/invoice-detail/ReviewCard.d.ts +17 -0
  286. package/dist/pages/invoice-detail/ReviewCard.js +12 -0
  287. package/dist/pages/invoice-detail/SideBySide.d.ts +5 -0
  288. package/dist/pages/invoice-detail/SideBySide.js +5 -0
  289. package/dist/pages/invoice-detail/WorkflowHistoryList.d.ts +23 -0
  290. package/dist/pages/invoice-detail/WorkflowHistoryList.js +32 -0
  291. package/dist/pages/invoice-detail/WorkflowLadder.d.ts +20 -0
  292. package/dist/pages/invoice-detail/WorkflowLadder.js +16 -0
  293. package/dist/pages/invoice-detail/history.d.ts +23 -0
  294. package/dist/pages/invoice-detail/history.js +76 -0
  295. package/dist/pages/invoice-detail/index.d.ts +21 -0
  296. package/dist/pages/invoice-detail/index.js +11 -0
  297. package/dist/pages/invoice-detail/labels.d.ts +79 -0
  298. package/dist/pages/invoice-detail/labels.js +139 -0
  299. package/dist/pages/invoice-detail/pipeline-types.d.ts +58 -0
  300. package/dist/pages/invoice-detail/pipeline-types.js +1 -0
  301. package/dist/pages/invoice-detail/review-recheck.d.ts +8 -0
  302. package/dist/pages/invoice-detail/review-recheck.js +103 -0
  303. package/dist/pages/invoice-detail/review.d.ts +91 -0
  304. package/dist/pages/invoice-detail/review.js +310 -0
  305. package/dist/pages/invoice-list/badges.d.ts +23 -0
  306. package/dist/pages/invoice-list/badges.js +26 -0
  307. package/dist/pages/invoice-list/index.d.ts +5 -0
  308. package/dist/pages/invoice-list/index.js +3 -0
  309. package/dist/pages/invoice-list/invoice-list-page.d.ts +13 -0
  310. package/dist/pages/invoice-list/invoice-list-page.js +114 -0
  311. package/dist/pages/invoice-list/labels.d.ts +36 -0
  312. package/dist/pages/invoice-list/labels.js +29 -0
  313. package/dist/pages/invoice-list/sort-control.d.ts +17 -0
  314. package/dist/pages/invoice-list/sort-control.js +8 -0
  315. package/dist/pages/invoice-list/use-table-view.d.ts +23 -0
  316. package/dist/pages/invoice-list/use-table-view.js +54 -0
  317. package/dist/pages/invoice-upload/InvoiceUploadPage.d.ts +7 -0
  318. package/dist/pages/invoice-upload/InvoiceUploadPage.js +115 -0
  319. package/dist/pages/invoice-upload/index.d.ts +4 -0
  320. package/dist/pages/invoice-upload/index.js +2 -0
  321. package/dist/pages/invoice-upload/labels.d.ts +29 -0
  322. package/dist/pages/invoice-upload/labels.js +28 -0
  323. package/dist/pages/manual-bookings/ManualBookingsPage.d.ts +7 -0
  324. package/dist/pages/manual-bookings/ManualBookingsPage.js +161 -0
  325. package/dist/pages/manual-bookings/index.d.ts +4 -0
  326. package/dist/pages/manual-bookings/index.js +2 -0
  327. package/dist/pages/manual-bookings/labels.d.ts +53 -0
  328. package/dist/pages/manual-bookings/labels.js +52 -0
  329. package/dist/pages/notifications/labels.d.ts +22 -0
  330. package/dist/pages/notifications/labels.js +21 -0
  331. package/dist/pages/notifications/notifications-page.d.ts +14 -0
  332. package/dist/pages/notifications/notifications-page.js +81 -0
  333. package/dist/pages/open-items/OpenItemsPage.d.ts +11 -0
  334. package/dist/pages/open-items/OpenItemsPage.js +110 -0
  335. package/dist/pages/open-items/index.d.ts +6 -0
  336. package/dist/pages/open-items/index.js +3 -0
  337. package/dist/pages/open-items/labels.d.ts +37 -0
  338. package/dist/pages/open-items/labels.js +36 -0
  339. package/dist/pages/open-items/urgency.d.ts +8 -0
  340. package/dist/pages/open-items/urgency.js +27 -0
  341. package/dist/pages/opos-whitelist/OposWhitelistPage.d.ts +7 -0
  342. package/dist/pages/opos-whitelist/OposWhitelistPage.js +165 -0
  343. package/dist/pages/opos-whitelist/index.d.ts +4 -0
  344. package/dist/pages/opos-whitelist/index.js +2 -0
  345. package/dist/pages/opos-whitelist/labels.d.ts +56 -0
  346. package/dist/pages/opos-whitelist/labels.js +70 -0
  347. package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.d.ts +7 -0
  348. package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.js +169 -0
  349. package/dist/pages/outgoing-invoices/index.d.ts +4 -0
  350. package/dist/pages/outgoing-invoices/index.js +2 -0
  351. package/dist/pages/outgoing-invoices/labels.d.ts +43 -0
  352. package/dist/pages/outgoing-invoices/labels.js +42 -0
  353. package/dist/pages/outgoing-invoices/sort-control.d.ts +17 -0
  354. package/dist/pages/outgoing-invoices/sort-control.js +8 -0
  355. package/dist/pages/outgoing-invoices/use-table-view.d.ts +23 -0
  356. package/dist/pages/outgoing-invoices/use-table-view.js +54 -0
  357. package/dist/pages/overview/labels.d.ts +35 -0
  358. package/dist/pages/overview/labels.js +34 -0
  359. package/dist/pages/overview/overview-page.d.ts +22 -0
  360. package/dist/pages/overview/overview-page.js +127 -0
  361. package/dist/pages/processing-log/labels.d.ts +54 -0
  362. package/dist/pages/processing-log/labels.js +53 -0
  363. package/dist/pages/processing-log/mail-parsing.d.ts +21 -0
  364. package/dist/pages/processing-log/mail-parsing.js +52 -0
  365. package/dist/pages/processing-log/processing-log-page.d.ts +9 -0
  366. package/dist/pages/processing-log/processing-log-page.js +206 -0
  367. package/dist/pages/properties/badges.d.ts +20 -0
  368. package/dist/pages/properties/badges.js +45 -0
  369. package/dist/pages/properties/company-assignment-field.d.ts +11 -0
  370. package/dist/pages/properties/company-assignment-field.js +13 -0
  371. package/dist/pages/properties/form-field.d.ts +6 -0
  372. package/dist/pages/properties/form-field.js +9 -0
  373. package/dist/pages/properties/labels.d.ts +124 -0
  374. package/dist/pages/properties/labels.js +128 -0
  375. package/dist/pages/properties/name-variants-card.d.ts +7 -0
  376. package/dist/pages/properties/name-variants-card.js +60 -0
  377. package/dist/pages/properties/property-detail-page.d.ts +10 -0
  378. package/dist/pages/properties/property-detail-page.js +150 -0
  379. package/dist/pages/properties/property-list-page.d.ts +13 -0
  380. package/dist/pages/properties/property-list-page.js +201 -0
  381. package/dist/pages/properties/sort-control.d.ts +14 -0
  382. package/dist/pages/properties/sort-control.js +9 -0
  383. package/dist/pages/properties/use-infinite-rows.d.ts +6 -0
  384. package/dist/pages/properties/use-infinite-rows.js +26 -0
  385. package/dist/pages/properties/use-table-view.d.ts +23 -0
  386. package/dist/pages/properties/use-table-view.js +56 -0
  387. package/dist/pages/supplier-detail/SupplierDetailPage.d.ts +10 -0
  388. package/dist/pages/supplier-detail/SupplierDetailPage.js +157 -0
  389. package/dist/pages/supplier-detail/index.d.ts +4 -0
  390. package/dist/pages/supplier-detail/index.js +2 -0
  391. package/dist/pages/supplier-detail/labels.d.ts +46 -0
  392. package/dist/pages/supplier-detail/labels.js +45 -0
  393. package/dist/pages/supplier-list/SupplierListPage.d.ts +9 -0
  394. package/dist/pages/supplier-list/SupplierListPage.js +102 -0
  395. package/dist/pages/supplier-list/index.d.ts +4 -0
  396. package/dist/pages/supplier-list/index.js +2 -0
  397. package/dist/pages/supplier-list/labels.d.ts +33 -0
  398. package/dist/pages/supplier-list/labels.js +32 -0
  399. package/dist/pages/supplier-list/sort-control.d.ts +17 -0
  400. package/dist/pages/supplier-list/sort-control.js +8 -0
  401. package/dist/pages/supplier-list/use-table-view.d.ts +23 -0
  402. package/dist/pages/supplier-list/use-table-view.js +54 -0
  403. package/dist/pages/team/account-dialogs.d.ts +12 -0
  404. package/dist/pages/team/account-dialogs.js +49 -0
  405. package/dist/pages/team/employee-editor.d.ts +19 -0
  406. package/dist/pages/team/employee-editor.js +124 -0
  407. package/dist/pages/team/labels.d.ts +99 -0
  408. package/dist/pages/team/labels.js +98 -0
  409. package/dist/pages/team/new-employee.d.ts +8 -0
  410. package/dist/pages/team/new-employee.js +103 -0
  411. package/dist/pages/team/roles-tab.d.ts +6 -0
  412. package/dist/pages/team/roles-tab.js +46 -0
  413. package/dist/pages/team/team-page.d.ts +7 -0
  414. package/dist/pages/team/team-page.js +81 -0
  415. package/dist/pages/team/temp-password-dialog.d.ts +11 -0
  416. package/dist/pages/team/temp-password-dialog.js +23 -0
  417. package/dist/pages/trash/labels.d.ts +68 -0
  418. package/dist/pages/trash/labels.js +69 -0
  419. package/dist/pages/trash/trash-page.d.ts +9 -0
  420. package/dist/pages/trash/trash-page.js +259 -0
  421. package/dist/pages/vat-rules/labels.d.ts +110 -0
  422. package/dist/pages/vat-rules/labels.js +109 -0
  423. package/dist/pages/vat-rules/new-rule-dialog.d.ts +7 -0
  424. package/dist/pages/vat-rules/new-rule-dialog.js +134 -0
  425. package/dist/pages/vat-rules/rule-row.d.ts +20 -0
  426. package/dist/pages/vat-rules/rule-row.js +120 -0
  427. package/dist/pages/vat-rules/vat-rules-page.d.ts +9 -0
  428. package/dist/pages/vat-rules/vat-rules-page.js +61 -0
  429. package/dist/ui/alert-dialog.d.ts +20 -0
  430. package/dist/ui/alert-dialog.js +41 -0
  431. package/dist/ui/badge.d.ts +9 -0
  432. package/dist/ui/badge.js +20 -0
  433. package/dist/ui/breadcrumb.d.ts +19 -0
  434. package/dist/ui/breadcrumb.js +23 -0
  435. package/dist/ui/button.d.ts +11 -0
  436. package/dist/ui/button.js +33 -0
  437. package/dist/ui/calendar.d.ts +8 -0
  438. package/dist/ui/calendar.js +75 -0
  439. package/dist/ui/card.d.ts +8 -0
  440. package/dist/ui/card.js +16 -0
  441. package/dist/ui/chart.d.ts +62 -0
  442. package/dist/ui/chart.js +118 -0
  443. package/dist/ui/checkbox.d.ts +4 -0
  444. package/dist/ui/checkbox.js +11 -0
  445. package/dist/ui/collapsible.d.ts +5 -0
  446. package/dist/ui/collapsible.js +5 -0
  447. package/dist/ui/combobox.d.ts +24 -0
  448. package/dist/ui/combobox.js +55 -0
  449. package/dist/ui/command.d.ts +80 -0
  450. package/dist/ui/command.js +29 -0
  451. package/dist/ui/dialog.d.ts +19 -0
  452. package/dist/ui/dialog.js +58 -0
  453. package/dist/ui/dropdown-menu.d.ts +27 -0
  454. package/dist/ui/dropdown-menu.js +33 -0
  455. package/dist/ui/field-context.d.ts +4 -0
  456. package/dist/ui/field-context.js +6 -0
  457. package/dist/ui/field.d.ts +3 -0
  458. package/dist/ui/field.js +8 -0
  459. package/dist/ui/icon-action.d.ts +3 -0
  460. package/dist/ui/icon-action.js +8 -0
  461. package/dist/ui/index.d.ts +32 -0
  462. package/dist/ui/index.js +32 -0
  463. package/dist/ui/input.d.ts +3 -0
  464. package/dist/ui/input.js +11 -0
  465. package/dist/ui/label.d.ts +5 -0
  466. package/dist/ui/label.js +15 -0
  467. package/dist/ui/multi-combobox.d.ts +18 -0
  468. package/dist/ui/multi-combobox.js +40 -0
  469. package/dist/ui/popover.d.ts +9 -0
  470. package/dist/ui/popover.js +12 -0
  471. package/dist/ui/scroll-area.d.ts +5 -0
  472. package/dist/ui/scroll-area.js +9 -0
  473. package/dist/ui/scroll-shadow.d.ts +8 -0
  474. package/dist/ui/scroll-shadow.js +57 -0
  475. package/dist/ui/select.d.ts +13 -0
  476. package/dist/ui/select.js +31 -0
  477. package/dist/ui/separator.d.ts +4 -0
  478. package/dist/ui/separator.js +7 -0
  479. package/dist/ui/sheet.d.ts +25 -0
  480. package/dist/ui/sheet.js +40 -0
  481. package/dist/ui/sidebar.d.ts +65 -0
  482. package/dist/ui/sidebar.js +207 -0
  483. package/dist/ui/skeleton.d.ts +2 -0
  484. package/dist/ui/skeleton.js +6 -0
  485. package/dist/ui/sonner.d.ts +5 -0
  486. package/dist/ui/sonner.js +13 -0
  487. package/dist/ui/switch.d.ts +4 -0
  488. package/dist/ui/switch.js +7 -0
  489. package/dist/ui/table.d.ts +12 -0
  490. package/dist/ui/table.js +24 -0
  491. package/dist/ui/tabs.d.ts +7 -0
  492. package/dist/ui/tabs.js +12 -0
  493. package/dist/ui/textarea.d.ts +3 -0
  494. package/dist/ui/textarea.js +11 -0
  495. package/dist/ui/tooltip.d.ts +7 -0
  496. package/dist/ui/tooltip.js +11 -0
  497. package/package.json +80 -0
  498. package/themes/TOKENS.md +57 -0
  499. package/themes/default.css +60 -0
@@ -0,0 +1,76 @@
1
+ const KNOWN_TYPES = [
2
+ "notiz",
3
+ "statuswechsel",
4
+ "aenderung",
5
+ "zuweisung",
6
+ "zuordnung",
7
+ "loeschung",
8
+ "regel",
9
+ "nicht_relevant",
10
+ "archiviert",
11
+ ];
12
+ export function historyTypeLabel(type, config, labels) {
13
+ const known = [...KNOWN_TYPES, ...config.approvalHistoryTypes];
14
+ return known.includes(type) ? labels.typeLabel(type) : type;
15
+ }
16
+ function legacyActionFromText(text, config, format) {
17
+ for (const id of config.legacyActionIds) {
18
+ const de = format.approvalActionLabelDe(id);
19
+ if (!de || de === id)
20
+ continue;
21
+ if (text === de || text.startsWith(`${de}: `))
22
+ return id;
23
+ }
24
+ return null;
25
+ }
26
+ function legacyCorrectionTarget(text, format) {
27
+ const match = /^Manuell korrigiert:\s*.+?\s*→\s*(.+)$/.exec(text.trim());
28
+ if (!match)
29
+ return null;
30
+ return format.workflowOrder.find((s) => format.workflowLabelDe(s) === match[1].trim()) ?? null;
31
+ }
32
+ export function historyComment(entry, config, format) {
33
+ const stored = entry.data?.kommentar;
34
+ if (typeof stored === "string" && stored.trim() !== "")
35
+ return stored.trim();
36
+ const text = entry.text?.trim();
37
+ if (!text)
38
+ return null;
39
+ const id = legacyActionFromText(text, config, format);
40
+ if (!id)
41
+ return null;
42
+ const de = format.approvalActionLabelDe(id);
43
+ return text.length > de.length + 2 ? text.slice(de.length + 2) : null;
44
+ }
45
+ export function historyTargetStatus(entry, config, format) {
46
+ const d = entry.data;
47
+ const raw = d?.korrektur_nach ?? d?.nach;
48
+ if (typeof raw === "string" && raw.trim() !== "")
49
+ return raw;
50
+ const from = entry.text ? legacyActionFromText(entry.text.trim(), config, format) : null;
51
+ return from ? (config.actionTargetStatus[from] ?? null) : legacyCorrectionTarget(entry.text ?? "", format);
52
+ }
53
+ export function historyStateLabel(entry, config, format, labels) {
54
+ const target = historyTargetStatus(entry, config, format);
55
+ return target ? labels.stateLabel(target) : historyTypeLabel(entry.type, config, labels);
56
+ }
57
+ export function historyQualifier(entry, labels) {
58
+ if (entry.type === "korrektur")
59
+ return labels.corrected;
60
+ if (entry.type === "rueckfrage")
61
+ return labels.queryAdditional;
62
+ return null;
63
+ }
64
+ export function historyLines(entry, config, format) {
65
+ const lines = entry.data?.lines;
66
+ if (Array.isArray(lines)) {
67
+ const strings = lines.filter((l) => typeof l === "string" && l.trim() !== "");
68
+ if (strings.length > 0)
69
+ return strings;
70
+ }
71
+ if (historyTargetStatus(entry, config, format) !== null || entry.type === "korrektur" || entry.type === "rueckfrage") {
72
+ const comment = historyComment(entry, config, format);
73
+ return comment ? [comment] : [];
74
+ }
75
+ return entry.text && entry.text.trim() !== "" ? [entry.text] : [];
76
+ }
@@ -0,0 +1,21 @@
1
+ export type { Confidence, Validation, Extracted, InvoiceReviewFields, InvoiceHistoryEntry } from "./pipeline-types";
2
+ export { VALIDATION_GATES, SEVERITY_INFORMATIONAL, SEVERITY_ACTION_REQUIRED, VALIDATION_FIELD_REASON, REVIEW_CHECK_REASON, SOURCE_HUMAN, reviewChecks, isManuallyCorrected, validationBase, validationCorrections, validationDetail, writeValidationDetail, validationFlat, reviewReasonsDetail, reviewReasonNumbers, buildReviewSummary, reviewReasonConfidence, reviewReasonIbanCount, reviewReasonIds, reviewScore, withoutEmDash, reviewLines, reviewCheckLabelDe, hasNoReviewChecks, } from "./review";
3
+ export type { ValidationGateKey, ReviewReasonId, ReviewCheck, ValidationDetailEntry, ValidationDetail, ReviewReason, ReviewSummary, ReviewLine, ReviewLabels, } from "./review";
4
+ export { ibanCandidates, ibanChecksumValid, invoiceRechecked } from "./review-recheck";
5
+ export { historyTypeLabel, historyComment, historyTargetStatus, historyStateLabel, historyQualifier, historyLines, } from "./history";
6
+ export type { HistoryConfig, HistoryFormat, HistoryLabels } from "./history";
7
+ export { isOutgoingInvoice, OutgoingInvoiceBanner, OutgoingInvoiceBadge } from "./OutgoingInvoiceFlag";
8
+ export type { OutgoingInvoiceLabels } from "./OutgoingInvoiceFlag";
9
+ export { SideBySide } from "./SideBySide";
10
+ export { WorkflowLadder } from "./WorkflowLadder";
11
+ export type { LadderColors, WorkflowLadderLabels } from "./WorkflowLadder";
12
+ export { WorkflowHistoryList } from "./WorkflowHistoryList";
13
+ export type { WorkflowHistoryRow, WorkflowHistoryLabels } from "./WorkflowHistoryList";
14
+ export { ReviewBadge } from "./ReviewBadge";
15
+ export type { ReviewBadgeLabels } from "./ReviewBadge";
16
+ export { ReviewCard } from "./ReviewCard";
17
+ export type { ReviewCardLabels } from "./ReviewCard";
18
+ export { englishInvoiceDetailLabels } from "./labels";
19
+ export type { InvoiceDetailLabels, InvoiceDetailPageLabels } from "./labels";
20
+ export { InvoiceDetailPage } from "./InvoiceDetailPage";
21
+ export type { InvoiceDetailPageProps } from "./InvoiceDetailPage";
@@ -0,0 +1,11 @@
1
+ export { VALIDATION_GATES, SEVERITY_INFORMATIONAL, SEVERITY_ACTION_REQUIRED, VALIDATION_FIELD_REASON, REVIEW_CHECK_REASON, SOURCE_HUMAN, reviewChecks, isManuallyCorrected, validationBase, validationCorrections, validationDetail, writeValidationDetail, validationFlat, reviewReasonsDetail, reviewReasonNumbers, buildReviewSummary, reviewReasonConfidence, reviewReasonIbanCount, reviewReasonIds, reviewScore, withoutEmDash, reviewLines, reviewCheckLabelDe, hasNoReviewChecks, } from "./review.js";
2
+ export { ibanCandidates, ibanChecksumValid, invoiceRechecked } from "./review-recheck.js";
3
+ export { historyTypeLabel, historyComment, historyTargetStatus, historyStateLabel, historyQualifier, historyLines, } from "./history.js";
4
+ export { isOutgoingInvoice, OutgoingInvoiceBanner, OutgoingInvoiceBadge } from "./OutgoingInvoiceFlag.js";
5
+ export { SideBySide } from "./SideBySide.js";
6
+ export { WorkflowLadder } from "./WorkflowLadder.js";
7
+ export { WorkflowHistoryList } from "./WorkflowHistoryList.js";
8
+ export { ReviewBadge } from "./ReviewBadge.js";
9
+ export { ReviewCard } from "./ReviewCard.js";
10
+ export { englishInvoiceDetailLabels } from "./labels.js";
11
+ export { InvoiceDetailPage } from "./InvoiceDetailPage.js";
@@ -0,0 +1,79 @@
1
+ import { ReviewBadgeLabels } from "./ReviewBadge";
2
+ import { ReviewCardLabels } from "./ReviewCard";
3
+ import { WorkflowLadderLabels } from "./WorkflowLadder";
4
+ import { WorkflowHistoryLabels } from "./WorkflowHistoryList";
5
+ import { OutgoingInvoiceLabels } from "./OutgoingInvoiceFlag";
6
+ import { ReviewLabels } from "./review";
7
+ import { HistoryLabels } from "./history";
8
+ export interface InvoiceDetailPageLabels {
9
+ backToList: string;
10
+ notFoundTitle: string;
11
+ notFoundBody: (id: string) => string;
12
+ noInvoiceNumber: string;
13
+ tabOverview: string;
14
+ tabApproval: string;
15
+ tabPayment: string;
16
+ tabDetails: string;
17
+ tabHistory: string;
18
+ edit: string;
19
+ save: string;
20
+ cancel: string;
21
+ saving: string;
22
+ saved: string;
23
+ saveFailed: (error: string) => string;
24
+ fieldIssuer: string;
25
+ fieldInvoiceNumber: string;
26
+ fieldOrderNumber: string;
27
+ fieldDocumentDate: string;
28
+ fieldDueDate: string;
29
+ fieldServiceDate: string;
30
+ fieldAmountNet: string;
31
+ fieldVatRate: string;
32
+ fieldVatAmount: string;
33
+ fieldAmountGross: string;
34
+ fieldCurrency: string;
35
+ fieldCompany: string;
36
+ fieldProperty: string;
37
+ fieldCategory: string;
38
+ fieldRecipientName: string;
39
+ fieldCustomerNumber: string;
40
+ fieldPaymentReference: string;
41
+ fieldPaymentMethod: string;
42
+ fieldTaxNote: string;
43
+ fieldServiceDescription: string;
44
+ unsavedTitle: string;
45
+ unsavedBody: (fields: string) => string;
46
+ unsavedDiscard: string;
47
+ unsavedKeepEditing: string;
48
+ addNotePlaceholder: string;
49
+ addNoteButton: string;
50
+ noteAdded: string;
51
+ deleteButton: string;
52
+ deleteDialogTitle: string;
53
+ deleteDialogDescription: string;
54
+ deleteReasonPlaceholder: string;
55
+ deleteConfirm: string;
56
+ deletedToast: string;
57
+ archiveButton: string;
58
+ unarchiveButton: string;
59
+ archivedBanner: (date: string) => string;
60
+ markPaid: string;
61
+ markUnpaid: string;
62
+ paidToast: string;
63
+ payableAccount: string;
64
+ noPayableAccount: string;
65
+ approvalComment: string;
66
+ approvalCommentPlaceholder: string;
67
+ runAction: string;
68
+ noActionsAvailable: string;
69
+ openSupplier: string;
70
+ }
71
+ export interface InvoiceDetailLabels {
72
+ review: ReviewBadgeLabels & ReviewCardLabels & ReviewLabels;
73
+ workflowLadder: WorkflowLadderLabels;
74
+ workflowHistory: WorkflowHistoryLabels;
75
+ outgoing: OutgoingInvoiceLabels;
76
+ history: HistoryLabels;
77
+ page: InvoiceDetailPageLabels;
78
+ }
79
+ export declare const englishInvoiceDetailLabels: InvoiceDetailLabels;
@@ -0,0 +1,139 @@
1
+ const DURATION_UNIT_WORD = {
2
+ minuten: "minute",
3
+ stunden: "hour",
4
+ tage: "day",
5
+ };
6
+ function pluralize(count, word) {
7
+ return `${count} ${word}${count === 1 ? "" : "s"}`;
8
+ }
9
+ const REASON_TEXT = {
10
+ brutto_fehlt: () => "The gross amount is missing.",
11
+ steller_fehlt: () => "The issuer is missing.",
12
+ summe_stimmt_nicht: () => "Net + VAT does not add up to the total.",
13
+ ust_satz_ungueltig: () => "The VAT rate is not one of the active rates.",
14
+ iban_ungueltig: () => "The IBAN's checksum does not check out.",
15
+ datum_zukunft: () => "The document date is in the future.",
16
+ rechnungsnr_fehlt: () => "The invoice number is missing.",
17
+ datum_fehlt: () => "The document date is missing.",
18
+ iban_fehlt: () => "No IBAN was found to pay this to.",
19
+ empfaenger_fehlt: () => "The recipient name is missing.",
20
+ iban_mehrere: (p) => `${p.ibanCount ?? "Several"} IBANs were found; which one is unclear.`,
21
+ konfidenz_unter_schwelle: (p) => p.confidence ? `Extraction confidence ${p.confidence.found}% is below the ${p.confidence.required}% required.` : "Extraction confidence is below the required threshold.",
22
+ nicht_relevant: () => "This does not read as an invoice this pipeline handles.",
23
+ gesellschaft_fehlt: () => "No company could be resolved for this invoice.",
24
+ manuell_markiert: () => "Marked for review by hand.",
25
+ keine_ueberweisung_belegt: () => "No transfer proof was found for this payment.",
26
+ lastschrift_erkannt: () => "This looks like a direct debit, not a transfer.",
27
+ ocr_ohne_sichtpruefung: () => "OCR text with no visual check yet.",
28
+ keine_rechnung_bestaetigt: () => "Not yet confirmed as an invoice.",
29
+ konfidenz_unter_sicherheitsgrenze: () => "Confidence is below the safety floor.",
30
+ zahlungsnachweis_veraltet: () => "The payment proof is out of date.",
31
+ nicht_lesbar: () => "The document could not be read.",
32
+ ausgeschlossen: () => "Excluded by an exclusion rule.",
33
+ };
34
+ export const englishInvoiceDetailLabels = {
35
+ review: {
36
+ none: "Reviewed",
37
+ duplicate: "Duplicate",
38
+ excluded: "Excluded",
39
+ alreadyPaid: "Already paid",
40
+ needed: "Needs review",
41
+ title: "Needs review",
42
+ checks: (count) => pluralize(count, "check"),
43
+ choose: "Choose",
44
+ fix: "Fix",
45
+ gateLabel: () => undefined,
46
+ gateHint: (field) => field,
47
+ reasonText: (id, params) => REASON_TEXT[id](params),
48
+ sumComparison: (expected, found) => `Expected ${expected}, document says ${found}.`,
49
+ formatMoney: (value) => value.toFixed(2),
50
+ },
51
+ workflowLadder: {
52
+ navAriaLabel: "Workflow stage",
53
+ stepLabel: (step) => step,
54
+ },
55
+ workflowHistory: {
56
+ emptyText: "No history yet.",
57
+ actorSystem: "System",
58
+ actingAs: (name) => `acting as ${name}`,
59
+ reason: "Reason",
60
+ arrivedLabel: "Arrived",
61
+ formatDateTime: (iso) => iso,
62
+ durationShort: (value, unit) => pluralize(value, DURATION_UNIT_WORD[unit]),
63
+ },
64
+ outgoing: {
65
+ banner: (issuer, recipient) => `Outgoing invoice: from ${issuer} to ${recipient}.`,
66
+ bannerShort: "Outgoing",
67
+ unknownIssuer: "unknown issuer",
68
+ unknownRecipient: "unknown recipient",
69
+ },
70
+ history: {
71
+ typeLabel: (type) => type,
72
+ stateLabel: (targetStatus) => targetStatus,
73
+ corrected: "Manually corrected",
74
+ queryAdditional: "Sent back with a query",
75
+ },
76
+ page: {
77
+ backToList: "Back to invoices",
78
+ notFoundTitle: "Invoice not found",
79
+ notFoundBody: (id) => `No invoice matches "${id}".`,
80
+ noInvoiceNumber: "No invoice number",
81
+ tabOverview: "Overview",
82
+ tabApproval: "Approval",
83
+ tabPayment: "Payment",
84
+ tabDetails: "Details",
85
+ tabHistory: "History",
86
+ edit: "Edit",
87
+ save: "Save",
88
+ cancel: "Cancel",
89
+ saving: "Saving…",
90
+ saved: "Saved.",
91
+ saveFailed: (error) => `Save failed: ${error}`,
92
+ fieldIssuer: "Issuer",
93
+ fieldInvoiceNumber: "Invoice number",
94
+ fieldOrderNumber: "Order number",
95
+ fieldDocumentDate: "Document date",
96
+ fieldDueDate: "Due date",
97
+ fieldServiceDate: "Service date",
98
+ fieldAmountNet: "Net amount",
99
+ fieldVatRate: "VAT rate",
100
+ fieldVatAmount: "VAT amount",
101
+ fieldAmountGross: "Gross amount",
102
+ fieldCurrency: "Currency",
103
+ fieldCompany: "Company",
104
+ fieldProperty: "Property",
105
+ fieldCategory: "Category",
106
+ fieldRecipientName: "Recipient",
107
+ fieldCustomerNumber: "Customer number",
108
+ fieldPaymentReference: "Payment reference",
109
+ fieldPaymentMethod: "Payment method",
110
+ fieldTaxNote: "Tax note",
111
+ fieldServiceDescription: "Service description",
112
+ unsavedTitle: "Unsaved changes",
113
+ unsavedBody: (fields) => `You have unsaved changes to: ${fields}. Discard them?`,
114
+ unsavedDiscard: "Discard",
115
+ unsavedKeepEditing: "Keep editing",
116
+ addNotePlaceholder: "Add a note…",
117
+ addNoteButton: "Add note",
118
+ noteAdded: "Note added.",
119
+ deleteButton: "Delete",
120
+ deleteDialogTitle: "Delete this invoice?",
121
+ deleteDialogDescription: "This moves the invoice to trash. It can be restored later.",
122
+ deleteReasonPlaceholder: "Reason (optional)",
123
+ deleteConfirm: "Delete",
124
+ deletedToast: "Invoice deleted.",
125
+ archiveButton: "Archive",
126
+ unarchiveButton: "Restore from archive",
127
+ archivedBanner: (date) => `Archived on ${date}.`,
128
+ markPaid: "Mark as paid",
129
+ markUnpaid: "Mark as unpaid",
130
+ paidToast: "Payment status updated.",
131
+ payableAccount: "Payable account",
132
+ noPayableAccount: "No payable account on file.",
133
+ approvalComment: "Comment",
134
+ approvalCommentPlaceholder: "Add a comment (optional)…",
135
+ runAction: "Confirm",
136
+ noActionsAvailable: "No approval action is available right now.",
137
+ openSupplier: "View supplier",
138
+ },
139
+ };
@@ -0,0 +1,58 @@
1
+ export interface Confidence {
2
+ issuer?: number;
3
+ invoiceNumber?: number;
4
+ documentDate?: number;
5
+ amountNet?: number;
6
+ vatAmount?: number;
7
+ amountGross?: number;
8
+ companyCode?: number;
9
+ propertyCode?: number;
10
+ [field: string]: number | undefined;
11
+ }
12
+ export interface Validation {
13
+ summe_ok?: boolean;
14
+ datum_vorhanden?: boolean;
15
+ brutto_vorhanden?: boolean;
16
+ steller_vorhanden?: boolean;
17
+ rechnungsnr_vorhanden?: boolean;
18
+ ust_satz_ok?: boolean | null;
19
+ iban_ok?: boolean | null;
20
+ datum_plausibel?: boolean | null;
21
+ kleinbetrag?: boolean;
22
+ decision_reason?: string;
23
+ [field: string]: unknown;
24
+ }
25
+ export interface Extracted {
26
+ konfidenz?: Confidence;
27
+ validation_detail?: Record<string, unknown> | null;
28
+ validation?: Validation | null;
29
+ richtung?: string | null;
30
+ zwischensumme_brutto?: number | string | null;
31
+ iban?: string | null;
32
+ review_checks?: unknown;
33
+ [field: string]: unknown;
34
+ }
35
+ export interface InvoiceReviewFields {
36
+ extracted: Extracted | null;
37
+ validation: Validation | null;
38
+ validation_detail?: Record<string, unknown> | null;
39
+ status: string | null;
40
+ issuer: string | null;
41
+ document_date: string | null;
42
+ invoice_number: string | null;
43
+ amount_net: number | null;
44
+ vat_amount: number | null;
45
+ amount_gross: number | null;
46
+ vat_rate: number | null;
47
+ recipient_name: string | null;
48
+ company_code: string | null;
49
+ }
50
+ export interface InvoiceHistoryEntry {
51
+ id: number;
52
+ invoiceId: string;
53
+ type: string;
54
+ text: string | null;
55
+ data: Record<string, unknown> | null;
56
+ actor: string | null;
57
+ createdAt: string;
58
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { InvoiceReviewFields } from "./pipeline-types";
2
+ export declare function ibanCandidates(raw: string | null | undefined): string[];
3
+ export declare function ibanChecksumValid(candidate: string): boolean;
4
+ export declare function invoiceRechecked<T extends InvoiceReviewFields>(invoice: T, opts?: {
5
+ supplierIban?: string | null;
6
+ actor?: string | null;
7
+ now?: string;
8
+ }): T;
@@ -0,0 +1,103 @@
1
+ import { SOURCE_HUMAN, validationBase, writeValidationDetail, } from "./review.js";
2
+ const IBAN_CHARS = /^[A-Z0-9]{15,34}$/;
3
+ const IBAN_SEPARATOR = /[;,/|]|\s{2,}|\bund\b/i;
4
+ export function ibanCandidates(raw) {
5
+ if (!raw)
6
+ return [];
7
+ return String(raw)
8
+ .split(new RegExp(IBAN_SEPARATOR.source, "gi"))
9
+ .map((part) => (part ?? "").trim())
10
+ .filter(Boolean);
11
+ }
12
+ export function ibanChecksumValid(candidate) {
13
+ const s = candidate.trim().toUpperCase().replace(/\s/g, "");
14
+ if (!IBAN_CHARS.test(s))
15
+ return false;
16
+ if (!/^[A-Z]{2}[0-9]{2}/.test(s))
17
+ return false;
18
+ const rearranged = s.slice(4) + s.slice(0, 4);
19
+ let expanded = "";
20
+ for (const c of rearranged) {
21
+ const value = parseInt(c, 36);
22
+ if (Number.isNaN(value))
23
+ return false;
24
+ expanded += String(value);
25
+ }
26
+ return BigInt(expanded) % 97n === 1n;
27
+ }
28
+ const SUM_TOLERANCE = 0.02;
29
+ function statusFor(ok) {
30
+ if (ok === null)
31
+ return "not_applicable";
32
+ return ok ? "ok" : "failed";
33
+ }
34
+ function num(v) {
35
+ const n = typeof v === "string" ? Number(v) : v;
36
+ return typeof n === "number" && Number.isFinite(n) ? n : null;
37
+ }
38
+ function applied(entry) {
39
+ return (entry?.status ?? "").trim().toLowerCase() !== "not_applicable";
40
+ }
41
+ function ibanSource(invoice, supplierIban) {
42
+ const own = (supplierIban ?? "").trim();
43
+ if (own)
44
+ return own;
45
+ const fromDocument = invoice.extracted?.iban;
46
+ return typeof fromDocument === "string" ? fromDocument : null;
47
+ }
48
+ function results(invoice, pipeline, supplierIban, today) {
49
+ const net = num(invoice.amount_net);
50
+ const vat = num(invoice.vat_amount);
51
+ const gross = num(invoice.amount_gross);
52
+ const subtotal = num(invoice.extracted?.zwischensumme_brutto) ?? gross;
53
+ const rate = num(invoice.vat_rate);
54
+ const activeRates = pipeline.vat_rate_valid?.values?.active_rates
55
+ ?.map(num)
56
+ .filter((n) => n != null);
57
+ const candidates = ibanCandidates(ibanSource(invoice, supplierIban));
58
+ const count = candidates.length;
59
+ return {
60
+ iban_checksum_valid: count === 0 ? null : candidates.every(ibanChecksumValid),
61
+ payable_iban_present: applied(pipeline.payable_iban_present) ? count > 0 : null,
62
+ iban_unambiguous: applied(pipeline.iban_unambiguous) && count > 0 ? count <= 1 : null,
63
+ gross_present: gross != null,
64
+ issuer_present: !!(invoice.issuer ?? "").trim(),
65
+ date_present: !!(invoice.document_date ?? "").trim(),
66
+ invoice_number_present: !!(invoice.invoice_number ?? "").trim(),
67
+ sum_matches: subtotal != null && net != null && vat != null
68
+ ? Math.abs(net + vat - subtotal) <= SUM_TOLERANCE
69
+ : null,
70
+ vat_rate_valid: rate == null || !activeRates?.length ? null : activeRates.includes(Math.round(rate)),
71
+ date_not_future: invoice.document_date ? invoice.document_date.slice(0, 10) <= today : null,
72
+ recipient_present: applied(pipeline.recipient_present) ? !!(invoice.recipient_name ?? "").trim() : null,
73
+ assignment_resolved: !!(invoice.company_code ?? "").trim(),
74
+ };
75
+ }
76
+ export function invoiceRechecked(invoice, opts = {}) {
77
+ const base = validationBase(invoice);
78
+ if (!base)
79
+ return invoice;
80
+ const now = opts.now ?? new Date().toISOString();
81
+ const next = results(invoice, base, opts.supplierIban ?? null, now.slice(0, 10));
82
+ const corrections = {};
83
+ for (const [field, ok] of Object.entries(next)) {
84
+ const original = base[field];
85
+ if (!original)
86
+ continue;
87
+ const newStatus = statusFor(ok);
88
+ if (newStatus === (original.status ?? "").trim().toLowerCase())
89
+ continue;
90
+ corrections[field] = {
91
+ ...original,
92
+ status: newStatus,
93
+ message: "Re-checked against the current data.",
94
+ source: SOURCE_HUMAN,
95
+ edited_at: now,
96
+ edited_by: opts.actor ?? null,
97
+ };
98
+ }
99
+ return {
100
+ ...invoice,
101
+ validation_detail: writeValidationDetail(base, corrections),
102
+ };
103
+ }
@@ -0,0 +1,91 @@
1
+ import { InvoiceReviewFields, Validation } from "./pipeline-types";
2
+ export type ValidationGateKey = "brutto_vorhanden" | "steller_vorhanden" | "datum_vorhanden" | "rechnungsnr_vorhanden" | "summe_ok" | "ust_satz_ok" | "iban_ok" | "datum_plausibel";
3
+ export declare const VALIDATION_GATES: ValidationGateKey[];
4
+ export type ReviewReasonId = "brutto_fehlt" | "steller_fehlt" | "summe_stimmt_nicht" | "ust_satz_ungueltig" | "iban_ungueltig" | "datum_zukunft" | "rechnungsnr_fehlt" | "datum_fehlt" | "iban_fehlt" | "empfaenger_fehlt" | "iban_mehrere" | "konfidenz_unter_schwelle" | "nicht_relevant" | "gesellschaft_fehlt" | "manuell_markiert" | "keine_ueberweisung_belegt" | "lastschrift_erkannt" | "ocr_ohne_sichtpruefung" | "keine_rechnung_bestaetigt" | "konfidenz_unter_sicherheitsgrenze" | "zahlungsnachweis_veraltet" | "nicht_lesbar" | "ausgeschlossen";
5
+ export interface ReviewCheck {
6
+ field?: string;
7
+ status?: string;
8
+ severity?: string;
9
+ message?: string;
10
+ values?: Record<string, unknown>;
11
+ }
12
+ export declare const SEVERITY_INFORMATIONAL = "informational";
13
+ export declare const SEVERITY_ACTION_REQUIRED = "action_required";
14
+ export declare function reviewChecks(invoice: Pick<InvoiceReviewFields, "extracted">): ReviewCheck[] | null;
15
+ export interface ValidationDetailEntry {
16
+ field?: string;
17
+ status?: string;
18
+ values?: Record<string, unknown>;
19
+ message?: string;
20
+ source?: string;
21
+ edited_at?: string;
22
+ edited_by?: string | null;
23
+ }
24
+ export type ValidationDetail = Record<string, ValidationDetailEntry>;
25
+ export declare const VALIDATION_FIELD_REASON: Record<string, ReviewReasonId>;
26
+ export declare const REVIEW_CHECK_REASON: Record<string, ReviewReasonId>;
27
+ export declare const SOURCE_HUMAN = "human";
28
+ export declare function isManuallyCorrected(entry: ValidationDetailEntry | undefined): boolean;
29
+ export declare function validationBase(invoice: Pick<InvoiceReviewFields, "extracted" | "validation_detail">): ValidationDetail | null;
30
+ export declare function validationCorrections(invoice: Pick<InvoiceReviewFields, "extracted" | "validation_detail">): ValidationDetail | null;
31
+ export declare function validationDetail(invoice: Pick<InvoiceReviewFields, "extracted" | "validation_detail">): ValidationDetail | null;
32
+ export declare function writeValidationDetail(base: ValidationDetail | null, corrections: ValidationDetail | null): Record<string, unknown>;
33
+ export declare function validationFlat(invoice: Pick<InvoiceReviewFields, "extracted" | "validation">): Validation;
34
+ export interface ReviewReason {
35
+ id: ReviewReasonId | null;
36
+ field: string;
37
+ severity?: string;
38
+ message?: string;
39
+ values?: Record<string, unknown>;
40
+ }
41
+ export declare function reviewReasonsDetail(invoice: Pick<InvoiceReviewFields, "validation" | "extracted" | "validation_detail">): ReviewReason[];
42
+ export declare function reviewReasonNumbers(reason: ReviewReason): {
43
+ expected: number;
44
+ found: number;
45
+ } | null;
46
+ export interface ReviewSummary {
47
+ reasons: ReviewReason[];
48
+ passed: {
49
+ field: string;
50
+ id: ReviewReasonId | null;
51
+ }[];
52
+ }
53
+ export declare function buildReviewSummary(invoice: Pick<InvoiceReviewFields, "validation" | "extracted" | "validation_detail">): ReviewSummary;
54
+ export declare function reviewReasonConfidence(reason: ReviewReason): {
55
+ found: number;
56
+ required: number;
57
+ } | null;
58
+ export declare function reviewReasonIbanCount(reason: ReviewReason): number | null;
59
+ export declare function reviewReasonIds(invoice: Pick<InvoiceReviewFields, "validation" | "extracted" | "validation_detail">): ReviewReasonId[];
60
+ export declare function reviewScore(invoice: Pick<InvoiceReviewFields, "validation" | "status" | "extracted" | "validation_detail">): number;
61
+ export declare function withoutEmDash(text: string): string;
62
+ export interface ReviewLine {
63
+ field: string;
64
+ title?: string;
65
+ text: string;
66
+ numbers?: string;
67
+ severity?: string;
68
+ jumpTo?: {
69
+ tab: string;
70
+ anchor: string;
71
+ };
72
+ }
73
+ export interface ReviewLabels {
74
+ gateLabel: (field: string) => string | undefined;
75
+ gateHint: (field: string) => string;
76
+ reasonText: (id: ReviewReasonId, params: {
77
+ confidence?: {
78
+ found: number;
79
+ required: number;
80
+ };
81
+ ibanCount?: number;
82
+ }) => string;
83
+ sumComparison: (expected: string, found: string) => string;
84
+ formatMoney: (value: number) => string;
85
+ }
86
+ export declare function reviewLines(reasons: ReviewReason[], labels: ReviewLabels, jumpTargets: Record<string, {
87
+ tab: string;
88
+ anchor: string;
89
+ }>): ReviewLine[];
90
+ export declare function reviewCheckLabelDe(field: string, labelDe: (field: string) => string | undefined): string;
91
+ export declare function hasNoReviewChecks(invoice: Pick<InvoiceReviewFields, "validation" | "extracted" | "validation_detail">): boolean;