@powerhousedao/contributor-billing 0.1.22 → 0.1.24
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/dist/document-models/billing-statement/actions.d.ts +18 -0
- package/dist/document-models/billing-statement/actions.d.ts.map +1 -0
- package/dist/document-models/billing-statement/actions.js +9 -0
- package/dist/document-models/billing-statement/gen/creators.d.ts +3 -0
- package/dist/document-models/billing-statement/gen/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/creators.js +3 -0
- package/dist/document-models/billing-statement/gen/document-model.d.ts +2 -2
- package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-schema.d.ts +294 -0
- package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/billing-statement/gen/document-schema.js +33 -0
- package/dist/document-models/billing-statement/gen/document-type.d.ts +2 -0
- package/dist/document-models/billing-statement/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/billing-statement/gen/document-type.js +1 -0
- package/dist/document-models/billing-statement/gen/general/actions.js +1 -1
- package/dist/document-models/billing-statement/gen/general/creators.d.ts +2 -2
- package/dist/document-models/billing-statement/gen/general/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/general/creators.js +5 -5
- package/dist/document-models/billing-statement/gen/general/operations.js +3 -1
- package/dist/document-models/billing-statement/gen/index.d.ts +9 -3
- package/dist/document-models/billing-statement/gen/index.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/index.js +9 -2
- package/dist/document-models/billing-statement/gen/line-items/actions.js +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +2 -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 +4 -4
- package/dist/document-models/billing-statement/gen/line-items/operations.js +3 -1
- package/dist/document-models/billing-statement/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/billing-statement/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/ph-factories.js +1 -4
- package/dist/document-models/billing-statement/gen/reducer.d.ts +1 -3
- package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/reducer.js +18 -21
- package/dist/document-models/billing-statement/gen/schema/index.d.ts +1 -1
- package/dist/document-models/billing-statement/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/index.js +1 -1
- package/dist/document-models/billing-statement/gen/tags/actions.js +1 -1
- package/dist/document-models/billing-statement/gen/tags/creators.d.ts +2 -2
- package/dist/document-models/billing-statement/gen/tags/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/tags/creators.js +3 -3
- package/dist/document-models/billing-statement/gen/tags/operations.js +3 -1
- package/dist/document-models/billing-statement/gen/types.d.ts +9 -7
- package/dist/document-models/billing-statement/gen/types.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/types.js +1 -1
- package/dist/document-models/billing-statement/gen/utils.d.ts +13 -20
- package/dist/document-models/billing-statement/gen/utils.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/utils.js +45 -36
- package/dist/document-models/billing-statement/hooks.d.ts +11 -0
- package/dist/document-models/billing-statement/hooks.d.ts.map +1 -0
- package/dist/document-models/billing-statement/hooks.js +26 -0
- package/dist/document-models/billing-statement/index.d.ts +5 -25
- package/dist/document-models/billing-statement/index.d.ts.map +1 -1
- package/dist/document-models/billing-statement/index.js +5 -17
- package/dist/document-models/billing-statement/module.d.ts +5 -0
- package/dist/document-models/billing-statement/module.d.ts.map +1 -0
- package/dist/document-models/billing-statement/module.js +10 -0
- package/dist/document-models/billing-statement/src/index.d.ts +2 -0
- package/dist/document-models/billing-statement/src/index.d.ts.map +1 -0
- package/dist/document-models/billing-statement/src/index.js +1 -0
- package/dist/document-models/billing-statement/src/reducers/general.d.ts +2 -7
- package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/general.js +2 -7
- package/dist/document-models/billing-statement/src/reducers/line-items.d.ts +2 -7
- 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 +1 -6
- package/dist/document-models/billing-statement/src/reducers/tags.d.ts +2 -7
- 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 -6
- package/dist/document-models/billing-statement/src/tests/document-model.test.js +3 -3
- package/dist/document-models/billing-statement/src/tests/general.test.js +3 -2
- package/dist/document-models/billing-statement/src/tests/line-items.test.js +2 -1
- package/dist/document-models/billing-statement/src/tests/tags.test.js +2 -1
- package/dist/document-models/billing-statement/utils.d.ts +14 -0
- package/dist/document-models/billing-statement/utils.d.ts.map +1 -0
- package/dist/document-models/billing-statement/utils.js +7 -0
- package/dist/document-models/document-models.d.ts +3 -0
- package/dist/document-models/document-models.d.ts.map +1 -0
- package/dist/document-models/document-models.js +10 -0
- package/dist/document-models/expense-report/actions.d.ts +27 -0
- package/dist/document-models/expense-report/actions.d.ts.map +1 -0
- package/dist/document-models/expense-report/actions.js +4 -0
- package/dist/document-models/expense-report/gen/creators.d.ts +1 -0
- package/dist/document-models/expense-report/gen/creators.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/creators.js +1 -0
- package/dist/document-models/expense-report/gen/document-model.d.ts +2 -2
- package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/document-schema.d.ts +199 -0
- package/dist/document-models/expense-report/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/expense-report/gen/document-schema.js +33 -0
- package/dist/document-models/expense-report/gen/document-type.d.ts +2 -0
- package/dist/document-models/expense-report/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/expense-report/gen/document-type.js +1 -0
- package/dist/document-models/expense-report/gen/expense-report/actions.js +1 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +2 -2
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.js +3 -3
- package/dist/document-models/expense-report/gen/expense-report/operations.js +3 -1
- package/dist/document-models/expense-report/gen/index.d.ts +7 -3
- package/dist/document-models/expense-report/gen/index.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/index.js +7 -2
- package/dist/document-models/expense-report/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/expense-report/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/ph-factories.js +1 -4
- package/dist/document-models/expense-report/gen/reducer.d.ts +1 -3
- package/dist/document-models/expense-report/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/reducer.js +34 -37
- package/dist/document-models/expense-report/gen/schema/index.d.ts +1 -1
- package/dist/document-models/expense-report/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/schema/index.js +1 -1
- package/dist/document-models/expense-report/gen/types.d.ts +9 -7
- package/dist/document-models/expense-report/gen/types.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/types.js +1 -1
- package/dist/document-models/expense-report/gen/utils.d.ts +13 -20
- package/dist/document-models/expense-report/gen/utils.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/utils.js +44 -35
- package/dist/document-models/expense-report/gen/wallet/actions.js +1 -1
- package/dist/document-models/expense-report/gen/wallet/creators.d.ts +2 -2
- package/dist/document-models/expense-report/gen/wallet/creators.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/wallet/creators.js +17 -17
- package/dist/document-models/expense-report/gen/wallet/operations.js +3 -1
- package/dist/document-models/expense-report/hooks.d.ts +11 -0
- package/dist/document-models/expense-report/hooks.d.ts.map +1 -0
- package/dist/document-models/expense-report/hooks.js +26 -0
- package/dist/document-models/expense-report/index.d.ts +5 -34
- package/dist/document-models/expense-report/index.d.ts.map +1 -1
- package/dist/document-models/expense-report/index.js +5 -17
- package/dist/document-models/expense-report/module.d.ts +5 -0
- package/dist/document-models/expense-report/module.d.ts.map +1 -0
- package/dist/document-models/expense-report/module.js +10 -0
- package/dist/document-models/expense-report/src/index.d.ts +2 -0
- package/dist/document-models/expense-report/src/index.d.ts.map +1 -0
- package/dist/document-models/expense-report/src/index.js +1 -0
- package/dist/document-models/expense-report/src/reducers/wallet.d.ts +2 -2
- package/dist/document-models/expense-report/src/reducers/wallet.d.ts.map +1 -1
- package/dist/document-models/expense-report/src/reducers/wallet.js +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.js +4 -4
- package/dist/document-models/expense-report/src/tests/expense-report.test.js +3 -3
- package/dist/document-models/expense-report/src/tests/wallet.test.js +3 -3
- package/dist/document-models/expense-report/utils.d.ts +14 -0
- package/dist/document-models/expense-report/utils.d.ts.map +1 -0
- package/dist/document-models/expense-report/utils.js +7 -0
- package/dist/document-models/index.d.ts +8 -4
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +8 -4
- package/dist/document-models/integrations/actions.d.ts +15 -0
- package/dist/document-models/integrations/actions.d.ts.map +1 -0
- package/dist/document-models/integrations/actions.js +4 -0
- package/dist/document-models/integrations/gen/creators.d.ts +1 -0
- package/dist/document-models/integrations/gen/creators.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/creators.js +1 -0
- package/dist/document-models/integrations/gen/document-model.d.ts +2 -2
- package/dist/document-models/integrations/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/document-schema.d.ts +180 -0
- package/dist/document-models/integrations/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/integrations/gen/document-schema.js +33 -0
- package/dist/document-models/integrations/gen/document-type.d.ts +2 -0
- package/dist/document-models/integrations/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/integrations/gen/document-type.js +1 -0
- package/dist/document-models/integrations/gen/index.d.ts +7 -3
- package/dist/document-models/integrations/gen/index.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/index.js +7 -2
- package/dist/document-models/integrations/gen/integrations/actions.js +1 -1
- package/dist/document-models/integrations/gen/integrations/creators.d.ts +2 -2
- package/dist/document-models/integrations/gen/integrations/creators.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/integrations/creators.js +5 -5
- package/dist/document-models/integrations/gen/integrations/operations.js +3 -1
- package/dist/document-models/integrations/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/integrations/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/ph-factories.js +4 -18
- package/dist/document-models/integrations/gen/reducer.d.ts +1 -3
- package/dist/document-models/integrations/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/reducer.js +10 -13
- package/dist/document-models/integrations/gen/schema/index.d.ts +1 -1
- package/dist/document-models/integrations/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/schema/index.js +1 -1
- package/dist/document-models/integrations/gen/types.d.ts +9 -7
- package/dist/document-models/integrations/gen/types.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/types.js +1 -1
- package/dist/document-models/integrations/gen/utils.d.ts +13 -20
- package/dist/document-models/integrations/gen/utils.d.ts.map +1 -1
- package/dist/document-models/integrations/gen/utils.js +47 -49
- package/dist/document-models/integrations/hooks.d.ts +11 -0
- package/dist/document-models/integrations/hooks.d.ts.map +1 -0
- package/dist/document-models/integrations/hooks.js +26 -0
- package/dist/document-models/integrations/index.d.ts +5 -22
- package/dist/document-models/integrations/index.d.ts.map +1 -1
- package/dist/document-models/integrations/index.js +5 -17
- package/dist/document-models/integrations/module.d.ts +5 -0
- package/dist/document-models/integrations/module.d.ts.map +1 -0
- package/dist/document-models/integrations/module.js +10 -0
- package/dist/document-models/integrations/src/index.d.ts +2 -0
- package/dist/document-models/integrations/src/index.d.ts.map +1 -0
- package/dist/document-models/integrations/src/index.js +1 -0
- package/dist/document-models/integrations/src/reducers/integrations.d.ts +2 -7
- package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.js +1 -6
- package/dist/document-models/integrations/src/tests/document-model.test.js +4 -4
- package/dist/document-models/integrations/src/tests/integrations.test.js +2 -1
- package/dist/document-models/integrations/utils.d.ts +14 -0
- package/dist/document-models/integrations/utils.d.ts.map +1 -0
- package/dist/document-models/integrations/utils.js +7 -0
- package/dist/document-models/invoice/actions.d.ts +40 -0
- package/dist/document-models/invoice/actions.d.ts.map +1 -0
- package/dist/document-models/invoice/actions.js +10 -0
- package/dist/document-models/invoice/gen/creators.d.ts +4 -0
- package/dist/document-models/invoice/gen/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/creators.js +4 -0
- package/dist/document-models/invoice/gen/document-model.d.ts +2 -2
- package/dist/document-models/invoice/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/document-schema.d.ts +465 -0
- package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/document-schema.js +33 -0
- package/dist/document-models/invoice/gen/document-type.d.ts +2 -0
- package/dist/document-models/invoice/gen/document-type.d.ts.map +1 -0
- package/dist/document-models/invoice/gen/document-type.js +1 -0
- package/dist/document-models/invoice/gen/general/actions.js +1 -1
- package/dist/document-models/invoice/gen/general/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/general/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/general/creators.js +7 -7
- package/dist/document-models/invoice/gen/general/operations.js +3 -1
- package/dist/document-models/invoice/gen/index.d.ts +10 -3
- package/dist/document-models/invoice/gen/index.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/index.js +10 -2
- package/dist/document-models/invoice/gen/items/actions.js +1 -1
- package/dist/document-models/invoice/gen/items/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/items/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/items/creators.js +7 -7
- package/dist/document-models/invoice/gen/items/operations.js +3 -1
- package/dist/document-models/invoice/gen/parties/actions.js +1 -1
- package/dist/document-models/invoice/gen/parties/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/parties/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/parties/creators.js +8 -8
- package/dist/document-models/invoice/gen/parties/operations.js +3 -1
- package/dist/document-models/invoice/gen/ph-factories.d.ts +6 -10
- package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.js +5 -5
- package/dist/document-models/invoice/gen/reducer.d.ts +1 -3
- package/dist/document-models/invoice/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/reducer.js +63 -66
- package/dist/document-models/invoice/gen/schema/index.d.ts +1 -1
- package/dist/document-models/invoice/gen/schema/index.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/index.js +1 -1
- package/dist/document-models/invoice/gen/schema/types.d.ts +1 -1
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/transitions/actions.js +1 -1
- package/dist/document-models/invoice/gen/transitions/creators.d.ts +2 -2
- package/dist/document-models/invoice/gen/transitions/creators.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/transitions/creators.js +14 -14
- package/dist/document-models/invoice/gen/transitions/operations.js +3 -1
- package/dist/document-models/invoice/gen/types.d.ts +9 -7
- package/dist/document-models/invoice/gen/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/types.js +1 -1
- package/dist/document-models/invoice/gen/utils.d.ts +13 -20
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +48 -36
- package/dist/document-models/invoice/hooks.d.ts +11 -0
- package/dist/document-models/invoice/hooks.d.ts.map +1 -0
- package/dist/document-models/invoice/hooks.js +26 -0
- package/dist/document-models/invoice/index.d.ts +5 -47
- package/dist/document-models/invoice/index.d.ts.map +1 -1
- package/dist/document-models/invoice/index.js +5 -17
- package/dist/document-models/invoice/module.d.ts +5 -0
- package/dist/document-models/invoice/module.d.ts.map +1 -0
- package/dist/document-models/invoice/module.js +10 -0
- package/dist/document-models/invoice/src/index.d.ts +2 -0
- package/dist/document-models/invoice/src/index.d.ts.map +1 -0
- package/dist/document-models/invoice/src/index.js +1 -0
- package/dist/document-models/invoice/src/reducers/general.d.ts +2 -7
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +1 -6
- package/dist/document-models/invoice/src/reducers/items.d.ts +2 -7
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +1 -6
- package/dist/document-models/invoice/src/reducers/parties.d.ts +2 -7
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +1 -6
- package/dist/document-models/invoice/src/reducers/transitions.d.ts +2 -2
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +1 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +3 -3
- package/dist/document-models/invoice/src/tests/general.test.js +4 -4
- package/dist/document-models/invoice/src/tests/items.test.js +5 -5
- package/dist/document-models/invoice/src/tests/parties.test.js +8 -8
- package/dist/document-models/invoice/src/tests/transitions.test.js +2 -1
- package/dist/document-models/invoice/utils.d.ts +14 -0
- package/dist/document-models/invoice/utils.d.ts.map +1 -0
- package/dist/document-models/invoice/utils.js +7 -0
- package/dist/editors/billing-statement/components/objectSetTable.js +3 -1
- package/dist/editors/billing-statement/config.d.ts +3 -0
- package/dist/editors/billing-statement/config.d.ts.map +1 -0
- package/dist/editors/billing-statement/config.js +3 -0
- package/dist/editors/billing-statement/editor.d.ts.map +1 -1
- package/dist/editors/billing-statement/editor.js +18 -10
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts +2 -2
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +2 -2
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts +2 -2
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +2 -0
- package/dist/editors/billing-statement/module.d.ts +3 -0
- package/dist/editors/billing-statement/module.d.ts.map +1 -0
- package/dist/editors/billing-statement/module.js +9 -0
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +2 -9
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -20
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts +8 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.js +97 -6
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.js +3 -3
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts +4 -4
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.js +45 -32
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.js +3 -8
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts +3 -3
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.js +1 -1
- package/dist/editors/contributor-billing/config.d.ts +3 -0
- package/dist/editors/contributor-billing/config.d.ts.map +1 -0
- package/dist/editors/contributor-billing/config.js +7 -0
- package/dist/editors/contributor-billing/editor.d.ts +2 -1
- package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
- package/dist/editors/contributor-billing/editor.js +7 -2
- package/dist/editors/contributor-billing/module.d.ts +3 -0
- package/dist/editors/contributor-billing/module.d.ts.map +1 -0
- package/dist/editors/contributor-billing/module.js +9 -0
- package/dist/editors/editors.d.ts +3 -0
- package/dist/editors/editors.d.ts.map +1 -0
- package/dist/editors/editors.js +12 -0
- package/dist/editors/expense-report/components/AddBillingStatementModal.js +2 -2
- package/dist/editors/expense-report/components/WalletsTable.d.ts.map +1 -1
- package/dist/editors/expense-report/components/WalletsTable.js +15 -8
- package/dist/editors/expense-report/config.d.ts +3 -0
- package/dist/editors/expense-report/config.d.ts.map +1 -0
- package/dist/editors/expense-report/config.js +3 -0
- package/dist/editors/expense-report/editor.d.ts +1 -1
- package/dist/editors/expense-report/editor.d.ts.map +1 -1
- package/dist/editors/expense-report/editor.js +12 -3
- package/dist/editors/expense-report/hooks/useSyncWallet.js +2 -2
- package/dist/editors/expense-report/hooks/useWalletSync.js +2 -2
- package/dist/editors/expense-report/module.d.ts +3 -0
- package/dist/editors/expense-report/module.d.ts.map +1 -0
- package/dist/editors/expense-report/module.js +9 -0
- package/dist/editors/hooks/useExpenseReportDocument.d.ts +2 -2
- package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +1 -1
- package/dist/editors/hooks/useIntegrationsDocument.d.ts +2 -2
- package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +1 -1
- package/dist/editors/index.d.ts +5 -5
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +5 -5
- package/dist/editors/integrations/config.d.ts +3 -0
- package/dist/editors/integrations/config.d.ts.map +1 -0
- package/dist/editors/integrations/config.js +3 -0
- package/dist/editors/integrations/editor.d.ts.map +1 -1
- package/dist/editors/integrations/editor.js +74 -52
- package/dist/editors/integrations/module.d.ts +3 -0
- package/dist/editors/integrations/module.d.ts.map +1 -0
- package/dist/editors/integrations/module.js +9 -0
- package/dist/editors/invoice/InvoicePDF.d.ts +1 -1
- package/dist/editors/invoice/InvoicePDF.d.ts.map +1 -1
- package/dist/editors/invoice/components/confirmationModal.js +1 -0
- package/dist/editors/invoice/components/countryForm.d.ts +1 -1
- package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/countryForm.js +1 -0
- package/dist/editors/invoice/components/currencyForm.d.ts +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -0
- package/dist/editors/invoice/components/datePicker.js +1 -0
- package/dist/editors/invoice/components/inputField.d.ts +1 -1
- package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
- package/dist/editors/invoice/components/inputField.js +1 -0
- package/dist/editors/invoice/components/selectField.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +0 -12
- package/dist/editors/invoice/components/statusModalComponents.js +4 -4
- package/dist/editors/invoice/config.d.ts +3 -0
- package/dist/editors/invoice/config.d.ts.map +1 -0
- package/dist/editors/invoice/config.js +3 -0
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +103 -95
- package/dist/editors/invoice/exportUBL.d.ts +1 -1
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.d.ts +1 -1
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +34 -18
- package/dist/editors/invoice/ingestUBL.d.ts +1 -1
- package/dist/editors/invoice/ingestUBL.d.ts.map +1 -1
- package/dist/editors/invoice/invoiceToGnosis.js +2 -2
- package/dist/editors/invoice/legalEntity/bankSection.d.ts +3 -3
- package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/common.d.ts +1 -1
- package/dist/editors/invoice/legalEntity/common.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts +3 -3
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.js +1 -0
- package/dist/editors/invoice/legalEntity/walletSection.d.ts +3 -3
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +5 -6
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts +2 -2
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/lineItemTags.js +2 -2
- package/dist/editors/invoice/lineItemTags/tagMapping.d.ts +1 -1
- package/dist/editors/invoice/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts +2 -2
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.js +2 -2
- package/dist/editors/invoice/lineItems.d.ts.map +1 -1
- package/dist/editors/invoice/lineItems.js +3 -1
- package/dist/editors/invoice/module.d.ts +3 -0
- package/dist/editors/invoice/module.d.ts.map +1 -0
- package/dist/editors/invoice/module.js +9 -0
- package/dist/editors/invoice/requestFinance.js +3 -3
- package/dist/editors/invoice/uploadPdfChunked.js +1 -1
- package/dist/editors/invoice/utils/utils.d.ts +25 -0
- package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
- package/dist/editors/invoice/utils/utils.js +66 -0
- package/dist/editors/invoice/validation/validationHandler.d.ts +1 -1
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +1 -1
- package/dist/editors/invoice/validation/validationManager.d.ts +1 -1
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +1 -0
- package/dist/editors/invoice/validation/validationRules.d.ts +1 -1
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/processors/index.d.ts +1 -1
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/line-item-processor/index.d.ts +2 -2
- package/dist/processors/line-item-processor/index.d.ts.map +1 -1
- package/dist/processors/line-item-processor/index.js +2 -1
- package/dist/scripts/invoice/autoTagging.d.ts +32 -0
- package/dist/scripts/invoice/autoTagging.d.ts.map +1 -0
- package/dist/scripts/invoice/autoTagging.js +341 -0
- package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
- package/dist/scripts/invoice/gnosisTransactionBuilder.js +4 -9
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
- package/dist/scripts/invoice/pdfToClaudeAI.js +8 -4
- package/dist/style.css +276 -4773
- package/dist/subgraphs/billing-statement/index.d.ts +2 -2
- package/dist/subgraphs/billing-statement/index.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/index.js +2 -2
- package/dist/subgraphs/billing-statement/resolvers.d.ts +2 -2
- package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/resolvers.js +1 -0
- package/dist/subgraphs/expense-report/index.d.ts +2 -2
- package/dist/subgraphs/expense-report/index.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/index.js +2 -2
- package/dist/subgraphs/expense-report/resolvers.d.ts +2 -2
- package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/resolvers.js +1 -0
- package/dist/subgraphs/integrations/index.d.ts +2 -2
- package/dist/subgraphs/integrations/index.d.ts.map +1 -1
- package/dist/subgraphs/integrations/index.js +2 -2
- package/dist/subgraphs/integrations/resolvers.d.ts +2 -2
- package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/integrations/resolvers.js +1 -0
- package/dist/subgraphs/invoice/index.d.ts +2 -2
- package/dist/subgraphs/invoice/index.d.ts.map +1 -1
- package/dist/subgraphs/invoice/index.js +2 -2
- package/dist/subgraphs/invoice/resolvers.d.ts +2 -2
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/dist/vite.config.js +13 -0
- package/package.json +66 -49
- package/dist/document-models/billing-statement/gen/general/object.d.ts +0 -9
- package/dist/document-models/billing-statement/gen/general/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/general/object.js +0 -13
- package/dist/document-models/billing-statement/gen/line-items/object.d.ts +0 -8
- package/dist/document-models/billing-statement/gen/line-items/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/line-items/object.js +0 -10
- package/dist/document-models/billing-statement/gen/object.d.ts +0 -19
- package/dist/document-models/billing-statement/gen/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/object.js +0 -33
- package/dist/document-models/billing-statement/gen/tags/object.d.ts +0 -7
- package/dist/document-models/billing-statement/gen/tags/object.d.ts.map +0 -1
- package/dist/document-models/billing-statement/gen/tags/object.js +0 -7
- package/dist/document-models/expense-report/gen/expense-report/object.d.ts +0 -7
- package/dist/document-models/expense-report/gen/expense-report/object.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/object.js +0 -7
- package/dist/document-models/expense-report/gen/object.d.ts +0 -15
- package/dist/document-models/expense-report/gen/object.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/object.js +0 -25
- package/dist/document-models/expense-report/gen/wallet/object.d.ts +0 -21
- package/dist/document-models/expense-report/gen/wallet/object.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/wallet/object.js +0 -49
- package/dist/document-models/integrations/gen/integrations/object.d.ts +0 -9
- package/dist/document-models/integrations/gen/integrations/object.d.ts.map +0 -1
- package/dist/document-models/integrations/gen/integrations/object.js +0 -13
- package/dist/document-models/integrations/gen/object.d.ts +0 -15
- package/dist/document-models/integrations/gen/object.d.ts.map +0 -1
- package/dist/document-models/integrations/gen/object.js +0 -25
- package/dist/document-models/invoice/gen/general/object.d.ts +0 -11
- package/dist/document-models/invoice/gen/general/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/general/object.js +0 -19
- package/dist/document-models/invoice/gen/items/object.d.ts +0 -11
- package/dist/document-models/invoice/gen/items/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/items/object.js +0 -19
- package/dist/document-models/invoice/gen/object.d.ts +0 -21
- package/dist/document-models/invoice/gen/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/object.js +0 -36
- package/dist/document-models/invoice/gen/parties/object.d.ts +0 -12
- package/dist/document-models/invoice/gen/parties/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/parties/object.js +0 -22
- package/dist/document-models/invoice/gen/transitions/object.d.ts +0 -18
- package/dist/document-models/invoice/gen/transitions/object.d.ts.map +0 -1
- package/dist/document-models/invoice/gen/transitions/object.js +0 -40
- package/dist/editors/billing-statement/index.d.ts +0 -4
- package/dist/editors/billing-statement/index.d.ts.map +0 -1
- package/dist/editors/billing-statement/index.js +0 -12
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts +0 -6
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/CreateDocument.js +0 -23
- package/dist/editors/contributor-billing/components/DocumentDispatch.d.ts +0 -12
- package/dist/editors/contributor-billing/components/DocumentDispatch.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/DocumentDispatch.js +0 -20
- package/dist/editors/contributor-billing/components/EditorContainer.d.ts +0 -10
- package/dist/editors/contributor-billing/components/EditorContainer.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/EditorContainer.js +0 -56
- package/dist/editors/contributor-billing/components/FileItemsGrid.d.ts +0 -12
- package/dist/editors/contributor-billing/components/FileItemsGrid.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/FileItemsGrid.js +0 -7
- package/dist/editors/contributor-billing/components/FolderItemsGrid.d.ts +0 -17
- package/dist/editors/contributor-billing/components/FolderItemsGrid.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/FolderItemsGrid.js +0 -14
- package/dist/editors/contributor-billing/components/FolderTree.d.ts +0 -13
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/FolderTree.js +0 -38
- package/dist/editors/contributor-billing/hooks/useDispatchMap.d.ts +0 -9
- package/dist/editors/contributor-billing/hooks/useDispatchMap.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useDispatchMap.js +0 -21
- package/dist/editors/contributor-billing/hooks/useDrop.d.ts +0 -22
- package/dist/editors/contributor-billing/hooks/useDrop.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useDrop.js +0 -57
- package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.d.ts +0 -8
- package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useSelectedFolderChildren.js +0 -19
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts +0 -3
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.d.ts.map +0 -1
- package/dist/editors/contributor-billing/hooks/useTransformedNodes.js +0 -32
- package/dist/editors/contributor-billing/index.d.ts +0 -4
- package/dist/editors/contributor-billing/index.d.ts.map +0 -1
- package/dist/editors/contributor-billing/index.js +0 -19
- package/dist/editors/contributor-billing/utils/withDropZone.d.ts +0 -4
- package/dist/editors/contributor-billing/utils/withDropZone.d.ts.map +0 -1
- package/dist/editors/contributor-billing/utils/withDropZone.js +0 -19
- package/dist/editors/expense-report/index.d.ts +0 -3
- package/dist/editors/expense-report/index.d.ts.map +0 -1
- package/dist/editors/expense-report/index.js +0 -11
- package/dist/editors/integrations/index.d.ts +0 -4
- package/dist/editors/integrations/index.d.ts.map +0 -1
- package/dist/editors/integrations/index.js +0 -12
- package/dist/editors/invoice/assets/custom.d.ts +0 -4
- package/dist/editors/invoice/assets/powerhouseLogo.png +0 -0
- package/dist/editors/invoice/index.d.ts +0 -4
- package/dist/editors/invoice/index.d.ts.map +0 -1
- package/dist/editors/invoice/index.js +0 -12
- package/dist/migrate-zip.d.ts +0 -2
- package/dist/migrate-zip.d.ts.map +0 -1
- package/dist/migrate-zip.js +0 -56
- package/dist/reducers/general.d.ts +0 -8
- package/dist/reducers/general.d.ts.map +0 -1
- package/dist/reducers/general.js +0 -73
- package/dist/reducers/items.d.ts +0 -8
- package/dist/reducers/items.d.ts.map +0 -1
- package/dist/reducers/items.js +0 -195
- package/dist/reducers/parties.d.ts +0 -8
- package/dist/reducers/parties.d.ts.map +0 -1
- package/dist/reducers/parties.js +0 -266
- package/dist/reducers/transitions.d.ts +0 -8
- package/dist/reducers/transitions.d.ts.map +0 -1
- package/dist/reducers/transitions.js +0 -162
- package/dist/scripts/invoice/pdfToDocumentAi.d.ts +0 -5
- package/dist/scripts/invoice/pdfToDocumentAi.d.ts.map +0 -1
- package/dist/scripts/invoice/pdfToDocumentAi.js +0 -659
- package/dist/tailwind.config.d.ts +0 -13
- package/dist/tailwind.config.d.ts.map +0 -1
- package/dist/tailwind.config.js +0 -16
package/dist/reducers/items.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a scaffold file meant for customization:
|
|
3
|
-
* - modify it by implementing the reducer functions
|
|
4
|
-
* - delete the file and run the code generator again to have it reset
|
|
5
|
-
*/
|
|
6
|
-
export const reducer = {
|
|
7
|
-
addLineItemOperation(state, action, dispatch) {
|
|
8
|
-
try {
|
|
9
|
-
const item = {
|
|
10
|
-
...action.input,
|
|
11
|
-
lineItemTag: [],
|
|
12
|
-
};
|
|
13
|
-
if (state.lineItems.find((x) => x.id === item.id))
|
|
14
|
-
throw new Error("Duplicate input.id");
|
|
15
|
-
validatePrices(item);
|
|
16
|
-
state.lineItems.push(item);
|
|
17
|
-
updateTotals(state);
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
console.error(e);
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
editLineItemOperation(state, action, dispatch) {
|
|
24
|
-
try {
|
|
25
|
-
const stateItem = state.lineItems.find((x) => x.id === action.input.id);
|
|
26
|
-
if (!stateItem)
|
|
27
|
-
throw new Error("Item matching input.id not found");
|
|
28
|
-
const sanitizedInput = Object.fromEntries(Object.entries(action.input).filter(([, value]) => value !== null));
|
|
29
|
-
// Ensure lineItemTag is always an array if provided
|
|
30
|
-
if ('lineItemTag' in action.input) {
|
|
31
|
-
sanitizedInput.lineItemTag = (action.input.lineItemTag ?? []);
|
|
32
|
-
}
|
|
33
|
-
const nextItem = {
|
|
34
|
-
...stateItem,
|
|
35
|
-
...sanitizedInput,
|
|
36
|
-
};
|
|
37
|
-
validatePrices(nextItem);
|
|
38
|
-
applyInvariants(state, nextItem);
|
|
39
|
-
Object.assign(stateItem, nextItem);
|
|
40
|
-
updateTotals(state);
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
console.error(e);
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
deleteLineItemOperation(state, action, dispatch) {
|
|
47
|
-
try {
|
|
48
|
-
state.lineItems = state.lineItems.filter((x) => x.id !== action.input.id);
|
|
49
|
-
updateTotals(state);
|
|
50
|
-
}
|
|
51
|
-
catch (e) {
|
|
52
|
-
console.error(e);
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
setLineItemTagOperation(state, action, dispatch) {
|
|
56
|
-
try {
|
|
57
|
-
const stateItem = state.lineItems.find((x) => x.id === action.input.lineItemId);
|
|
58
|
-
if (!stateItem)
|
|
59
|
-
throw new Error("Item matching input.id not found");
|
|
60
|
-
// if tag already exists with the same dimension, update the value and label
|
|
61
|
-
const existingTag = stateItem.lineItemTag?.find((tag) => tag.dimension === action.input.dimension);
|
|
62
|
-
if (existingTag) {
|
|
63
|
-
existingTag.value = action.input.value;
|
|
64
|
-
existingTag.label = action.input.label || null;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// if tag does not exist, add it
|
|
68
|
-
const newTag = {
|
|
69
|
-
dimension: action.input.dimension,
|
|
70
|
-
value: action.input.value,
|
|
71
|
-
label: action.input.label || null,
|
|
72
|
-
};
|
|
73
|
-
if (!stateItem.lineItemTag) {
|
|
74
|
-
stateItem.lineItemTag = [];
|
|
75
|
-
}
|
|
76
|
-
// Add the new tag
|
|
77
|
-
stateItem.lineItemTag?.push(newTag);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
console.error(e);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
setInvoiceTagOperation(state, action, dispatch) {
|
|
85
|
-
try {
|
|
86
|
-
// if tag already exists with the same dimension, update the value and label
|
|
87
|
-
const existingTag = state.invoiceTags?.find((tag) => tag.dimension === action.input.dimension);
|
|
88
|
-
if (existingTag) {
|
|
89
|
-
existingTag.value = action.input.value;
|
|
90
|
-
existingTag.label = action.input.label || null;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
// if tag does not exist, add it
|
|
94
|
-
const newTag = {
|
|
95
|
-
dimension: action.input.dimension,
|
|
96
|
-
value: action.input.value,
|
|
97
|
-
label: action.input.label || null,
|
|
98
|
-
};
|
|
99
|
-
if (!state.invoiceTags) {
|
|
100
|
-
state.invoiceTags = [];
|
|
101
|
-
}
|
|
102
|
-
// Add the new tag
|
|
103
|
-
state.invoiceTags.push(newTag);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
catch (e) {
|
|
107
|
-
console.error(e);
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
function updateTotals(state) {
|
|
112
|
-
state.totalPriceTaxExcl = state.lineItems.reduce((total, lineItem) => {
|
|
113
|
-
return total + lineItem.quantity * lineItem.unitPriceTaxExcl;
|
|
114
|
-
}, 0.0);
|
|
115
|
-
state.totalPriceTaxIncl = state.lineItems.reduce((total, lineItem) => {
|
|
116
|
-
return total + lineItem.quantity * lineItem.unitPriceTaxIncl;
|
|
117
|
-
}, 0.0);
|
|
118
|
-
}
|
|
119
|
-
function validatePrices(item) {
|
|
120
|
-
const EPSILON = 0.00001; // Small value for floating point comparisons
|
|
121
|
-
// Calculate total prices from unit prices and quantity
|
|
122
|
-
const calcPriceIncl = item.quantity * item.unitPriceTaxIncl;
|
|
123
|
-
const calcPriceExcl = item.quantity * item.unitPriceTaxExcl;
|
|
124
|
-
// Convert tax percentage to decimal rate
|
|
125
|
-
const taxRate = item.taxPercent / 100;
|
|
126
|
-
// Helper function to compare floating point numbers
|
|
127
|
-
const isClose = (a, b) => Math.abs(a - b) < EPSILON;
|
|
128
|
-
// Validate unit prices (tax-exclusive should equal tax-inclusive / (1 + taxRate))
|
|
129
|
-
const expectedUnitPriceExcl = item.unitPriceTaxIncl / (1 + taxRate);
|
|
130
|
-
if (!isClose(item.unitPriceTaxExcl, expectedUnitPriceExcl)) {
|
|
131
|
-
throw new Error("Tax inclusive/exclusive unit prices failed comparison.");
|
|
132
|
-
}
|
|
133
|
-
// Validate total prices
|
|
134
|
-
if (!isClose(calcPriceIncl, item.totalPriceTaxIncl)) {
|
|
135
|
-
throw new Error("Calculated unitPriceTaxIncl does not match input total");
|
|
136
|
-
}
|
|
137
|
-
if (!isClose(calcPriceExcl, item.totalPriceTaxExcl)) {
|
|
138
|
-
throw new Error("Calculated unitPriceTaxExcl does not match input total");
|
|
139
|
-
}
|
|
140
|
-
// Validate total prices using the tax rate
|
|
141
|
-
const expectedTotalPriceExcl = calcPriceIncl / (1 + taxRate);
|
|
142
|
-
if (!isClose(calcPriceExcl, expectedTotalPriceExcl)) {
|
|
143
|
-
throw new Error("Tax inclusive/exclusive totals failed comparison.");
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
const applyInvariants = (state, nextItem) => {
|
|
147
|
-
const EPSILON = 0.00001; // Small value for floating point comparisons
|
|
148
|
-
// Helper function to compare floating point numbers
|
|
149
|
-
const isClose = (a, b) => Math.abs(a - b) < EPSILON;
|
|
150
|
-
// Helper function to check if a value has changed significantly
|
|
151
|
-
const hasChanged = (oldValue, newValue) => !isClose(oldValue, newValue);
|
|
152
|
-
// Find the current state of this line item
|
|
153
|
-
const currentItem = state.lineItems.find(item => item.id === nextItem.id);
|
|
154
|
-
if (!currentItem) {
|
|
155
|
-
// New item, no comparison needed
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const taxRate = nextItem.taxPercent / 100;
|
|
159
|
-
// Check if totalPriceTaxExcl was changed and update unitPriceTaxExcl accordingly
|
|
160
|
-
const expectedTotalPriceTaxExcl = nextItem.quantity * nextItem.unitPriceTaxExcl;
|
|
161
|
-
if (hasChanged(expectedTotalPriceTaxExcl, nextItem.totalPriceTaxExcl)) {
|
|
162
|
-
// Total was changed, update unit price
|
|
163
|
-
nextItem.unitPriceTaxExcl = nextItem.totalPriceTaxExcl / nextItem.quantity;
|
|
164
|
-
// Update tax-inclusive unit price to maintain tax relationship
|
|
165
|
-
nextItem.unitPriceTaxIncl = nextItem.unitPriceTaxExcl * (1 + taxRate);
|
|
166
|
-
// Update tax-inclusive total to maintain consistency
|
|
167
|
-
nextItem.totalPriceTaxIncl = nextItem.quantity * nextItem.unitPriceTaxIncl;
|
|
168
|
-
}
|
|
169
|
-
// Check if totalPriceTaxIncl was changed and update unitPriceTaxIncl accordingly
|
|
170
|
-
const expectedTotalPriceTaxIncl = nextItem.quantity * nextItem.unitPriceTaxIncl;
|
|
171
|
-
if (hasChanged(expectedTotalPriceTaxIncl, nextItem.totalPriceTaxIncl)) {
|
|
172
|
-
// Total was changed, update unit price
|
|
173
|
-
nextItem.unitPriceTaxIncl = nextItem.totalPriceTaxIncl / nextItem.quantity;
|
|
174
|
-
// Update tax-exclusive unit price to maintain tax relationship
|
|
175
|
-
nextItem.unitPriceTaxExcl = nextItem.unitPriceTaxIncl / (1 + taxRate);
|
|
176
|
-
// Update tax-exclusive total to maintain consistency
|
|
177
|
-
nextItem.totalPriceTaxExcl = nextItem.quantity * nextItem.unitPriceTaxExcl;
|
|
178
|
-
}
|
|
179
|
-
// Check if unitPriceTaxExcl was changed and update totals accordingly
|
|
180
|
-
const expectedUnitPriceTaxIncl = nextItem.unitPriceTaxExcl * (1 + taxRate);
|
|
181
|
-
if (hasChanged(expectedUnitPriceTaxIncl, nextItem.unitPriceTaxIncl)) {
|
|
182
|
-
// Unit price was changed, update tax-inclusive unit price and totals
|
|
183
|
-
nextItem.unitPriceTaxIncl = nextItem.unitPriceTaxExcl * (1 + taxRate);
|
|
184
|
-
nextItem.totalPriceTaxExcl = nextItem.quantity * nextItem.unitPriceTaxExcl;
|
|
185
|
-
nextItem.totalPriceTaxIncl = nextItem.quantity * nextItem.unitPriceTaxIncl;
|
|
186
|
-
}
|
|
187
|
-
// Check if unitPriceTaxIncl was changed and update totals accordingly
|
|
188
|
-
const expectedUnitPriceTaxExcl = nextItem.unitPriceTaxIncl / (1 + taxRate);
|
|
189
|
-
if (hasChanged(expectedUnitPriceTaxExcl, nextItem.unitPriceTaxExcl)) {
|
|
190
|
-
// Unit price was changed, update tax-exclusive unit price and totals
|
|
191
|
-
nextItem.unitPriceTaxExcl = nextItem.unitPriceTaxIncl / (1 + taxRate);
|
|
192
|
-
nextItem.totalPriceTaxExcl = nextItem.quantity * nextItem.unitPriceTaxExcl;
|
|
193
|
-
nextItem.totalPriceTaxIncl = nextItem.quantity * nextItem.unitPriceTaxIncl;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a scaffold file meant for customization:
|
|
3
|
-
* - modify it by implementing the reducer functions
|
|
4
|
-
* - delete the file and run the code generator again to have it reset
|
|
5
|
-
*/
|
|
6
|
-
import type { InvoicePartiesOperations } from "../../gen/parties/operations.js";
|
|
7
|
-
export declare const reducer: InvoicePartiesOperations;
|
|
8
|
-
//# sourceMappingURL=parties.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parties.d.ts","sourceRoot":"","sources":["../../reducers/parties.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAShF,eAAO,MAAM,OAAO,EAAE,wBAwarB,CAAC"}
|
package/dist/reducers/parties.js
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a scaffold file meant for customization:
|
|
3
|
-
* - modify it by implementing the reducer functions
|
|
4
|
-
* - delete the file and run the code generator again to have it reset
|
|
5
|
-
*/
|
|
6
|
-
function getStateValue(input, currentValue) {
|
|
7
|
-
return input === undefined ? currentValue : input;
|
|
8
|
-
}
|
|
9
|
-
export const reducer = {
|
|
10
|
-
editIssuerOperation(state, action, dispatch) {
|
|
11
|
-
try {
|
|
12
|
-
if ('address' in state.issuer && ('city' in action.input ||
|
|
13
|
-
'country' in action.input ||
|
|
14
|
-
'extendedAddress' in action.input ||
|
|
15
|
-
'postalCode' in action.input ||
|
|
16
|
-
'stateProvince' in action.input ||
|
|
17
|
-
'streetAddress' in action.input)) {
|
|
18
|
-
state.issuer.address = {
|
|
19
|
-
...state.issuer.address,
|
|
20
|
-
city: action.input.city !== undefined ? action.input.city : state.issuer.address?.city ?? null,
|
|
21
|
-
country: action.input.country !== undefined ? action.input.country : state.issuer.address?.country ?? null,
|
|
22
|
-
extendedAddress: action.input.extendedAddress !== undefined ? action.input.extendedAddress : state.issuer.address?.extendedAddress ?? null,
|
|
23
|
-
postalCode: action.input.postalCode !== undefined ? action.input.postalCode : state.issuer.address?.postalCode ?? null,
|
|
24
|
-
stateProvince: action.input.stateProvince !== undefined ? action.input.stateProvince : state.issuer.address?.stateProvince ?? null,
|
|
25
|
-
streetAddress: action.input.streetAddress !== undefined ? action.input.streetAddress : state.issuer.address?.streetAddress ?? null,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if ('contactInfo' in state.issuer && ('tel' in action.input ||
|
|
29
|
-
'email' in action.input)) {
|
|
30
|
-
state.issuer.contactInfo = {
|
|
31
|
-
...state.issuer.contactInfo,
|
|
32
|
-
tel: action.input.tel !== undefined ? action.input.tel : state.issuer.contactInfo?.tel ?? null,
|
|
33
|
-
email: action.input.email !== undefined ? action.input.email : state.issuer.contactInfo?.email ?? null,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if ('country' in action.input) {
|
|
37
|
-
state.issuer.country = action.input.country !== undefined ? action.input.country : state.issuer.country ?? null;
|
|
38
|
-
}
|
|
39
|
-
if ('id' in action.input) {
|
|
40
|
-
state.issuer.id = action.input.id ? { taxId: action.input.id } : null;
|
|
41
|
-
}
|
|
42
|
-
if ('name' in action.input) {
|
|
43
|
-
state.issuer.name = action.input.name !== undefined ? action.input.name : state.issuer.name ?? null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
console.error(e);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
editIssuerBankOperation(state, action, dispatch) {
|
|
51
|
-
try {
|
|
52
|
-
if (!state.issuer.paymentRouting) {
|
|
53
|
-
state.issuer.paymentRouting = {
|
|
54
|
-
bank: null,
|
|
55
|
-
wallet: null,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
state.issuer.paymentRouting.bank = {
|
|
59
|
-
ABA: getStateValue(action.input.ABA, state.issuer.paymentRouting.bank?.ABA ?? null),
|
|
60
|
-
BIC: getStateValue(action.input.BIC, state.issuer.paymentRouting.bank?.BIC ?? null),
|
|
61
|
-
SWIFT: getStateValue(action.input.SWIFT, state.issuer.paymentRouting.bank?.SWIFT ?? null),
|
|
62
|
-
accountNum: action.input.accountNum ??
|
|
63
|
-
state.issuer.paymentRouting.bank?.accountNum ??
|
|
64
|
-
"",
|
|
65
|
-
accountType: getStateValue(action.input.accountType, state.issuer.paymentRouting.bank?.accountType ?? null),
|
|
66
|
-
address: {
|
|
67
|
-
city: getStateValue(action.input.city, state.issuer.paymentRouting.bank?.address.city ?? null),
|
|
68
|
-
country: getStateValue(action.input.country, state.issuer.paymentRouting.bank?.address.country ?? null),
|
|
69
|
-
extendedAddress: getStateValue(action.input.extendedAddress, state.issuer.paymentRouting.bank?.address.extendedAddress ?? null),
|
|
70
|
-
postalCode: getStateValue(action.input.postalCode, state.issuer.paymentRouting.bank?.address.postalCode ?? null),
|
|
71
|
-
stateProvince: getStateValue(action.input.stateProvince, state.issuer.paymentRouting.bank?.address.stateProvince ?? null),
|
|
72
|
-
streetAddress: getStateValue(action.input.streetAddress, state.issuer.paymentRouting.bank?.address.streetAddress ?? null),
|
|
73
|
-
},
|
|
74
|
-
beneficiary: getStateValue(action.input.beneficiary, state.issuer.paymentRouting.bank?.beneficiary ?? null),
|
|
75
|
-
name: action.input.name ?? state.issuer.paymentRouting.bank?.name ?? "",
|
|
76
|
-
memo: getStateValue(action.input.memo, state.issuer.paymentRouting.bank?.memo ?? null),
|
|
77
|
-
intermediaryBank: {
|
|
78
|
-
ABA: getStateValue(action.input.ABAIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.ABA ?? null),
|
|
79
|
-
BIC: getStateValue(action.input.BICIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.BIC ?? null),
|
|
80
|
-
SWIFT: getStateValue(action.input.SWIFTIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.SWIFT ?? null),
|
|
81
|
-
accountNum: action.input.accountNumIntermediary ??
|
|
82
|
-
state.issuer.paymentRouting.bank?.intermediaryBank?.accountNum ??
|
|
83
|
-
"",
|
|
84
|
-
accountType: getStateValue(action.input.accountTypeIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.accountType ??
|
|
85
|
-
null),
|
|
86
|
-
address: {
|
|
87
|
-
city: getStateValue(action.input.cityIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.address
|
|
88
|
-
.city ?? null),
|
|
89
|
-
country: getStateValue(action.input.countryIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.address
|
|
90
|
-
.country ?? null),
|
|
91
|
-
extendedAddress: getStateValue(action.input.extendedAddressIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.address
|
|
92
|
-
.extendedAddress ?? null),
|
|
93
|
-
postalCode: getStateValue(action.input.postalCodeIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.address
|
|
94
|
-
.postalCode ?? null),
|
|
95
|
-
stateProvince: getStateValue(action.input.stateProvinceIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.address
|
|
96
|
-
.stateProvince ?? null),
|
|
97
|
-
streetAddress: getStateValue(action.input.streetAddressIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.address
|
|
98
|
-
.streetAddress ?? null),
|
|
99
|
-
},
|
|
100
|
-
beneficiary: getStateValue(action.input.beneficiaryIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.beneficiary ??
|
|
101
|
-
null),
|
|
102
|
-
name: action.input.nameIntermediary ??
|
|
103
|
-
state.issuer.paymentRouting.bank?.intermediaryBank?.name ??
|
|
104
|
-
"",
|
|
105
|
-
memo: getStateValue(action.input.memoIntermediary, state.issuer.paymentRouting.bank?.intermediaryBank?.memo ?? null),
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
catch (e) {
|
|
110
|
-
console.error(e);
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
editIssuerWalletOperation(state, action, dispatch) {
|
|
114
|
-
try {
|
|
115
|
-
if (!state.issuer.paymentRouting) {
|
|
116
|
-
state.issuer.paymentRouting = {
|
|
117
|
-
bank: null,
|
|
118
|
-
wallet: null,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
state.issuer.paymentRouting.wallet = {
|
|
122
|
-
address: action.input.address ??
|
|
123
|
-
state.issuer.paymentRouting.wallet?.address ??
|
|
124
|
-
null,
|
|
125
|
-
chainId: action.input.chainId ??
|
|
126
|
-
state.issuer.paymentRouting.wallet?.chainId ??
|
|
127
|
-
null,
|
|
128
|
-
chainName: action.input.chainName ??
|
|
129
|
-
state.issuer.paymentRouting.wallet?.chainName ??
|
|
130
|
-
null,
|
|
131
|
-
rpc: action.input.rpc ?? state.issuer.paymentRouting.wallet?.rpc ?? null,
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
catch (e) {
|
|
135
|
-
console.error(e);
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
editPayerOperation(state, action, dispatch) {
|
|
139
|
-
try {
|
|
140
|
-
if ('address' in state.payer && ('city' in action.input ||
|
|
141
|
-
'country' in action.input ||
|
|
142
|
-
'extendedAddress' in action.input ||
|
|
143
|
-
'postalCode' in action.input ||
|
|
144
|
-
'stateProvince' in action.input ||
|
|
145
|
-
'streetAddress' in action.input)) {
|
|
146
|
-
state.payer.address = {
|
|
147
|
-
...state.payer.address,
|
|
148
|
-
city: action.input.city !== undefined ? action.input.city : state.payer.address?.city ?? null,
|
|
149
|
-
country: action.input.country !== undefined ? action.input.country : state.payer.address?.country ?? null,
|
|
150
|
-
extendedAddress: action.input.extendedAddress !== undefined ? action.input.extendedAddress : state.payer.address?.extendedAddress ?? null,
|
|
151
|
-
postalCode: action.input.postalCode !== undefined ? action.input.postalCode : state.payer.address?.postalCode ?? null,
|
|
152
|
-
stateProvince: action.input.stateProvince !== undefined ? action.input.stateProvince : state.payer.address?.stateProvince ?? null,
|
|
153
|
-
streetAddress: action.input.streetAddress !== undefined ? action.input.streetAddress : state.payer.address?.streetAddress ?? null,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if ('contactInfo' in state.payer && ('tel' in action.input ||
|
|
157
|
-
'email' in action.input)) {
|
|
158
|
-
state.payer.contactInfo = {
|
|
159
|
-
...state.payer.contactInfo,
|
|
160
|
-
tel: action.input.tel !== undefined ? action.input.tel : state.payer.contactInfo?.tel ?? null,
|
|
161
|
-
email: action.input.email !== undefined ? action.input.email : state.payer.contactInfo?.email ?? null,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
if ('country' in action.input) {
|
|
165
|
-
state.payer.country = action.input.country !== undefined ? action.input.country : state.payer.country ?? null;
|
|
166
|
-
}
|
|
167
|
-
if ('id' in action.input) {
|
|
168
|
-
state.payer.id = action.input.id ? { taxId: action.input.id } : null;
|
|
169
|
-
}
|
|
170
|
-
if ('name' in action.input) {
|
|
171
|
-
state.payer.name = action.input.name !== undefined ? action.input.name : state.payer.name ?? null;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
catch (e) {
|
|
175
|
-
console.error(e);
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
editPayerBankOperation(state, action, dispatch) {
|
|
179
|
-
try {
|
|
180
|
-
if (!state.payer.paymentRouting) {
|
|
181
|
-
state.payer.paymentRouting = {
|
|
182
|
-
bank: null,
|
|
183
|
-
wallet: null,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
state.payer.paymentRouting.bank = {
|
|
187
|
-
ABA: getStateValue(action.input.ABA, state.payer.paymentRouting.bank?.ABA ?? null),
|
|
188
|
-
BIC: getStateValue(action.input.BIC, state.payer.paymentRouting.bank?.BIC ?? null),
|
|
189
|
-
SWIFT: getStateValue(action.input.SWIFT, state.payer.paymentRouting.bank?.SWIFT ?? null),
|
|
190
|
-
accountNum: action.input.accountNum ??
|
|
191
|
-
state.payer.paymentRouting.bank?.accountNum ??
|
|
192
|
-
"",
|
|
193
|
-
accountType: getStateValue(action.input.accountType, state.payer.paymentRouting.bank?.accountType ?? null),
|
|
194
|
-
address: {
|
|
195
|
-
city: getStateValue(action.input.city, state.payer.paymentRouting.bank?.address.city ?? null),
|
|
196
|
-
country: getStateValue(action.input.country, state.payer.paymentRouting.bank?.address.country ?? null),
|
|
197
|
-
extendedAddress: getStateValue(action.input.extendedAddress, state.payer.paymentRouting.bank?.address.extendedAddress ?? null),
|
|
198
|
-
postalCode: getStateValue(action.input.postalCode, state.payer.paymentRouting.bank?.address.postalCode ?? null),
|
|
199
|
-
stateProvince: getStateValue(action.input.stateProvince, state.payer.paymentRouting.bank?.address.stateProvince ?? null),
|
|
200
|
-
streetAddress: getStateValue(action.input.streetAddress, state.payer.paymentRouting.bank?.address.streetAddress ?? null),
|
|
201
|
-
},
|
|
202
|
-
beneficiary: getStateValue(action.input.beneficiary, state.payer.paymentRouting.bank?.beneficiary ?? null),
|
|
203
|
-
name: action.input.name ?? state.payer.paymentRouting.bank?.name ?? "",
|
|
204
|
-
memo: getStateValue(action.input.memo, state.payer.paymentRouting.bank?.memo ?? null),
|
|
205
|
-
intermediaryBank: {
|
|
206
|
-
ABA: getStateValue(action.input.ABAIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.ABA ?? null),
|
|
207
|
-
BIC: getStateValue(action.input.BICIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.BIC ?? null),
|
|
208
|
-
SWIFT: getStateValue(action.input.SWIFTIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.SWIFT ?? null),
|
|
209
|
-
accountNum: action.input.accountNumIntermediary ??
|
|
210
|
-
state.payer.paymentRouting.bank?.intermediaryBank?.accountNum ??
|
|
211
|
-
"",
|
|
212
|
-
accountType: getStateValue(action.input.accountTypeIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.accountType ??
|
|
213
|
-
null),
|
|
214
|
-
address: {
|
|
215
|
-
city: getStateValue(action.input.cityIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.address.city ??
|
|
216
|
-
null),
|
|
217
|
-
country: getStateValue(action.input.countryIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.address
|
|
218
|
-
.country ?? null),
|
|
219
|
-
extendedAddress: getStateValue(action.input.extendedAddressIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.address
|
|
220
|
-
.extendedAddress ?? null),
|
|
221
|
-
postalCode: getStateValue(action.input.postalCodeIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.address
|
|
222
|
-
.postalCode ?? null),
|
|
223
|
-
stateProvince: getStateValue(action.input.stateProvinceIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.address
|
|
224
|
-
.stateProvince ?? null),
|
|
225
|
-
streetAddress: getStateValue(action.input.streetAddressIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.address
|
|
226
|
-
.streetAddress ?? null),
|
|
227
|
-
},
|
|
228
|
-
beneficiary: getStateValue(action.input.beneficiaryIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.beneficiary ??
|
|
229
|
-
null),
|
|
230
|
-
name: action.input.nameIntermediary ??
|
|
231
|
-
state.payer.paymentRouting.bank?.intermediaryBank?.name ??
|
|
232
|
-
"",
|
|
233
|
-
memo: getStateValue(action.input.memoIntermediary, state.payer.paymentRouting.bank?.intermediaryBank?.memo ?? null),
|
|
234
|
-
},
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
catch (e) {
|
|
238
|
-
console.error(e);
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
editPayerWalletOperation(state, action, dispatch) {
|
|
242
|
-
try {
|
|
243
|
-
if (!state.payer.paymentRouting) {
|
|
244
|
-
state.payer.paymentRouting = {
|
|
245
|
-
bank: null,
|
|
246
|
-
wallet: null,
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
state.payer.paymentRouting.wallet = {
|
|
250
|
-
address: action.input.address ??
|
|
251
|
-
state.payer.paymentRouting.wallet?.address ??
|
|
252
|
-
null,
|
|
253
|
-
chainId: action.input.chainId ??
|
|
254
|
-
state.payer.paymentRouting.wallet?.chainId ??
|
|
255
|
-
null,
|
|
256
|
-
chainName: action.input.chainName ??
|
|
257
|
-
state.payer.paymentRouting.wallet?.chainName ??
|
|
258
|
-
null,
|
|
259
|
-
rpc: action.input.rpc ?? state.payer.paymentRouting.wallet?.rpc ?? null,
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
catch (e) {
|
|
263
|
-
console.error(e);
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a scaffold file meant for customization:
|
|
3
|
-
* - modify it by implementing the reducer functions
|
|
4
|
-
* - delete the file and run the code generator again to have it reset
|
|
5
|
-
*/
|
|
6
|
-
import type { InvoiceTransitionsOperations } from "../../gen/transitions/operations.js";
|
|
7
|
-
export declare const reducer: InvoiceTransitionsOperations;
|
|
8
|
-
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../reducers/transitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAGxF,eAAO,MAAM,OAAO,EAAE,4BA4IrB,CAAC"}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a scaffold file meant for customization:
|
|
3
|
-
* - modify it by implementing the reducer functions
|
|
4
|
-
* - delete the file and run the code generator again to have it reset
|
|
5
|
-
*/
|
|
6
|
-
import { permittedTransitions } from "../../utils/statusTransitions.js";
|
|
7
|
-
export const reducer = {
|
|
8
|
-
cancelOperation(state, action, dispatch) {
|
|
9
|
-
if (permittedTransitions[state.status].includes('CANCELLED')) {
|
|
10
|
-
state.status = 'CANCELLED';
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
throw new Error(`Invalid transition from ${state.status} to CANCELLED`);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
issueOperation(state, action, dispatch) {
|
|
17
|
-
if (!action.input.invoiceNo || !action.input.dateIssued) {
|
|
18
|
-
throw new Error('Invoice number and date issued are required');
|
|
19
|
-
}
|
|
20
|
-
if (permittedTransitions[state.status].includes('ISSUED')) {
|
|
21
|
-
state.status = 'ISSUED';
|
|
22
|
-
state.invoiceNo = action.input.invoiceNo;
|
|
23
|
-
state.dateIssued = action.input.dateIssued;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
throw new Error(`Invalid transition from ${state.status} to ISSUED`);
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
resetOperation(state, action, dispatch) {
|
|
30
|
-
if (permittedTransitions[state.status].includes('DRAFT')) {
|
|
31
|
-
state.status = 'DRAFT';
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
throw new Error(`Invalid transition from ${state.status} to DRAFT`);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
rejectOperation(state, action, dispatch) {
|
|
38
|
-
if (!action.input.id || !action.input.reason) {
|
|
39
|
-
throw new Error('Reason, ID and final are required');
|
|
40
|
-
}
|
|
41
|
-
if (permittedTransitions[state.status].includes('REJECTED')) {
|
|
42
|
-
state.status = 'REJECTED';
|
|
43
|
-
const rejection = {
|
|
44
|
-
id: action.input.id,
|
|
45
|
-
reason: action.input.reason,
|
|
46
|
-
final: action.input.final,
|
|
47
|
-
};
|
|
48
|
-
state.rejections.push(rejection);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
throw new Error(`Invalid transition from ${state.status} to REJECTED`);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
acceptOperation(state, action, dispatch) {
|
|
55
|
-
if (!action.input.payAfter) {
|
|
56
|
-
throw new Error('Pay after is required');
|
|
57
|
-
}
|
|
58
|
-
if (permittedTransitions[state.status].includes('ACCEPTED')) {
|
|
59
|
-
state.status = 'ACCEPTED';
|
|
60
|
-
state.payAfter = action.input.payAfter;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
throw new Error(`Invalid transition from ${state.status} to ACCEPTED`);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
reinstateOperation(state, action, dispatch) {
|
|
67
|
-
const finalRejection = state.rejections.find(rejection => rejection.final === true);
|
|
68
|
-
if (finalRejection) {
|
|
69
|
-
throw new Error('Cannot reinstate an invoice that has been rejected');
|
|
70
|
-
}
|
|
71
|
-
if (permittedTransitions[state.status].includes('ISSUED')) {
|
|
72
|
-
state.status = 'ISSUED';
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
throw new Error(`Invalid transition from ${state.status} to ISSUED`);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
schedulePaymentOperation(state, action, dispatch) {
|
|
79
|
-
if (!action.input.id || !action.input.processorRef) {
|
|
80
|
-
throw new Error('ID and processorRef are required');
|
|
81
|
-
}
|
|
82
|
-
if (permittedTransitions[state.status].includes('PAYMENTSCHEDULED')) {
|
|
83
|
-
state.status = 'PAYMENTSCHEDULED';
|
|
84
|
-
state.payments.push({
|
|
85
|
-
id: action.input.id,
|
|
86
|
-
processorRef: action.input.processorRef,
|
|
87
|
-
paymentDate: '',
|
|
88
|
-
txnRef: "",
|
|
89
|
-
confirmed: false,
|
|
90
|
-
issue: "",
|
|
91
|
-
amount: 0,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
throw new Error(`Invalid transition from ${state.status} to PAYMENTSCHEDULED`);
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
reapprovePaymentOperation(state, action, dispatch) {
|
|
99
|
-
if (permittedTransitions[state.status].includes('ACCEPTED')) {
|
|
100
|
-
state.status = 'ACCEPTED';
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
throw new Error(`Invalid transition from ${state.status} to ACCEPTED`);
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
registerPaymentTxOperation(state, action, dispatch) {
|
|
107
|
-
if (permittedTransitions[state.status].includes('PAYMENTSENT')) {
|
|
108
|
-
state.status = 'PAYMENTSENT';
|
|
109
|
-
const payment = state.payments.find(payment => payment.id === action.input.id);
|
|
110
|
-
if (!payment)
|
|
111
|
-
throw new Error('Payment not found');
|
|
112
|
-
payment.txnRef = action.input.txRef;
|
|
113
|
-
payment.paymentDate = action.input.timestamp;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
throw new Error(`Invalid transition from ${state.status} to PAYMENTSENT`);
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
reportPaymentIssueOperation(state, action, dispatch) {
|
|
120
|
-
if (!action.input.id || !action.input.issue) {
|
|
121
|
-
throw new Error('ID and issue are required');
|
|
122
|
-
}
|
|
123
|
-
if (permittedTransitions[state.status].includes('PAYMENTISSUE')) {
|
|
124
|
-
state.status = 'PAYMENTISSUE';
|
|
125
|
-
const payment = state.payments.find(payment => payment.id === action.input.id);
|
|
126
|
-
if (!payment)
|
|
127
|
-
throw new Error('Payment not found');
|
|
128
|
-
payment.issue = action.input.issue;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
throw new Error(`Invalid transition from ${state.status} to PAYMENTISSUE`);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
confirmPaymentOperation(state, action, dispatch) {
|
|
135
|
-
if (!action.input.id || !action.input.amount) {
|
|
136
|
-
throw new Error('ID and amount are required');
|
|
137
|
-
}
|
|
138
|
-
if (permittedTransitions[state.status].includes('PAYMENTRECEIVED')) {
|
|
139
|
-
state.status = 'PAYMENTRECEIVED';
|
|
140
|
-
const payment = state.payments.find(payment => payment.id === action.input.id);
|
|
141
|
-
if (!payment)
|
|
142
|
-
throw new Error('Payment not found');
|
|
143
|
-
payment.confirmed = true;
|
|
144
|
-
payment.amount = action.input.amount;
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
throw new Error(`Invalid transition from ${state.status} to PAYMENTRECEIVED`);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
closePaymentOperation(state, action, dispatch) {
|
|
151
|
-
if (!action.input.closureReason) {
|
|
152
|
-
throw new Error('Closure reason is required');
|
|
153
|
-
}
|
|
154
|
-
if (permittedTransitions[state.status].includes('PAYMENTCLOSED')) {
|
|
155
|
-
state.status = 'PAYMENTCLOSED';
|
|
156
|
-
state.closureReason = action.input.closureReason;
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
throw new Error(`Invalid transition from ${state.status} to PAYMENTCLOSED`);
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pdfToDocumentAi.d.ts","sourceRoot":"","sources":["../../../scripts/invoice/pdfToDocumentAi.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,YAAY,EAGlB,MAAM,wCAAwC,CAAC;AAoBlD,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,GAAG;;GAyDtD"}
|