@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,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Withdrawal-related constants for the shared services package.
|
|
3
|
-
*
|
|
4
|
-
* These constants should match the backend constants in bilberry/withdrawals/constants.py
|
|
5
|
-
* to ensure consistency across the application stack.
|
|
6
|
-
*/
|
|
7
|
-
// Withdrawal status constants
|
|
8
|
-
export const WITHDRAWAL_STATUS_PENDING_REVIEW = 'PENDING_REVIEW';
|
|
9
|
-
export const WITHDRAWAL_STATUS_APPROVED = 'APPROVED';
|
|
10
|
-
export const WITHDRAWAL_STATUS_REJECTED = 'REJECTED';
|
|
11
|
-
export const WITHDRAWAL_STATUS_PROCESSING = 'PROCESSING';
|
|
12
|
-
export const WITHDRAWAL_STATUS_AWAITING_LIQUIDATION = 'AWAITING_LIQUIDATION';
|
|
13
|
-
export const WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS = 'LIQUIDATION_IN_PROGRESS';
|
|
14
|
-
export const WITHDRAWAL_STATUS_COMPLETED = 'COMPLETED';
|
|
15
|
-
export const WITHDRAWAL_STATUS_CANCELLED = 'CANCELLED';
|
|
16
|
-
export const WITHDRAWAL_STATUS_FAILED = 'FAILED';
|
|
17
|
-
// Withdrawal status label constants
|
|
18
|
-
export const WITHDRAWAL_STATUS_LABEL_PENDING_REVIEW = 'Pending Review';
|
|
19
|
-
export const WITHDRAWAL_STATUS_LABEL_APPROVED = 'Approved';
|
|
20
|
-
export const WITHDRAWAL_STATUS_LABEL_REJECTED = 'Rejected';
|
|
21
|
-
export const WITHDRAWAL_STATUS_LABEL_PROCESSING = 'Processing';
|
|
22
|
-
export const WITHDRAWAL_STATUS_LABEL_AWAITING_LIQUIDATION = 'Awaiting Asset Liquidation';
|
|
23
|
-
export const WITHDRAWAL_STATUS_LABEL_LIQUIDATION_IN_PROGRESS = 'Liquidation in Progress';
|
|
24
|
-
export const WITHDRAWAL_STATUS_LABEL_COMPLETED = 'Completed';
|
|
25
|
-
export const WITHDRAWAL_STATUS_LABEL_CANCELLED = 'Cancelled';
|
|
26
|
-
export const WITHDRAWAL_STATUS_LABEL_FAILED = 'Failed';
|
|
27
|
-
// Withdrawal status options
|
|
28
|
-
export const WITHDRAWAL_STATUS_OPTIONS = [
|
|
29
|
-
{ value: WITHDRAWAL_STATUS_PENDING_REVIEW, label: WITHDRAWAL_STATUS_LABEL_PENDING_REVIEW },
|
|
30
|
-
{ value: WITHDRAWAL_STATUS_APPROVED, label: WITHDRAWAL_STATUS_LABEL_APPROVED },
|
|
31
|
-
{ value: WITHDRAWAL_STATUS_REJECTED, label: WITHDRAWAL_STATUS_LABEL_REJECTED },
|
|
32
|
-
{ value: WITHDRAWAL_STATUS_PROCESSING, label: WITHDRAWAL_STATUS_LABEL_PROCESSING },
|
|
33
|
-
{ value: WITHDRAWAL_STATUS_AWAITING_LIQUIDATION, label: WITHDRAWAL_STATUS_LABEL_AWAITING_LIQUIDATION },
|
|
34
|
-
{ value: WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS, label: WITHDRAWAL_STATUS_LABEL_LIQUIDATION_IN_PROGRESS },
|
|
35
|
-
{ value: WITHDRAWAL_STATUS_COMPLETED, label: WITHDRAWAL_STATUS_LABEL_COMPLETED },
|
|
36
|
-
{ value: WITHDRAWAL_STATUS_CANCELLED, label: WITHDRAWAL_STATUS_LABEL_CANCELLED },
|
|
37
|
-
{ value: WITHDRAWAL_STATUS_FAILED, label: WITHDRAWAL_STATUS_LABEL_FAILED },
|
|
38
|
-
];
|
|
39
|
-
// Liquidation status constants
|
|
40
|
-
export const LIQUIDATION_STATUS_PENDING = 'PENDING';
|
|
41
|
-
export const LIQUIDATION_STATUS_TRADES_CREATED = 'TRADES_CREATED';
|
|
42
|
-
export const LIQUIDATION_STATUS_EXECUTED = 'EXECUTED';
|
|
43
|
-
export const LIQUIDATION_STATUS_SETTLED = 'SETTLED';
|
|
44
|
-
export const LIQUIDATION_STATUS_FAILED = 'FAILED';
|
|
45
|
-
// Liquidation status label constants
|
|
46
|
-
export const LIQUIDATION_STATUS_LABEL_PENDING = 'Pending';
|
|
47
|
-
export const LIQUIDATION_STATUS_LABEL_TRADES_CREATED = 'Trades Created';
|
|
48
|
-
export const LIQUIDATION_STATUS_LABEL_EXECUTED = 'Executed';
|
|
49
|
-
export const LIQUIDATION_STATUS_LABEL_SETTLED = 'Settled';
|
|
50
|
-
export const LIQUIDATION_STATUS_LABEL_FAILED = 'Failed';
|
|
51
|
-
// Liquidation status options
|
|
52
|
-
export const LIQUIDATION_STATUS_OPTIONS = [
|
|
53
|
-
{ value: LIQUIDATION_STATUS_PENDING, label: LIQUIDATION_STATUS_LABEL_PENDING },
|
|
54
|
-
{ value: LIQUIDATION_STATUS_TRADES_CREATED, label: LIQUIDATION_STATUS_LABEL_TRADES_CREATED },
|
|
55
|
-
{ value: LIQUIDATION_STATUS_EXECUTED, label: LIQUIDATION_STATUS_LABEL_EXECUTED },
|
|
56
|
-
{ value: LIQUIDATION_STATUS_SETTLED, label: LIQUIDATION_STATUS_LABEL_SETTLED },
|
|
57
|
-
{ value: LIQUIDATION_STATUS_FAILED, label: LIQUIDATION_STATUS_LABEL_FAILED },
|
|
58
|
-
];
|
|
59
|
-
// Withdrawal Type constants
|
|
60
|
-
export const WITHDRAWAL_TYPE_FULL_CASH = 'FULL_CASH';
|
|
61
|
-
export const WITHDRAWAL_TYPE_PARTIAL_CASH = 'PARTIAL_CASH';
|
|
62
|
-
// Withdrawal Type label constants
|
|
63
|
-
export const WITHDRAWAL_TYPE_LABEL_FULL_CASH = 'Full Cash Withdrawal';
|
|
64
|
-
export const WITHDRAWAL_TYPE_LABEL_PARTIAL_CASH = 'Partial Cash Withdrawal';
|
|
65
|
-
// Withdrawal Type options
|
|
66
|
-
export const WITHDRAWAL_TYPE_OPTIONS = [
|
|
67
|
-
{ value: WITHDRAWAL_TYPE_FULL_CASH, label: WITHDRAWAL_TYPE_LABEL_FULL_CASH },
|
|
68
|
-
{ value: WITHDRAWAL_TYPE_PARTIAL_CASH, label: WITHDRAWAL_TYPE_LABEL_PARTIAL_CASH },
|
|
69
|
-
];
|
|
70
|
-
// Withdrawal Reason constants
|
|
71
|
-
export const WITHDRAWAL_REASON_INVESTMENT_STRATEGY = 'INVESTMENT_STRATEGY';
|
|
72
|
-
export const WITHDRAWAL_REASON_PERSONAL_EXPENSES = 'PERSONAL_EXPENSES';
|
|
73
|
-
export const WITHDRAWAL_REASON_EMERGENCY = 'EMERGENCY';
|
|
74
|
-
export const WITHDRAWAL_REASON_OTHER = 'OTHER';
|
|
75
|
-
// Withdrawal Reason label constants
|
|
76
|
-
export const WITHDRAWAL_REASON_LABEL_INVESTMENT_STRATEGY = 'Investment Strategy Change';
|
|
77
|
-
export const WITHDRAWAL_REASON_LABEL_PERSONAL_EXPENSES = 'Personal Expenses';
|
|
78
|
-
export const WITHDRAWAL_REASON_LABEL_EMERGENCY = 'Emergency';
|
|
79
|
-
export const WITHDRAWAL_REASON_LABEL_OTHER = 'Other';
|
|
80
|
-
// Withdrawal Reason options
|
|
81
|
-
export const WITHDRAWAL_REASON_OPTIONS = [
|
|
82
|
-
{ value: WITHDRAWAL_REASON_INVESTMENT_STRATEGY, label: WITHDRAWAL_REASON_LABEL_INVESTMENT_STRATEGY },
|
|
83
|
-
{ value: WITHDRAWAL_REASON_PERSONAL_EXPENSES, label: WITHDRAWAL_REASON_LABEL_PERSONAL_EXPENSES },
|
|
84
|
-
{ value: WITHDRAWAL_REASON_EMERGENCY, label: WITHDRAWAL_REASON_LABEL_EMERGENCY },
|
|
85
|
-
{ value: WITHDRAWAL_REASON_OTHER, label: WITHDRAWAL_REASON_LABEL_OTHER },
|
|
86
|
-
];
|
|
87
|
-
// API Endpoints
|
|
88
|
-
export const API_ENDPOINTS = {
|
|
89
|
-
WITHDRAWAL_REQUESTS: '/api/withdrawal-requests/',
|
|
90
|
-
WITHDRAWAL_LIQUIDATIONS: '/api/withdrawal-liquidations/',
|
|
91
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { WithdrawalRequest, WithdrawalAssetLiquidation, WithdrawalRequestPayload, WithdrawalAssetLiquidationPayload, WithdrawalRequestQueryParams, WithdrawalAssetLiquidationQueryParams, PaginatedWithdrawalRequests, PaginatedWithdrawalAssetLiquidations, WithdrawalStatus, WithdrawalType, WithdrawalReason, WithdrawalLiquidationStatus, } from './types';
|
|
2
|
-
export * as WithdrawalRequests from './withdrawal_requests';
|
|
3
|
-
export * as WithdrawalLiquidations from './withdrawal_liquidations';
|
|
4
|
-
export { formatWithdrawalAmount, getStatusColor, getStatusLabel, getWithdrawalTypeLabel, getReasonLabel, formatLiquidationValue, getLiquidationStatusColor, getLiquidationStatusLabel, calculateLiquidationProgress, getTotalEstimatedValue, formatSharesQuantity, } from './utils';
|
|
5
|
-
export { WITHDRAWAL_STATUS_PENDING_REVIEW, WITHDRAWAL_STATUS_APPROVED, WITHDRAWAL_STATUS_REJECTED, WITHDRAWAL_STATUS_PROCESSING, WITHDRAWAL_STATUS_AWAITING_LIQUIDATION, WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS, WITHDRAWAL_STATUS_COMPLETED, WITHDRAWAL_STATUS_CANCELLED, WITHDRAWAL_STATUS_FAILED, WITHDRAWAL_STATUS_LABEL_PENDING_REVIEW, WITHDRAWAL_STATUS_LABEL_APPROVED, WITHDRAWAL_STATUS_LABEL_REJECTED, WITHDRAWAL_STATUS_LABEL_PROCESSING, WITHDRAWAL_STATUS_LABEL_AWAITING_LIQUIDATION, WITHDRAWAL_STATUS_LABEL_LIQUIDATION_IN_PROGRESS, WITHDRAWAL_STATUS_LABEL_COMPLETED, WITHDRAWAL_STATUS_LABEL_CANCELLED, WITHDRAWAL_STATUS_LABEL_FAILED, WITHDRAWAL_STATUS_OPTIONS, LIQUIDATION_STATUS_PENDING, LIQUIDATION_STATUS_TRADES_CREATED, LIQUIDATION_STATUS_EXECUTED, LIQUIDATION_STATUS_SETTLED, LIQUIDATION_STATUS_FAILED, LIQUIDATION_STATUS_LABEL_PENDING, LIQUIDATION_STATUS_LABEL_TRADES_CREATED, LIQUIDATION_STATUS_LABEL_EXECUTED, LIQUIDATION_STATUS_LABEL_SETTLED, LIQUIDATION_STATUS_LABEL_FAILED, LIQUIDATION_STATUS_OPTIONS, WITHDRAWAL_TYPE_FULL_CASH, WITHDRAWAL_TYPE_PARTIAL_CASH, WITHDRAWAL_TYPE_LABEL_FULL_CASH, WITHDRAWAL_TYPE_LABEL_PARTIAL_CASH, WITHDRAWAL_TYPE_OPTIONS, WITHDRAWAL_REASON_INVESTMENT_STRATEGY, WITHDRAWAL_REASON_PERSONAL_EXPENSES, WITHDRAWAL_REASON_EMERGENCY, WITHDRAWAL_REASON_OTHER, WITHDRAWAL_REASON_LABEL_INVESTMENT_STRATEGY, WITHDRAWAL_REASON_LABEL_PERSONAL_EXPENSES, WITHDRAWAL_REASON_LABEL_EMERGENCY, WITHDRAWAL_REASON_LABEL_OTHER, WITHDRAWAL_REASON_OPTIONS, } from './constants';
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/withdrawals/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,wBAAwB,EACxB,iCAAiC,EACjC,4BAA4B,EAC5B,qCAAqC,EACrC,2BAA2B,EAC3B,oCAAoC,EACpC,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,sBAAsB,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,gCAAgC,EAChC,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,sCAAsC,EACtC,yCAAyC,EACzC,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,sCAAsC,EACtC,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,4CAA4C,EAC5C,+CAA+C,EAC/C,iCAAiC,EACjC,iCAAiC,EACjC,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC1B,iCAAiC,EACjC,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,gCAAgC,EAChC,uCAAuC,EACvC,iCAAiC,EACjC,gCAAgC,EAChC,+BAA+B,EAC/B,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,+BAA+B,EAC/B,kCAAkC,EAClC,uBAAuB,EACvB,qCAAqC,EACrC,mCAAmC,EACnC,2BAA2B,EAC3B,uBAAuB,EACvB,2CAA2C,EAC3C,yCAAyC,EACzC,iCAAiC,EACjC,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,aAAa,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// Export sub-services
|
|
2
|
-
export * as WithdrawalRequests from './withdrawal_requests';
|
|
3
|
-
export * as WithdrawalLiquidations from './withdrawal_liquidations';
|
|
4
|
-
// Export utility functions
|
|
5
|
-
export { formatWithdrawalAmount, getStatusColor, getStatusLabel, getWithdrawalTypeLabel, getReasonLabel, formatLiquidationValue, getLiquidationStatusColor, getLiquidationStatusLabel, calculateLiquidationProgress, getTotalEstimatedValue, formatSharesQuantity, } from './utils';
|
|
6
|
-
// Export constants as values
|
|
7
|
-
export { WITHDRAWAL_STATUS_PENDING_REVIEW, WITHDRAWAL_STATUS_APPROVED, WITHDRAWAL_STATUS_REJECTED, WITHDRAWAL_STATUS_PROCESSING, WITHDRAWAL_STATUS_AWAITING_LIQUIDATION, WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS, WITHDRAWAL_STATUS_COMPLETED, WITHDRAWAL_STATUS_CANCELLED, WITHDRAWAL_STATUS_FAILED, WITHDRAWAL_STATUS_LABEL_PENDING_REVIEW, WITHDRAWAL_STATUS_LABEL_APPROVED, WITHDRAWAL_STATUS_LABEL_REJECTED, WITHDRAWAL_STATUS_LABEL_PROCESSING, WITHDRAWAL_STATUS_LABEL_AWAITING_LIQUIDATION, WITHDRAWAL_STATUS_LABEL_LIQUIDATION_IN_PROGRESS, WITHDRAWAL_STATUS_LABEL_COMPLETED, WITHDRAWAL_STATUS_LABEL_CANCELLED, WITHDRAWAL_STATUS_LABEL_FAILED, WITHDRAWAL_STATUS_OPTIONS, LIQUIDATION_STATUS_PENDING, LIQUIDATION_STATUS_TRADES_CREATED, LIQUIDATION_STATUS_EXECUTED, LIQUIDATION_STATUS_SETTLED, LIQUIDATION_STATUS_FAILED, LIQUIDATION_STATUS_LABEL_PENDING, LIQUIDATION_STATUS_LABEL_TRADES_CREATED, LIQUIDATION_STATUS_LABEL_EXECUTED, LIQUIDATION_STATUS_LABEL_SETTLED, LIQUIDATION_STATUS_LABEL_FAILED, LIQUIDATION_STATUS_OPTIONS, WITHDRAWAL_TYPE_FULL_CASH, WITHDRAWAL_TYPE_PARTIAL_CASH, WITHDRAWAL_TYPE_LABEL_FULL_CASH, WITHDRAWAL_TYPE_LABEL_PARTIAL_CASH, WITHDRAWAL_TYPE_OPTIONS, WITHDRAWAL_REASON_INVESTMENT_STRATEGY, WITHDRAWAL_REASON_PERSONAL_EXPENSES, WITHDRAWAL_REASON_EMERGENCY, WITHDRAWAL_REASON_OTHER, WITHDRAWAL_REASON_LABEL_INVESTMENT_STRATEGY, WITHDRAWAL_REASON_LABEL_PERSONAL_EXPENSES, WITHDRAWAL_REASON_LABEL_EMERGENCY, WITHDRAWAL_REASON_LABEL_OTHER, WITHDRAWAL_REASON_OPTIONS, } from './constants';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * as WithdrawalRequests from './withdrawal_requests';
|
|
2
|
-
export * as WithdrawalLiquidations from './withdrawal_liquidations';
|
|
3
|
-
export { formatWithdrawalAmount, getStatusColor, getStatusLabel, getWithdrawalTypeLabel, getReasonLabel, formatLiquidationValue, getLiquidationStatusColor, getLiquidationStatusLabel, calculateLiquidationProgress, getTotalEstimatedValue, formatSharesQuantity, } from './utils';
|
|
4
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/withdrawals/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,sBAAsB,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Main service functions combining withdrawal requests and liquidations
|
|
2
|
-
export * as WithdrawalRequests from './withdrawal_requests';
|
|
3
|
-
export * as WithdrawalLiquidations from './withdrawal_liquidations';
|
|
4
|
-
// Re-export utility functions at the top level for convenience
|
|
5
|
-
export { formatWithdrawalAmount, getStatusColor, getStatusLabel, getWithdrawalTypeLabel, getReasonLabel, formatLiquidationValue, getLiquidationStatusColor, getLiquidationStatusLabel, calculateLiquidationProgress, getTotalEstimatedValue, formatSharesQuantity, } from './utils';
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { PaginatedResponse } from '../../api/types';
|
|
2
|
-
export type WithdrawalStatus = 'PENDING_REVIEW' | 'APPROVED' | 'REJECTED' | 'PROCESSING' | 'AWAITING_LIQUIDATION' | 'LIQUIDATION_IN_PROGRESS' | 'COMPLETED' | 'CANCELLED' | 'FAILED';
|
|
3
|
-
export type WithdrawalType = 'FULL_CASH' | 'PARTIAL_CASH';
|
|
4
|
-
export type WithdrawalReason = 'INVESTMENT_STRATEGY' | 'PERSONAL_EXPENSES' | 'EMERGENCY' | 'OTHER';
|
|
5
|
-
export type WithdrawalLiquidationStatus = 'PENDING' | 'TRADES_CREATED' | 'EXECUTED' | 'SETTLED' | 'FAILED';
|
|
6
|
-
export interface WithdrawalRequest {
|
|
7
|
-
uuid: string;
|
|
8
|
-
account: string;
|
|
9
|
-
requestedBy: string;
|
|
10
|
-
requestedAmount: string;
|
|
11
|
-
withdrawalType: WithdrawalType;
|
|
12
|
-
status: WithdrawalStatus;
|
|
13
|
-
requestedDate: string;
|
|
14
|
-
targetTradeSheet: string | null;
|
|
15
|
-
reason: WithdrawalReason | null;
|
|
16
|
-
createdAt: string;
|
|
17
|
-
updatedAt: string;
|
|
18
|
-
}
|
|
19
|
-
export interface WithdrawalAssetLiquidation {
|
|
20
|
-
uuid: string;
|
|
21
|
-
withdrawalRequest: string;
|
|
22
|
-
assetHolding: string;
|
|
23
|
-
sharesToLiquidate: number;
|
|
24
|
-
estimatedValue: string;
|
|
25
|
-
targetCompletionDate: string | null;
|
|
26
|
-
expectedSettlementDate: string | null;
|
|
27
|
-
liquidationStatus: WithdrawalLiquidationStatus;
|
|
28
|
-
targetTrade: string | null;
|
|
29
|
-
instrumentName: string;
|
|
30
|
-
instrumentSymbol: string;
|
|
31
|
-
instrumentCurrency: string | null;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
}
|
|
35
|
-
export interface WithdrawalRequestPayload {
|
|
36
|
-
account: string;
|
|
37
|
-
requestedAmount: string;
|
|
38
|
-
withdrawalType?: WithdrawalType;
|
|
39
|
-
targetTradeSheet?: string | null;
|
|
40
|
-
reason?: WithdrawalReason | null;
|
|
41
|
-
}
|
|
42
|
-
export interface WithdrawalAssetLiquidationPayload {
|
|
43
|
-
withdrawalRequest: string;
|
|
44
|
-
assetHolding: string;
|
|
45
|
-
sharesToLiquidate: number;
|
|
46
|
-
estimatedValue: string;
|
|
47
|
-
targetCompletionDate?: string | null;
|
|
48
|
-
expectedSettlementDate?: string | null;
|
|
49
|
-
liquidationStatus?: WithdrawalLiquidationStatus;
|
|
50
|
-
targetTrade?: string | null;
|
|
51
|
-
}
|
|
52
|
-
export interface WithdrawalRequestQueryParams {
|
|
53
|
-
account?: string;
|
|
54
|
-
status?: string;
|
|
55
|
-
withdrawal_type?: string;
|
|
56
|
-
start_date?: string;
|
|
57
|
-
end_date?: string;
|
|
58
|
-
min_amount?: string;
|
|
59
|
-
max_amount?: string;
|
|
60
|
-
order_by?: string;
|
|
61
|
-
page?: number;
|
|
62
|
-
page_size?: number;
|
|
63
|
-
}
|
|
64
|
-
export interface WithdrawalAssetLiquidationQueryParams {
|
|
65
|
-
withdrawal_request?: string;
|
|
66
|
-
asset_holding?: string;
|
|
67
|
-
liquidation_status?: string;
|
|
68
|
-
target_completion_start_date?: string;
|
|
69
|
-
target_completion_end_date?: string;
|
|
70
|
-
expected_settlement_start_date?: string;
|
|
71
|
-
expected_settlement_end_date?: string;
|
|
72
|
-
target_trade?: string;
|
|
73
|
-
min_value?: string;
|
|
74
|
-
max_value?: string;
|
|
75
|
-
order_by?: string;
|
|
76
|
-
page?: number;
|
|
77
|
-
page_size?: number;
|
|
78
|
-
}
|
|
79
|
-
export type PaginatedWithdrawalRequests = PaginatedResponse<WithdrawalRequest>;
|
|
80
|
-
export type PaginatedWithdrawalAssetLiquidations = PaginatedResponse<WithdrawalAssetLiquidation>;
|
|
81
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/withdrawals/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,sBAAsB,GACtB,yBAAyB,GACzB,WAAW,GACX,WAAW,GACX,QAAQ,CAAC;AAGb,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,cAAc,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,WAAW,GAAG,OAAO,CAAC;AAGnG,MAAM,MAAM,2BAA2B,GAAG,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAG3G,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,iBAAiB,EAAE,2BAA2B,CAAC;IAC/C,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAClC;AAGD,MAAM,WAAW,iCAAiC;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAGD,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,WAAW,qCAAqC;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,2BAA2B,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAC/E,MAAM,MAAM,oCAAoC,GAAG,iBAAiB,CAAC,0BAA0B,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalRequest, WithdrawalAssetLiquidation } from './types';
|
|
2
|
-
export declare const formatWithdrawalAmount: (amount: string | number) => string;
|
|
3
|
-
export declare const getStatusColor: (status: WithdrawalRequest["status"]) => string;
|
|
4
|
-
export declare const getStatusLabel: (status: WithdrawalRequest["status"]) => string;
|
|
5
|
-
export declare const getWithdrawalTypeLabel: (type: WithdrawalRequest["withdrawalType"]) => string;
|
|
6
|
-
export declare const getReasonLabel: (reason: WithdrawalRequest["reason"]) => string;
|
|
7
|
-
export declare const formatLiquidationValue: (value: string | number) => string;
|
|
8
|
-
export declare const getLiquidationStatusColor: (status: WithdrawalAssetLiquidation["liquidationStatus"]) => string;
|
|
9
|
-
export declare const getLiquidationStatusLabel: (status: WithdrawalAssetLiquidation["liquidationStatus"]) => string;
|
|
10
|
-
export declare const calculateLiquidationProgress: (liquidations: WithdrawalAssetLiquidation[]) => {
|
|
11
|
-
total: number;
|
|
12
|
-
pending: number;
|
|
13
|
-
inProgress: number;
|
|
14
|
-
completed: number;
|
|
15
|
-
failed: number;
|
|
16
|
-
completionRate: number;
|
|
17
|
-
};
|
|
18
|
-
export declare const getTotalEstimatedValue: (liquidations: WithdrawalAssetLiquidation[]) => number;
|
|
19
|
-
export declare const formatSharesQuantity: (shares: number) => string;
|
|
20
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/services/withdrawals/utils.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAG7E,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,GAAG,MAAM,KAAG,MAMhE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,KAAG,MAapE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,KAAG,MAapE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,KAAG,MAMlF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,KAAG,MAUpE,CAAC;AAGF,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,GAAG,MAAM,KAAG,MAM/D,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,0BAA0B,CAAC,mBAAmB,CAAC,KAAG,MASnG,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,QAAQ,0BAA0B,CAAC,mBAAmB,CAAC,KAAG,MASnG,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,cAAc,0BAA0B,EAAE,KACzC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CAmBxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,cAAc,0BAA0B,EAAE,KAAG,MAInF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,MAKrD,CAAC"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { WITHDRAWAL_STATUS_PENDING_REVIEW, WITHDRAWAL_STATUS_APPROVED, WITHDRAWAL_STATUS_REJECTED, WITHDRAWAL_STATUS_PROCESSING, WITHDRAWAL_STATUS_AWAITING_LIQUIDATION, WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS, WITHDRAWAL_STATUS_COMPLETED, WITHDRAWAL_STATUS_CANCELLED, WITHDRAWAL_STATUS_FAILED, WITHDRAWAL_STATUS_LABEL_PENDING_REVIEW, WITHDRAWAL_STATUS_LABEL_APPROVED, WITHDRAWAL_STATUS_LABEL_REJECTED, WITHDRAWAL_STATUS_LABEL_PROCESSING, WITHDRAWAL_STATUS_LABEL_AWAITING_LIQUIDATION, WITHDRAWAL_STATUS_LABEL_LIQUIDATION_IN_PROGRESS, WITHDRAWAL_STATUS_LABEL_COMPLETED, WITHDRAWAL_STATUS_LABEL_CANCELLED, WITHDRAWAL_STATUS_LABEL_FAILED, WITHDRAWAL_TYPE_FULL_CASH, WITHDRAWAL_TYPE_PARTIAL_CASH, WITHDRAWAL_TYPE_LABEL_FULL_CASH, WITHDRAWAL_TYPE_LABEL_PARTIAL_CASH, WITHDRAWAL_REASON_INVESTMENT_STRATEGY, WITHDRAWAL_REASON_PERSONAL_EXPENSES, WITHDRAWAL_REASON_EMERGENCY, WITHDRAWAL_REASON_OTHER, WITHDRAWAL_REASON_LABEL_INVESTMENT_STRATEGY, WITHDRAWAL_REASON_LABEL_PERSONAL_EXPENSES, WITHDRAWAL_REASON_LABEL_EMERGENCY, WITHDRAWAL_REASON_LABEL_OTHER, LIQUIDATION_STATUS_PENDING, LIQUIDATION_STATUS_TRADES_CREATED, LIQUIDATION_STATUS_EXECUTED, LIQUIDATION_STATUS_SETTLED, LIQUIDATION_STATUS_FAILED, LIQUIDATION_STATUS_LABEL_PENDING, LIQUIDATION_STATUS_LABEL_TRADES_CREATED, LIQUIDATION_STATUS_LABEL_EXECUTED, LIQUIDATION_STATUS_LABEL_SETTLED, LIQUIDATION_STATUS_LABEL_FAILED, } from './constants';
|
|
2
|
-
// Withdrawal request formatting utilities
|
|
3
|
-
export const formatWithdrawalAmount = (amount) => {
|
|
4
|
-
const numValue = typeof amount === 'string' ? parseFloat(amount) : amount;
|
|
5
|
-
return new Intl.NumberFormat('en-AU', {
|
|
6
|
-
style: 'currency',
|
|
7
|
-
currency: 'AUD',
|
|
8
|
-
}).format(numValue);
|
|
9
|
-
};
|
|
10
|
-
export const getStatusColor = (status) => {
|
|
11
|
-
const statusColors = {
|
|
12
|
-
[WITHDRAWAL_STATUS_PENDING_REVIEW]: 'text-warning-600',
|
|
13
|
-
[WITHDRAWAL_STATUS_APPROVED]: 'text-success-600',
|
|
14
|
-
[WITHDRAWAL_STATUS_REJECTED]: 'text-error-600',
|
|
15
|
-
[WITHDRAWAL_STATUS_PROCESSING]: 'text-primary-600',
|
|
16
|
-
[WITHDRAWAL_STATUS_AWAITING_LIQUIDATION]: 'text-warning-600',
|
|
17
|
-
[WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS]: 'text-primary-600',
|
|
18
|
-
[WITHDRAWAL_STATUS_COMPLETED]: 'text-success-600',
|
|
19
|
-
[WITHDRAWAL_STATUS_CANCELLED]: 'text-content-muted',
|
|
20
|
-
[WITHDRAWAL_STATUS_FAILED]: 'text-error-600',
|
|
21
|
-
};
|
|
22
|
-
return statusColors[status] || 'text-content-muted';
|
|
23
|
-
};
|
|
24
|
-
export const getStatusLabel = (status) => {
|
|
25
|
-
const statusLabels = {
|
|
26
|
-
[WITHDRAWAL_STATUS_PENDING_REVIEW]: WITHDRAWAL_STATUS_LABEL_PENDING_REVIEW,
|
|
27
|
-
[WITHDRAWAL_STATUS_APPROVED]: WITHDRAWAL_STATUS_LABEL_APPROVED,
|
|
28
|
-
[WITHDRAWAL_STATUS_REJECTED]: WITHDRAWAL_STATUS_LABEL_REJECTED,
|
|
29
|
-
[WITHDRAWAL_STATUS_PROCESSING]: WITHDRAWAL_STATUS_LABEL_PROCESSING,
|
|
30
|
-
[WITHDRAWAL_STATUS_AWAITING_LIQUIDATION]: WITHDRAWAL_STATUS_LABEL_AWAITING_LIQUIDATION,
|
|
31
|
-
[WITHDRAWAL_STATUS_LIQUIDATION_IN_PROGRESS]: WITHDRAWAL_STATUS_LABEL_LIQUIDATION_IN_PROGRESS,
|
|
32
|
-
[WITHDRAWAL_STATUS_COMPLETED]: WITHDRAWAL_STATUS_LABEL_COMPLETED,
|
|
33
|
-
[WITHDRAWAL_STATUS_CANCELLED]: WITHDRAWAL_STATUS_LABEL_CANCELLED,
|
|
34
|
-
[WITHDRAWAL_STATUS_FAILED]: WITHDRAWAL_STATUS_LABEL_FAILED,
|
|
35
|
-
};
|
|
36
|
-
return statusLabels[status] || status;
|
|
37
|
-
};
|
|
38
|
-
export const getWithdrawalTypeLabel = (type) => {
|
|
39
|
-
const typeLabels = {
|
|
40
|
-
[WITHDRAWAL_TYPE_FULL_CASH]: WITHDRAWAL_TYPE_LABEL_FULL_CASH,
|
|
41
|
-
[WITHDRAWAL_TYPE_PARTIAL_CASH]: WITHDRAWAL_TYPE_LABEL_PARTIAL_CASH,
|
|
42
|
-
};
|
|
43
|
-
return typeLabels[type] || type;
|
|
44
|
-
};
|
|
45
|
-
export const getReasonLabel = (reason) => {
|
|
46
|
-
if (!reason)
|
|
47
|
-
return 'Not specified';
|
|
48
|
-
const reasonLabels = {
|
|
49
|
-
[WITHDRAWAL_REASON_INVESTMENT_STRATEGY]: WITHDRAWAL_REASON_LABEL_INVESTMENT_STRATEGY,
|
|
50
|
-
[WITHDRAWAL_REASON_PERSONAL_EXPENSES]: WITHDRAWAL_REASON_LABEL_PERSONAL_EXPENSES,
|
|
51
|
-
[WITHDRAWAL_REASON_EMERGENCY]: WITHDRAWAL_REASON_LABEL_EMERGENCY,
|
|
52
|
-
[WITHDRAWAL_REASON_OTHER]: WITHDRAWAL_REASON_LABEL_OTHER,
|
|
53
|
-
};
|
|
54
|
-
return reasonLabels[reason] || reason;
|
|
55
|
-
};
|
|
56
|
-
// Withdrawal liquidation formatting utilities
|
|
57
|
-
export const formatLiquidationValue = (value) => {
|
|
58
|
-
const numValue = typeof value === 'string' ? parseFloat(value) : value;
|
|
59
|
-
return new Intl.NumberFormat('en-AU', {
|
|
60
|
-
style: 'currency',
|
|
61
|
-
currency: 'AUD',
|
|
62
|
-
}).format(numValue);
|
|
63
|
-
};
|
|
64
|
-
export const getLiquidationStatusColor = (status) => {
|
|
65
|
-
const statusColors = {
|
|
66
|
-
[LIQUIDATION_STATUS_PENDING]: 'text-warning-600',
|
|
67
|
-
[LIQUIDATION_STATUS_TRADES_CREATED]: 'text-primary-600',
|
|
68
|
-
[LIQUIDATION_STATUS_EXECUTED]: 'text-accent-secondary',
|
|
69
|
-
[LIQUIDATION_STATUS_SETTLED]: 'text-success-600',
|
|
70
|
-
[LIQUIDATION_STATUS_FAILED]: 'text-error-600',
|
|
71
|
-
};
|
|
72
|
-
return statusColors[status] || 'text-content-muted';
|
|
73
|
-
};
|
|
74
|
-
export const getLiquidationStatusLabel = (status) => {
|
|
75
|
-
const statusLabels = {
|
|
76
|
-
[LIQUIDATION_STATUS_PENDING]: LIQUIDATION_STATUS_LABEL_PENDING,
|
|
77
|
-
[LIQUIDATION_STATUS_TRADES_CREATED]: LIQUIDATION_STATUS_LABEL_TRADES_CREATED,
|
|
78
|
-
[LIQUIDATION_STATUS_EXECUTED]: LIQUIDATION_STATUS_LABEL_EXECUTED,
|
|
79
|
-
[LIQUIDATION_STATUS_SETTLED]: LIQUIDATION_STATUS_LABEL_SETTLED,
|
|
80
|
-
[LIQUIDATION_STATUS_FAILED]: LIQUIDATION_STATUS_LABEL_FAILED,
|
|
81
|
-
};
|
|
82
|
-
return statusLabels[status] || status;
|
|
83
|
-
};
|
|
84
|
-
export const calculateLiquidationProgress = (liquidations) => {
|
|
85
|
-
const total = liquidations.length;
|
|
86
|
-
const pending = liquidations.filter((l) => l.liquidationStatus === LIQUIDATION_STATUS_PENDING).length;
|
|
87
|
-
const inProgress = liquidations.filter((l) => [LIQUIDATION_STATUS_TRADES_CREATED, LIQUIDATION_STATUS_EXECUTED].includes(l.liquidationStatus)).length;
|
|
88
|
-
const completed = liquidations.filter((l) => l.liquidationStatus === LIQUIDATION_STATUS_SETTLED).length;
|
|
89
|
-
const failed = liquidations.filter((l) => l.liquidationStatus === LIQUIDATION_STATUS_FAILED).length;
|
|
90
|
-
const completionRate = total > 0 ? (completed / total) * 100 : 0;
|
|
91
|
-
return {
|
|
92
|
-
total,
|
|
93
|
-
pending,
|
|
94
|
-
inProgress,
|
|
95
|
-
completed,
|
|
96
|
-
failed,
|
|
97
|
-
completionRate,
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
export const getTotalEstimatedValue = (liquidations) => {
|
|
101
|
-
return liquidations.reduce((total, liquidation) => {
|
|
102
|
-
return total + parseFloat(liquidation.estimatedValue || '0');
|
|
103
|
-
}, 0);
|
|
104
|
-
};
|
|
105
|
-
export const formatSharesQuantity = (shares) => {
|
|
106
|
-
return new Intl.NumberFormat('en-AU', {
|
|
107
|
-
minimumFractionDigits: 0,
|
|
108
|
-
maximumFractionDigits: 0,
|
|
109
|
-
}).format(shares);
|
|
110
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type { WithdrawalAssetLiquidation, WithdrawalAssetLiquidationPayload, WithdrawalAssetLiquidationQueryParams, PaginatedWithdrawalAssetLiquidations, WithdrawalLiquidationStatus, } from './types';
|
|
2
|
-
export { getWithdrawalAssetLiquidations, createWithdrawalAssetLiquidation, updateWithdrawalAssetLiquidation, getWithdrawalAssetLiquidationByUuid, deleteWithdrawalAssetLiquidation, getAssetLiquidationsByWithdrawalRequest, } from './service';
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/withdrawals/withdrawal_liquidations/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,0BAA0B,EAC1B,iCAAiC,EACjC,qCAAqC,EACrC,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,8BAA8B,EAC9B,gCAAgC,EAChC,gCAAgC,EAChC,mCAAmC,EACnC,gCAAgC,EAChC,uCAAuC,GACxC,MAAM,WAAW,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalAssetLiquidation, WithdrawalAssetLiquidationPayload, WithdrawalAssetLiquidationQueryParams, PaginatedWithdrawalAssetLiquidations } from './types';
|
|
2
|
-
export declare const getWithdrawalAssetLiquidations: (params?: WithdrawalAssetLiquidationQueryParams) => Promise<import("axios").AxiosResponse<PaginatedWithdrawalAssetLiquidations, any>>;
|
|
3
|
-
export declare const createWithdrawalAssetLiquidation: (data: WithdrawalAssetLiquidationPayload) => Promise<import("axios").AxiosResponse<WithdrawalAssetLiquidation, any>>;
|
|
4
|
-
export declare const updateWithdrawalAssetLiquidation: (uuid: string, data: Partial<WithdrawalAssetLiquidationPayload>) => Promise<import("axios").AxiosResponse<WithdrawalAssetLiquidation, any>>;
|
|
5
|
-
export declare const getWithdrawalAssetLiquidationByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<WithdrawalAssetLiquidation, any>>;
|
|
6
|
-
export declare const deleteWithdrawalAssetLiquidation: (uuid: string) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
7
|
-
export declare const getAssetLiquidationsByWithdrawalRequest: (withdrawalRequestUuid: string) => Promise<import("axios").AxiosResponse<PaginatedWithdrawalAssetLiquidations, any>>;
|
|
8
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/withdrawals/withdrawal_liquidations/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,0BAA0B,EAC1B,iCAAiC,EACjC,qCAAqC,EACrC,oCAAoC,EACrC,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,8BAA8B,GAAI,SAAS,qCAAqC,sFA8C5F,CAAC;AAGF,eAAO,MAAM,gCAAgC,GAAI,MAAM,iCAAiC,4EAEvF,CAAC;AAGF,eAAO,MAAM,gCAAgC,GAAI,MAAM,MAAM,EAAE,MAAM,OAAO,CAAC,iCAAiC,CAAC,4EAE9G,CAAC;AAGF,eAAO,MAAM,mCAAmC,GAAI,MAAM,MAAM,4EAE/D,CAAC;AAGF,eAAO,MAAM,gCAAgC,GAAI,MAAM,MAAM,sDAE5D,CAAC;AAGF,eAAO,MAAM,uCAAuC,GAAI,uBAAuB,MAAM,sFAEpF,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { webApiClient } from '../../../api/apiClient';
|
|
2
|
-
import { API_ENDPOINTS } from '../constants';
|
|
3
|
-
// Fetch withdrawal asset liquidations with optional filtering
|
|
4
|
-
export const getWithdrawalAssetLiquidations = (params) => {
|
|
5
|
-
const queryParams = {};
|
|
6
|
-
if (params?.withdrawal_request) {
|
|
7
|
-
queryParams.withdrawal_request = params.withdrawal_request;
|
|
8
|
-
}
|
|
9
|
-
if (params?.asset_holding) {
|
|
10
|
-
queryParams.asset_holding = params.asset_holding;
|
|
11
|
-
}
|
|
12
|
-
if (params?.liquidation_status) {
|
|
13
|
-
queryParams.liquidation_status = params.liquidation_status;
|
|
14
|
-
}
|
|
15
|
-
if (params?.target_completion_start_date) {
|
|
16
|
-
queryParams.target_completion_start_date = params.target_completion_start_date;
|
|
17
|
-
}
|
|
18
|
-
if (params?.target_completion_end_date) {
|
|
19
|
-
queryParams.target_completion_end_date = params.target_completion_end_date;
|
|
20
|
-
}
|
|
21
|
-
if (params?.expected_settlement_start_date) {
|
|
22
|
-
queryParams.expected_settlement_start_date = params.expected_settlement_start_date;
|
|
23
|
-
}
|
|
24
|
-
if (params?.expected_settlement_end_date) {
|
|
25
|
-
queryParams.expected_settlement_end_date = params.expected_settlement_end_date;
|
|
26
|
-
}
|
|
27
|
-
if (params?.target_trade) {
|
|
28
|
-
queryParams.target_trade = params.target_trade;
|
|
29
|
-
}
|
|
30
|
-
if (params?.min_value) {
|
|
31
|
-
queryParams.min_value = params.min_value;
|
|
32
|
-
}
|
|
33
|
-
if (params?.max_value) {
|
|
34
|
-
queryParams.max_value = params.max_value;
|
|
35
|
-
}
|
|
36
|
-
if (params?.order_by) {
|
|
37
|
-
queryParams.order_by = params.order_by;
|
|
38
|
-
}
|
|
39
|
-
if (params?.page) {
|
|
40
|
-
queryParams.page = params.page;
|
|
41
|
-
}
|
|
42
|
-
if (params?.page_size) {
|
|
43
|
-
queryParams.page_size = params.page_size;
|
|
44
|
-
}
|
|
45
|
-
return webApiClient.get(API_ENDPOINTS.WITHDRAWAL_LIQUIDATIONS, {
|
|
46
|
-
params: queryParams,
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
// Create a new withdrawal asset liquidation
|
|
50
|
-
export const createWithdrawalAssetLiquidation = (data) => {
|
|
51
|
-
return webApiClient.post(API_ENDPOINTS.WITHDRAWAL_LIQUIDATIONS, data);
|
|
52
|
-
};
|
|
53
|
-
// Update an existing withdrawal asset liquidation by UUID
|
|
54
|
-
export const updateWithdrawalAssetLiquidation = (uuid, data) => {
|
|
55
|
-
return webApiClient.patch(`${API_ENDPOINTS.WITHDRAWAL_LIQUIDATIONS}${uuid}/`, data);
|
|
56
|
-
};
|
|
57
|
-
// Get withdrawal asset liquidation by UUID
|
|
58
|
-
export const getWithdrawalAssetLiquidationByUuid = (uuid) => {
|
|
59
|
-
return webApiClient.get(`${API_ENDPOINTS.WITHDRAWAL_LIQUIDATIONS}${uuid}/`);
|
|
60
|
-
};
|
|
61
|
-
// Delete a withdrawal asset liquidation by UUID
|
|
62
|
-
export const deleteWithdrawalAssetLiquidation = (uuid) => {
|
|
63
|
-
return webApiClient.delete(`${API_ENDPOINTS.WITHDRAWAL_LIQUIDATIONS}${uuid}/`);
|
|
64
|
-
};
|
|
65
|
-
// Get asset liquidations for a specific withdrawal request
|
|
66
|
-
export const getAssetLiquidationsByWithdrawalRequest = (withdrawalRequestUuid) => {
|
|
67
|
-
return getWithdrawalAssetLiquidations({ withdrawal_request: withdrawalRequestUuid });
|
|
68
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/withdrawals/withdrawal_liquidations/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,0BAA0B,EAC1B,iCAAiC,EACjC,qCAAqC,EACrC,oCAAoC,EACpC,2BAA2B,GAC5B,MAAM,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export type { WithdrawalRequest, WithdrawalRequestPayload, WithdrawalRequestQueryParams, PaginatedWithdrawalRequests, WithdrawalStatus, WithdrawalType, WithdrawalReason, } from './types';
|
|
2
|
-
export { getWithdrawalRequests, createWithdrawalRequest, updateWithdrawalRequest, getWithdrawalRequestByUuid, deleteWithdrawalRequest, } from './service';
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/withdrawals/withdrawal_requests/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,WAAW,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { WithdrawalRequest, WithdrawalRequestPayload, WithdrawalRequestQueryParams, PaginatedWithdrawalRequests } from './types';
|
|
2
|
-
export declare const getWithdrawalRequests: (params?: WithdrawalRequestQueryParams) => Promise<import("axios").AxiosResponse<PaginatedWithdrawalRequests, any>>;
|
|
3
|
-
export declare const createWithdrawalRequest: (data: WithdrawalRequestPayload) => Promise<import("axios").AxiosResponse<WithdrawalRequest, any>>;
|
|
4
|
-
export declare const updateWithdrawalRequest: (uuid: string, data: Partial<WithdrawalRequestPayload>) => Promise<import("axios").AxiosResponse<WithdrawalRequest, any>>;
|
|
5
|
-
export declare const getWithdrawalRequestByUuid: (uuid: string) => Promise<import("axios").AxiosResponse<WithdrawalRequest, any>>;
|
|
6
|
-
export declare const deleteWithdrawalRequest: (uuid: string) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
7
|
-
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/services/withdrawals/withdrawal_requests/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAGjB,eAAO,MAAM,qBAAqB,GAAI,SAAS,4BAA4B,6EAqC1E,CAAC;AAGF,eAAO,MAAM,uBAAuB,GAAI,MAAM,wBAAwB,mEAErE,CAAC;AAGF,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,EAAE,MAAM,OAAO,CAAC,wBAAwB,CAAC,mEAE5F,CAAC;AAGF,eAAO,MAAM,0BAA0B,GAAI,MAAM,MAAM,mEAEtD,CAAC;AAGF,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,sDAEnD,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { webApiClient } from '../../../api/apiClient';
|
|
2
|
-
import { API_ENDPOINTS } from '../constants';
|
|
3
|
-
// Fetch withdrawal requests with optional filtering
|
|
4
|
-
export const getWithdrawalRequests = (params) => {
|
|
5
|
-
const queryParams = {};
|
|
6
|
-
if (params?.account) {
|
|
7
|
-
queryParams.account = params.account;
|
|
8
|
-
}
|
|
9
|
-
if (params?.status) {
|
|
10
|
-
queryParams.status = params.status;
|
|
11
|
-
}
|
|
12
|
-
if (params?.withdrawal_type) {
|
|
13
|
-
queryParams.withdrawal_type = params.withdrawal_type;
|
|
14
|
-
}
|
|
15
|
-
if (params?.start_date) {
|
|
16
|
-
queryParams.start_date = params.start_date;
|
|
17
|
-
}
|
|
18
|
-
if (params?.end_date) {
|
|
19
|
-
queryParams.end_date = params.end_date;
|
|
20
|
-
}
|
|
21
|
-
if (params?.min_amount) {
|
|
22
|
-
queryParams.min_amount = params.min_amount;
|
|
23
|
-
}
|
|
24
|
-
if (params?.max_amount) {
|
|
25
|
-
queryParams.max_amount = params.max_amount;
|
|
26
|
-
}
|
|
27
|
-
if (params?.order_by) {
|
|
28
|
-
queryParams.order_by = params.order_by;
|
|
29
|
-
}
|
|
30
|
-
if (params?.page) {
|
|
31
|
-
queryParams.page = params.page;
|
|
32
|
-
}
|
|
33
|
-
if (params?.page_size) {
|
|
34
|
-
queryParams.page_size = params.page_size;
|
|
35
|
-
}
|
|
36
|
-
return webApiClient.get(API_ENDPOINTS.WITHDRAWAL_REQUESTS, {
|
|
37
|
-
params: queryParams,
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
// Create a new withdrawal request
|
|
41
|
-
export const createWithdrawalRequest = (data) => {
|
|
42
|
-
return webApiClient.post(API_ENDPOINTS.WITHDRAWAL_REQUESTS, data);
|
|
43
|
-
};
|
|
44
|
-
// Update an existing withdrawal request by UUID
|
|
45
|
-
export const updateWithdrawalRequest = (uuid, data) => {
|
|
46
|
-
return webApiClient.patch(`${API_ENDPOINTS.WITHDRAWAL_REQUESTS}${uuid}/`, data);
|
|
47
|
-
};
|
|
48
|
-
// Get withdrawal request by UUID
|
|
49
|
-
export const getWithdrawalRequestByUuid = (uuid) => {
|
|
50
|
-
return webApiClient.get(`${API_ENDPOINTS.WITHDRAWAL_REQUESTS}${uuid}/`);
|
|
51
|
-
};
|
|
52
|
-
// Delete a withdrawal request by UUID
|
|
53
|
-
export const deleteWithdrawalRequest = (uuid) => {
|
|
54
|
-
return webApiClient.delete(`${API_ENDPOINTS.WITHDRAWAL_REQUESTS}${uuid}/`);
|
|
55
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/services/withdrawals/withdrawal_requests/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|