@cranberry-money/shared-services 1.13.0 → 3.0.1
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/CHANGELOG.md +240 -0
- package/README.md +464 -190
- package/dist/api/functional-client.d.ts +66 -0
- package/dist/api/functional-client.d.ts.map +1 -0
- package/dist/api/functional-client.js +165 -0
- package/dist/auth/functional/auth-operations.d.ts +116 -0
- package/dist/auth/functional/auth-operations.d.ts.map +1 -0
- package/dist/auth/functional/auth-operations.js +246 -0
- package/dist/auth/functional/auth-state.d.ts +38 -0
- package/dist/auth/functional/auth-state.d.ts.map +1 -0
- package/dist/auth/functional/auth-state.js +87 -0
- package/dist/auth/functional/token-storage.d.ts +44 -0
- package/dist/auth/functional/token-storage.d.ts.map +1 -0
- package/dist/auth/functional/token-storage.js +178 -0
- package/dist/auth/react/AuthProvider.d.ts +92 -0
- package/dist/auth/react/AuthProvider.d.ts.map +1 -0
- package/dist/auth/react/AuthProvider.js +207 -0
- package/dist/index.d.ts +25 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +114 -42
- package/dist/integration/blueberry-integration.d.ts +21 -0
- package/dist/integration/blueberry-integration.d.ts.map +1 -0
- package/dist/integration/blueberry-integration.js +109 -0
- package/dist/integration/index.d.ts +8 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +18 -0
- package/dist/services/accounts.d.ts +220 -0
- package/dist/services/accounts.d.ts.map +1 -0
- package/dist/services/accounts.js +175 -0
- package/dist/services/banks.d.ts +123 -0
- package/dist/services/banks.d.ts.map +1 -0
- package/dist/services/banks.js +151 -0
- package/dist/services/cash-accounts.d.ts +112 -0
- package/dist/services/cash-accounts.d.ts.map +1 -0
- package/dist/services/cash-accounts.js +222 -0
- package/dist/services/documents.d.ts +143 -0
- package/dist/services/documents.d.ts.map +1 -0
- package/dist/services/documents.js +253 -0
- package/dist/services/factories/account-factory.d.ts +16 -0
- package/dist/services/factories/account-factory.d.ts.map +1 -0
- package/dist/services/factories/account-factory.js +79 -0
- package/dist/services/factories/auth-factory.d.ts +23 -0
- package/dist/services/factories/auth-factory.d.ts.map +1 -0
- package/dist/services/factories/auth-factory.js +75 -0
- package/dist/services/factories/bank-factory.d.ts +16 -0
- package/dist/services/factories/bank-factory.d.ts.map +1 -0
- package/dist/services/factories/bank-factory.js +72 -0
- package/dist/services/factories/cash-account-factory.d.ts +16 -0
- package/dist/services/factories/cash-account-factory.d.ts.map +1 -0
- package/dist/services/factories/cash-account-factory.js +74 -0
- package/dist/services/factories/document-factory.d.ts +16 -0
- package/dist/services/factories/document-factory.d.ts.map +1 -0
- package/dist/services/factories/document-factory.js +85 -0
- package/dist/services/factories/index.d.ts +21 -0
- package/dist/services/factories/index.d.ts.map +1 -0
- package/dist/services/factories/index.js +40 -0
- package/dist/services/factories/instrument-factory.d.ts +16 -0
- package/dist/services/factories/instrument-factory.d.ts.map +1 -0
- package/dist/services/factories/instrument-factory.js +68 -0
- package/dist/services/factories/master-factory.d.ts +74 -0
- package/dist/services/factories/master-factory.d.ts.map +1 -0
- package/dist/services/factories/master-factory.js +183 -0
- package/dist/services/factories/portfolio-factory.d.ts +16 -0
- package/dist/services/factories/portfolio-factory.d.ts.map +1 -0
- package/dist/services/factories/portfolio-factory.js +74 -0
- package/dist/services/factories/portfolio-template-factory.d.ts +16 -0
- package/dist/services/factories/portfolio-template-factory.d.ts.map +1 -0
- package/dist/services/factories/portfolio-template-factory.js +76 -0
- package/dist/services/factories/reference-data-factory.d.ts +16 -0
- package/dist/services/factories/reference-data-factory.d.ts.map +1 -0
- package/dist/services/factories/reference-data-factory.js +86 -0
- package/dist/services/factories/tax-residency-factory.d.ts +16 -0
- package/dist/services/factories/tax-residency-factory.d.ts.map +1 -0
- package/dist/services/factories/tax-residency-factory.js +73 -0
- package/dist/services/factories/trade-factory.d.ts +16 -0
- package/dist/services/factories/trade-factory.d.ts.map +1 -0
- package/dist/services/factories/trade-factory.js +79 -0
- package/dist/services/factories/types.d.ts +250 -0
- package/dist/services/factories/types.d.ts.map +1 -0
- package/dist/services/factories/types.js +32 -0
- package/dist/services/factories/withdrawal-factory.d.ts +16 -0
- package/dist/services/factories/withdrawal-factory.d.ts.map +1 -0
- package/dist/services/factories/withdrawal-factory.js +78 -0
- package/dist/services/instruments.d.ts +138 -0
- package/dist/services/instruments.d.ts.map +1 -0
- package/dist/services/instruments.js +178 -0
- package/dist/services/portfolio-templates.d.ts +142 -0
- package/dist/services/portfolio-templates.d.ts.map +1 -0
- package/dist/services/portfolio-templates.js +201 -0
- package/dist/services/portfolios.d.ts +157 -0
- package/dist/services/portfolios.d.ts.map +1 -0
- package/dist/services/portfolios.js +144 -0
- package/dist/services/reference-data.d.ts +185 -0
- package/dist/services/reference-data.d.ts.map +1 -0
- package/dist/services/reference-data.js +245 -0
- package/dist/services/tax-residencies.d.ts +83 -0
- package/dist/services/tax-residencies.d.ts.map +1 -0
- package/dist/services/tax-residencies.js +179 -0
- package/dist/services/trades.d.ts +190 -0
- package/dist/services/trades.d.ts.map +1 -0
- package/dist/services/trades.js +207 -0
- package/dist/services/withdrawals.d.ts +236 -0
- package/dist/services/withdrawals.d.ts.map +1 -0
- package/dist/services/withdrawals.js +345 -0
- package/package.json +39 -16
- package/dist/adapters/MobileApiClient.d.ts +0 -68
- package/dist/adapters/MobileApiClient.d.ts.map +0 -1
- package/dist/adapters/MobileApiClient.js +0 -240
- package/dist/adapters/MobileTokenStorage.d.ts +0 -43
- package/dist/adapters/MobileTokenStorage.d.ts.map +0 -1
- package/dist/adapters/MobileTokenStorage.js +0 -128
- package/dist/adapters/WebApiClient.d.ts +0 -28
- package/dist/adapters/WebApiClient.d.ts.map +0 -1
- package/dist/adapters/WebApiClient.js +0 -119
- package/dist/adapters/WebTokenStorage.d.ts +0 -38
- package/dist/adapters/WebTokenStorage.d.ts.map +0 -1
- package/dist/adapters/WebTokenStorage.js +0 -86
- package/dist/api/apiClient.d.ts +0 -31
- package/dist/api/apiClient.d.ts.map +0 -1
- package/dist/api/apiClient.js +0 -49
- package/dist/api/types.d.ts +0 -51
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -4
- package/dist/auth/AuthManager.d.ts +0 -81
- package/dist/auth/AuthManager.d.ts.map +0 -1
- package/dist/auth/AuthManager.js +0 -223
- package/dist/auth/createAuthManager.d.ts +0 -63
- package/dist/auth/createAuthManager.d.ts.map +0 -1
- package/dist/auth/createAuthManager.js +0 -103
- package/dist/auth/useAuthManager.d.ts +0 -66
- package/dist/auth/useAuthManager.d.ts.map +0 -1
- package/dist/auth/useAuthManager.js +0 -133
- package/dist/config/serviceConfig.d.ts +0 -37
- package/dist/config/serviceConfig.d.ts.map +0 -1
- package/dist/config/serviceConfig.js +0 -70
- package/dist/core/BaseApiClient.d.ts +0 -82
- package/dist/core/BaseApiClient.d.ts.map +0 -1
- package/dist/core/BaseApiClient.js +0 -89
- package/dist/core/TokenStorage.d.ts +0 -45
- package/dist/core/TokenStorage.d.ts.map +0 -1
- package/dist/core/TokenStorage.js +0 -23
- package/dist/query/QueryClient.d.ts +0 -82
- package/dist/query/QueryClient.d.ts.map +0 -1
- package/dist/query/QueryClient.js +0 -136
- package/dist/query/useAuth.d.ts +0 -64
- package/dist/query/useAuth.d.ts.map +0 -1
- package/dist/query/useAuth.js +0 -144
- package/dist/query/usePortfolios.d.ts +0 -79
- package/dist/query/usePortfolios.d.ts.map +0 -1
- package/dist/query/usePortfolios.js +0 -172
- package/dist/services/AuthService.d.ts +0 -75
- package/dist/services/AuthService.d.ts.map +0 -1
- package/dist/services/AuthService.js +0 -83
- package/dist/services/BaseService.d.ts +0 -48
- package/dist/services/BaseService.d.ts.map +0 -1
- package/dist/services/BaseService.js +0 -51
- package/dist/services/PortfolioService.d.ts +0 -100
- package/dist/services/PortfolioService.d.ts.map +0 -1
- package/dist/services/PortfolioService.js +0 -68
- package/dist/services/accounts/constants.d.ts +0 -24
- package/dist/services/accounts/constants.d.ts.map +0 -1
- package/dist/services/accounts/constants.js +0 -30
- package/dist/services/accounts/index.d.ts +0 -7
- package/dist/services/accounts/index.d.ts.map +0 -1
- package/dist/services/accounts/index.js +0 -6
- package/dist/services/accounts/service.d.ts +0 -11
- package/dist/services/accounts/service.d.ts.map +0 -1
- package/dist/services/accounts/service.js +0 -19
- package/dist/services/accounts/types.d.ts +0 -15
- package/dist/services/accounts/types.d.ts.map +0 -1
- package/dist/services/accounts/types.js +0 -4
- package/dist/services/auth/constants.d.ts +0 -30
- package/dist/services/auth/constants.d.ts.map +0 -1
- package/dist/services/auth/constants.js +0 -37
- package/dist/services/auth/index.d.ts +0 -8
- package/dist/services/auth/index.d.ts.map +0 -1
- package/dist/services/auth/index.js +0 -7
- package/dist/services/auth/service.d.ts +0 -8
- package/dist/services/auth/service.d.ts.map +0 -1
- package/dist/services/auth/service.js +0 -23
- package/dist/services/auth/types.d.ts +0 -38
- package/dist/services/auth/types.d.ts.map +0 -1
- package/dist/services/auth/types.js +0 -1
- package/dist/services/auth/utils.d.ts +0 -46
- package/dist/services/auth/utils.d.ts.map +0 -1
- package/dist/services/auth/utils.js +0 -113
- package/dist/services/banks/constants.d.ts +0 -47
- package/dist/services/banks/constants.d.ts.map +0 -1
- package/dist/services/banks/constants.js +0 -98
- package/dist/services/banks/index.d.ts +0 -8
- package/dist/services/banks/index.d.ts.map +0 -1
- package/dist/services/banks/index.js +0 -7
- package/dist/services/banks/service.d.ts +0 -9
- package/dist/services/banks/service.d.ts.map +0 -1
- package/dist/services/banks/service.js +0 -38
- package/dist/services/banks/types.d.ts +0 -36
- package/dist/services/banks/types.d.ts.map +0 -1
- package/dist/services/banks/types.js +0 -4
- package/dist/services/cash_accounts/constants.d.ts +0 -7
- package/dist/services/cash_accounts/constants.d.ts.map +0 -1
- package/dist/services/cash_accounts/constants.js +0 -7
- package/dist/services/cash_accounts/index.d.ts +0 -5
- package/dist/services/cash_accounts/index.d.ts.map +0 -1
- package/dist/services/cash_accounts/index.js +0 -6
- package/dist/services/cash_accounts/service.d.ts +0 -8
- package/dist/services/cash_accounts/service.d.ts.map +0 -1
- package/dist/services/cash_accounts/service.js +0 -32
- package/dist/services/cash_accounts/transactions/constants.d.ts +0 -18
- package/dist/services/cash_accounts/transactions/constants.d.ts.map +0 -1
- package/dist/services/cash_accounts/transactions/constants.js +0 -25
- package/dist/services/cash_accounts/transactions/index.d.ts +0 -5
- package/dist/services/cash_accounts/transactions/index.d.ts.map +0 -1
- package/dist/services/cash_accounts/transactions/index.js +0 -6
- package/dist/services/cash_accounts/transactions/service.d.ts +0 -13
- package/dist/services/cash_accounts/transactions/service.d.ts.map +0 -1
- package/dist/services/cash_accounts/transactions/service.js +0 -75
- package/dist/services/cash_accounts/transactions/types.d.ts +0 -38
- package/dist/services/cash_accounts/transactions/types.d.ts.map +0 -1
- package/dist/services/cash_accounts/transactions/types.js +0 -11
- package/dist/services/cash_accounts/types.d.ts +0 -24
- package/dist/services/cash_accounts/types.d.ts.map +0 -1
- package/dist/services/cash_accounts/types.js +0 -4
- package/dist/services/countries/constants.d.ts +0 -9
- package/dist/services/countries/constants.d.ts.map +0 -1
- package/dist/services/countries/constants.js +0 -10
- package/dist/services/countries/index.d.ts +0 -5
- package/dist/services/countries/index.d.ts.map +0 -1
- package/dist/services/countries/index.js +0 -6
- package/dist/services/countries/service.d.ts +0 -18
- package/dist/services/countries/service.d.ts.map +0 -1
- package/dist/services/countries/service.js +0 -32
- package/dist/services/countries/types.d.ts +0 -24
- package/dist/services/countries/types.d.ts.map +0 -1
- package/dist/services/countries/types.js +0 -1
- package/dist/services/countries/utils.d.ts +0 -38
- package/dist/services/countries/utils.d.ts.map +0 -1
- package/dist/services/countries/utils.js +0 -62
- package/dist/services/documents/constants.d.ts +0 -55
- package/dist/services/documents/constants.d.ts.map +0 -1
- package/dist/services/documents/constants.js +0 -50
- package/dist/services/documents/index.d.ts +0 -6
- package/dist/services/documents/index.d.ts.map +0 -1
- package/dist/services/documents/index.js +0 -6
- package/dist/services/documents/service.d.ts +0 -50
- package/dist/services/documents/service.d.ts.map +0 -1
- package/dist/services/documents/service.js +0 -116
- package/dist/services/documents/types.d.ts +0 -47
- package/dist/services/documents/types.d.ts.map +0 -1
- package/dist/services/documents/types.js +0 -1
- package/dist/services/documents/utils.d.ts +0 -26
- package/dist/services/documents/utils.d.ts.map +0 -1
- package/dist/services/documents/utils.js +0 -37
- package/dist/services/industries/constants.d.ts +0 -8
- package/dist/services/industries/constants.d.ts.map +0 -1
- package/dist/services/industries/constants.js +0 -9
- package/dist/services/industries/index.d.ts +0 -6
- package/dist/services/industries/index.d.ts.map +0 -1
- package/dist/services/industries/index.js +0 -6
- package/dist/services/industries/service.d.ts +0 -18
- package/dist/services/industries/service.d.ts.map +0 -1
- package/dist/services/industries/service.js +0 -43
- package/dist/services/industries/types.d.ts +0 -21
- package/dist/services/industries/types.d.ts.map +0 -1
- package/dist/services/industries/types.js +0 -1
- package/dist/services/industries/utils.d.ts +0 -47
- package/dist/services/industries/utils.d.ts.map +0 -1
- package/dist/services/industries/utils.js +0 -86
- package/dist/services/instruments/constants.d.ts +0 -38
- package/dist/services/instruments/constants.d.ts.map +0 -1
- package/dist/services/instruments/constants.js +0 -36
- package/dist/services/instruments/index.d.ts +0 -5
- package/dist/services/instruments/index.d.ts.map +0 -1
- package/dist/services/instruments/index.js +0 -6
- package/dist/services/instruments/service.d.ts +0 -54
- package/dist/services/instruments/service.d.ts.map +0 -1
- package/dist/services/instruments/service.js +0 -106
- package/dist/services/instruments/types.d.ts +0 -83
- package/dist/services/instruments/types.d.ts.map +0 -1
- package/dist/services/instruments/types.js +0 -1
- package/dist/services/instruments/utils.d.ts +0 -50
- package/dist/services/instruments/utils.d.ts.map +0 -1
- package/dist/services/instruments/utils.js +0 -111
- package/dist/services/portfolio_templates/constants.d.ts +0 -8
- package/dist/services/portfolio_templates/constants.d.ts.map +0 -1
- package/dist/services/portfolio_templates/constants.js +0 -8
- package/dist/services/portfolio_templates/index.d.ts +0 -5
- package/dist/services/portfolio_templates/index.d.ts.map +0 -1
- package/dist/services/portfolio_templates/index.js +0 -5
- package/dist/services/portfolio_templates/service.d.ts +0 -6
- package/dist/services/portfolio_templates/service.d.ts.map +0 -1
- package/dist/services/portfolio_templates/service.js +0 -14
- package/dist/services/portfolio_templates/types.d.ts +0 -49
- package/dist/services/portfolio_templates/types.d.ts.map +0 -1
- package/dist/services/portfolio_templates/types.js +0 -1
- package/dist/services/portfolio_templates/utils.d.ts +0 -8
- package/dist/services/portfolio_templates/utils.d.ts.map +0 -1
- package/dist/services/portfolio_templates/utils.js +0 -13
- package/dist/services/portfolios/allocations/index.d.ts +0 -7
- package/dist/services/portfolios/allocations/index.d.ts.map +0 -1
- package/dist/services/portfolios/allocations/index.js +0 -6
- package/dist/services/portfolios/allocations/service.d.ts +0 -6
- package/dist/services/portfolios/allocations/service.d.ts.map +0 -1
- package/dist/services/portfolios/allocations/service.js +0 -19
- package/dist/services/portfolios/allocations/types.d.ts +0 -17
- package/dist/services/portfolios/allocations/types.d.ts.map +0 -1
- package/dist/services/portfolios/allocations/types.js +0 -4
- package/dist/services/portfolios/allocations/utils.d.ts +0 -3
- package/dist/services/portfolios/allocations/utils.d.ts.map +0 -1
- package/dist/services/portfolios/allocations/utils.js +0 -7
- package/dist/services/portfolios/constants.d.ts +0 -45
- package/dist/services/portfolios/constants.d.ts.map +0 -1
- package/dist/services/portfolios/constants.js +0 -57
- package/dist/services/portfolios/holdings/index.d.ts +0 -7
- package/dist/services/portfolios/holdings/index.d.ts.map +0 -1
- package/dist/services/portfolios/holdings/index.js +0 -6
- package/dist/services/portfolios/holdings/service.d.ts +0 -10
- package/dist/services/portfolios/holdings/service.d.ts.map +0 -1
- package/dist/services/portfolios/holdings/service.js +0 -53
- package/dist/services/portfolios/holdings/types.d.ts +0 -42
- package/dist/services/portfolios/holdings/types.d.ts.map +0 -1
- package/dist/services/portfolios/holdings/types.js +0 -4
- package/dist/services/portfolios/holdings/utils.d.ts +0 -8
- package/dist/services/portfolios/holdings/utils.d.ts.map +0 -1
- package/dist/services/portfolios/holdings/utils.js +0 -82
- package/dist/services/portfolios/index.d.ts +0 -10
- package/dist/services/portfolios/index.d.ts.map +0 -1
- package/dist/services/portfolios/index.js +0 -10
- package/dist/services/portfolios/service.d.ts +0 -7
- package/dist/services/portfolios/service.d.ts.map +0 -1
- package/dist/services/portfolios/service.js +0 -19
- package/dist/services/portfolios/types.d.ts +0 -29
- package/dist/services/portfolios/types.d.ts.map +0 -1
- package/dist/services/portfolios/types.js +0 -1
- package/dist/services/portfolios/utils.d.ts +0 -5
- package/dist/services/portfolios/utils.d.ts.map +0 -1
- package/dist/services/portfolios/utils.js +0 -26
- package/dist/services/sectors/constants.d.ts +0 -7
- package/dist/services/sectors/constants.d.ts.map +0 -1
- package/dist/services/sectors/constants.js +0 -7
- package/dist/services/sectors/index.d.ts +0 -6
- package/dist/services/sectors/index.d.ts.map +0 -1
- package/dist/services/sectors/index.js +0 -6
- package/dist/services/sectors/service.d.ts +0 -14
- package/dist/services/sectors/service.d.ts.map +0 -1
- package/dist/services/sectors/service.js +0 -32
- package/dist/services/sectors/types.d.ts +0 -19
- package/dist/services/sectors/types.d.ts.map +0 -1
- package/dist/services/sectors/types.js +0 -1
- package/dist/services/sectors/utils.d.ts +0 -31
- package/dist/services/sectors/utils.d.ts.map +0 -1
- package/dist/services/sectors/utils.js +0 -54
- package/dist/services/stock_exchanges/constants.d.ts +0 -7
- package/dist/services/stock_exchanges/constants.d.ts.map +0 -1
- package/dist/services/stock_exchanges/constants.js +0 -7
- package/dist/services/stock_exchanges/index.d.ts +0 -6
- package/dist/services/stock_exchanges/index.d.ts.map +0 -1
- package/dist/services/stock_exchanges/index.js +0 -6
- package/dist/services/stock_exchanges/service.d.ts +0 -4
- package/dist/services/stock_exchanges/service.d.ts.map +0 -1
- package/dist/services/stock_exchanges/service.js +0 -26
- package/dist/services/stock_exchanges/types.d.ts +0 -28
- package/dist/services/stock_exchanges/types.d.ts.map +0 -1
- package/dist/services/stock_exchanges/types.js +0 -1
- package/dist/services/stock_exchanges/utils.d.ts +0 -8
- package/dist/services/stock_exchanges/utils.d.ts.map +0 -1
- package/dist/services/stock_exchanges/utils.js +0 -37
- package/dist/services/tax_residencies/constants.d.ts +0 -7
- package/dist/services/tax_residencies/constants.d.ts.map +0 -1
- package/dist/services/tax_residencies/constants.js +0 -7
- package/dist/services/tax_residencies/index.d.ts +0 -10
- package/dist/services/tax_residencies/index.d.ts.map +0 -1
- package/dist/services/tax_residencies/index.js +0 -11
- package/dist/services/tax_residencies/service.d.ts +0 -6
- package/dist/services/tax_residencies/service.d.ts.map +0 -1
- package/dist/services/tax_residencies/service.js +0 -20
- package/dist/services/tax_residencies/types.d.ts +0 -26
- package/dist/services/tax_residencies/types.d.ts.map +0 -1
- package/dist/services/tax_residencies/types.js +0 -4
- package/dist/services/tax_residencies/utils.d.ts +0 -9
- package/dist/services/tax_residencies/utils.d.ts.map +0 -1
- package/dist/services/tax_residencies/utils.js +0 -19
- package/dist/services/trades/constants.d.ts +0 -47
- package/dist/services/trades/constants.d.ts.map +0 -1
- package/dist/services/trades/constants.js +0 -61
- package/dist/services/trades/index.d.ts +0 -4
- package/dist/services/trades/index.d.ts.map +0 -1
- package/dist/services/trades/index.js +0 -12
- package/dist/services/trades/service.d.ts +0 -19
- package/dist/services/trades/service.d.ts.map +0 -1
- package/dist/services/trades/service.js +0 -177
- package/dist/services/trades/types.d.ts +0 -114
- package/dist/services/trades/types.d.ts.map +0 -1
- package/dist/services/trades/types.js +0 -1
- package/dist/services/users/constants.d.ts +0 -7
- package/dist/services/users/constants.d.ts.map +0 -1
- package/dist/services/users/constants.js +0 -8
- package/dist/services/users/index.d.ts +0 -9
- package/dist/services/users/index.d.ts.map +0 -1
- package/dist/services/users/index.js +0 -9
- package/dist/services/users/investment_preferences/constants.d.ts +0 -7
- package/dist/services/users/investment_preferences/constants.d.ts.map +0 -1
- package/dist/services/users/investment_preferences/constants.js +0 -7
- package/dist/services/users/investment_preferences/index.d.ts +0 -7
- package/dist/services/users/investment_preferences/index.d.ts.map +0 -1
- package/dist/services/users/investment_preferences/index.js +0 -6
- package/dist/services/users/investment_preferences/service.d.ts +0 -5
- package/dist/services/users/investment_preferences/service.d.ts.map +0 -1
- package/dist/services/users/investment_preferences/service.js +0 -12
- package/dist/services/users/investment_preferences/types.d.ts +0 -23
- package/dist/services/users/investment_preferences/types.d.ts.map +0 -1
- package/dist/services/users/investment_preferences/types.js +0 -1
- package/dist/services/users/service.d.ts +0 -6
- package/dist/services/users/service.d.ts.map +0 -1
- package/dist/services/users/service.js +0 -15
- package/dist/services/users/types.d.ts +0 -32
- package/dist/services/users/types.d.ts.map +0 -1
- package/dist/services/users/types.js +0 -1
- package/dist/services/users/utils.d.ts +0 -2
- package/dist/services/users/utils.d.ts.map +0 -1
- package/dist/services/users/utils.js +0 -6
- package/dist/services/withdrawals/constants.d.ts +0 -67
- package/dist/services/withdrawals/constants.d.ts.map +0 -1
- package/dist/services/withdrawals/constants.js +0 -91
- package/dist/services/withdrawals/index.d.ts +0 -6
- package/dist/services/withdrawals/index.d.ts.map +0 -1
- package/dist/services/withdrawals/index.js +0 -7
- package/dist/services/withdrawals/service.d.ts +0 -4
- package/dist/services/withdrawals/service.d.ts.map +0 -1
- package/dist/services/withdrawals/service.js +0 -5
- package/dist/services/withdrawals/types.d.ts +0 -81
- package/dist/services/withdrawals/types.d.ts.map +0 -1
- package/dist/services/withdrawals/types.js +0 -1
- package/dist/services/withdrawals/utils.d.ts +0 -20
- package/dist/services/withdrawals/utils.d.ts.map +0 -1
- package/dist/services/withdrawals/utils.js +0 -110
- package/dist/services/withdrawals/withdrawal_liquidations/index.d.ts +0 -3
- package/dist/services/withdrawals/withdrawal_liquidations/index.d.ts.map +0 -1
- package/dist/services/withdrawals/withdrawal_liquidations/index.js +0 -2
- package/dist/services/withdrawals/withdrawal_liquidations/service.d.ts +0 -8
- package/dist/services/withdrawals/withdrawal_liquidations/service.d.ts.map +0 -1
- package/dist/services/withdrawals/withdrawal_liquidations/service.js +0 -68
- package/dist/services/withdrawals/withdrawal_liquidations/types.d.ts +0 -2
- package/dist/services/withdrawals/withdrawal_liquidations/types.d.ts.map +0 -1
- package/dist/services/withdrawals/withdrawal_liquidations/types.js +0 -1
- package/dist/services/withdrawals/withdrawal_requests/index.d.ts +0 -3
- package/dist/services/withdrawals/withdrawal_requests/index.d.ts.map +0 -1
- package/dist/services/withdrawals/withdrawal_requests/index.js +0 -2
- package/dist/services/withdrawals/withdrawal_requests/service.d.ts +0 -7
- package/dist/services/withdrawals/withdrawal_requests/service.d.ts.map +0 -1
- package/dist/services/withdrawals/withdrawal_requests/service.js +0 -55
- package/dist/services/withdrawals/withdrawal_requests/types.d.ts +0 -2
- package/dist/services/withdrawals/withdrawal_requests/types.d.ts.map +0 -1
- package/dist/services/withdrawals/withdrawal_requests/types.js +0 -1
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_TOKEN_REFRESH_BUFFER_MINUTES, MILLISECONDS_PER_MINUTE, MINUTES_PER_HOUR, HOURS_PER_DAY, TIME_LABEL_EXPIRED, TIME_LABEL_MINUTE, TIME_LABEL_MINUTES, TIME_LABEL_HOUR, TIME_LABEL_HOURS, TIME_LABEL_DAY, TIME_LABEL_DAYS, DEFAULT_UNKNOWN_VALUE, DEFAULT_ERROR_MESSAGE, } from './constants';
|
|
2
|
-
/**
|
|
3
|
-
* Check if a token has expired based on its expiration timestamp
|
|
4
|
-
*/
|
|
5
|
-
export const isTokenExpired = (expiresAt) => {
|
|
6
|
-
const expirationTime = new Date(expiresAt).getTime();
|
|
7
|
-
const currentTime = Date.now();
|
|
8
|
-
return currentTime >= expirationTime;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Check if a token will expire within a specified number of minutes
|
|
12
|
-
*/
|
|
13
|
-
export const isTokenExpiringSoon = (expiresAt, minutesBeforeExpiry = DEFAULT_TOKEN_REFRESH_BUFFER_MINUTES) => {
|
|
14
|
-
const expirationTime = new Date(expiresAt).getTime();
|
|
15
|
-
const currentTime = Date.now();
|
|
16
|
-
const bufferTime = minutesBeforeExpiry * MILLISECONDS_PER_MINUTE;
|
|
17
|
-
return currentTime + bufferTime >= expirationTime;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Get the remaining time until token expiry in minutes
|
|
21
|
-
*/
|
|
22
|
-
export const getTimeUntilExpiry = (expiresAt) => {
|
|
23
|
-
const expirationTime = new Date(expiresAt).getTime();
|
|
24
|
-
const currentTime = Date.now();
|
|
25
|
-
const remainingTime = expirationTime - currentTime;
|
|
26
|
-
if (remainingTime <= 0) {
|
|
27
|
-
return 0;
|
|
28
|
-
}
|
|
29
|
-
return Math.floor(remainingTime / MILLISECONDS_PER_MINUTE);
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Format the time until expiry in a human-readable format
|
|
33
|
-
*/
|
|
34
|
-
export const formatTimeUntilExpiry = (expiresAt) => {
|
|
35
|
-
const minutesRemaining = getTimeUntilExpiry(expiresAt);
|
|
36
|
-
if (minutesRemaining <= 0) {
|
|
37
|
-
return TIME_LABEL_EXPIRED;
|
|
38
|
-
}
|
|
39
|
-
if (minutesRemaining < MINUTES_PER_HOUR) {
|
|
40
|
-
return minutesRemaining === 1 ? `1 ${TIME_LABEL_MINUTE}` : `${minutesRemaining} ${TIME_LABEL_MINUTES}`;
|
|
41
|
-
}
|
|
42
|
-
const hoursRemaining = Math.floor(minutesRemaining / MINUTES_PER_HOUR);
|
|
43
|
-
if (hoursRemaining < HOURS_PER_DAY) {
|
|
44
|
-
return hoursRemaining === 1 ? `1 ${TIME_LABEL_HOUR}` : `${hoursRemaining} ${TIME_LABEL_HOURS}`;
|
|
45
|
-
}
|
|
46
|
-
const daysRemaining = Math.floor(hoursRemaining / HOURS_PER_DAY);
|
|
47
|
-
return daysRemaining === 1 ? `1 ${TIME_LABEL_DAY}` : `${daysRemaining} ${TIME_LABEL_DAYS}`;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Parse device information from user agent string
|
|
51
|
-
*/
|
|
52
|
-
export const parseDeviceInfo = (userAgent) => {
|
|
53
|
-
const browser = userAgent.includes('Chrome')
|
|
54
|
-
? 'Chrome'
|
|
55
|
-
: userAgent.includes('Firefox')
|
|
56
|
-
? 'Firefox'
|
|
57
|
-
: userAgent.includes('Safari')
|
|
58
|
-
? 'Safari'
|
|
59
|
-
: userAgent.includes('Edge')
|
|
60
|
-
? 'Edge'
|
|
61
|
-
: DEFAULT_UNKNOWN_VALUE;
|
|
62
|
-
const os = userAgent.includes('Windows')
|
|
63
|
-
? 'Windows'
|
|
64
|
-
: userAgent.includes('Mac')
|
|
65
|
-
? 'macOS'
|
|
66
|
-
: userAgent.includes('Linux')
|
|
67
|
-
? 'Linux'
|
|
68
|
-
: userAgent.includes('Android')
|
|
69
|
-
? 'Android'
|
|
70
|
-
: userAgent.includes('iOS')
|
|
71
|
-
? 'iOS'
|
|
72
|
-
: DEFAULT_UNKNOWN_VALUE;
|
|
73
|
-
return { browser, os };
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Check if token refresh was successful
|
|
77
|
-
*/
|
|
78
|
-
export const isRefreshSuccess = (response) => {
|
|
79
|
-
return !!(response?.status === 200 && response?.data?.access && response?.data?.refresh);
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Get error message from token refresh error
|
|
83
|
-
*/
|
|
84
|
-
export const getRefreshErrorMessage = (error) => {
|
|
85
|
-
if (error.response?.data?.detail) {
|
|
86
|
-
return error.response.data.detail;
|
|
87
|
-
}
|
|
88
|
-
if (error.response?.data?.message) {
|
|
89
|
-
return error.response.data.message;
|
|
90
|
-
}
|
|
91
|
-
if (error.message) {
|
|
92
|
-
return error.message;
|
|
93
|
-
}
|
|
94
|
-
return DEFAULT_ERROR_MESSAGE;
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Create an auto-refresh handler for tokens
|
|
98
|
-
*/
|
|
99
|
-
export const createAutoRefreshHandler = (refreshCallback, checkInterval = 60000) => {
|
|
100
|
-
let intervalId = null;
|
|
101
|
-
const start = () => {
|
|
102
|
-
if (intervalId)
|
|
103
|
-
return;
|
|
104
|
-
intervalId = setInterval(refreshCallback, checkInterval);
|
|
105
|
-
};
|
|
106
|
-
const stop = () => {
|
|
107
|
-
if (intervalId) {
|
|
108
|
-
clearInterval(intervalId);
|
|
109
|
-
intervalId = null;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
return { start, stop };
|
|
113
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bank account constants.
|
|
3
|
-
*/
|
|
4
|
-
export declare const BANK_ACCOUNT_STATUS_PRIMARY = "primary";
|
|
5
|
-
export declare const BANK_ACCOUNT_STATUS_VERIFIED = "verified";
|
|
6
|
-
export declare const BANK_ACCOUNT_STATUS_UNVERIFIED = "unverified";
|
|
7
|
-
export declare const BANK_ACCOUNT_STATUS_INACTIVE = "inactive";
|
|
8
|
-
export declare const BANK_ACCOUNT_STATUS_LABEL_PRIMARY = "Primary";
|
|
9
|
-
export declare const BANK_ACCOUNT_STATUS_LABEL_VERIFIED = "Verified";
|
|
10
|
-
export declare const BANK_ACCOUNT_STATUS_LABEL_UNVERIFIED = "Unverified";
|
|
11
|
-
export declare const BANK_ACCOUNT_STATUS_LABEL_INACTIVE = "Inactive";
|
|
12
|
-
export declare const BANK_ACCOUNT_STATUS_OPTIONS: {
|
|
13
|
-
value: string;
|
|
14
|
-
label: string;
|
|
15
|
-
}[];
|
|
16
|
-
export declare const BANK_ACCOUNT_TYPE_SAVINGS = "savings";
|
|
17
|
-
export declare const BANK_ACCOUNT_TYPE_CHECKING = "checking";
|
|
18
|
-
export declare const BANK_ACCOUNT_TYPE_TRANSACTION = "transaction";
|
|
19
|
-
export declare const BANK_ACCOUNT_TYPE_TERM_DEPOSIT = "term_deposit";
|
|
20
|
-
export declare const BANK_ACCOUNT_TYPE_OFFSET = "offset";
|
|
21
|
-
export declare const BANK_ACCOUNT_TYPE_LABEL_SAVINGS = "Savings Account";
|
|
22
|
-
export declare const BANK_ACCOUNT_TYPE_LABEL_CHECKING = "Checking Account";
|
|
23
|
-
export declare const BANK_ACCOUNT_TYPE_LABEL_TRANSACTION = "Transaction Account";
|
|
24
|
-
export declare const BANK_ACCOUNT_TYPE_LABEL_TERM_DEPOSIT = "Term Deposit";
|
|
25
|
-
export declare const BANK_ACCOUNT_TYPE_LABEL_OFFSET = "Offset Account";
|
|
26
|
-
export declare const BANK_ACCOUNT_TYPE_DESC_SAVINGS = "Interest-bearing savings account";
|
|
27
|
-
export declare const BANK_ACCOUNT_TYPE_DESC_CHECKING = "Everyday checking account";
|
|
28
|
-
export declare const BANK_ACCOUNT_TYPE_DESC_TRANSACTION = "Daily transaction account";
|
|
29
|
-
export declare const BANK_ACCOUNT_TYPE_DESC_TERM_DEPOSIT = "Fixed-term deposit account";
|
|
30
|
-
export declare const BANK_ACCOUNT_TYPE_DESC_OFFSET = "Mortgage offset account";
|
|
31
|
-
export declare const BANK_ACCOUNT_TYPE_OPTIONS: {
|
|
32
|
-
value: string;
|
|
33
|
-
label: string;
|
|
34
|
-
description: string;
|
|
35
|
-
}[];
|
|
36
|
-
export type AccountType = typeof BANK_ACCOUNT_TYPE_SAVINGS | typeof BANK_ACCOUNT_TYPE_CHECKING | typeof BANK_ACCOUNT_TYPE_TRANSACTION | typeof BANK_ACCOUNT_TYPE_TERM_DEPOSIT | typeof BANK_ACCOUNT_TYPE_OFFSET;
|
|
37
|
-
export interface AccountTypeInfo {
|
|
38
|
-
code: AccountType;
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
}
|
|
42
|
-
export declare const ACCOUNT_TYPES: AccountTypeInfo[];
|
|
43
|
-
export declare const getAccountTypeInfo: (code: AccountType) => AccountTypeInfo | undefined;
|
|
44
|
-
export declare const API_ENDPOINTS: {
|
|
45
|
-
readonly BANK_ACCOUNTS: "/api/bank-accounts/";
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/banks/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,4BAA4B,aAAa,CAAC;AACvD,eAAO,MAAM,8BAA8B,eAAe,CAAC;AAC3D,eAAO,MAAM,4BAA4B,aAAa,CAAC;AAGvD,eAAO,MAAM,iCAAiC,YAAY,CAAC;AAC3D,eAAO,MAAM,kCAAkC,aAAa,CAAC;AAC7D,eAAO,MAAM,oCAAoC,eAAe,CAAC;AACjE,eAAO,MAAM,kCAAkC,aAAa,CAAC;AAG7D,eAAO,MAAM,2BAA2B;;;GAKvC,CAAC;AAGF,eAAO,MAAM,yBAAyB,YAAY,CAAC;AACnD,eAAO,MAAM,0BAA0B,aAAa,CAAC;AACrD,eAAO,MAAM,6BAA6B,gBAAgB,CAAC;AAC3D,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAC7D,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAGjD,eAAO,MAAM,+BAA+B,oBAAoB,CAAC;AACjE,eAAO,MAAM,gCAAgC,qBAAqB,CAAC;AACnE,eAAO,MAAM,mCAAmC,wBAAwB,CAAC;AACzE,eAAO,MAAM,oCAAoC,iBAAiB,CAAC;AACnE,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAG/D,eAAO,MAAM,8BAA8B,qCAAqC,CAAC;AACjF,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAC3E,eAAO,MAAM,kCAAkC,8BAA8B,CAAC;AAC9E,eAAO,MAAM,mCAAmC,+BAA+B,CAAC;AAChF,eAAO,MAAM,6BAA6B,4BAA4B,CAAC;AAGvE,eAAO,MAAM,yBAAyB;;;;GA0BrC,CAAC;AAGF,MAAM,MAAM,WAAW,GACnB,OAAO,yBAAyB,GAChC,OAAO,0BAA0B,GACjC,OAAO,6BAA6B,GACpC,OAAO,8BAA8B,GACrC,OAAO,wBAAwB,CAAC;AAGpC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,eAAO,MAAM,aAAa,EAAE,eAAe,EAsB1C,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,MAAM,WAAW,KAAG,eAAe,GAAG,SAExE,CAAC;AAGF,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bank account constants.
|
|
3
|
-
*/
|
|
4
|
-
// Bank Account Status constants (frontend-specific)
|
|
5
|
-
export const BANK_ACCOUNT_STATUS_PRIMARY = 'primary';
|
|
6
|
-
export const BANK_ACCOUNT_STATUS_VERIFIED = 'verified';
|
|
7
|
-
export const BANK_ACCOUNT_STATUS_UNVERIFIED = 'unverified';
|
|
8
|
-
export const BANK_ACCOUNT_STATUS_INACTIVE = 'inactive';
|
|
9
|
-
// Bank Account Status label constants
|
|
10
|
-
export const BANK_ACCOUNT_STATUS_LABEL_PRIMARY = 'Primary';
|
|
11
|
-
export const BANK_ACCOUNT_STATUS_LABEL_VERIFIED = 'Verified';
|
|
12
|
-
export const BANK_ACCOUNT_STATUS_LABEL_UNVERIFIED = 'Unverified';
|
|
13
|
-
export const BANK_ACCOUNT_STATUS_LABEL_INACTIVE = 'Inactive';
|
|
14
|
-
// Bank Account Status options
|
|
15
|
-
export const BANK_ACCOUNT_STATUS_OPTIONS = [
|
|
16
|
-
{ value: BANK_ACCOUNT_STATUS_PRIMARY, label: BANK_ACCOUNT_STATUS_LABEL_PRIMARY },
|
|
17
|
-
{ value: BANK_ACCOUNT_STATUS_VERIFIED, label: BANK_ACCOUNT_STATUS_LABEL_VERIFIED },
|
|
18
|
-
{ value: BANK_ACCOUNT_STATUS_UNVERIFIED, label: BANK_ACCOUNT_STATUS_LABEL_UNVERIFIED },
|
|
19
|
-
{ value: BANK_ACCOUNT_STATUS_INACTIVE, label: BANK_ACCOUNT_STATUS_LABEL_INACTIVE },
|
|
20
|
-
];
|
|
21
|
-
// Bank Account Type constants matching backend choices
|
|
22
|
-
export const BANK_ACCOUNT_TYPE_SAVINGS = 'savings';
|
|
23
|
-
export const BANK_ACCOUNT_TYPE_CHECKING = 'checking';
|
|
24
|
-
export const BANK_ACCOUNT_TYPE_TRANSACTION = 'transaction';
|
|
25
|
-
export const BANK_ACCOUNT_TYPE_TERM_DEPOSIT = 'term_deposit';
|
|
26
|
-
export const BANK_ACCOUNT_TYPE_OFFSET = 'offset';
|
|
27
|
-
// Bank Account Type label constants
|
|
28
|
-
export const BANK_ACCOUNT_TYPE_LABEL_SAVINGS = 'Savings Account';
|
|
29
|
-
export const BANK_ACCOUNT_TYPE_LABEL_CHECKING = 'Checking Account';
|
|
30
|
-
export const BANK_ACCOUNT_TYPE_LABEL_TRANSACTION = 'Transaction Account';
|
|
31
|
-
export const BANK_ACCOUNT_TYPE_LABEL_TERM_DEPOSIT = 'Term Deposit';
|
|
32
|
-
export const BANK_ACCOUNT_TYPE_LABEL_OFFSET = 'Offset Account';
|
|
33
|
-
// Bank Account Type descriptions
|
|
34
|
-
export const BANK_ACCOUNT_TYPE_DESC_SAVINGS = 'Interest-bearing savings account';
|
|
35
|
-
export const BANK_ACCOUNT_TYPE_DESC_CHECKING = 'Everyday checking account';
|
|
36
|
-
export const BANK_ACCOUNT_TYPE_DESC_TRANSACTION = 'Daily transaction account';
|
|
37
|
-
export const BANK_ACCOUNT_TYPE_DESC_TERM_DEPOSIT = 'Fixed-term deposit account';
|
|
38
|
-
export const BANK_ACCOUNT_TYPE_DESC_OFFSET = 'Mortgage offset account';
|
|
39
|
-
// Bank Account Type options
|
|
40
|
-
export const BANK_ACCOUNT_TYPE_OPTIONS = [
|
|
41
|
-
{
|
|
42
|
-
value: BANK_ACCOUNT_TYPE_SAVINGS,
|
|
43
|
-
label: BANK_ACCOUNT_TYPE_LABEL_SAVINGS,
|
|
44
|
-
description: BANK_ACCOUNT_TYPE_DESC_SAVINGS,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
value: BANK_ACCOUNT_TYPE_CHECKING,
|
|
48
|
-
label: BANK_ACCOUNT_TYPE_LABEL_CHECKING,
|
|
49
|
-
description: BANK_ACCOUNT_TYPE_DESC_CHECKING,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
value: BANK_ACCOUNT_TYPE_TRANSACTION,
|
|
53
|
-
label: BANK_ACCOUNT_TYPE_LABEL_TRANSACTION,
|
|
54
|
-
description: BANK_ACCOUNT_TYPE_DESC_TRANSACTION,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: BANK_ACCOUNT_TYPE_TERM_DEPOSIT,
|
|
58
|
-
label: BANK_ACCOUNT_TYPE_LABEL_TERM_DEPOSIT,
|
|
59
|
-
description: BANK_ACCOUNT_TYPE_DESC_TERM_DEPOSIT,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
value: BANK_ACCOUNT_TYPE_OFFSET,
|
|
63
|
-
label: BANK_ACCOUNT_TYPE_LABEL_OFFSET,
|
|
64
|
-
description: BANK_ACCOUNT_TYPE_DESC_OFFSET,
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
// Available account types with display information
|
|
68
|
-
export const ACCOUNT_TYPES = [
|
|
69
|
-
{
|
|
70
|
-
code: BANK_ACCOUNT_TYPE_SAVINGS,
|
|
71
|
-
name: BANK_ACCOUNT_TYPE_LABEL_SAVINGS,
|
|
72
|
-
description: BANK_ACCOUNT_TYPE_DESC_SAVINGS,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
code: BANK_ACCOUNT_TYPE_CHECKING,
|
|
76
|
-
name: BANK_ACCOUNT_TYPE_LABEL_CHECKING,
|
|
77
|
-
description: BANK_ACCOUNT_TYPE_DESC_CHECKING,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
code: BANK_ACCOUNT_TYPE_TRANSACTION,
|
|
81
|
-
name: BANK_ACCOUNT_TYPE_LABEL_TRANSACTION,
|
|
82
|
-
description: BANK_ACCOUNT_TYPE_DESC_TRANSACTION,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
code: BANK_ACCOUNT_TYPE_TERM_DEPOSIT,
|
|
86
|
-
name: BANK_ACCOUNT_TYPE_LABEL_TERM_DEPOSIT,
|
|
87
|
-
description: BANK_ACCOUNT_TYPE_DESC_TERM_DEPOSIT,
|
|
88
|
-
},
|
|
89
|
-
{ code: BANK_ACCOUNT_TYPE_OFFSET, name: BANK_ACCOUNT_TYPE_LABEL_OFFSET, description: BANK_ACCOUNT_TYPE_DESC_OFFSET },
|
|
90
|
-
];
|
|
91
|
-
// Helper function to get account type info by code
|
|
92
|
-
export const getAccountTypeInfo = (code) => {
|
|
93
|
-
return ACCOUNT_TYPES.find((type) => type.code === code);
|
|
94
|
-
};
|
|
95
|
-
// API Endpoints
|
|
96
|
-
export const API_ENDPOINTS = {
|
|
97
|
-
BANK_ACCOUNTS: '/api/bank-accounts/',
|
|
98
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/banks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,mBAAmB,SAAS,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGvD,cAAc,aAAa,CAAC;AAG5B,cAAc,WAAW,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bank account API service functions.
|
|
3
|
-
*/
|
|
4
|
-
import type { PaginatedResponse } from '../../api/types';
|
|
5
|
-
import type { BankAccount, BankAccountQueryParams } from './types';
|
|
6
|
-
export type PaginatedBankAccounts = PaginatedResponse<BankAccount>;
|
|
7
|
-
export declare const getBankAccounts: (params?: BankAccountQueryParams) => Promise<import("axios").AxiosResponse<PaginatedBankAccounts, any>>;
|
|
8
|
-
export declare const getBankAccountByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<BankAccount, any>>;
|
|
9
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/banks/service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEnE,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEnE,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,uEA+B9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,6DAEhD,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bank account API service functions.
|
|
3
|
-
*/
|
|
4
|
-
import { webApiClient } from '../../api/apiClient';
|
|
5
|
-
import { API_ENDPOINTS } from './constants';
|
|
6
|
-
export const getBankAccounts = (params) => {
|
|
7
|
-
const queryParams = {};
|
|
8
|
-
if (params?.account) {
|
|
9
|
-
queryParams.account = params.account;
|
|
10
|
-
}
|
|
11
|
-
if (params?.bankName) {
|
|
12
|
-
queryParams.bank_name = params.bankName;
|
|
13
|
-
}
|
|
14
|
-
if (params?.accountType) {
|
|
15
|
-
queryParams.account_type = params.accountType;
|
|
16
|
-
}
|
|
17
|
-
if (params?.currency) {
|
|
18
|
-
queryParams.currency = params.currency;
|
|
19
|
-
}
|
|
20
|
-
if (params?.isVerified !== undefined) {
|
|
21
|
-
queryParams.is_verified = params.isVerified.toString();
|
|
22
|
-
}
|
|
23
|
-
if (params?.isPrimary !== undefined) {
|
|
24
|
-
queryParams.is_primary = params.isPrimary.toString();
|
|
25
|
-
}
|
|
26
|
-
if (params?.isActive !== undefined) {
|
|
27
|
-
queryParams.is_active = params.isActive.toString();
|
|
28
|
-
}
|
|
29
|
-
if (params?.ordering) {
|
|
30
|
-
queryParams.ordering = params.ordering;
|
|
31
|
-
}
|
|
32
|
-
return webApiClient.get(API_ENDPOINTS.BANK_ACCOUNTS, {
|
|
33
|
-
params: queryParams,
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
export const getBankAccountByUuid = (uuid) => {
|
|
37
|
-
return webApiClient.get(`${API_ENDPOINTS.BANK_ACCOUNTS}${uuid}/`);
|
|
38
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bank account types and interfaces.
|
|
3
|
-
*/
|
|
4
|
-
import type { AccountType } from './constants';
|
|
5
|
-
export type CurrencyCode = 'AUD' | 'USD';
|
|
6
|
-
export interface BankAccount {
|
|
7
|
-
uuid: string;
|
|
8
|
-
account: string;
|
|
9
|
-
bankName: string;
|
|
10
|
-
branchName?: string;
|
|
11
|
-
accountNumber: string;
|
|
12
|
-
bsb: string;
|
|
13
|
-
accountName: string;
|
|
14
|
-
accountType: AccountType;
|
|
15
|
-
currency: CurrencyCode;
|
|
16
|
-
swiftCode?: string;
|
|
17
|
-
iban?: string;
|
|
18
|
-
isVerified: boolean;
|
|
19
|
-
verificationDate?: string;
|
|
20
|
-
isPrimary: boolean;
|
|
21
|
-
isActive: boolean;
|
|
22
|
-
notes?: string;
|
|
23
|
-
createdAt: string;
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
}
|
|
26
|
-
export interface BankAccountQueryParams {
|
|
27
|
-
account?: string;
|
|
28
|
-
bankName?: string;
|
|
29
|
-
accountType?: AccountType;
|
|
30
|
-
currency?: CurrencyCode;
|
|
31
|
-
isVerified?: boolean;
|
|
32
|
-
isPrimary?: boolean;
|
|
33
|
-
isActive?: boolean;
|
|
34
|
-
ordering?: string;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/banks/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,CAAC;AAEzC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/cash_accounts/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { CashAccount, CashAccountQueryParams, CurrencyCode, PaginatedCashAccounts, } from './types';
|
|
2
|
-
export { getCashAccounts, getCashAccountByUuid, getAccountCashAccounts, } from './service';
|
|
3
|
-
export { API_ENDPOINTS } from './constants';
|
|
4
|
-
export * as Transactions from './transactions';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/cash_accounts/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,sBAAsB,EACtB,YAAY,EACZ,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Export service functions
|
|
2
|
-
export { getCashAccounts, getCashAccountByUuid, getAccountCashAccounts, } from './service';
|
|
3
|
-
// Export constants
|
|
4
|
-
export { API_ENDPOINTS } from './constants';
|
|
5
|
-
// Export transactions sub-service as namespace
|
|
6
|
-
export * as Transactions from './transactions';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cash account API service functions.
|
|
3
|
-
*/
|
|
4
|
-
import type { CashAccount, CashAccountQueryParams, PaginatedCashAccounts } from './types';
|
|
5
|
-
export declare const getCashAccounts: (params?: CashAccountQueryParams) => Promise<import("axios").AxiosResponse<PaginatedCashAccounts, any>>;
|
|
6
|
-
export declare const getCashAccountByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<CashAccount, any>>;
|
|
7
|
-
export declare const getAccountCashAccounts: (accountUuid: string) => Promise<import("axios").AxiosResponse<PaginatedCashAccounts, any>>;
|
|
8
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/cash_accounts/service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAE1F,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,uEAsB9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,6DAEhD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,uEAEzD,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cash account API service functions.
|
|
3
|
-
*/
|
|
4
|
-
import { webApiClient } from '../../api/apiClient';
|
|
5
|
-
import { API_ENDPOINTS } from './constants';
|
|
6
|
-
export const getCashAccounts = (params) => {
|
|
7
|
-
const queryParams = {};
|
|
8
|
-
if (params?.account) {
|
|
9
|
-
queryParams.account = params.account;
|
|
10
|
-
}
|
|
11
|
-
if (params?.currency) {
|
|
12
|
-
queryParams.currency = params.currency;
|
|
13
|
-
}
|
|
14
|
-
if (params?.minBalance !== undefined) {
|
|
15
|
-
queryParams.min_balance = params.minBalance.toString();
|
|
16
|
-
}
|
|
17
|
-
if (params?.maxBalance !== undefined) {
|
|
18
|
-
queryParams.max_balance = params.maxBalance.toString();
|
|
19
|
-
}
|
|
20
|
-
if (params?.ordering) {
|
|
21
|
-
queryParams.ordering = params.ordering;
|
|
22
|
-
}
|
|
23
|
-
return webApiClient.get(API_ENDPOINTS.CASH_ACCOUNTS, {
|
|
24
|
-
params: queryParams,
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
export const getCashAccountByUuid = (uuid) => {
|
|
28
|
-
return webApiClient.get(`${API_ENDPOINTS.CASH_ACCOUNTS}${uuid}/`);
|
|
29
|
-
};
|
|
30
|
-
export const getAccountCashAccounts = (accountUuid) => {
|
|
31
|
-
return getCashAccounts({ account: accountUuid });
|
|
32
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cash account transaction constants.
|
|
3
|
-
*/
|
|
4
|
-
export declare const TRANSACTION_TYPE_LABEL_DEPOSIT = "Deposit";
|
|
5
|
-
export declare const TRANSACTION_TYPE_LABEL_WITHDRAWAL = "Withdrawal";
|
|
6
|
-
export declare const TRANSACTION_TYPE_LABEL_TRADE_SETTLEMENT = "Trade Settlement";
|
|
7
|
-
export declare const TRANSACTION_TYPE_LABEL_DISTRIBUTION = "Distribution";
|
|
8
|
-
export declare const TRANSACTION_TYPE_LABEL_FEE = "Fee";
|
|
9
|
-
export declare const TRANSACTION_TYPE_LABEL_INTEREST = "Interest";
|
|
10
|
-
export declare const TRANSACTION_TYPE_LABEL_OTHER = "Adjustment";
|
|
11
|
-
export declare const TRANSACTION_TYPE_OPTIONS: {
|
|
12
|
-
value: string;
|
|
13
|
-
label: string;
|
|
14
|
-
}[];
|
|
15
|
-
export declare const API_ENDPOINTS: {
|
|
16
|
-
readonly CASH_ACCOUNT_TRANSACTIONS: "/api/cash-account-transactions/";
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/services/cash_accounts/transactions/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,8BAA8B,YAAY,CAAC;AACxD,eAAO,MAAM,iCAAiC,eAAe,CAAC;AAC9D,eAAO,MAAM,uCAAuC,qBAAqB,CAAC;AAC1E,eAAO,MAAM,mCAAmC,iBAAiB,CAAC;AAClE,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAChD,eAAO,MAAM,+BAA+B,aAAa,CAAC;AAC1D,eAAO,MAAM,4BAA4B,eAAe,CAAC;AAGzD,eAAO,MAAM,wBAAwB;;;GAQpC,CAAC;AAGF,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cash account transaction constants.
|
|
3
|
-
*/
|
|
4
|
-
// Transaction Type label constants
|
|
5
|
-
export const TRANSACTION_TYPE_LABEL_DEPOSIT = 'Deposit';
|
|
6
|
-
export const TRANSACTION_TYPE_LABEL_WITHDRAWAL = 'Withdrawal';
|
|
7
|
-
export const TRANSACTION_TYPE_LABEL_TRADE_SETTLEMENT = 'Trade Settlement';
|
|
8
|
-
export const TRANSACTION_TYPE_LABEL_DISTRIBUTION = 'Distribution';
|
|
9
|
-
export const TRANSACTION_TYPE_LABEL_FEE = 'Fee';
|
|
10
|
-
export const TRANSACTION_TYPE_LABEL_INTEREST = 'Interest';
|
|
11
|
-
export const TRANSACTION_TYPE_LABEL_OTHER = 'Adjustment';
|
|
12
|
-
// Transaction Type options
|
|
13
|
-
export const TRANSACTION_TYPE_OPTIONS = [
|
|
14
|
-
{ value: 'DEPOSIT', label: TRANSACTION_TYPE_LABEL_DEPOSIT },
|
|
15
|
-
{ value: 'WITHDRAWAL', label: TRANSACTION_TYPE_LABEL_WITHDRAWAL },
|
|
16
|
-
{ value: 'TRADE_SETTLEMENT', label: TRANSACTION_TYPE_LABEL_TRADE_SETTLEMENT },
|
|
17
|
-
{ value: 'DISTRIBUTION', label: TRANSACTION_TYPE_LABEL_DISTRIBUTION },
|
|
18
|
-
{ value: 'FEE', label: TRANSACTION_TYPE_LABEL_FEE },
|
|
19
|
-
{ value: 'INTEREST', label: TRANSACTION_TYPE_LABEL_INTEREST },
|
|
20
|
-
{ value: 'OTHER', label: TRANSACTION_TYPE_LABEL_OTHER },
|
|
21
|
-
];
|
|
22
|
-
// API Endpoints
|
|
23
|
-
export const API_ENDPOINTS = {
|
|
24
|
-
CASH_ACCOUNT_TRANSACTIONS: '/api/cash-account-transactions/',
|
|
25
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { CashAccountTransaction, CashAccountTransactionQueryParams, TransactionSummary, TransactionType, PaginatedCashAccountTransactions, } from './types';
|
|
2
|
-
export { TRANSACTION_TYPE_DEPOSIT, TRANSACTION_TYPE_WITHDRAWAL, TRANSACTION_TYPE_TRADE_SETTLEMENT, TRANSACTION_TYPE_DISTRIBUTION, TRANSACTION_TYPE_FEE, TRANSACTION_TYPE_INTEREST, TRANSACTION_TYPE_OTHER, } from './types';
|
|
3
|
-
export { getCashAccountTransactions, getCashAccountTransactionByUuid, getCashAccountTransactionsByAccount, getTransactionsByDateRange, getRecentTransactions, getTransactionTypeLabel, formatTransactionAmount, } from './service';
|
|
4
|
-
export { TRANSACTION_TYPE_LABEL_DEPOSIT, TRANSACTION_TYPE_LABEL_WITHDRAWAL, TRANSACTION_TYPE_LABEL_TRADE_SETTLEMENT, TRANSACTION_TYPE_LABEL_DISTRIBUTION, TRANSACTION_TYPE_LABEL_FEE, TRANSACTION_TYPE_LABEL_INTEREST, TRANSACTION_TYPE_LABEL_OTHER, TRANSACTION_TYPE_OPTIONS, } from './constants';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/cash_accounts/transactions/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,sBAAsB,EACtB,iCAAiC,EACjC,kBAAkB,EAClB,eAAe,EACf,gCAAgC,GACjC,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,iCAAiC,EACjC,6BAA6B,EAC7B,oBAAoB,EACpB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,mCAAmC,EACnC,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,8BAA8B,EAC9B,iCAAiC,EACjC,uCAAuC,EACvC,mCAAmC,EACnC,0BAA0B,EAC1B,+BAA+B,EAC/B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Export type constants as values
|
|
2
|
-
export { TRANSACTION_TYPE_DEPOSIT, TRANSACTION_TYPE_WITHDRAWAL, TRANSACTION_TYPE_TRADE_SETTLEMENT, TRANSACTION_TYPE_DISTRIBUTION, TRANSACTION_TYPE_FEE, TRANSACTION_TYPE_INTEREST, TRANSACTION_TYPE_OTHER, } from './types';
|
|
3
|
-
// Export service functions
|
|
4
|
-
export { getCashAccountTransactions, getCashAccountTransactionByUuid, getCashAccountTransactionsByAccount, getTransactionsByDateRange, getRecentTransactions, getTransactionTypeLabel, formatTransactionAmount, } from './service';
|
|
5
|
-
// Export constants
|
|
6
|
-
export { TRANSACTION_TYPE_LABEL_DEPOSIT, TRANSACTION_TYPE_LABEL_WITHDRAWAL, TRANSACTION_TYPE_LABEL_TRADE_SETTLEMENT, TRANSACTION_TYPE_LABEL_DISTRIBUTION, TRANSACTION_TYPE_LABEL_FEE, TRANSACTION_TYPE_LABEL_INTEREST, TRANSACTION_TYPE_LABEL_OTHER, TRANSACTION_TYPE_OPTIONS, } from './constants';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cash account transaction API service functions.
|
|
3
|
-
*/
|
|
4
|
-
import type { CashAccountTransaction, CashAccountTransactionQueryParams, PaginatedCashAccountTransactions, TransactionType } from './types';
|
|
5
|
-
export declare const getCashAccountTransactions: (params?: CashAccountTransactionQueryParams) => Promise<import("axios").AxiosResponse<PaginatedCashAccountTransactions, any>>;
|
|
6
|
-
export declare const getCashAccountTransactionByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<CashAccountTransaction, any>>;
|
|
7
|
-
export declare const getCashAccountTransactionsByAccount: (cashAccountUuid: string, params?: Omit<CashAccountTransactionQueryParams, "cashAccount">) => Promise<import("axios").AxiosResponse<PaginatedCashAccountTransactions, any>>;
|
|
8
|
-
export declare const getTransactionsByDateRange: (startDate: string, endDate: string, params?: Omit<CashAccountTransactionQueryParams, "startDate" | "endDate">) => Promise<import("axios").AxiosResponse<PaginatedCashAccountTransactions, any>>;
|
|
9
|
-
export declare const getRecentTransactions: (days?: number, // Default to 30 days for recent transactions
|
|
10
|
-
params?: CashAccountTransactionQueryParams) => Promise<import("axios").AxiosResponse<PaginatedCashAccountTransactions, any>>;
|
|
11
|
-
export declare const getTransactionTypeLabel: (transactionType: TransactionType) => string;
|
|
12
|
-
export declare const formatTransactionAmount: (amount: string | number) => string;
|
|
13
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/cash_accounts/transactions/service.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,sBAAsB,EACtB,iCAAiC,EACjC,gCAAgC,EAChC,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B,GAAI,SAAS,iCAAiC,kFA4BpF,CAAC;AAEF,eAAO,MAAM,+BAA+B,GAAI,MAAM,MAAM,wEAE3D,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAC9C,iBAAiB,MAAM,EACvB,SAAS,IAAI,CAAC,iCAAiC,EAAE,aAAa,CAAC,kFAMhE,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,EACjB,SAAS,MAAM,EACf,SAAS,IAAI,CAAC,iCAAiC,EAAE,WAAW,GAAG,SAAS,CAAC,kFAO1E,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAM,MAAW,EAAE,6CAA6C;AAChE,SAAS,iCAAiC,kFAM3C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,iBAAiB,eAAe,KAAG,MAY1E,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,GAAG,MAAM,KAAG,MAQjE,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cash account transaction API service functions.
|
|
3
|
-
*/
|
|
4
|
-
import { webApiClient } from '../../../api/apiClient';
|
|
5
|
-
import { API_ENDPOINTS } from './constants';
|
|
6
|
-
export const getCashAccountTransactions = (params) => {
|
|
7
|
-
const queryParams = {};
|
|
8
|
-
if (params?.cashAccount) {
|
|
9
|
-
queryParams.cash_account = params.cashAccount;
|
|
10
|
-
}
|
|
11
|
-
if (params?.transactionType) {
|
|
12
|
-
queryParams.transaction_type = params.transactionType;
|
|
13
|
-
}
|
|
14
|
-
if (params?.startDate) {
|
|
15
|
-
queryParams.start_date = params.startDate;
|
|
16
|
-
}
|
|
17
|
-
if (params?.endDate) {
|
|
18
|
-
queryParams.end_date = params.endDate;
|
|
19
|
-
}
|
|
20
|
-
if (params?.minAmount !== undefined) {
|
|
21
|
-
queryParams.min_amount = params.minAmount.toString();
|
|
22
|
-
}
|
|
23
|
-
if (params?.maxAmount !== undefined) {
|
|
24
|
-
queryParams.max_amount = params.maxAmount.toString();
|
|
25
|
-
}
|
|
26
|
-
if (params?.orderBy) {
|
|
27
|
-
queryParams.order_by = params.orderBy;
|
|
28
|
-
}
|
|
29
|
-
return webApiClient.get(API_ENDPOINTS.CASH_ACCOUNT_TRANSACTIONS, {
|
|
30
|
-
params: queryParams,
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
export const getCashAccountTransactionByUuid = (uuid) => {
|
|
34
|
-
return webApiClient.get(`${API_ENDPOINTS.CASH_ACCOUNT_TRANSACTIONS}${uuid}/`);
|
|
35
|
-
};
|
|
36
|
-
export const getCashAccountTransactionsByAccount = (cashAccountUuid, params) => {
|
|
37
|
-
return getCashAccountTransactions({
|
|
38
|
-
...params,
|
|
39
|
-
cashAccount: cashAccountUuid,
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
export const getTransactionsByDateRange = (startDate, endDate, params) => {
|
|
43
|
-
return getCashAccountTransactions({
|
|
44
|
-
...params,
|
|
45
|
-
startDate,
|
|
46
|
-
endDate,
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
export const getRecentTransactions = (days = 30, // Default to 30 days for recent transactions
|
|
50
|
-
params) => {
|
|
51
|
-
const endDate = new Date().toISOString().split('T')[0];
|
|
52
|
-
const startDate = new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString().split('T')[0];
|
|
53
|
-
return getTransactionsByDateRange(startDate, endDate, params);
|
|
54
|
-
};
|
|
55
|
-
export const getTransactionTypeLabel = (transactionType) => {
|
|
56
|
-
const labels = {
|
|
57
|
-
DEPOSIT: 'Deposit',
|
|
58
|
-
WITHDRAWAL: 'Withdrawal',
|
|
59
|
-
TRADE_SETTLEMENT: 'Trade Settlement',
|
|
60
|
-
DISTRIBUTION: 'Distribution',
|
|
61
|
-
FEE: 'Fee',
|
|
62
|
-
INTEREST: 'Interest',
|
|
63
|
-
OTHER: 'Adjustment',
|
|
64
|
-
};
|
|
65
|
-
return labels[transactionType];
|
|
66
|
-
};
|
|
67
|
-
export const formatTransactionAmount = (amount) => {
|
|
68
|
-
const numAmount = typeof amount === 'string' ? parseFloat(amount) : amount;
|
|
69
|
-
// Using simple formatting for now - could be enhanced with proper currency formatting
|
|
70
|
-
return new Intl.NumberFormat('en-AU', {
|
|
71
|
-
style: 'currency',
|
|
72
|
-
currency: 'AUD',
|
|
73
|
-
signDisplay: 'exceptZero',
|
|
74
|
-
}).format(numAmount);
|
|
75
|
-
};
|