@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,49 @@
|
|
|
1
|
+
export const OPOS_CATEGORIES = [
|
|
2
|
+
"salary",
|
|
3
|
+
"tax_prepayment",
|
|
4
|
+
"private_withdrawal",
|
|
5
|
+
"rebooking",
|
|
6
|
+
"loan_installment",
|
|
7
|
+
"fee_interest",
|
|
8
|
+
"atm_withdrawal",
|
|
9
|
+
"other",
|
|
10
|
+
];
|
|
11
|
+
export const OPOS_SCOPES = ["reference", "counterparty", "iban", "booking_text", "any"];
|
|
12
|
+
export const OPOS_TERM_MIN_LENGTH = 3;
|
|
13
|
+
export function oposNorm(term) {
|
|
14
|
+
return term.toLowerCase().replace(/\s+/g, " ").trim();
|
|
15
|
+
}
|
|
16
|
+
const UMLAUT_PAIRS = [
|
|
17
|
+
[/ä/g, "ae"],
|
|
18
|
+
[/ö/g, "oe"],
|
|
19
|
+
[/ü/g, "ue"],
|
|
20
|
+
[/Ä/g, "Ae"],
|
|
21
|
+
[/Ö/g, "Oe"],
|
|
22
|
+
[/Ü/g, "Ue"],
|
|
23
|
+
[/ß/g, "ss"],
|
|
24
|
+
];
|
|
25
|
+
export function asciiSpelling(term) {
|
|
26
|
+
const ascii = UMLAUT_PAIRS.reduce((text, [pattern, replacement]) => text.replace(pattern, replacement), term);
|
|
27
|
+
return ascii === term ? null : ascii;
|
|
28
|
+
}
|
|
29
|
+
export function shadowingRule(rule, all) {
|
|
30
|
+
const mine = oposNorm(rule.term);
|
|
31
|
+
if (!mine || !rule.is_active)
|
|
32
|
+
return null;
|
|
33
|
+
const olderThan = (a, b) => (a.created_at !== b.created_at ? a.created_at < b.created_at : a.term < b.term);
|
|
34
|
+
let winner = null;
|
|
35
|
+
for (const other of all) {
|
|
36
|
+
if (other.id === rule.id || !other.is_active)
|
|
37
|
+
continue;
|
|
38
|
+
if (other.scope !== rule.scope && other.scope !== "any")
|
|
39
|
+
continue;
|
|
40
|
+
const theirs = oposNorm(other.term);
|
|
41
|
+
if (!theirs || !mine.includes(theirs))
|
|
42
|
+
continue;
|
|
43
|
+
if (!olderThan(other, rule))
|
|
44
|
+
continue;
|
|
45
|
+
if (!winner || olderThan(other, winner))
|
|
46
|
+
winner = other;
|
|
47
|
+
}
|
|
48
|
+
return winner;
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface QueryResult<Data> {
|
|
2
|
+
data: Data | undefined;
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
isError: boolean;
|
|
5
|
+
error: unknown;
|
|
6
|
+
isRefreshing: boolean;
|
|
7
|
+
refetch: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface MutationResult<Input> {
|
|
10
|
+
run: (input: Input) => void;
|
|
11
|
+
isPending: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createPlaceholderOverviewAdapter, englishPlaceholderOverviewLabels, } from "./overview.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OverviewAdapter } from "../../adapters/overview";
|
|
2
|
+
export interface PlaceholderOverviewLabels {
|
|
3
|
+
stages: string[];
|
|
4
|
+
suppliers: string[];
|
|
5
|
+
companies: string[];
|
|
6
|
+
channels: string[];
|
|
7
|
+
trendPoints: string[];
|
|
8
|
+
openItems: string[];
|
|
9
|
+
bank: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const englishPlaceholderOverviewLabels: PlaceholderOverviewLabels;
|
|
12
|
+
export declare function createPlaceholderOverviewAdapter(labels?: PlaceholderOverviewLabels, formatMoney?: (value: number) => string): OverviewAdapter;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { FileText, Landmark } from "lucide-react";
|
|
2
|
+
export const englishPlaceholderOverviewLabels = {
|
|
3
|
+
stages: ["Inbox", "Needs review", "Approved"],
|
|
4
|
+
suppliers: ["Sample supplier one", "Sample supplier two", "Sample supplier three"],
|
|
5
|
+
companies: ["Sample company north", "Sample company south"],
|
|
6
|
+
channels: ["Email", "Upload"],
|
|
7
|
+
trendPoints: ["Week 1", "Week 2", "Week 3", "Week 4"],
|
|
8
|
+
openItems: ["Due this week", "Overdue"],
|
|
9
|
+
bank: ["Unmatched transactions"],
|
|
10
|
+
};
|
|
11
|
+
const SAMPLE_MONEY_FIGURE = {
|
|
12
|
+
value: 48250,
|
|
13
|
+
count: 24,
|
|
14
|
+
previousValue: 41000,
|
|
15
|
+
loading: false,
|
|
16
|
+
};
|
|
17
|
+
const STAGE_COUNTS = [12, 5, 31];
|
|
18
|
+
const SUPPLIER_VALUES = [18400, 12900, 6300];
|
|
19
|
+
const COMPANY_VALUES = [22100, 15500];
|
|
20
|
+
const CHANNEL_COUNTS = [84, 44];
|
|
21
|
+
const TREND_VALUES = [
|
|
22
|
+
{ incoming: 9200, outgoing: 7400 },
|
|
23
|
+
{ incoming: 11800, outgoing: 8100 },
|
|
24
|
+
{ incoming: 10400, outgoing: 9600 },
|
|
25
|
+
{ incoming: 13900, outgoing: 8800 },
|
|
26
|
+
];
|
|
27
|
+
const OPEN_ITEM_VALUES = ["4", "2"];
|
|
28
|
+
const BANK_VALUES = ["9"];
|
|
29
|
+
function rankedRows(names, values, formatMoney) {
|
|
30
|
+
const highest = Math.max(...values);
|
|
31
|
+
return names.map((name, index) => ({
|
|
32
|
+
key: String(index),
|
|
33
|
+
label: name,
|
|
34
|
+
valueText: formatMoney(values[index] ?? 0),
|
|
35
|
+
sharePct: highest === 0 ? 0 : Math.round(((values[index] ?? 0) / highest) * 100),
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
function sumOf(values) {
|
|
39
|
+
return values.reduce((total, value) => total + value, 0);
|
|
40
|
+
}
|
|
41
|
+
export function createPlaceholderOverviewAdapter(labels = englishPlaceholderOverviewLabels, formatMoney = (value) => String(value)) {
|
|
42
|
+
return {
|
|
43
|
+
useMoneyFigures(ranges) {
|
|
44
|
+
const data = {};
|
|
45
|
+
for (const key of Object.keys(ranges)) {
|
|
46
|
+
data[key] = SAMPLE_MONEY_FIGURE;
|
|
47
|
+
}
|
|
48
|
+
return { data, loading: false };
|
|
49
|
+
},
|
|
50
|
+
useInvoiceStages() {
|
|
51
|
+
return {
|
|
52
|
+
data: labels.stages.map((label, index) => ({
|
|
53
|
+
key: String(index),
|
|
54
|
+
label,
|
|
55
|
+
count: STAGE_COUNTS[index] ?? 0,
|
|
56
|
+
link: { to: "/" },
|
|
57
|
+
})),
|
|
58
|
+
loading: false,
|
|
59
|
+
error: false,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
useTopSuppliers() {
|
|
63
|
+
return {
|
|
64
|
+
data: {
|
|
65
|
+
rows: rankedRows(labels.suppliers, SUPPLIER_VALUES, formatMoney),
|
|
66
|
+
totalText: formatMoney(sumOf(SUPPLIER_VALUES)),
|
|
67
|
+
},
|
|
68
|
+
loading: false,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
useSpendByCompany() {
|
|
72
|
+
return {
|
|
73
|
+
data: {
|
|
74
|
+
rows: rankedRows(labels.companies, COMPANY_VALUES, formatMoney),
|
|
75
|
+
totalText: formatMoney(sumOf(COMPANY_VALUES)),
|
|
76
|
+
},
|
|
77
|
+
loading: false,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
useMoneyTrend() {
|
|
81
|
+
return {
|
|
82
|
+
data: labels.trendPoints.map((label, index) => ({
|
|
83
|
+
label,
|
|
84
|
+
incoming: TREND_VALUES[index]?.incoming ?? 0,
|
|
85
|
+
outgoing: TREND_VALUES[index]?.outgoing ?? 0,
|
|
86
|
+
})),
|
|
87
|
+
loading: false,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
useProcessingSummary() {
|
|
91
|
+
return {
|
|
92
|
+
data: {
|
|
93
|
+
processed: 128,
|
|
94
|
+
recognized: 119,
|
|
95
|
+
needsReview: 7,
|
|
96
|
+
errors: 2,
|
|
97
|
+
channels: labels.channels.map((label, index) => ({
|
|
98
|
+
label,
|
|
99
|
+
count: CHANNEL_COUNTS[index] ?? 0,
|
|
100
|
+
})),
|
|
101
|
+
lastRunLabel: null,
|
|
102
|
+
},
|
|
103
|
+
loading: false,
|
|
104
|
+
error: false,
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
useOpenItemsSummary() {
|
|
108
|
+
return {
|
|
109
|
+
data: labels.openItems.map((label, index) => ({
|
|
110
|
+
key: String(index),
|
|
111
|
+
to: "/",
|
|
112
|
+
icon: FileText,
|
|
113
|
+
iconClassName: index === 0 ? "bg-warning" : "bg-danger",
|
|
114
|
+
label,
|
|
115
|
+
value: OPEN_ITEM_VALUES[index] ?? "0",
|
|
116
|
+
})),
|
|
117
|
+
loading: false,
|
|
118
|
+
error: false,
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
useBankSummary() {
|
|
122
|
+
return {
|
|
123
|
+
data: labels.bank.map((label, index) => ({
|
|
124
|
+
key: String(index),
|
|
125
|
+
to: "/",
|
|
126
|
+
icon: Landmark,
|
|
127
|
+
iconClassName: "bg-muted-foreground",
|
|
128
|
+
label,
|
|
129
|
+
value: BANK_VALUES[index] ?? "0",
|
|
130
|
+
})),
|
|
131
|
+
loading: false,
|
|
132
|
+
error: false,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
formatMoney,
|
|
136
|
+
formatMoneyCompact: formatMoney,
|
|
137
|
+
formatDay: (iso) => iso,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BankReconciliationAdapter } from "../../adapters/bank-reconciliation";
|
|
2
|
+
import { type BankAccountsLabels } from "./labels";
|
|
3
|
+
export interface BankAccountsPageProps {
|
|
4
|
+
adapter: Pick<BankReconciliationAdapter, "useAccounts" | "useCompanyOptions" | "formatMoney" | "formatDate">;
|
|
5
|
+
labels?: BankAccountsLabels;
|
|
6
|
+
}
|
|
7
|
+
export declare function BankAccountsPage({ adapter, labels }: BankAccountsPageProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { Combobox } from "../../ui/combobox.js";
|
|
4
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../ui/table.js";
|
|
5
|
+
import { ErrorState, TableSkeleton } from "../../components/feedback/query-states.js";
|
|
6
|
+
import { cn } from "../../lib/class-names.js";
|
|
7
|
+
import { englishBankAccountsLabels } from "./labels.js";
|
|
8
|
+
function formatIban(iban) {
|
|
9
|
+
if (!iban)
|
|
10
|
+
return "—";
|
|
11
|
+
return iban.replace(/(.{4})/g, "$1 ").trim();
|
|
12
|
+
}
|
|
13
|
+
export function BankAccountsPage({ adapter, labels = englishBankAccountsLabels }) {
|
|
14
|
+
const accountsQuery = adapter.useAccounts();
|
|
15
|
+
const companyOptionsQuery = adapter.useCompanyOptions?.();
|
|
16
|
+
const [company, setCompany] = useState("");
|
|
17
|
+
const rows = useMemo(() => {
|
|
18
|
+
return accountsQuery.data.filter((account) => !company || account.company_code === company);
|
|
19
|
+
}, [accountsQuery.data, company]);
|
|
20
|
+
return (_jsxs("div", { children: [_jsxs("div", { children: [_jsx("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: labels.title }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: labels.subtitle })] }), companyOptionsQuery && (companyOptionsQuery.data?.length ?? 0) > 0 && (_jsx("div", { className: "mt-6", children: _jsx(Combobox, { value: company, onValueChange: setCompany, className: "w-full sm:w-56", options: [{ value: "", label: labels.companyAll }, ...companyOptionsQuery.data.map((c) => ({ value: c.code, label: `${c.code} — ${c.name}` }))] }) })), accountsQuery.error ? (_jsx("div", { className: "mt-4", children: _jsx(ErrorState, { error: accountsQuery.error, onRetry: () => { } }) })) : accountsQuery.loading ? (_jsx("div", { className: "mt-4", children: _jsx(TableSkeleton, { rows: 6, columns: 6 }) })) : (_jsx("div", { className: "mt-4 overflow-hidden overflow-x-auto rounded-xl border border-border bg-card", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { className: "bg-muted/40", children: [_jsx(TableHead, { children: labels.columnAccount }), _jsx(TableHead, { children: labels.columnCompany }), _jsx(TableHead, { children: labels.columnIban }), _jsx(TableHead, { children: labels.columnBank }), _jsx(TableHead, { className: "text-right", children: labels.columnBalance }), _jsx(TableHead, { children: labels.columnStatus })] }) }), _jsxs(TableBody, { children: [rows.map((account) => (_jsxs(TableRow, { className: cn(account.excluded_at && "opacity-60"), children: [_jsx(TableCell, { className: "font-medium text-foreground", children: account.account_name ?? "—" }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: account.company_code ?? "—" }), _jsx(TableCell, { className: "font-mono text-sm text-muted-foreground", children: formatIban(account.iban) }), _jsx(TableCell, { className: "text-sm text-muted-foreground", children: account.bank_name ?? "—" }), _jsx(TableCell, { className: "text-right font-medium tabular-nums", children: adapter.formatMoney(account.balance) }), _jsx(TableCell, { children: _jsx("span", { className: cn("inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-medium", account.excluded_at ? "bg-muted text-muted-foreground" : "bg-emerald-100 text-emerald-800"), children: account.excluded_at ? labels.statusExcluded : labels.statusActive }) })] }, account.id))), rows.length === 0 && (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 6, className: "py-12 text-center text-muted-foreground", children: labels.empty }) }))] })] }) }))] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface BankAccountsLabels {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle: string;
|
|
4
|
+
companyAll: string;
|
|
5
|
+
columnAccount: string;
|
|
6
|
+
columnCompany: string;
|
|
7
|
+
columnIban: string;
|
|
8
|
+
columnBank: string;
|
|
9
|
+
columnBalance: string;
|
|
10
|
+
columnStatus: string;
|
|
11
|
+
statusActive: string;
|
|
12
|
+
statusExcluded: string;
|
|
13
|
+
empty: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const englishBankAccountsLabels: BankAccountsLabels;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const englishBankAccountsLabels = {
|
|
2
|
+
title: "Bank accounts",
|
|
3
|
+
subtitle: "Connected and manually entered bank accounts.",
|
|
4
|
+
companyAll: "All companies",
|
|
5
|
+
columnAccount: "Account",
|
|
6
|
+
columnCompany: "Company",
|
|
7
|
+
columnIban: "IBAN",
|
|
8
|
+
columnBank: "Bank",
|
|
9
|
+
columnBalance: "Balance",
|
|
10
|
+
columnStatus: "Status",
|
|
11
|
+
statusActive: "Active",
|
|
12
|
+
statusExcluded: "Excluded",
|
|
13
|
+
empty: "No bank accounts found.",
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Formatters } from "../../lib/formatters";
|
|
2
|
+
import type { BankReconciliationAdapter } from "../../adapters/bank-reconciliation";
|
|
3
|
+
import { type BankImportLabels } from "./labels";
|
|
4
|
+
export interface BankImportWizardProps {
|
|
5
|
+
adapter: Pick<BankReconciliationAdapter, "import" | "formatMoney" | "formatDate">;
|
|
6
|
+
labels?: BankImportLabels;
|
|
7
|
+
formatters?: Formatters;
|
|
8
|
+
}
|
|
9
|
+
export declare function BankImportWizard({ adapter, labels, formatters }: BankImportWizardProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { AlertTriangle, Trash2, Upload } from "lucide-react";
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { Button } from "../../ui/button.js";
|
|
6
|
+
import { Checkbox } from "../../ui/checkbox.js";
|
|
7
|
+
import { Combobox } from "../../ui/combobox.js";
|
|
8
|
+
import { Label } from "../../ui/label.js";
|
|
9
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "../../ui/dialog.js";
|
|
10
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../ui/table.js";
|
|
11
|
+
import { readableErrorMessage } from "../../components/feedback/query-states.js";
|
|
12
|
+
import { cn } from "../../lib/class-names.js";
|
|
13
|
+
import { englishFormatters } from "../../lib/formatters.js";
|
|
14
|
+
import { detectFormat, findSuspectedDuplicates, guessColumnMapping, loadStoredMapping, normalizeTable, parseBankFile, saveMapping, } from "../../lib/bank-import/index.js";
|
|
15
|
+
import { englishBankImportLabels } from "./labels.js";
|
|
16
|
+
const STEPS = ["account", "upload", "mapping", "preview", "result"];
|
|
17
|
+
const OPTIONAL_FIELDS = [
|
|
18
|
+
"value_date",
|
|
19
|
+
"currency",
|
|
20
|
+
"counterparty_holder",
|
|
21
|
+
"counterparty_iban",
|
|
22
|
+
"payment_reference",
|
|
23
|
+
"booking_text",
|
|
24
|
+
];
|
|
25
|
+
export function BankImportWizard({ adapter, labels = englishBankImportLabels, formatters = englishFormatters }) {
|
|
26
|
+
if (!adapter.import)
|
|
27
|
+
return null;
|
|
28
|
+
const importCapability = adapter.import;
|
|
29
|
+
const accountOptionsQuery = importCapability.useAccountOptions();
|
|
30
|
+
const [open, setOpen] = useState(false);
|
|
31
|
+
const [step, setStep] = useState("account");
|
|
32
|
+
const [accountId, setAccountId] = useState("");
|
|
33
|
+
const [table, setTable] = useState(null);
|
|
34
|
+
const [filename, setFilename] = useState("");
|
|
35
|
+
const [normalized, setNormalized] = useState(null);
|
|
36
|
+
const [rows, setRows] = useState([]);
|
|
37
|
+
const [importing, setImporting] = useState(false);
|
|
38
|
+
const [result, setResult] = useState(null);
|
|
39
|
+
function reset() {
|
|
40
|
+
setStep("account");
|
|
41
|
+
setAccountId("");
|
|
42
|
+
setTable(null);
|
|
43
|
+
setFilename("");
|
|
44
|
+
setNormalized(null);
|
|
45
|
+
setRows([]);
|
|
46
|
+
setResult(null);
|
|
47
|
+
}
|
|
48
|
+
async function runImport() {
|
|
49
|
+
setImporting(true);
|
|
50
|
+
try {
|
|
51
|
+
const outcome = await importCapability.importRows(accountId, filename, rows);
|
|
52
|
+
setResult(outcome);
|
|
53
|
+
setStep("result");
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
toast.error(labels.importFailed(readableErrorMessage(error, "")));
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
setImporting(false);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return (_jsxs(Dialog, { open: open, onOpenChange: (next) => {
|
|
63
|
+
setOpen(next);
|
|
64
|
+
if (!next)
|
|
65
|
+
reset();
|
|
66
|
+
}, children: [_jsx(DialogTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", className: "gap-2", children: [_jsx(Upload, { className: "size-4" }), labels.button] }) }), _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: labels.dialogTitle }), _jsx(DialogDescription, { children: labels.dialogDescription })] }), _jsx("ol", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground", children: STEPS.map((s, i) => (_jsxs("li", { className: cn("flex items-center gap-1", s === step && "font-medium text-foreground"), children: [_jsxs("span", { children: [i + 1, "."] }), { account: labels.stepAccount, upload: labels.stepUpload, mapping: labels.stepMapping, preview: labels.stepPreview, result: labels.stepResult }[s]] }, s))) }), step === "account" && (_jsxs("div", { className: "space-y-3", children: [_jsx(Combobox, { value: accountId, onValueChange: setAccountId, options: accountOptionsQuery.data.map((a) => ({ value: a.id, label: a.label })), placeholder: labels.accountPlaceholder }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { disabled: !accountId, onClick: () => setStep("upload"), children: labels.continueButton }) })] })), step === "upload" && (_jsx(UploadStep, { labels: labels, onParsed: (t, name) => {
|
|
67
|
+
setTable(t);
|
|
68
|
+
setFilename(name);
|
|
69
|
+
setStep("mapping");
|
|
70
|
+
}, onBack: () => setStep("account") })), step === "mapping" && table && (_jsx(MappingStep, { table: table, labels: labels, onBack: () => setStep("upload"), onConfirm: (mapping) => {
|
|
71
|
+
const result = normalizeTable(table, mapping);
|
|
72
|
+
setNormalized(result);
|
|
73
|
+
setRows(result.rows);
|
|
74
|
+
setStep("preview");
|
|
75
|
+
} })), step === "preview" && normalized && (_jsx(PreviewStep, { normalized: normalized, rows: rows, onRowsChange: setRows, labels: labels, formatters: formatters, importing: importing, onBack: () => setStep("mapping"), onImport: runImport })), step === "result" && result && (_jsxs("div", { className: "space-y-4", children: [_jsx("p", { className: "text-sm text-foreground", children: labels.resultSummary(result.imported, result.skipped, result.duplicates) }), _jsx("div", { className: "flex justify-end", children: _jsx(Button, { onClick: () => setOpen(false), children: labels.close }) })] }))] })] }));
|
|
76
|
+
}
|
|
77
|
+
function UploadStep({ labels, onParsed, onBack, }) {
|
|
78
|
+
const inputRef = useRef(null);
|
|
79
|
+
const [dragOver, setDragOver] = useState(false);
|
|
80
|
+
const [busy, setBusy] = useState(false);
|
|
81
|
+
const [error, setError] = useState(null);
|
|
82
|
+
async function handleFile(file) {
|
|
83
|
+
setError(null);
|
|
84
|
+
if (detectFormat(file) === "pdf") {
|
|
85
|
+
setError(labels.pdfNotSupported);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
setBusy(true);
|
|
89
|
+
try {
|
|
90
|
+
const { table } = await parseBankFile(file);
|
|
91
|
+
onParsed(table, file.name);
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
setError(readableErrorMessage(e, ""));
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
setBusy(false);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: cn("flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-border p-10 text-center", dragOver && "border-brand bg-brand-wash"), onDragOver: (event) => {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
setDragOver(true);
|
|
103
|
+
}, onDragLeave: () => setDragOver(false), onDrop: (event) => {
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
setDragOver(false);
|
|
106
|
+
const file = event.dataTransfer.files[0];
|
|
107
|
+
if (file)
|
|
108
|
+
handleFile(file);
|
|
109
|
+
}, children: [_jsx(Upload, { className: "size-6 text-muted-foreground" }), _jsx(Button, { type: "button", variant: "outline", disabled: busy, onClick: () => inputRef.current?.click(), children: busy ? labels.uploadBusy : labels.uploadPrompt }), _jsx("p", { className: "text-xs text-muted-foreground", children: labels.uploadHint }), _jsx("input", { ref: inputRef, type: "file", accept: ".csv,.txt,.xlsx,.xls", className: "hidden", onChange: (event) => {
|
|
110
|
+
const file = event.target.files?.[0];
|
|
111
|
+
if (file)
|
|
112
|
+
handleFile(file);
|
|
113
|
+
} })] }), error && (_jsxs("p", { className: "flex items-center gap-1.5 text-sm text-destructive", children: [_jsx(AlertTriangle, { className: "size-4 shrink-0" }), error] })), _jsx("div", { className: "flex justify-start", children: _jsx(Button, { variant: "ghost", onClick: onBack, children: labels.backButton }) })] }));
|
|
114
|
+
}
|
|
115
|
+
function MappingStep({ table, labels, onConfirm, onBack, }) {
|
|
116
|
+
const [mapping, setMapping] = useState({});
|
|
117
|
+
const [splitAmount, setSplitAmount] = useState(false);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
const stored = loadStoredMapping(table.headers);
|
|
120
|
+
const initial = stored ?? guessColumnMapping(table.headers);
|
|
121
|
+
setMapping(initial);
|
|
122
|
+
setSplitAmount(!!(initial.amountDebit || initial.amountCredit));
|
|
123
|
+
}, [table.headers]);
|
|
124
|
+
const columnOptions = [{ value: "", label: labels.notMapped }, ...table.headers.map((h) => ({ value: h, label: h }))];
|
|
125
|
+
const fieldLabel = {
|
|
126
|
+
booking_date: labels.fieldBookingDate,
|
|
127
|
+
value_date: labels.fieldValueDate,
|
|
128
|
+
amount: labels.fieldAmount,
|
|
129
|
+
currency: labels.fieldCurrency,
|
|
130
|
+
counterparty_holder: labels.fieldCounterpartyHolder,
|
|
131
|
+
counterparty_iban: labels.fieldCounterpartyIban,
|
|
132
|
+
payment_reference: labels.fieldPaymentReference,
|
|
133
|
+
booking_text: labels.fieldBookingText,
|
|
134
|
+
};
|
|
135
|
+
function setField(field, value) {
|
|
136
|
+
setMapping((prev) => ({ ...prev, [field]: value || undefined }));
|
|
137
|
+
}
|
|
138
|
+
const hasAmount = splitAmount ? mapping.amountDebit || mapping.amountCredit : !!mapping.amount;
|
|
139
|
+
const canContinue = !!mapping.booking_date && hasAmount;
|
|
140
|
+
function confirm() {
|
|
141
|
+
const finalMapping = splitAmount ? { ...mapping, amount: undefined } : { ...mapping, amountDebit: undefined, amountCredit: undefined };
|
|
142
|
+
saveMapping(table.headers, finalMapping);
|
|
143
|
+
onConfirm(finalMapping);
|
|
144
|
+
}
|
|
145
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: labels.mappingHint }), _jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-3", children: [_jsx(MappingField, { label: `${labels.fieldBookingDate} *`, value: mapping.booking_date ?? "", onChange: (v) => setField("booking_date", v), options: columnOptions }), !splitAmount && (_jsx(MappingField, { label: `${labels.fieldAmount} *`, value: mapping.amount ?? "", onChange: (v) => setField("amount", v), options: columnOptions })), OPTIONAL_FIELDS.map((field) => (_jsx(MappingField, { label: fieldLabel[field], value: mapping[field] ?? "", onChange: (v) => setField(field, v), options: columnOptions }, field)))] }), _jsxs("label", { className: "flex items-center gap-2 text-sm", children: [_jsx(Checkbox, { checked: splitAmount, onCheckedChange: (v) => setSplitAmount(v === true) }), _jsx("span", { className: "text-muted-foreground", children: labels.useSplitAmount })] }), splitAmount && (_jsxs("div", { className: "grid grid-cols-2 gap-x-4 gap-y-3", children: [_jsx(MappingField, { label: `${labels.fieldAmountDebit} *`, value: mapping.amountDebit ?? "", onChange: (v) => setField("amountDebit", v), options: columnOptions }), _jsx(MappingField, { label: `${labels.fieldAmountCredit} *`, value: mapping.amountCredit ?? "", onChange: (v) => setField("amountCredit", v), options: columnOptions })] })), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Button, { variant: "ghost", onClick: onBack, children: labels.backButton }), _jsx(Button, { disabled: !canContinue, onClick: confirm, children: labels.continueButton })] })] }));
|
|
146
|
+
}
|
|
147
|
+
function MappingField({ label, value, onChange, options }) {
|
|
148
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { children: label }), _jsx(Combobox, { value: value, onValueChange: onChange, options: options, className: "w-full" })] }));
|
|
149
|
+
}
|
|
150
|
+
function PreviewStep({ normalized, rows, onRowsChange, labels, formatters, importing, onBack, onImport, }) {
|
|
151
|
+
const duplicates = findSuspectedDuplicates(rows);
|
|
152
|
+
const sum = rows.reduce((acc, r) => acc + r.amount, 0);
|
|
153
|
+
const dates = rows.map((r) => r.booking_date).sort();
|
|
154
|
+
function removeRow(index) {
|
|
155
|
+
onRowsChange(rows.filter((_, i) => i !== index));
|
|
156
|
+
}
|
|
157
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsx("div", { className: "rounded-md border border-border bg-muted/40 p-3 text-sm text-foreground", children: labels.previewSummary(rows.length, formatters.formatDate(dates[0]), formatters.formatDate(dates[dates.length - 1]), formatters.formatMoney(sum)) }), normalized.issues.length > 0 && _jsx("p", { className: "text-sm text-muted-foreground", children: labels.issuesWarning(normalized.issues.length) }), duplicates.size > 0 && (_jsxs("div", { className: "flex items-start gap-2 rounded-md border border-amber-300/60 bg-amber-50 p-3 text-sm text-amber-900", children: [_jsx(AlertTriangle, { className: "mt-0.5 size-4 shrink-0" }), labels.duplicateWarning(duplicates.size)] })), _jsx("div", { className: "overflow-hidden rounded-md border border-border", children: _jsxs(Table, { containerClassName: "max-h-[360px]", children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: labels.columnDate }), _jsx(TableHead, { className: "text-right", children: labels.columnAmount }), _jsx(TableHead, { children: labels.columnCounterparty }), _jsx(TableHead, { children: labels.columnReference }), _jsx(TableHead, { className: "w-9" })] }) }), _jsx(TableBody, { children: rows.slice(0, 100).map((row, i) => (_jsxs(TableRow, { className: cn(duplicates.has(i) && "bg-amber-50"), children: [_jsx(TableCell, { children: formatters.formatDate(row.booking_date) }), _jsx(TableCell, { className: "text-right tabular-nums", children: formatters.formatMoney(row.amount) }), _jsx(TableCell, { children: row.counterparty_holder ?? "—" }), _jsx(TableCell, { className: "max-w-[280px] truncate", children: row.payment_reference ?? "—" }), _jsx(TableCell, { children: _jsx(Button, { variant: "ghost", size: "icon", type: "button", className: "size-7 text-muted-foreground hover:text-destructive", title: labels.removeRow, onClick: () => removeRow(i), children: _jsx(Trash2, { className: "size-4" }) }) })] }, i))) })] }) }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Button, { variant: "ghost", onClick: onBack, type: "button", children: labels.backButton }), _jsx(Button, { disabled: rows.length === 0 || importing, onClick: onImport, children: importing ? labels.importing : labels.importButton })] })] }));
|
|
158
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface BankImportLabels {
|
|
2
|
+
button: string;
|
|
3
|
+
dialogTitle: string;
|
|
4
|
+
dialogDescription: string;
|
|
5
|
+
stepAccount: string;
|
|
6
|
+
stepUpload: string;
|
|
7
|
+
stepMapping: string;
|
|
8
|
+
stepPreview: string;
|
|
9
|
+
stepResult: string;
|
|
10
|
+
accountPlaceholder: string;
|
|
11
|
+
uploadPrompt: string;
|
|
12
|
+
uploadHint: string;
|
|
13
|
+
uploadBusy: string;
|
|
14
|
+
pdfNotSupported: string;
|
|
15
|
+
mappingHint: string;
|
|
16
|
+
fieldBookingDate: string;
|
|
17
|
+
fieldAmount: string;
|
|
18
|
+
fieldValueDate: string;
|
|
19
|
+
fieldCurrency: string;
|
|
20
|
+
fieldCounterpartyHolder: string;
|
|
21
|
+
fieldCounterpartyIban: string;
|
|
22
|
+
fieldPaymentReference: string;
|
|
23
|
+
fieldBookingText: string;
|
|
24
|
+
fieldAmountDebit: string;
|
|
25
|
+
fieldAmountCredit: string;
|
|
26
|
+
useSplitAmount: string;
|
|
27
|
+
notMapped: string;
|
|
28
|
+
continueButton: string;
|
|
29
|
+
backButton: string;
|
|
30
|
+
previewSummary: (count: number, from: string, to: string, sum: string) => string;
|
|
31
|
+
issuesWarning: (count: number) => string;
|
|
32
|
+
duplicateWarning: (count: number) => string;
|
|
33
|
+
columnDate: string;
|
|
34
|
+
columnAmount: string;
|
|
35
|
+
columnCounterparty: string;
|
|
36
|
+
columnReference: string;
|
|
37
|
+
removeRow: string;
|
|
38
|
+
importButton: string;
|
|
39
|
+
importing: string;
|
|
40
|
+
resultSummary: (imported: number, skipped: number, duplicates: number) => string;
|
|
41
|
+
close: string;
|
|
42
|
+
importFailed: (error: string) => string;
|
|
43
|
+
}
|
|
44
|
+
export declare const englishBankImportLabels: BankImportLabels;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const englishBankImportLabels = {
|
|
2
|
+
button: "Import file",
|
|
3
|
+
dialogTitle: "Import bank transactions",
|
|
4
|
+
dialogDescription: "Upload a CSV or Excel export from your bank.",
|
|
5
|
+
stepAccount: "Account",
|
|
6
|
+
stepUpload: "Upload",
|
|
7
|
+
stepMapping: "Columns",
|
|
8
|
+
stepPreview: "Preview",
|
|
9
|
+
stepResult: "Done",
|
|
10
|
+
accountPlaceholder: "Choose an account",
|
|
11
|
+
uploadPrompt: "Choose a CSV or Excel file",
|
|
12
|
+
uploadHint: "or drag and drop it here",
|
|
13
|
+
uploadBusy: "Reading file…",
|
|
14
|
+
pdfNotSupported: "PDF statements are not supported here.",
|
|
15
|
+
mappingHint: "Match each column in your file to the field it holds.",
|
|
16
|
+
fieldBookingDate: "Booking date",
|
|
17
|
+
fieldAmount: "Amount",
|
|
18
|
+
fieldValueDate: "Value date",
|
|
19
|
+
fieldCurrency: "Currency",
|
|
20
|
+
fieldCounterpartyHolder: "Counterparty",
|
|
21
|
+
fieldCounterpartyIban: "Counterparty IBAN",
|
|
22
|
+
fieldPaymentReference: "Reference",
|
|
23
|
+
fieldBookingText: "Booking text",
|
|
24
|
+
fieldAmountDebit: "Debit column",
|
|
25
|
+
fieldAmountCredit: "Credit column",
|
|
26
|
+
useSplitAmount: "Amount is split across two columns (debit/credit)",
|
|
27
|
+
notMapped: "Not mapped",
|
|
28
|
+
continueButton: "Continue",
|
|
29
|
+
backButton: "Back",
|
|
30
|
+
previewSummary: (count, from, to, sum) => `${count} rows, ${from} to ${to}, total ${sum}.`,
|
|
31
|
+
issuesWarning: (count) => `${count} rows could not be read and were skipped.`,
|
|
32
|
+
duplicateWarning: (count) => `${count} rows look like duplicates of each other.`,
|
|
33
|
+
columnDate: "Date",
|
|
34
|
+
columnAmount: "Amount",
|
|
35
|
+
columnCounterparty: "Counterparty",
|
|
36
|
+
columnReference: "Reference",
|
|
37
|
+
removeRow: "Remove row",
|
|
38
|
+
importButton: "Import",
|
|
39
|
+
importing: "Importing…",
|
|
40
|
+
resultSummary: (imported, skipped, duplicates) => `Imported ${imported}, skipped ${skipped}, ${duplicates} flagged as duplicates.`,
|
|
41
|
+
close: "Close",
|
|
42
|
+
importFailed: (error) => `Import failed: ${error}`,
|
|
43
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SyncLogAdapter } from "../../adapters/bank-sync-log";
|
|
2
|
+
import { type BankSyncLogLabels } from "./labels";
|
|
3
|
+
export interface BankSyncLogPageProps {
|
|
4
|
+
adapter: SyncLogAdapter;
|
|
5
|
+
labels?: BankSyncLogLabels;
|
|
6
|
+
}
|
|
7
|
+
export declare function BankSyncLogPage({ adapter, labels }: BankSyncLogPageProps): import("react").JSX.Element;
|