@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,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portfolio-related constants for shared services.
|
|
3
|
-
*
|
|
4
|
-
* These constants should match the backend constants in bilberry/portfolios/constants.py
|
|
5
|
-
* to ensure consistency across the application stack.
|
|
6
|
-
*/
|
|
7
|
-
export declare const INVESTMENT_HORIZON_SHORT = "short";
|
|
8
|
-
export declare const INVESTMENT_HORIZON_MEDIUM = "medium";
|
|
9
|
-
export declare const INVESTMENT_HORIZON_LONG = "long";
|
|
10
|
-
export declare const INVESTMENT_HORIZON_LABEL_SHORT = "Short-term (0\u20133 yrs)";
|
|
11
|
-
export declare const INVESTMENT_HORIZON_LABEL_MEDIUM = "Medium-term (3\u20137 yrs)";
|
|
12
|
-
export declare const INVESTMENT_HORIZON_LABEL_LONG = "Long-term (7+ yrs)";
|
|
13
|
-
export declare const INVESTMENT_HORIZON_OPTIONS: {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}[];
|
|
17
|
-
export declare const RISK_TOLERANCE_LOW = "low";
|
|
18
|
-
export declare const RISK_TOLERANCE_MEDIUM = "medium";
|
|
19
|
-
export declare const RISK_TOLERANCE_HIGH = "high";
|
|
20
|
-
export declare const RISK_TOLERANCE_LABEL_LOW = "Low";
|
|
21
|
-
export declare const RISK_TOLERANCE_LABEL_MEDIUM = "Medium";
|
|
22
|
-
export declare const RISK_TOLERANCE_LABEL_HIGH = "High";
|
|
23
|
-
export declare const RISK_TOLERANCE_OPTIONS: {
|
|
24
|
-
value: string;
|
|
25
|
-
label: string;
|
|
26
|
-
}[];
|
|
27
|
-
export declare const INVESTMENT_EXPERIENCE_NONE = "none";
|
|
28
|
-
export declare const INVESTMENT_EXPERIENCE_SOME = "some";
|
|
29
|
-
export declare const INVESTMENT_EXPERIENCE_EXTENSIVE = "extensive";
|
|
30
|
-
export declare const INVESTMENT_EXPERIENCE_LABEL_NONE = "No experience";
|
|
31
|
-
export declare const INVESTMENT_EXPERIENCE_LABEL_SOME = "Some experience";
|
|
32
|
-
export declare const INVESTMENT_EXPERIENCE_LABEL_EXTENSIVE = "Extensive";
|
|
33
|
-
export declare const INVESTMENT_EXPERIENCE_OPTIONS: {
|
|
34
|
-
value: string;
|
|
35
|
-
label: string;
|
|
36
|
-
}[];
|
|
37
|
-
export declare const API_ENDPOINTS: {
|
|
38
|
-
readonly PORTFOLIOS: "/api/portfolios/";
|
|
39
|
-
readonly PORTFOLIO_TEMPLATES: "/api/portfolio-templates/";
|
|
40
|
-
readonly PORTFOLIO_TEMPLATES_RECOMMENDED: "/api/portfolio-templates/recommended/";
|
|
41
|
-
readonly ASSET_ALLOCATIONS: "/api/asset-allocations/";
|
|
42
|
-
readonly ASSET_HOLDINGS: "/api/asset-holdings/";
|
|
43
|
-
readonly ASSET_HOLDING_SNAPSHOTS: "/api/asset-holding-snapshots/";
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/portfolios/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,wBAAwB,UAAU,CAAC;AAChD,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAClD,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAG9C,eAAO,MAAM,8BAA8B,8BAAyB,CAAC;AACrE,eAAO,MAAM,+BAA+B,+BAA0B,CAAC;AACvE,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAGlE,eAAO,MAAM,0BAA0B;;;GAItC,CAAC;AAGF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAG1C,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAC9C,eAAO,MAAM,2BAA2B,WAAW,CAAC;AACpD,eAAO,MAAM,yBAAyB,SAAS,CAAC;AAGhD,eAAO,MAAM,sBAAsB;;;GAIlC,CAAC;AAGF,eAAO,MAAM,0BAA0B,SAAS,CAAC;AACjD,eAAO,MAAM,0BAA0B,SAAS,CAAC;AACjD,eAAO,MAAM,+BAA+B,cAAc,CAAC;AAG3D,eAAO,MAAM,gCAAgC,kBAAkB,CAAC;AAChE,eAAO,MAAM,gCAAgC,oBAAoB,CAAC;AAClE,eAAO,MAAM,qCAAqC,cAAc,CAAC;AAGjE,eAAO,MAAM,6BAA6B;;;GAIzC,CAAC;AAGF,eAAO,MAAM,aAAa;;;;;;;CAOhB,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portfolio-related constants for shared services.
|
|
3
|
-
*
|
|
4
|
-
* These constants should match the backend constants in bilberry/portfolios/constants.py
|
|
5
|
-
* to ensure consistency across the application stack.
|
|
6
|
-
*/
|
|
7
|
-
// Investment horizon constants
|
|
8
|
-
export const INVESTMENT_HORIZON_SHORT = 'short';
|
|
9
|
-
export const INVESTMENT_HORIZON_MEDIUM = 'medium';
|
|
10
|
-
export const INVESTMENT_HORIZON_LONG = 'long';
|
|
11
|
-
// Investment horizon label constants
|
|
12
|
-
export const INVESTMENT_HORIZON_LABEL_SHORT = 'Short-term (0–3 yrs)';
|
|
13
|
-
export const INVESTMENT_HORIZON_LABEL_MEDIUM = 'Medium-term (3–7 yrs)';
|
|
14
|
-
export const INVESTMENT_HORIZON_LABEL_LONG = 'Long-term (7+ yrs)';
|
|
15
|
-
// Investment horizon options
|
|
16
|
-
export const INVESTMENT_HORIZON_OPTIONS = [
|
|
17
|
-
{ value: INVESTMENT_HORIZON_SHORT, label: INVESTMENT_HORIZON_LABEL_SHORT },
|
|
18
|
-
{ value: INVESTMENT_HORIZON_MEDIUM, label: INVESTMENT_HORIZON_LABEL_MEDIUM },
|
|
19
|
-
{ value: INVESTMENT_HORIZON_LONG, label: INVESTMENT_HORIZON_LABEL_LONG },
|
|
20
|
-
];
|
|
21
|
-
// Risk tolerance constants
|
|
22
|
-
export const RISK_TOLERANCE_LOW = 'low';
|
|
23
|
-
export const RISK_TOLERANCE_MEDIUM = 'medium';
|
|
24
|
-
export const RISK_TOLERANCE_HIGH = 'high';
|
|
25
|
-
// Risk tolerance label constants
|
|
26
|
-
export const RISK_TOLERANCE_LABEL_LOW = 'Low';
|
|
27
|
-
export const RISK_TOLERANCE_LABEL_MEDIUM = 'Medium';
|
|
28
|
-
export const RISK_TOLERANCE_LABEL_HIGH = 'High';
|
|
29
|
-
// Risk tolerance options
|
|
30
|
-
export const RISK_TOLERANCE_OPTIONS = [
|
|
31
|
-
{ value: RISK_TOLERANCE_LOW, label: RISK_TOLERANCE_LABEL_LOW },
|
|
32
|
-
{ value: RISK_TOLERANCE_MEDIUM, label: RISK_TOLERANCE_LABEL_MEDIUM },
|
|
33
|
-
{ value: RISK_TOLERANCE_HIGH, label: RISK_TOLERANCE_LABEL_HIGH },
|
|
34
|
-
];
|
|
35
|
-
// Investment experience constants
|
|
36
|
-
export const INVESTMENT_EXPERIENCE_NONE = 'none';
|
|
37
|
-
export const INVESTMENT_EXPERIENCE_SOME = 'some';
|
|
38
|
-
export const INVESTMENT_EXPERIENCE_EXTENSIVE = 'extensive';
|
|
39
|
-
// Investment experience label constants
|
|
40
|
-
export const INVESTMENT_EXPERIENCE_LABEL_NONE = 'No experience';
|
|
41
|
-
export const INVESTMENT_EXPERIENCE_LABEL_SOME = 'Some experience';
|
|
42
|
-
export const INVESTMENT_EXPERIENCE_LABEL_EXTENSIVE = 'Extensive';
|
|
43
|
-
// Investment experience options
|
|
44
|
-
export const INVESTMENT_EXPERIENCE_OPTIONS = [
|
|
45
|
-
{ value: INVESTMENT_EXPERIENCE_NONE, label: INVESTMENT_EXPERIENCE_LABEL_NONE },
|
|
46
|
-
{ value: INVESTMENT_EXPERIENCE_SOME, label: INVESTMENT_EXPERIENCE_LABEL_SOME },
|
|
47
|
-
{ value: INVESTMENT_EXPERIENCE_EXTENSIVE, label: INVESTMENT_EXPERIENCE_LABEL_EXTENSIVE },
|
|
48
|
-
];
|
|
49
|
-
// API Endpoints
|
|
50
|
-
export const API_ENDPOINTS = {
|
|
51
|
-
PORTFOLIOS: '/api/portfolios/',
|
|
52
|
-
PORTFOLIO_TEMPLATES: '/api/portfolio-templates/',
|
|
53
|
-
PORTFOLIO_TEMPLATES_RECOMMENDED: '/api/portfolio-templates/recommended/',
|
|
54
|
-
ASSET_ALLOCATIONS: '/api/asset-allocations/',
|
|
55
|
-
ASSET_HOLDINGS: '/api/asset-holdings/',
|
|
56
|
-
ASSET_HOLDING_SNAPSHOTS: '/api/asset-holding-snapshots/',
|
|
57
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/portfolios/holdings/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PaginatedResponse } from '../../../api/types';
|
|
2
|
-
import type { AssetHolding, AssetHoldingSnapshot, AssetHoldingFilters, AssetHoldingSnapshotFilters } from './types';
|
|
3
|
-
export type PaginatedAssetHoldings = PaginatedResponse<AssetHolding>;
|
|
4
|
-
export type PaginatedAssetHoldingSnapshots = PaginatedResponse<AssetHoldingSnapshot>;
|
|
5
|
-
export declare const getAssetHoldings: (filters?: AssetHoldingFilters) => Promise<import("axios").AxiosResponse<PaginatedAssetHoldings, any>>;
|
|
6
|
-
export declare const getPortfolioHoldings: (portfolioUuid: string, orderBy?: string) => Promise<import("axios").AxiosResponse<AssetHolding[], any>>;
|
|
7
|
-
export declare const getAssetHoldingByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<AssetHolding, any>>;
|
|
8
|
-
export declare const getAssetHoldingSnapshots: (filters?: AssetHoldingSnapshotFilters) => Promise<import("axios").AxiosResponse<PaginatedAssetHoldingSnapshots, any>>;
|
|
9
|
-
export declare const getAssetHoldingSnapshotById: (id: number) => Promise<import("axios").AxiosResponse<AssetHoldingSnapshot, any>>;
|
|
10
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/portfolios/holdings/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAGpH,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;AACrE,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;AAKrF,eAAO,MAAM,gBAAgB,GAAI,UAAU,mBAAmB,wEAW7D,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAAI,eAAe,MAAM,EAAE,UAAU,MAAM,gEAK3E,CAAC;AAGF,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,8DAEjD,CAAC;AAKF,eAAO,MAAM,wBAAwB,GAAI,UAAU,2BAA2B,gFAW7E,CAAC;AAGF,eAAO,MAAM,2BAA2B,GAAI,IAAI,MAAM,sEAErD,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { webApiClient } from '../../../api/apiClient';
|
|
2
|
-
import { API_ENDPOINTS } from '../constants';
|
|
3
|
-
// ASSET HOLDINGS API FUNCTIONS
|
|
4
|
-
// Fetch asset holdings with optional filtering
|
|
5
|
-
export const getAssetHoldings = (filters) => {
|
|
6
|
-
const params = {};
|
|
7
|
-
if (filters?.portfolioId)
|
|
8
|
-
params.portfolio_id = filters.portfolioId;
|
|
9
|
-
if (filters?.portfolioUuid)
|
|
10
|
-
params.portfolio_uuid = filters.portfolioUuid;
|
|
11
|
-
if (filters?.instrument)
|
|
12
|
-
params.instrument = filters.instrument;
|
|
13
|
-
if (filters?.minQuantity)
|
|
14
|
-
params.min_quantity = filters.minQuantity.toString();
|
|
15
|
-
if (filters?.maxQuantity)
|
|
16
|
-
params.max_quantity = filters.maxQuantity.toString();
|
|
17
|
-
if (filters?.orderBy)
|
|
18
|
-
params.order_by = filters.orderBy;
|
|
19
|
-
return webApiClient.get(API_ENDPOINTS.ASSET_HOLDINGS, { params });
|
|
20
|
-
};
|
|
21
|
-
// Fetch holdings for a specific portfolio
|
|
22
|
-
export const getPortfolioHoldings = (portfolioUuid, orderBy) => {
|
|
23
|
-
const params = {};
|
|
24
|
-
if (orderBy)
|
|
25
|
-
params.order_by = orderBy;
|
|
26
|
-
return webApiClient.get(`${API_ENDPOINTS.PORTFOLIOS}${portfolioUuid}/holdings/`, { params });
|
|
27
|
-
};
|
|
28
|
-
// Get asset holding by UUID
|
|
29
|
-
export const getAssetHoldingByUuid = (uuid) => {
|
|
30
|
-
return webApiClient.get(`${API_ENDPOINTS.ASSET_HOLDINGS}${uuid}/`);
|
|
31
|
-
};
|
|
32
|
-
// ASSET HOLDING SNAPSHOTS API FUNCTIONS
|
|
33
|
-
// Fetch asset holding snapshots with optional filtering
|
|
34
|
-
export const getAssetHoldingSnapshots = (filters) => {
|
|
35
|
-
const params = {};
|
|
36
|
-
if (filters?.assetHoldingId)
|
|
37
|
-
params.asset_holding_id = filters.assetHoldingId;
|
|
38
|
-
if (filters?.portfolioId)
|
|
39
|
-
params.portfolio_id = filters.portfolioId;
|
|
40
|
-
if (filters?.reason)
|
|
41
|
-
params.reason = filters.reason;
|
|
42
|
-
if (filters?.startDate)
|
|
43
|
-
params.start_date = filters.startDate;
|
|
44
|
-
if (filters?.endDate)
|
|
45
|
-
params.end_date = filters.endDate;
|
|
46
|
-
if (filters?.orderBy)
|
|
47
|
-
params.order_by = filters.orderBy;
|
|
48
|
-
return webApiClient.get(API_ENDPOINTS.ASSET_HOLDING_SNAPSHOTS, { params });
|
|
49
|
-
};
|
|
50
|
-
// Get asset holding snapshot by ID
|
|
51
|
-
export const getAssetHoldingSnapshotById = (id) => {
|
|
52
|
-
return webApiClient.get(`${API_ENDPOINTS.ASSET_HOLDING_SNAPSHOTS}${id}/`);
|
|
53
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Asset Holdings types and interfaces
|
|
3
|
-
*/
|
|
4
|
-
export interface AssetHolding {
|
|
5
|
-
uuid: string;
|
|
6
|
-
portfolio: string;
|
|
7
|
-
instrument: any;
|
|
8
|
-
instrumentName: string;
|
|
9
|
-
instrumentSymbol: string;
|
|
10
|
-
quantity: number;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
updatedAt: string;
|
|
13
|
-
}
|
|
14
|
-
export interface AssetHoldingSnapshot {
|
|
15
|
-
id: number;
|
|
16
|
-
assetHolding: string;
|
|
17
|
-
portfolioId: number;
|
|
18
|
-
instrumentName: string;
|
|
19
|
-
instrumentSymbol: string;
|
|
20
|
-
quantity: number;
|
|
21
|
-
snapshotReason: 'TRADE' | 'REBALANCE' | 'VALUATION' | 'AUDIT';
|
|
22
|
-
snapshotDate: string;
|
|
23
|
-
createdAt: string;
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
}
|
|
26
|
-
export interface AssetHoldingFilters {
|
|
27
|
-
portfolioId?: string;
|
|
28
|
-
portfolioUuid?: string;
|
|
29
|
-
instrument?: string;
|
|
30
|
-
minQuantity?: number;
|
|
31
|
-
maxQuantity?: number;
|
|
32
|
-
orderBy?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface AssetHoldingSnapshotFilters {
|
|
35
|
-
assetHoldingId?: string;
|
|
36
|
-
portfolioId?: string;
|
|
37
|
-
reason?: 'TRADE' | 'REBALANCE' | 'VALUATION' | 'AUDIT';
|
|
38
|
-
startDate?: string;
|
|
39
|
-
endDate?: string;
|
|
40
|
-
orderBy?: string;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/portfolios/holdings/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,GAAG,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,2BAA2B;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AssetHolding } from './types';
|
|
2
|
-
export declare const calculatePortfolioValue: (holdings: AssetHolding[], prices: Record<string, number>) => number;
|
|
3
|
-
export declare const calculateHoldingAllocations: (holdings: AssetHolding[]) => Record<string, number>;
|
|
4
|
-
export declare const groupHoldingsByInstrument: (holdings: AssetHolding[]) => Record<string, AssetHolding[]>;
|
|
5
|
-
export declare const filterHoldingsByMinQuantity: (holdings: AssetHolding[], minQuantity: number) => AssetHolding[];
|
|
6
|
-
export declare const sortHoldings: (holdings: AssetHolding[], sortBy: "quantity" | "symbol" | "name" | "createdAt", direction?: "asc" | "desc") => AssetHolding[];
|
|
7
|
-
export declare const formatQuantity: (quantity: number) => string;
|
|
8
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/services/portfolios/holdings/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,eAAO,MAAM,uBAAuB,GAAI,UAAU,YAAY,EAAE,EAAE,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAG,MAKlG,CAAC;AAGF,eAAO,MAAM,2BAA2B,GAAI,UAAU,YAAY,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAW3F,CAAC;AAGF,eAAO,MAAM,yBAAyB,GAAI,UAAU,YAAY,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAYjG,CAAC;AAGF,eAAO,MAAM,2BAA2B,GAAI,UAAU,YAAY,EAAE,EAAE,aAAa,MAAM,KAAG,YAAY,EAEvG,CAAC;AAGF,eAAO,MAAM,YAAY,GACvB,UAAU,YAAY,EAAE,EACxB,QAAQ,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,EACpD,YAAW,KAAK,GAAG,MAAe,KACjC,YAAY,EAsCd,CAAC;AAGF,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,MAQjD,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// ASSET HOLDINGS UTILITY FUNCTIONS
|
|
2
|
-
// Calculate total portfolio value based on holdings and prices
|
|
3
|
-
export const calculatePortfolioValue = (holdings, prices) => {
|
|
4
|
-
return holdings.reduce((total, holding) => {
|
|
5
|
-
const price = prices[holding.instrument.uuid] || 0;
|
|
6
|
-
return total + holding.quantity * price;
|
|
7
|
-
}, 0);
|
|
8
|
-
};
|
|
9
|
-
// Calculate holding allocation percentages within a portfolio
|
|
10
|
-
export const calculateHoldingAllocations = (holdings) => {
|
|
11
|
-
const totalQuantity = holdings.reduce((sum, holding) => sum + holding.quantity, 0);
|
|
12
|
-
if (totalQuantity === 0)
|
|
13
|
-
return {};
|
|
14
|
-
const allocations = {};
|
|
15
|
-
holdings.forEach((holding) => {
|
|
16
|
-
allocations[holding.instrument.uuid] = (holding.quantity / totalQuantity) * 100;
|
|
17
|
-
});
|
|
18
|
-
return allocations;
|
|
19
|
-
};
|
|
20
|
-
// Group holdings by instrument for aggregated view
|
|
21
|
-
export const groupHoldingsByInstrument = (holdings) => {
|
|
22
|
-
return holdings.reduce((groups, holding) => {
|
|
23
|
-
const instrumentUuid = holding.instrument.uuid;
|
|
24
|
-
if (!groups[instrumentUuid]) {
|
|
25
|
-
groups[instrumentUuid] = [];
|
|
26
|
-
}
|
|
27
|
-
groups[instrumentUuid].push(holding);
|
|
28
|
-
return groups;
|
|
29
|
-
}, {});
|
|
30
|
-
};
|
|
31
|
-
// Filter holdings with quantities above a threshold
|
|
32
|
-
export const filterHoldingsByMinQuantity = (holdings, minQuantity) => {
|
|
33
|
-
return holdings.filter((holding) => holding.quantity >= minQuantity);
|
|
34
|
-
};
|
|
35
|
-
// Sort holdings by various criteria
|
|
36
|
-
export const sortHoldings = (holdings, sortBy, direction = 'desc') => {
|
|
37
|
-
return [...holdings].sort((a, b) => {
|
|
38
|
-
let valueA;
|
|
39
|
-
let valueB;
|
|
40
|
-
switch (sortBy) {
|
|
41
|
-
case 'quantity':
|
|
42
|
-
valueA = a.quantity;
|
|
43
|
-
valueB = b.quantity;
|
|
44
|
-
break;
|
|
45
|
-
case 'symbol':
|
|
46
|
-
valueA = a.instrumentSymbol;
|
|
47
|
-
valueB = b.instrumentSymbol;
|
|
48
|
-
break;
|
|
49
|
-
case 'name':
|
|
50
|
-
valueA = a.instrumentName;
|
|
51
|
-
valueB = b.instrumentName;
|
|
52
|
-
break;
|
|
53
|
-
case 'createdAt':
|
|
54
|
-
valueA = a.createdAt;
|
|
55
|
-
valueB = b.createdAt;
|
|
56
|
-
break;
|
|
57
|
-
default:
|
|
58
|
-
return 0;
|
|
59
|
-
}
|
|
60
|
-
if (typeof valueA === 'string' && typeof valueB === 'string') {
|
|
61
|
-
const comparison = valueA.localeCompare(valueB);
|
|
62
|
-
return direction === 'asc' ? comparison : -comparison;
|
|
63
|
-
}
|
|
64
|
-
if (typeof valueA === 'number' && typeof valueB === 'number') {
|
|
65
|
-
const comparison = valueA - valueB;
|
|
66
|
-
return direction === 'asc' ? comparison : -comparison;
|
|
67
|
-
}
|
|
68
|
-
return 0;
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
// Format quantity for display with proper units
|
|
72
|
-
export const formatQuantity = (quantity) => {
|
|
73
|
-
if (quantity >= 1000000) {
|
|
74
|
-
return `${(quantity / 1000000).toFixed(1)}M`;
|
|
75
|
-
}
|
|
76
|
-
else if (quantity >= 1000) {
|
|
77
|
-
return `${(quantity / 1000).toFixed(1)}K`;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
return quantity.toString();
|
|
81
|
-
}
|
|
82
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portfolios service exports
|
|
3
|
-
*/
|
|
4
|
-
export * from './constants';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './service';
|
|
7
|
-
export * from './utils';
|
|
8
|
-
export * as Allocations from './allocations';
|
|
9
|
-
export * as Holdings from './holdings';
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/portfolios/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AAGxB,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Portfolios service exports
|
|
3
|
-
*/
|
|
4
|
-
export * from './constants';
|
|
5
|
-
export * from './types';
|
|
6
|
-
export * from './service';
|
|
7
|
-
export * from './utils';
|
|
8
|
-
// Sub-services
|
|
9
|
-
export * as Allocations from './allocations';
|
|
10
|
-
export * as Holdings from './holdings';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Portfolio, PaginatedPortfolios, PortfolioPayload, RebalancingTradesGenerationResponse } from './types';
|
|
2
|
-
export declare const getPortfolios: () => Promise<import("axios").AxiosResponse<PaginatedPortfolios, any>>;
|
|
3
|
-
export declare const createPortfolio: (data: PortfolioPayload) => Promise<import("axios").AxiosResponse<Portfolio, any>>;
|
|
4
|
-
export declare const updatePortfolio: (uuid: string, data: Partial<PortfolioPayload>) => Promise<import("axios").AxiosResponse<Portfolio, any>>;
|
|
5
|
-
export declare const getPortfolioByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<Portfolio, any>>;
|
|
6
|
-
export declare const generateRebalancingTrades: (portfolioUuid: string) => Promise<import("axios").AxiosResponse<RebalancingTradesGenerationResponse, any>>;
|
|
7
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/portfolios/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mCAAmC,EAAE,MAAM,SAAS,CAAC;AAGrH,eAAO,MAAM,aAAa,wEAEzB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,gBAAgB,2DAErD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,2DAE5E,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,2DAE9C,CAAC;AAGF,eAAO,MAAM,yBAAyB,GAAI,eAAe,MAAM,qFAI9D,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { webApiClient } from '../../api/apiClient';
|
|
2
|
-
import { API_ENDPOINTS } from './constants';
|
|
3
|
-
// Portfolio CRUD operations
|
|
4
|
-
export const getPortfolios = () => {
|
|
5
|
-
return webApiClient.get(API_ENDPOINTS.PORTFOLIOS);
|
|
6
|
-
};
|
|
7
|
-
export const createPortfolio = (data) => {
|
|
8
|
-
return webApiClient.post(API_ENDPOINTS.PORTFOLIOS, data);
|
|
9
|
-
};
|
|
10
|
-
export const updatePortfolio = (uuid, data) => {
|
|
11
|
-
return webApiClient.patch(`${API_ENDPOINTS.PORTFOLIOS}${uuid}/`, data);
|
|
12
|
-
};
|
|
13
|
-
export const getPortfolioByUuid = (uuid) => {
|
|
14
|
-
return webApiClient.get(`${API_ENDPOINTS.PORTFOLIOS}${uuid}/`);
|
|
15
|
-
};
|
|
16
|
-
// Portfolio rebalancing operations
|
|
17
|
-
export const generateRebalancingTrades = (portfolioUuid) => {
|
|
18
|
-
return webApiClient.post(`${API_ENDPOINTS.PORTFOLIOS}${portfolioUuid}/generate-rebalancing-trades/`);
|
|
19
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { PaginatedResponse } from '../../api/types';
|
|
2
|
-
export interface Portfolio {
|
|
3
|
-
uuid: string;
|
|
4
|
-
account: string;
|
|
5
|
-
name: string;
|
|
6
|
-
template: string | null;
|
|
7
|
-
marketValue: string;
|
|
8
|
-
createdAt?: string;
|
|
9
|
-
updatedAt?: string;
|
|
10
|
-
}
|
|
11
|
-
export type PaginatedPortfolios = PaginatedResponse<Portfolio>;
|
|
12
|
-
export interface PortfolioPayload {
|
|
13
|
-
account: string;
|
|
14
|
-
name: string;
|
|
15
|
-
template?: string | null;
|
|
16
|
-
}
|
|
17
|
-
export interface RebalancingTradesGenerationResponse {
|
|
18
|
-
status: string;
|
|
19
|
-
message: string;
|
|
20
|
-
tradeCount?: number;
|
|
21
|
-
buyTradeCount?: number;
|
|
22
|
-
sellTradeCount?: number;
|
|
23
|
-
totalTradeValue?: number;
|
|
24
|
-
netCashImpact?: number;
|
|
25
|
-
availableCash?: number;
|
|
26
|
-
requiredMinimum?: number;
|
|
27
|
-
errorType?: 'business_logic' | 'permission' | 'server';
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/portfolios/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,mCAAmC;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,gBAAgB,GAAG,YAAY,GAAG,QAAQ,CAAC;CACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const formatPortfolioValue: (value: string | number) => string;
|
|
2
|
-
export declare const calculateTotalValue: (marketValue: string | number, cashBalance: string | number) => number;
|
|
3
|
-
export declare const getMarketAllocation: (marketValue: string | number, totalValue: string | number) => number;
|
|
4
|
-
export declare const getCashAllocation: (cashBalance: string | number, totalValue: string | number) => number;
|
|
5
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/services/portfolios/utils.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,GAAG,MAAM,KAAG,MAQ7D,CAAC;AAGF,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,GAAG,MAAM,EAAE,aAAa,MAAM,GAAG,MAAM,KAAG,MAIhG,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,aAAa,MAAM,GAAG,MAAM,EAAE,YAAY,MAAM,GAAG,MAAM,KAAG,MAI/F,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,aAAa,MAAM,GAAG,MAAM,EAAE,YAAY,MAAM,GAAG,MAAM,KAAG,MAI7F,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Portfolio formatting utilities
|
|
2
|
-
export const formatPortfolioValue = (value) => {
|
|
3
|
-
const numValue = typeof value === 'string' ? parseFloat(value) : value;
|
|
4
|
-
return new Intl.NumberFormat('en-AU', {
|
|
5
|
-
style: 'currency',
|
|
6
|
-
currency: 'AUD',
|
|
7
|
-
minimumFractionDigits: 2,
|
|
8
|
-
maximumFractionDigits: 2,
|
|
9
|
-
}).format(numValue);
|
|
10
|
-
};
|
|
11
|
-
// Portfolio calculation utilities
|
|
12
|
-
export const calculateTotalValue = (marketValue, cashBalance) => {
|
|
13
|
-
const market = typeof marketValue === 'string' ? parseFloat(marketValue || '0') : marketValue;
|
|
14
|
-
const cash = typeof cashBalance === 'string' ? parseFloat(cashBalance || '0') : cashBalance;
|
|
15
|
-
return market + cash;
|
|
16
|
-
};
|
|
17
|
-
export const getMarketAllocation = (marketValue, totalValue) => {
|
|
18
|
-
const market = typeof marketValue === 'string' ? parseFloat(marketValue || '0') : marketValue;
|
|
19
|
-
const total = typeof totalValue === 'string' ? parseFloat(totalValue || '0') : totalValue;
|
|
20
|
-
return total > 0 ? (market / total) * 100 : 0;
|
|
21
|
-
};
|
|
22
|
-
export const getCashAllocation = (cashBalance, totalValue) => {
|
|
23
|
-
const cash = typeof cashBalance === 'string' ? parseFloat(cashBalance || '0') : cashBalance;
|
|
24
|
-
const total = typeof totalValue === 'string' ? parseFloat(totalValue || '0') : totalValue;
|
|
25
|
-
return total > 0 ? (cash / total) * 100 : 0;
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/sectors/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,aAAa;;CAEhB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { Sector, SectorQueryParams, PaginatedSectors } from './types';
|
|
2
|
-
export type { SortDirection } from './utils';
|
|
3
|
-
export { getSectors, getSectorByUuid, searchSectors } from './service';
|
|
4
|
-
export { sortSectorsByName, filterSectorsByName, findSectorByName, getSectorNames, groupSectorsAlphabetically, sectorExists, findSectorsByPartialName, } from './utils';
|
|
5
|
-
export { API_ENDPOINTS } from './constants';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/sectors/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAGvE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,YAAY,EACZ,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Export service functions
|
|
2
|
-
export { getSectors, getSectorByUuid, searchSectors } from './service';
|
|
3
|
-
// Export utility functions
|
|
4
|
-
export { sortSectorsByName, filterSectorsByName, findSectorByName, getSectorNames, groupSectorsAlphabetically, sectorExists, findSectorsByPartialName, } from './utils';
|
|
5
|
-
// Export constants
|
|
6
|
-
export { API_ENDPOINTS } from './constants';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Sector, SectorQueryParams, PaginatedSectors } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Get list of sectors with optional filtering
|
|
4
|
-
*/
|
|
5
|
-
export declare const getSectors: (params?: SectorQueryParams) => Promise<import("axios").AxiosResponse<PaginatedSectors, any>>;
|
|
6
|
-
/**
|
|
7
|
-
* Get sector details by UUID
|
|
8
|
-
*/
|
|
9
|
-
export declare const getSectorByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<Sector, any>>;
|
|
10
|
-
/**
|
|
11
|
-
* Search sectors by name
|
|
12
|
-
*/
|
|
13
|
-
export declare const searchSectors: (searchTerm: string, params?: Omit<SectorQueryParams, "name">) => Promise<import("axios").AxiosResponse<PaginatedSectors, any>>;
|
|
14
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/sectors/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3E;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,iBAAiB,kEASpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,wDAE3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,YAAY,MAAM,EAAE,SAAS,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,kEAKzF,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { webApiClient } from '../../api/apiClient';
|
|
2
|
-
import { API_ENDPOINTS } from './constants';
|
|
3
|
-
/**
|
|
4
|
-
* Get list of sectors with optional filtering
|
|
5
|
-
*/
|
|
6
|
-
export const getSectors = (params) => {
|
|
7
|
-
const queryParams = {};
|
|
8
|
-
if (params?.name)
|
|
9
|
-
queryParams.name = params.name;
|
|
10
|
-
if (params?.ordering)
|
|
11
|
-
queryParams.ordering = params.ordering;
|
|
12
|
-
if (params?.page)
|
|
13
|
-
queryParams.page = params.page.toString();
|
|
14
|
-
if (params?.page_size)
|
|
15
|
-
queryParams.page_size = params.page_size.toString();
|
|
16
|
-
return webApiClient.get(API_ENDPOINTS.SECTORS, { params: queryParams });
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Get sector details by UUID
|
|
20
|
-
*/
|
|
21
|
-
export const getSectorByUuid = (uuid) => {
|
|
22
|
-
return webApiClient.get(`${API_ENDPOINTS.SECTORS}${uuid}/`);
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Search sectors by name
|
|
26
|
-
*/
|
|
27
|
-
export const searchSectors = (searchTerm, params) => {
|
|
28
|
-
return getSectors({
|
|
29
|
-
...params,
|
|
30
|
-
name: searchTerm,
|
|
31
|
-
});
|
|
32
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { PaginatedResponse } from '../../api/types';
|
|
2
|
-
/**
|
|
3
|
-
* Sector entity representing business sectors
|
|
4
|
-
*/
|
|
5
|
-
export interface Sector {
|
|
6
|
-
uuid: string;
|
|
7
|
-
name: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Query parameters for filtering sectors
|
|
11
|
-
*/
|
|
12
|
-
export interface SectorQueryParams {
|
|
13
|
-
name?: string;
|
|
14
|
-
ordering?: string;
|
|
15
|
-
page?: number;
|
|
16
|
-
page_size?: number;
|
|
17
|
-
}
|
|
18
|
-
export type PaginatedSectors = PaginatedResponse<Sector>;
|
|
19
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/sectors/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|