From bfe74ca47c1929331ac78fa2a90d8b652d1d37dd Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 19 Sep 2026 22:14:07 +0300 Subject: [PATCH] =?UTF-8?q?chore(app):=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B3?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D1=8C=20Dart-=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Портфели, создание счетов, ручные события, PATCH инструмента, ScopeCardOut, MetricsStatusOut, логотипы в HoldingOut. --- .../api_client/.openapi-generator/FILES | 20 + app/packages/api_client/doc/AccountCreate.md | 18 + app/packages/api_client/doc/AccountOut.md | 2 + app/packages/api_client/doc/AccountPatch.md | 1 + app/packages/api_client/doc/AccountsApi.md | 44 ++ app/packages/api_client/doc/AnalyticsApi.md | 40 ++ app/packages/api_client/doc/EventOut.md | 1 + app/packages/api_client/doc/EventsApi.md | 87 ++++ app/packages/api_client/doc/HealthApi.md | 2 + app/packages/api_client/doc/HoldingOut.md | 2 + app/packages/api_client/doc/InstrumentOut.md | 2 + .../api_client/doc/InstrumentPatch.md | 19 + app/packages/api_client/doc/InstrumentsApi.md | 46 ++ .../api_client/doc/ManualEventCreate.md | 25 + app/packages/api_client/doc/MetricsApi.md | 12 +- .../api_client/doc/MetricsStatusOut.md | 17 + .../api_client/doc/PortfolioAccountsIn.md | 15 + .../api_client/doc/PortfolioCreate.md | 16 + app/packages/api_client/doc/PortfolioOut.md | 18 + app/packages/api_client/doc/PortfolioPatch.md | 15 + app/packages/api_client/doc/PortfoliosApi.md | 222 +++++++++ app/packages/api_client/doc/RefreshLogOut.md | 2 + app/packages/api_client/doc/ScopeCardOut.md | 27 ++ .../api_client/lib/fintracker_api.dart | 10 + app/packages/api_client/lib/src/api.dart | 7 + .../api_client/lib/src/api/accounts_api.dart | 98 ++++ .../api_client/lib/src/api/analytics_api.dart | 77 +++ .../api_client/lib/src/api/events_api.dart | 152 ++++++ .../api_client/lib/src/api/health_api.dart | 2 +- .../lib/src/api/instruments_api.dart | 100 ++++ .../api_client/lib/src/api/metrics_api.dart | 27 +- .../lib/src/api/portfolios_api.dart | 448 ++++++++++++++++++ .../api_client/lib/src/deserialize.dart | 27 ++ .../lib/src/model/account_create.dart | 109 +++++ .../lib/src/model/account_create.g.dart | 127 +++++ .../api_client/lib/src/model/account_out.dart | 37 +- .../lib/src/model/account_out.g.dart | 28 ++ .../lib/src/model/account_patch.dart | 16 + .../lib/src/model/account_patch.g.dart | 13 + .../api_client/lib/src/model/event_out.dart | 16 + .../api_client/lib/src/model/event_out.g.dart | 15 + .../api_client/lib/src/model/holding_out.dart | 32 ++ .../lib/src/model/holding_out.g.dart | 28 ++ .../lib/src/model/instrument_out.dart | 32 ++ .../lib/src/model/instrument_out.g.dart | 28 ++ .../lib/src/model/instrument_patch.dart | 123 +++++ .../lib/src/model/instrument_patch.g.dart | 125 +++++ .../lib/src/model/manual_event_create.dart | 225 +++++++++ .../lib/src/model/manual_event_create.g.dart | 252 ++++++++++ .../lib/src/model/metrics_status_out.dart | 91 ++++ .../lib/src/model/metrics_status_out.g.dart | 108 +++++ .../lib/src/model/portfolio_accounts_in.dart | 58 +++ .../src/model/portfolio_accounts_in.g.dart | 75 +++ .../lib/src/model/portfolio_create.dart | 74 +++ .../lib/src/model/portfolio_create.g.dart | 87 ++++ .../lib/src/model/portfolio_out.dart | 106 +++++ .../lib/src/model/portfolio_out.g.dart | 127 +++++ .../lib/src/model/portfolio_patch.dart | 58 +++ .../lib/src/model/portfolio_patch.g.dart | 67 +++ .../lib/src/model/refresh_log_out.dart | 32 ++ .../lib/src/model/refresh_log_out.g.dart | 36 ++ .../lib/src/model/scope_card_out.dart | 259 ++++++++++ .../lib/src/model/scope_card_out.g.dart | 272 +++++++++++ .../api_client/test/account_create_test.dart | 32 ++ .../test/instrument_patch_test.dart | 36 ++ .../test/manual_event_create_test.dart | 71 +++ .../test/metrics_status_out_test.dart | 26 + .../test/portfolio_accounts_in_test.dart | 16 + .../test/portfolio_create_test.dart | 21 + .../api_client/test/portfolio_out_test.dart | 31 ++ .../api_client/test/portfolio_patch_test.dart | 16 + .../api_client/test/portfolios_api_test.dart | 46 ++ .../api_client/test/scope_card_out_test.dart | 85 ++++ 73 files changed, 4615 insertions(+), 22 deletions(-) create mode 100644 app/packages/api_client/doc/AccountCreate.md create mode 100644 app/packages/api_client/doc/InstrumentPatch.md create mode 100644 app/packages/api_client/doc/ManualEventCreate.md create mode 100644 app/packages/api_client/doc/MetricsStatusOut.md create mode 100644 app/packages/api_client/doc/PortfolioAccountsIn.md create mode 100644 app/packages/api_client/doc/PortfolioCreate.md create mode 100644 app/packages/api_client/doc/PortfolioOut.md create mode 100644 app/packages/api_client/doc/PortfolioPatch.md create mode 100644 app/packages/api_client/doc/PortfoliosApi.md create mode 100644 app/packages/api_client/doc/ScopeCardOut.md create mode 100644 app/packages/api_client/lib/src/api/portfolios_api.dart create mode 100644 app/packages/api_client/lib/src/model/account_create.dart create mode 100644 app/packages/api_client/lib/src/model/account_create.g.dart create mode 100644 app/packages/api_client/lib/src/model/instrument_patch.dart create mode 100644 app/packages/api_client/lib/src/model/instrument_patch.g.dart create mode 100644 app/packages/api_client/lib/src/model/manual_event_create.dart create mode 100644 app/packages/api_client/lib/src/model/manual_event_create.g.dart create mode 100644 app/packages/api_client/lib/src/model/metrics_status_out.dart create mode 100644 app/packages/api_client/lib/src/model/metrics_status_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_accounts_in.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_accounts_in.g.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_create.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_create.g.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_out.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_patch.dart create mode 100644 app/packages/api_client/lib/src/model/portfolio_patch.g.dart create mode 100644 app/packages/api_client/lib/src/model/scope_card_out.dart create mode 100644 app/packages/api_client/lib/src/model/scope_card_out.g.dart create mode 100644 app/packages/api_client/test/account_create_test.dart create mode 100644 app/packages/api_client/test/instrument_patch_test.dart create mode 100644 app/packages/api_client/test/manual_event_create_test.dart create mode 100644 app/packages/api_client/test/metrics_status_out_test.dart create mode 100644 app/packages/api_client/test/portfolio_accounts_in_test.dart create mode 100644 app/packages/api_client/test/portfolio_create_test.dart create mode 100644 app/packages/api_client/test/portfolio_out_test.dart create mode 100644 app/packages/api_client/test/portfolio_patch_test.dart create mode 100644 app/packages/api_client/test/portfolios_api_test.dart create mode 100644 app/packages/api_client/test/scope_card_out_test.dart diff --git a/app/packages/api_client/.openapi-generator/FILES b/app/packages/api_client/.openapi-generator/FILES index 131d1ad..da40cd3 100644 --- a/app/packages/api_client/.openapi-generator/FILES +++ b/app/packages/api_client/.openapi-generator/FILES @@ -1,6 +1,7 @@ analysis_options.yaml build.yaml doc/AccountBalance.md +doc/AccountCreate.md doc/AccountKind.md doc/AccountOut.md doc/AccountPatch.md @@ -56,6 +57,7 @@ doc/ImportsApi.md doc/IncomeApi.md doc/InstrumentDetail.md doc/InstrumentOut.md +doc/InstrumentPatch.md doc/InstrumentsApi.md doc/JobStatus.md doc/LinkCreate.md @@ -63,7 +65,9 @@ doc/LinkOut.md doc/LinksApi.md doc/LoginRequest.md doc/LotOut.md +doc/ManualEventCreate.md doc/MetricsApi.md +doc/MetricsStatusOut.md doc/NetWorthBreakdown.md doc/NetWorthDay.md doc/NetworthApi.md @@ -71,6 +75,11 @@ doc/NewInstrument.md doc/PendingInstrumentOut.md doc/PendingResolveRequest.md doc/PendingResolveResult.md +doc/PortfolioAccountsIn.md +doc/PortfolioCreate.md +doc/PortfolioOut.md +doc/PortfolioPatch.md +doc/PortfoliosApi.md doc/PriceManualIn.md doc/PriceManualOut.md doc/PricePoint.md @@ -93,6 +102,7 @@ doc/RulesApi.md doc/RunStatus.md doc/RunwayOut.md doc/SampleEventOut.md +doc/ScopeCardOut.md doc/ScopeOut.md doc/SourceStatus.md doc/SpendingRow.md @@ -137,6 +147,7 @@ lib/src/api/instruments_api.dart lib/src/api/links_api.dart lib/src/api/metrics_api.dart lib/src/api/networth_api.dart +lib/src/api/portfolios_api.dart lib/src/api/rebalance_api.dart lib/src/api/rules_api.dart lib/src/api/sync_api.dart @@ -149,6 +160,7 @@ lib/src/auth/bearer_auth.dart lib/src/auth/oauth.dart lib/src/deserialize.dart lib/src/model/account_balance.dart +lib/src/model/account_create.dart lib/src/model/account_kind.dart lib/src/model/account_out.dart lib/src/model/account_patch.dart @@ -193,17 +205,24 @@ lib/src/model/import_result.dart lib/src/model/import_summary.dart lib/src/model/instrument_detail.dart lib/src/model/instrument_out.dart +lib/src/model/instrument_patch.dart lib/src/model/job_status.dart lib/src/model/link_create.dart lib/src/model/link_out.dart lib/src/model/login_request.dart lib/src/model/lot_out.dart +lib/src/model/manual_event_create.dart +lib/src/model/metrics_status_out.dart lib/src/model/net_worth_breakdown.dart lib/src/model/net_worth_day.dart lib/src/model/new_instrument.dart lib/src/model/pending_instrument_out.dart lib/src/model/pending_resolve_request.dart lib/src/model/pending_resolve_result.dart +lib/src/model/portfolio_accounts_in.dart +lib/src/model/portfolio_create.dart +lib/src/model/portfolio_out.dart +lib/src/model/portfolio_patch.dart lib/src/model/price_manual_in.dart lib/src/model/price_manual_out.dart lib/src/model/price_point.dart @@ -224,6 +243,7 @@ lib/src/model/rule_patch.dart lib/src/model/run_status.dart lib/src/model/runway_out.dart lib/src/model/sample_event_out.dart +lib/src/model/scope_card_out.dart lib/src/model/scope_out.dart lib/src/model/source_status.dart lib/src/model/spending_row.dart diff --git a/app/packages/api_client/doc/AccountCreate.md b/app/packages/api_client/doc/AccountCreate.md new file mode 100644 index 0000000..5806767 --- /dev/null +++ b/app/packages/api_client/doc/AccountCreate.md @@ -0,0 +1,18 @@ +# fintracker_api.model.AccountCreate + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**broker** | [**Broker**](Broker.md) | | +**currency** | **String** | | [optional] [default to 'RUB'] +**name** | **String** | | +**sourceId** | **String** | Agreement number exactly as the broker's report prints it | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/AccountOut.md b/app/packages/api_client/doc/AccountOut.md index f6d61f0..b69f073 100644 --- a/app/packages/api_client/doc/AccountOut.md +++ b/app/packages/api_client/doc/AccountOut.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **broker** | [**Broker**](Broker.md) | | **creditLimit** | **String** | decimal as string | **currency** | **String** | | +**disabled** | **bool** | | **id** | **int** | | **includeInNetWorth** | **bool** | | **kind** | [**AccountKind**](AccountKind.md) | | @@ -25,6 +26,7 @@ Name | Type | Description | Notes **source_** | **String** | | **sourceId** | **String** | | **startBalance** | **String** | decimal as string | +**valueRub** | **String** | decimal as string | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/app/packages/api_client/doc/AccountPatch.md b/app/packages/api_client/doc/AccountPatch.md index 53a8985..c190a5c 100644 --- a/app/packages/api_client/doc/AccountPatch.md +++ b/app/packages/api_client/doc/AccountPatch.md @@ -8,6 +8,7 @@ import 'package:fintracker_api/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**disabled** | **bool** | | [optional] **includeInNetWorth** | **bool** | | [optional] **mirrorOfAccountId** | **int** | | [optional] **name** | **String** | | [optional] diff --git a/app/packages/api_client/doc/AccountsApi.md b/app/packages/api_client/doc/AccountsApi.md index 7047a69..e5a0c36 100644 --- a/app/packages/api_client/doc/AccountsApi.md +++ b/app/packages/api_client/doc/AccountsApi.md @@ -9,10 +9,54 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**accountsCreate**](AccountsApi.md#accountscreate) | **POST** /api/v1/accounts | Create [**accountsList**](AccountsApi.md#accountslist) | **GET** /api/v1/accounts | List [**accountsPatch**](AccountsApi.md#accountspatch) | **PATCH** /api/v1/accounts/{account_id} | Patch +# **accountsCreate** +> AccountOut accountsCreate(accountCreate) + +Create + +Create the broker account a report import will write into. `source_id` is the agreement number the report prints: it is how the import finds the account on its own the next time. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAccountsApi(); +final AccountCreate accountCreate = ; // AccountCreate | + +try { + final response = api.accountsCreate(accountCreate); + print(response); +} on DioException catch (e) { + print('Exception when calling AccountsApi->accountsCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accountCreate** | [**AccountCreate**](AccountCreate.md)| | + +### Return type + +[**AccountOut**](AccountOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **accountsList** > List accountsList() diff --git a/app/packages/api_client/doc/AnalyticsApi.md b/app/packages/api_client/doc/AnalyticsApi.md index 5cf10d0..4dc8738 100644 --- a/app/packages/api_client/doc/AnalyticsApi.md +++ b/app/packages/api_client/doc/AnalyticsApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**analyticsAllocation**](AnalyticsApi.md#analyticsallocation) | **GET** /api/v1/analytics/allocation | Allocation [**analyticsCashflowBroker**](AnalyticsApi.md#analyticscashflowbroker) | **GET** /api/v1/analytics/cashflow-broker | Cashflow Broker [**analyticsHoldings**](AnalyticsApi.md#analyticsholdings) | **GET** /api/v1/analytics/holdings | Holdings +[**analyticsOverview**](AnalyticsApi.md#analyticsoverview) | **GET** /api/v1/analytics/overview | Overview [**analyticsReturns**](AnalyticsApi.md#analyticsreturns) | **GET** /api/v1/analytics/returns | Returns [**analyticsScopes**](AnalyticsApi.md#analyticsscopes) | **GET** /api/v1/analytics/scopes | Scopes [**analyticsSummary**](AnalyticsApi.md#analyticssummary) | **GET** /api/v1/analytics/summary | Summary @@ -149,6 +150,45 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **analyticsOverview** +> List analyticsOverview() + +Overview + +One card per scope for the home screen, in a single round trip. `all` first, then the portfolios, then the accounts by value. A scope holding nothing at all is left out: a card of zeros is noise, not an answer. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); + +try { + final response = api.analyticsOverview(); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsOverview: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<ScopeCardOut>**](ScopeCardOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **analyticsReturns** > List analyticsReturns(scope) diff --git a/app/packages/api_client/doc/EventOut.md b/app/packages/api_client/doc/EventOut.md index 298b119..aca2fd7 100644 --- a/app/packages/api_client/doc/EventOut.md +++ b/app/packages/api_client/doc/EventOut.md @@ -22,6 +22,7 @@ Name | Type | Description | Notes **price** | **String** | decimal as string | **priceCurrency** | **String** | | **quantity** | **String** | decimal as string | +**source_** | **String** | | **status** | [**EventStatus**](EventStatus.md) | | **tax** | **String** | decimal as string | **ticker** | **String** | | diff --git a/app/packages/api_client/doc/EventsApi.md b/app/packages/api_client/doc/EventsApi.md index 08f5164..2a5c8b6 100644 --- a/app/packages/api_client/doc/EventsApi.md +++ b/app/packages/api_client/doc/EventsApi.md @@ -9,9 +9,96 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**eventsCreate**](EventsApi.md#eventscreate) | **POST** /api/v1/events | Create +[**eventsDelete**](EventsApi.md#eventsdelete) | **DELETE** /api/v1/events/{event_id} | Delete [**eventsList**](EventsApi.md#eventslist) | **GET** /api/v1/events | List +# **eventsCreate** +> EventOut eventsCreate(manualEventCreate) + +Create + +Enter an event by hand. It is `confirmed` at once: it is the user's own statement, so it is never shadowed by the account's primary feed. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getEventsApi(); +final ManualEventCreate manualEventCreate = ; // ManualEventCreate | + +try { + final response = api.eventsCreate(manualEventCreate); + print(response); +} on DioException catch (e) { + print('Exception when calling EventsApi->eventsCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **manualEventCreate** | [**ManualEventCreate**](ManualEventCreate.md)| | + +### Return type + +[**EventOut**](EventOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **eventsDelete** +> eventsDelete(eventId) + +Delete + +Delete an event that was entered by hand. Broker events are evidence, not ours to erase: the next sync or import would bring them straight back. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getEventsApi(); +final int eventId = 56; // int | + +try { + api.eventsDelete(eventId); +} on DioException catch (e) { + print('Exception when calling EventsApi->eventsDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eventId** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **eventsList** > EventPage eventsList(from, to, accountId, instrumentId, kind, status, externalFlow, q, page, pageSize) diff --git a/app/packages/api_client/doc/HealthApi.md b/app/packages/api_client/doc/HealthApi.md index 3910e97..c4c4a98 100644 --- a/app/packages/api_client/doc/HealthApi.md +++ b/app/packages/api_client/doc/HealthApi.md @@ -17,6 +17,8 @@ Method | HTTP request | Description Check +503 when the database cannot be reached, so a container healthcheck can trust the code. + ### Example ```dart import 'package:fintracker_api/api.dart'; diff --git a/app/packages/api_client/doc/HoldingOut.md b/app/packages/api_client/doc/HoldingOut.md index 880f90b..b667862 100644 --- a/app/packages/api_client/doc/HoldingOut.md +++ b/app/packages/api_client/doc/HoldingOut.md @@ -20,6 +20,8 @@ Name | Type | Description | Notes **incomeRub** | **String** | decimal as string | **instrumentId** | **int** | | **ldvEligibleQty** | **String** | decimal as string | +**logoColor** | **String** | | [optional] +**logoUrl** | **String** | | [optional] **marketPrice** | **String** | decimal as string | **name** | **String** | | **priceCurrency** | **String** | | diff --git a/app/packages/api_client/doc/InstrumentOut.md b/app/packages/api_client/doc/InstrumentOut.md index bdad265..f9779e4 100644 --- a/app/packages/api_client/doc/InstrumentOut.md +++ b/app/packages/api_client/doc/InstrumentOut.md @@ -18,6 +18,8 @@ Name | Type | Description | Notes **isActive** | **bool** | | **isin** | **String** | | **issuer** | **String** | | +**logoColor** | **String** | | [optional] +**logoUrl** | **String** | | [optional] **lot** | **int** | | **maturityDate** | [**DateTime**](DateTime.md) | | **name** | **String** | | diff --git a/app/packages/api_client/doc/InstrumentPatch.md b/app/packages/api_client/doc/InstrumentPatch.md new file mode 100644 index 0000000..d042afd --- /dev/null +++ b/app/packages/api_client/doc/InstrumentPatch.md @@ -0,0 +1,19 @@ +# fintracker_api.model.InstrumentPatch + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assetClass** | **String** | | [optional] +**board** | **String** | | [optional] +**lot** | **int** | | [optional] +**name** | **String** | | [optional] +**sector** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/InstrumentsApi.md b/app/packages/api_client/doc/InstrumentsApi.md index d7386a6..b51b951 100644 --- a/app/packages/api_client/doc/InstrumentsApi.md +++ b/app/packages/api_client/doc/InstrumentsApi.md @@ -11,6 +11,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**instrumentsGet**](InstrumentsApi.md#instrumentsget) | **GET** /api/v1/instruments/{instrument_id} | Get [**instrumentsList**](InstrumentsApi.md#instrumentslist) | **GET** /api/v1/instruments | List +[**instrumentsPatch**](InstrumentsApi.md#instrumentspatch) | **PATCH** /api/v1/instruments/{instrument_id} | Patch [**instrumentsPending**](InstrumentsApi.md#instrumentspending) | **GET** /api/v1/instruments/pending | Pending [**instrumentsPendingResolve**](InstrumentsApi.md#instrumentspendingresolve) | **POST** /api/v1/instruments/pending/{pending_id}/resolve | Pending Resolve [**instrumentsSetManualPrice**](InstrumentsApi.md#instrumentssetmanualprice) | **POST** /api/v1/instruments/{instrument_id}/prices | Set Manual Price @@ -110,6 +111,51 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **instrumentsPatch** +> InstrumentOut instrumentsPatch(instrumentId, instrumentPatch) + +Patch + +Correct an instrument by hand: name, board, lot, asset class, sector. The lot only rounds the quantities the rebalancing suggests; the asset class decides the bucket it lands in. Neither is refreshed here — call `POST /metrics/refresh` after, same as `/rules/apply`. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getInstrumentsApi(); +final int instrumentId = 56; // int | +final InstrumentPatch instrumentPatch = ; // InstrumentPatch | + +try { + final response = api.instrumentsPatch(instrumentId, instrumentPatch); + print(response); +} on DioException catch (e) { + print('Exception when calling InstrumentsApi->instrumentsPatch: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instrumentId** | **int**| | + **instrumentPatch** | [**InstrumentPatch**](InstrumentPatch.md)| | + +### Return type + +[**InstrumentOut**](InstrumentOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **instrumentsPending** > List instrumentsPending(status, limit, offset) diff --git a/app/packages/api_client/doc/ManualEventCreate.md b/app/packages/api_client/doc/ManualEventCreate.md new file mode 100644 index 0000000..9ac3728 --- /dev/null +++ b/app/packages/api_client/doc/ManualEventCreate.md @@ -0,0 +1,25 @@ +# fintracker_api.model.ManualEventCreate + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | +**accruedInterest** | **String** | decimal as string | [optional] +**amount** | **String** | decimal as string | [optional] +**currency** | **String** | | [optional] +**description** | **String** | | [optional] +**fee** | **String** | decimal as string | [optional] +**instrumentId** | **int** | | [optional] +**kind** | [**EventKind**](EventKind.md) | | +**price** | **String** | decimal as string | [optional] +**quantity** | **String** | decimal as string | [optional] +**tradeDate** | [**DateTime**](DateTime.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/MetricsApi.md b/app/packages/api_client/doc/MetricsApi.md index 481ab3c..0363d14 100644 --- a/app/packages/api_client/doc/MetricsApi.md +++ b/app/packages/api_client/doc/MetricsApi.md @@ -54,11 +54,11 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **metricsRefresh** -> RefreshLogOut metricsRefresh() +> SyncJobOut metricsRefresh() Refresh -Rebuild every metric_* table inline (seconds at personal volumes). +Queue a rebuild of every metric_* table; the worker runs it. Poll `/metrics/status` until `refreshing` is false. A request while one is already waiting shares it. One that arrives while a rebuild is RUNNING queues another, because the running one may have read the data before the change that prompted this call. ### Example ```dart @@ -79,7 +79,7 @@ This endpoint does not need any parameter. ### Return type -[**RefreshLogOut**](RefreshLogOut.md) +[**SyncJobOut**](SyncJobOut.md) ### Authorization @@ -93,11 +93,11 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **metricsStatus** -> RefreshLogOut metricsStatus() +> MetricsStatusOut metricsStatus() Status -When the metric tables were last rebuilt, and whether it failed. +When the metric tables were last rebuilt, whether they are one consistent snapshot, and whether another rebuild is on its way. ### Example ```dart @@ -118,7 +118,7 @@ This endpoint does not need any parameter. ### Return type -[**RefreshLogOut**](RefreshLogOut.md) +[**MetricsStatusOut**](MetricsStatusOut.md) ### Authorization diff --git a/app/packages/api_client/doc/MetricsStatusOut.md b/app/packages/api_client/doc/MetricsStatusOut.md new file mode 100644 index 0000000..28247ed --- /dev/null +++ b/app/packages/api_client/doc/MetricsStatusOut.md @@ -0,0 +1,17 @@ +# fintracker_api.model.MetricsStatusOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**consistent** | **bool** | | +**lastRefresh** | [**RefreshLogOut**](RefreshLogOut.md) | | +**refreshing** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PortfolioAccountsIn.md b/app/packages/api_client/doc/PortfolioAccountsIn.md new file mode 100644 index 0000000..ed327b2 --- /dev/null +++ b/app/packages/api_client/doc/PortfolioAccountsIn.md @@ -0,0 +1,15 @@ +# fintracker_api.model.PortfolioAccountsIn + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountIds** | **List<int>** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PortfolioCreate.md b/app/packages/api_client/doc/PortfolioCreate.md new file mode 100644 index 0000000..3c5b2a1 --- /dev/null +++ b/app/packages/api_client/doc/PortfolioCreate.md @@ -0,0 +1,16 @@ +# fintracker_api.model.PortfolioCreate + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountIds** | **List<int>** | | [optional] +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PortfolioOut.md b/app/packages/api_client/doc/PortfolioOut.md new file mode 100644 index 0000000..09bb0ee --- /dev/null +++ b/app/packages/api_client/doc/PortfolioOut.md @@ -0,0 +1,18 @@ +# fintracker_api.model.PortfolioOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountIds** | **List<int>** | | +**baseCurrency** | **String** | | +**id** | **int** | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PortfolioPatch.md b/app/packages/api_client/doc/PortfolioPatch.md new file mode 100644 index 0000000..b358efa --- /dev/null +++ b/app/packages/api_client/doc/PortfolioPatch.md @@ -0,0 +1,15 @@ +# fintracker_api.model.PortfolioPatch + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PortfoliosApi.md b/app/packages/api_client/doc/PortfoliosApi.md new file mode 100644 index 0000000..f340590 --- /dev/null +++ b/app/packages/api_client/doc/PortfoliosApi.md @@ -0,0 +1,222 @@ +# fintracker_api.api.PortfoliosApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**portfoliosCreate**](PortfoliosApi.md#portfolioscreate) | **POST** /api/v1/portfolios | Create +[**portfoliosDelete**](PortfoliosApi.md#portfoliosdelete) | **DELETE** /api/v1/portfolios/{portfolio_id} | Delete +[**portfoliosList**](PortfoliosApi.md#portfolioslist) | **GET** /api/v1/portfolios | List +[**portfoliosPatch**](PortfoliosApi.md#portfoliospatch) | **PATCH** /api/v1/portfolios/{portfolio_id} | Patch +[**portfoliosSetAccounts**](PortfoliosApi.md#portfoliossetaccounts) | **PUT** /api/v1/portfolios/{portfolio_id}/accounts | Set Accounts + + +# **portfoliosCreate** +> PortfolioOut portfoliosCreate(portfolioCreate) + +Create + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getPortfoliosApi(); +final PortfolioCreate portfolioCreate = ; // PortfolioCreate | + +try { + final response = api.portfoliosCreate(portfolioCreate); + print(response); +} on DioException catch (e) { + print('Exception when calling PortfoliosApi->portfoliosCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioCreate** | [**PortfolioCreate**](PortfolioCreate.md)| | + +### Return type + +[**PortfolioOut**](PortfolioOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **portfoliosDelete** +> portfoliosDelete(portfolioId) + +Delete + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getPortfoliosApi(); +final int portfolioId = 56; // int | + +try { + api.portfoliosDelete(portfolioId); +} on DioException catch (e) { + print('Exception when calling PortfoliosApi->portfoliosDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioId** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **portfoliosList** +> List portfoliosList() + +List + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getPortfoliosApi(); + +try { + final response = api.portfoliosList(); + print(response); +} on DioException catch (e) { + print('Exception when calling PortfoliosApi->portfoliosList: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<PortfolioOut>**](PortfolioOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **portfoliosPatch** +> PortfolioOut portfoliosPatch(portfolioId, portfolioPatch) + +Patch + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getPortfoliosApi(); +final int portfolioId = 56; // int | +final PortfolioPatch portfolioPatch = ; // PortfolioPatch | + +try { + final response = api.portfoliosPatch(portfolioId, portfolioPatch); + print(response); +} on DioException catch (e) { + print('Exception when calling PortfoliosApi->portfoliosPatch: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioId** | **int**| | + **portfolioPatch** | [**PortfolioPatch**](PortfolioPatch.md)| | + +### Return type + +[**PortfolioOut**](PortfolioOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **portfoliosSetAccounts** +> PortfolioOut portfoliosSetAccounts(portfolioId, portfolioAccountsIn) + +Set Accounts + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getPortfoliosApi(); +final int portfolioId = 56; // int | +final PortfolioAccountsIn portfolioAccountsIn = ; // PortfolioAccountsIn | + +try { + final response = api.portfoliosSetAccounts(portfolioId, portfolioAccountsIn); + print(response); +} on DioException catch (e) { + print('Exception when calling PortfoliosApi->portfoliosSetAccounts: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioId** | **int**| | + **portfolioAccountsIn** | [**PortfolioAccountsIn**](PortfolioAccountsIn.md)| | + +### Return type + +[**PortfolioOut**](PortfolioOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/app/packages/api_client/doc/RefreshLogOut.md b/app/packages/api_client/doc/RefreshLogOut.md index 78d8be0..c788df9 100644 --- a/app/packages/api_client/doc/RefreshLogOut.md +++ b/app/packages/api_client/doc/RefreshLogOut.md @@ -9,9 +9,11 @@ import 'package:fintracker_api/api.dart'; Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | **String** | | +**failedStep** | **String** | | **finishedAt** | [**DateTime**](DateTime.md) | | **id** | **int** | | **startedAt** | [**DateTime**](DateTime.md) | | +**stepTimings** | **Map<String, num>** | | **trigger** | **String** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/app/packages/api_client/doc/ScopeCardOut.md b/app/packages/api_client/doc/ScopeCardOut.md new file mode 100644 index 0000000..4f665f3 --- /dev/null +++ b/app/packages/api_client/doc/ScopeCardOut.md @@ -0,0 +1,27 @@ +# fintracker_api.model.ScopeCardOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**dayChangePct** | **String** | decimal as string | +**dayChangeRub** | **String** | decimal as string | +**incomeYearPct** | **String** | decimal as string | +**incomeYearRub** | **String** | decimal as string | +**investedRub** | **String** | decimal as string | +**kind** | **String** | | +**name** | **String** | | +**pnlPct** | **String** | decimal as string | +**pnlRub** | **String** | decimal as string | +**scope** | **String** | | +**totalRub** | **String** | decimal as string | +**xirr** | **String** | decimal as string | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/lib/fintracker_api.dart b/app/packages/api_client/lib/fintracker_api.dart index 35e64b7..c275158 100644 --- a/app/packages/api_client/lib/fintracker_api.dart +++ b/app/packages/api_client/lib/fintracker_api.dart @@ -24,6 +24,7 @@ export 'package:fintracker_api/src/api/instruments_api.dart'; export 'package:fintracker_api/src/api/links_api.dart'; export 'package:fintracker_api/src/api/metrics_api.dart'; export 'package:fintracker_api/src/api/networth_api.dart'; +export 'package:fintracker_api/src/api/portfolios_api.dart'; export 'package:fintracker_api/src/api/rebalance_api.dart'; export 'package:fintracker_api/src/api/rules_api.dart'; export 'package:fintracker_api/src/api/sync_api.dart'; @@ -31,6 +32,7 @@ export 'package:fintracker_api/src/api/tax_api.dart'; export 'package:fintracker_api/src/api/transactions_api.dart'; export 'package:fintracker_api/src/model/account_balance.dart'; +export 'package:fintracker_api/src/model/account_create.dart'; export 'package:fintracker_api/src/model/account_kind.dart'; export 'package:fintracker_api/src/model/account_out.dart'; export 'package:fintracker_api/src/model/account_patch.dart'; @@ -75,17 +77,24 @@ export 'package:fintracker_api/src/model/import_result.dart'; export 'package:fintracker_api/src/model/import_summary.dart'; export 'package:fintracker_api/src/model/instrument_detail.dart'; export 'package:fintracker_api/src/model/instrument_out.dart'; +export 'package:fintracker_api/src/model/instrument_patch.dart'; export 'package:fintracker_api/src/model/job_status.dart'; export 'package:fintracker_api/src/model/link_create.dart'; export 'package:fintracker_api/src/model/link_out.dart'; export 'package:fintracker_api/src/model/login_request.dart'; export 'package:fintracker_api/src/model/lot_out.dart'; +export 'package:fintracker_api/src/model/manual_event_create.dart'; +export 'package:fintracker_api/src/model/metrics_status_out.dart'; export 'package:fintracker_api/src/model/net_worth_breakdown.dart'; export 'package:fintracker_api/src/model/net_worth_day.dart'; export 'package:fintracker_api/src/model/new_instrument.dart'; export 'package:fintracker_api/src/model/pending_instrument_out.dart'; export 'package:fintracker_api/src/model/pending_resolve_request.dart'; export 'package:fintracker_api/src/model/pending_resolve_result.dart'; +export 'package:fintracker_api/src/model/portfolio_accounts_in.dart'; +export 'package:fintracker_api/src/model/portfolio_create.dart'; +export 'package:fintracker_api/src/model/portfolio_out.dart'; +export 'package:fintracker_api/src/model/portfolio_patch.dart'; export 'package:fintracker_api/src/model/price_manual_in.dart'; export 'package:fintracker_api/src/model/price_manual_out.dart'; export 'package:fintracker_api/src/model/price_point.dart'; @@ -106,6 +115,7 @@ export 'package:fintracker_api/src/model/rule_patch.dart'; export 'package:fintracker_api/src/model/run_status.dart'; export 'package:fintracker_api/src/model/runway_out.dart'; export 'package:fintracker_api/src/model/sample_event_out.dart'; +export 'package:fintracker_api/src/model/scope_card_out.dart'; export 'package:fintracker_api/src/model/scope_out.dart'; export 'package:fintracker_api/src/model/source_status.dart'; export 'package:fintracker_api/src/model/spending_row.dart'; diff --git a/app/packages/api_client/lib/src/api.dart b/app/packages/api_client/lib/src/api.dart index 27ffc56..0d6b478 100644 --- a/app/packages/api_client/lib/src/api.dart +++ b/app/packages/api_client/lib/src/api.dart @@ -22,6 +22,7 @@ import 'package:fintracker_api/src/api/instruments_api.dart'; import 'package:fintracker_api/src/api/links_api.dart'; import 'package:fintracker_api/src/api/metrics_api.dart'; import 'package:fintracker_api/src/api/networth_api.dart'; +import 'package:fintracker_api/src/api/portfolios_api.dart'; import 'package:fintracker_api/src/api/rebalance_api.dart'; import 'package:fintracker_api/src/api/rules_api.dart'; import 'package:fintracker_api/src/api/sync_api.dart'; @@ -209,6 +210,12 @@ class FintrackerApi { return NetworthApi(dio); } + /// Get PortfoliosApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + PortfoliosApi getPortfoliosApi() { + return PortfoliosApi(dio); + } + /// Get RebalanceApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed RebalanceApi getRebalanceApi() { diff --git a/app/packages/api_client/lib/src/api/accounts_api.dart b/app/packages/api_client/lib/src/api/accounts_api.dart index 5731489..278f648 100644 --- a/app/packages/api_client/lib/src/api/accounts_api.dart +++ b/app/packages/api_client/lib/src/api/accounts_api.dart @@ -9,6 +9,7 @@ import 'dart:convert'; import 'package:fintracker_api/src/deserialize.dart'; import 'package:dio/dio.dart'; +import 'package:fintracker_api/src/model/account_create.dart'; import 'package:fintracker_api/src/model/account_out.dart'; import 'package:fintracker_api/src/model/account_patch.dart'; import 'package:fintracker_api/src/model/problem.dart'; @@ -19,6 +20,103 @@ class AccountsApi { const AccountsApi(this._dio); + /// Create + /// Create the broker account a report import will write into. `source_id` is the agreement number the report prints: it is how the import finds the account on its own the next time. + /// + /// Parameters: + /// * [accountCreate] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [AccountOut] as data + /// Throws [DioException] if API call or serialization fails + Future> accountsCreate({ + required AccountCreate accountCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/accounts'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(accountCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + AccountOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'AccountOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + /// List /// Every account, archived ones included — the client decides what to show. /// diff --git a/app/packages/api_client/lib/src/api/analytics_api.dart b/app/packages/api_client/lib/src/api/analytics_api.dart index db60343..bc47720 100644 --- a/app/packages/api_client/lib/src/api/analytics_api.dart +++ b/app/packages/api_client/lib/src/api/analytics_api.dart @@ -15,6 +15,7 @@ import 'package:fintracker_api/src/model/cash_flow_broker_month.dart'; import 'package:fintracker_api/src/model/holding_out.dart'; import 'package:fintracker_api/src/model/problem.dart'; import 'package:fintracker_api/src/model/returns_out.dart'; +import 'package:fintracker_api/src/model/scope_card_out.dart'; import 'package:fintracker_api/src/model/scope_out.dart'; import 'package:fintracker_api/src/model/summary_out.dart'; import 'package:fintracker_api/src/model/value_day.dart'; @@ -277,6 +278,82 @@ _responseData = rawData == null ? null : deserialize, HoldingOu ); } + /// Overview + /// One card per scope for the home screen, in a single round trip. `all` first, then the portfolios, then the accounts by value. A scope holding nothing at all is left out: a card of zeros is noise, not an answer. + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> analyticsOverview({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/overview'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, ScopeCardOut>(rawData, 'List', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + /// Returns /// XIRR and TWR per period, shortest first. /// diff --git a/app/packages/api_client/lib/src/api/events_api.dart b/app/packages/api_client/lib/src/api/events_api.dart index 25b595f..fcc936d 100644 --- a/app/packages/api_client/lib/src/api/events_api.dart +++ b/app/packages/api_client/lib/src/api/events_api.dart @@ -10,8 +10,10 @@ import 'package:fintracker_api/src/deserialize.dart'; import 'package:dio/dio.dart'; import 'package:fintracker_api/src/model/event_kind.dart'; +import 'package:fintracker_api/src/model/event_out.dart'; import 'package:fintracker_api/src/model/event_page.dart'; import 'package:fintracker_api/src/model/event_status.dart'; +import 'package:fintracker_api/src/model/manual_event_create.dart'; import 'package:fintracker_api/src/model/problem.dart'; class EventsApi { @@ -20,6 +22,156 @@ class EventsApi { const EventsApi(this._dio); + /// Create + /// Enter an event by hand. It is `confirmed` at once: it is the user's own statement, so it is never shadowed by the account's primary feed. + /// + /// Parameters: + /// * [manualEventCreate] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [EventOut] as data + /// Throws [DioException] if API call or serialization fails + Future> eventsCreate({ + required ManualEventCreate manualEventCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/events'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(manualEventCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + EventOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'EventOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Delete + /// Delete an event that was entered by hand. Broker events are evidence, not ours to erase: the next sync or import would bring them straight back. + /// + /// Parameters: + /// * [eventId] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> eventsDelete({ + required int eventId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/events/{event_id}'.replaceAll('{' r'event_id' '}', eventId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + /// List /// One page of ledger events, newest first, with RUB amounts at each own date's rate. /// diff --git a/app/packages/api_client/lib/src/api/health_api.dart b/app/packages/api_client/lib/src/api/health_api.dart index c037b24..020ec36 100644 --- a/app/packages/api_client/lib/src/api/health_api.dart +++ b/app/packages/api_client/lib/src/api/health_api.dart @@ -19,7 +19,7 @@ class HealthApi { const HealthApi(this._dio); /// Check - /// + /// 503 when the database cannot be reached, so a container healthcheck can trust the code. /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation diff --git a/app/packages/api_client/lib/src/api/instruments_api.dart b/app/packages/api_client/lib/src/api/instruments_api.dart index ac7e4f3..888f4ed 100644 --- a/app/packages/api_client/lib/src/api/instruments_api.dart +++ b/app/packages/api_client/lib/src/api/instruments_api.dart @@ -11,6 +11,7 @@ import 'package:dio/dio.dart'; import 'package:fintracker_api/src/model/instrument_detail.dart'; import 'package:fintracker_api/src/model/instrument_out.dart'; +import 'package:fintracker_api/src/model/instrument_patch.dart'; import 'package:fintracker_api/src/model/pending_instrument_out.dart'; import 'package:fintracker_api/src/model/pending_resolve_request.dart'; import 'package:fintracker_api/src/model/pending_resolve_result.dart'; @@ -204,6 +205,105 @@ _responseData = rawData == null ? null : deserialize, Instru ); } + /// Patch + /// Correct an instrument by hand: name, board, lot, asset class, sector. The lot only rounds the quantities the rebalancing suggests; the asset class decides the bucket it lands in. Neither is refreshed here — call `POST /metrics/refresh` after, same as `/rules/apply`. + /// + /// Parameters: + /// * [instrumentId] + /// * [instrumentPatch] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [InstrumentOut] as data + /// Throws [DioException] if API call or serialization fails + Future> instrumentsPatch({ + required int instrumentId, + required InstrumentPatch instrumentPatch, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/instruments/{instrument_id}'.replaceAll('{' r'instrument_id' '}', instrumentId.toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(instrumentPatch); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + InstrumentOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'InstrumentOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + /// Pending /// Instruments a report named that nothing in the master resolves to. /// diff --git a/app/packages/api_client/lib/src/api/metrics_api.dart b/app/packages/api_client/lib/src/api/metrics_api.dart index 5fc0ca6..15e1999 100644 --- a/app/packages/api_client/lib/src/api/metrics_api.dart +++ b/app/packages/api_client/lib/src/api/metrics_api.dart @@ -10,8 +10,9 @@ import 'package:fintracker_api/src/deserialize.dart'; import 'package:dio/dio.dart'; import 'package:fintracker_api/src/model/data_quality_row.dart'; +import 'package:fintracker_api/src/model/metrics_status_out.dart'; import 'package:fintracker_api/src/model/problem.dart'; -import 'package:fintracker_api/src/model/refresh_log_out.dart'; +import 'package:fintracker_api/src/model/sync_job_out.dart'; class MetricsApi { @@ -96,7 +97,7 @@ _responseData = rawData == null ? null : deserialize, DataQ } /// Refresh - /// Rebuild every metric_* table inline (seconds at personal volumes). + /// Queue a rebuild of every metric_* table; the worker runs it. Poll `/metrics/status` until `refreshing` is false. A request while one is already waiting shares it. One that arrives while a rebuild is RUNNING queues another, because the running one may have read the data before the change that prompted this call. /// /// Parameters: /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation @@ -106,9 +107,9 @@ _responseData = rawData == null ? null : deserialize, DataQ /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future] containing a [Response] with a [RefreshLogOut] as data + /// Returns a [Future] containing a [Response] with a [SyncJobOut] as data /// Throws [DioException] if API call or serialization fails - Future> metricsRefresh({ + Future> metricsRefresh({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -143,11 +144,11 @@ _responseData = rawData == null ? null : deserialize, DataQ onReceiveProgress: onReceiveProgress, ); - RefreshLogOut? _responseData; + SyncJobOut? _responseData; try { final rawData = _response.data; -_responseData = rawData == null ? null : deserialize(rawData, 'RefreshLogOut', growable: true); +_responseData = rawData == null ? null : deserialize(rawData, 'SyncJobOut', growable: true); } catch (error, stackTrace) { throw DioException( @@ -159,7 +160,7 @@ _responseData = rawData == null ? null : deserialize( + return Response( data: _responseData, headers: _response.headers, isRedirect: _response.isRedirect, @@ -172,7 +173,7 @@ _responseData = rawData == null ? null : deserialize> metricsStatus({ + Future> metricsStatus({ CancelToken? cancelToken, Map? headers, Map? extra, @@ -219,11 +220,11 @@ _responseData = rawData == null ? null : deserialize(rawData, 'RefreshLogOut', growable: true); +_responseData = rawData == null ? null : deserialize(rawData, 'MetricsStatusOut', growable: true); } catch (error, stackTrace) { throw DioException( @@ -235,7 +236,7 @@ _responseData = rawData == null ? null : deserialize( + return Response( data: _responseData, headers: _response.headers, isRedirect: _response.isRedirect, diff --git a/app/packages/api_client/lib/src/api/portfolios_api.dart b/app/packages/api_client/lib/src/api/portfolios_api.dart new file mode 100644 index 0000000..c800e2f --- /dev/null +++ b/app/packages/api_client/lib/src/api/portfolios_api.dart @@ -0,0 +1,448 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:fintracker_api/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:fintracker_api/src/model/portfolio_accounts_in.dart'; +import 'package:fintracker_api/src/model/portfolio_create.dart'; +import 'package:fintracker_api/src/model/portfolio_out.dart'; +import 'package:fintracker_api/src/model/portfolio_patch.dart'; +import 'package:fintracker_api/src/model/problem.dart'; + +class PortfoliosApi { + + final Dio _dio; + + const PortfoliosApi(this._dio); + + /// Create + /// + /// + /// Parameters: + /// * [portfolioCreate] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PortfolioOut] as data + /// Throws [DioException] if API call or serialization fails + Future> portfoliosCreate({ + required PortfolioCreate portfolioCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(portfolioCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PortfolioOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'PortfolioOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Delete + /// + /// + /// Parameters: + /// * [portfolioId] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> portfoliosDelete({ + required int portfolioId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios/{portfolio_id}'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// List + /// + /// + /// Parameters: + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [List] as data + /// Throws [DioException] if API call or serialization fails + Future>> portfoliosList({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, PortfolioOut>(rawData, 'List', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Patch + /// + /// + /// Parameters: + /// * [portfolioId] + /// * [portfolioPatch] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PortfolioOut] as data + /// Throws [DioException] if API call or serialization fails + Future> portfoliosPatch({ + required int portfolioId, + required PortfolioPatch portfolioPatch, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios/{portfolio_id}'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(portfolioPatch); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PortfolioOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'PortfolioOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Set Accounts + /// + /// + /// Parameters: + /// * [portfolioId] + /// * [portfolioAccountsIn] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] containing a [Response] with a [PortfolioOut] as data + /// Throws [DioException] if API call or serialization fails + Future> portfoliosSetAccounts({ + required int portfolioId, + required PortfolioAccountsIn portfolioAccountsIn, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios/{portfolio_id}/accounts'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString()); + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(portfolioAccountsIn); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PortfolioOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'PortfolioOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + +} diff --git a/app/packages/api_client/lib/src/deserialize.dart b/app/packages/api_client/lib/src/deserialize.dart index 188491e..6232f60 100644 --- a/app/packages/api_client/lib/src/deserialize.dart +++ b/app/packages/api_client/lib/src/deserialize.dart @@ -1,4 +1,5 @@ import 'package:fintracker_api/src/model/account_balance.dart'; +import 'package:fintracker_api/src/model/account_create.dart'; import 'package:fintracker_api/src/model/account_out.dart'; import 'package:fintracker_api/src/model/account_patch.dart'; import 'package:fintracker_api/src/model/account_suggestion.dart'; @@ -35,16 +36,23 @@ import 'package:fintracker_api/src/model/import_result.dart'; import 'package:fintracker_api/src/model/import_summary.dart'; import 'package:fintracker_api/src/model/instrument_detail.dart'; import 'package:fintracker_api/src/model/instrument_out.dart'; +import 'package:fintracker_api/src/model/instrument_patch.dart'; import 'package:fintracker_api/src/model/link_create.dart'; import 'package:fintracker_api/src/model/link_out.dart'; import 'package:fintracker_api/src/model/login_request.dart'; import 'package:fintracker_api/src/model/lot_out.dart'; +import 'package:fintracker_api/src/model/manual_event_create.dart'; +import 'package:fintracker_api/src/model/metrics_status_out.dart'; import 'package:fintracker_api/src/model/net_worth_breakdown.dart'; import 'package:fintracker_api/src/model/net_worth_day.dart'; import 'package:fintracker_api/src/model/new_instrument.dart'; import 'package:fintracker_api/src/model/pending_instrument_out.dart'; import 'package:fintracker_api/src/model/pending_resolve_request.dart'; import 'package:fintracker_api/src/model/pending_resolve_result.dart'; +import 'package:fintracker_api/src/model/portfolio_accounts_in.dart'; +import 'package:fintracker_api/src/model/portfolio_create.dart'; +import 'package:fintracker_api/src/model/portfolio_out.dart'; +import 'package:fintracker_api/src/model/portfolio_patch.dart'; import 'package:fintracker_api/src/model/price_manual_in.dart'; import 'package:fintracker_api/src/model/price_manual_out.dart'; import 'package:fintracker_api/src/model/price_point.dart'; @@ -62,6 +70,7 @@ import 'package:fintracker_api/src/model/rule_out.dart'; import 'package:fintracker_api/src/model/rule_patch.dart'; import 'package:fintracker_api/src/model/runway_out.dart'; import 'package:fintracker_api/src/model/sample_event_out.dart'; +import 'package:fintracker_api/src/model/scope_card_out.dart'; import 'package:fintracker_api/src/model/scope_out.dart'; import 'package:fintracker_api/src/model/source_status.dart'; import 'package:fintracker_api/src/model/spending_row.dart'; @@ -107,6 +116,8 @@ final _regMap = RegExp(r'^Map$'); return (value is double ? value : double.parse('$value')) as ReturnType; case 'AccountBalance': return AccountBalance.fromJson(value as Map) as ReturnType; + case 'AccountCreate': + return AccountCreate.fromJson(value as Map) as ReturnType; case 'AccountKind': @@ -203,6 +214,8 @@ final _regMap = RegExp(r'^Map$'); return InstrumentDetail.fromJson(value as Map) as ReturnType; case 'InstrumentOut': return InstrumentOut.fromJson(value as Map) as ReturnType; + case 'InstrumentPatch': + return InstrumentPatch.fromJson(value as Map) as ReturnType; case 'JobStatus': @@ -214,6 +227,10 @@ final _regMap = RegExp(r'^Map$'); return LoginRequest.fromJson(value as Map) as ReturnType; case 'LotOut': return LotOut.fromJson(value as Map) as ReturnType; + case 'ManualEventCreate': + return ManualEventCreate.fromJson(value as Map) as ReturnType; + case 'MetricsStatusOut': + return MetricsStatusOut.fromJson(value as Map) as ReturnType; case 'NetWorthBreakdown': return NetWorthBreakdown.fromJson(value as Map) as ReturnType; case 'NetWorthDay': @@ -226,6 +243,14 @@ final _regMap = RegExp(r'^Map$'); return PendingResolveRequest.fromJson(value as Map) as ReturnType; case 'PendingResolveResult': return PendingResolveResult.fromJson(value as Map) as ReturnType; + case 'PortfolioAccountsIn': + return PortfolioAccountsIn.fromJson(value as Map) as ReturnType; + case 'PortfolioCreate': + return PortfolioCreate.fromJson(value as Map) as ReturnType; + case 'PortfolioOut': + return PortfolioOut.fromJson(value as Map) as ReturnType; + case 'PortfolioPatch': + return PortfolioPatch.fromJson(value as Map) as ReturnType; case 'PriceManualIn': return PriceManualIn.fromJson(value as Map) as ReturnType; case 'PriceManualOut': @@ -269,6 +294,8 @@ final _regMap = RegExp(r'^Map$'); return RunwayOut.fromJson(value as Map) as ReturnType; case 'SampleEventOut': return SampleEventOut.fromJson(value as Map) as ReturnType; + case 'ScopeCardOut': + return ScopeCardOut.fromJson(value as Map) as ReturnType; case 'ScopeOut': return ScopeOut.fromJson(value as Map) as ReturnType; case 'SourceStatus': diff --git a/app/packages/api_client/lib/src/model/account_create.dart b/app/packages/api_client/lib/src/model/account_create.dart new file mode 100644 index 0000000..0016ec7 --- /dev/null +++ b/app/packages/api_client/lib/src/model/account_create.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/broker.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'account_create.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AccountCreate { + /// Returns a new [AccountCreate] instance. + AccountCreate({ + + required this.broker, + + this.currency = 'RUB', + + required this.name, + + required this.sourceId, + }); + + @JsonKey( + + name: r'broker', + required: true, + includeIfNull: false, + unknownEnumValue: Broker.unknownDefaultOpenApi, + ) + + + final Broker broker; + + + + @JsonKey( + defaultValue: 'RUB', + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + /// Agreement number exactly as the broker's report prints it + @JsonKey( + + name: r'source_id', + required: true, + includeIfNull: false, + ) + + + final String sourceId; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AccountCreate && + other.broker == broker && + other.currency == currency && + other.name == name && + other.sourceId == sourceId; + + @override + int get hashCode => + broker.hashCode + + currency.hashCode + + name.hashCode + + sourceId.hashCode; + + factory AccountCreate.fromJson(Map json) => _$AccountCreateFromJson(json); + + Map toJson() => _$AccountCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/account_create.g.dart b/app/packages/api_client/lib/src/model/account_create.g.dart new file mode 100644 index 0000000..7d425e4 --- /dev/null +++ b/app/packages/api_client/lib/src/model/account_create.g.dart @@ -0,0 +1,127 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'account_create.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$AccountCreateCWProxy { + AccountCreate broker(Broker broker); + + AccountCreate currency(String? currency); + + AccountCreate name(String name); + + AccountCreate sourceId(String sourceId); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// AccountCreate(...).copyWith(id: 12, name: "My name") + /// ```` + AccountCreate call({ + Broker broker, + String? currency, + String name, + String sourceId, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountCreate.copyWith.fieldName(...)` +class _$AccountCreateCWProxyImpl implements _$AccountCreateCWProxy { + const _$AccountCreateCWProxyImpl(this._value); + + final AccountCreate _value; + + @override + AccountCreate broker(Broker broker) => this(broker: broker); + + @override + AccountCreate currency(String? currency) => this(currency: currency); + + @override + AccountCreate name(String name) => this(name: name); + + @override + AccountCreate sourceId(String sourceId) => this(sourceId: sourceId); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// AccountCreate(...).copyWith(id: 12, name: "My name") + /// ```` + AccountCreate call({ + Object? broker = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? sourceId = const $CopyWithPlaceholder(), + }) { + return AccountCreate( + broker: broker == const $CopyWithPlaceholder() + ? _value.broker + // ignore: cast_nullable_to_non_nullable + : broker as Broker, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + sourceId: sourceId == const $CopyWithPlaceholder() + ? _value.sourceId + // ignore: cast_nullable_to_non_nullable + : sourceId as String, + ); + } +} + +extension $AccountCreateCopyWith on AccountCreate { + /// Returns a callable class that can be used as follows: `instanceOfAccountCreate.copyWith(...)` or like so:`instanceOfAccountCreate.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$AccountCreateCWProxy get copyWith => _$AccountCreateCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AccountCreate _$AccountCreateFromJson(Map json) => + $checkedCreate('AccountCreate', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['broker', 'name', 'source_id']); + final val = AccountCreate( + broker: $checkedConvert( + 'broker', + (v) => $enumDecode( + _$BrokerEnumMap, + v, + unknownValue: Broker.unknownDefaultOpenApi, + ), + ), + currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'), + name: $checkedConvert('name', (v) => v as String), + sourceId: $checkedConvert('source_id', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'sourceId': 'source_id'}); + +Map _$AccountCreateToJson(AccountCreate instance) => + { + 'broker': _$BrokerEnumMap[instance.broker]!, + 'currency': ?instance.currency, + 'name': instance.name, + 'source_id': instance.sourceId, + }; + +const _$BrokerEnumMap = { + Broker.tinvest: 'tinvest', + Broker.sber: 'sber', + Broker.vtb: 'vtb', + Broker.other: 'other', + Broker.unknownDefaultOpenApi: 'unknown_default_open_api', +}; diff --git a/app/packages/api_client/lib/src/model/account_out.dart b/app/packages/api_client/lib/src/model/account_out.dart index 55e34d8..f62a715 100644 --- a/app/packages/api_client/lib/src/model/account_out.dart +++ b/app/packages/api_client/lib/src/model/account_out.dart @@ -36,6 +36,8 @@ class AccountOut { required this.currency, + required this.disabled, + required this.id, required this.includeInNetWorth, @@ -57,6 +59,8 @@ class AccountOut { required this.sourceId, required this.startBalance, + + this.valueRub, }); @JsonKey( @@ -134,6 +138,18 @@ class AccountOut { + @JsonKey( + + name: r'disabled', + required: true, + includeIfNull: false, + ) + + + final bool disabled; + + + @JsonKey( name: r'id', @@ -270,6 +286,19 @@ class AccountOut { + /// decimal as string + @JsonKey( + + name: r'value_rub', + required: false, + includeIfNull: false, + ) + + + final String? valueRub; + + + @override @@ -280,6 +309,7 @@ class AccountOut { other.broker == broker && other.creditLimit == creditLimit && other.currency == currency && + other.disabled == disabled && other.id == id && other.includeInNetWorth == includeInNetWorth && other.kind == kind && @@ -290,7 +320,8 @@ class AccountOut { other.role == role && other.source_ == source_ && other.sourceId == sourceId && - other.startBalance == startBalance; + other.startBalance == startBalance && + other.valueRub == valueRub; @override int get hashCode => @@ -300,6 +331,7 @@ class AccountOut { (broker == null ? 0 : broker.hashCode) + (creditLimit == null ? 0 : creditLimit.hashCode) + currency.hashCode + + disabled.hashCode + id.hashCode + includeInNetWorth.hashCode + kind.hashCode + @@ -310,7 +342,8 @@ class AccountOut { role.hashCode + source_.hashCode + sourceId.hashCode + - (startBalance == null ? 0 : startBalance.hashCode); + (startBalance == null ? 0 : startBalance.hashCode) + + (valueRub == null ? 0 : valueRub.hashCode); factory AccountOut.fromJson(Map json) => _$AccountOutFromJson(json); diff --git a/app/packages/api_client/lib/src/model/account_out.g.dart b/app/packages/api_client/lib/src/model/account_out.g.dart index 97f90d6..d38b43d 100644 --- a/app/packages/api_client/lib/src/model/account_out.g.dart +++ b/app/packages/api_client/lib/src/model/account_out.g.dart @@ -19,6 +19,8 @@ abstract class _$AccountOutCWProxy { AccountOut currency(String currency); + AccountOut disabled(bool disabled); + AccountOut id(int id); AccountOut includeInNetWorth(bool includeInNetWorth); @@ -41,6 +43,8 @@ abstract class _$AccountOutCWProxy { AccountOut startBalance(String? startBalance); + AccountOut valueRub(String? valueRub); + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage @@ -54,6 +58,7 @@ abstract class _$AccountOutCWProxy { Broker? broker, String? creditLimit, String currency, + bool disabled, int id, bool includeInNetWorth, AccountKind kind, @@ -65,6 +70,7 @@ abstract class _$AccountOutCWProxy { String source_, String sourceId, String? startBalance, + String? valueRub, }); } @@ -93,6 +99,9 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy { @override AccountOut currency(String currency) => this(currency: currency); + @override + AccountOut disabled(bool disabled) => this(disabled: disabled); + @override AccountOut id(int id) => this(id: id); @@ -130,6 +139,9 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy { AccountOut startBalance(String? startBalance) => this(startBalance: startBalance); + @override + AccountOut valueRub(String? valueRub) => this(valueRub: valueRub); + @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// @@ -144,6 +156,7 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy { Object? broker = const $CopyWithPlaceholder(), Object? creditLimit = const $CopyWithPlaceholder(), Object? currency = const $CopyWithPlaceholder(), + Object? disabled = const $CopyWithPlaceholder(), Object? id = const $CopyWithPlaceholder(), Object? includeInNetWorth = const $CopyWithPlaceholder(), Object? kind = const $CopyWithPlaceholder(), @@ -155,6 +168,7 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy { Object? source_ = const $CopyWithPlaceholder(), Object? sourceId = const $CopyWithPlaceholder(), Object? startBalance = const $CopyWithPlaceholder(), + Object? valueRub = const $CopyWithPlaceholder(), }) { return AccountOut( archived: archived == const $CopyWithPlaceholder() @@ -181,6 +195,10 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy { ? _value.currency // ignore: cast_nullable_to_non_nullable : currency as String, + disabled: disabled == const $CopyWithPlaceholder() + ? _value.disabled + // ignore: cast_nullable_to_non_nullable + : disabled as bool, id: id == const $CopyWithPlaceholder() ? _value.id // ignore: cast_nullable_to_non_nullable @@ -225,6 +243,10 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy { ? _value.startBalance // ignore: cast_nullable_to_non_nullable : startBalance as String?, + valueRub: valueRub == const $CopyWithPlaceholder() + ? _value.valueRub + // ignore: cast_nullable_to_non_nullable + : valueRub as String?, ); } } @@ -252,6 +274,7 @@ AccountOut _$AccountOutFromJson(Map json) => $checkedCreate( 'broker', 'credit_limit', 'currency', + 'disabled', 'id', 'include_in_net_worth', 'kind', @@ -282,6 +305,7 @@ AccountOut _$AccountOutFromJson(Map json) => $checkedCreate( ), creditLimit: $checkedConvert('credit_limit', (v) => v as String?), currency: $checkedConvert('currency', (v) => v as String), + disabled: $checkedConvert('disabled', (v) => v as bool), id: $checkedConvert('id', (v) => (v as num).toInt()), includeInNetWorth: $checkedConvert( 'include_in_net_worth', @@ -323,6 +347,7 @@ AccountOut _$AccountOutFromJson(Map json) => $checkedCreate( source_: $checkedConvert('source', (v) => v as String), sourceId: $checkedConvert('source_id', (v) => v as String), startBalance: $checkedConvert('start_balance', (v) => v as String?), + valueRub: $checkedConvert('value_rub', (v) => v as String?), ); return val; }, @@ -336,6 +361,7 @@ AccountOut _$AccountOutFromJson(Map json) => $checkedCreate( 'source_': 'source', 'sourceId': 'source_id', 'startBalance': 'start_balance', + 'valueRub': 'value_rub', }, ); @@ -347,6 +373,7 @@ Map _$AccountOutToJson(AccountOut instance) => 'broker': _$BrokerEnumMap[instance.broker], 'credit_limit': instance.creditLimit, 'currency': instance.currency, + 'disabled': instance.disabled, 'id': instance.id, 'include_in_net_worth': instance.includeInNetWorth, 'kind': _$AccountKindEnumMap[instance.kind]!, @@ -358,6 +385,7 @@ Map _$AccountOutToJson(AccountOut instance) => 'source': instance.source_, 'source_id': instance.sourceId, 'start_balance': instance.startBalance, + 'value_rub': ?instance.valueRub, }; const _$BrokerEnumMap = { diff --git a/app/packages/api_client/lib/src/model/account_patch.dart b/app/packages/api_client/lib/src/model/account_patch.dart index a7c9659..7f5ba4a 100644 --- a/app/packages/api_client/lib/src/model/account_patch.dart +++ b/app/packages/api_client/lib/src/model/account_patch.dart @@ -22,6 +22,8 @@ class AccountPatch { /// Returns a new [AccountPatch] instance. AccountPatch({ + this.disabled, + this.includeInNetWorth, this.mirrorOfAccountId, @@ -33,6 +35,18 @@ class AccountPatch { this.role, }); + @JsonKey( + + name: r'disabled', + required: false, + includeIfNull: false, + ) + + + final bool? disabled; + + + @JsonKey( name: r'include_in_net_worth', @@ -99,6 +113,7 @@ class AccountPatch { @override bool operator ==(Object other) => identical(this, other) || other is AccountPatch && + other.disabled == disabled && other.includeInNetWorth == includeInNetWorth && other.mirrorOfAccountId == mirrorOfAccountId && other.name == name && @@ -107,6 +122,7 @@ class AccountPatch { @override int get hashCode => + (disabled == null ? 0 : disabled.hashCode) + (includeInNetWorth == null ? 0 : includeInNetWorth.hashCode) + (mirrorOfAccountId == null ? 0 : mirrorOfAccountId.hashCode) + (name == null ? 0 : name.hashCode) + diff --git a/app/packages/api_client/lib/src/model/account_patch.g.dart b/app/packages/api_client/lib/src/model/account_patch.g.dart index 42f8753..410bbf1 100644 --- a/app/packages/api_client/lib/src/model/account_patch.g.dart +++ b/app/packages/api_client/lib/src/model/account_patch.g.dart @@ -7,6 +7,8 @@ part of 'account_patch.dart'; // ************************************************************************** abstract class _$AccountPatchCWProxy { + AccountPatch disabled(bool? disabled); + AccountPatch includeInNetWorth(bool? includeInNetWorth); AccountPatch mirrorOfAccountId(int? mirrorOfAccountId); @@ -24,6 +26,7 @@ abstract class _$AccountPatchCWProxy { /// AccountPatch(...).copyWith(id: 12, name: "My name") /// ```` AccountPatch call({ + bool? disabled, bool? includeInNetWorth, int? mirrorOfAccountId, String? name, @@ -38,6 +41,9 @@ class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy { final AccountPatch _value; + @override + AccountPatch disabled(bool? disabled) => this(disabled: disabled); + @override AccountPatch includeInNetWorth(bool? includeInNetWorth) => this(includeInNetWorth: includeInNetWorth); @@ -64,6 +70,7 @@ class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy { /// AccountPatch(...).copyWith(id: 12, name: "My name") /// ```` AccountPatch call({ + Object? disabled = const $CopyWithPlaceholder(), Object? includeInNetWorth = const $CopyWithPlaceholder(), Object? mirrorOfAccountId = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), @@ -71,6 +78,10 @@ class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy { Object? role = const $CopyWithPlaceholder(), }) { return AccountPatch( + disabled: disabled == const $CopyWithPlaceholder() + ? _value.disabled + // ignore: cast_nullable_to_non_nullable + : disabled as bool?, includeInNetWorth: includeInNetWorth == const $CopyWithPlaceholder() ? _value.includeInNetWorth // ignore: cast_nullable_to_non_nullable @@ -111,6 +122,7 @@ AccountPatch _$AccountPatchFromJson(Map json) => json, ($checkedConvert) { final val = AccountPatch( + disabled: $checkedConvert('disabled', (v) => v as bool?), includeInNetWorth: $checkedConvert( 'include_in_net_worth', (v) => v as bool?, @@ -149,6 +161,7 @@ AccountPatch _$AccountPatchFromJson(Map json) => Map _$AccountPatchToJson( AccountPatch instance, ) => { + 'disabled': ?instance.disabled, 'include_in_net_worth': ?instance.includeInNetWorth, 'mirror_of_account_id': ?instance.mirrorOfAccountId, 'name': ?instance.name, diff --git a/app/packages/api_client/lib/src/model/event_out.dart b/app/packages/api_client/lib/src/model/event_out.dart index 711ac46..6db7a26 100644 --- a/app/packages/api_client/lib/src/model/event_out.dart +++ b/app/packages/api_client/lib/src/model/event_out.dart @@ -50,6 +50,8 @@ class EventOut { required this.quantity, + required this.source_, + required this.status, required this.tax, @@ -236,6 +238,18 @@ class EventOut { + @JsonKey( + + name: r'source', + required: true, + includeIfNull: false, + ) + + + final String source_; + + + @JsonKey( name: r'status', @@ -316,6 +330,7 @@ class EventOut { other.price == price && other.priceCurrency == priceCurrency && other.quantity == quantity && + other.source_ == source_ && other.status == status && other.tax == tax && other.ticker == ticker && @@ -338,6 +353,7 @@ class EventOut { (price == null ? 0 : price.hashCode) + (priceCurrency == null ? 0 : priceCurrency.hashCode) + (quantity == null ? 0 : quantity.hashCode) + + source_.hashCode + status.hashCode + (tax == null ? 0 : tax.hashCode) + (ticker == null ? 0 : ticker.hashCode) + diff --git a/app/packages/api_client/lib/src/model/event_out.g.dart b/app/packages/api_client/lib/src/model/event_out.g.dart index 2a7bb43..c06042f 100644 --- a/app/packages/api_client/lib/src/model/event_out.g.dart +++ b/app/packages/api_client/lib/src/model/event_out.g.dart @@ -35,6 +35,8 @@ abstract class _$EventOutCWProxy { EventOut quantity(String? quantity); + EventOut source_(String source_); + EventOut status(EventStatus status); EventOut tax(String? tax); @@ -66,6 +68,7 @@ abstract class _$EventOutCWProxy { String? price, String? priceCurrency, String? quantity, + String source_, EventStatus status, String? tax, String? ticker, @@ -124,6 +127,9 @@ class _$EventOutCWProxyImpl implements _$EventOutCWProxy { @override EventOut quantity(String? quantity) => this(quantity: quantity); + @override + EventOut source_(String source_) => this(source_: source_); + @override EventOut status(EventStatus status) => this(status: status); @@ -161,6 +167,7 @@ class _$EventOutCWProxyImpl implements _$EventOutCWProxy { Object? price = const $CopyWithPlaceholder(), Object? priceCurrency = const $CopyWithPlaceholder(), Object? quantity = const $CopyWithPlaceholder(), + Object? source_ = const $CopyWithPlaceholder(), Object? status = const $CopyWithPlaceholder(), Object? tax = const $CopyWithPlaceholder(), Object? ticker = const $CopyWithPlaceholder(), @@ -224,6 +231,10 @@ class _$EventOutCWProxyImpl implements _$EventOutCWProxy { ? _value.quantity // ignore: cast_nullable_to_non_nullable : quantity as String?, + source_: source_ == const $CopyWithPlaceholder() + ? _value.source_ + // ignore: cast_nullable_to_non_nullable + : source_ as String, status: status == const $CopyWithPlaceholder() ? _value.status // ignore: cast_nullable_to_non_nullable @@ -279,6 +290,7 @@ EventOut _$EventOutFromJson(Map json) => $checkedCreate( 'price', 'price_currency', 'quantity', + 'source', 'status', 'tax', 'ticker', @@ -311,6 +323,7 @@ EventOut _$EventOutFromJson(Map json) => $checkedCreate( price: $checkedConvert('price', (v) => v as String?), priceCurrency: $checkedConvert('price_currency', (v) => v as String?), quantity: $checkedConvert('quantity', (v) => v as String?), + source_: $checkedConvert('source', (v) => v as String), status: $checkedConvert( 'status', (v) => $enumDecode( @@ -336,6 +349,7 @@ EventOut _$EventOutFromJson(Map json) => $checkedCreate( 'externalFlow': 'external_flow', 'instrumentId': 'instrument_id', 'priceCurrency': 'price_currency', + 'source_': 'source', 'tradeDate': 'trade_date', }, ); @@ -355,6 +369,7 @@ Map _$EventOutToJson(EventOut instance) => { 'price': instance.price, 'price_currency': instance.priceCurrency, 'quantity': instance.quantity, + 'source': instance.source_, 'status': _$EventStatusEnumMap[instance.status]!, 'tax': instance.tax, 'ticker': instance.ticker, diff --git a/app/packages/api_client/lib/src/model/holding_out.dart b/app/packages/api_client/lib/src/model/holding_out.dart index 23a46d5..478eea2 100644 --- a/app/packages/api_client/lib/src/model/holding_out.dart +++ b/app/packages/api_client/lib/src/model/holding_out.dart @@ -44,6 +44,10 @@ class HoldingOut { required this.ldvEligibleQty, + this.logoColor, + + this.logoUrl, + required this.marketPrice, required this.name, @@ -222,6 +226,30 @@ class HoldingOut { + @JsonKey( + + name: r'logo_color', + required: false, + includeIfNull: false, + ) + + + final String? logoColor; + + + + @JsonKey( + + name: r'logo_url', + required: false, + includeIfNull: false, + ) + + + final String? logoUrl; + + + /// decimal as string @JsonKey( @@ -415,6 +443,8 @@ class HoldingOut { other.incomeRub == incomeRub && other.instrumentId == instrumentId && other.ldvEligibleQty == ldvEligibleQty && + other.logoColor == logoColor && + other.logoUrl == logoUrl && other.marketPrice == marketPrice && other.name == name && other.priceCurrency == priceCurrency && @@ -444,6 +474,8 @@ class HoldingOut { (incomeRub == null ? 0 : incomeRub.hashCode) + instrumentId.hashCode + ldvEligibleQty.hashCode + + (logoColor == null ? 0 : logoColor.hashCode) + + (logoUrl == null ? 0 : logoUrl.hashCode) + (marketPrice == null ? 0 : marketPrice.hashCode) + name.hashCode + (priceCurrency == null ? 0 : priceCurrency.hashCode) + diff --git a/app/packages/api_client/lib/src/model/holding_out.g.dart b/app/packages/api_client/lib/src/model/holding_out.g.dart index 9bde774..73b2c8b 100644 --- a/app/packages/api_client/lib/src/model/holding_out.g.dart +++ b/app/packages/api_client/lib/src/model/holding_out.g.dart @@ -31,6 +31,10 @@ abstract class _$HoldingOutCWProxy { HoldingOut ldvEligibleQty(String ldvEligibleQty); + HoldingOut logoColor(String? logoColor); + + HoldingOut logoUrl(String? logoUrl); + HoldingOut marketPrice(String? marketPrice); HoldingOut name(String name); @@ -78,6 +82,8 @@ abstract class _$HoldingOutCWProxy { String? incomeRub, int instrumentId, String ldvEligibleQty, + String? logoColor, + String? logoUrl, String? marketPrice, String name, String? priceCurrency, @@ -142,6 +148,12 @@ class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy { HoldingOut ldvEligibleQty(String ldvEligibleQty) => this(ldvEligibleQty: ldvEligibleQty); + @override + HoldingOut logoColor(String? logoColor) => this(logoColor: logoColor); + + @override + HoldingOut logoUrl(String? logoUrl) => this(logoUrl: logoUrl); + @override HoldingOut marketPrice(String? marketPrice) => this(marketPrice: marketPrice); @@ -208,6 +220,8 @@ class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy { Object? incomeRub = const $CopyWithPlaceholder(), Object? instrumentId = const $CopyWithPlaceholder(), Object? ldvEligibleQty = const $CopyWithPlaceholder(), + Object? logoColor = const $CopyWithPlaceholder(), + Object? logoUrl = const $CopyWithPlaceholder(), Object? marketPrice = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), Object? priceCurrency = const $CopyWithPlaceholder(), @@ -272,6 +286,14 @@ class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy { ? _value.ldvEligibleQty // ignore: cast_nullable_to_non_nullable : ldvEligibleQty as String, + logoColor: logoColor == const $CopyWithPlaceholder() + ? _value.logoColor + // ignore: cast_nullable_to_non_nullable + : logoColor as String?, + logoUrl: logoUrl == const $CopyWithPlaceholder() + ? _value.logoUrl + // ignore: cast_nullable_to_non_nullable + : logoUrl as String?, marketPrice: marketPrice == const $CopyWithPlaceholder() ? _value.marketPrice // ignore: cast_nullable_to_non_nullable @@ -396,6 +418,8 @@ HoldingOut _$HoldingOutFromJson(Map json) => $checkedCreate( incomeRub: $checkedConvert('income_rub', (v) => v as String?), instrumentId: $checkedConvert('instrument_id', (v) => (v as num).toInt()), ldvEligibleQty: $checkedConvert('ldv_eligible_qty', (v) => v as String), + logoColor: $checkedConvert('logo_color', (v) => v as String?), + logoUrl: $checkedConvert('logo_url', (v) => v as String?), marketPrice: $checkedConvert('market_price', (v) => v as String?), name: $checkedConvert('name', (v) => v as String), priceCurrency: $checkedConvert('price_currency', (v) => v as String?), @@ -433,6 +457,8 @@ HoldingOut _$HoldingOutFromJson(Map json) => $checkedCreate( 'incomeRub': 'income_rub', 'instrumentId': 'instrument_id', 'ldvEligibleQty': 'ldv_eligible_qty', + 'logoColor': 'logo_color', + 'logoUrl': 'logo_url', 'marketPrice': 'market_price', 'priceCurrency': 'price_currency', 'priceDate': 'price_date', @@ -459,6 +485,8 @@ Map _$HoldingOutToJson(HoldingOut instance) => 'income_rub': instance.incomeRub, 'instrument_id': instance.instrumentId, 'ldv_eligible_qty': instance.ldvEligibleQty, + 'logo_color': ?instance.logoColor, + 'logo_url': ?instance.logoUrl, 'market_price': instance.marketPrice, 'name': instance.name, 'price_currency': instance.priceCurrency, diff --git a/app/packages/api_client/lib/src/model/instrument_out.dart b/app/packages/api_client/lib/src/model/instrument_out.dart index 8bc5b72..3f5d7b4 100644 --- a/app/packages/api_client/lib/src/model/instrument_out.dart +++ b/app/packages/api_client/lib/src/model/instrument_out.dart @@ -40,6 +40,10 @@ class InstrumentOut { required this.issuer, + this.logoColor, + + this.logoUrl, + required this.lot, required this.maturityDate, @@ -175,6 +179,30 @@ class InstrumentOut { + @JsonKey( + + name: r'logo_color', + required: false, + includeIfNull: false, + ) + + + final String? logoColor; + + + + @JsonKey( + + name: r'logo_url', + required: false, + includeIfNull: false, + ) + + + final String? logoUrl; + + + @JsonKey( name: r'lot', @@ -274,6 +302,8 @@ class InstrumentOut { other.isActive == isActive && other.isin == isin && other.issuer == issuer && + other.logoColor == logoColor && + other.logoUrl == logoUrl && other.lot == lot && other.maturityDate == maturityDate && other.name == name && @@ -294,6 +324,8 @@ class InstrumentOut { isActive.hashCode + (isin == null ? 0 : isin.hashCode) + (issuer == null ? 0 : issuer.hashCode) + + (logoColor == null ? 0 : logoColor.hashCode) + + (logoUrl == null ? 0 : logoUrl.hashCode) + lot.hashCode + (maturityDate == null ? 0 : maturityDate.hashCode) + name.hashCode + diff --git a/app/packages/api_client/lib/src/model/instrument_out.g.dart b/app/packages/api_client/lib/src/model/instrument_out.g.dart index c2bd59b..9923981 100644 --- a/app/packages/api_client/lib/src/model/instrument_out.g.dart +++ b/app/packages/api_client/lib/src/model/instrument_out.g.dart @@ -27,6 +27,10 @@ abstract class _$InstrumentOutCWProxy { InstrumentOut issuer(String? issuer); + InstrumentOut logoColor(String? logoColor); + + InstrumentOut logoUrl(String? logoUrl); + InstrumentOut lot(int lot); InstrumentOut maturityDate(DateTime? maturityDate); @@ -58,6 +62,8 @@ abstract class _$InstrumentOutCWProxy { bool isActive, String? isin, String? issuer, + String? logoColor, + String? logoUrl, int lot, DateTime? maturityDate, String name, @@ -104,6 +110,12 @@ class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy { @override InstrumentOut issuer(String? issuer) => this(issuer: issuer); + @override + InstrumentOut logoColor(String? logoColor) => this(logoColor: logoColor); + + @override + InstrumentOut logoUrl(String? logoUrl) => this(logoUrl: logoUrl); + @override InstrumentOut lot(int lot) => this(lot: lot); @@ -145,6 +157,8 @@ class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy { Object? isActive = const $CopyWithPlaceholder(), Object? isin = const $CopyWithPlaceholder(), Object? issuer = const $CopyWithPlaceholder(), + Object? logoColor = const $CopyWithPlaceholder(), + Object? logoUrl = const $CopyWithPlaceholder(), Object? lot = const $CopyWithPlaceholder(), Object? maturityDate = const $CopyWithPlaceholder(), Object? name = const $CopyWithPlaceholder(), @@ -194,6 +208,14 @@ class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy { ? _value.issuer // ignore: cast_nullable_to_non_nullable : issuer as String?, + logoColor: logoColor == const $CopyWithPlaceholder() + ? _value.logoColor + // ignore: cast_nullable_to_non_nullable + : logoColor as String?, + logoUrl: logoUrl == const $CopyWithPlaceholder() + ? _value.logoUrl + // ignore: cast_nullable_to_non_nullable + : logoUrl as String?, lot: lot == const $CopyWithPlaceholder() ? _value.lot // ignore: cast_nullable_to_non_nullable @@ -274,6 +296,8 @@ InstrumentOut _$InstrumentOutFromJson(Map json) => isActive: $checkedConvert('is_active', (v) => v as bool), isin: $checkedConvert('isin', (v) => v as String?), issuer: $checkedConvert('issuer', (v) => v as String?), + logoColor: $checkedConvert('logo_color', (v) => v as String?), + logoUrl: $checkedConvert('logo_url', (v) => v as String?), lot: $checkedConvert('lot', (v) => (v as num).toInt()), maturityDate: $checkedConvert( 'maturity_date', @@ -293,6 +317,8 @@ InstrumentOut _$InstrumentOutFromJson(Map json) => fieldKeyMap: const { 'assetClass': 'asset_class', 'isActive': 'is_active', + 'logoColor': 'logo_color', + 'logoUrl': 'logo_url', 'maturityDate': 'maturity_date', 'nominalCurrency': 'nominal_currency', }, @@ -310,6 +336,8 @@ Map _$InstrumentOutToJson(InstrumentOut instance) => 'is_active': instance.isActive, 'isin': instance.isin, 'issuer': instance.issuer, + 'logo_color': ?instance.logoColor, + 'logo_url': ?instance.logoUrl, 'lot': instance.lot, 'maturity_date': instance.maturityDate?.toIso8601String(), 'name': instance.name, diff --git a/app/packages/api_client/lib/src/model/instrument_patch.dart b/app/packages/api_client/lib/src/model/instrument_patch.dart new file mode 100644 index 0000000..b45d69b --- /dev/null +++ b/app/packages/api_client/lib/src/model/instrument_patch.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'instrument_patch.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class InstrumentPatch { + /// Returns a new [InstrumentPatch] instance. + InstrumentPatch({ + + this.assetClass, + + this.board, + + this.lot, + + this.name, + + this.sector, + }); + + @JsonKey( + + name: r'asset_class', + required: false, + includeIfNull: false, + ) + + + final String? assetClass; + + + + @JsonKey( + + name: r'board', + required: false, + includeIfNull: false, + ) + + + final String? board; + + + + // minimum: 1 + @JsonKey( + + name: r'lot', + required: false, + includeIfNull: false, + ) + + + final int? lot; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false, + ) + + + final String? name; + + + + @JsonKey( + + name: r'sector', + required: false, + includeIfNull: false, + ) + + + final String? sector; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is InstrumentPatch && + other.assetClass == assetClass && + other.board == board && + other.lot == lot && + other.name == name && + other.sector == sector; + + @override + int get hashCode => + (assetClass == null ? 0 : assetClass.hashCode) + + (board == null ? 0 : board.hashCode) + + (lot == null ? 0 : lot.hashCode) + + (name == null ? 0 : name.hashCode) + + (sector == null ? 0 : sector.hashCode); + + factory InstrumentPatch.fromJson(Map json) => _$InstrumentPatchFromJson(json); + + Map toJson() => _$InstrumentPatchToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/instrument_patch.g.dart b/app/packages/api_client/lib/src/model/instrument_patch.g.dart new file mode 100644 index 0000000..624aff4 --- /dev/null +++ b/app/packages/api_client/lib/src/model/instrument_patch.g.dart @@ -0,0 +1,125 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'instrument_patch.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$InstrumentPatchCWProxy { + InstrumentPatch assetClass(String? assetClass); + + InstrumentPatch board(String? board); + + InstrumentPatch lot(int? lot); + + InstrumentPatch name(String? name); + + InstrumentPatch sector(String? sector); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// InstrumentPatch(...).copyWith(id: 12, name: "My name") + /// ```` + InstrumentPatch call({ + String? assetClass, + String? board, + int? lot, + String? name, + String? sector, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfInstrumentPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfInstrumentPatch.copyWith.fieldName(...)` +class _$InstrumentPatchCWProxyImpl implements _$InstrumentPatchCWProxy { + const _$InstrumentPatchCWProxyImpl(this._value); + + final InstrumentPatch _value; + + @override + InstrumentPatch assetClass(String? assetClass) => + this(assetClass: assetClass); + + @override + InstrumentPatch board(String? board) => this(board: board); + + @override + InstrumentPatch lot(int? lot) => this(lot: lot); + + @override + InstrumentPatch name(String? name) => this(name: name); + + @override + InstrumentPatch sector(String? sector) => this(sector: sector); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// InstrumentPatch(...).copyWith(id: 12, name: "My name") + /// ```` + InstrumentPatch call({ + Object? assetClass = const $CopyWithPlaceholder(), + Object? board = const $CopyWithPlaceholder(), + Object? lot = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? sector = const $CopyWithPlaceholder(), + }) { + return InstrumentPatch( + assetClass: assetClass == const $CopyWithPlaceholder() + ? _value.assetClass + // ignore: cast_nullable_to_non_nullable + : assetClass as String?, + board: board == const $CopyWithPlaceholder() + ? _value.board + // ignore: cast_nullable_to_non_nullable + : board as String?, + lot: lot == const $CopyWithPlaceholder() + ? _value.lot + // ignore: cast_nullable_to_non_nullable + : lot as int?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String?, + sector: sector == const $CopyWithPlaceholder() + ? _value.sector + // ignore: cast_nullable_to_non_nullable + : sector as String?, + ); + } +} + +extension $InstrumentPatchCopyWith on InstrumentPatch { + /// Returns a callable class that can be used as follows: `instanceOfInstrumentPatch.copyWith(...)` or like so:`instanceOfInstrumentPatch.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$InstrumentPatchCWProxy get copyWith => _$InstrumentPatchCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +InstrumentPatch _$InstrumentPatchFromJson(Map json) => + $checkedCreate('InstrumentPatch', json, ($checkedConvert) { + final val = InstrumentPatch( + assetClass: $checkedConvert('asset_class', (v) => v as String?), + board: $checkedConvert('board', (v) => v as String?), + lot: $checkedConvert('lot', (v) => (v as num?)?.toInt()), + name: $checkedConvert('name', (v) => v as String?), + sector: $checkedConvert('sector', (v) => v as String?), + ); + return val; + }, fieldKeyMap: const {'assetClass': 'asset_class'}); + +Map _$InstrumentPatchToJson(InstrumentPatch instance) => + { + 'asset_class': ?instance.assetClass, + 'board': ?instance.board, + 'lot': ?instance.lot, + 'name': ?instance.name, + 'sector': ?instance.sector, + }; diff --git a/app/packages/api_client/lib/src/model/manual_event_create.dart b/app/packages/api_client/lib/src/model/manual_event_create.dart new file mode 100644 index 0000000..3dda059 --- /dev/null +++ b/app/packages/api_client/lib/src/model/manual_event_create.dart @@ -0,0 +1,225 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/event_kind.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'manual_event_create.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ManualEventCreate { + /// Returns a new [ManualEventCreate] instance. + ManualEventCreate({ + + required this.accountId, + + this.accruedInterest, + + this.amount, + + this.currency, + + this.description, + + this.fee, + + this.instrumentId, + + required this.kind, + + this.price, + + this.quantity, + + required this.tradeDate, + }); + + @JsonKey( + + name: r'account_id', + required: true, + includeIfNull: false, + ) + + + final int accountId; + + + + /// decimal as string + @JsonKey( + + name: r'accrued_interest', + required: false, + includeIfNull: false, + ) + + + final String? accruedInterest; + + + + /// decimal as string + @JsonKey( + + name: r'amount', + required: false, + includeIfNull: false, + ) + + + final String? amount; + + + + @JsonKey( + + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + @JsonKey( + + name: r'description', + required: false, + includeIfNull: false, + ) + + + final String? description; + + + + /// decimal as string + @JsonKey( + + name: r'fee', + required: false, + includeIfNull: false, + ) + + + final String? fee; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + unknownEnumValue: EventKind.unknownDefaultOpenApi, + ) + + + final EventKind kind; + + + + /// decimal as string + @JsonKey( + + name: r'price', + required: false, + includeIfNull: false, + ) + + + final String? price; + + + + /// decimal as string + @JsonKey( + + name: r'quantity', + required: false, + includeIfNull: false, + ) + + + final String? quantity; + + + + @JsonKey( + + name: r'trade_date', + required: true, + includeIfNull: false, + ) + + + final DateTime tradeDate; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ManualEventCreate && + other.accountId == accountId && + other.accruedInterest == accruedInterest && + other.amount == amount && + other.currency == currency && + other.description == description && + other.fee == fee && + other.instrumentId == instrumentId && + other.kind == kind && + other.price == price && + other.quantity == quantity && + other.tradeDate == tradeDate; + + @override + int get hashCode => + accountId.hashCode + + (accruedInterest == null ? 0 : accruedInterest.hashCode) + + (amount == null ? 0 : amount.hashCode) + + (currency == null ? 0 : currency.hashCode) + + (description == null ? 0 : description.hashCode) + + (fee == null ? 0 : fee.hashCode) + + (instrumentId == null ? 0 : instrumentId.hashCode) + + kind.hashCode + + (price == null ? 0 : price.hashCode) + + (quantity == null ? 0 : quantity.hashCode) + + tradeDate.hashCode; + + factory ManualEventCreate.fromJson(Map json) => _$ManualEventCreateFromJson(json); + + Map toJson() => _$ManualEventCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/manual_event_create.g.dart b/app/packages/api_client/lib/src/model/manual_event_create.g.dart new file mode 100644 index 0000000..c042030 --- /dev/null +++ b/app/packages/api_client/lib/src/model/manual_event_create.g.dart @@ -0,0 +1,252 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'manual_event_create.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ManualEventCreateCWProxy { + ManualEventCreate accountId(int accountId); + + ManualEventCreate accruedInterest(String? accruedInterest); + + ManualEventCreate amount(String? amount); + + ManualEventCreate currency(String? currency); + + ManualEventCreate description(String? description); + + ManualEventCreate fee(String? fee); + + ManualEventCreate instrumentId(int? instrumentId); + + ManualEventCreate kind(EventKind kind); + + ManualEventCreate price(String? price); + + ManualEventCreate quantity(String? quantity); + + ManualEventCreate tradeDate(DateTime tradeDate); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ManualEventCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ManualEventCreate(...).copyWith(id: 12, name: "My name") + /// ```` + ManualEventCreate call({ + int accountId, + String? accruedInterest, + String? amount, + String? currency, + String? description, + String? fee, + int? instrumentId, + EventKind kind, + String? price, + String? quantity, + DateTime tradeDate, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfManualEventCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfManualEventCreate.copyWith.fieldName(...)` +class _$ManualEventCreateCWProxyImpl implements _$ManualEventCreateCWProxy { + const _$ManualEventCreateCWProxyImpl(this._value); + + final ManualEventCreate _value; + + @override + ManualEventCreate accountId(int accountId) => this(accountId: accountId); + + @override + ManualEventCreate accruedInterest(String? accruedInterest) => + this(accruedInterest: accruedInterest); + + @override + ManualEventCreate amount(String? amount) => this(amount: amount); + + @override + ManualEventCreate currency(String? currency) => this(currency: currency); + + @override + ManualEventCreate description(String? description) => + this(description: description); + + @override + ManualEventCreate fee(String? fee) => this(fee: fee); + + @override + ManualEventCreate instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + ManualEventCreate kind(EventKind kind) => this(kind: kind); + + @override + ManualEventCreate price(String? price) => this(price: price); + + @override + ManualEventCreate quantity(String? quantity) => this(quantity: quantity); + + @override + ManualEventCreate tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ManualEventCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ManualEventCreate(...).copyWith(id: 12, name: "My name") + /// ```` + ManualEventCreate call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? accruedInterest = const $CopyWithPlaceholder(), + Object? amount = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? description = const $CopyWithPlaceholder(), + Object? fee = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? price = const $CopyWithPlaceholder(), + Object? quantity = const $CopyWithPlaceholder(), + Object? tradeDate = const $CopyWithPlaceholder(), + }) { + return ManualEventCreate( + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int, + accruedInterest: accruedInterest == const $CopyWithPlaceholder() + ? _value.accruedInterest + // ignore: cast_nullable_to_non_nullable + : accruedInterest as String?, + amount: amount == const $CopyWithPlaceholder() + ? _value.amount + // ignore: cast_nullable_to_non_nullable + : amount as String?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + description: description == const $CopyWithPlaceholder() + ? _value.description + // ignore: cast_nullable_to_non_nullable + : description as String?, + fee: fee == const $CopyWithPlaceholder() + ? _value.fee + // ignore: cast_nullable_to_non_nullable + : fee as String?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int?, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as EventKind, + price: price == const $CopyWithPlaceholder() + ? _value.price + // ignore: cast_nullable_to_non_nullable + : price as String?, + quantity: quantity == const $CopyWithPlaceholder() + ? _value.quantity + // ignore: cast_nullable_to_non_nullable + : quantity as String?, + tradeDate: tradeDate == const $CopyWithPlaceholder() + ? _value.tradeDate + // ignore: cast_nullable_to_non_nullable + : tradeDate as DateTime, + ); + } +} + +extension $ManualEventCreateCopyWith on ManualEventCreate { + /// Returns a callable class that can be used as follows: `instanceOfManualEventCreate.copyWith(...)` or like so:`instanceOfManualEventCreate.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ManualEventCreateCWProxy get copyWith => + _$ManualEventCreateCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ManualEventCreate _$ManualEventCreateFromJson( + Map json, +) => $checkedCreate( + 'ManualEventCreate', + json, + ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['account_id', 'kind', 'trade_date']); + final val = ManualEventCreate( + accountId: $checkedConvert('account_id', (v) => (v as num).toInt()), + accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?), + amount: $checkedConvert('amount', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String?), + description: $checkedConvert('description', (v) => v as String?), + fee: $checkedConvert('fee', (v) => v as String?), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + kind: $checkedConvert( + 'kind', + (v) => $enumDecode( + _$EventKindEnumMap, + v, + unknownValue: EventKind.unknownDefaultOpenApi, + ), + ), + price: $checkedConvert('price', (v) => v as String?), + quantity: $checkedConvert('quantity', (v) => v as String?), + tradeDate: $checkedConvert( + 'trade_date', + (v) => DateTime.parse(v as String), + ), + ); + return val; + }, + fieldKeyMap: const { + 'accountId': 'account_id', + 'accruedInterest': 'accrued_interest', + 'instrumentId': 'instrument_id', + 'tradeDate': 'trade_date', + }, +); + +Map _$ManualEventCreateToJson(ManualEventCreate instance) => + { + 'account_id': instance.accountId, + 'accrued_interest': ?instance.accruedInterest, + 'amount': ?instance.amount, + 'currency': ?instance.currency, + 'description': ?instance.description, + 'fee': ?instance.fee, + 'instrument_id': ?instance.instrumentId, + 'kind': _$EventKindEnumMap[instance.kind]!, + 'price': ?instance.price, + 'quantity': ?instance.quantity, + 'trade_date': instance.tradeDate.toIso8601String(), + }; + +const _$EventKindEnumMap = { + EventKind.buy: 'buy', + EventKind.sell: 'sell', + EventKind.dividend: 'dividend', + EventKind.coupon: 'coupon', + EventKind.interest: 'interest', + EventKind.tax: 'tax', + EventKind.taxRefund: 'tax_refund', + EventKind.commission: 'commission', + EventKind.deposit: 'deposit', + EventKind.withdrawal: 'withdrawal', + EventKind.transferIn: 'transfer_in', + EventKind.transferOut: 'transfer_out', + EventKind.split: 'split', + EventKind.amortization: 'amortization', + EventKind.repayment: 'repayment', + EventKind.fxExchange: 'fx_exchange', + EventKind.other: 'other', + EventKind.unknownDefaultOpenApi: 'unknown_default_open_api', +}; diff --git a/app/packages/api_client/lib/src/model/metrics_status_out.dart b/app/packages/api_client/lib/src/model/metrics_status_out.dart new file mode 100644 index 0000000..186ee50 --- /dev/null +++ b/app/packages/api_client/lib/src/model/metrics_status_out.dart @@ -0,0 +1,91 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/refresh_log_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'metrics_status_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class MetricsStatusOut { + /// Returns a new [MetricsStatusOut] instance. + MetricsStatusOut({ + + required this.consistent, + + required this.lastRefresh, + + required this.refreshing, + }); + + @JsonKey( + + name: r'consistent', + required: true, + includeIfNull: false, + ) + + + final bool consistent; + + + + @JsonKey( + + name: r'last_refresh', + required: true, + includeIfNull: true, + ) + + + final RefreshLogOut? lastRefresh; + + + + @JsonKey( + + name: r'refreshing', + required: true, + includeIfNull: false, + ) + + + final bool refreshing; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is MetricsStatusOut && + other.consistent == consistent && + other.lastRefresh == lastRefresh && + other.refreshing == refreshing; + + @override + int get hashCode => + consistent.hashCode + + (lastRefresh == null ? 0 : lastRefresh.hashCode) + + refreshing.hashCode; + + factory MetricsStatusOut.fromJson(Map json) => _$MetricsStatusOutFromJson(json); + + Map toJson() => _$MetricsStatusOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/metrics_status_out.g.dart b/app/packages/api_client/lib/src/model/metrics_status_out.g.dart new file mode 100644 index 0000000..334c875 --- /dev/null +++ b/app/packages/api_client/lib/src/model/metrics_status_out.g.dart @@ -0,0 +1,108 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'metrics_status_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$MetricsStatusOutCWProxy { + MetricsStatusOut consistent(bool consistent); + + MetricsStatusOut lastRefresh(RefreshLogOut? lastRefresh); + + MetricsStatusOut refreshing(bool refreshing); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `MetricsStatusOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// MetricsStatusOut(...).copyWith(id: 12, name: "My name") + /// ```` + MetricsStatusOut call({ + bool consistent, + RefreshLogOut? lastRefresh, + bool refreshing, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfMetricsStatusOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfMetricsStatusOut.copyWith.fieldName(...)` +class _$MetricsStatusOutCWProxyImpl implements _$MetricsStatusOutCWProxy { + const _$MetricsStatusOutCWProxyImpl(this._value); + + final MetricsStatusOut _value; + + @override + MetricsStatusOut consistent(bool consistent) => this(consistent: consistent); + + @override + MetricsStatusOut lastRefresh(RefreshLogOut? lastRefresh) => + this(lastRefresh: lastRefresh); + + @override + MetricsStatusOut refreshing(bool refreshing) => this(refreshing: refreshing); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `MetricsStatusOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// MetricsStatusOut(...).copyWith(id: 12, name: "My name") + /// ```` + MetricsStatusOut call({ + Object? consistent = const $CopyWithPlaceholder(), + Object? lastRefresh = const $CopyWithPlaceholder(), + Object? refreshing = const $CopyWithPlaceholder(), + }) { + return MetricsStatusOut( + consistent: consistent == const $CopyWithPlaceholder() + ? _value.consistent + // ignore: cast_nullable_to_non_nullable + : consistent as bool, + lastRefresh: lastRefresh == const $CopyWithPlaceholder() + ? _value.lastRefresh + // ignore: cast_nullable_to_non_nullable + : lastRefresh as RefreshLogOut?, + refreshing: refreshing == const $CopyWithPlaceholder() + ? _value.refreshing + // ignore: cast_nullable_to_non_nullable + : refreshing as bool, + ); + } +} + +extension $MetricsStatusOutCopyWith on MetricsStatusOut { + /// Returns a callable class that can be used as follows: `instanceOfMetricsStatusOut.copyWith(...)` or like so:`instanceOfMetricsStatusOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$MetricsStatusOutCWProxy get copyWith => _$MetricsStatusOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +MetricsStatusOut _$MetricsStatusOutFromJson(Map json) => + $checkedCreate('MetricsStatusOut', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['consistent', 'last_refresh', 'refreshing'], + ); + final val = MetricsStatusOut( + consistent: $checkedConvert('consistent', (v) => v as bool), + lastRefresh: $checkedConvert( + 'last_refresh', + (v) => v == null + ? null + : RefreshLogOut.fromJson(v as Map), + ), + refreshing: $checkedConvert('refreshing', (v) => v as bool), + ); + return val; + }, fieldKeyMap: const {'lastRefresh': 'last_refresh'}); + +Map _$MetricsStatusOutToJson(MetricsStatusOut instance) => + { + 'consistent': instance.consistent, + 'last_refresh': instance.lastRefresh?.toJson(), + 'refreshing': instance.refreshing, + }; diff --git a/app/packages/api_client/lib/src/model/portfolio_accounts_in.dart b/app/packages/api_client/lib/src/model/portfolio_accounts_in.dart new file mode 100644 index 0000000..7c2c7c8 --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_accounts_in.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'portfolio_accounts_in.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PortfolioAccountsIn { + /// Returns a new [PortfolioAccountsIn] instance. + PortfolioAccountsIn({ + + required this.accountIds, + }); + + @JsonKey( + + name: r'account_ids', + required: true, + includeIfNull: false, + ) + + + final List accountIds; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PortfolioAccountsIn && + other.accountIds == accountIds; + + @override + int get hashCode => + accountIds.hashCode; + + factory PortfolioAccountsIn.fromJson(Map json) => _$PortfolioAccountsInFromJson(json); + + Map toJson() => _$PortfolioAccountsInToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/portfolio_accounts_in.g.dart b/app/packages/api_client/lib/src/model/portfolio_accounts_in.g.dart new file mode 100644 index 0000000..1c974d4 --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_accounts_in.g.dart @@ -0,0 +1,75 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'portfolio_accounts_in.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PortfolioAccountsInCWProxy { + PortfolioAccountsIn accountIds(List accountIds); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioAccountsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioAccountsIn(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioAccountsIn call({List accountIds}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioAccountsIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioAccountsIn.copyWith.fieldName(...)` +class _$PortfolioAccountsInCWProxyImpl implements _$PortfolioAccountsInCWProxy { + const _$PortfolioAccountsInCWProxyImpl(this._value); + + final PortfolioAccountsIn _value; + + @override + PortfolioAccountsIn accountIds(List accountIds) => + this(accountIds: accountIds); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioAccountsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioAccountsIn(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioAccountsIn call({ + Object? accountIds = const $CopyWithPlaceholder(), + }) { + return PortfolioAccountsIn( + accountIds: accountIds == const $CopyWithPlaceholder() + ? _value.accountIds + // ignore: cast_nullable_to_non_nullable + : accountIds as List, + ); + } +} + +extension $PortfolioAccountsInCopyWith on PortfolioAccountsIn { + /// Returns a callable class that can be used as follows: `instanceOfPortfolioAccountsIn.copyWith(...)` or like so:`instanceOfPortfolioAccountsIn.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PortfolioAccountsInCWProxy get copyWith => + _$PortfolioAccountsInCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PortfolioAccountsIn _$PortfolioAccountsInFromJson(Map json) => + $checkedCreate('PortfolioAccountsIn', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['account_ids']); + final val = PortfolioAccountsIn( + accountIds: $checkedConvert( + 'account_ids', + (v) => (v as List).map((e) => (e as num).toInt()).toList(), + ), + ); + return val; + }, fieldKeyMap: const {'accountIds': 'account_ids'}); + +Map _$PortfolioAccountsInToJson( + PortfolioAccountsIn instance, +) => {'account_ids': instance.accountIds}; diff --git a/app/packages/api_client/lib/src/model/portfolio_create.dart b/app/packages/api_client/lib/src/model/portfolio_create.dart new file mode 100644 index 0000000..f542b6f --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_create.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'portfolio_create.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PortfolioCreate { + /// Returns a new [PortfolioCreate] instance. + PortfolioCreate({ + + this.accountIds, + + required this.name, + }); + + @JsonKey( + + name: r'account_ids', + required: false, + includeIfNull: false, + ) + + + final List? accountIds; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PortfolioCreate && + other.accountIds == accountIds && + other.name == name; + + @override + int get hashCode => + accountIds.hashCode + + name.hashCode; + + factory PortfolioCreate.fromJson(Map json) => _$PortfolioCreateFromJson(json); + + Map toJson() => _$PortfolioCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/portfolio_create.g.dart b/app/packages/api_client/lib/src/model/portfolio_create.g.dart new file mode 100644 index 0000000..6d1b9c1 --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_create.g.dart @@ -0,0 +1,87 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'portfolio_create.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PortfolioCreateCWProxy { + PortfolioCreate accountIds(List? accountIds); + + PortfolioCreate name(String name); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioCreate(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioCreate call({List? accountIds, String name}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioCreate.copyWith.fieldName(...)` +class _$PortfolioCreateCWProxyImpl implements _$PortfolioCreateCWProxy { + const _$PortfolioCreateCWProxyImpl(this._value); + + final PortfolioCreate _value; + + @override + PortfolioCreate accountIds(List? accountIds) => + this(accountIds: accountIds); + + @override + PortfolioCreate name(String name) => this(name: name); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioCreate(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioCreate call({ + Object? accountIds = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + }) { + return PortfolioCreate( + accountIds: accountIds == const $CopyWithPlaceholder() + ? _value.accountIds + // ignore: cast_nullable_to_non_nullable + : accountIds as List?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + ); + } +} + +extension $PortfolioCreateCopyWith on PortfolioCreate { + /// Returns a callable class that can be used as follows: `instanceOfPortfolioCreate.copyWith(...)` or like so:`instanceOfPortfolioCreate.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PortfolioCreateCWProxy get copyWith => _$PortfolioCreateCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PortfolioCreate _$PortfolioCreateFromJson(Map json) => + $checkedCreate('PortfolioCreate', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['name']); + final val = PortfolioCreate( + accountIds: $checkedConvert( + 'account_ids', + (v) => (v as List?)?.map((e) => (e as num).toInt()).toList(), + ), + name: $checkedConvert('name', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'accountIds': 'account_ids'}); + +Map _$PortfolioCreateToJson(PortfolioCreate instance) => + { + 'account_ids': ?instance.accountIds, + 'name': instance.name, + }; diff --git a/app/packages/api_client/lib/src/model/portfolio_out.dart b/app/packages/api_client/lib/src/model/portfolio_out.dart new file mode 100644 index 0000000..b324eab --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_out.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'portfolio_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PortfolioOut { + /// Returns a new [PortfolioOut] instance. + PortfolioOut({ + + required this.accountIds, + + required this.baseCurrency, + + required this.id, + + required this.name, + }); + + @JsonKey( + + name: r'account_ids', + required: true, + includeIfNull: false, + ) + + + final List accountIds; + + + + @JsonKey( + + name: r'base_currency', + required: true, + includeIfNull: false, + ) + + + final String baseCurrency; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PortfolioOut && + other.accountIds == accountIds && + other.baseCurrency == baseCurrency && + other.id == id && + other.name == name; + + @override + int get hashCode => + accountIds.hashCode + + baseCurrency.hashCode + + id.hashCode + + name.hashCode; + + factory PortfolioOut.fromJson(Map json) => _$PortfolioOutFromJson(json); + + Map toJson() => _$PortfolioOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/portfolio_out.g.dart b/app/packages/api_client/lib/src/model/portfolio_out.g.dart new file mode 100644 index 0000000..03fbad3 --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_out.g.dart @@ -0,0 +1,127 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'portfolio_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PortfolioOutCWProxy { + PortfolioOut accountIds(List accountIds); + + PortfolioOut baseCurrency(String baseCurrency); + + PortfolioOut id(int id); + + PortfolioOut name(String name); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioOut(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioOut call({ + List accountIds, + String baseCurrency, + int id, + String name, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioOut.copyWith.fieldName(...)` +class _$PortfolioOutCWProxyImpl implements _$PortfolioOutCWProxy { + const _$PortfolioOutCWProxyImpl(this._value); + + final PortfolioOut _value; + + @override + PortfolioOut accountIds(List accountIds) => this(accountIds: accountIds); + + @override + PortfolioOut baseCurrency(String baseCurrency) => + this(baseCurrency: baseCurrency); + + @override + PortfolioOut id(int id) => this(id: id); + + @override + PortfolioOut name(String name) => this(name: name); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioOut(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioOut call({ + Object? accountIds = const $CopyWithPlaceholder(), + Object? baseCurrency = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + }) { + return PortfolioOut( + accountIds: accountIds == const $CopyWithPlaceholder() + ? _value.accountIds + // ignore: cast_nullable_to_non_nullable + : accountIds as List, + baseCurrency: baseCurrency == const $CopyWithPlaceholder() + ? _value.baseCurrency + // ignore: cast_nullable_to_non_nullable + : baseCurrency as String, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + ); + } +} + +extension $PortfolioOutCopyWith on PortfolioOut { + /// Returns a callable class that can be used as follows: `instanceOfPortfolioOut.copyWith(...)` or like so:`instanceOfPortfolioOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PortfolioOutCWProxy get copyWith => _$PortfolioOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PortfolioOut _$PortfolioOutFromJson(Map json) => + $checkedCreate( + 'PortfolioOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['account_ids', 'base_currency', 'id', 'name'], + ); + final val = PortfolioOut( + accountIds: $checkedConvert( + 'account_ids', + (v) => (v as List).map((e) => (e as num).toInt()).toList(), + ), + baseCurrency: $checkedConvert('base_currency', (v) => v as String), + id: $checkedConvert('id', (v) => (v as num).toInt()), + name: $checkedConvert('name', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'accountIds': 'account_ids', + 'baseCurrency': 'base_currency', + }, + ); + +Map _$PortfolioOutToJson(PortfolioOut instance) => + { + 'account_ids': instance.accountIds, + 'base_currency': instance.baseCurrency, + 'id': instance.id, + 'name': instance.name, + }; diff --git a/app/packages/api_client/lib/src/model/portfolio_patch.dart b/app/packages/api_client/lib/src/model/portfolio_patch.dart new file mode 100644 index 0000000..2a45adb --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_patch.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'portfolio_patch.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PortfolioPatch { + /// Returns a new [PortfolioPatch] instance. + PortfolioPatch({ + + required this.name, + }); + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PortfolioPatch && + other.name == name; + + @override + int get hashCode => + name.hashCode; + + factory PortfolioPatch.fromJson(Map json) => _$PortfolioPatchFromJson(json); + + Map toJson() => _$PortfolioPatchToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/portfolio_patch.g.dart b/app/packages/api_client/lib/src/model/portfolio_patch.g.dart new file mode 100644 index 0000000..cc1579d --- /dev/null +++ b/app/packages/api_client/lib/src/model/portfolio_patch.g.dart @@ -0,0 +1,67 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'portfolio_patch.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PortfolioPatchCWProxy { + PortfolioPatch name(String name); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioPatch(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioPatch call({String name}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioPatch.copyWith.fieldName(...)` +class _$PortfolioPatchCWProxyImpl implements _$PortfolioPatchCWProxy { + const _$PortfolioPatchCWProxyImpl(this._value); + + final PortfolioPatch _value; + + @override + PortfolioPatch name(String name) => this(name: name); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PortfolioPatch(...).copyWith(id: 12, name: "My name") + /// ```` + PortfolioPatch call({Object? name = const $CopyWithPlaceholder()}) { + return PortfolioPatch( + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + ); + } +} + +extension $PortfolioPatchCopyWith on PortfolioPatch { + /// Returns a callable class that can be used as follows: `instanceOfPortfolioPatch.copyWith(...)` or like so:`instanceOfPortfolioPatch.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PortfolioPatchCWProxy get copyWith => _$PortfolioPatchCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PortfolioPatch _$PortfolioPatchFromJson(Map json) => + $checkedCreate('PortfolioPatch', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['name']); + final val = PortfolioPatch( + name: $checkedConvert('name', (v) => v as String), + ); + return val; + }); + +Map _$PortfolioPatchToJson(PortfolioPatch instance) => + {'name': instance.name}; diff --git a/app/packages/api_client/lib/src/model/refresh_log_out.dart b/app/packages/api_client/lib/src/model/refresh_log_out.dart index b03bbb3..4efac38 100644 --- a/app/packages/api_client/lib/src/model/refresh_log_out.dart +++ b/app/packages/api_client/lib/src/model/refresh_log_out.dart @@ -22,12 +22,16 @@ class RefreshLogOut { required this.error, + required this.failedStep, + required this.finishedAt, required this.id, required this.startedAt, + required this.stepTimings, + required this.trigger, }); @@ -43,6 +47,18 @@ class RefreshLogOut { + @JsonKey( + + name: r'failed_step', + required: true, + includeIfNull: true, + ) + + + final String? failedStep; + + + @JsonKey( name: r'finished_at', @@ -79,6 +95,18 @@ class RefreshLogOut { + @JsonKey( + + name: r'step_timings', + required: true, + includeIfNull: true, + ) + + + final Map? stepTimings; + + + @JsonKey( name: r'trigger', @@ -96,17 +124,21 @@ class RefreshLogOut { @override bool operator ==(Object other) => identical(this, other) || other is RefreshLogOut && other.error == error && + other.failedStep == failedStep && other.finishedAt == finishedAt && other.id == id && other.startedAt == startedAt && + other.stepTimings == stepTimings && other.trigger == trigger; @override int get hashCode => (error == null ? 0 : error.hashCode) + + (failedStep == null ? 0 : failedStep.hashCode) + (finishedAt == null ? 0 : finishedAt.hashCode) + id.hashCode + startedAt.hashCode + + (stepTimings == null ? 0 : stepTimings.hashCode) + trigger.hashCode; factory RefreshLogOut.fromJson(Map json) => _$RefreshLogOutFromJson(json); diff --git a/app/packages/api_client/lib/src/model/refresh_log_out.g.dart b/app/packages/api_client/lib/src/model/refresh_log_out.g.dart index 2a04a55..76841a7 100644 --- a/app/packages/api_client/lib/src/model/refresh_log_out.g.dart +++ b/app/packages/api_client/lib/src/model/refresh_log_out.g.dart @@ -9,12 +9,16 @@ part of 'refresh_log_out.dart'; abstract class _$RefreshLogOutCWProxy { RefreshLogOut error(String? error); + RefreshLogOut failedStep(String? failedStep); + RefreshLogOut finishedAt(DateTime? finishedAt); RefreshLogOut id(int id); RefreshLogOut startedAt(DateTime startedAt); + RefreshLogOut stepTimings(Map? stepTimings); + RefreshLogOut trigger(String trigger); /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RefreshLogOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. @@ -25,9 +29,11 @@ abstract class _$RefreshLogOutCWProxy { /// ```` RefreshLogOut call({ String? error, + String? failedStep, DateTime? finishedAt, int id, DateTime startedAt, + Map? stepTimings, String trigger, }); } @@ -41,6 +47,9 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy { @override RefreshLogOut error(String? error) => this(error: error); + @override + RefreshLogOut failedStep(String? failedStep) => this(failedStep: failedStep); + @override RefreshLogOut finishedAt(DateTime? finishedAt) => this(finishedAt: finishedAt); @@ -51,6 +60,10 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy { @override RefreshLogOut startedAt(DateTime startedAt) => this(startedAt: startedAt); + @override + RefreshLogOut stepTimings(Map? stepTimings) => + this(stepTimings: stepTimings); + @override RefreshLogOut trigger(String trigger) => this(trigger: trigger); @@ -63,9 +76,11 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy { /// ```` RefreshLogOut call({ Object? error = const $CopyWithPlaceholder(), + Object? failedStep = const $CopyWithPlaceholder(), Object? finishedAt = const $CopyWithPlaceholder(), Object? id = const $CopyWithPlaceholder(), Object? startedAt = const $CopyWithPlaceholder(), + Object? stepTimings = const $CopyWithPlaceholder(), Object? trigger = const $CopyWithPlaceholder(), }) { return RefreshLogOut( @@ -73,6 +88,10 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy { ? _value.error // ignore: cast_nullable_to_non_nullable : error as String?, + failedStep: failedStep == const $CopyWithPlaceholder() + ? _value.failedStep + // ignore: cast_nullable_to_non_nullable + : failedStep as String?, finishedAt: finishedAt == const $CopyWithPlaceholder() ? _value.finishedAt // ignore: cast_nullable_to_non_nullable @@ -85,6 +104,10 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy { ? _value.startedAt // ignore: cast_nullable_to_non_nullable : startedAt as DateTime, + stepTimings: stepTimings == const $CopyWithPlaceholder() + ? _value.stepTimings + // ignore: cast_nullable_to_non_nullable + : stepTimings as Map?, trigger: trigger == const $CopyWithPlaceholder() ? _value.trigger // ignore: cast_nullable_to_non_nullable @@ -112,14 +135,17 @@ RefreshLogOut _$RefreshLogOutFromJson(Map json) => json, requiredKeys: const [ 'error', + 'failed_step', 'finished_at', 'id', 'started_at', + 'step_timings', 'trigger', ], ); final val = RefreshLogOut( error: $checkedConvert('error', (v) => v as String?), + failedStep: $checkedConvert('failed_step', (v) => v as String?), finishedAt: $checkedConvert( 'finished_at', (v) => v == null ? null : DateTime.parse(v as String), @@ -129,21 +155,31 @@ RefreshLogOut _$RefreshLogOutFromJson(Map json) => 'started_at', (v) => DateTime.parse(v as String), ), + stepTimings: $checkedConvert( + 'step_timings', + (v) => (v as Map?)?.map( + (k, e) => MapEntry(k, e as num), + ), + ), trigger: $checkedConvert('trigger', (v) => v as String), ); return val; }, fieldKeyMap: const { + 'failedStep': 'failed_step', 'finishedAt': 'finished_at', 'startedAt': 'started_at', + 'stepTimings': 'step_timings', }, ); Map _$RefreshLogOutToJson(RefreshLogOut instance) => { 'error': instance.error, + 'failed_step': instance.failedStep, 'finished_at': instance.finishedAt?.toIso8601String(), 'id': instance.id, 'started_at': instance.startedAt.toIso8601String(), + 'step_timings': instance.stepTimings, 'trigger': instance.trigger, }; diff --git a/app/packages/api_client/lib/src/model/scope_card_out.dart b/app/packages/api_client/lib/src/model/scope_card_out.dart new file mode 100644 index 0000000..2ac6273 --- /dev/null +++ b/app/packages/api_client/lib/src/model/scope_card_out.dart @@ -0,0 +1,259 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'scope_card_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ScopeCardOut { + /// Returns a new [ScopeCardOut] instance. + ScopeCardOut({ + + required this.asOf, + + required this.dayChangePct, + + required this.dayChangeRub, + + required this.incomeYearPct, + + required this.incomeYearRub, + + required this.investedRub, + + required this.kind, + + required this.name, + + required this.pnlPct, + + required this.pnlRub, + + required this.scope, + + required this.totalRub, + + required this.xirr, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: true, + ) + + + final DateTime? asOf; + + + + /// decimal as string + @JsonKey( + + name: r'day_change_pct', + required: true, + includeIfNull: true, + ) + + + final String? dayChangePct; + + + + /// decimal as string + @JsonKey( + + name: r'day_change_rub', + required: true, + includeIfNull: true, + ) + + + final String? dayChangeRub; + + + + /// decimal as string + @JsonKey( + + name: r'income_year_pct', + required: true, + includeIfNull: true, + ) + + + final String? incomeYearPct; + + + + /// decimal as string + @JsonKey( + + name: r'income_year_rub', + required: true, + includeIfNull: false, + ) + + + final String incomeYearRub; + + + + /// decimal as string + @JsonKey( + + name: r'invested_rub', + required: true, + includeIfNull: false, + ) + + + final String investedRub; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + /// decimal as string + @JsonKey( + + name: r'pnl_pct', + required: true, + includeIfNull: true, + ) + + + final String? pnlPct; + + + + /// decimal as string + @JsonKey( + + name: r'pnl_rub', + required: true, + includeIfNull: true, + ) + + + final String? pnlRub; + + + + @JsonKey( + + name: r'scope', + required: true, + includeIfNull: false, + ) + + + final String scope; + + + + /// decimal as string + @JsonKey( + + name: r'total_rub', + required: true, + includeIfNull: false, + ) + + + final String totalRub; + + + + /// decimal as string + @JsonKey( + + name: r'xirr', + required: true, + includeIfNull: true, + ) + + + final String? xirr; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ScopeCardOut && + other.asOf == asOf && + other.dayChangePct == dayChangePct && + other.dayChangeRub == dayChangeRub && + other.incomeYearPct == incomeYearPct && + other.incomeYearRub == incomeYearRub && + other.investedRub == investedRub && + other.kind == kind && + other.name == name && + other.pnlPct == pnlPct && + other.pnlRub == pnlRub && + other.scope == scope && + other.totalRub == totalRub && + other.xirr == xirr; + + @override + int get hashCode => + (asOf == null ? 0 : asOf.hashCode) + + (dayChangePct == null ? 0 : dayChangePct.hashCode) + + (dayChangeRub == null ? 0 : dayChangeRub.hashCode) + + (incomeYearPct == null ? 0 : incomeYearPct.hashCode) + + incomeYearRub.hashCode + + investedRub.hashCode + + kind.hashCode + + name.hashCode + + (pnlPct == null ? 0 : pnlPct.hashCode) + + (pnlRub == null ? 0 : pnlRub.hashCode) + + scope.hashCode + + totalRub.hashCode + + (xirr == null ? 0 : xirr.hashCode); + + factory ScopeCardOut.fromJson(Map json) => _$ScopeCardOutFromJson(json); + + Map toJson() => _$ScopeCardOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/scope_card_out.g.dart b/app/packages/api_client/lib/src/model/scope_card_out.g.dart new file mode 100644 index 0000000..217da36 --- /dev/null +++ b/app/packages/api_client/lib/src/model/scope_card_out.g.dart @@ -0,0 +1,272 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'scope_card_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ScopeCardOutCWProxy { + ScopeCardOut asOf(DateTime? asOf); + + ScopeCardOut dayChangePct(String? dayChangePct); + + ScopeCardOut dayChangeRub(String? dayChangeRub); + + ScopeCardOut incomeYearPct(String? incomeYearPct); + + ScopeCardOut incomeYearRub(String incomeYearRub); + + ScopeCardOut investedRub(String investedRub); + + ScopeCardOut kind(String kind); + + ScopeCardOut name(String name); + + ScopeCardOut pnlPct(String? pnlPct); + + ScopeCardOut pnlRub(String? pnlRub); + + ScopeCardOut scope(String scope); + + ScopeCardOut totalRub(String totalRub); + + ScopeCardOut xirr(String? xirr); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScopeCardOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ScopeCardOut(...).copyWith(id: 12, name: "My name") + /// ```` + ScopeCardOut call({ + DateTime? asOf, + String? dayChangePct, + String? dayChangeRub, + String? incomeYearPct, + String incomeYearRub, + String investedRub, + String kind, + String name, + String? pnlPct, + String? pnlRub, + String scope, + String totalRub, + String? xirr, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfScopeCardOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfScopeCardOut.copyWith.fieldName(...)` +class _$ScopeCardOutCWProxyImpl implements _$ScopeCardOutCWProxy { + const _$ScopeCardOutCWProxyImpl(this._value); + + final ScopeCardOut _value; + + @override + ScopeCardOut asOf(DateTime? asOf) => this(asOf: asOf); + + @override + ScopeCardOut dayChangePct(String? dayChangePct) => + this(dayChangePct: dayChangePct); + + @override + ScopeCardOut dayChangeRub(String? dayChangeRub) => + this(dayChangeRub: dayChangeRub); + + @override + ScopeCardOut incomeYearPct(String? incomeYearPct) => + this(incomeYearPct: incomeYearPct); + + @override + ScopeCardOut incomeYearRub(String incomeYearRub) => + this(incomeYearRub: incomeYearRub); + + @override + ScopeCardOut investedRub(String investedRub) => + this(investedRub: investedRub); + + @override + ScopeCardOut kind(String kind) => this(kind: kind); + + @override + ScopeCardOut name(String name) => this(name: name); + + @override + ScopeCardOut pnlPct(String? pnlPct) => this(pnlPct: pnlPct); + + @override + ScopeCardOut pnlRub(String? pnlRub) => this(pnlRub: pnlRub); + + @override + ScopeCardOut scope(String scope) => this(scope: scope); + + @override + ScopeCardOut totalRub(String totalRub) => this(totalRub: totalRub); + + @override + ScopeCardOut xirr(String? xirr) => this(xirr: xirr); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScopeCardOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ScopeCardOut(...).copyWith(id: 12, name: "My name") + /// ```` + ScopeCardOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? dayChangePct = const $CopyWithPlaceholder(), + Object? dayChangeRub = const $CopyWithPlaceholder(), + Object? incomeYearPct = const $CopyWithPlaceholder(), + Object? incomeYearRub = const $CopyWithPlaceholder(), + Object? investedRub = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? pnlPct = const $CopyWithPlaceholder(), + Object? pnlRub = const $CopyWithPlaceholder(), + Object? scope = const $CopyWithPlaceholder(), + Object? totalRub = const $CopyWithPlaceholder(), + Object? xirr = const $CopyWithPlaceholder(), + }) { + return ScopeCardOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime?, + dayChangePct: dayChangePct == const $CopyWithPlaceholder() + ? _value.dayChangePct + // ignore: cast_nullable_to_non_nullable + : dayChangePct as String?, + dayChangeRub: dayChangeRub == const $CopyWithPlaceholder() + ? _value.dayChangeRub + // ignore: cast_nullable_to_non_nullable + : dayChangeRub as String?, + incomeYearPct: incomeYearPct == const $CopyWithPlaceholder() + ? _value.incomeYearPct + // ignore: cast_nullable_to_non_nullable + : incomeYearPct as String?, + incomeYearRub: incomeYearRub == const $CopyWithPlaceholder() + ? _value.incomeYearRub + // ignore: cast_nullable_to_non_nullable + : incomeYearRub as String, + investedRub: investedRub == const $CopyWithPlaceholder() + ? _value.investedRub + // ignore: cast_nullable_to_non_nullable + : investedRub as String, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + pnlPct: pnlPct == const $CopyWithPlaceholder() + ? _value.pnlPct + // ignore: cast_nullable_to_non_nullable + : pnlPct as String?, + pnlRub: pnlRub == const $CopyWithPlaceholder() + ? _value.pnlRub + // ignore: cast_nullable_to_non_nullable + : pnlRub as String?, + scope: scope == const $CopyWithPlaceholder() + ? _value.scope + // ignore: cast_nullable_to_non_nullable + : scope as String, + totalRub: totalRub == const $CopyWithPlaceholder() + ? _value.totalRub + // ignore: cast_nullable_to_non_nullable + : totalRub as String, + xirr: xirr == const $CopyWithPlaceholder() + ? _value.xirr + // ignore: cast_nullable_to_non_nullable + : xirr as String?, + ); + } +} + +extension $ScopeCardOutCopyWith on ScopeCardOut { + /// Returns a callable class that can be used as follows: `instanceOfScopeCardOut.copyWith(...)` or like so:`instanceOfScopeCardOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ScopeCardOutCWProxy get copyWith => _$ScopeCardOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ScopeCardOut _$ScopeCardOutFromJson(Map json) => + $checkedCreate( + 'ScopeCardOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'as_of', + 'day_change_pct', + 'day_change_rub', + 'income_year_pct', + 'income_year_rub', + 'invested_rub', + 'kind', + 'name', + 'pnl_pct', + 'pnl_rub', + 'scope', + 'total_rub', + 'xirr', + ], + ); + final val = ScopeCardOut( + asOf: $checkedConvert( + 'as_of', + (v) => v == null ? null : DateTime.parse(v as String), + ), + dayChangePct: $checkedConvert('day_change_pct', (v) => v as String?), + dayChangeRub: $checkedConvert('day_change_rub', (v) => v as String?), + incomeYearPct: $checkedConvert( + 'income_year_pct', + (v) => v as String?, + ), + incomeYearRub: $checkedConvert('income_year_rub', (v) => v as String), + investedRub: $checkedConvert('invested_rub', (v) => v as String), + kind: $checkedConvert('kind', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + pnlPct: $checkedConvert('pnl_pct', (v) => v as String?), + pnlRub: $checkedConvert('pnl_rub', (v) => v as String?), + scope: $checkedConvert('scope', (v) => v as String), + totalRub: $checkedConvert('total_rub', (v) => v as String), + xirr: $checkedConvert('xirr', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'asOf': 'as_of', + 'dayChangePct': 'day_change_pct', + 'dayChangeRub': 'day_change_rub', + 'incomeYearPct': 'income_year_pct', + 'incomeYearRub': 'income_year_rub', + 'investedRub': 'invested_rub', + 'pnlPct': 'pnl_pct', + 'pnlRub': 'pnl_rub', + 'totalRub': 'total_rub', + }, + ); + +Map _$ScopeCardOutToJson(ScopeCardOut instance) => + { + 'as_of': instance.asOf?.toIso8601String(), + 'day_change_pct': instance.dayChangePct, + 'day_change_rub': instance.dayChangeRub, + 'income_year_pct': instance.incomeYearPct, + 'income_year_rub': instance.incomeYearRub, + 'invested_rub': instance.investedRub, + 'kind': instance.kind, + 'name': instance.name, + 'pnl_pct': instance.pnlPct, + 'pnl_rub': instance.pnlRub, + 'scope': instance.scope, + 'total_rub': instance.totalRub, + 'xirr': instance.xirr, + }; diff --git a/app/packages/api_client/test/account_create_test.dart b/app/packages/api_client/test/account_create_test.dart new file mode 100644 index 0000000..fe5488d --- /dev/null +++ b/app/packages/api_client/test/account_create_test.dart @@ -0,0 +1,32 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for AccountCreate +void main() { + final AccountCreate? instance = /* AccountCreate(...) */ null; + // TODO add properties to the entity + + group(AccountCreate, () { + // Broker broker + test('to test the property `broker`', () async { + // TODO + }); + + // String currency (default value: 'RUB') + test('to test the property `currency`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Agreement number exactly as the broker's report prints it + // String sourceId + test('to test the property `sourceId`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/instrument_patch_test.dart b/app/packages/api_client/test/instrument_patch_test.dart new file mode 100644 index 0000000..64c306c --- /dev/null +++ b/app/packages/api_client/test/instrument_patch_test.dart @@ -0,0 +1,36 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for InstrumentPatch +void main() { + final InstrumentPatch? instance = /* InstrumentPatch(...) */ null; + // TODO add properties to the entity + + group(InstrumentPatch, () { + // String assetClass + test('to test the property `assetClass`', () async { + // TODO + }); + + // String board + test('to test the property `board`', () async { + // TODO + }); + + // int lot + test('to test the property `lot`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String sector + test('to test the property `sector`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/manual_event_create_test.dart b/app/packages/api_client/test/manual_event_create_test.dart new file mode 100644 index 0000000..0effea4 --- /dev/null +++ b/app/packages/api_client/test/manual_event_create_test.dart @@ -0,0 +1,71 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ManualEventCreate +void main() { + final ManualEventCreate? instance = /* ManualEventCreate(...) */ null; + // TODO add properties to the entity + + group(ManualEventCreate, () { + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // decimal as string + // String accruedInterest + test('to test the property `accruedInterest`', () async { + // TODO + }); + + // decimal as string + // String amount + test('to test the property `amount`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // decimal as string + // String fee + test('to test the property `fee`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // EventKind kind + test('to test the property `kind`', () async { + // TODO + }); + + // decimal as string + // String price + test('to test the property `price`', () async { + // TODO + }); + + // decimal as string + // String quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime tradeDate + test('to test the property `tradeDate`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/metrics_status_out_test.dart b/app/packages/api_client/test/metrics_status_out_test.dart new file mode 100644 index 0000000..49ad3f7 --- /dev/null +++ b/app/packages/api_client/test/metrics_status_out_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for MetricsStatusOut +void main() { + final MetricsStatusOut? instance = /* MetricsStatusOut(...) */ null; + // TODO add properties to the entity + + group(MetricsStatusOut, () { + // bool consistent + test('to test the property `consistent`', () async { + // TODO + }); + + // RefreshLogOut lastRefresh + test('to test the property `lastRefresh`', () async { + // TODO + }); + + // bool refreshing + test('to test the property `refreshing`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/portfolio_accounts_in_test.dart b/app/packages/api_client/test/portfolio_accounts_in_test.dart new file mode 100644 index 0000000..9d439b4 --- /dev/null +++ b/app/packages/api_client/test/portfolio_accounts_in_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PortfolioAccountsIn +void main() { + final PortfolioAccountsIn? instance = /* PortfolioAccountsIn(...) */ null; + // TODO add properties to the entity + + group(PortfolioAccountsIn, () { + // List accountIds + test('to test the property `accountIds`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/portfolio_create_test.dart b/app/packages/api_client/test/portfolio_create_test.dart new file mode 100644 index 0000000..b1df62c --- /dev/null +++ b/app/packages/api_client/test/portfolio_create_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PortfolioCreate +void main() { + final PortfolioCreate? instance = /* PortfolioCreate(...) */ null; + // TODO add properties to the entity + + group(PortfolioCreate, () { + // List accountIds + test('to test the property `accountIds`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/portfolio_out_test.dart b/app/packages/api_client/test/portfolio_out_test.dart new file mode 100644 index 0000000..0bce05c --- /dev/null +++ b/app/packages/api_client/test/portfolio_out_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PortfolioOut +void main() { + final PortfolioOut? instance = /* PortfolioOut(...) */ null; + // TODO add properties to the entity + + group(PortfolioOut, () { + // List accountIds + test('to test the property `accountIds`', () async { + // TODO + }); + + // String baseCurrency + test('to test the property `baseCurrency`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/portfolio_patch_test.dart b/app/packages/api_client/test/portfolio_patch_test.dart new file mode 100644 index 0000000..52dd3e6 --- /dev/null +++ b/app/packages/api_client/test/portfolio_patch_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PortfolioPatch +void main() { + final PortfolioPatch? instance = /* PortfolioPatch(...) */ null; + // TODO add properties to the entity + + group(PortfolioPatch, () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/portfolios_api_test.dart b/app/packages/api_client/test/portfolios_api_test.dart new file mode 100644 index 0000000..a90c663 --- /dev/null +++ b/app/packages/api_client/test/portfolios_api_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for PortfoliosApi +void main() { + final instance = FintrackerApi().getPortfoliosApi(); + + group(PortfoliosApi, () { + // Create + // + //Future portfoliosCreate(PortfolioCreate portfolioCreate) async + test('test portfoliosCreate', () async { + // TODO + }); + + // Delete + // + //Future portfoliosDelete(int portfolioId) async + test('test portfoliosDelete', () async { + // TODO + }); + + // List + // + //Future> portfoliosList() async + test('test portfoliosList', () async { + // TODO + }); + + // Patch + // + //Future portfoliosPatch(int portfolioId, PortfolioPatch portfolioPatch) async + test('test portfoliosPatch', () async { + // TODO + }); + + // Set Accounts + // + //Future portfoliosSetAccounts(int portfolioId, PortfolioAccountsIn portfolioAccountsIn) async + test('test portfoliosSetAccounts', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/scope_card_out_test.dart b/app/packages/api_client/test/scope_card_out_test.dart new file mode 100644 index 0000000..00e2900 --- /dev/null +++ b/app/packages/api_client/test/scope_card_out_test.dart @@ -0,0 +1,85 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ScopeCardOut +void main() { + final ScopeCardOut? instance = /* ScopeCardOut(...) */ null; + // TODO add properties to the entity + + group(ScopeCardOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // decimal as string + // String dayChangePct + test('to test the property `dayChangePct`', () async { + // TODO + }); + + // decimal as string + // String dayChangeRub + test('to test the property `dayChangeRub`', () async { + // TODO + }); + + // decimal as string + // String incomeYearPct + test('to test the property `incomeYearPct`', () async { + // TODO + }); + + // decimal as string + // String incomeYearRub + test('to test the property `incomeYearRub`', () async { + // TODO + }); + + // decimal as string + // String investedRub + test('to test the property `investedRub`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // decimal as string + // String pnlPct + test('to test the property `pnlPct`', () async { + // TODO + }); + + // decimal as string + // String pnlRub + test('to test the property `pnlRub`', () async { + // TODO + }); + + // String scope + test('to test the property `scope`', () async { + // TODO + }); + + // decimal as string + // String totalRub + test('to test the property `totalRub`', () async { + // TODO + }); + + // decimal as string + // String xirr + test('to test the property `xirr`', () async { + // TODO + }); + + }); +}