@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.
- package/README.md +125 -0
- package/cli/hub-kit.mjs +112 -0
- package/dist/adapters/bank-reconciliation.d.ts +100 -0
- package/dist/adapters/bank-reconciliation.js +1 -0
- package/dist/adapters/bank-sync-log.d.ts +46 -0
- package/dist/adapters/bank-sync-log.js +1 -0
- package/dist/adapters/category-rules.d.ts +94 -0
- package/dist/adapters/category-rules.js +1 -0
- package/dist/adapters/companies.d.ts +85 -0
- package/dist/adapters/companies.js +3 -0
- package/dist/adapters/customers.d.ts +71 -0
- package/dist/adapters/customers.js +1 -0
- package/dist/adapters/exclusion-rules.d.ts +34 -0
- package/dist/adapters/exclusion-rules.js +15 -0
- package/dist/adapters/file-naming.d.ts +36 -0
- package/dist/adapters/file-naming.js +1 -0
- package/dist/adapters/index.d.ts +24 -0
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/invoice-detail.d.ts +126 -0
- package/dist/adapters/invoice-detail.js +1 -0
- package/dist/adapters/invoice-list.d.ts +63 -0
- package/dist/adapters/invoice-list.js +1 -0
- package/dist/adapters/invoice-upload.d.ts +26 -0
- package/dist/adapters/invoice-upload.js +1 -0
- package/dist/adapters/manual-bookings.d.ts +56 -0
- package/dist/adapters/manual-bookings.js +1 -0
- package/dist/adapters/notifications.d.ts +31 -0
- package/dist/adapters/notifications.js +1 -0
- package/dist/adapters/open-items.d.ts +42 -0
- package/dist/adapters/open-items.js +1 -0
- package/dist/adapters/opos-whitelist.d.ts +38 -0
- package/dist/adapters/opos-whitelist.js +1 -0
- package/dist/adapters/outgoing-invoices.d.ts +32 -0
- package/dist/adapters/outgoing-invoices.js +1 -0
- package/dist/adapters/overview.d.ts +68 -0
- package/dist/adapters/overview.js +1 -0
- package/dist/adapters/processing-log.d.ts +48 -0
- package/dist/adapters/processing-log.js +1 -0
- package/dist/adapters/properties.d.ts +87 -0
- package/dist/adapters/properties.js +1 -0
- package/dist/adapters/supplier-detail.d.ts +64 -0
- package/dist/adapters/supplier-detail.js +1 -0
- package/dist/adapters/supplier-list.d.ts +21 -0
- package/dist/adapters/supplier-list.js +1 -0
- package/dist/adapters/team.d.ts +79 -0
- package/dist/adapters/team.js +1 -0
- package/dist/adapters/trash.d.ts +26 -0
- package/dist/adapters/trash.js +1 -0
- package/dist/adapters/vat-rules.d.ts +83 -0
- package/dist/adapters/vat-rules.js +1 -0
- package/dist/components/access/index.d.ts +3 -0
- package/dist/components/access/index.js +3 -0
- package/dist/components/access/permission-checklist.d.ts +13 -0
- package/dist/components/access/permission-checklist.js +19 -0
- package/dist/components/access/permission-matrix.d.ts +12 -0
- package/dist/components/access/permission-matrix.js +18 -0
- package/dist/components/access/types.d.ts +15 -0
- package/dist/components/access/types.js +1 -0
- package/dist/components/dashboard/date-range-calendar.d.ts +19 -0
- package/dist/components/dashboard/date-range-calendar.js +97 -0
- package/dist/components/dashboard/index.d.ts +23 -0
- package/dist/components/dashboard/index.js +14 -0
- package/dist/components/dashboard/kpi-card.d.ts +13 -0
- package/dist/components/dashboard/kpi-card.js +7 -0
- package/dist/components/dashboard/money-cards-row.d.ts +29 -0
- package/dist/components/dashboard/money-cards-row.js +28 -0
- package/dist/components/dashboard/money-trend-chart.d.ts +13 -0
- package/dist/components/dashboard/money-trend-chart.js +16 -0
- package/dist/components/dashboard/panel.d.ts +9 -0
- package/dist/components/dashboard/panel.js +5 -0
- package/dist/components/dashboard/period-picker.d.ts +25 -0
- package/dist/components/dashboard/period-picker.js +82 -0
- package/dist/components/dashboard/periods.d.ts +13 -0
- package/dist/components/dashboard/periods.js +63 -0
- package/dist/components/dashboard/pipeline-stages-panel.d.ts +14 -0
- package/dist/components/dashboard/pipeline-stages-panel.js +12 -0
- package/dist/components/dashboard/processing-summary-panel.d.ts +34 -0
- package/dist/components/dashboard/processing-summary-panel.js +11 -0
- package/dist/components/dashboard/ranked-bars.d.ts +15 -0
- package/dist/components/dashboard/ranked-bars.js +16 -0
- package/dist/components/dashboard/ranked-list-panel.d.ts +14 -0
- package/dist/components/dashboard/ranked-list-panel.js +9 -0
- package/dist/components/dashboard/stage-tiles.d.ts +15 -0
- package/dist/components/dashboard/stage-tiles.js +6 -0
- package/dist/components/dashboard/stat-rows-panel.d.ts +25 -0
- package/dist/components/dashboard/stat-rows-panel.js +7 -0
- package/dist/components/dashboard/stat-tile.d.ts +20 -0
- package/dist/components/dashboard/stat-tile.js +9 -0
- package/dist/components/feedback/index.d.ts +4 -0
- package/dist/components/feedback/index.js +2 -0
- package/dist/components/feedback/query-states.d.ts +27 -0
- package/dist/components/feedback/query-states.js +38 -0
- package/dist/components/feedback/table-pagination.d.ts +20 -0
- package/dist/components/feedback/table-pagination.js +15 -0
- package/dist/components/invoice-queue/index.d.ts +5 -0
- package/dist/components/invoice-queue/index.js +3 -0
- package/dist/components/invoice-queue/next-action-cell.d.ts +5 -0
- package/dist/components/invoice-queue/next-action-cell.js +9 -0
- package/dist/components/invoice-queue/queue-kpi-card.d.ts +19 -0
- package/dist/components/invoice-queue/queue-kpi-card.js +31 -0
- package/dist/components/invoice-queue/queue-kpi-row.d.ts +22 -0
- package/dist/components/invoice-queue/queue-kpi-row.js +12 -0
- package/dist/components/notifications/alerts.d.ts +25 -0
- package/dist/components/notifications/alerts.js +66 -0
- package/dist/components/notifications/bell.d.ts +14 -0
- package/dist/components/notifications/bell.js +17 -0
- package/dist/components/notifications/highlight.d.ts +4 -0
- package/dist/components/notifications/highlight.js +7 -0
- package/dist/components/notifications/index.d.ts +7 -0
- package/dist/components/notifications/index.js +6 -0
- package/dist/components/notifications/reminder-dialog.d.ts +24 -0
- package/dist/components/notifications/reminder-dialog.js +54 -0
- package/dist/components/notifications/types.d.ts +27 -0
- package/dist/components/notifications/types.js +1 -0
- package/dist/components/notifications/use-notification-acks.d.ts +7 -0
- package/dist/components/notifications/use-notification-acks.js +37 -0
- package/dist/components/shell/breadcrumbs.d.ts +7 -0
- package/dist/components/shell/breadcrumbs.js +38 -0
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/index.js +3 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +110 -0
- package/dist/components/shell/types.d.ts +23 -0
- package/dist/components/shell/types.js +3 -0
- package/dist/components/tour/find-target.d.ts +1 -0
- package/dist/components/tour/find-target.js +3 -0
- package/dist/components/tour/index.d.ts +14 -0
- package/dist/components/tour/index.js +8 -0
- package/dist/components/tour/labels.d.ts +10 -0
- package/dist/components/tour/labels.js +9 -0
- package/dist/components/tour/seen-store.d.ts +3 -0
- package/dist/components/tour/seen-store.js +34 -0
- package/dist/components/tour/tour-blocks.d.ts +4 -0
- package/dist/components/tour/tour-blocks.js +27 -0
- package/dist/components/tour/tour-button.d.ts +4 -0
- package/dist/components/tour/tour-button.js +12 -0
- package/dist/components/tour/tour-card.d.ts +11 -0
- package/dist/components/tour/tour-card.js +7 -0
- package/dist/components/tour/tour-context.d.ts +16 -0
- package/dist/components/tour/tour-context.js +2 -0
- package/dist/components/tour/tour-overlay.d.ts +1 -0
- package/dist/components/tour/tour-overlay.js +165 -0
- package/dist/components/tour/tour-provider.d.ts +9 -0
- package/dist/components/tour/tour-provider.js +80 -0
- package/dist/components/tour/types.d.ts +44 -0
- package/dist/components/tour/types.js +1 -0
- package/dist/components/tour/use-tour.d.ts +3 -0
- package/dist/components/tour/use-tour.js +9 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +15 -0
- package/dist/lib/bank-import/classify.d.ts +8 -0
- package/dist/lib/bank-import/classify.js +89 -0
- package/dist/lib/bank-import/column-guess.d.ts +2 -0
- package/dist/lib/bank-import/column-guess.js +40 -0
- package/dist/lib/bank-import/csv.d.ts +3 -0
- package/dist/lib/bank-import/csv.js +20 -0
- package/dist/lib/bank-import/duplicates.d.ts +2 -0
- package/dist/lib/bank-import/duplicates.js +21 -0
- package/dist/lib/bank-import/index.d.ts +12 -0
- package/dist/lib/bank-import/index.js +9 -0
- package/dist/lib/bank-import/mapping-storage.d.ts +3 -0
- package/dist/lib/bank-import/mapping-storage.js +29 -0
- package/dist/lib/bank-import/normalize.d.ts +4 -0
- package/dist/lib/bank-import/normalize.js +82 -0
- package/dist/lib/bank-import/parse-file.d.ts +7 -0
- package/dist/lib/bank-import/parse-file.js +23 -0
- package/dist/lib/bank-import/types.d.ts +31 -0
- package/dist/lib/bank-import/types.js +1 -0
- package/dist/lib/bank-import/xlsx.d.ts +2 -0
- package/dist/lib/bank-import/xlsx.js +25 -0
- package/dist/lib/class-names.d.ts +2 -0
- package/dist/lib/class-names.js +5 -0
- package/dist/lib/download.d.ts +2 -0
- package/dist/lib/download.js +14 -0
- package/dist/lib/formatters.d.ts +6 -0
- package/dist/lib/formatters.js +24 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/opos-whitelist/index.d.ts +2 -0
- package/dist/lib/opos-whitelist/index.js +1 -0
- package/dist/lib/opos-whitelist/opos.d.ts +14 -0
- package/dist/lib/opos-whitelist/opos.js +49 -0
- package/dist/lib/query-result.d.ts +12 -0
- package/dist/lib/query-result.js +1 -0
- package/dist/lib/tour-placeholders/index.d.ts +2 -0
- package/dist/lib/tour-placeholders/index.js +1 -0
- package/dist/lib/tour-placeholders/overview.d.ts +12 -0
- package/dist/lib/tour-placeholders/overview.js +139 -0
- package/dist/pages/bank-accounts/BankAccountsPage.d.ts +7 -0
- package/dist/pages/bank-accounts/BankAccountsPage.js +21 -0
- package/dist/pages/bank-accounts/index.d.ts +4 -0
- package/dist/pages/bank-accounts/index.js +2 -0
- package/dist/pages/bank-accounts/labels.d.ts +15 -0
- package/dist/pages/bank-accounts/labels.js +14 -0
- package/dist/pages/bank-import/BankImportWizard.d.ts +9 -0
- package/dist/pages/bank-import/BankImportWizard.js +158 -0
- package/dist/pages/bank-import/index.d.ts +4 -0
- package/dist/pages/bank-import/index.js +2 -0
- package/dist/pages/bank-import/labels.d.ts +44 -0
- package/dist/pages/bank-import/labels.js +43 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.d.ts +7 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.js +77 -0
- package/dist/pages/bank-sync-log/index.d.ts +4 -0
- package/dist/pages/bank-sync-log/index.js +2 -0
- package/dist/pages/bank-sync-log/labels.d.ts +21 -0
- package/dist/pages/bank-sync-log/labels.js +20 -0
- package/dist/pages/bank-transactions/BankMatchPanel.d.ts +8 -0
- package/dist/pages/bank-transactions/BankMatchPanel.js +75 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.d.ts +7 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.js +59 -0
- package/dist/pages/bank-transactions/badges.d.ts +8 -0
- package/dist/pages/bank-transactions/badges.js +24 -0
- package/dist/pages/bank-transactions/index.d.ts +6 -0
- package/dist/pages/bank-transactions/index.js +4 -0
- package/dist/pages/bank-transactions/labels.d.ts +41 -0
- package/dist/pages/bank-transactions/labels.js +40 -0
- package/dist/pages/bank-transactions/sort-control.d.ts +17 -0
- package/dist/pages/bank-transactions/sort-control.js +8 -0
- package/dist/pages/bank-transactions/use-table-view.d.ts +23 -0
- package/dist/pages/bank-transactions/use-table-view.js +54 -0
- package/dist/pages/category-rules/CategoryRulesPage.d.ts +7 -0
- package/dist/pages/category-rules/CategoryRulesPage.js +160 -0
- package/dist/pages/category-rules/index.d.ts +4 -0
- package/dist/pages/category-rules/index.js +2 -0
- package/dist/pages/category-rules/labels.d.ts +66 -0
- package/dist/pages/category-rules/labels.js +72 -0
- package/dist/pages/companies/company-detail-page.d.ts +10 -0
- package/dist/pages/companies/company-detail-page.js +184 -0
- package/dist/pages/companies/company-form.d.ts +20 -0
- package/dist/pages/companies/company-form.js +23 -0
- package/dist/pages/companies/company-list-page.d.ts +9 -0
- package/dist/pages/companies/company-list-page.js +109 -0
- package/dist/pages/companies/known-spellings-card.d.ts +8 -0
- package/dist/pages/companies/known-spellings-card.js +65 -0
- package/dist/pages/companies/labels.d.ts +105 -0
- package/dist/pages/companies/labels.js +104 -0
- package/dist/pages/companies/sort-control.d.ts +17 -0
- package/dist/pages/companies/sort-control.js +8 -0
- package/dist/pages/companies/use-infinite-rows.d.ts +6 -0
- package/dist/pages/companies/use-infinite-rows.js +24 -0
- package/dist/pages/companies/use-table-view.d.ts +23 -0
- package/dist/pages/companies/use-table-view.js +56 -0
- package/dist/pages/customers/company-chip.d.ts +6 -0
- package/dist/pages/customers/company-chip.js +9 -0
- package/dist/pages/customers/copy-button.d.ts +6 -0
- package/dist/pages/customers/copy-button.js +31 -0
- package/dist/pages/customers/customer-detail-page.d.ts +10 -0
- package/dist/pages/customers/customer-detail-page.js +83 -0
- package/dist/pages/customers/customer-list-page.d.ts +9 -0
- package/dist/pages/customers/customer-list-page.js +65 -0
- package/dist/pages/customers/edit-customer-dialog.d.ts +9 -0
- package/dist/pages/customers/edit-customer-dialog.js +72 -0
- package/dist/pages/customers/form-hints.d.ts +6 -0
- package/dist/pages/customers/form-hints.js +9 -0
- package/dist/pages/customers/invoice-status-badge.d.ts +10 -0
- package/dist/pages/customers/invoice-status-badge.js +22 -0
- package/dist/pages/customers/labels.d.ts +116 -0
- package/dist/pages/customers/labels.js +117 -0
- package/dist/pages/customers/new-customer-dialog.d.ts +6 -0
- package/dist/pages/customers/new-customer-dialog.js +93 -0
- package/dist/pages/customers/sort-control.d.ts +14 -0
- package/dist/pages/customers/sort-control.js +9 -0
- package/dist/pages/customers/use-table-view.d.ts +23 -0
- package/dist/pages/customers/use-table-view.js +56 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.d.ts +7 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.js +114 -0
- package/dist/pages/exclusion-rules/labels.d.ts +53 -0
- package/dist/pages/exclusion-rules/labels.js +61 -0
- package/dist/pages/file-naming/build-filename.d.ts +3 -0
- package/dist/pages/file-naming/build-filename.js +82 -0
- package/dist/pages/file-naming/file-naming-page.d.ts +10 -0
- package/dist/pages/file-naming/file-naming-page.js +120 -0
- package/dist/pages/file-naming/labels.d.ts +44 -0
- package/dist/pages/file-naming/labels.js +44 -0
- package/dist/pages/index.d.ts +63 -0
- package/dist/pages/index.js +48 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.d.ts +11 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.js +292 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.d.ts +26 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.js +16 -0
- package/dist/pages/invoice-detail/ReviewBadge.d.ts +15 -0
- package/dist/pages/invoice-detail/ReviewBadge.js +23 -0
- package/dist/pages/invoice-detail/ReviewCard.d.ts +17 -0
- package/dist/pages/invoice-detail/ReviewCard.js +12 -0
- package/dist/pages/invoice-detail/SideBySide.d.ts +5 -0
- package/dist/pages/invoice-detail/SideBySide.js +5 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.d.ts +23 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.js +32 -0
- package/dist/pages/invoice-detail/WorkflowLadder.d.ts +20 -0
- package/dist/pages/invoice-detail/WorkflowLadder.js +16 -0
- package/dist/pages/invoice-detail/history.d.ts +23 -0
- package/dist/pages/invoice-detail/history.js +76 -0
- package/dist/pages/invoice-detail/index.d.ts +21 -0
- package/dist/pages/invoice-detail/index.js +11 -0
- package/dist/pages/invoice-detail/labels.d.ts +79 -0
- package/dist/pages/invoice-detail/labels.js +139 -0
- package/dist/pages/invoice-detail/pipeline-types.d.ts +58 -0
- package/dist/pages/invoice-detail/pipeline-types.js +1 -0
- package/dist/pages/invoice-detail/review-recheck.d.ts +8 -0
- package/dist/pages/invoice-detail/review-recheck.js +103 -0
- package/dist/pages/invoice-detail/review.d.ts +91 -0
- package/dist/pages/invoice-detail/review.js +310 -0
- package/dist/pages/invoice-list/badges.d.ts +23 -0
- package/dist/pages/invoice-list/badges.js +26 -0
- package/dist/pages/invoice-list/index.d.ts +5 -0
- package/dist/pages/invoice-list/index.js +3 -0
- package/dist/pages/invoice-list/invoice-list-page.d.ts +13 -0
- package/dist/pages/invoice-list/invoice-list-page.js +114 -0
- package/dist/pages/invoice-list/labels.d.ts +36 -0
- package/dist/pages/invoice-list/labels.js +29 -0
- package/dist/pages/invoice-list/sort-control.d.ts +17 -0
- package/dist/pages/invoice-list/sort-control.js +8 -0
- package/dist/pages/invoice-list/use-table-view.d.ts +23 -0
- package/dist/pages/invoice-list/use-table-view.js +54 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.d.ts +7 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.js +115 -0
- package/dist/pages/invoice-upload/index.d.ts +4 -0
- package/dist/pages/invoice-upload/index.js +2 -0
- package/dist/pages/invoice-upload/labels.d.ts +29 -0
- package/dist/pages/invoice-upload/labels.js +28 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.d.ts +7 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.js +161 -0
- package/dist/pages/manual-bookings/index.d.ts +4 -0
- package/dist/pages/manual-bookings/index.js +2 -0
- package/dist/pages/manual-bookings/labels.d.ts +53 -0
- package/dist/pages/manual-bookings/labels.js +52 -0
- package/dist/pages/notifications/labels.d.ts +22 -0
- package/dist/pages/notifications/labels.js +21 -0
- package/dist/pages/notifications/notifications-page.d.ts +14 -0
- package/dist/pages/notifications/notifications-page.js +81 -0
- package/dist/pages/open-items/OpenItemsPage.d.ts +11 -0
- package/dist/pages/open-items/OpenItemsPage.js +110 -0
- package/dist/pages/open-items/index.d.ts +6 -0
- package/dist/pages/open-items/index.js +3 -0
- package/dist/pages/open-items/labels.d.ts +37 -0
- package/dist/pages/open-items/labels.js +36 -0
- package/dist/pages/open-items/urgency.d.ts +8 -0
- package/dist/pages/open-items/urgency.js +27 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.d.ts +7 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.js +165 -0
- package/dist/pages/opos-whitelist/index.d.ts +4 -0
- package/dist/pages/opos-whitelist/index.js +2 -0
- package/dist/pages/opos-whitelist/labels.d.ts +56 -0
- package/dist/pages/opos-whitelist/labels.js +70 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.d.ts +7 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.js +169 -0
- package/dist/pages/outgoing-invoices/index.d.ts +4 -0
- package/dist/pages/outgoing-invoices/index.js +2 -0
- package/dist/pages/outgoing-invoices/labels.d.ts +43 -0
- package/dist/pages/outgoing-invoices/labels.js +42 -0
- package/dist/pages/outgoing-invoices/sort-control.d.ts +17 -0
- package/dist/pages/outgoing-invoices/sort-control.js +8 -0
- package/dist/pages/outgoing-invoices/use-table-view.d.ts +23 -0
- package/dist/pages/outgoing-invoices/use-table-view.js +54 -0
- package/dist/pages/overview/labels.d.ts +35 -0
- package/dist/pages/overview/labels.js +34 -0
- package/dist/pages/overview/overview-page.d.ts +22 -0
- package/dist/pages/overview/overview-page.js +127 -0
- package/dist/pages/processing-log/labels.d.ts +54 -0
- package/dist/pages/processing-log/labels.js +53 -0
- package/dist/pages/processing-log/mail-parsing.d.ts +21 -0
- package/dist/pages/processing-log/mail-parsing.js +52 -0
- package/dist/pages/processing-log/processing-log-page.d.ts +9 -0
- package/dist/pages/processing-log/processing-log-page.js +206 -0
- package/dist/pages/properties/badges.d.ts +20 -0
- package/dist/pages/properties/badges.js +45 -0
- package/dist/pages/properties/company-assignment-field.d.ts +11 -0
- package/dist/pages/properties/company-assignment-field.js +13 -0
- package/dist/pages/properties/form-field.d.ts +6 -0
- package/dist/pages/properties/form-field.js +9 -0
- package/dist/pages/properties/labels.d.ts +124 -0
- package/dist/pages/properties/labels.js +128 -0
- package/dist/pages/properties/name-variants-card.d.ts +7 -0
- package/dist/pages/properties/name-variants-card.js +60 -0
- package/dist/pages/properties/property-detail-page.d.ts +10 -0
- package/dist/pages/properties/property-detail-page.js +150 -0
- package/dist/pages/properties/property-list-page.d.ts +13 -0
- package/dist/pages/properties/property-list-page.js +201 -0
- package/dist/pages/properties/sort-control.d.ts +14 -0
- package/dist/pages/properties/sort-control.js +9 -0
- package/dist/pages/properties/use-infinite-rows.d.ts +6 -0
- package/dist/pages/properties/use-infinite-rows.js +26 -0
- package/dist/pages/properties/use-table-view.d.ts +23 -0
- package/dist/pages/properties/use-table-view.js +56 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.d.ts +10 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.js +157 -0
- package/dist/pages/supplier-detail/index.d.ts +4 -0
- package/dist/pages/supplier-detail/index.js +2 -0
- package/dist/pages/supplier-detail/labels.d.ts +46 -0
- package/dist/pages/supplier-detail/labels.js +45 -0
- package/dist/pages/supplier-list/SupplierListPage.d.ts +9 -0
- package/dist/pages/supplier-list/SupplierListPage.js +102 -0
- package/dist/pages/supplier-list/index.d.ts +4 -0
- package/dist/pages/supplier-list/index.js +2 -0
- package/dist/pages/supplier-list/labels.d.ts +33 -0
- package/dist/pages/supplier-list/labels.js +32 -0
- package/dist/pages/supplier-list/sort-control.d.ts +17 -0
- package/dist/pages/supplier-list/sort-control.js +8 -0
- package/dist/pages/supplier-list/use-table-view.d.ts +23 -0
- package/dist/pages/supplier-list/use-table-view.js +54 -0
- package/dist/pages/team/account-dialogs.d.ts +12 -0
- package/dist/pages/team/account-dialogs.js +49 -0
- package/dist/pages/team/employee-editor.d.ts +19 -0
- package/dist/pages/team/employee-editor.js +124 -0
- package/dist/pages/team/labels.d.ts +99 -0
- package/dist/pages/team/labels.js +98 -0
- package/dist/pages/team/new-employee.d.ts +8 -0
- package/dist/pages/team/new-employee.js +103 -0
- package/dist/pages/team/roles-tab.d.ts +6 -0
- package/dist/pages/team/roles-tab.js +46 -0
- package/dist/pages/team/team-page.d.ts +7 -0
- package/dist/pages/team/team-page.js +81 -0
- package/dist/pages/team/temp-password-dialog.d.ts +11 -0
- package/dist/pages/team/temp-password-dialog.js +23 -0
- package/dist/pages/trash/labels.d.ts +68 -0
- package/dist/pages/trash/labels.js +69 -0
- package/dist/pages/trash/trash-page.d.ts +9 -0
- package/dist/pages/trash/trash-page.js +259 -0
- package/dist/pages/vat-rules/labels.d.ts +110 -0
- package/dist/pages/vat-rules/labels.js +109 -0
- package/dist/pages/vat-rules/new-rule-dialog.d.ts +7 -0
- package/dist/pages/vat-rules/new-rule-dialog.js +134 -0
- package/dist/pages/vat-rules/rule-row.d.ts +20 -0
- package/dist/pages/vat-rules/rule-row.js +120 -0
- package/dist/pages/vat-rules/vat-rules-page.d.ts +9 -0
- package/dist/pages/vat-rules/vat-rules-page.js +61 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/alert-dialog.js +41 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +20 -0
- package/dist/ui/breadcrumb.d.ts +19 -0
- package/dist/ui/breadcrumb.js +23 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.js +33 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/chart.d.ts +62 -0
- package/dist/ui/chart.js +118 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +5 -0
- package/dist/ui/combobox.d.ts +24 -0
- package/dist/ui/combobox.js +55 -0
- package/dist/ui/command.d.ts +80 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/dialog.d.ts +19 -0
- package/dist/ui/dialog.js +58 -0
- package/dist/ui/dropdown-menu.d.ts +27 -0
- package/dist/ui/dropdown-menu.js +33 -0
- package/dist/ui/field-context.d.ts +4 -0
- package/dist/ui/field-context.js +6 -0
- package/dist/ui/field.d.ts +3 -0
- package/dist/ui/field.js +8 -0
- package/dist/ui/icon-action.d.ts +3 -0
- package/dist/ui/icon-action.js +8 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +11 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +15 -0
- package/dist/ui/multi-combobox.d.ts +18 -0
- package/dist/ui/multi-combobox.js +40 -0
- package/dist/ui/popover.d.ts +9 -0
- package/dist/ui/popover.js +12 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +9 -0
- package/dist/ui/scroll-shadow.d.ts +8 -0
- package/dist/ui/scroll-shadow.js +57 -0
- package/dist/ui/select.d.ts +13 -0
- package/dist/ui/select.js +31 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +40 -0
- package/dist/ui/sidebar.d.ts +65 -0
- package/dist/ui/sidebar.js +207 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.js +13 -0
- package/dist/ui/switch.d.ts +4 -0
- package/dist/ui/switch.js +7 -0
- package/dist/ui/table.d.ts +12 -0
- package/dist/ui/table.js +24 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +12 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +11 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +11 -0
- package/package.json +80 -0
- package/themes/TOKENS.md +57 -0
- package/themes/default.css +60 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { TourContext } from "./tour-context.js";
|
|
3
|
+
export function useTour() {
|
|
4
|
+
return useContext(TourContext);
|
|
5
|
+
}
|
|
6
|
+
export function useTourPlaceholderData() {
|
|
7
|
+
const tour = useContext(TourContext);
|
|
8
|
+
return tour?.showsPlaceholderData === true;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
const MOBILE_BREAKPOINT = 640;
|
|
3
|
+
export function useIsMobile() {
|
|
4
|
+
const [isMobile, setIsMobile] = useState(undefined);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
+
const onChange = () => {
|
|
8
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
|
+
};
|
|
10
|
+
mql.addEventListener("change", onChange);
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
+
return () => mql.removeEventListener("change", onChange);
|
|
13
|
+
}, []);
|
|
14
|
+
return !!isMobile;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { englishProcessingLogLabels } from "../pages/processing-log/labels";
|
|
2
|
+
export { englishNotificationsPageLabels } from "../pages/notifications/labels";
|
|
3
|
+
export { englishTeamPageLabels } from "../pages/team/labels";
|
|
4
|
+
export { englishTrashPageLabels } from "../pages/trash/labels";
|
|
5
|
+
export { englishCustomersLabels } from "../pages/customers/labels";
|
|
6
|
+
export { englishCompaniesLabels } from "../pages/companies/labels";
|
|
7
|
+
export { englishPropertiesLabels } from "../pages/properties/labels";
|
|
8
|
+
export { englishExclusionRulesLabels } from "../pages/exclusion-rules/labels";
|
|
9
|
+
export { englishVatRulesLabels } from "../pages/vat-rules/labels";
|
|
10
|
+
export { englishFileNamingLabels } from "../pages/file-naming/labels";
|
|
11
|
+
export { englishReminderDialogLabels } from "../components/notifications/reminder-dialog";
|
|
12
|
+
export { englishErrorStateLabels, englishPaginationLabels } from "../components/feedback";
|
|
13
|
+
export { englishFormatters } from "../lib/formatters";
|
|
14
|
+
export { englishOverviewLabels } from "../pages/overview/labels";
|
|
15
|
+
export { englishTourLabels } from "../components/tour/labels";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { englishProcessingLogLabels } from "../pages/processing-log/labels.js";
|
|
2
|
+
export { englishNotificationsPageLabels } from "../pages/notifications/labels.js";
|
|
3
|
+
export { englishTeamPageLabels } from "../pages/team/labels.js";
|
|
4
|
+
export { englishTrashPageLabels } from "../pages/trash/labels.js";
|
|
5
|
+
export { englishCustomersLabels } from "../pages/customers/labels.js";
|
|
6
|
+
export { englishCompaniesLabels } from "../pages/companies/labels.js";
|
|
7
|
+
export { englishPropertiesLabels } from "../pages/properties/labels.js";
|
|
8
|
+
export { englishExclusionRulesLabels } from "../pages/exclusion-rules/labels.js";
|
|
9
|
+
export { englishVatRulesLabels } from "../pages/vat-rules/labels.js";
|
|
10
|
+
export { englishFileNamingLabels } from "../pages/file-naming/labels.js";
|
|
11
|
+
export { englishReminderDialogLabels } from "../components/notifications/reminder-dialog.js";
|
|
12
|
+
export { englishErrorStateLabels, englishPaginationLabels } from "../components/feedback/index.js";
|
|
13
|
+
export { englishFormatters } from "../lib/formatters.js";
|
|
14
|
+
export { englishOverviewLabels } from "../pages/overview/labels.js";
|
|
15
|
+
export { englishTourLabels } from "../components/tour/labels.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type TransactionType = "ueberweisung" | "lastschrift" | "kreditkarte" | "kartenzahlung" | "gutschrift" | "unbekannt";
|
|
2
|
+
export interface ClassifyInput {
|
|
3
|
+
bookingText?: string | null;
|
|
4
|
+
paymentReference?: string | null;
|
|
5
|
+
amount?: number | null;
|
|
6
|
+
productType?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function classifyTransactionType(input: ClassifyInput): TransactionType;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function normalize(value) {
|
|
2
|
+
return (value ?? "")
|
|
3
|
+
.toLowerCase()
|
|
4
|
+
.replace(/ä/g, "ae")
|
|
5
|
+
.replace(/ö/g, "oe")
|
|
6
|
+
.replace(/ü/g, "ue")
|
|
7
|
+
.replace(/ß/g, "ss")
|
|
8
|
+
.replace(/[^a-z0-9]+/g, " ")
|
|
9
|
+
.trim();
|
|
10
|
+
}
|
|
11
|
+
function hasPart(haystack, parts) {
|
|
12
|
+
return parts.some((p) => haystack.includes(p));
|
|
13
|
+
}
|
|
14
|
+
function hasWord(haystack, words) {
|
|
15
|
+
return words.some((w) => haystack === w || new RegExp(`(^| )${w}( |$)`).test(haystack));
|
|
16
|
+
}
|
|
17
|
+
const CARD_ACCOUNT_PARTS = ["kreditkarte", "kreditkarten"];
|
|
18
|
+
const CARD_ACCOUNT_WORDS = [
|
|
19
|
+
"visa",
|
|
20
|
+
"mastercard",
|
|
21
|
+
"eurocard",
|
|
22
|
+
"amex",
|
|
23
|
+
"american express",
|
|
24
|
+
"maestro",
|
|
25
|
+
"creditcard",
|
|
26
|
+
"credit card",
|
|
27
|
+
];
|
|
28
|
+
const CARD_SETTLEMENT_PARTS = [
|
|
29
|
+
"kreditkarte",
|
|
30
|
+
"kreditkarten",
|
|
31
|
+
"kartenabrechnung",
|
|
32
|
+
"kartenumsaetze",
|
|
33
|
+
"wochenabrechnung",
|
|
34
|
+
"monatsabrechnung",
|
|
35
|
+
];
|
|
36
|
+
const CARD_SETTLEMENT_WORDS = ["visa", "mastercard", "eurocard", "amex", "american express"];
|
|
37
|
+
const CARD_PAYMENT_PARTS = [
|
|
38
|
+
"kartenzahlung",
|
|
39
|
+
"kartenverfuegung",
|
|
40
|
+
"girocard",
|
|
41
|
+
"debitkarte",
|
|
42
|
+
"bargeldauszahlung",
|
|
43
|
+
"geldautomat",
|
|
44
|
+
];
|
|
45
|
+
const CARD_PAYMENT_WORDS = ["elv", "ec cash", "pos", "ga auszahlung"];
|
|
46
|
+
const CARD_REF_PREFIXES = ["ec", "ga"];
|
|
47
|
+
const DEBIT_PARTS = ["lastschrift", "einzugsermaechtigung", "abbuchung", "basisls", "firmenls"];
|
|
48
|
+
const TRANSFER_PARTS = [
|
|
49
|
+
"ueberweisung",
|
|
50
|
+
"ueberw",
|
|
51
|
+
"uebertrag",
|
|
52
|
+
"dauerauftrag",
|
|
53
|
+
"umbuchung",
|
|
54
|
+
"echtzeitzahlung",
|
|
55
|
+
];
|
|
56
|
+
const TRANSFER_WORDS = ["sepa ct", "lohn", "gehalt", "sammler"];
|
|
57
|
+
const CREDIT_PARTS = ["gutschrift", "zinsen", "erstattung", "rueckzahlung", "einzahlung", "storno"];
|
|
58
|
+
function isCardAccount(productType) {
|
|
59
|
+
const p = normalize(productType);
|
|
60
|
+
return !!p && (hasPart(p, CARD_ACCOUNT_PARTS) || hasWord(p, CARD_ACCOUNT_WORDS));
|
|
61
|
+
}
|
|
62
|
+
function classifyText(text) {
|
|
63
|
+
if (!text)
|
|
64
|
+
return null;
|
|
65
|
+
if (hasPart(text, CARD_SETTLEMENT_PARTS) || hasWord(text, CARD_SETTLEMENT_WORDS)) {
|
|
66
|
+
return "kreditkarte";
|
|
67
|
+
}
|
|
68
|
+
if (hasPart(text, CARD_PAYMENT_PARTS) ||
|
|
69
|
+
hasWord(text, CARD_PAYMENT_WORDS) ||
|
|
70
|
+
CARD_REF_PREFIXES.includes(text.split(" ")[0])) {
|
|
71
|
+
return "kartenzahlung";
|
|
72
|
+
}
|
|
73
|
+
if (hasPart(text, DEBIT_PARTS))
|
|
74
|
+
return "lastschrift";
|
|
75
|
+
if (hasPart(text, TRANSFER_PARTS) || hasWord(text, TRANSFER_WORDS))
|
|
76
|
+
return "ueberweisung";
|
|
77
|
+
if (hasPart(text, CREDIT_PARTS))
|
|
78
|
+
return "gutschrift";
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
export function classifyTransactionType(input) {
|
|
82
|
+
const fromText = classifyText(normalize(input.bookingText)) ?? classifyText(normalize(input.paymentReference));
|
|
83
|
+
if (isCardAccount(input.productType)) {
|
|
84
|
+
if (fromText === "kreditkarte")
|
|
85
|
+
return "kreditkarte";
|
|
86
|
+
return (input.amount ?? 0) > 0 ? "gutschrift" : "kartenzahlung";
|
|
87
|
+
}
|
|
88
|
+
return fromText ?? "unbekannt";
|
|
89
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const KEYWORDS = [
|
|
2
|
+
{ field: "booking_date", keywords: ["buchungstag", "buchungsdatum", "booking date", "datum"] },
|
|
3
|
+
{ field: "value_date", keywords: ["valuta", "wertstellung", "value date"] },
|
|
4
|
+
{ field: "amount", keywords: ["betrag", "amount", "umsatz"] },
|
|
5
|
+
{ field: "amountDebit", keywords: ["soll", "belastung", "debit", "ausgang"] },
|
|
6
|
+
{ field: "amountCredit", keywords: ["haben", "gutschrift", "credit", "eingang"] },
|
|
7
|
+
{ field: "currency", keywords: ["währung", "waehrung", "currency"] },
|
|
8
|
+
{
|
|
9
|
+
field: "counterparty_holder",
|
|
10
|
+
keywords: ["empfänger", "empfaenger", "auftraggeber", "zahlungspflichtiger", "name", "beguenstigter", "begünstigter"],
|
|
11
|
+
},
|
|
12
|
+
{ field: "counterparty_iban", keywords: ["iban"] },
|
|
13
|
+
{ field: "payment_reference", keywords: ["verwendungszweck", "referenz", "reference", "buchungstext", "purpose"] },
|
|
14
|
+
{ field: "booking_text", keywords: ["buchungsart", "text", "umsatzart", "vorgang", "description"] },
|
|
15
|
+
];
|
|
16
|
+
function normalizeHeader(header) {
|
|
17
|
+
return header
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.trim()
|
|
20
|
+
.replace(/[äÄ]/g, "ae")
|
|
21
|
+
.replace(/[öÖ]/g, "oe")
|
|
22
|
+
.replace(/[üÜ]/g, "ue")
|
|
23
|
+
.replace(/ß/g, "ss");
|
|
24
|
+
}
|
|
25
|
+
export function guessColumnMapping(headers) {
|
|
26
|
+
const mapping = {};
|
|
27
|
+
const claimed = new Set();
|
|
28
|
+
for (const header of headers) {
|
|
29
|
+
const normalized = normalizeHeader(header);
|
|
30
|
+
const match = KEYWORDS.find((k) => !claimed.has(k.field) && k.keywords.some((kw) => normalized.includes(kw)));
|
|
31
|
+
if (!match)
|
|
32
|
+
continue;
|
|
33
|
+
claimed.add(match.field);
|
|
34
|
+
mapping[match.field] = header;
|
|
35
|
+
}
|
|
36
|
+
if (mapping.amountDebit || mapping.amountCredit) {
|
|
37
|
+
delete mapping.amount;
|
|
38
|
+
}
|
|
39
|
+
return mapping;
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Papa from "papaparse";
|
|
2
|
+
export function parseCsv(text) {
|
|
3
|
+
const result = Papa.parse(text, {
|
|
4
|
+
header: true,
|
|
5
|
+
skipEmptyLines: true,
|
|
6
|
+
delimitersToGuess: [",", ";", "\t", "|"],
|
|
7
|
+
});
|
|
8
|
+
const fatal = result.errors.find((e) => e.type !== "FieldMismatch");
|
|
9
|
+
if (fatal) {
|
|
10
|
+
throw new Error(`Could not read the CSV file: ${fatal.message} (row ${(fatal.row ?? 0) + 2})`);
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
headers: result.meta.fields ?? [],
|
|
14
|
+
rows: result.data,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export async function parseCsvFile(file) {
|
|
18
|
+
const text = await file.text();
|
|
19
|
+
return parseCsv(text);
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function normalizeText(value) {
|
|
2
|
+
return (value ?? "").trim().toLowerCase();
|
|
3
|
+
}
|
|
4
|
+
function contentKey(row) {
|
|
5
|
+
return [row.booking_date, row.amount.toFixed(2), row.currency ?? "", normalizeText(row.payment_reference), normalizeText(row.counterparty_iban)].join("|");
|
|
6
|
+
}
|
|
7
|
+
export function findSuspectedDuplicates(rows) {
|
|
8
|
+
const counts = new Map();
|
|
9
|
+
rows.forEach((row, i) => {
|
|
10
|
+
const key = contentKey(row);
|
|
11
|
+
const list = counts.get(key) ?? [];
|
|
12
|
+
list.push(i);
|
|
13
|
+
counts.set(key, list);
|
|
14
|
+
});
|
|
15
|
+
const suspects = new Set();
|
|
16
|
+
for (const indexes of counts.values()) {
|
|
17
|
+
if (indexes.length > 1)
|
|
18
|
+
indexes.forEach((i) => suspects.add(i));
|
|
19
|
+
}
|
|
20
|
+
return suspects;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { NormalizedRow, ParseIssueCode, ParseIssue, NormalizeResult, ParsedTable, SingleTargetField, ColumnMapping } from "./types";
|
|
2
|
+
export { REQUIRED_FIELDS } from "./types";
|
|
3
|
+
export { classifyTransactionType } from "./classify";
|
|
4
|
+
export type { ClassifyInput, TransactionType } from "./classify";
|
|
5
|
+
export { guessColumnMapping } from "./column-guess";
|
|
6
|
+
export { parseCsv, parseCsvFile } from "./csv";
|
|
7
|
+
export { parseXlsxFile } from "./xlsx";
|
|
8
|
+
export { detectFormat, parseBankFile } from "./parse-file";
|
|
9
|
+
export type { DetectedFormat } from "./parse-file";
|
|
10
|
+
export { parseFlexibleDate, parseFlexibleAmount, normalizeTable } from "./normalize";
|
|
11
|
+
export { findSuspectedDuplicates } from "./duplicates";
|
|
12
|
+
export { loadStoredMapping, saveMapping } from "./mapping-storage";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { REQUIRED_FIELDS } from "./types.js";
|
|
2
|
+
export { classifyTransactionType } from "./classify.js";
|
|
3
|
+
export { guessColumnMapping } from "./column-guess.js";
|
|
4
|
+
export { parseCsv, parseCsvFile } from "./csv.js";
|
|
5
|
+
export { parseXlsxFile } from "./xlsx.js";
|
|
6
|
+
export { detectFormat, parseBankFile } from "./parse-file.js";
|
|
7
|
+
export { parseFlexibleDate, parseFlexibleAmount, normalizeTable } from "./normalize.js";
|
|
8
|
+
export { findSuspectedDuplicates } from "./duplicates.js";
|
|
9
|
+
export { loadStoredMapping, saveMapping } from "./mapping-storage.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const STORAGE_PREFIX = "hub-kit.bank-import.mapping.";
|
|
2
|
+
function fingerprint(headers) {
|
|
3
|
+
const key = [...headers]
|
|
4
|
+
.map((h) => h.trim().toLowerCase())
|
|
5
|
+
.sort()
|
|
6
|
+
.join("|");
|
|
7
|
+
let hash = 0;
|
|
8
|
+
for (let i = 0; i < key.length; i++) {
|
|
9
|
+
hash = (hash * 31 + key.charCodeAt(i)) | 0;
|
|
10
|
+
}
|
|
11
|
+
return hash.toString(36);
|
|
12
|
+
}
|
|
13
|
+
export function loadStoredMapping(headers) {
|
|
14
|
+
try {
|
|
15
|
+
const raw = localStorage.getItem(STORAGE_PREFIX + fingerprint(headers));
|
|
16
|
+
return raw ? JSON.parse(raw) : null;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function saveMapping(headers, mapping) {
|
|
23
|
+
try {
|
|
24
|
+
localStorage.setItem(STORAGE_PREFIX + fingerprint(headers), JSON.stringify(mapping));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ColumnMapping, NormalizeResult, ParsedTable } from "./types";
|
|
2
|
+
export declare function parseFlexibleDate(value: string): string | null;
|
|
3
|
+
export declare function parseFlexibleAmount(value: string): number | null;
|
|
4
|
+
export declare function normalizeTable(table: ParsedTable, mapping: ColumnMapping): NormalizeResult;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export function parseFlexibleDate(value) {
|
|
2
|
+
const v = value.trim();
|
|
3
|
+
if (!v)
|
|
4
|
+
return null;
|
|
5
|
+
const iso = v.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
6
|
+
if (iso)
|
|
7
|
+
return `${iso[1]}-${iso[2]}-${iso[3]}`;
|
|
8
|
+
const german = v.match(/^(\d{1,2})\.(\d{1,2})\.(\d{2}|\d{4})$/);
|
|
9
|
+
if (german) {
|
|
10
|
+
const [, d, m, yRaw] = german;
|
|
11
|
+
const y = yRaw.length === 2 ? `20${yRaw}` : yRaw;
|
|
12
|
+
const dd = d.padStart(2, "0");
|
|
13
|
+
const mm = m.padStart(2, "0");
|
|
14
|
+
if (Number(mm) < 1 || Number(mm) > 12 || Number(dd) < 1 || Number(dd) > 31)
|
|
15
|
+
return null;
|
|
16
|
+
return `${y}-${mm}-${dd}`;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
export function parseFlexibleAmount(value) {
|
|
21
|
+
let v = value.trim();
|
|
22
|
+
if (!v)
|
|
23
|
+
return null;
|
|
24
|
+
const trailingMinus = /-\s*$/.test(v);
|
|
25
|
+
v = v.replace(/[^\d,.-]/g, "");
|
|
26
|
+
const hasComma = v.includes(",");
|
|
27
|
+
const hasDot = v.includes(".");
|
|
28
|
+
if (hasComma && hasDot) {
|
|
29
|
+
v = v.lastIndexOf(",") > v.lastIndexOf(".") ? v.replace(/\./g, "").replace(",", ".") : v.replace(/,/g, "");
|
|
30
|
+
}
|
|
31
|
+
else if (hasComma) {
|
|
32
|
+
v = v.replace(",", ".");
|
|
33
|
+
}
|
|
34
|
+
const n = Number(v);
|
|
35
|
+
if (!Number.isFinite(n))
|
|
36
|
+
return null;
|
|
37
|
+
return trailingMinus && n > 0 ? -n : n;
|
|
38
|
+
}
|
|
39
|
+
function cell(row, header) {
|
|
40
|
+
if (!header)
|
|
41
|
+
return "";
|
|
42
|
+
return (row[header] ?? "").trim();
|
|
43
|
+
}
|
|
44
|
+
export function normalizeTable(table, mapping) {
|
|
45
|
+
const rows = [];
|
|
46
|
+
const issues = [];
|
|
47
|
+
table.rows.forEach((row, rowIndex) => {
|
|
48
|
+
const bookingDateRaw = cell(row, mapping.booking_date);
|
|
49
|
+
const bookingDate = parseFlexibleDate(bookingDateRaw);
|
|
50
|
+
if (!bookingDate) {
|
|
51
|
+
issues.push({ rowIndex, code: "missing_booking_date", rawValue: bookingDateRaw });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
let amount;
|
|
55
|
+
if (mapping.amountDebit || mapping.amountCredit) {
|
|
56
|
+
const debit = parseFlexibleAmount(cell(row, mapping.amountDebit)) ?? 0;
|
|
57
|
+
const credit = parseFlexibleAmount(cell(row, mapping.amountCredit)) ?? 0;
|
|
58
|
+
amount = credit - Math.abs(debit);
|
|
59
|
+
if (debit === 0 && credit === 0)
|
|
60
|
+
amount = null;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
amount = parseFlexibleAmount(cell(row, mapping.amount));
|
|
64
|
+
}
|
|
65
|
+
if (amount === null) {
|
|
66
|
+
issues.push({ rowIndex, code: "missing_amount", rawValue: cell(row, mapping.amount) });
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
rows.push({
|
|
70
|
+
booking_date: bookingDate,
|
|
71
|
+
value_date: parseFlexibleDate(cell(row, mapping.value_date)),
|
|
72
|
+
amount,
|
|
73
|
+
currency: cell(row, mapping.currency) || null,
|
|
74
|
+
counterparty_holder: cell(row, mapping.counterparty_holder) || null,
|
|
75
|
+
counterparty_iban: cell(row, mapping.counterparty_iban).replace(/\s+/g, "") || null,
|
|
76
|
+
payment_reference: cell(row, mapping.payment_reference) || null,
|
|
77
|
+
booking_text: cell(row, mapping.booking_text) || null,
|
|
78
|
+
provider_ref: null,
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
return { rows, issues };
|
|
82
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ParsedTable } from "./types";
|
|
2
|
+
export type DetectedFormat = "csv" | "xlsx" | "pdf" | null;
|
|
3
|
+
export declare function detectFormat(file: File): DetectedFormat;
|
|
4
|
+
export declare function parseBankFile(file: File): Promise<{
|
|
5
|
+
format: "csv" | "xlsx";
|
|
6
|
+
table: ParsedTable;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { parseCsvFile } from "./csv.js";
|
|
2
|
+
import { parseXlsxFile } from "./xlsx.js";
|
|
3
|
+
export function detectFormat(file) {
|
|
4
|
+
const name = file.name.toLowerCase();
|
|
5
|
+
if (name.endsWith(".csv") || name.endsWith(".txt"))
|
|
6
|
+
return "csv";
|
|
7
|
+
if (name.endsWith(".xlsx") || name.endsWith(".xls"))
|
|
8
|
+
return "xlsx";
|
|
9
|
+
if (name.endsWith(".pdf"))
|
|
10
|
+
return "pdf";
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
export async function parseBankFile(file) {
|
|
14
|
+
const format = detectFormat(file);
|
|
15
|
+
if (format !== "csv" && format !== "xlsx") {
|
|
16
|
+
throw new Error("Unsupported file format. Upload a CSV or Excel (.xlsx) file.");
|
|
17
|
+
}
|
|
18
|
+
const table = format === "csv" ? await parseCsvFile(file) : await parseXlsxFile(file);
|
|
19
|
+
if (table.headers.length === 0 || table.rows.length === 0) {
|
|
20
|
+
throw new Error("The file has no recognizable columns or rows.");
|
|
21
|
+
}
|
|
22
|
+
return { format, table };
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface NormalizedRow {
|
|
2
|
+
booking_date: string;
|
|
3
|
+
value_date: string | null;
|
|
4
|
+
amount: number;
|
|
5
|
+
currency: string | null;
|
|
6
|
+
counterparty_holder: string | null;
|
|
7
|
+
counterparty_iban: string | null;
|
|
8
|
+
payment_reference: string | null;
|
|
9
|
+
booking_text: string | null;
|
|
10
|
+
provider_ref: string | null;
|
|
11
|
+
}
|
|
12
|
+
export type ParseIssueCode = "missing_booking_date" | "missing_amount";
|
|
13
|
+
export interface ParseIssue {
|
|
14
|
+
rowIndex: number;
|
|
15
|
+
code: ParseIssueCode;
|
|
16
|
+
rawValue: string;
|
|
17
|
+
}
|
|
18
|
+
export interface NormalizeResult {
|
|
19
|
+
rows: NormalizedRow[];
|
|
20
|
+
issues: ParseIssue[];
|
|
21
|
+
}
|
|
22
|
+
export interface ParsedTable {
|
|
23
|
+
headers: string[];
|
|
24
|
+
rows: Record<string, string>[];
|
|
25
|
+
}
|
|
26
|
+
export type SingleTargetField = "booking_date" | "value_date" | "amount" | "currency" | "counterparty_holder" | "counterparty_iban" | "payment_reference" | "booking_text";
|
|
27
|
+
export type ColumnMapping = Partial<Record<SingleTargetField, string>> & {
|
|
28
|
+
amountDebit?: string;
|
|
29
|
+
amountCredit?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const REQUIRED_FIELDS: readonly SingleTargetField[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const REQUIRED_FIELDS = ["booking_date"];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as XLSX from "xlsx";
|
|
2
|
+
export async function parseXlsxFile(file) {
|
|
3
|
+
const buffer = await file.arrayBuffer();
|
|
4
|
+
const workbook = XLSX.read(buffer, { type: "array", cellDates: true });
|
|
5
|
+
const sheetName = workbook.SheetNames[0];
|
|
6
|
+
if (!sheetName)
|
|
7
|
+
throw new Error("The Excel file has no sheets.");
|
|
8
|
+
const sheet = workbook.Sheets[sheetName];
|
|
9
|
+
const matrix = XLSX.utils.sheet_to_json(sheet, { header: 1, raw: false, defval: "" });
|
|
10
|
+
const headerRowIndex = matrix.findIndex((row) => row.some((cell) => String(cell ?? "").trim() !== ""));
|
|
11
|
+
if (headerRowIndex === -1)
|
|
12
|
+
throw new Error("The Excel file has no data.");
|
|
13
|
+
const headers = matrix[headerRowIndex].map((cell) => String(cell ?? "").trim());
|
|
14
|
+
const rows = matrix
|
|
15
|
+
.slice(headerRowIndex + 1)
|
|
16
|
+
.filter((row) => row.some((cell) => String(cell ?? "").trim() !== ""))
|
|
17
|
+
.map((row) => {
|
|
18
|
+
const record = {};
|
|
19
|
+
headers.forEach((header, i) => {
|
|
20
|
+
record[header] = String(row[i] ?? "").trim();
|
|
21
|
+
});
|
|
22
|
+
return record;
|
|
23
|
+
});
|
|
24
|
+
return { headers, rows };
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function downloadTextFile(fileName, content, mimeType = "text/csv") {
|
|
2
|
+
const blob = new Blob([content], { type: `${mimeType};charset=utf-8` });
|
|
3
|
+
const url = URL.createObjectURL(blob);
|
|
4
|
+
const link = document.createElement("a");
|
|
5
|
+
link.href = url;
|
|
6
|
+
link.download = fileName;
|
|
7
|
+
link.click();
|
|
8
|
+
URL.revokeObjectURL(url);
|
|
9
|
+
}
|
|
10
|
+
export function toCsv(rows) {
|
|
11
|
+
return rows
|
|
12
|
+
.map((row) => row.map((cell) => `"${cell.replace(/"/g, '""')}"`).join(";"))
|
|
13
|
+
.join("\r\n");
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface Formatters {
|
|
2
|
+
formatDate: (isoDate: string | null | undefined) => string;
|
|
3
|
+
formatDateTime: (isoDateTime: string | null | undefined) => string;
|
|
4
|
+
formatMoney: (amount: number | null | undefined) => string;
|
|
5
|
+
}
|
|
6
|
+
export declare const englishFormatters: Formatters;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const EMPTY = "—";
|
|
2
|
+
export const englishFormatters = {
|
|
3
|
+
formatDate(isoDate) {
|
|
4
|
+
if (!isoDate)
|
|
5
|
+
return EMPTY;
|
|
6
|
+
const date = new Date(isoDate.length <= 10 ? `${isoDate}T00:00:00` : isoDate);
|
|
7
|
+
if (Number.isNaN(date.getTime()))
|
|
8
|
+
return EMPTY;
|
|
9
|
+
return date.toLocaleDateString("en-GB", { year: "numeric", month: "long", day: "numeric" });
|
|
10
|
+
},
|
|
11
|
+
formatDateTime(isoDateTime) {
|
|
12
|
+
if (!isoDateTime)
|
|
13
|
+
return EMPTY;
|
|
14
|
+
const date = new Date(isoDateTime);
|
|
15
|
+
if (Number.isNaN(date.getTime()))
|
|
16
|
+
return EMPTY;
|
|
17
|
+
return date.toLocaleString("en-GB", { dateStyle: "long", timeStyle: "short" });
|
|
18
|
+
},
|
|
19
|
+
formatMoney(amount) {
|
|
20
|
+
if (amount === null || amount === undefined)
|
|
21
|
+
return EMPTY;
|
|
22
|
+
return new Intl.NumberFormat("en-GB", { style: "currency", currency: "EUR" }).format(amount);
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { cn } from "./class-names";
|
|
2
|
+
export type { QueryResult, MutationResult } from "./query-result";
|
|
3
|
+
export type { Formatters } from "./formatters";
|
|
4
|
+
export { englishFormatters } from "./formatters";
|
|
5
|
+
export { downloadTextFile, toCsv } from "./download";
|
|
6
|
+
export * from "./bank-import";
|
|
7
|
+
export * from "./opos-whitelist";
|
|
8
|
+
export { createPlaceholderOverviewAdapter, englishPlaceholderOverviewLabels, } from "./tour-placeholders";
|
|
9
|
+
export type { PlaceholderOverviewLabels } from "./tour-placeholders";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { cn } from "./class-names.js";
|
|
2
|
+
export { englishFormatters } from "./formatters.js";
|
|
3
|
+
export { downloadTextFile, toCsv } from "./download.js";
|
|
4
|
+
export * from "./bank-import/index.js";
|
|
5
|
+
export * from "./opos-whitelist/index.js";
|
|
6
|
+
export { createPlaceholderOverviewAdapter, englishPlaceholderOverviewLabels, } from "./tour-placeholders/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OPOS_CATEGORIES, OPOS_SCOPES, OPOS_TERM_MIN_LENGTH, oposNorm, asciiSpelling, shadowingRule, } from "./opos.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type OposCategory = "salary" | "tax_prepayment" | "private_withdrawal" | "rebooking" | "loan_installment" | "fee_interest" | "atm_withdrawal" | "other";
|
|
2
|
+
export declare const OPOS_CATEGORIES: readonly OposCategory[];
|
|
3
|
+
export type OposScope = "reference" | "counterparty" | "iban" | "booking_text" | "any";
|
|
4
|
+
export declare const OPOS_SCOPES: readonly OposScope[];
|
|
5
|
+
export declare const OPOS_TERM_MIN_LENGTH = 3;
|
|
6
|
+
export declare function oposNorm(term: string): string;
|
|
7
|
+
export declare function asciiSpelling(term: string): string | null;
|
|
8
|
+
export declare function shadowingRule<T extends {
|
|
9
|
+
id: string;
|
|
10
|
+
term: string;
|
|
11
|
+
scope: OposScope;
|
|
12
|
+
is_active: boolean;
|
|
13
|
+
created_at: string;
|
|
14
|
+
}>(rule: T, all: readonly T[]): T | null;
|