@powerhousedao/contributor-billing 0.1.27 → 0.1.30
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 +165 -8
- package/dist/document-models/billing-statement/actions.d.ts +1 -0
- package/dist/document-models/billing-statement/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.js +58 -47
- package/dist/document-models/billing-statement/gen/document-schema.d.ts +38 -38
- package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts +6 -2
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +3 -2
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.js +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/ph-factories.js +1 -1
- package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/reducer.js +5 -1
- package/dist/document-models/billing-statement/gen/schema/types.d.ts +3 -0
- package/dist/document-models/billing-statement/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.js +5 -0
- package/dist/document-models/billing-statement/gen/utils.js +2 -2
- package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/general.js +5 -4
- package/dist/document-models/billing-statement/src/reducers/line-items.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/line-items.js +7 -2
- package/dist/document-models/billing-statement/src/reducers/tags.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/tags.js +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.js +94 -7
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts +2 -1
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/general.test.js +33 -88
- package/dist/document-models/billing-statement/src/tests/line-items.test.js +22 -125
- package/dist/document-models/billing-statement/src/tests/tags.test.js +13 -47
- package/dist/document-models/document-models.js +2 -2
- package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/document-model.js +48 -48
- package/dist/document-models/expense-report/gen/document-schema.d.ts +6 -6
- package/dist/document-models/expense-report/gen/utils.js +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.js +94 -8
- package/dist/document-models/expense-report/src/tests/wallet.test.js +145 -10
- package/dist/document-models/index.d.ts +2 -6
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +2 -6
- package/dist/document-models/integrations/gen/document-model.js +33 -33
- package/dist/document-models/integrations/gen/document-schema.d.ts +6 -6
- package/dist/document-models/integrations/gen/utils.js +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.js +9 -32
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/integrations/src/tests/document-model.test.js +91 -5
- package/dist/document-models/integrations/src/tests/integrations.test.js +21 -46
- package/dist/document-models/invoice/gen/document-model.js +147 -147
- package/dist/document-models/invoice/gen/document-schema.d.ts +127 -127
- package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.js +16 -122
- package/dist/document-models/invoice/gen/schema/types.d.ts +4 -4
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.js +4 -4
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +17 -123
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +34 -10
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +7 -7
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +96 -50
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +69 -53
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +91 -4
- package/dist/document-models/invoice/src/tests/general.test.js +24 -26
- package/dist/document-models/invoice/src/tests/items.test.js +37 -17
- package/dist/document-models/invoice/src/tests/parties.test.js +32 -26
- package/dist/document-models/invoice/src/tests/transitions.test.js +52 -500
- package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -1
- package/dist/document-models/invoice/utils/statusTransitions.js +10 -10
- package/dist/editors/billing-statement/components/lineItemsTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/lineItemsTable.js +32 -23
- package/dist/editors/billing-statement/components/objectSetTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/objectSetTable.js +1 -2
- package/dist/editors/billing-statement/editor.d.ts +4 -0
- package/dist/editors/billing-statement/editor.d.ts.map +1 -1
- package/dist/editors/billing-statement/editor.js +34 -16
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +36 -37
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +28 -10
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.js +18 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveContents.js +10 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts +7 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.js +16 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/EmptyState.js +10 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Files.js +12 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/FolderTree.js +65 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Folders.js +12 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/clean-new-editor/config.d.ts +4 -0
- package/dist/editors/clean-new-editor/config.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/config.js +5 -0
- package/dist/editors/clean-new-editor/editor.d.ts +4 -0
- package/dist/editors/clean-new-editor/editor.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/editor.js +11 -0
- package/dist/editors/clean-new-editor/module.d.ts +3 -0
- package/dist/editors/clean-new-editor/module.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/module.js +10 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts +14 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.js +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/CreateDocument.js +18 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts +3 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/DriveContents.js +10 -0
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +3 -3
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -180
- package/dist/editors/contributor-billing/components/EmptyState.d.ts +3 -0
- package/dist/editors/contributor-billing/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/EmptyState.js +10 -0
- package/dist/editors/contributor-billing/components/Files.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Files.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Files.js +12 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts +6 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/FolderTree.js +65 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Folders.js +12 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts +38 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/HeaderControls.js +124 -0
- package/dist/editors/contributor-billing/components/HeaderStats.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.js → HeaderStats.js} +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts +22 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.js +399 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts +6 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.js +111 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts +32 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.js +55 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts +13 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.js +16 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/contributor-billing/config.d.ts +1 -0
- package/dist/editors/contributor-billing/config.d.ts.map +1 -1
- package/dist/editors/contributor-billing/config.js +4 -1
- package/dist/editors/contributor-billing/editor.d.ts +1 -0
- package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
- package/dist/editors/contributor-billing/editor.js +4 -1
- package/dist/editors/contributor-billing/module.d.ts +1 -1
- package/dist/editors/contributor-billing/module.d.ts.map +1 -1
- package/dist/editors/contributor-billing/module.js +3 -2
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts +15 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts.map +1 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.js +122 -0
- package/dist/editors/editors.js +2 -2
- package/dist/editors/expense-report/components/AddBillingStatementModal.d.ts.map +1 -1
- package/dist/editors/expense-report/editor.js +8 -8
- package/dist/editors/index.d.ts +2 -2
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/editors/integrations/components/EditName.d.ts +3 -0
- package/dist/editors/integrations/components/EditName.d.ts.map +1 -0
- package/dist/editors/integrations/components/EditName.js +31 -0
- package/dist/editors/integrations/editor.d.ts +2 -4
- package/dist/editors/integrations/editor.d.ts.map +1 -1
- package/dist/editors/integrations/editor.js +5 -132
- package/dist/editors/integrations/module.d.ts +1 -0
- package/dist/editors/integrations/module.d.ts.map +1 -1
- package/dist/editors/integrations/module.js +3 -2
- package/dist/editors/invoice/components/confirmationModal.js +1 -1
- package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/countryForm.js +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts.map +1 -1
- package/dist/editors/invoice/components/datePicker.js +1 -1
- package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
- package/dist/editors/invoice/components/inputField.js +3 -2
- package/dist/editors/invoice/components/lineItemMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/components/lineItemMobileModal.js +1 -1
- package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +7 -7
- package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -1
- package/dist/editors/invoice/components/statusModalComponents.js +27 -3
- package/dist/editors/invoice/editor.d.ts +1 -4
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +102 -40
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/exportUBL.js +35 -18
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +15 -9
- package/dist/editors/invoice/invoiceToGnosis.js +2 -2
- package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/bankSection.js +19 -10
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts +4 -0
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.js +66 -2
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +3 -3
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.js +4 -3
- package/dist/editors/invoice/lineItems.d.ts.map +1 -1
- package/dist/editors/invoice/module.d.ts +1 -0
- package/dist/editors/invoice/module.d.ts.map +1 -1
- package/dist/editors/invoice/module.js +2 -1
- package/dist/editors/invoice/requestFinance.js +3 -3
- package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -1
- package/dist/editors/invoice/uploadPdfChunked.js +5 -4
- package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
- package/dist/editors/invoice/utils/utils.js +5 -4
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +11 -5
- package/dist/editors/invoice/validation/validationManager.d.ts +2 -2
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +5 -5
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationRules.js +178 -178
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts +7 -0
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/DriveExplorer.js +184 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts +2 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.js +73 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.js +1 -1
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/RowActionMenu.d.ts +1 -1
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
- package/dist/old-contributor-billing/config.d.ts +3 -0
- package/dist/old-contributor-billing/config.d.ts.map +1 -0
- package/dist/old-contributor-billing/config.js +4 -0
- package/dist/old-contributor-billing/editor.d.ts +3 -0
- package/dist/old-contributor-billing/editor.d.ts.map +1 -0
- package/dist/old-contributor-billing/editor.js +8 -0
- package/dist/old-contributor-billing/module.d.ts +3 -0
- package/dist/old-contributor-billing/module.d.ts.map +1 -0
- package/dist/old-contributor-billing/module.js +9 -0
- package/dist/old-contributor-billing/util.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/util.js +11 -9
- package/dist/powerhouse.manifest.json +6 -41
- package/dist/processors/index.d.ts +1 -6
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -18
- package/dist/scripts/contributor-billing/createExpenseReportCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createExpenseReportCsv.js +24 -24
- package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createXeroCsv.js +52 -46
- package/dist/scripts/invoice/autoTagging.d.ts +1 -1
- package/dist/scripts/invoice/autoTagging.d.ts.map +1 -1
- package/dist/scripts/invoice/autoTagging.js +168 -138
- package/dist/scripts/invoice/exampleBatchTxn.js +16 -16
- package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
- package/dist/scripts/invoice/gnosisTransactionBuilder.js +32 -25
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
- package/dist/scripts/invoice/pdfToClaudeAI.js +36 -30
- package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
- package/dist/scripts/invoice/requestFinance.js +13 -13
- package/dist/style.css +407 -13659
- package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
- package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/resolvers.js +16 -5
- package/dist/subgraphs/billing-statement/schema.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/schema.js +12 -67
- package/dist/subgraphs/expense-report/resolvers.d.ts +1 -1
- package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/resolvers.js +4 -5
- package/dist/subgraphs/expense-report/schema.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/schema.js +5 -48
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
- package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/integrations/resolvers.js +4 -5
- package/dist/subgraphs/integrations/schema.d.ts.map +1 -1
- package/dist/subgraphs/integrations/schema.js +3 -43
- package/dist/subgraphs/invoice/index.d.ts.map +1 -1
- package/dist/subgraphs/invoice/index.js +1 -20
- package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +4 -9
- package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
- package/dist/subgraphs/invoice/schema.js +14 -232
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.d.ts +1 -1
- package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -0
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.js +38 -34
- package/dist/subgraphs/invoice-addon/index.d.ts +11 -0
- package/dist/subgraphs/invoice-addon/index.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/index.js +11 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/resolvers.js +12 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/schema.js +52 -0
- package/package.json +9 -20
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts +0 -8
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/actions.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +0 -4
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.js +0 -3
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts +0 -2
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/error.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts +0 -7
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.js +0 -3
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts +0 -6
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts.map +0 -1
- package/dist/document-models/expense-report/src/tests/expense-report.test.js +0 -24
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +0 -2
- package/dist/editors/contributor-billing/util.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.d.ts +0 -4
- package/dist/editors/hooks/useBillingStatementDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.js +0 -8
- package/dist/editors/hooks/useExpenseReportDocument.d.ts +0 -4
- package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useExpenseReportDocument.js +0 -8
- package/dist/editors/hooks/useIntegrationsDocument.d.ts +0 -4
- package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useIntegrationsDocument.js +0 -8
- package/dist/editors/hooks/useInvoiceDocument.d.ts +0 -4
- package/dist/editors/hooks/useInvoiceDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useInvoiceDocument.js +0 -8
- package/dist/editors/integrations/config.d.ts +0 -3
- package/dist/editors/integrations/config.d.ts.map +0 -1
- package/dist/editors/integrations/config.js +0 -3
- package/dist/processors/line-item-processor/index.d.ts +0 -11
- package/dist/processors/line-item-processor/index.d.ts.map +0 -1
- package/dist/processors/line-item-processor/index.js +0 -36
- package/dist/subgraphs/invoice/customResolvers.d.ts.map +0 -1
- package/editors/invoice/assets/custom.d.ts +0 -4
- package/editors/invoice/assets/powerhouseLogo.png +0 -0
- /package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.d.ts → HeaderStats.d.ts} +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/util.d.ts +0 -0
|
@@ -1,11 +1,71 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, {} from "react";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
4
|
import { LegalEntityWalletSection } from "./walletSection.js";
|
|
5
5
|
import { LegalEntityBankSection } from "./bankSection.js";
|
|
6
6
|
import { CountryForm } from "../components/countryForm.js";
|
|
7
7
|
import { InputField } from "../components/inputField.js";
|
|
8
|
+
import { Select } from "@powerhousedao/document-engineering";
|
|
8
9
|
const FieldLabel = ({ children }) => (_jsx("label", { className: "block text-sm font-medium text-gray-700", children: children }));
|
|
10
|
+
export const STATE_PROVINCE_OPTIONS = [
|
|
11
|
+
{ label: "Alabama", value: "AL" },
|
|
12
|
+
{ label: "Alaska", value: "AK" },
|
|
13
|
+
{ label: "Arizona", value: "AZ" },
|
|
14
|
+
{ label: "Arkansas", value: "AR" },
|
|
15
|
+
{ label: "American Samoa", value: "AS" },
|
|
16
|
+
{ label: "California", value: "CA" },
|
|
17
|
+
{ label: "Colorado", value: "CO" },
|
|
18
|
+
{ label: "Connecticut", value: "CT" },
|
|
19
|
+
{ label: "Delaware", value: "DE" },
|
|
20
|
+
{ label: "District of Columbia", value: "DC" },
|
|
21
|
+
{ label: "Florida", value: "FL" },
|
|
22
|
+
{ label: "Georgia", value: "GA" },
|
|
23
|
+
{ label: "Guam", value: "GU" },
|
|
24
|
+
{ label: "Hawaii", value: "HI" },
|
|
25
|
+
{ label: "Idaho", value: "ID" },
|
|
26
|
+
{ label: "Illinois", value: "IL" },
|
|
27
|
+
{ label: "Indiana", value: "IN" },
|
|
28
|
+
{ label: "Iowa", value: "IA" },
|
|
29
|
+
{ label: "Kansas", value: "KS" },
|
|
30
|
+
{ label: "Kentucky", value: "KY" },
|
|
31
|
+
{ label: "Louisiana", value: "LA" },
|
|
32
|
+
{ label: "Maine", value: "ME" },
|
|
33
|
+
{ label: "Maryland", value: "MD" },
|
|
34
|
+
{ label: "Massachusetts", value: "MA" },
|
|
35
|
+
{ label: "Michigan", value: "MI" },
|
|
36
|
+
{ label: "Minnesota", value: "MN" },
|
|
37
|
+
{ label: "Mississippi", value: "MS" },
|
|
38
|
+
{ label: "Missouri", value: "MO" },
|
|
39
|
+
{ label: "Montana", value: "MT" },
|
|
40
|
+
{ label: "Nebraska", value: "NE" },
|
|
41
|
+
{ label: "Nevada", value: "NV" },
|
|
42
|
+
{ label: "New Hampshire", value: "NH" },
|
|
43
|
+
{ label: "New Jersey", value: "NJ" },
|
|
44
|
+
{ label: "New Mexico", value: "NM" },
|
|
45
|
+
{ label: "New York", value: "NY" },
|
|
46
|
+
{ label: "North Carolina", value: "NC" },
|
|
47
|
+
{ label: "North Dakota", value: "ND" },
|
|
48
|
+
{ label: "Northern Mariana Islands", value: "MP" },
|
|
49
|
+
{ label: "Ohio", value: "OH" },
|
|
50
|
+
{ label: "Oklahoma", value: "OK" },
|
|
51
|
+
{ label: "Oregon", value: "OR" },
|
|
52
|
+
{ label: "Pennsylvania", value: "PA" },
|
|
53
|
+
{ label: "Puerto Rico", value: "PR" },
|
|
54
|
+
{ label: "Rhode Island", value: "RI" },
|
|
55
|
+
{ label: "South Carolina", value: "SC" },
|
|
56
|
+
{ label: "South Dakota", value: "SD" },
|
|
57
|
+
{ label: "Tennessee", value: "TN" },
|
|
58
|
+
{ label: "Texas", value: "TX" },
|
|
59
|
+
{ label: "Trust Territories", value: "TT" },
|
|
60
|
+
{ label: "Utah", value: "UT" },
|
|
61
|
+
{ label: "Vermont", value: "VT" },
|
|
62
|
+
{ label: "Virgin Islands", value: "VI" },
|
|
63
|
+
{ label: "Virginia", value: "VA" },
|
|
64
|
+
{ label: "Washington", value: "WA" },
|
|
65
|
+
{ label: "West Virginia", value: "WV" },
|
|
66
|
+
{ label: "Wisconsin", value: "WI" },
|
|
67
|
+
{ label: "Wyoming", value: "WY" },
|
|
68
|
+
];
|
|
9
69
|
export const LegalEntityMainSection = (props) => {
|
|
10
70
|
const { value, onChange, disabled, mainCountryValidation, bankCountryValidation, streetaddressvalidation, cityvalidation, postalcodevalidation, payeremailvalidation, ...divProps } = props;
|
|
11
71
|
const handleInputChange = (field) => (e) => {
|
|
@@ -24,7 +84,11 @@ export const LegalEntityMainSection = (props) => {
|
|
|
24
84
|
onChange({ [field]: e.target.value });
|
|
25
85
|
}
|
|
26
86
|
};
|
|
27
|
-
return (_jsxs("div", { ...divProps, className: twMerge("rounded-lg border border-gray-200 bg-white p-6 mb-2", props.className), children: [_jsx("h3", { className: "mb-4 text-lg font-semibold text-gray-900", children: "Basic Information" }), _jsxs("div", { className: "space-y-6", children: [_jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.name ?? "", label: "Name", placeholder: "Legal Entity Name", onBlur: handleTextareaBlur("name"), handleInputChange: handleTextareaChange("name"), className: "h-10 w-full text-md mb-2" }) }), _jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.id ?? "", label: "Tax ID / Corp. Reg", placeholder: "332...", onBlur: handleTextareaBlur("id"), handleInputChange: handleTextareaChange("id"), className: "h-10 w-full text-md mb-2" }) }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx(InputField, { value: value.streetAddress ?? "", label: "Address", placeholder: "Street Address", onBlur: handleTextareaBlur("streetAddress"), handleInputChange: handleTextareaChange("streetAddress"), className: "h-10 w-full text-md mb-2", validation: streetaddressvalidation }), _jsx(InputField, { value: value.extendedAddress ?? "", placeholder: "Extended Address", onBlur: handleTextareaBlur("extendedAddress"), handleInputChange: handleTextareaChange("extendedAddress"), className: "h-10 w-full text-md mb-2" })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.city ?? "", label: "City", placeholder: "City", onBlur: handleTextareaBlur("city"), handleInputChange: handleTextareaChange("city"), className: "h-10 w-full text-md mb-2", validation: cityvalidation }) }), _jsx("div", { className: "space-y-2", children:
|
|
87
|
+
return (_jsxs("div", { ...divProps, className: twMerge("rounded-lg border border-gray-200 bg-white p-6 mb-2", props.className), children: [_jsx("h3", { className: "mb-4 text-lg font-semibold text-gray-900", children: "Basic Information" }), _jsxs("div", { className: "space-y-6", children: [_jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.name ?? "", label: "Name", placeholder: "Legal Entity Name", onBlur: handleTextareaBlur("name"), handleInputChange: handleTextareaChange("name"), className: "h-10 w-full text-md mb-2" }) }), _jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.id ?? "", label: "Tax ID / Corp. Reg", placeholder: "332...", onBlur: handleTextareaBlur("id"), handleInputChange: handleTextareaChange("id"), className: "h-10 w-full text-md mb-2" }) }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx(InputField, { value: value.streetAddress ?? "", label: "Address", placeholder: "Street Address", onBlur: handleTextareaBlur("streetAddress"), handleInputChange: handleTextareaChange("streetAddress"), className: "h-10 w-full text-md mb-2", validation: streetaddressvalidation }), _jsx(InputField, { value: value.extendedAddress ?? "", placeholder: "Extended Address", onBlur: handleTextareaBlur("extendedAddress"), handleInputChange: handleTextareaChange("extendedAddress"), className: "h-10 w-full text-md mb-2" })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.city ?? "", label: "City", placeholder: "City", onBlur: handleTextareaBlur("city"), handleInputChange: handleTextareaChange("city"), className: "h-10 w-full text-md mb-2", validation: cityvalidation }) }), _jsx("div", { className: "space-y-2", children: value.country === "US" ? (_jsxs(_Fragment, { children: [_jsx("label", { className: "mb-2 block text-sm font-medium text-gray-700", children: "State/Province" }), _jsx(Select, { options: STATE_PROVINCE_OPTIONS, value: value.stateProvince ?? "", onChange: (value) => {
|
|
88
|
+
handleBlur("stateProvince")({
|
|
89
|
+
target: { value: value },
|
|
90
|
+
});
|
|
91
|
+
}, className: "h-10 w-full text-md mb-2", searchable: true })] })) : (_jsx(InputField, { value: value.stateProvince ?? "", label: "State/Province", placeholder: "State/Province", onBlur: handleTextareaBlur("stateProvince"), handleInputChange: handleTextareaChange("stateProvince"), className: "h-10 w-full text-md mb-2" })) })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.postalCode ?? "", label: "Postal Code", placeholder: "Postal Code", onBlur: handleTextareaBlur("postalCode"), handleInputChange: handleTextareaChange("postalCode"), className: "h-10 w-full text-md mb-2", validation: postalcodevalidation }) }), _jsxs("div", { className: "space-y-2", children: [_jsx(FieldLabel, { children: "Country" }), _jsx(CountryForm, { country: value.country ?? "", handleInputChange: handleInputChange("country"), handleBlur: handleBlur("country"), className: "h-10 w-full text-md mb-2", validation: mainCountryValidation })] })] })] }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.email ?? "", label: "Email", placeholder: "Email", onBlur: handleTextareaBlur("email"), handleInputChange: handleTextareaChange("email"), className: "h-10 w-full text-md mb-2", validation: payeremailvalidation }) }), _jsx("div", { className: "space-y-2", children: _jsx(InputField, { value: value.tel ?? "", label: "Telephone", placeholder: "Telephone", onBlur: handleTextareaBlur("tel"), handleInputChange: handleTextareaChange("tel"), className: "h-10 w-full text-md mb-2" }) })] })] })] }));
|
|
28
92
|
};
|
|
29
93
|
// Helper to flatten LegalEntity to EditLegalEntityInput
|
|
30
94
|
function flattenLegalEntityToEditInput(legalEntity) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletSection.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/walletSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,OAAO,6BAA6B,
|
|
1
|
+
{"version":3,"file":"walletSection.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/legalEntity/walletSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,cAAc,CAAC,KAAK,CAAC,EACrB,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,QAAQ,CAAC,KAAK,EAAE,0BAA0B,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,OAAO,6BAA6B,4CAyGrC,CAAC"}
|
|
@@ -11,7 +11,7 @@ export const LegalEntityWalletSection = (props) => {
|
|
|
11
11
|
setLocalState(value);
|
|
12
12
|
}, [value]);
|
|
13
13
|
const handleInputChange = (field, event) => {
|
|
14
|
-
setLocalState(prev => ({
|
|
14
|
+
setLocalState((prev) => ({
|
|
15
15
|
...prev,
|
|
16
16
|
[field]: event.target.value,
|
|
17
17
|
}));
|
|
@@ -23,7 +23,7 @@ export const LegalEntityWalletSection = (props) => {
|
|
|
23
23
|
[field]: newValue,
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
const CHAIN_PRESETS = getAllChainConfigs().map(config => ({
|
|
26
|
+
const CHAIN_PRESETS = getAllChainConfigs().map((config) => ({
|
|
27
27
|
chainName: config.chainName,
|
|
28
28
|
chainId: config.chainId,
|
|
29
29
|
}));
|
|
@@ -38,7 +38,7 @@ export const LegalEntityWalletSection = (props) => {
|
|
|
38
38
|
const chainId = Array.isArray(value) ? value[0] : value;
|
|
39
39
|
const preset = CHAIN_PRESETS.find((p) => p.chainId === chainId);
|
|
40
40
|
if (preset) {
|
|
41
|
-
setLocalState(prev => ({
|
|
41
|
+
setLocalState((prev) => ({
|
|
42
42
|
...prev,
|
|
43
43
|
chainId: preset.chainId,
|
|
44
44
|
chainName: preset.chainName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineItemTags.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/lineItemTags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,OAAO,CAAC;AAKhD,OAAO,
|
|
1
|
+
{"version":3,"file":"lineItemTags.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/lineItemTags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,OAAO,CAAC;AAKhD,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,2CAA2C,CAAC;AAKnD,UAAU,gBAAgB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,UAAU,sBAAsB;IAC9B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxB,eAAe,EAAE,UAAU,EAAE,CAAC;CAC/B;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,OAAO,EACP,QAAQ,EACR,eAAe,GAChB,EAAE,sBAAsB,2CAkQxB"}
|
|
@@ -4,7 +4,7 @@ import { X, Tag } from "lucide-react";
|
|
|
4
4
|
import { PowerhouseButton as Button } from "@powerhousedao/design-system/powerhouse/components/index";
|
|
5
5
|
import { Select, DatePicker } from "@powerhousedao/document-engineering/ui";
|
|
6
6
|
import { expenseAccountOptions, paymentAccountOptions } from "./tagMapping.js";
|
|
7
|
-
import { actions } from "../../../document-models/invoice/index.js";
|
|
7
|
+
import { actions, } from "../../../document-models/invoice/index.js";
|
|
8
8
|
import { InputField } from "../components/inputField.js";
|
|
9
9
|
import { TagCard } from "./tagCard.js";
|
|
10
10
|
import { TagMobileModal } from "./tagMobileModal.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tagMobileModal.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/tagMobileModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tagMobileModal.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/lineItemTags/tagMobileModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI3D,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,2CAA2C,CAAC;AAEnD,KAAK,gBAAgB,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;CACzB,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,EAAE,mBAAmB,2CAsLrB"}
|
|
@@ -3,8 +3,8 @@ import { X } from "lucide-react";
|
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
4
|
import { InputField } from "../components/inputField.js";
|
|
5
5
|
import { Select, DatePicker } from "@powerhousedao/document-engineering/ui";
|
|
6
|
-
import { expenseAccountOptions, paymentAccountOptions
|
|
7
|
-
import { actions } from "../../../document-models/invoice/index.js";
|
|
6
|
+
import { expenseAccountOptions, paymentAccountOptions } from "./tagMapping.js";
|
|
7
|
+
import { actions, } from "../../../document-models/invoice/index.js";
|
|
8
8
|
export function TagMobileModal({ item, onClose, dispatch, }) {
|
|
9
9
|
const [description, setDescription] = useState(item.item);
|
|
10
10
|
// Get current tag values
|
|
@@ -66,6 +66,7 @@ export function TagMobileModal({ item, onClose, dispatch, }) {
|
|
|
66
66
|
setPeriodStoredValue(newValue);
|
|
67
67
|
}, className: "bg-white" })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Xero Expense Account" }), _jsx(Select, { options: expenseAccountOptions, value: expenseValue, placeholder: "Select Expense Account", searchable: true, onChange: (value) => {
|
|
68
68
|
setExpenseValue(value);
|
|
69
|
-
setExpenseLabel(expenseAccountOptions.find((option) => option.value === value)
|
|
69
|
+
setExpenseLabel(expenseAccountOptions.find((option) => option.value === value)
|
|
70
|
+
?.label || "");
|
|
70
71
|
} })] }), _jsx("div", { className: "bg-gray-50 rounded-lg p-4", children: _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { className: "text-sm text-gray-600", children: "Total:" }), _jsx("span", { className: "text-lg font-bold text-gray-900", children: item.total })] }) })] }), _jsxs("div", { className: "border-t border-gray-200 p-4 bg-white flex gap-3", children: [_jsx("button", { onClick: onClose, className: "flex-1 px-4 py-3 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors font-medium text-gray-700", children: "Cancel" }), _jsx("button", { onClick: handleSave, className: "flex-1 px-4 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors font-medium", children: "Save Tags" })] })] }));
|
|
71
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineItems.d.ts","sourceRoot":"","sources":["../../../editors/invoice/lineItems.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,OAAO,CAAC;AAef,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,KAAK,QAAQ,GAAG;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAobF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAC7B,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GAAG,IAAI,KACL,IAAI,CAAC;IACV,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;CACxC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,eAAe,GAChB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"lineItems.d.ts","sourceRoot":"","sources":["../../../editors/invoice/lineItems.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,OAAO,CAAC;AAef,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,KAAK,QAAQ,GAAG;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAobF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAC7B,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,GAAG,IAAI,KACL,IAAI,CAAC;IACV,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;CACxC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,eAAe,GAChB,EAAE,mBAAmB,2CA6arB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/invoice/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,eAAO,MAAM,OAAO,EAAE,YAOrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../editors/invoice/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,6DAA6D;AAC7D,eAAO,MAAM,OAAO,EAAE,YAOrB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { lazy } from "react";
|
|
2
|
+
/** Document editor module for the Todo List document type */
|
|
2
3
|
export const Invoice = {
|
|
3
4
|
Component: lazy(() => import("./editor.js")),
|
|
4
5
|
documentTypes: ["powerhouse/invoice"],
|
|
5
6
|
config: {
|
|
6
7
|
id: "powerhouse-invoice-editor",
|
|
7
|
-
name: "
|
|
8
|
+
name: "invoice",
|
|
8
9
|
},
|
|
9
10
|
};
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import { actions } from "../../document-models/invoice/index.js";
|
|
4
4
|
import { generateId } from "document-model";
|
|
5
|
-
let GRAPHQL_URL = "http://localhost:4001/graphql
|
|
5
|
+
let GRAPHQL_URL = "http://localhost:4001/graphql";
|
|
6
6
|
if (!window.document.baseURI.includes("localhost")) {
|
|
7
|
-
GRAPHQL_URL = "https://
|
|
7
|
+
GRAPHQL_URL = "https://switchboard-dev.powerhouse.xyz/graphql";
|
|
8
8
|
}
|
|
9
9
|
const RequestFinance = ({ docState, dispatch, }) => {
|
|
10
10
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -62,7 +62,7 @@ const RequestFinance = ({ docState, dispatch, }) => {
|
|
|
62
62
|
setError(null);
|
|
63
63
|
setInvoiceLink(null);
|
|
64
64
|
setDirectPaymentStatus(null);
|
|
65
|
-
|
|
65
|
+
const bankDetails = {
|
|
66
66
|
currency: docState.currency,
|
|
67
67
|
accountNumber: docState.issuer.paymentRouting.bank.accountNum,
|
|
68
68
|
country: docState.issuer.paymentRouting.bank.address.country.toUpperCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadPdfChunked.d.ts","sourceRoot":"","sources":["../../../editors/invoice/uploadPdfChunked.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAoB,EAC9B,SAAS,GAAE,MAAmB,EAAE,eAAe;AAC/C,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"uploadPdfChunked.d.ts","sourceRoot":"","sources":["../../../editors/invoice/uploadPdfChunked.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAoB,EAC9B,SAAS,GAAE,MAAmB,EAAE,eAAe;AAC/C,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GACtC,OAAO,CAAC,GAAG,CAAC,CAgFd"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* @param chunkSize Size of each chunk in bytes (default: 500KB)
|
|
6
6
|
* @param onProgress Callback for upload progress
|
|
7
7
|
*/
|
|
8
|
-
let GRAPHQL_URL =
|
|
9
|
-
if (!window.document.baseURI.includes(
|
|
10
|
-
GRAPHQL_URL = "https://
|
|
8
|
+
let GRAPHQL_URL = "http://localhost:4001/graphql";
|
|
9
|
+
if (!window.document.baseURI.includes("localhost")) {
|
|
10
|
+
GRAPHQL_URL = "https://switchboard-dev.powerhouse.xyz/graphql";
|
|
11
11
|
}
|
|
12
12
|
export async function uploadPdfChunked(pdfData, endpoint = GRAPHQL_URL, chunkSize = 500 * 1024, // 500KB chunks
|
|
13
13
|
onProgress) {
|
|
@@ -66,7 +66,8 @@ onProgress) {
|
|
|
66
66
|
onProgress(((i + 1) / totalChunks) * 100);
|
|
67
67
|
}
|
|
68
68
|
// If this is the last chunk and it was successful, return the final result
|
|
69
|
-
if (i === totalChunks - 1 &&
|
|
69
|
+
if (i === totalChunks - 1 &&
|
|
70
|
+
result.data?.Invoice_uploadInvoicePdfChunk?.success) {
|
|
70
71
|
return result.data.Invoice_uploadInvoicePdfChunk;
|
|
71
72
|
}
|
|
72
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/utils/utils.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,GAAG,SAAS,GAAG,IAAI,KACrC,MA8DF,CAAC;AAGF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAgBrD,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,WAAoC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/utils/utils.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,sBAAsB,GACjC,aAAa,MAAM,GAAG,SAAS,GAAG,IAAI,KACrC,MA8DF,CAAC;AAGF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAGD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAgBrD,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,WAAoC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACnC,WAAW,CA+Bb;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,WAAW,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAK3E"}
|
|
@@ -57,17 +57,17 @@ export const CHAIN_CONFIGS = {
|
|
|
57
57
|
base: {
|
|
58
58
|
chainName: "Base",
|
|
59
59
|
chainId: "8453",
|
|
60
|
-
rpc: "https://base.llamarpc.com"
|
|
60
|
+
rpc: "https://base.llamarpc.com",
|
|
61
61
|
},
|
|
62
62
|
ethereum: {
|
|
63
63
|
chainName: "Ethereum",
|
|
64
64
|
chainId: "1",
|
|
65
|
-
rpc: "https://eth.llamarpc.com"
|
|
65
|
+
rpc: "https://eth.llamarpc.com",
|
|
66
66
|
},
|
|
67
67
|
"arbitrum one": {
|
|
68
68
|
chainName: "Arbitrum One",
|
|
69
69
|
chainId: "42161",
|
|
70
|
-
rpc: "https://arb1.arbitrum.io/rpc"
|
|
70
|
+
rpc: "https://arb1.arbitrum.io/rpc",
|
|
71
71
|
},
|
|
72
72
|
};
|
|
73
73
|
// Default chain configuration (Ethereum)
|
|
@@ -116,5 +116,6 @@ export function getAllChainConfigs() {
|
|
|
116
116
|
* @returns ChainConfig if found, null otherwise
|
|
117
117
|
*/
|
|
118
118
|
export function getChainConfigByChainId(chainId) {
|
|
119
|
-
return Object.values(CHAIN_CONFIGS).find(config => config.chainId === chainId) ||
|
|
119
|
+
return (Object.values(CHAIN_CONFIGS).find((config) => config.chainId === chainId) ||
|
|
120
|
+
null);
|
|
120
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validationHandler.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"validationHandler.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,wBAAwB,CAAC;AAIhC,QAAA,MAAM,4BAA4B,GAChC,WAAW,MAAM,EACjB,OAAO,GAAG,EACV,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC5D,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC3D,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC7D,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAChE,0BAA0B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAChE,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EACzD,kBAAkB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EACxD,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAClE,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC7D,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAClE,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EACzD,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC/D,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC/D,uBAAuB,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAC7D,4BAA4B,CAAC,UAAU,EAAE,gBAAgB,KAAK,IAAI,EAClE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,wBAkO9C,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { validateField } from "./validationManager.js";
|
|
1
|
+
import { validateField, } from "./validationManager.js";
|
|
2
2
|
import { toast } from "@powerhousedao/design-system/connect";
|
|
3
3
|
import { isValidIBAN } from "./validationRules.js";
|
|
4
4
|
const validateStatusBeforeContinue = (newStatus, state, setInvoiceValidation, setWalletValidation, setCurrencyValidation, setMainCountryValidation, setBankCountryValidation, setIbanValidation, setBicValidation, setAccountNumberValidation, setBankNameValidation, setStreetAddressValidation, setCityValidation, setPostalCodeValidation, setPayerEmailValidation, setLineItemValidation, setRoutingNumberValidation, isFiatCurrency) => {
|
|
@@ -65,17 +65,23 @@ const validateStatusBeforeContinue = (newStatus, state, setInvoiceValidation, se
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
// Validate BIC/SWIFT number
|
|
68
|
-
const bicValidation = validateField("bicNumber", state.issuer.paymentRouting?.bank?.BIC ||
|
|
68
|
+
const bicValidation = validateField("bicNumber", state.issuer.paymentRouting?.bank?.BIC ||
|
|
69
|
+
state.issuer.paymentRouting?.bank?.SWIFT, context);
|
|
69
70
|
setBicValidation(bicValidation);
|
|
70
71
|
if (bicValidation && !bicValidation.isValid) {
|
|
71
72
|
validationErrors.push(bicValidation);
|
|
72
73
|
}
|
|
73
74
|
// Validate routing number
|
|
74
75
|
const routingNumberValidation = validateField("routingNumber", state.issuer.paymentRouting?.bank?.ABA, context);
|
|
75
|
-
const usdIbanPayment = isValidIBAN(state.issuer.paymentRouting?.bank?.accountNum ?? "") &&
|
|
76
|
+
const usdIbanPayment = isValidIBAN(state.issuer.paymentRouting?.bank?.accountNum ?? "") &&
|
|
77
|
+
state.currency === "USD";
|
|
76
78
|
setRoutingNumberValidation(usdIbanPayment ? null : routingNumberValidation);
|
|
77
|
-
if (usdIbanPayment
|
|
78
|
-
|
|
79
|
+
if (usdIbanPayment
|
|
80
|
+
? null
|
|
81
|
+
: routingNumberValidation && !routingNumberValidation.isValid) {
|
|
82
|
+
validationErrors.push(usdIbanPayment
|
|
83
|
+
? { isValid: true, message: "", severity: "none" }
|
|
84
|
+
: routingNumberValidation);
|
|
79
85
|
}
|
|
80
86
|
// Validate bank name
|
|
81
87
|
const bankNameValidation = validateField("bankName", state.issuer.paymentRouting?.bank?.name, context);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Status } from "../../../document-models/invoice/index.js";
|
|
2
|
-
export type ValidationSeverity =
|
|
2
|
+
export type ValidationSeverity = "error" | "warning" | "none";
|
|
3
3
|
export type ValidationResult = {
|
|
4
4
|
isValid: boolean;
|
|
5
5
|
message: string;
|
|
@@ -9,7 +9,7 @@ export type ValidationRule = {
|
|
|
9
9
|
field: string;
|
|
10
10
|
validate: (value: any, context?: any) => ValidationResult;
|
|
11
11
|
appliesTo: {
|
|
12
|
-
currencies: Array<string |
|
|
12
|
+
currencies: Array<string | "ALL">;
|
|
13
13
|
statusTransitions: {
|
|
14
14
|
from: Status[];
|
|
15
15
|
to: Status[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validationManager.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAoBxE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG;
|
|
1
|
+
{"version":3,"file":"validationManager.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAoBxE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;IAC1D,SAAS,EAAE;QACT,UAAU,EAAE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;QAClC,iBAAiB,EAAE;YACjB,IAAI,EAAE,MAAM,EAAE,CAAC;YACf,EAAE,EAAE,MAAM,EAAE,CAAC;SACd,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAsCF,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,GAAG,IAAI,CAqBzB;AAGD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,EAAE,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAalC;AAGD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAE5D;AAGD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAKxD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {} from "../../../document-models/invoice/index.js";
|
|
2
|
-
import { accountIbanRule, bicNumberRule, bankNameRule, currencyRule, ethereumAddressRule, invoiceNumberRule, issuerPostalCodeRule, issuerStreetAddressRule, issuerCityRule, payerEmailRule, lineItemRule, mainCountryRule, bankCountryRule, routingNumberRule, accountNumberRule } from "./validationRules.js";
|
|
2
|
+
import { accountIbanRule, bicNumberRule, bankNameRule, currencyRule, ethereumAddressRule, invoiceNumberRule, issuerPostalCodeRule, issuerStreetAddressRule, issuerCityRule, payerEmailRule, lineItemRule, mainCountryRule, bankCountryRule, routingNumberRule, accountNumberRule, } from "./validationRules.js";
|
|
3
3
|
// Validation rules registry
|
|
4
4
|
const validationRules = [];
|
|
5
5
|
// Register rules
|
|
@@ -21,14 +21,14 @@ validationRules.push(accountNumberRule);
|
|
|
21
21
|
// Helper to check if a rule applies to the current context
|
|
22
22
|
function ruleAppliesToContext(rule, context) {
|
|
23
23
|
const { currencies, statusTransitions } = rule.appliesTo;
|
|
24
|
-
const currencyMatches = currencies.includes(
|
|
24
|
+
const currencyMatches = currencies.includes("ALL") || currencies.includes(context.currency);
|
|
25
25
|
const statusMatches = statusTransitions.from.includes(context.currentStatus) &&
|
|
26
26
|
statusTransitions.to.includes(context.targetStatus);
|
|
27
27
|
return currencyMatches && statusMatches;
|
|
28
28
|
}
|
|
29
29
|
// Main validation function
|
|
30
30
|
export function validateField(field, value, context) {
|
|
31
|
-
const applicableRules = validationRules.filter(rule => rule.field === field && ruleAppliesToContext(rule, context));
|
|
31
|
+
const applicableRules = validationRules.filter((rule) => rule.field === field && ruleAppliesToContext(rule, context));
|
|
32
32
|
if (applicableRules.length === 0) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
@@ -46,7 +46,7 @@ export function validateField(field, value, context) {
|
|
|
46
46
|
// Validate all fields for a status transition
|
|
47
47
|
export function validateStatusTransition(fields, context) {
|
|
48
48
|
const results = {};
|
|
49
|
-
validationRules.forEach(rule => {
|
|
49
|
+
validationRules.forEach((rule) => {
|
|
50
50
|
if (ruleAppliesToContext(rule, context)) {
|
|
51
51
|
const result = rule.validate(fields[rule.field]);
|
|
52
52
|
if (!result.isValid) {
|
|
@@ -62,7 +62,7 @@ export function addValidationRule(rule) {
|
|
|
62
62
|
}
|
|
63
63
|
// Remove a validation rule
|
|
64
64
|
export function removeValidationRule(field) {
|
|
65
|
-
const index = validationRules.findIndex(rule => rule.field === field);
|
|
65
|
+
const index = validationRules.findIndex((rule) => rule.field === field);
|
|
66
66
|
if (index !== -1) {
|
|
67
67
|
validationRules.splice(index, 1);
|
|
68
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validationRules.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationRules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQ7D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"validationRules.d.ts","sourceRoot":"","sources":["../../../../editors/invoice/validation/validationRules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQ7D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAajD;AAQD,eAAO,MAAM,iBAAiB,EAAE,cAuB/B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,cA8BjC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAuB7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cA+B7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAgC/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,cAiC3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAuBrC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAuB5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAuBlC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cA8B5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,cAuB1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,cAqC/B,CAAC"}
|