wbportfolio 2.2.1__py2.py3-none-any.whl
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.
Potentially problematic release.
This version of wbportfolio might be problematic. Click here for more details.
- wbportfolio/__init__.py +1 -0
- wbportfolio/admin/__init__.py +12 -0
- wbportfolio/admin/asset.py +47 -0
- wbportfolio/admin/custodians.py +9 -0
- wbportfolio/admin/portfolio.py +127 -0
- wbportfolio/admin/portfolio_relationships.py +22 -0
- wbportfolio/admin/product_groups.py +42 -0
- wbportfolio/admin/products.py +80 -0
- wbportfolio/admin/reconciliations.py +14 -0
- wbportfolio/admin/registers.py +17 -0
- wbportfolio/admin/roles.py +19 -0
- wbportfolio/admin/synchronization/__init__.py +2 -0
- wbportfolio/admin/synchronization/admin.py +114 -0
- wbportfolio/admin/synchronization/portfolio_synchronization.py +18 -0
- wbportfolio/admin/synchronization/price_computation.py +21 -0
- wbportfolio/admin/transactions/__init__.py +5 -0
- wbportfolio/admin/transactions/claim.py +16 -0
- wbportfolio/admin/transactions/dividends.py +14 -0
- wbportfolio/admin/transactions/fees.py +35 -0
- wbportfolio/admin/transactions/trades.py +49 -0
- wbportfolio/admin/transactions/transactions.py +37 -0
- wbportfolio/analysis/__init__.py +0 -0
- wbportfolio/analysis/claims.py +235 -0
- wbportfolio/apps.py +5 -0
- wbportfolio/contrib/__init__.py +0 -0
- wbportfolio/contrib/company_portfolio/__init__.py +0 -0
- wbportfolio/contrib/company_portfolio/admin.py +28 -0
- wbportfolio/contrib/company_portfolio/apps.py +29 -0
- wbportfolio/contrib/company_portfolio/configs/__init__.py +3 -0
- wbportfolio/contrib/company_portfolio/configs/display.py +182 -0
- wbportfolio/contrib/company_portfolio/configs/endpoints.py +34 -0
- wbportfolio/contrib/company_portfolio/configs/previews.py +37 -0
- wbportfolio/contrib/company_portfolio/constants.py +1 -0
- wbportfolio/contrib/company_portfolio/dynamic_preferences_registry.py +87 -0
- wbportfolio/contrib/company_portfolio/factories.py +32 -0
- wbportfolio/contrib/company_portfolio/filters.py +127 -0
- wbportfolio/contrib/company_portfolio/management.py +19 -0
- wbportfolio/contrib/company_portfolio/migrations/0001_initial.py +214 -0
- wbportfolio/contrib/company_portfolio/migrations/__init__.py +0 -0
- wbportfolio/contrib/company_portfolio/models.py +334 -0
- wbportfolio/contrib/company_portfolio/scripts.py +76 -0
- wbportfolio/contrib/company_portfolio/serializers.py +303 -0
- wbportfolio/contrib/company_portfolio/tasks.py +19 -0
- wbportfolio/contrib/company_portfolio/tests/__init__.py +0 -0
- wbportfolio/contrib/company_portfolio/tests/conftest.py +161 -0
- wbportfolio/contrib/company_portfolio/tests/test_models.py +161 -0
- wbportfolio/contrib/company_portfolio/urls.py +29 -0
- wbportfolio/contrib/company_portfolio/viewsets.py +195 -0
- wbportfolio/defaults/__init__.py +0 -0
- wbportfolio/defaults/fees/__init__.py +0 -0
- wbportfolio/defaults/fees/default.py +92 -0
- wbportfolio/defaults/portfolio/__init__.py +0 -0
- wbportfolio/defaults/portfolio/default_rebalancing.py +45 -0
- wbportfolio/dynamic_preferences_registry.py +58 -0
- wbportfolio/factories/__init__.py +35 -0
- wbportfolio/factories/adjustments.py +17 -0
- wbportfolio/factories/assets.py +75 -0
- wbportfolio/factories/claim.py +39 -0
- wbportfolio/factories/custodians.py +11 -0
- wbportfolio/factories/dividends.py +14 -0
- wbportfolio/factories/fees.py +15 -0
- wbportfolio/factories/indexes.py +17 -0
- wbportfolio/factories/portfolio_cash_flow.py +20 -0
- wbportfolio/factories/portfolio_cash_targets.py +15 -0
- wbportfolio/factories/portfolio_swing_pricings.py +15 -0
- wbportfolio/factories/portfolios.py +59 -0
- wbportfolio/factories/product_groups.py +28 -0
- wbportfolio/factories/products.py +56 -0
- wbportfolio/factories/pytest_utils.py +121 -0
- wbportfolio/factories/reconciliations.py +23 -0
- wbportfolio/factories/roles.py +20 -0
- wbportfolio/factories/synchronization.py +40 -0
- wbportfolio/factories/trades.py +35 -0
- wbportfolio/factories/transactions.py +21 -0
- wbportfolio/fdm/__init__.py +0 -0
- wbportfolio/fdm/tasks.py +12 -0
- wbportfolio/filters/__init__.py +32 -0
- wbportfolio/filters/assets.py +485 -0
- wbportfolio/filters/assets_and_net_new_money_progression.py +42 -0
- wbportfolio/filters/custodians.py +10 -0
- wbportfolio/filters/esg.py +22 -0
- wbportfolio/filters/performances.py +171 -0
- wbportfolio/filters/portfolios.py +24 -0
- wbportfolio/filters/positions.py +178 -0
- wbportfolio/filters/products.py +157 -0
- wbportfolio/filters/roles.py +26 -0
- wbportfolio/filters/signals.py +92 -0
- wbportfolio/filters/transactions/__init__.py +20 -0
- wbportfolio/filters/transactions/claim.py +394 -0
- wbportfolio/filters/transactions/fees.py +66 -0
- wbportfolio/filters/transactions/trades.py +224 -0
- wbportfolio/filters/transactions/transactions.py +98 -0
- wbportfolio/import_export/__init__.py +0 -0
- wbportfolio/import_export/backends/__init__.py +2 -0
- wbportfolio/import_export/backends/ubs/__init__.py +3 -0
- wbportfolio/import_export/backends/ubs/asset_position.py +45 -0
- wbportfolio/import_export/backends/ubs/fees.py +63 -0
- wbportfolio/import_export/backends/ubs/instrument_price.py +44 -0
- wbportfolio/import_export/backends/ubs/mixin.py +15 -0
- wbportfolio/import_export/backends/utils.py +58 -0
- wbportfolio/import_export/backends/wbfdm/__init__.py +2 -0
- wbportfolio/import_export/backends/wbfdm/adjustment.py +50 -0
- wbportfolio/import_export/backends/wbfdm/dividend.py +16 -0
- wbportfolio/import_export/backends/wbfdm/mixin.py +15 -0
- wbportfolio/import_export/handlers/__init__.py +0 -0
- wbportfolio/import_export/handlers/adjustment.py +39 -0
- wbportfolio/import_export/handlers/asset_position.py +167 -0
- wbportfolio/import_export/handlers/dividend.py +80 -0
- wbportfolio/import_export/handlers/fees.py +58 -0
- wbportfolio/import_export/handlers/portfolio_cash_flow.py +57 -0
- wbportfolio/import_export/handlers/register.py +43 -0
- wbportfolio/import_export/handlers/trade.py +191 -0
- wbportfolio/import_export/parsers/__init__.py +0 -0
- wbportfolio/import_export/parsers/default_mapping.py +30 -0
- wbportfolio/import_export/parsers/jpmorgan/__init__.py +0 -0
- wbportfolio/import_export/parsers/jpmorgan/customer_trade.py +63 -0
- wbportfolio/import_export/parsers/jpmorgan/fees.py +64 -0
- wbportfolio/import_export/parsers/jpmorgan/strategy.py +116 -0
- wbportfolio/import_export/parsers/jpmorgan/valuation.py +41 -0
- wbportfolio/import_export/parsers/leonteq/__init__.py +0 -0
- wbportfolio/import_export/parsers/leonteq/customer_trade.py +47 -0
- wbportfolio/import_export/parsers/leonteq/equity.py +81 -0
- wbportfolio/import_export/parsers/leonteq/fees.py +70 -0
- wbportfolio/import_export/parsers/leonteq/trade.py +94 -0
- wbportfolio/import_export/parsers/leonteq/valuation.py +39 -0
- wbportfolio/import_export/parsers/natixis/__init__.py +0 -0
- wbportfolio/import_export/parsers/natixis/customer_trade.py +62 -0
- wbportfolio/import_export/parsers/natixis/d1_customer_trade.py +66 -0
- wbportfolio/import_export/parsers/natixis/d1_equity.py +80 -0
- wbportfolio/import_export/parsers/natixis/d1_fees.py +58 -0
- wbportfolio/import_export/parsers/natixis/d1_trade.py +70 -0
- wbportfolio/import_export/parsers/natixis/d1_valuation.py +41 -0
- wbportfolio/import_export/parsers/natixis/dividend.py +53 -0
- wbportfolio/import_export/parsers/natixis/equity.py +60 -0
- wbportfolio/import_export/parsers/natixis/fees.py +53 -0
- wbportfolio/import_export/parsers/natixis/trade.py +63 -0
- wbportfolio/import_export/parsers/natixis/utils.py +76 -0
- wbportfolio/import_export/parsers/natixis/valuation.py +46 -0
- wbportfolio/import_export/parsers/refinitiv/__init__.py +0 -0
- wbportfolio/import_export/parsers/refinitiv/adjustment.py +24 -0
- wbportfolio/import_export/parsers/sg_lux/__init__.py +0 -0
- wbportfolio/import_export/parsers/sg_lux/custodian_positions.py +70 -0
- wbportfolio/import_export/parsers/sg_lux/customer_trade.py +75 -0
- wbportfolio/import_export/parsers/sg_lux/customer_trade_pending_slk.py +140 -0
- wbportfolio/import_export/parsers/sg_lux/customer_trade_slk.py +80 -0
- wbportfolio/import_export/parsers/sg_lux/customer_trade_without_pw.py +57 -0
- wbportfolio/import_export/parsers/sg_lux/equity.py +137 -0
- wbportfolio/import_export/parsers/sg_lux/fees.py +56 -0
- wbportfolio/import_export/parsers/sg_lux/perf_fees.py +51 -0
- wbportfolio/import_export/parsers/sg_lux/portfolio_cash_flow.py +29 -0
- wbportfolio/import_export/parsers/sg_lux/portfolio_future_cash_flow.py +36 -0
- wbportfolio/import_export/parsers/sg_lux/registers.py +210 -0
- wbportfolio/import_export/parsers/sg_lux/sylk.py +248 -0
- wbportfolio/import_export/parsers/sg_lux/utils.py +36 -0
- wbportfolio/import_export/parsers/sg_lux/valuation.py +53 -0
- wbportfolio/import_export/parsers/societe_generale/__init__.py +0 -0
- wbportfolio/import_export/parsers/societe_generale/customer_trade.py +54 -0
- wbportfolio/import_export/parsers/societe_generale/strategy.py +94 -0
- wbportfolio/import_export/parsers/societe_generale/valuation.py +37 -0
- wbportfolio/import_export/parsers/tellco/__init__.py +0 -0
- wbportfolio/import_export/parsers/tellco/customer_trade.py +64 -0
- wbportfolio/import_export/parsers/tellco/equity.py +86 -0
- wbportfolio/import_export/parsers/tellco/valuation.py +52 -0
- wbportfolio/import_export/parsers/ubs/__init__.py +0 -0
- wbportfolio/import_export/parsers/ubs/api/__init__.py +0 -0
- wbportfolio/import_export/parsers/ubs/api/asset_position.py +106 -0
- wbportfolio/import_export/parsers/ubs/api/fees.py +31 -0
- wbportfolio/import_export/parsers/ubs/api/instrument_price.py +20 -0
- wbportfolio/import_export/parsers/ubs/api/utils.py +0 -0
- wbportfolio/import_export/parsers/ubs/customer_trade.py +60 -0
- wbportfolio/import_export/parsers/ubs/equity.py +97 -0
- wbportfolio/import_export/parsers/ubs/historical_customer_trade.py +67 -0
- wbportfolio/import_export/parsers/ubs/valuation.py +52 -0
- wbportfolio/import_export/parsers/vontobel/__init__.py +0 -0
- wbportfolio/import_export/parsers/vontobel/asset_position.py +97 -0
- wbportfolio/import_export/parsers/vontobel/customer_trade.py +54 -0
- wbportfolio/import_export/parsers/vontobel/historical_customer_trade.py +40 -0
- wbportfolio/import_export/parsers/vontobel/instrument.py +34 -0
- wbportfolio/import_export/parsers/vontobel/management_fees.py +86 -0
- wbportfolio/import_export/parsers/vontobel/performance_fees.py +35 -0
- wbportfolio/import_export/parsers/vontobel/trade.py +38 -0
- wbportfolio/import_export/parsers/vontobel/utils.py +17 -0
- wbportfolio/import_export/parsers/vontobel/valuation.py +29 -0
- wbportfolio/import_export/resources/__init__.py +0 -0
- wbportfolio/import_export/resources/assets.py +68 -0
- wbportfolio/import_export/resources/trades.py +41 -0
- wbportfolio/import_export/utils.py +42 -0
- wbportfolio/metric/__init__.py +0 -0
- wbportfolio/metric/backends/__init__.py +2 -0
- wbportfolio/metric/backends/base.py +86 -0
- wbportfolio/metric/backends/constants.py +222 -0
- wbportfolio/metric/backends/portfolio_base.py +255 -0
- wbportfolio/metric/backends/portfolio_esg.py +66 -0
- wbportfolio/metric/tests/__init__.py +0 -0
- wbportfolio/metric/tests/conftest.py +4 -0
- wbportfolio/metric/tests/test_portfolio_base.py +135 -0
- wbportfolio/metric/tests/test_portfolio_esg.py +69 -0
- wbportfolio/migrations/0001_initial_squashed.py +13848 -0
- wbportfolio/migrations/0002_product_default_sub_account_squashed_0039_alter_assetallocation_company_and_more.py +3836 -0
- wbportfolio/migrations/0040_instrument_financial_instrument.py +26 -0
- wbportfolio/migrations/0041_remove_listresearch_research_ptr_and_more.py +129 -0
- wbportfolio/migrations/0042_instrumentlist_instrumentlistthroughmodel_and_more.py +71 -0
- wbportfolio/migrations/0043_alter_instrumentlistthroughmodel_options_and_more.py +238 -0
- wbportfolio/migrations/0044_alter_instrumentlist_identifier.py +35 -0
- wbportfolio/migrations/0045_alter_instrument_financial_instrument.py +26 -0
- wbportfolio/migrations/0046_add_product_default_account.py +166 -0
- wbportfolio/migrations/0047_remove_product_default_sub_account.py +14 -0
- wbportfolio/migrations/0048_alter_trade_status.py +29 -0
- wbportfolio/migrations/0049_trade_claimed_shares.py +25 -0
- wbportfolio/migrations/0050_fees_fee_date_fees_wbportfolio_transac_1f7a29_idx.py +44 -0
- wbportfolio/migrations/0051_delete_macroreview.py +11 -0
- wbportfolio/migrations/0052_remove_cash_instrument_ptr_and_more.py +888 -0
- wbportfolio/migrations/0053_remove_product_group.py +132 -0
- wbportfolio/migrations/0054_portfolioinstrumentpreferredclassificationthroughmodel_and_more.py +270 -0
- wbportfolio/migrations/0055_remove_product__custom_management_rebates_and_more.py +139 -0
- wbportfolio/migrations/0056_remove_companyportfoliodata_assets_under_management_currency_and_more.py +56 -0
- wbportfolio/migrations/0057_alter_portfolio_preferred_instrument_classifications_and_more.py +36 -0
- wbportfolio/migrations/0058_pmsinstrument.py +23 -0
- wbportfolio/migrations/0059_fees_unique_fees.py +51 -0
- wbportfolio/migrations/0060_alter_portfolioportfoliothroughmodel_type.py +21 -0
- wbportfolio/migrations/0061_portfolio_bank_accounts_product_bank_account_and_more.py +175 -0
- wbportfolio/migrations/0062_alter_dailyportfoliocashflow_options.py +20 -0
- wbportfolio/migrations/0063_accountreconciliation_accountreconciliationline_and_more.py +133 -0
- wbportfolio/migrations/0064_alter_portfolio_managers_portfolio_is_tracked_and_more.py +40 -0
- wbportfolio/migrations/0065_alter_portfolio_managers_claim_as_shares_and_more.py +73 -0
- wbportfolio/migrations/0066_assetposition_initial_shares_at_custodian_and_more.py +108 -0
- wbportfolio/migrations/0067_assetposition_unique_asset_position.py +77 -0
- wbportfolio/migrations/0068_trade_internal_trade_trade_marked_as_internal_and_more.py +59 -0
- wbportfolio/migrations/0069_remove_portfolio_is_invested_and_more.py +56 -0
- wbportfolio/migrations/0070_remove_assetposition_unique_asset_position_and_more.py +82 -0
- wbportfolio/migrations/0071_alter_trade_options_alter_trade_order.py +22 -0
- wbportfolio/migrations/__init__.py +0 -0
- wbportfolio/models/__init__.py +26 -0
- wbportfolio/models/adjustments.py +246 -0
- wbportfolio/models/asset.py +869 -0
- wbportfolio/models/custodians.py +101 -0
- wbportfolio/models/indexes.py +33 -0
- wbportfolio/models/mixins/__init__.py +0 -0
- wbportfolio/models/mixins/instruments.py +127 -0
- wbportfolio/models/mixins/liquidity_stress_test.py +1307 -0
- wbportfolio/models/portfolio.py +1039 -0
- wbportfolio/models/portfolio_cash_flow.py +167 -0
- wbportfolio/models/portfolio_cash_targets.py +46 -0
- wbportfolio/models/portfolio_relationship.py +135 -0
- wbportfolio/models/portfolio_swing_pricings.py +51 -0
- wbportfolio/models/product_groups.py +230 -0
- wbportfolio/models/products.py +569 -0
- wbportfolio/models/reconciliations/__init__.py +2 -0
- wbportfolio/models/reconciliations/account_reconciliation_lines.py +192 -0
- wbportfolio/models/reconciliations/account_reconciliations.py +102 -0
- wbportfolio/models/reconciliations/reconciliations.py +25 -0
- wbportfolio/models/registers.py +132 -0
- wbportfolio/models/roles.py +208 -0
- wbportfolio/models/synchronization/__init__.py +3 -0
- wbportfolio/models/synchronization/portfolio_synchronization.py +292 -0
- wbportfolio/models/synchronization/price_computation.py +200 -0
- wbportfolio/models/synchronization/synchronization.py +188 -0
- wbportfolio/models/transactions/__init__.py +7 -0
- wbportfolio/models/transactions/claim.py +634 -0
- wbportfolio/models/transactions/dividends.py +31 -0
- wbportfolio/models/transactions/expiry.py +7 -0
- wbportfolio/models/transactions/fees.py +153 -0
- wbportfolio/models/transactions/trade_proposals.py +502 -0
- wbportfolio/models/transactions/trades.py +704 -0
- wbportfolio/models/transactions/transactions.py +211 -0
- wbportfolio/models/utils.py +12 -0
- wbportfolio/permissions.py +13 -0
- wbportfolio/pms/__init__.py +0 -0
- wbportfolio/pms/statistics/__init__.py +0 -0
- wbportfolio/pms/trading/__init__.py +1 -0
- wbportfolio/pms/trading/handler.py +164 -0
- wbportfolio/pms/typing.py +194 -0
- wbportfolio/preferences.py +6 -0
- wbportfolio/reports/__init__.py +0 -0
- wbportfolio/reports/monthly_position_report.py +74 -0
- wbportfolio/risk_management/__init__.py +0 -0
- wbportfolio/risk_management/backends/__init__.py +11 -0
- wbportfolio/risk_management/backends/accounts.py +166 -0
- wbportfolio/risk_management/backends/controversy_portfolio.py +63 -0
- wbportfolio/risk_management/backends/exposure_portfolio.py +203 -0
- wbportfolio/risk_management/backends/instrument_list_portfolio.py +89 -0
- wbportfolio/risk_management/backends/liquidity_risk.py +86 -0
- wbportfolio/risk_management/backends/liquidity_stress_instrument.py +86 -0
- wbportfolio/risk_management/backends/mixins.py +220 -0
- wbportfolio/risk_management/backends/product_integrity.py +111 -0
- wbportfolio/risk_management/backends/stop_loss_instrument.py +24 -0
- wbportfolio/risk_management/backends/stop_loss_portfolio.py +36 -0
- wbportfolio/risk_management/backends/ucits_portfolio.py +63 -0
- wbportfolio/risk_management/tests/__init__.py +0 -0
- wbportfolio/risk_management/tests/conftest.py +15 -0
- wbportfolio/risk_management/tests/test_accounts.py +98 -0
- wbportfolio/risk_management/tests/test_controversy_portfolio.py +33 -0
- wbportfolio/risk_management/tests/test_exposure_portfolio.py +94 -0
- wbportfolio/risk_management/tests/test_instrument_list_portfolio.py +60 -0
- wbportfolio/risk_management/tests/test_liquidity_risk.py +47 -0
- wbportfolio/risk_management/tests/test_product_integrity.py +55 -0
- wbportfolio/risk_management/tests/test_stop_loss_instrument.py +110 -0
- wbportfolio/risk_management/tests/test_stop_loss_portfolio.py +119 -0
- wbportfolio/risk_management/tests/test_ucits_portfolio.py +39 -0
- wbportfolio/serializers/__init__.py +42 -0
- wbportfolio/serializers/adjustments.py +24 -0
- wbportfolio/serializers/assets.py +166 -0
- wbportfolio/serializers/custodians.py +26 -0
- wbportfolio/serializers/portfolio_cash_flow.py +48 -0
- wbportfolio/serializers/portfolio_cash_targets.py +20 -0
- wbportfolio/serializers/portfolio_relationship.py +53 -0
- wbportfolio/serializers/portfolio_swing_pricing.py +20 -0
- wbportfolio/serializers/portfolios.py +143 -0
- wbportfolio/serializers/positions.py +76 -0
- wbportfolio/serializers/product_group.py +88 -0
- wbportfolio/serializers/products.py +331 -0
- wbportfolio/serializers/reconciliations.py +171 -0
- wbportfolio/serializers/registers.py +72 -0
- wbportfolio/serializers/roles.py +60 -0
- wbportfolio/serializers/signals.py +157 -0
- wbportfolio/serializers/synchronization.py +18 -0
- wbportfolio/serializers/transactions/__init__.py +24 -0
- wbportfolio/serializers/transactions/claim.py +310 -0
- wbportfolio/serializers/transactions/dividends.py +18 -0
- wbportfolio/serializers/transactions/expiry.py +18 -0
- wbportfolio/serializers/transactions/fees.py +32 -0
- wbportfolio/serializers/transactions/trades.py +315 -0
- wbportfolio/serializers/transactions/transactions.py +84 -0
- wbportfolio/tasks.py +125 -0
- wbportfolio/tests/__init__.py +0 -0
- wbportfolio/tests/conftest.py +164 -0
- wbportfolio/tests/models/__init__.py +0 -0
- wbportfolio/tests/models/test_account_reconciliation.py +191 -0
- wbportfolio/tests/models/test_assets.py +193 -0
- wbportfolio/tests/models/test_custodians.py +12 -0
- wbportfolio/tests/models/test_customer_trades.py +113 -0
- wbportfolio/tests/models/test_dividends.py +7 -0
- wbportfolio/tests/models/test_imports.py +192 -0
- wbportfolio/tests/models/test_instrument_mixins.py +48 -0
- wbportfolio/tests/models/test_merge.py +133 -0
- wbportfolio/tests/models/test_portfolio_cash_flow.py +112 -0
- wbportfolio/tests/models/test_portfolio_cash_targets.py +27 -0
- wbportfolio/tests/models/test_portfolio_swing_pricings.py +42 -0
- wbportfolio/tests/models/test_portfolios.py +676 -0
- wbportfolio/tests/models/test_product_groups.py +80 -0
- wbportfolio/tests/models/test_products.py +187 -0
- wbportfolio/tests/models/test_roles.py +82 -0
- wbportfolio/tests/models/test_splits.py +233 -0
- wbportfolio/tests/models/test_synchronization.py +617 -0
- wbportfolio/tests/models/transactions/__init__.py +0 -0
- wbportfolio/tests/models/transactions/test_claim.py +129 -0
- wbportfolio/tests/models/transactions/test_fees.py +65 -0
- wbportfolio/tests/models/transactions/test_trades.py +204 -0
- wbportfolio/tests/models/utils.py +13 -0
- wbportfolio/tests/serializers/__init__.py +0 -0
- wbportfolio/tests/serializers/test_claims.py +21 -0
- wbportfolio/tests/signals.py +151 -0
- wbportfolio/tests/tests.py +31 -0
- wbportfolio/tests/viewsets/__init__.py +0 -0
- wbportfolio/tests/viewsets/test_assets.py +67 -0
- wbportfolio/tests/viewsets/test_performances.py +72 -0
- wbportfolio/tests/viewsets/test_products.py +92 -0
- wbportfolio/tests/viewsets/transactions/__init__.py +0 -0
- wbportfolio/tests/viewsets/transactions/test_claims.py +146 -0
- wbportfolio/urls.py +247 -0
- wbportfolio/utils.py +30 -0
- wbportfolio/viewsets/__init__.py +57 -0
- wbportfolio/viewsets/adjustments.py +46 -0
- wbportfolio/viewsets/assets.py +562 -0
- wbportfolio/viewsets/assets_and_net_new_money_progression.py +117 -0
- wbportfolio/viewsets/charts/__init__.py +1 -0
- wbportfolio/viewsets/charts/assets.py +247 -0
- wbportfolio/viewsets/configs/__init__.py +6 -0
- wbportfolio/viewsets/configs/buttons/__init__.py +23 -0
- wbportfolio/viewsets/configs/buttons/adjustments.py +13 -0
- wbportfolio/viewsets/configs/buttons/assets.py +145 -0
- wbportfolio/viewsets/configs/buttons/claims.py +83 -0
- wbportfolio/viewsets/configs/buttons/custodians.py +76 -0
- wbportfolio/viewsets/configs/buttons/fees.py +14 -0
- wbportfolio/viewsets/configs/buttons/mixins.py +88 -0
- wbportfolio/viewsets/configs/buttons/portfolios.py +115 -0
- wbportfolio/viewsets/configs/buttons/products.py +41 -0
- wbportfolio/viewsets/configs/buttons/reconciliations.py +65 -0
- wbportfolio/viewsets/configs/buttons/registers.py +11 -0
- wbportfolio/viewsets/configs/buttons/signals.py +68 -0
- wbportfolio/viewsets/configs/buttons/trade_proposals.py +25 -0
- wbportfolio/viewsets/configs/buttons/trades.py +144 -0
- wbportfolio/viewsets/configs/display/__init__.py +61 -0
- wbportfolio/viewsets/configs/display/adjustments.py +81 -0
- wbportfolio/viewsets/configs/display/assets.py +265 -0
- wbportfolio/viewsets/configs/display/claim.py +299 -0
- wbportfolio/viewsets/configs/display/custodians.py +24 -0
- wbportfolio/viewsets/configs/display/esg.py +88 -0
- wbportfolio/viewsets/configs/display/fees.py +133 -0
- wbportfolio/viewsets/configs/display/portfolio_cash_flow.py +103 -0
- wbportfolio/viewsets/configs/display/portfolio_relationship.py +38 -0
- wbportfolio/viewsets/configs/display/portfolios.py +125 -0
- wbportfolio/viewsets/configs/display/positions.py +75 -0
- wbportfolio/viewsets/configs/display/product_groups.py +54 -0
- wbportfolio/viewsets/configs/display/product_performance.py +241 -0
- wbportfolio/viewsets/configs/display/products.py +249 -0
- wbportfolio/viewsets/configs/display/reconciliations.py +151 -0
- wbportfolio/viewsets/configs/display/registers.py +71 -0
- wbportfolio/viewsets/configs/display/roles.py +49 -0
- wbportfolio/viewsets/configs/display/trade_proposals.py +97 -0
- wbportfolio/viewsets/configs/display/trades.py +359 -0
- wbportfolio/viewsets/configs/display/transactions.py +55 -0
- wbportfolio/viewsets/configs/endpoints/__init__.py +75 -0
- wbportfolio/viewsets/configs/endpoints/adjustments.py +17 -0
- wbportfolio/viewsets/configs/endpoints/assets.py +115 -0
- wbportfolio/viewsets/configs/endpoints/claim.py +106 -0
- wbportfolio/viewsets/configs/endpoints/custodians.py +6 -0
- wbportfolio/viewsets/configs/endpoints/esg.py +14 -0
- wbportfolio/viewsets/configs/endpoints/fees.py +26 -0
- wbportfolio/viewsets/configs/endpoints/portfolio_relationship.py +23 -0
- wbportfolio/viewsets/configs/endpoints/portfolios.py +43 -0
- wbportfolio/viewsets/configs/endpoints/positions.py +18 -0
- wbportfolio/viewsets/configs/endpoints/product_groups.py +11 -0
- wbportfolio/viewsets/configs/endpoints/product_performance.py +29 -0
- wbportfolio/viewsets/configs/endpoints/products.py +37 -0
- wbportfolio/viewsets/configs/endpoints/reconciliations.py +31 -0
- wbportfolio/viewsets/configs/endpoints/roles.py +9 -0
- wbportfolio/viewsets/configs/endpoints/trade_proposals.py +17 -0
- wbportfolio/viewsets/configs/endpoints/trades.py +82 -0
- wbportfolio/viewsets/configs/endpoints/transactions.py +17 -0
- wbportfolio/viewsets/configs/menu/__init__.py +30 -0
- wbportfolio/viewsets/configs/menu/adjustments.py +8 -0
- wbportfolio/viewsets/configs/menu/assets.py +8 -0
- wbportfolio/viewsets/configs/menu/claim.py +41 -0
- wbportfolio/viewsets/configs/menu/custodians.py +11 -0
- wbportfolio/viewsets/configs/menu/fees.py +13 -0
- wbportfolio/viewsets/configs/menu/instrument_prices.py +10 -0
- wbportfolio/viewsets/configs/menu/portfolio_cash_flow.py +8 -0
- wbportfolio/viewsets/configs/menu/portfolios.py +15 -0
- wbportfolio/viewsets/configs/menu/positions.py +14 -0
- wbportfolio/viewsets/configs/menu/product_groups.py +10 -0
- wbportfolio/viewsets/configs/menu/product_performance.py +25 -0
- wbportfolio/viewsets/configs/menu/products.py +15 -0
- wbportfolio/viewsets/configs/menu/reconciliations.py +7 -0
- wbportfolio/viewsets/configs/menu/registers.py +10 -0
- wbportfolio/viewsets/configs/menu/roles.py +16 -0
- wbportfolio/viewsets/configs/menu/trades.py +18 -0
- wbportfolio/viewsets/configs/menu/transactions.py +8 -0
- wbportfolio/viewsets/configs/previews/__init__.py +1 -0
- wbportfolio/viewsets/configs/previews/portfolios.py +21 -0
- wbportfolio/viewsets/configs/titles/__init__.py +65 -0
- wbportfolio/viewsets/configs/titles/adjustments.py +19 -0
- wbportfolio/viewsets/configs/titles/assets.py +57 -0
- wbportfolio/viewsets/configs/titles/assets_and_net_new_money_progression.py +6 -0
- wbportfolio/viewsets/configs/titles/claim.py +81 -0
- wbportfolio/viewsets/configs/titles/custodians.py +12 -0
- wbportfolio/viewsets/configs/titles/esg.py +10 -0
- wbportfolio/viewsets/configs/titles/fees.py +25 -0
- wbportfolio/viewsets/configs/titles/instrument_prices.py +20 -0
- wbportfolio/viewsets/configs/titles/portfolios.py +32 -0
- wbportfolio/viewsets/configs/titles/positions.py +11 -0
- wbportfolio/viewsets/configs/titles/product_groups.py +12 -0
- wbportfolio/viewsets/configs/titles/product_performance.py +16 -0
- wbportfolio/viewsets/configs/titles/products.py +6 -0
- wbportfolio/viewsets/configs/titles/registers.py +12 -0
- wbportfolio/viewsets/configs/titles/roles.py +23 -0
- wbportfolio/viewsets/configs/titles/trades.py +51 -0
- wbportfolio/viewsets/configs/titles/transactions.py +8 -0
- wbportfolio/viewsets/custodians.py +66 -0
- wbportfolio/viewsets/esg.py +165 -0
- wbportfolio/viewsets/mixins.py +48 -0
- wbportfolio/viewsets/portfolio_cash_flow.py +31 -0
- wbportfolio/viewsets/portfolio_cash_targets.py +8 -0
- wbportfolio/viewsets/portfolio_relationship.py +46 -0
- wbportfolio/viewsets/portfolio_swing_pricing.py +8 -0
- wbportfolio/viewsets/portfolios.py +154 -0
- wbportfolio/viewsets/positions.py +292 -0
- wbportfolio/viewsets/product_groups.py +84 -0
- wbportfolio/viewsets/product_performance.py +646 -0
- wbportfolio/viewsets/products.py +529 -0
- wbportfolio/viewsets/reconciliations.py +160 -0
- wbportfolio/viewsets/registers.py +75 -0
- wbportfolio/viewsets/roles.py +44 -0
- wbportfolio/viewsets/signals.py +42 -0
- wbportfolio/viewsets/synchronization.py +25 -0
- wbportfolio/viewsets/transactions/__init__.py +40 -0
- wbportfolio/viewsets/transactions/claim.py +933 -0
- wbportfolio/viewsets/transactions/fees.py +190 -0
- wbportfolio/viewsets/transactions/mixins.py +19 -0
- wbportfolio/viewsets/transactions/trade_proposals.py +93 -0
- wbportfolio/viewsets/transactions/trades.py +395 -0
- wbportfolio/viewsets/transactions/transactions.py +123 -0
- wbportfolio-2.2.1.dist-info/METADATA +21 -0
- wbportfolio-2.2.1.dist-info/RECORD +486 -0
- wbportfolio-2.2.1.dist-info/WHEEL +5 -0
- wbportfolio-2.2.1.dist-info/licenses/LICENSE +4 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
|
4
|
+
from wbcore.contrib.icons import WBIcon
|
|
5
|
+
from wbcore.enums import Unit
|
|
6
|
+
from wbcore.metadata.configs import display as dp
|
|
7
|
+
from wbcore.metadata.configs.display.formatting import Condition, Operator
|
|
8
|
+
from wbcore.metadata.configs.display.instance_display.shortcuts import (
|
|
9
|
+
Display,
|
|
10
|
+
create_simple_display,
|
|
11
|
+
create_simple_section,
|
|
12
|
+
)
|
|
13
|
+
from wbcore.metadata.configs.display.instance_display.utils import repeat_field
|
|
14
|
+
from wbcore.metadata.configs.display.view_config import DisplayViewConfig
|
|
15
|
+
from wbfdm.contrib.metric.viewsets.configs.utils import (
|
|
16
|
+
PERFORMANCE_FORMATTING,
|
|
17
|
+
get_performance_fields,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ProductDisplayConfig(DisplayViewConfig):
|
|
22
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
23
|
+
return dp.ListDisplay(
|
|
24
|
+
fields=[
|
|
25
|
+
dp.Field(
|
|
26
|
+
key="information",
|
|
27
|
+
label=_("Information"),
|
|
28
|
+
open_by_default=False,
|
|
29
|
+
children=[
|
|
30
|
+
dp.Field(
|
|
31
|
+
key="is_invested",
|
|
32
|
+
label="",
|
|
33
|
+
formatting_rules=[
|
|
34
|
+
dp.FormattingRule(
|
|
35
|
+
icon=WBIcon.UNFILTER.icon,
|
|
36
|
+
condition=Condition(Operator("=="), False),
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
width=30,
|
|
40
|
+
show="open",
|
|
41
|
+
),
|
|
42
|
+
dp.Field(key="name_repr", label="Name", width=250),
|
|
43
|
+
dp.Field(key="parent", label="Parent"),
|
|
44
|
+
dp.Field(key="isin", label="ISIN"),
|
|
45
|
+
dp.Field(key="ticker", label="Ticker", show="open"),
|
|
46
|
+
dp.Field(key="bank", label="Bank"),
|
|
47
|
+
dp.Field(key="description", label="Description", show="open"),
|
|
48
|
+
dp.Field(key="currency", label="Currency", width=100, show="open"),
|
|
49
|
+
dp.Field(key="classifications", label="Classifications", show="open"),
|
|
50
|
+
dp.Field(key="white_label_customers", label="Customers", width=100, show="open"),
|
|
51
|
+
],
|
|
52
|
+
),
|
|
53
|
+
dp.Field(
|
|
54
|
+
label="Fees",
|
|
55
|
+
open_by_default=False,
|
|
56
|
+
key=None,
|
|
57
|
+
children=[
|
|
58
|
+
dp.Field(key="current_bank_fees", label="Bank Fees", width=100, show="open"),
|
|
59
|
+
dp.Field(key="current_management_fees", label="Management Fees", width=100, show="open"),
|
|
60
|
+
dp.Field(key="current_total_issuer_fees", label="Total Issuer Fees", width=100),
|
|
61
|
+
dp.Field(key="current_performance_fees", label="Performance Fees", width=100, show="open"),
|
|
62
|
+
],
|
|
63
|
+
),
|
|
64
|
+
dp.Field(
|
|
65
|
+
label="Last Valuation",
|
|
66
|
+
open_by_default=False,
|
|
67
|
+
key=None,
|
|
68
|
+
children=[
|
|
69
|
+
dp.Field(key="last_valuation_date", show="open", label="Date", width=150),
|
|
70
|
+
dp.Field(key="net_value", label="Valuation", width=150, tooltip=dp.Tooltip(key="market_data")),
|
|
71
|
+
],
|
|
72
|
+
),
|
|
73
|
+
dp.Field(
|
|
74
|
+
key=None,
|
|
75
|
+
label=_("Performance"),
|
|
76
|
+
open_by_default=False,
|
|
77
|
+
children=[
|
|
78
|
+
dp.Field(key="performance_is_estimated", label="Estimated", width=50, show="open"),
|
|
79
|
+
dp.Field(key="performance_date", label="Date", width=85),
|
|
80
|
+
*get_performance_fields(with_comparison_performances=True),
|
|
81
|
+
dp.Field(key="assets_under_management", label="AUM", width=100, show="open"),
|
|
82
|
+
dp.Field(key="assets_under_management_usd", label="AUM ($)", width=100),
|
|
83
|
+
],
|
|
84
|
+
),
|
|
85
|
+
dp.Field(
|
|
86
|
+
label="NNM",
|
|
87
|
+
open_by_default=False,
|
|
88
|
+
key=None,
|
|
89
|
+
children=[
|
|
90
|
+
dp.Field(
|
|
91
|
+
key="nnm_weekly",
|
|
92
|
+
label="Weekly",
|
|
93
|
+
width=150,
|
|
94
|
+
show="open",
|
|
95
|
+
formatting_rules=PERFORMANCE_FORMATTING,
|
|
96
|
+
),
|
|
97
|
+
dp.Field(
|
|
98
|
+
key="nnm_monthly",
|
|
99
|
+
label="Monthly",
|
|
100
|
+
width=150,
|
|
101
|
+
show="open",
|
|
102
|
+
formatting_rules=PERFORMANCE_FORMATTING,
|
|
103
|
+
),
|
|
104
|
+
dp.Field(
|
|
105
|
+
key="nnm_year_to_date", label="YTD", width=150, formatting_rules=PERFORMANCE_FORMATTING
|
|
106
|
+
),
|
|
107
|
+
dp.Field(
|
|
108
|
+
key="nnm_yearly",
|
|
109
|
+
label="Yearly",
|
|
110
|
+
width=150,
|
|
111
|
+
show="open",
|
|
112
|
+
formatting_rules=PERFORMANCE_FORMATTING,
|
|
113
|
+
),
|
|
114
|
+
],
|
|
115
|
+
),
|
|
116
|
+
],
|
|
117
|
+
formatting=[
|
|
118
|
+
dp.Formatting(
|
|
119
|
+
column="is_invested",
|
|
120
|
+
formatting_rules=[
|
|
121
|
+
dp.FormattingRule(
|
|
122
|
+
style={"backgroundColor": "#ADD8E6"},
|
|
123
|
+
condition=Condition(Operator("=="), False),
|
|
124
|
+
),
|
|
125
|
+
],
|
|
126
|
+
)
|
|
127
|
+
],
|
|
128
|
+
legends=[
|
|
129
|
+
dp.Legend(
|
|
130
|
+
key="is_invested",
|
|
131
|
+
items=[dp.LegendItem(icon="#ADD8E6", label="Internal (Double Accounting)", value=False)],
|
|
132
|
+
),
|
|
133
|
+
],
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
def get_instance_display(self) -> Display:
|
|
137
|
+
return create_simple_display(
|
|
138
|
+
[
|
|
139
|
+
[repeat_field(2, "name"), repeat_field(2, "name_repr")],
|
|
140
|
+
["inception_date", "isin", "ticker", "id_repr"],
|
|
141
|
+
["share_price", "issue_price", "initial_high_water_mark", "currency"],
|
|
142
|
+
[repeat_field(2, "bank"), repeat_field(2, "parent")],
|
|
143
|
+
[repeat_field(4, "tags")],
|
|
144
|
+
[repeat_field(4, "description")],
|
|
145
|
+
[repeat_field(4, "classifications_section")],
|
|
146
|
+
[repeat_field(4, "fees_section")],
|
|
147
|
+
[repeat_field(4, "information_section")],
|
|
148
|
+
[repeat_field(4, "white_label_customers_section")],
|
|
149
|
+
[repeat_field(4, "portfolios_section")],
|
|
150
|
+
[repeat_field(4, "related_instruments_section")],
|
|
151
|
+
[repeat_field(4, "baseindexpositions_section")],
|
|
152
|
+
[repeat_field(4, "portfoliorole_section")],
|
|
153
|
+
[repeat_field(4, "preferredclassification_section")],
|
|
154
|
+
],
|
|
155
|
+
[
|
|
156
|
+
create_simple_section(
|
|
157
|
+
"classifications_section", _("Classifications"), [["classifications"]], "classifications"
|
|
158
|
+
),
|
|
159
|
+
create_simple_section(
|
|
160
|
+
"fees_section",
|
|
161
|
+
_("Fees"),
|
|
162
|
+
[
|
|
163
|
+
["current_bank_fees", "current_management_fees", "current_performance_fees", "."],
|
|
164
|
+
],
|
|
165
|
+
"fees",
|
|
166
|
+
),
|
|
167
|
+
create_simple_section(
|
|
168
|
+
"information_section",
|
|
169
|
+
_("Information"),
|
|
170
|
+
[
|
|
171
|
+
[repeat_field(2, "asset_class"), "type_of_return", "legal_structure"],
|
|
172
|
+
["jurisdiction", "investment_index", repeat_field(2, "risk_scale")],
|
|
173
|
+
[repeat_field(2, "external_webpage"), repeat_field(2, "liquidity")],
|
|
174
|
+
],
|
|
175
|
+
"information",
|
|
176
|
+
),
|
|
177
|
+
create_simple_section(
|
|
178
|
+
"white_label_customers_section",
|
|
179
|
+
_("White Label Customers"),
|
|
180
|
+
[["white_label_customers"]],
|
|
181
|
+
"white_label_customers",
|
|
182
|
+
),
|
|
183
|
+
create_simple_section("portfolios_section", _("Portfolios"), [["portfolios"]], "portfolios"),
|
|
184
|
+
create_simple_section(
|
|
185
|
+
"related_instruments_section",
|
|
186
|
+
_("Related Instruments"),
|
|
187
|
+
[["related_instruments"]],
|
|
188
|
+
"related_instruments",
|
|
189
|
+
),
|
|
190
|
+
create_simple_section(
|
|
191
|
+
"baseindexpositions_section", _("Index"), [["baseindexpositions"]], "baseindexpositions"
|
|
192
|
+
),
|
|
193
|
+
create_simple_section("portfoliorole_section", _("Roles"), [["portfoliorole"]], "portfoliorole"),
|
|
194
|
+
create_simple_section(
|
|
195
|
+
"preferredclassification_section",
|
|
196
|
+
_("Preferred Classification per Instrument"),
|
|
197
|
+
[["preferredclassification"]],
|
|
198
|
+
"preferredclassification",
|
|
199
|
+
),
|
|
200
|
+
],
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class ProductCustomerDisplayConfig(DisplayViewConfig):
|
|
205
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
206
|
+
return dp.ListDisplay(
|
|
207
|
+
fields=[
|
|
208
|
+
dp.Field(key="name", label="Name"),
|
|
209
|
+
dp.Field(key="isin", label="ISIN"),
|
|
210
|
+
dp.Field(key="ticker", label="Ticker"),
|
|
211
|
+
dp.Field(key="net_value", label="Net Value"),
|
|
212
|
+
dp.Field(key="bank_repr", label="Bank"),
|
|
213
|
+
]
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
def get_instance_display(self) -> Display:
|
|
217
|
+
return create_simple_display(
|
|
218
|
+
[
|
|
219
|
+
[repeat_field(3, "name")],
|
|
220
|
+
["isin", "ticker", "bank"],
|
|
221
|
+
["share_price", "issue_price", "currency"],
|
|
222
|
+
[repeat_field(3, "description")],
|
|
223
|
+
]
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class ProductPerformanceFeesDisplayConfig(ProductDisplayConfig):
|
|
228
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
229
|
+
return dp.ListDisplay(
|
|
230
|
+
fields=[
|
|
231
|
+
dp.Field(key="computed_str", label="Title", width=Unit.PIXEL(400)),
|
|
232
|
+
dp.Field(key="isin", label="ISIN", width=Unit.PIXEL(150)),
|
|
233
|
+
dp.Field(key="sum_management_fees", label="Mgmt", width=Unit.PIXEL(150)),
|
|
234
|
+
dp.Field(key="sum_management_fees_usd", label="Mgmt ($)", width=Unit.PIXEL(150)),
|
|
235
|
+
dp.Field(key="sum_performance_fees_net", label="Perf", width=Unit.PIXEL(150)),
|
|
236
|
+
dp.Field(key="sum_performance_fees_net_usd", label="Perf ($)", width=Unit.PIXEL(150)),
|
|
237
|
+
dp.Field(key="sum_total", label="Total", width=Unit.PIXEL(150)),
|
|
238
|
+
dp.Field(
|
|
239
|
+
key="sum_total_usd",
|
|
240
|
+
label="$ Total",
|
|
241
|
+
formatting_rules=[
|
|
242
|
+
dp.FormattingRule(
|
|
243
|
+
style={"fontWeight": "bold"},
|
|
244
|
+
),
|
|
245
|
+
],
|
|
246
|
+
width=Unit.PIXEL(150),
|
|
247
|
+
),
|
|
248
|
+
]
|
|
249
|
+
)
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
from wbcore.metadata.configs import display as dp
|
|
2
|
+
from wbcore.metadata.configs.display.instance_display.utils import repeat_field
|
|
3
|
+
from wbcore.metadata.configs.display.view_config import DisplayViewConfig
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AccountReconciliationDisplayViewConfig(DisplayViewConfig):
|
|
7
|
+
def get_list_display(self) -> dp.ListDisplay:
|
|
8
|
+
return dp.ListDisplay(
|
|
9
|
+
fields=[
|
|
10
|
+
dp.Field(key="reconciliation_date", label="Reconciliation Date"),
|
|
11
|
+
dp.Field(key="account", label="Account"),
|
|
12
|
+
dp.Field(key="creator", label="Creator"),
|
|
13
|
+
dp.Field(key="approved_by", label="Approved By"),
|
|
14
|
+
dp.Field(key="approved_dt", label="Approved Timestamp"),
|
|
15
|
+
],
|
|
16
|
+
formatting=[
|
|
17
|
+
dp.Formatting(
|
|
18
|
+
column="approved_dt",
|
|
19
|
+
formatting_rules=[dp.FormattingRule(condition=("∃", True), style={"backgroundColor": "#77DD77"})],
|
|
20
|
+
),
|
|
21
|
+
],
|
|
22
|
+
legends=[dp.Legend(items=[dp.LegendItem(label="Agreed Reconciliations", icon="#77DD77")])],
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def get_instance_display(self) -> dp.Display:
|
|
26
|
+
return dp.Display(
|
|
27
|
+
pages=[
|
|
28
|
+
dp.Page(
|
|
29
|
+
layouts={
|
|
30
|
+
dp.default(): dp.Layout(
|
|
31
|
+
grid_template_areas=[
|
|
32
|
+
["reconciliation_date", "account", "creator", "approved_by", "approved_dt"],
|
|
33
|
+
[repeat_field(5, "lines")],
|
|
34
|
+
],
|
|
35
|
+
grid_template_rows=["min-content", "1fr"],
|
|
36
|
+
inlines=[dp.Inline(key="lines", endpoint="lines")],
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AccountReconciliationLineDisplayViewConfig(DisplayViewConfig):
|
|
45
|
+
def get_list_display(self) -> dp.ListDisplay:
|
|
46
|
+
difference = [
|
|
47
|
+
dp.FormattingRule(condition=("<", 0), style={"fontWeight": "bold", "color": "#FF6961"}),
|
|
48
|
+
dp.FormattingRule(condition=(">", 0), style={"fontWeight": "bold", "color": "green"}),
|
|
49
|
+
]
|
|
50
|
+
editable = [dp.FormattingRule(style={"fontWeight": "bold"})]
|
|
51
|
+
equal = [dp.FormattingRule(condition=("==", False, "is_equal"), style={"backgroundColor": "orange"})]
|
|
52
|
+
borderLeft = [
|
|
53
|
+
dp.FormattingRule(
|
|
54
|
+
style={
|
|
55
|
+
"borderLeft": "1px solid #bdc3c7",
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
]
|
|
59
|
+
borderRight = [
|
|
60
|
+
dp.FormattingRule(
|
|
61
|
+
style={
|
|
62
|
+
"borderRight": "1px solid #bdc3c7",
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
return dp.ListDisplay(
|
|
68
|
+
hide_control_bar=True,
|
|
69
|
+
fields=[
|
|
70
|
+
dp.Field(
|
|
71
|
+
key="product",
|
|
72
|
+
label="Product",
|
|
73
|
+
width=450,
|
|
74
|
+
),
|
|
75
|
+
dp.Field(
|
|
76
|
+
key="price_date",
|
|
77
|
+
label="Date",
|
|
78
|
+
width=100,
|
|
79
|
+
),
|
|
80
|
+
dp.Field(
|
|
81
|
+
label="Our Calculations",
|
|
82
|
+
key="system",
|
|
83
|
+
children=[
|
|
84
|
+
dp.Field(
|
|
85
|
+
key="shares",
|
|
86
|
+
label="Shares",
|
|
87
|
+
width=90,
|
|
88
|
+
),
|
|
89
|
+
dp.Field(
|
|
90
|
+
key="nominal_value",
|
|
91
|
+
label="Nominal",
|
|
92
|
+
width=90,
|
|
93
|
+
),
|
|
94
|
+
dp.Field(
|
|
95
|
+
key="price",
|
|
96
|
+
label="Price",
|
|
97
|
+
width=100,
|
|
98
|
+
),
|
|
99
|
+
dp.Field(
|
|
100
|
+
key="assets_under_management",
|
|
101
|
+
label="AuM",
|
|
102
|
+
width=120,
|
|
103
|
+
),
|
|
104
|
+
],
|
|
105
|
+
),
|
|
106
|
+
dp.Field(
|
|
107
|
+
label="Your Input (Please adjust the columns in bold if necessary)",
|
|
108
|
+
key="confirmation",
|
|
109
|
+
children=[
|
|
110
|
+
dp.Field(
|
|
111
|
+
key="shares_external",
|
|
112
|
+
label="Shares",
|
|
113
|
+
width=90,
|
|
114
|
+
formatting_rules=[*equal, *editable, *borderLeft],
|
|
115
|
+
),
|
|
116
|
+
dp.Field(
|
|
117
|
+
key="nominal_value_external",
|
|
118
|
+
label="Nominal",
|
|
119
|
+
width=90,
|
|
120
|
+
formatting_rules=[*equal, *editable],
|
|
121
|
+
),
|
|
122
|
+
dp.Field(
|
|
123
|
+
key="price",
|
|
124
|
+
label="Price",
|
|
125
|
+
width=100,
|
|
126
|
+
),
|
|
127
|
+
dp.Field(
|
|
128
|
+
key="assets_under_management_external",
|
|
129
|
+
label="AuM",
|
|
130
|
+
width=120,
|
|
131
|
+
formatting_rules=[*equal, *borderRight],
|
|
132
|
+
),
|
|
133
|
+
],
|
|
134
|
+
),
|
|
135
|
+
dp.Field(
|
|
136
|
+
label="Differences",
|
|
137
|
+
key="differences",
|
|
138
|
+
children=[
|
|
139
|
+
dp.Field(key="pct_diff", label="Shares", width=90, formatting_rules=difference),
|
|
140
|
+
dp.Field(key="shares_diff", label="Shares", width=90, formatting_rules=difference),
|
|
141
|
+
dp.Field(key="nominal_value_diff", label="Nominal", width=90, formatting_rules=difference),
|
|
142
|
+
dp.Field(
|
|
143
|
+
key="assets_under_management_diff",
|
|
144
|
+
label="AuM",
|
|
145
|
+
width=120,
|
|
146
|
+
formatting_rules=difference,
|
|
147
|
+
),
|
|
148
|
+
],
|
|
149
|
+
),
|
|
150
|
+
],
|
|
151
|
+
)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from wbcore.metadata.configs import display as dp
|
|
4
|
+
from wbcore.metadata.configs.display.instance_display.shortcuts import (
|
|
5
|
+
Display,
|
|
6
|
+
create_simple_display,
|
|
7
|
+
create_simple_section,
|
|
8
|
+
)
|
|
9
|
+
from wbcore.metadata.configs.display.instance_display.utils import repeat_field
|
|
10
|
+
from wbcore.metadata.configs.display.view_config import DisplayViewConfig
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RegisterDisplayConfig(DisplayViewConfig):
|
|
14
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
15
|
+
return dp.ListDisplay(
|
|
16
|
+
fields=[
|
|
17
|
+
dp.Field(key="register_reference", label="Register Reference"),
|
|
18
|
+
dp.Field(key="register_name_1", label="Register Name 1"),
|
|
19
|
+
dp.Field(key="register_name_2", label="Register Name 2"),
|
|
20
|
+
dp.Field(key="custodian_reference", label="Custodian Reference"),
|
|
21
|
+
dp.Field(key="custodian_name_1", label="Custodian Name 1"),
|
|
22
|
+
dp.Field(key="custodian_name_2", label="Custodian Name 2"),
|
|
23
|
+
dp.Field(key="outlet_reference", label="Outlet Reference"),
|
|
24
|
+
dp.Field(key="outlet_name", label="Outlet Name"),
|
|
25
|
+
dp.Field(key="status", label="Status"),
|
|
26
|
+
dp.Field(key="status_message", label="Status Message"),
|
|
27
|
+
]
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
def get_instance_display(self) -> Display:
|
|
31
|
+
return create_simple_display(
|
|
32
|
+
[
|
|
33
|
+
["register_reference", "register_name_1", "register_name_2"],
|
|
34
|
+
["global_register_reference", "external_register_reference", "."],
|
|
35
|
+
["citizenship", "residence", "investor_type"],
|
|
36
|
+
[repeat_field(3, "custodian_section")],
|
|
37
|
+
[repeat_field(3, "outlet_section")],
|
|
38
|
+
[repeat_field(3, "information_section")],
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
create_simple_section(
|
|
42
|
+
"custodian_section",
|
|
43
|
+
"Custodian",
|
|
44
|
+
[
|
|
45
|
+
["custodian_reference", "custodian_name_1", "custodian_name_2"],
|
|
46
|
+
[repeat_field(3, "custodian_address")],
|
|
47
|
+
["custodian_postcode", "custodian_city", "custodian_country"],
|
|
48
|
+
],
|
|
49
|
+
),
|
|
50
|
+
create_simple_section(
|
|
51
|
+
"outlet_section",
|
|
52
|
+
"Outlet",
|
|
53
|
+
[
|
|
54
|
+
["sales_reference", repeat_field(2, "dealer_reference")],
|
|
55
|
+
["outlet_reference", repeat_field(2, "outlet_name")],
|
|
56
|
+
[repeat_field(3, "outlet_address")],
|
|
57
|
+
["outlet_postcode", "outlet_city", "outlet_country"],
|
|
58
|
+
],
|
|
59
|
+
),
|
|
60
|
+
create_simple_section(
|
|
61
|
+
"information_section",
|
|
62
|
+
"Information",
|
|
63
|
+
[
|
|
64
|
+
["opened", repeat_field(2, "status")],
|
|
65
|
+
[".", "opened_reference_1", "opened_reference_2"],
|
|
66
|
+
[".", "updated_reference_1", "updated_reference_2"],
|
|
67
|
+
[repeat_field(3, "status_message")],
|
|
68
|
+
],
|
|
69
|
+
),
|
|
70
|
+
],
|
|
71
|
+
)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from wbcore.metadata.configs import display as dp
|
|
4
|
+
from wbcore.metadata.configs.display.instance_display.shortcuts import (
|
|
5
|
+
Display,
|
|
6
|
+
create_simple_display,
|
|
7
|
+
)
|
|
8
|
+
from wbcore.metadata.configs.display.instance_display.utils import repeat_field
|
|
9
|
+
from wbcore.metadata.configs.display.view_config import DisplayViewConfig
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PortfolioRoleDisplayConfig(DisplayViewConfig):
|
|
13
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
14
|
+
return dp.ListDisplay(
|
|
15
|
+
fields=[
|
|
16
|
+
dp.Field(key="role_type", label="Type"),
|
|
17
|
+
dp.Field(key="person", label="Person"),
|
|
18
|
+
dp.Field(key="start", label="Start"),
|
|
19
|
+
dp.Field(key="end", label="End"),
|
|
20
|
+
dp.Field(key="weighting", label="Weighting"),
|
|
21
|
+
dp.Field(key="instrument", label="Instrument"),
|
|
22
|
+
]
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def get_instance_display(self) -> Display:
|
|
26
|
+
return create_simple_display(
|
|
27
|
+
[["role_type", repeat_field(2, "person")], ["start", "end", "weighting"], [repeat_field(3, "instrument")]]
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class PortfolioRoleInstrumentDisplayConfig(PortfolioRoleDisplayConfig):
|
|
32
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
33
|
+
return dp.ListDisplay(
|
|
34
|
+
fields=[
|
|
35
|
+
dp.Field(key="role_type", label="Type"),
|
|
36
|
+
dp.Field(key="person", label="Person"),
|
|
37
|
+
dp.Field(key="start", label="Start"),
|
|
38
|
+
dp.Field(key="end", label="End"),
|
|
39
|
+
dp.Field(key="weighting", label="Weighting"),
|
|
40
|
+
]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def get_instance_display(self) -> Display:
|
|
44
|
+
return create_simple_display(
|
|
45
|
+
[
|
|
46
|
+
["role_type", repeat_field(2, "person")],
|
|
47
|
+
["start", "end", "weighting"],
|
|
48
|
+
]
|
|
49
|
+
)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from wbcore.contrib.color.enums import WBColor
|
|
4
|
+
from wbcore.metadata.configs import display as dp
|
|
5
|
+
from wbcore.metadata.configs.display.instance_display import Inline, Layout, Page
|
|
6
|
+
from wbcore.metadata.configs.display.instance_display.operators import default
|
|
7
|
+
from wbcore.metadata.configs.display.instance_display.shortcuts import Display
|
|
8
|
+
from wbcore.metadata.configs.display.view_config import DisplayViewConfig
|
|
9
|
+
from wbportfolio.models import TradeProposal
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TradeProposalDisplayConfig(DisplayViewConfig):
|
|
13
|
+
def get_list_display(self) -> Optional[dp.ListDisplay]:
|
|
14
|
+
return dp.ListDisplay(
|
|
15
|
+
fields=[
|
|
16
|
+
dp.Field(key="trade_date", label="Trade Date"),
|
|
17
|
+
dp.Field(key="comment", label="Comment"),
|
|
18
|
+
],
|
|
19
|
+
legends=[
|
|
20
|
+
dp.Legend(
|
|
21
|
+
key="status",
|
|
22
|
+
items=[
|
|
23
|
+
dp.LegendItem(
|
|
24
|
+
icon=WBColor.BLUE_LIGHT.value,
|
|
25
|
+
label=TradeProposal.Status.DRAFT.label,
|
|
26
|
+
value=TradeProposal.Status.DRAFT.value,
|
|
27
|
+
),
|
|
28
|
+
dp.LegendItem(
|
|
29
|
+
icon=WBColor.YELLOW_LIGHT.value,
|
|
30
|
+
label=TradeProposal.Status.SUBMIT.label,
|
|
31
|
+
value=TradeProposal.Status.SUBMIT.value,
|
|
32
|
+
),
|
|
33
|
+
dp.LegendItem(
|
|
34
|
+
icon=WBColor.GREEN_LIGHT.value,
|
|
35
|
+
label=TradeProposal.Status.APPROVED.label,
|
|
36
|
+
value=TradeProposal.Status.APPROVED.value,
|
|
37
|
+
),
|
|
38
|
+
dp.LegendItem(
|
|
39
|
+
icon=WBColor.RED_LIGHT.value,
|
|
40
|
+
label=TradeProposal.Status.DENIED.label,
|
|
41
|
+
value=TradeProposal.Status.DENIED.value,
|
|
42
|
+
),
|
|
43
|
+
],
|
|
44
|
+
),
|
|
45
|
+
],
|
|
46
|
+
formatting=[
|
|
47
|
+
dp.Formatting(
|
|
48
|
+
column="status",
|
|
49
|
+
formatting_rules=[
|
|
50
|
+
dp.FormattingRule(
|
|
51
|
+
style={"backgroundColor": WBColor.BLUE_LIGHT.value},
|
|
52
|
+
condition=("==", TradeProposal.Status.DRAFT.value),
|
|
53
|
+
),
|
|
54
|
+
dp.FormattingRule(
|
|
55
|
+
style={"backgroundColor": WBColor.YELLOW_LIGHT.value},
|
|
56
|
+
condition=("==", TradeProposal.Status.SUBMIT.value),
|
|
57
|
+
),
|
|
58
|
+
dp.FormattingRule(
|
|
59
|
+
style={"backgroundColor": WBColor.GREEN_LIGHT.value},
|
|
60
|
+
condition=("==", TradeProposal.Status.APPROVED.value),
|
|
61
|
+
),
|
|
62
|
+
dp.FormattingRule(
|
|
63
|
+
style={"backgroundColor": WBColor.RED_LIGHT.value},
|
|
64
|
+
condition=("==", TradeProposal.Status.DENIED.value),
|
|
65
|
+
),
|
|
66
|
+
],
|
|
67
|
+
)
|
|
68
|
+
],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def get_instance_display(self) -> Display:
|
|
72
|
+
return Display(
|
|
73
|
+
pages=[
|
|
74
|
+
Page(
|
|
75
|
+
title="Main Information",
|
|
76
|
+
layouts={
|
|
77
|
+
default(): Layout(
|
|
78
|
+
grid_template_areas=[
|
|
79
|
+
["status", "status"],
|
|
80
|
+
["trade_date", "model_portfolio"],
|
|
81
|
+
["comment", "comment"],
|
|
82
|
+
],
|
|
83
|
+
),
|
|
84
|
+
},
|
|
85
|
+
),
|
|
86
|
+
Page(
|
|
87
|
+
title="Trades",
|
|
88
|
+
layouts={
|
|
89
|
+
default(): Layout(
|
|
90
|
+
grid_template_areas=[["trades"]],
|
|
91
|
+
grid_template_rows=["minmax(700px, 100%)"],
|
|
92
|
+
inlines=[Inline(key="trades", endpoint="trades")],
|
|
93
|
+
),
|
|
94
|
+
},
|
|
95
|
+
),
|
|
96
|
+
]
|
|
97
|
+
)
|