From 28ff63bdfacf2203d03f1729bf1793730bfb82e9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 18 Sep 2026 14:20:50 +0300 Subject: [PATCH] =?UTF-8?q?chore(app):=20=D1=81=D0=B3=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?Dart-=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=20=D1=81=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=D0=BC=D0=B8=20=D0=B0=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D1=82=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit just gen-client после новых роутов. --- .../api_client/.openapi-generator/FILES | 66 ++- .../api_client/doc/AllocationBucket.md | 19 + .../api_client/doc/AllocationDimension.md | 14 + app/packages/api_client/doc/AnalyticsApi.md | 279 ++++++++++ app/packages/api_client/doc/EventKind.md | 14 + app/packages/api_client/doc/EventOut.md | 33 ++ app/packages/api_client/doc/EventPage.md | 18 + app/packages/api_client/doc/EventStatus.md | 14 + app/packages/api_client/doc/EventsApi.md | 75 +++ app/packages/api_client/doc/HoldingOut.md | 40 ++ .../api_client/doc/InstrumentDetail.md | 19 + app/packages/api_client/doc/InstrumentOut.md | 31 ++ app/packages/api_client/doc/InstrumentsApi.md | 109 ++++ app/packages/api_client/doc/LotOut.md | 23 + app/packages/api_client/doc/PricePoint.md | 18 + app/packages/api_client/doc/ReturnsOut.md | 25 + app/packages/api_client/doc/ScopeOut.md | 17 + app/packages/api_client/doc/SummaryOut.md | 28 + app/packages/api_client/doc/ValueDay.md | 25 + .../api_client/lib/fintracker_api.dart | 18 + app/packages/api_client/lib/src/api.dart | 21 + .../api_client/lib/src/api/analytics_api.dart | 527 ++++++++++++++++++ .../api_client/lib/src/api/events_api.dart | 133 +++++ .../lib/src/api/instruments_api.dart | 202 +++++++ .../api_client/lib/src/deserialize.dart | 45 ++ .../lib/src/model/allocation_bucket.dart | 126 +++++ .../lib/src/model/allocation_bucket.g.dart | 157 ++++++ .../lib/src/model/allocation_dimension.dart | 27 + .../api_client/lib/src/model/event_kind.dart | 52 ++ .../api_client/lib/src/model/event_out.dart | 357 ++++++++++++ .../api_client/lib/src/model/event_out.g.dart | 392 +++++++++++++ .../api_client/lib/src/model/event_page.dart | 107 ++++ .../lib/src/model/event_page.g.dart | 114 ++++ .../lib/src/model/event_status.dart | 26 + .../api_client/lib/src/model/holding_out.dart | 472 ++++++++++++++++ .../lib/src/model/holding_out.g.dart | 476 ++++++++++++++++ .../lib/src/model/instrument_detail.dart | 127 +++++ .../lib/src/model/instrument_detail.g.dart | 157 ++++++ .../lib/src/model/instrument_out.dart | 315 +++++++++++ .../lib/src/model/instrument_out.g.dart | 320 +++++++++++ .../api_client/lib/src/model/lot_out.dart | 190 +++++++ .../api_client/lib/src/model/lot_out.g.dart | 208 +++++++ .../api_client/lib/src/model/price_point.dart | 108 ++++ .../lib/src/model/price_point.g.dart | 120 ++++ .../api_client/lib/src/model/returns_out.dart | 225 ++++++++ .../lib/src/model/returns_out.g.dart | 241 ++++++++ .../api_client/lib/src/model/scope_out.dart | 90 +++ .../api_client/lib/src/model/scope_out.g.dart | 97 ++++ .../api_client/lib/src/model/summary_out.dart | 274 +++++++++ .../lib/src/model/summary_out.g.dart | 295 ++++++++++ .../api_client/lib/src/model/value_day.dart | 225 ++++++++ .../api_client/lib/src/model/value_day.g.dart | 251 +++++++++ .../test/allocation_bucket_test.dart | 38 ++ .../test/allocation_dimension_test.dart | 9 + .../api_client/test/analytics_api_test.dart | 65 +++ .../api_client/test/asset_class_test.dart | 9 + .../api_client/test/event_kind_test.dart | 9 + .../api_client/test/event_out_test.dart | 113 ++++ .../api_client/test/event_page_test.dart | 31 ++ .../api_client/test/event_status_test.dart | 9 + .../api_client/test/events_api_test.dart | 20 + .../api_client/test/holding_out_test.dart | 155 ++++++ .../test/instrument_detail_test.dart | 36 ++ .../api_client/test/instrument_out_test.dart | 97 ++++ .../api_client/test/instruments_api_test.dart | 27 + .../api_client/test/lot_out_test.dart | 60 ++ .../api_client/test/price_point_test.dart | 33 ++ .../api_client/test/returns_out_test.dart | 73 +++ .../api_client/test/scope_out_test.dart | 26 + .../api_client/test/summary_out_test.dart | 88 +++ .../api_client/test/value_day_test.dart | 73 +++ 71 files changed, 8303 insertions(+), 30 deletions(-) create mode 100644 app/packages/api_client/doc/AllocationBucket.md create mode 100644 app/packages/api_client/doc/AllocationDimension.md create mode 100644 app/packages/api_client/doc/AnalyticsApi.md create mode 100644 app/packages/api_client/doc/EventKind.md create mode 100644 app/packages/api_client/doc/EventOut.md create mode 100644 app/packages/api_client/doc/EventPage.md create mode 100644 app/packages/api_client/doc/EventStatus.md create mode 100644 app/packages/api_client/doc/EventsApi.md create mode 100644 app/packages/api_client/doc/HoldingOut.md create mode 100644 app/packages/api_client/doc/InstrumentDetail.md create mode 100644 app/packages/api_client/doc/InstrumentOut.md create mode 100644 app/packages/api_client/doc/InstrumentsApi.md create mode 100644 app/packages/api_client/doc/LotOut.md create mode 100644 app/packages/api_client/doc/PricePoint.md create mode 100644 app/packages/api_client/doc/ReturnsOut.md create mode 100644 app/packages/api_client/doc/ScopeOut.md create mode 100644 app/packages/api_client/doc/SummaryOut.md create mode 100644 app/packages/api_client/doc/ValueDay.md create mode 100644 app/packages/api_client/lib/src/api/analytics_api.dart create mode 100644 app/packages/api_client/lib/src/api/events_api.dart create mode 100644 app/packages/api_client/lib/src/api/instruments_api.dart create mode 100644 app/packages/api_client/lib/src/model/allocation_bucket.dart create mode 100644 app/packages/api_client/lib/src/model/allocation_bucket.g.dart create mode 100644 app/packages/api_client/lib/src/model/allocation_dimension.dart create mode 100644 app/packages/api_client/lib/src/model/event_kind.dart create mode 100644 app/packages/api_client/lib/src/model/event_out.dart create mode 100644 app/packages/api_client/lib/src/model/event_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/event_page.dart create mode 100644 app/packages/api_client/lib/src/model/event_page.g.dart create mode 100644 app/packages/api_client/lib/src/model/event_status.dart create mode 100644 app/packages/api_client/lib/src/model/holding_out.dart create mode 100644 app/packages/api_client/lib/src/model/holding_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/instrument_detail.dart create mode 100644 app/packages/api_client/lib/src/model/instrument_detail.g.dart create mode 100644 app/packages/api_client/lib/src/model/instrument_out.dart create mode 100644 app/packages/api_client/lib/src/model/instrument_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/lot_out.dart create mode 100644 app/packages/api_client/lib/src/model/lot_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/price_point.dart create mode 100644 app/packages/api_client/lib/src/model/price_point.g.dart create mode 100644 app/packages/api_client/lib/src/model/returns_out.dart create mode 100644 app/packages/api_client/lib/src/model/returns_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/scope_out.dart create mode 100644 app/packages/api_client/lib/src/model/scope_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/summary_out.dart create mode 100644 app/packages/api_client/lib/src/model/summary_out.g.dart create mode 100644 app/packages/api_client/lib/src/model/value_day.dart create mode 100644 app/packages/api_client/lib/src/model/value_day.g.dart create mode 100644 app/packages/api_client/test/allocation_bucket_test.dart create mode 100644 app/packages/api_client/test/allocation_dimension_test.dart create mode 100644 app/packages/api_client/test/analytics_api_test.dart create mode 100644 app/packages/api_client/test/asset_class_test.dart create mode 100644 app/packages/api_client/test/event_kind_test.dart create mode 100644 app/packages/api_client/test/event_out_test.dart create mode 100644 app/packages/api_client/test/event_page_test.dart create mode 100644 app/packages/api_client/test/event_status_test.dart create mode 100644 app/packages/api_client/test/events_api_test.dart create mode 100644 app/packages/api_client/test/holding_out_test.dart create mode 100644 app/packages/api_client/test/instrument_detail_test.dart create mode 100644 app/packages/api_client/test/instrument_out_test.dart create mode 100644 app/packages/api_client/test/instruments_api_test.dart create mode 100644 app/packages/api_client/test/lot_out_test.dart create mode 100644 app/packages/api_client/test/price_point_test.dart create mode 100644 app/packages/api_client/test/returns_out_test.dart create mode 100644 app/packages/api_client/test/scope_out_test.dart create mode 100644 app/packages/api_client/test/summary_out_test.dart create mode 100644 app/packages/api_client/test/value_day_test.dart diff --git a/app/packages/api_client/.openapi-generator/FILES b/app/packages/api_client/.openapi-generator/FILES index a00d0b4..ef45eb8 100644 --- a/app/packages/api_client/.openapi-generator/FILES +++ b/app/packages/api_client/.openapi-generator/FILES @@ -6,6 +6,9 @@ doc/AccountOut.md doc/AccountPatch.md doc/AccountRole.md doc/AccountsApi.md +doc/AllocationBucket.md +doc/AllocationDimension.md +doc/AnalyticsApi.md doc/AuthApi.md doc/Broker.md doc/CashFlowMonth.md @@ -13,19 +16,31 @@ doc/CashflowApi.md doc/CategoriesApi.md doc/CategoryOut.md doc/DataQualityRow.md +doc/EventKind.md +doc/EventOut.md +doc/EventPage.md doc/EventSource.md +doc/EventStatus.md +doc/EventsApi.md doc/FlowType.md doc/Health.md doc/HealthApi.md +doc/HoldingOut.md +doc/InstrumentDetail.md +doc/InstrumentOut.md +doc/InstrumentsApi.md doc/JobStatus.md doc/LoginRequest.md +doc/LotOut.md doc/MetricsApi.md doc/NetWorthBreakdown.md doc/NetWorthDay.md doc/NetworthApi.md +doc/PricePoint.md doc/Problem.md doc/RefreshLogOut.md doc/RefreshRequest.md +doc/ReturnsOut.md doc/RuleCreate.md doc/RuleKind.md doc/RuleMatchType.md @@ -34,8 +49,10 @@ doc/RulePatch.md doc/RulesApi.md doc/RunStatus.md doc/RunwayOut.md +doc/ScopeOut.md doc/SourceStatus.md doc/SpendingRow.md +doc/SummaryOut.md doc/SyncApi.md doc/SyncJobOut.md doc/SyncRunOut.md @@ -44,13 +61,17 @@ doc/TransactionOut.md doc/TransactionPage.md doc/TransactionsApi.md doc/UserOut.md +doc/ValueDay.md lib/fintracker_api.dart lib/src/api.dart lib/src/api/accounts_api.dart +lib/src/api/analytics_api.dart lib/src/api/auth_api.dart lib/src/api/cashflow_api.dart lib/src/api/categories_api.dart +lib/src/api/events_api.dart lib/src/api/health_api.dart +lib/src/api/instruments_api.dart lib/src/api/metrics_api.dart lib/src/api/networth_api.dart lib/src/api/rules_api.dart @@ -67,20 +88,32 @@ lib/src/model/account_kind.dart lib/src/model/account_out.dart lib/src/model/account_patch.dart lib/src/model/account_role.dart +lib/src/model/allocation_bucket.dart +lib/src/model/allocation_dimension.dart lib/src/model/broker.dart lib/src/model/cash_flow_month.dart lib/src/model/category_out.dart lib/src/model/data_quality_row.dart +lib/src/model/event_kind.dart +lib/src/model/event_out.dart +lib/src/model/event_page.dart lib/src/model/event_source.dart +lib/src/model/event_status.dart lib/src/model/flow_type.dart lib/src/model/health.dart +lib/src/model/holding_out.dart +lib/src/model/instrument_detail.dart +lib/src/model/instrument_out.dart lib/src/model/job_status.dart lib/src/model/login_request.dart +lib/src/model/lot_out.dart lib/src/model/net_worth_breakdown.dart lib/src/model/net_worth_day.dart +lib/src/model/price_point.dart lib/src/model/problem.dart lib/src/model/refresh_log_out.dart lib/src/model/refresh_request.dart +lib/src/model/returns_out.dart lib/src/model/rule_create.dart lib/src/model/rule_kind.dart lib/src/model/rule_match_type.dart @@ -88,42 +121,15 @@ lib/src/model/rule_out.dart lib/src/model/rule_patch.dart lib/src/model/run_status.dart lib/src/model/runway_out.dart +lib/src/model/scope_out.dart lib/src/model/source_status.dart lib/src/model/spending_row.dart +lib/src/model/summary_out.dart lib/src/model/sync_job_out.dart lib/src/model/sync_run_out.dart lib/src/model/token_pair.dart lib/src/model/transaction_out.dart lib/src/model/transaction_page.dart lib/src/model/user_out.dart +lib/src/model/value_day.dart pubspec.yaml -test/account_balance_test.dart -test/account_kind_test.dart -test/account_out_test.dart -test/account_patch_test.dart -test/account_role_test.dart -test/accounts_api_test.dart -test/broker_test.dart -test/cash_flow_month_test.dart -test/cashflow_api_test.dart -test/categories_api_test.dart -test/category_out_test.dart -test/data_quality_row_test.dart -test/event_source_test.dart -test/flow_type_test.dart -test/metrics_api_test.dart -test/net_worth_breakdown_test.dart -test/net_worth_day_test.dart -test/networth_api_test.dart -test/refresh_log_out_test.dart -test/rule_create_test.dart -test/rule_kind_test.dart -test/rule_match_type_test.dart -test/rule_out_test.dart -test/rule_patch_test.dart -test/rules_api_test.dart -test/runway_out_test.dart -test/spending_row_test.dart -test/transaction_out_test.dart -test/transaction_page_test.dart -test/transactions_api_test.dart diff --git a/app/packages/api_client/doc/AllocationBucket.md b/app/packages/api_client/doc/AllocationBucket.md new file mode 100644 index 0000000..ed4bbc3 --- /dev/null +++ b/app/packages/api_client/doc/AllocationBucket.md @@ -0,0 +1,19 @@ +# fintracker_api.model.AllocationBucket + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bucket** | **String** | | +**dimension** | [**AllocationDimension**](AllocationDimension.md) | | +**holdingCount** | **int** | | +**valueRub** | **String** | decimal as string | +**weight** | **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/doc/AllocationDimension.md b/app/packages/api_client/doc/AllocationDimension.md new file mode 100644 index 0000000..14a6679 --- /dev/null +++ b/app/packages/api_client/doc/AllocationDimension.md @@ -0,0 +1,14 @@ +# fintracker_api.model.AllocationDimension + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/AnalyticsApi.md b/app/packages/api_client/doc/AnalyticsApi.md new file mode 100644 index 0000000..f4a4ead --- /dev/null +++ b/app/packages/api_client/doc/AnalyticsApi.md @@ -0,0 +1,279 @@ +# fintracker_api.api.AnalyticsApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**analyticsAllocation**](AnalyticsApi.md#analyticsallocation) | **GET** /api/v1/analytics/allocation | Allocation +[**analyticsHoldings**](AnalyticsApi.md#analyticsholdings) | **GET** /api/v1/analytics/holdings | Holdings +[**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 +[**analyticsValueSeries**](AnalyticsApi.md#analyticsvalueseries) | **GET** /api/v1/analytics/value-series | Value Series + + +# **analyticsAllocation** +> List analyticsAllocation(scope, dimension) + +Allocation + +Buckets of one dimension (or all four), largest first. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); +final String scope = scope_example; // String | all | account: | portfolio: +final AllocationDimension dimension = ; // AllocationDimension | + +try { + final response = api.analyticsAllocation(scope, dimension); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsAllocation: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **dimension** | [**AllocationDimension**](.md)| | [optional] + +### Return type + +[**List<AllocationBucket>**](AllocationBucket.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) + +# **analyticsHoldings** +> List analyticsHoldings(scope) + +Holdings + +Open positions, most valuable first; unpriced ones last with null values. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); +final String scope = scope_example; // String | all | account: | portfolio: + +try { + final response = api.analyticsHoldings(scope); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsHoldings: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + +### Return type + +[**List<HoldingOut>**](HoldingOut.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) + +Returns + +XIRR and TWR per period, shortest first. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); +final String scope = scope_example; // String | all | account: | portfolio: + +try { + final response = api.analyticsReturns(scope); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsReturns: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + +### Return type + +[**List<ReturnsOut>**](ReturnsOut.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) + +# **analyticsScopes** +> List analyticsScopes() + +Scopes + +Every set of accounts the metrics were built for. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); + +try { + final response = api.analyticsScopes(); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsScopes: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<ScopeOut>**](ScopeOut.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) + +# **analyticsSummary** +> SummaryOut analyticsSummary(scope) + +Summary + +One screen's worth: the latest day, the totals it adds up to, and the returns. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); +final String scope = scope_example; // String | all | account: | portfolio: + +try { + final response = api.analyticsSummary(scope); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsSummary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + +### Return type + +[**SummaryOut**](SummaryOut.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) + +# **analyticsValueSeries** +> List analyticsValueSeries(scope, from, to) + +Value Series + +Daily portfolio value; defaults to the last 365 days. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getAnalyticsApi(); +final String scope = scope_example; // String | all | account: | portfolio: +final DateTime from = 2013-10-20; // DateTime | +final DateTime to = 2013-10-20; // DateTime | + +try { + final response = api.analyticsValueSeries(scope, from, to); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsValueSeries: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **from** | **DateTime**| | [optional] + **to** | **DateTime**| | [optional] + +### Return type + +[**List<ValueDay>**](ValueDay.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) + diff --git a/app/packages/api_client/doc/EventKind.md b/app/packages/api_client/doc/EventKind.md new file mode 100644 index 0000000..796deb9 --- /dev/null +++ b/app/packages/api_client/doc/EventKind.md @@ -0,0 +1,14 @@ +# fintracker_api.model.EventKind + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/EventOut.md b/app/packages/api_client/doc/EventOut.md new file mode 100644 index 0000000..298b119 --- /dev/null +++ b/app/packages/api_client/doc/EventOut.md @@ -0,0 +1,33 @@ +# fintracker_api.model.EventOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | +**accruedInterest** | **String** | decimal as string | +**amount** | **String** | decimal as string | +**amountRub** | **String** | decimal as string | +**currency** | **String** | | +**description** | **String** | | +**externalFlow** | **bool** | | +**fee** | **String** | decimal as string | +**id** | **int** | | +**instrumentId** | **int** | | +**kind** | [**EventKind**](EventKind.md) | | +**price** | **String** | decimal as string | +**priceCurrency** | **String** | | +**quantity** | **String** | decimal as string | +**status** | [**EventStatus**](EventStatus.md) | | +**tax** | **String** | decimal as string | +**ticker** | **String** | | +**tradeDate** | [**DateTime**](DateTime.md) | | +**ts** | [**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/EventPage.md b/app/packages/api_client/doc/EventPage.md new file mode 100644 index 0000000..d21ceca --- /dev/null +++ b/app/packages/api_client/doc/EventPage.md @@ -0,0 +1,18 @@ +# fintracker_api.model.EventPage + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**List<EventOut>**](EventOut.md) | | +**page** | **int** | | +**pageSize** | **int** | | +**total** | **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/EventStatus.md b/app/packages/api_client/doc/EventStatus.md new file mode 100644 index 0000000..30a078f --- /dev/null +++ b/app/packages/api_client/doc/EventStatus.md @@ -0,0 +1,14 @@ +# fintracker_api.model.EventStatus + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/EventsApi.md b/app/packages/api_client/doc/EventsApi.md new file mode 100644 index 0000000..08f5164 --- /dev/null +++ b/app/packages/api_client/doc/EventsApi.md @@ -0,0 +1,75 @@ +# fintracker_api.api.EventsApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**eventsList**](EventsApi.md#eventslist) | **GET** /api/v1/events | List + + +# **eventsList** +> EventPage eventsList(from, to, accountId, instrumentId, kind, status, externalFlow, q, page, pageSize) + +List + +One page of ledger events, newest first, with RUB amounts at each own date's rate. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getEventsApi(); +final DateTime from = 2013-10-20; // DateTime | +final DateTime to = 2013-10-20; // DateTime | +final int accountId = 56; // int | +final int instrumentId = 56; // int | +final EventKind kind = ; // EventKind | +final EventStatus status = ; // EventStatus | +final bool externalFlow = true; // bool | only the events XIRR reads as boundary flows +final String q = q_example; // String | substring of description or ticker +final int page = 56; // int | +final int pageSize = 56; // int | + +try { + final response = api.eventsList(from, to, accountId, instrumentId, kind, status, externalFlow, q, page, pageSize); + print(response); +} on DioException catch (e) { + print('Exception when calling EventsApi->eventsList: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **from** | **DateTime**| | [optional] + **to** | **DateTime**| | [optional] + **accountId** | **int**| | [optional] + **instrumentId** | **int**| | [optional] + **kind** | [**EventKind**](.md)| | [optional] + **status** | [**EventStatus**](.md)| | [optional] + **externalFlow** | **bool**| only the events XIRR reads as boundary flows | [optional] + **q** | **String**| substring of description or ticker | [optional] + **page** | **int**| | [optional] [default to 1] + **pageSize** | **int**| | [optional] [default to 50] + +### Return type + +[**EventPage**](EventPage.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) + diff --git a/app/packages/api_client/doc/HoldingOut.md b/app/packages/api_client/doc/HoldingOut.md new file mode 100644 index 0000000..880f90b --- /dev/null +++ b/app/packages/api_client/doc/HoldingOut.md @@ -0,0 +1,40 @@ +# fintracker_api.model.HoldingOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accruedInterestRub** | **String** | decimal as string | +**assetClass** | **String** | | +**avgCost** | **String** | decimal as string | +**board** | **String** | | +**costCurrency** | **String** | | +**costTotalRub** | **String** | decimal as string | +**currency** | **String** | | +**daysHeld** | **int** | | +**firstBuyDate** | [**DateTime**](DateTime.md) | | +**incomeRub** | **String** | decimal as string | +**instrumentId** | **int** | | +**ldvEligibleQty** | **String** | decimal as string | +**marketPrice** | **String** | decimal as string | +**name** | **String** | | +**priceCurrency** | **String** | | +**priceDate** | [**DateTime**](DateTime.md) | | +**priceStatus** | **String** | | +**qty** | **String** | decimal as string | +**realizedPnlRub** | **String** | decimal as string | +**ticker** | **String** | | +**unrealizedPnlNative** | **String** | decimal as string | +**unrealizedPnlRub** | **String** | decimal as string | +**valueNative** | **String** | decimal as string | +**valueRub** | **String** | decimal as string | +**weight** | **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/doc/InstrumentDetail.md b/app/packages/api_client/doc/InstrumentDetail.md new file mode 100644 index 0000000..2e6b1bc --- /dev/null +++ b/app/packages/api_client/doc/InstrumentDetail.md @@ -0,0 +1,19 @@ +# fintracker_api.model.InstrumentDetail + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**List<EventOut>**](EventOut.md) | | +**holding** | [**HoldingOut**](HoldingOut.md) | | +**instrument** | [**InstrumentOut**](InstrumentOut.md) | | +**lots** | [**List<LotOut>**](LotOut.md) | | +**prices** | [**List<PricePoint>**](PricePoint.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/InstrumentOut.md b/app/packages/api_client/doc/InstrumentOut.md new file mode 100644 index 0000000..bdad265 --- /dev/null +++ b/app/packages/api_client/doc/InstrumentOut.md @@ -0,0 +1,31 @@ +# fintracker_api.model.InstrumentOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assetClass** | **String** | | +**board** | **String** | | +**country** | **String** | | +**currency** | **String** | | +**exchange** | **String** | | +**figi** | **String** | | +**id** | **int** | | +**isActive** | **bool** | | +**isin** | **String** | | +**issuer** | **String** | | +**lot** | **int** | | +**maturityDate** | [**DateTime**](DateTime.md) | | +**name** | **String** | | +**nominal** | **String** | decimal as string | +**nominalCurrency** | **String** | | +**sector** | **String** | | +**ticker** | **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/InstrumentsApi.md b/app/packages/api_client/doc/InstrumentsApi.md new file mode 100644 index 0000000..5190202 --- /dev/null +++ b/app/packages/api_client/doc/InstrumentsApi.md @@ -0,0 +1,109 @@ +# fintracker_api.api.InstrumentsApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**instrumentsGet**](InstrumentsApi.md#instrumentsget) | **GET** /api/v1/instruments/{instrument_id} | Get +[**instrumentsList**](InstrumentsApi.md#instrumentslist) | **GET** /api/v1/instruments | List + + +# **instrumentsGet** +> InstrumentDetail instrumentsGet(instrumentId, scope, pricesFrom) + +Get + +One instrument with its position, open lots, events and price history. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getInstrumentsApi(); +final int instrumentId = 56; // int | +final String scope = scope_example; // String | all | account: | portfolio: +final DateTime pricesFrom = 2013-10-20; // DateTime | + +try { + final response = api.instrumentsGet(instrumentId, scope, pricesFrom); + print(response); +} on DioException catch (e) { + print('Exception when calling InstrumentsApi->instrumentsGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instrumentId** | **int**| | + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **pricesFrom** | **DateTime**| | [optional] + +### Return type + +[**InstrumentDetail**](InstrumentDetail.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) + +# **instrumentsList** +> List instrumentsList(q, assetClass, heldOnly, limit) + +List + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getInstrumentsApi(); +final String q = q_example; // String | substring of ticker, name or ISIN +final String assetClass = assetClass_example; // String | share | bond | etf | fund | currency | index | … +final bool heldOnly = true; // bool | only instruments with an open lot +final int limit = 56; // int | + +try { + final response = api.instrumentsList(q, assetClass, heldOnly, limit); + print(response); +} on DioException catch (e) { + print('Exception when calling InstrumentsApi->instrumentsList: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **q** | **String**| substring of ticker, name or ISIN | [optional] + **assetClass** | **String**| share | bond | etf | fund | currency | index | … | [optional] + **heldOnly** | **bool**| only instruments with an open lot | [optional] [default to false] + **limit** | **int**| | [optional] [default to 100] + +### Return type + +[**List<InstrumentOut>**](InstrumentOut.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) + diff --git a/app/packages/api_client/doc/LotOut.md b/app/packages/api_client/doc/LotOut.md new file mode 100644 index 0000000..1688ac8 --- /dev/null +++ b/app/packages/api_client/doc/LotOut.md @@ -0,0 +1,23 @@ +# fintracker_api.model.LotOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | +**closedAt** | [**DateTime**](DateTime.md) | | +**costCurrency** | **String** | | +**costPerUnit** | **String** | decimal as string | +**costTotalRub** | **String** | decimal as string | +**id** | **int** | | +**openDate** | [**DateTime**](DateTime.md) | | +**qtyOpen** | **String** | decimal as string | +**qtyRemaining** | **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/doc/PricePoint.md b/app/packages/api_client/doc/PricePoint.md new file mode 100644 index 0000000..9f4459b --- /dev/null +++ b/app/packages/api_client/doc/PricePoint.md @@ -0,0 +1,18 @@ +# fintracker_api.model.PricePoint + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accruedInterest** | **String** | decimal as string | +**close** | **String** | decimal as string | +**currency** | **String** | | +**d** | [**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/ReturnsOut.md b/app/packages/api_client/doc/ReturnsOut.md new file mode 100644 index 0000000..bb2d2f1 --- /dev/null +++ b/app/packages/api_client/doc/ReturnsOut.md @@ -0,0 +1,25 @@ +# fintracker_api.model.ReturnsOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**absPnlRub** | **String** | decimal as string | +**dateFrom** | [**DateTime**](DateTime.md) | | +**dateTo** | [**DateTime**](DateTime.md) | | +**externalFlowRub** | **String** | decimal as string | +**period** | **String** | | +**twr** | **String** | decimal as string | +**twrAnnualized** | **String** | decimal as string | +**twrDaysSkipped** | **int** | | +**valueEndRub** | **String** | decimal as string | +**valueStartRub** | **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/doc/ScopeOut.md b/app/packages/api_client/doc/ScopeOut.md new file mode 100644 index 0000000..5c61a76 --- /dev/null +++ b/app/packages/api_client/doc/ScopeOut.md @@ -0,0 +1,17 @@ +# fintracker_api.model.ScopeOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountIds** | **List<int>** | | +**name** | **String** | | +**scope** | **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/SummaryOut.md b/app/packages/api_client/doc/SummaryOut.md new file mode 100644 index 0000000..c98cb83 --- /dev/null +++ b/app/packages/api_client/doc/SummaryOut.md @@ -0,0 +1,28 @@ +# fintracker_api.model.SummaryOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**cashRub** | **String** | decimal as string | +**computedAt** | [**DateTime**](DateTime.md) | | +**holdingCount** | **int** | | +**incomeRub** | **String** | decimal as string | +**investedNetRub** | **String** | decimal as string | +**marketValueRub** | **String** | decimal as string | +**pnlTotalRub** | **String** | decimal as string | +**realizedPnlRub** | **String** | decimal as string | +**returns** | [**List<ReturnsOut>**](ReturnsOut.md) | | +**scope** | **String** | | +**staleCount** | **int** | | +**totalRub** | **String** | decimal as string | +**unpricedCount** | **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/ValueDay.md b/app/packages/api_client/doc/ValueDay.md new file mode 100644 index 0000000..85e5cc0 --- /dev/null +++ b/app/packages/api_client/doc/ValueDay.md @@ -0,0 +1,25 @@ +# fintracker_api.model.ValueDay + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accruedInterestRub** | **String** | decimal as string | +**cashRub** | **String** | decimal as string | +**d** | [**DateTime**](DateTime.md) | | +**externalFlowRub** | **String** | decimal as string | +**investedNetRub** | **String** | decimal as string | +**marketValueRub** | **String** | decimal as string | +**missingFxCount** | **int** | | +**missingPriceCount** | **int** | | +**pnlTotalRub** | **String** | decimal as string | +**stalePriceCount** | **int** | | +**totalRub** | **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 4e76fd5..6a6fe21 100644 --- a/app/packages/api_client/lib/fintracker_api.dart +++ b/app/packages/api_client/lib/fintracker_api.dart @@ -10,10 +10,13 @@ export 'package:fintracker_api/src/auth/oauth.dart'; export 'package:fintracker_api/src/api/accounts_api.dart'; +export 'package:fintracker_api/src/api/analytics_api.dart'; export 'package:fintracker_api/src/api/auth_api.dart'; export 'package:fintracker_api/src/api/cashflow_api.dart'; export 'package:fintracker_api/src/api/categories_api.dart'; +export 'package:fintracker_api/src/api/events_api.dart'; export 'package:fintracker_api/src/api/health_api.dart'; +export 'package:fintracker_api/src/api/instruments_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/rules_api.dart'; @@ -25,20 +28,32 @@ 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'; export 'package:fintracker_api/src/model/account_role.dart'; +export 'package:fintracker_api/src/model/allocation_bucket.dart'; +export 'package:fintracker_api/src/model/allocation_dimension.dart'; export 'package:fintracker_api/src/model/broker.dart'; export 'package:fintracker_api/src/model/cash_flow_month.dart'; export 'package:fintracker_api/src/model/category_out.dart'; export 'package:fintracker_api/src/model/data_quality_row.dart'; +export 'package:fintracker_api/src/model/event_kind.dart'; +export 'package:fintracker_api/src/model/event_out.dart'; +export 'package:fintracker_api/src/model/event_page.dart'; export 'package:fintracker_api/src/model/event_source.dart'; +export 'package:fintracker_api/src/model/event_status.dart'; export 'package:fintracker_api/src/model/flow_type.dart'; export 'package:fintracker_api/src/model/health.dart'; +export 'package:fintracker_api/src/model/holding_out.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/job_status.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/net_worth_breakdown.dart'; export 'package:fintracker_api/src/model/net_worth_day.dart'; +export 'package:fintracker_api/src/model/price_point.dart'; export 'package:fintracker_api/src/model/problem.dart'; export 'package:fintracker_api/src/model/refresh_log_out.dart'; export 'package:fintracker_api/src/model/refresh_request.dart'; +export 'package:fintracker_api/src/model/returns_out.dart'; export 'package:fintracker_api/src/model/rule_create.dart'; export 'package:fintracker_api/src/model/rule_kind.dart'; export 'package:fintracker_api/src/model/rule_match_type.dart'; @@ -46,12 +61,15 @@ export 'package:fintracker_api/src/model/rule_out.dart'; 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/scope_out.dart'; export 'package:fintracker_api/src/model/source_status.dart'; export 'package:fintracker_api/src/model/spending_row.dart'; +export 'package:fintracker_api/src/model/summary_out.dart'; export 'package:fintracker_api/src/model/sync_job_out.dart'; export 'package:fintracker_api/src/model/sync_run_out.dart'; export 'package:fintracker_api/src/model/token_pair.dart'; export 'package:fintracker_api/src/model/transaction_out.dart'; export 'package:fintracker_api/src/model/transaction_page.dart'; export 'package:fintracker_api/src/model/user_out.dart'; +export 'package:fintracker_api/src/model/value_day.dart'; diff --git a/app/packages/api_client/lib/src/api.dart b/app/packages/api_client/lib/src/api.dart index 4f1e7e1..6b15661 100644 --- a/app/packages/api_client/lib/src/api.dart +++ b/app/packages/api_client/lib/src/api.dart @@ -8,10 +8,13 @@ import 'package:fintracker_api/src/auth/basic_auth.dart'; import 'package:fintracker_api/src/auth/bearer_auth.dart'; import 'package:fintracker_api/src/auth/oauth.dart'; import 'package:fintracker_api/src/api/accounts_api.dart'; +import 'package:fintracker_api/src/api/analytics_api.dart'; import 'package:fintracker_api/src/api/auth_api.dart'; import 'package:fintracker_api/src/api/cashflow_api.dart'; import 'package:fintracker_api/src/api/categories_api.dart'; +import 'package:fintracker_api/src/api/events_api.dart'; import 'package:fintracker_api/src/api/health_api.dart'; +import 'package:fintracker_api/src/api/instruments_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/rules_api.dart'; @@ -115,6 +118,12 @@ class FintrackerApi { return AccountsApi(dio); } + /// Get AnalyticsApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + AnalyticsApi getAnalyticsApi() { + return AnalyticsApi(dio); + } + /// Get AuthApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed AuthApi getAuthApi() { @@ -133,12 +142,24 @@ class FintrackerApi { return CategoriesApi(dio); } + /// Get EventsApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + EventsApi getEventsApi() { + return EventsApi(dio); + } + /// Get HealthApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed HealthApi getHealthApi() { return HealthApi(dio); } + /// Get InstrumentsApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + InstrumentsApi getInstrumentsApi() { + return InstrumentsApi(dio); + } + /// Get MetricsApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed MetricsApi getMetricsApi() { diff --git a/app/packages/api_client/lib/src/api/analytics_api.dart b/app/packages/api_client/lib/src/api/analytics_api.dart new file mode 100644 index 0000000..c6b17ee --- /dev/null +++ b/app/packages/api_client/lib/src/api/analytics_api.dart @@ -0,0 +1,527 @@ +// +// 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/allocation_bucket.dart'; +import 'package:fintracker_api/src/model/allocation_dimension.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_out.dart'; +import 'package:fintracker_api/src/model/summary_out.dart'; +import 'package:fintracker_api/src/model/value_day.dart'; + +class AnalyticsApi { + + final Dio _dio; + + const AnalyticsApi(this._dio); + + /// Allocation + /// Buckets of one dimension (or all four), largest first. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [dimension] + /// * [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>> analyticsAllocation({ + String? scope = 'all', + AllocationDimension? dimension, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/allocation'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (scope != null) r'scope': scope, + if (dimension != null) r'dimension': dimension, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, AllocationBucket>(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, + ); + } + + /// Holdings + /// Open positions, most valuable first; unpriced ones last with null values. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [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>> analyticsHoldings({ + String? scope = 'all', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/holdings'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (scope != null) r'scope': scope, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, HoldingOut>(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. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [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>> analyticsReturns({ + String? scope = 'all', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/returns'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (scope != null) r'scope': scope, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, ReturnsOut>(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, + ); + } + + /// Scopes + /// Every set of accounts the metrics were built for. + /// + /// 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>> analyticsScopes({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/scopes'; + 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, ScopeOut>(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, + ); + } + + /// Summary + /// One screen's worth: the latest day, the totals it adds up to, and the returns. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [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 [SummaryOut] as data + /// Throws [DioException] if API call or serialization fails + Future> analyticsSummary({ + String? scope = 'all', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/summary'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (scope != null) r'scope': scope, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + SummaryOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'SummaryOut', 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, + ); + } + + /// Value Series + /// Daily portfolio value; defaults to the last 365 days. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [from] + /// * [to] + /// * [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>> analyticsValueSeries({ + String? scope = 'all', + DateTime? from, + DateTime? to, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/value-series'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (scope != null) r'scope': scope, + if (from != null) r'from': from, + if (to != null) r'to': to, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, ValueDay>(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, + ); + } + +} diff --git a/app/packages/api_client/lib/src/api/events_api.dart b/app/packages/api_client/lib/src/api/events_api.dart new file mode 100644 index 0000000..25b595f --- /dev/null +++ b/app/packages/api_client/lib/src/api/events_api.dart @@ -0,0 +1,133 @@ +// +// 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/event_kind.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/problem.dart'; + +class EventsApi { + + final Dio _dio; + + const EventsApi(this._dio); + + /// List + /// One page of ledger events, newest first, with RUB amounts at each own date's rate. + /// + /// Parameters: + /// * [from] + /// * [to] + /// * [accountId] + /// * [instrumentId] + /// * [kind] + /// * [status] + /// * [externalFlow] - only the events XIRR reads as boundary flows + /// * [q] - substring of description or ticker + /// * [page] + /// * [pageSize] + /// * [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 [EventPage] as data + /// Throws [DioException] if API call or serialization fails + Future> eventsList({ + DateTime? from, + DateTime? to, + int? accountId, + int? instrumentId, + EventKind? kind, + EventStatus? status, + bool? externalFlow, + String? q, + int? page = 1, + int? pageSize = 50, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/events'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (from != null) r'from': from, + if (to != null) r'to': to, + if (accountId != null) r'account_id': accountId, + if (instrumentId != null) r'instrument_id': instrumentId, + if (kind != null) r'kind': kind, + if (status != null) r'status': status, + if (externalFlow != null) r'external_flow': externalFlow, + if (q != null) r'q': q, + if (page != null) r'page': page, + if (pageSize != null) r'page_size': pageSize, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + EventPage? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'EventPage', 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/api/instruments_api.dart b/app/packages/api_client/lib/src/api/instruments_api.dart new file mode 100644 index 0000000..b4efec9 --- /dev/null +++ b/app/packages/api_client/lib/src/api/instruments_api.dart @@ -0,0 +1,202 @@ +// +// 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/instrument_detail.dart'; +import 'package:fintracker_api/src/model/instrument_out.dart'; +import 'package:fintracker_api/src/model/problem.dart'; + +class InstrumentsApi { + + final Dio _dio; + + const InstrumentsApi(this._dio); + + /// Get + /// One instrument with its position, open lots, events and price history. + /// + /// Parameters: + /// * [instrumentId] + /// * [scope] - all | account: | portfolio: + /// * [pricesFrom] + /// * [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 [InstrumentDetail] as data + /// Throws [DioException] if API call or serialization fails + Future> instrumentsGet({ + required int instrumentId, + String? scope = 'all', + DateTime? pricesFrom, + 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'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (scope != null) r'scope': scope, + if (pricesFrom != null) r'prices_from': pricesFrom, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + InstrumentDetail? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'InstrumentDetail', 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 + /// + /// + /// Parameters: + /// * [q] - substring of ticker, name or ISIN + /// * [assetClass] - share | bond | etf | fund | currency | index | … + /// * [heldOnly] - only instruments with an open lot + /// * [limit] + /// * [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>> instrumentsList({ + String? q, + String? assetClass, + bool? heldOnly = false, + int? limit = 100, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/instruments'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (q != null) r'q': q, + if (assetClass != null) r'asset_class': assetClass, + if (heldOnly != null) r'held_only': heldOnly, + if (limit != null) r'limit': limit, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + List? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize, InstrumentOut>(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, + ); + } + +} diff --git a/app/packages/api_client/lib/src/deserialize.dart b/app/packages/api_client/lib/src/deserialize.dart index cd2f9b2..c2c64d7 100644 --- a/app/packages/api_client/lib/src/deserialize.dart +++ b/app/packages/api_client/lib/src/deserialize.dart @@ -1,28 +1,40 @@ import 'package:fintracker_api/src/model/account_balance.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/allocation_bucket.dart'; import 'package:fintracker_api/src/model/cash_flow_month.dart'; import 'package:fintracker_api/src/model/category_out.dart'; import 'package:fintracker_api/src/model/data_quality_row.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/health.dart'; +import 'package:fintracker_api/src/model/holding_out.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/login_request.dart'; +import 'package:fintracker_api/src/model/lot_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/price_point.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/refresh_request.dart'; +import 'package:fintracker_api/src/model/returns_out.dart'; import 'package:fintracker_api/src/model/rule_create.dart'; 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/scope_out.dart'; import 'package:fintracker_api/src/model/source_status.dart'; import 'package:fintracker_api/src/model/spending_row.dart'; +import 'package:fintracker_api/src/model/summary_out.dart'; import 'package:fintracker_api/src/model/sync_job_out.dart'; import 'package:fintracker_api/src/model/sync_run_out.dart'; import 'package:fintracker_api/src/model/token_pair.dart'; import 'package:fintracker_api/src/model/transaction_out.dart'; import 'package:fintracker_api/src/model/transaction_page.dart'; import 'package:fintracker_api/src/model/user_out.dart'; +import 'package:fintracker_api/src/model/value_day.dart'; final _regList = RegExp(r'^List<(.*)>$'); final _regSet = RegExp(r'^Set<(.*)>$'); @@ -54,6 +66,11 @@ final _regMap = RegExp(r'^Map$'); case 'AccountRole': + case 'AllocationBucket': + return AllocationBucket.fromJson(value as Map) as ReturnType; + case 'AllocationDimension': + + case 'Broker': @@ -63,29 +80,51 @@ final _regMap = RegExp(r'^Map$'); return CategoryOut.fromJson(value as Map) as ReturnType; case 'DataQualityRow': return DataQualityRow.fromJson(value as Map) as ReturnType; + case 'EventKind': + + + case 'EventOut': + return EventOut.fromJson(value as Map) as ReturnType; + case 'EventPage': + return EventPage.fromJson(value as Map) as ReturnType; case 'EventSource': + case 'EventStatus': + + case 'FlowType': case 'Health': return Health.fromJson(value as Map) as ReturnType; + case 'HoldingOut': + return HoldingOut.fromJson(value as Map) as ReturnType; + case 'InstrumentDetail': + return InstrumentDetail.fromJson(value as Map) as ReturnType; + case 'InstrumentOut': + return InstrumentOut.fromJson(value as Map) as ReturnType; case 'JobStatus': case 'LoginRequest': return LoginRequest.fromJson(value as Map) as ReturnType; + case 'LotOut': + return LotOut.fromJson(value as Map) as ReturnType; case 'NetWorthBreakdown': return NetWorthBreakdown.fromJson(value as Map) as ReturnType; case 'NetWorthDay': return NetWorthDay.fromJson(value as Map) as ReturnType; + case 'PricePoint': + return PricePoint.fromJson(value as Map) as ReturnType; case 'Problem': return Problem.fromJson(value as Map) as ReturnType; case 'RefreshLogOut': return RefreshLogOut.fromJson(value as Map) as ReturnType; case 'RefreshRequest': return RefreshRequest.fromJson(value as Map) as ReturnType; + case 'ReturnsOut': + return ReturnsOut.fromJson(value as Map) as ReturnType; case 'RuleCreate': return RuleCreate.fromJson(value as Map) as ReturnType; case 'RuleKind': @@ -103,10 +142,14 @@ final _regMap = RegExp(r'^Map$'); case 'RunwayOut': return RunwayOut.fromJson(value as Map) as ReturnType; + case 'ScopeOut': + return ScopeOut.fromJson(value as Map) as ReturnType; case 'SourceStatus': return SourceStatus.fromJson(value as Map) as ReturnType; case 'SpendingRow': return SpendingRow.fromJson(value as Map) as ReturnType; + case 'SummaryOut': + return SummaryOut.fromJson(value as Map) as ReturnType; case 'SyncJobOut': return SyncJobOut.fromJson(value as Map) as ReturnType; case 'SyncRunOut': @@ -119,6 +162,8 @@ final _regMap = RegExp(r'^Map$'); return TransactionPage.fromJson(value as Map) as ReturnType; case 'UserOut': return UserOut.fromJson(value as Map) as ReturnType; + case 'ValueDay': + return ValueDay.fromJson(value as Map) as ReturnType; default: RegExpMatch? match; diff --git a/app/packages/api_client/lib/src/model/allocation_bucket.dart b/app/packages/api_client/lib/src/model/allocation_bucket.dart new file mode 100644 index 0000000..4d47f59 --- /dev/null +++ b/app/packages/api_client/lib/src/model/allocation_bucket.dart @@ -0,0 +1,126 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/allocation_dimension.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'allocation_bucket.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AllocationBucket { + /// Returns a new [AllocationBucket] instance. + AllocationBucket({ + + required this.bucket, + + required this.dimension, + + required this.holdingCount, + + required this.valueRub, + + required this.weight, + }); + + @JsonKey( + + name: r'bucket', + required: true, + includeIfNull: false, + ) + + + final String bucket; + + + + @JsonKey( + + name: r'dimension', + required: true, + includeIfNull: false, + unknownEnumValue: AllocationDimension.unknownDefaultOpenApi, + ) + + + final AllocationDimension dimension; + + + + @JsonKey( + + name: r'holding_count', + required: true, + includeIfNull: false, + ) + + + final int holdingCount; + + + + /// decimal as string + @JsonKey( + + name: r'value_rub', + required: true, + includeIfNull: false, + ) + + + final String valueRub; + + + + /// decimal as string + @JsonKey( + + name: r'weight', + required: true, + includeIfNull: false, + ) + + + final String weight; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AllocationBucket && + other.bucket == bucket && + other.dimension == dimension && + other.holdingCount == holdingCount && + other.valueRub == valueRub && + other.weight == weight; + + @override + int get hashCode => + bucket.hashCode + + dimension.hashCode + + holdingCount.hashCode + + valueRub.hashCode + + weight.hashCode; + + factory AllocationBucket.fromJson(Map json) => _$AllocationBucketFromJson(json); + + Map toJson() => _$AllocationBucketToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/allocation_bucket.g.dart b/app/packages/api_client/lib/src/model/allocation_bucket.g.dart new file mode 100644 index 0000000..3dbe45b --- /dev/null +++ b/app/packages/api_client/lib/src/model/allocation_bucket.g.dart @@ -0,0 +1,157 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'allocation_bucket.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$AllocationBucketCWProxy { + AllocationBucket bucket(String bucket); + + AllocationBucket dimension(AllocationDimension dimension); + + AllocationBucket holdingCount(int holdingCount); + + AllocationBucket valueRub(String valueRub); + + AllocationBucket weight(String weight); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AllocationBucket(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// AllocationBucket(...).copyWith(id: 12, name: "My name") + /// ```` + AllocationBucket call({ + String bucket, + AllocationDimension dimension, + int holdingCount, + String valueRub, + String weight, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAllocationBucket.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAllocationBucket.copyWith.fieldName(...)` +class _$AllocationBucketCWProxyImpl implements _$AllocationBucketCWProxy { + const _$AllocationBucketCWProxyImpl(this._value); + + final AllocationBucket _value; + + @override + AllocationBucket bucket(String bucket) => this(bucket: bucket); + + @override + AllocationBucket dimension(AllocationDimension dimension) => + this(dimension: dimension); + + @override + AllocationBucket holdingCount(int holdingCount) => + this(holdingCount: holdingCount); + + @override + AllocationBucket valueRub(String valueRub) => this(valueRub: valueRub); + + @override + AllocationBucket weight(String weight) => this(weight: weight); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AllocationBucket(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// AllocationBucket(...).copyWith(id: 12, name: "My name") + /// ```` + AllocationBucket call({ + Object? bucket = const $CopyWithPlaceholder(), + Object? dimension = const $CopyWithPlaceholder(), + Object? holdingCount = const $CopyWithPlaceholder(), + Object? valueRub = const $CopyWithPlaceholder(), + Object? weight = const $CopyWithPlaceholder(), + }) { + return AllocationBucket( + bucket: bucket == const $CopyWithPlaceholder() + ? _value.bucket + // ignore: cast_nullable_to_non_nullable + : bucket as String, + dimension: dimension == const $CopyWithPlaceholder() + ? _value.dimension + // ignore: cast_nullable_to_non_nullable + : dimension as AllocationDimension, + holdingCount: holdingCount == const $CopyWithPlaceholder() + ? _value.holdingCount + // ignore: cast_nullable_to_non_nullable + : holdingCount as int, + valueRub: valueRub == const $CopyWithPlaceholder() + ? _value.valueRub + // ignore: cast_nullable_to_non_nullable + : valueRub as String, + weight: weight == const $CopyWithPlaceholder() + ? _value.weight + // ignore: cast_nullable_to_non_nullable + : weight as String, + ); + } +} + +extension $AllocationBucketCopyWith on AllocationBucket { + /// Returns a callable class that can be used as follows: `instanceOfAllocationBucket.copyWith(...)` or like so:`instanceOfAllocationBucket.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$AllocationBucketCWProxy get copyWith => _$AllocationBucketCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AllocationBucket _$AllocationBucketFromJson( + Map json, +) => $checkedCreate( + 'AllocationBucket', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'bucket', + 'dimension', + 'holding_count', + 'value_rub', + 'weight', + ], + ); + final val = AllocationBucket( + bucket: $checkedConvert('bucket', (v) => v as String), + dimension: $checkedConvert( + 'dimension', + (v) => $enumDecode( + _$AllocationDimensionEnumMap, + v, + unknownValue: AllocationDimension.unknownDefaultOpenApi, + ), + ), + holdingCount: $checkedConvert('holding_count', (v) => (v as num).toInt()), + valueRub: $checkedConvert('value_rub', (v) => v as String), + weight: $checkedConvert('weight', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const {'holdingCount': 'holding_count', 'valueRub': 'value_rub'}, +); + +Map _$AllocationBucketToJson(AllocationBucket instance) => + { + 'bucket': instance.bucket, + 'dimension': _$AllocationDimensionEnumMap[instance.dimension]!, + 'holding_count': instance.holdingCount, + 'value_rub': instance.valueRub, + 'weight': instance.weight, + }; + +const _$AllocationDimensionEnumMap = { + AllocationDimension.assetClass: 'asset_class', + AllocationDimension.sector: 'sector', + AllocationDimension.country: 'country', + AllocationDimension.currency: 'currency', + AllocationDimension.unknownDefaultOpenApi: 'unknown_default_open_api', +}; diff --git a/app/packages/api_client/lib/src/model/allocation_dimension.dart b/app/packages/api_client/lib/src/model/allocation_dimension.dart new file mode 100644 index 0000000..3e40725 --- /dev/null +++ b/app/packages/api_client/lib/src/model/allocation_dimension.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +/// How a portfolio can be sliced. Every dimension covers the SAME total — securities plus cash — so the weights of any one of them add up to 1 and the charts agree. +enum AllocationDimension { + @JsonValue(r'asset_class') + assetClass(r'asset_class'), + @JsonValue(r'sector') + sector(r'sector'), + @JsonValue(r'country') + country(r'country'), + @JsonValue(r'currency') + currency(r'currency'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); + + const AllocationDimension(this.value); + + final String value; + + @override + String toString() => value; +} diff --git a/app/packages/api_client/lib/src/model/event_kind.dart b/app/packages/api_client/lib/src/model/event_kind.dart new file mode 100644 index 0000000..313297e --- /dev/null +++ b/app/packages/api_client/lib/src/model/event_kind.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum EventKind { + @JsonValue(r'buy') + buy(r'buy'), + @JsonValue(r'sell') + sell(r'sell'), + @JsonValue(r'dividend') + dividend(r'dividend'), + @JsonValue(r'coupon') + coupon(r'coupon'), + @JsonValue(r'interest') + interest(r'interest'), + @JsonValue(r'tax') + tax(r'tax'), + @JsonValue(r'tax_refund') + taxRefund(r'tax_refund'), + @JsonValue(r'commission') + commission(r'commission'), + @JsonValue(r'deposit') + deposit(r'deposit'), + @JsonValue(r'withdrawal') + withdrawal(r'withdrawal'), + @JsonValue(r'transfer_in') + transferIn(r'transfer_in'), + @JsonValue(r'transfer_out') + transferOut(r'transfer_out'), + @JsonValue(r'split') + split(r'split'), + @JsonValue(r'amortization') + amortization(r'amortization'), + @JsonValue(r'repayment') + repayment(r'repayment'), + @JsonValue(r'fx_exchange') + fxExchange(r'fx_exchange'), + @JsonValue(r'other') + other(r'other'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); + + const EventKind(this.value); + + final String value; + + @override + String toString() => value; +} diff --git a/app/packages/api_client/lib/src/model/event_out.dart b/app/packages/api_client/lib/src/model/event_out.dart new file mode 100644 index 0000000..711ac46 --- /dev/null +++ b/app/packages/api_client/lib/src/model/event_out.dart @@ -0,0 +1,357 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/event_status.dart'; +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 'event_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EventOut { + /// Returns a new [EventOut] instance. + EventOut({ + + required this.accountId, + + required this.accruedInterest, + + required this.amount, + + required this.amountRub, + + required this.currency, + + required this.description, + + required this.externalFlow, + + required this.fee, + + required this.id, + + required this.instrumentId, + + required this.kind, + + required this.price, + + required this.priceCurrency, + + required this.quantity, + + required this.status, + + required this.tax, + + required this.ticker, + + required this.tradeDate, + + required this.ts, + }); + + @JsonKey( + + name: r'account_id', + required: true, + includeIfNull: false, + ) + + + final int accountId; + + + + /// decimal as string + @JsonKey( + + name: r'accrued_interest', + required: true, + includeIfNull: true, + ) + + + final String? accruedInterest; + + + + /// decimal as string + @JsonKey( + + name: r'amount', + required: true, + includeIfNull: false, + ) + + + final String amount; + + + + /// decimal as string + @JsonKey( + + name: r'amount_rub', + required: true, + includeIfNull: true, + ) + + + final String? amountRub; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'description', + required: true, + includeIfNull: true, + ) + + + final String? description; + + + + @JsonKey( + + name: r'external_flow', + required: true, + includeIfNull: false, + ) + + + final bool externalFlow; + + + + /// decimal as string + @JsonKey( + + name: r'fee', + required: true, + includeIfNull: true, + ) + + + final String? fee; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: true, + ) + + + 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: true, + includeIfNull: true, + ) + + + final String? price; + + + + @JsonKey( + + name: r'price_currency', + required: true, + includeIfNull: true, + ) + + + final String? priceCurrency; + + + + /// decimal as string + @JsonKey( + + name: r'quantity', + required: true, + includeIfNull: true, + ) + + + final String? quantity; + + + + @JsonKey( + + name: r'status', + required: true, + includeIfNull: false, + unknownEnumValue: EventStatus.unknownDefaultOpenApi, + ) + + + final EventStatus status; + + + + /// decimal as string + @JsonKey( + + name: r'tax', + required: true, + includeIfNull: true, + ) + + + final String? tax; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: true, + ) + + + final String? ticker; + + + + @JsonKey( + + name: r'trade_date', + required: true, + includeIfNull: false, + ) + + + final DateTime tradeDate; + + + + @JsonKey( + + name: r'ts', + required: true, + includeIfNull: false, + ) + + + final DateTime ts; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EventOut && + other.accountId == accountId && + other.accruedInterest == accruedInterest && + other.amount == amount && + other.amountRub == amountRub && + other.currency == currency && + other.description == description && + other.externalFlow == externalFlow && + other.fee == fee && + other.id == id && + other.instrumentId == instrumentId && + other.kind == kind && + other.price == price && + other.priceCurrency == priceCurrency && + other.quantity == quantity && + other.status == status && + other.tax == tax && + other.ticker == ticker && + other.tradeDate == tradeDate && + other.ts == ts; + + @override + int get hashCode => + accountId.hashCode + + (accruedInterest == null ? 0 : accruedInterest.hashCode) + + amount.hashCode + + (amountRub == null ? 0 : amountRub.hashCode) + + currency.hashCode + + (description == null ? 0 : description.hashCode) + + externalFlow.hashCode + + (fee == null ? 0 : fee.hashCode) + + id.hashCode + + (instrumentId == null ? 0 : instrumentId.hashCode) + + kind.hashCode + + (price == null ? 0 : price.hashCode) + + (priceCurrency == null ? 0 : priceCurrency.hashCode) + + (quantity == null ? 0 : quantity.hashCode) + + status.hashCode + + (tax == null ? 0 : tax.hashCode) + + (ticker == null ? 0 : ticker.hashCode) + + tradeDate.hashCode + + ts.hashCode; + + factory EventOut.fromJson(Map json) => _$EventOutFromJson(json); + + Map toJson() => _$EventOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + 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 new file mode 100644 index 0000000..2a7bb43 --- /dev/null +++ b/app/packages/api_client/lib/src/model/event_out.g.dart @@ -0,0 +1,392 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'event_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$EventOutCWProxy { + EventOut accountId(int accountId); + + EventOut accruedInterest(String? accruedInterest); + + EventOut amount(String amount); + + EventOut amountRub(String? amountRub); + + EventOut currency(String currency); + + EventOut description(String? description); + + EventOut externalFlow(bool externalFlow); + + EventOut fee(String? fee); + + EventOut id(int id); + + EventOut instrumentId(int? instrumentId); + + EventOut kind(EventKind kind); + + EventOut price(String? price); + + EventOut priceCurrency(String? priceCurrency); + + EventOut quantity(String? quantity); + + EventOut status(EventStatus status); + + EventOut tax(String? tax); + + EventOut ticker(String? ticker); + + EventOut tradeDate(DateTime tradeDate); + + EventOut ts(DateTime ts); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// EventOut(...).copyWith(id: 12, name: "My name") + /// ```` + EventOut call({ + int accountId, + String? accruedInterest, + String amount, + String? amountRub, + String currency, + String? description, + bool externalFlow, + String? fee, + int id, + int? instrumentId, + EventKind kind, + String? price, + String? priceCurrency, + String? quantity, + EventStatus status, + String? tax, + String? ticker, + DateTime tradeDate, + DateTime ts, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfEventOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfEventOut.copyWith.fieldName(...)` +class _$EventOutCWProxyImpl implements _$EventOutCWProxy { + const _$EventOutCWProxyImpl(this._value); + + final EventOut _value; + + @override + EventOut accountId(int accountId) => this(accountId: accountId); + + @override + EventOut accruedInterest(String? accruedInterest) => + this(accruedInterest: accruedInterest); + + @override + EventOut amount(String amount) => this(amount: amount); + + @override + EventOut amountRub(String? amountRub) => this(amountRub: amountRub); + + @override + EventOut currency(String currency) => this(currency: currency); + + @override + EventOut description(String? description) => this(description: description); + + @override + EventOut externalFlow(bool externalFlow) => this(externalFlow: externalFlow); + + @override + EventOut fee(String? fee) => this(fee: fee); + + @override + EventOut id(int id) => this(id: id); + + @override + EventOut instrumentId(int? instrumentId) => this(instrumentId: instrumentId); + + @override + EventOut kind(EventKind kind) => this(kind: kind); + + @override + EventOut price(String? price) => this(price: price); + + @override + EventOut priceCurrency(String? priceCurrency) => + this(priceCurrency: priceCurrency); + + @override + EventOut quantity(String? quantity) => this(quantity: quantity); + + @override + EventOut status(EventStatus status) => this(status: status); + + @override + EventOut tax(String? tax) => this(tax: tax); + + @override + EventOut ticker(String? ticker) => this(ticker: ticker); + + @override + EventOut tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate); + + @override + EventOut ts(DateTime ts) => this(ts: ts); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// EventOut(...).copyWith(id: 12, name: "My name") + /// ```` + EventOut call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? accruedInterest = const $CopyWithPlaceholder(), + Object? amount = const $CopyWithPlaceholder(), + Object? amountRub = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? description = const $CopyWithPlaceholder(), + Object? externalFlow = const $CopyWithPlaceholder(), + Object? fee = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? price = const $CopyWithPlaceholder(), + Object? priceCurrency = const $CopyWithPlaceholder(), + Object? quantity = const $CopyWithPlaceholder(), + Object? status = const $CopyWithPlaceholder(), + Object? tax = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + Object? tradeDate = const $CopyWithPlaceholder(), + Object? ts = const $CopyWithPlaceholder(), + }) { + return EventOut( + 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, + amountRub: amountRub == const $CopyWithPlaceholder() + ? _value.amountRub + // ignore: cast_nullable_to_non_nullable + : amountRub 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?, + externalFlow: externalFlow == const $CopyWithPlaceholder() + ? _value.externalFlow + // ignore: cast_nullable_to_non_nullable + : externalFlow as bool, + fee: fee == const $CopyWithPlaceholder() + ? _value.fee + // ignore: cast_nullable_to_non_nullable + : fee as String?, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + 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?, + priceCurrency: priceCurrency == const $CopyWithPlaceholder() + ? _value.priceCurrency + // ignore: cast_nullable_to_non_nullable + : priceCurrency as String?, + quantity: quantity == const $CopyWithPlaceholder() + ? _value.quantity + // ignore: cast_nullable_to_non_nullable + : quantity as String?, + status: status == const $CopyWithPlaceholder() + ? _value.status + // ignore: cast_nullable_to_non_nullable + : status as EventStatus, + tax: tax == const $CopyWithPlaceholder() + ? _value.tax + // ignore: cast_nullable_to_non_nullable + : tax as String?, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + tradeDate: tradeDate == const $CopyWithPlaceholder() + ? _value.tradeDate + // ignore: cast_nullable_to_non_nullable + : tradeDate as DateTime, + ts: ts == const $CopyWithPlaceholder() + ? _value.ts + // ignore: cast_nullable_to_non_nullable + : ts as DateTime, + ); + } +} + +extension $EventOutCopyWith on EventOut { + /// Returns a callable class that can be used as follows: `instanceOfEventOut.copyWith(...)` or like so:`instanceOfEventOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$EventOutCWProxy get copyWith => _$EventOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +EventOut _$EventOutFromJson(Map json) => $checkedCreate( + 'EventOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'account_id', + 'accrued_interest', + 'amount', + 'amount_rub', + 'currency', + 'description', + 'external_flow', + 'fee', + 'id', + 'instrument_id', + 'kind', + 'price', + 'price_currency', + 'quantity', + 'status', + 'tax', + 'ticker', + 'trade_date', + 'ts', + ], + ); + final val = EventOut( + accountId: $checkedConvert('account_id', (v) => (v as num).toInt()), + accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?), + amount: $checkedConvert('amount', (v) => v as String), + amountRub: $checkedConvert('amount_rub', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String), + description: $checkedConvert('description', (v) => v as String?), + externalFlow: $checkedConvert('external_flow', (v) => v as bool), + fee: $checkedConvert('fee', (v) => v as String?), + id: $checkedConvert('id', (v) => (v as num).toInt()), + 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?), + priceCurrency: $checkedConvert('price_currency', (v) => v as String?), + quantity: $checkedConvert('quantity', (v) => v as String?), + status: $checkedConvert( + 'status', + (v) => $enumDecode( + _$EventStatusEnumMap, + v, + unknownValue: EventStatus.unknownDefaultOpenApi, + ), + ), + tax: $checkedConvert('tax', (v) => v as String?), + ticker: $checkedConvert('ticker', (v) => v as String?), + tradeDate: $checkedConvert( + 'trade_date', + (v) => DateTime.parse(v as String), + ), + ts: $checkedConvert('ts', (v) => DateTime.parse(v as String)), + ); + return val; + }, + fieldKeyMap: const { + 'accountId': 'account_id', + 'accruedInterest': 'accrued_interest', + 'amountRub': 'amount_rub', + 'externalFlow': 'external_flow', + 'instrumentId': 'instrument_id', + 'priceCurrency': 'price_currency', + 'tradeDate': 'trade_date', + }, +); + +Map _$EventOutToJson(EventOut instance) => { + 'account_id': instance.accountId, + 'accrued_interest': instance.accruedInterest, + 'amount': instance.amount, + 'amount_rub': instance.amountRub, + 'currency': instance.currency, + 'description': instance.description, + 'external_flow': instance.externalFlow, + 'fee': instance.fee, + 'id': instance.id, + 'instrument_id': instance.instrumentId, + 'kind': _$EventKindEnumMap[instance.kind]!, + 'price': instance.price, + 'price_currency': instance.priceCurrency, + 'quantity': instance.quantity, + 'status': _$EventStatusEnumMap[instance.status]!, + 'tax': instance.tax, + 'ticker': instance.ticker, + 'trade_date': instance.tradeDate.toIso8601String(), + 'ts': instance.ts.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', +}; + +const _$EventStatusEnumMap = { + EventStatus.confirmed: 'confirmed', + EventStatus.pending: 'pending', + EventStatus.shadow: 'shadow', + EventStatus.ignored: 'ignored', + EventStatus.unknownDefaultOpenApi: 'unknown_default_open_api', +}; diff --git a/app/packages/api_client/lib/src/model/event_page.dart b/app/packages/api_client/lib/src/model/event_page.dart new file mode 100644 index 0000000..f2521eb --- /dev/null +++ b/app/packages/api_client/lib/src/model/event_page.dart @@ -0,0 +1,107 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/event_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'event_page.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class EventPage { + /// Returns a new [EventPage] instance. + EventPage({ + + required this.items, + + required this.page, + + required this.pageSize, + + required this.total, + }); + + @JsonKey( + + name: r'items', + required: true, + includeIfNull: false, + ) + + + final List items; + + + + @JsonKey( + + name: r'page', + required: true, + includeIfNull: false, + ) + + + final int page; + + + + @JsonKey( + + name: r'page_size', + required: true, + includeIfNull: false, + ) + + + final int pageSize; + + + + @JsonKey( + + name: r'total', + required: true, + includeIfNull: false, + ) + + + final int total; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is EventPage && + other.items == items && + other.page == page && + other.pageSize == pageSize && + other.total == total; + + @override + int get hashCode => + items.hashCode + + page.hashCode + + pageSize.hashCode + + total.hashCode; + + factory EventPage.fromJson(Map json) => _$EventPageFromJson(json); + + Map toJson() => _$EventPageToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/event_page.g.dart b/app/packages/api_client/lib/src/model/event_page.g.dart new file mode 100644 index 0000000..5a863b5 --- /dev/null +++ b/app/packages/api_client/lib/src/model/event_page.g.dart @@ -0,0 +1,114 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'event_page.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$EventPageCWProxy { + EventPage items(List items); + + EventPage page(int page); + + EventPage pageSize(int pageSize); + + EventPage total(int total); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// EventPage(...).copyWith(id: 12, name: "My name") + /// ```` + EventPage call({List items, int page, int pageSize, int total}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfEventPage.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfEventPage.copyWith.fieldName(...)` +class _$EventPageCWProxyImpl implements _$EventPageCWProxy { + const _$EventPageCWProxyImpl(this._value); + + final EventPage _value; + + @override + EventPage items(List items) => this(items: items); + + @override + EventPage page(int page) => this(page: page); + + @override + EventPage pageSize(int pageSize) => this(pageSize: pageSize); + + @override + EventPage total(int total) => this(total: total); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// EventPage(...).copyWith(id: 12, name: "My name") + /// ```` + EventPage call({ + Object? items = const $CopyWithPlaceholder(), + Object? page = const $CopyWithPlaceholder(), + Object? pageSize = const $CopyWithPlaceholder(), + Object? total = const $CopyWithPlaceholder(), + }) { + return EventPage( + items: items == const $CopyWithPlaceholder() + ? _value.items + // ignore: cast_nullable_to_non_nullable + : items as List, + page: page == const $CopyWithPlaceholder() + ? _value.page + // ignore: cast_nullable_to_non_nullable + : page as int, + pageSize: pageSize == const $CopyWithPlaceholder() + ? _value.pageSize + // ignore: cast_nullable_to_non_nullable + : pageSize as int, + total: total == const $CopyWithPlaceholder() + ? _value.total + // ignore: cast_nullable_to_non_nullable + : total as int, + ); + } +} + +extension $EventPageCopyWith on EventPage { + /// Returns a callable class that can be used as follows: `instanceOfEventPage.copyWith(...)` or like so:`instanceOfEventPage.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$EventPageCWProxy get copyWith => _$EventPageCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +EventPage _$EventPageFromJson(Map json) => + $checkedCreate('EventPage', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['items', 'page', 'page_size', 'total'], + ); + final val = EventPage( + items: $checkedConvert( + 'items', + (v) => (v as List) + .map((e) => EventOut.fromJson(e as Map)) + .toList(), + ), + page: $checkedConvert('page', (v) => (v as num).toInt()), + pageSize: $checkedConvert('page_size', (v) => (v as num).toInt()), + total: $checkedConvert('total', (v) => (v as num).toInt()), + ); + return val; + }, fieldKeyMap: const {'pageSize': 'page_size'}); + +Map _$EventPageToJson(EventPage instance) => { + 'items': instance.items.map((e) => e.toJson()).toList(), + 'page': instance.page, + 'page_size': instance.pageSize, + 'total': instance.total, +}; diff --git a/app/packages/api_client/lib/src/model/event_status.dart b/app/packages/api_client/lib/src/model/event_status.dart new file mode 100644 index 0000000..1e14671 --- /dev/null +++ b/app/packages/api_client/lib/src/model/event_status.dart @@ -0,0 +1,26 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:json_annotation/json_annotation.dart'; + +enum EventStatus { + @JsonValue(r'confirmed') + confirmed(r'confirmed'), + @JsonValue(r'pending') + pending(r'pending'), + @JsonValue(r'shadow') + shadow(r'shadow'), + @JsonValue(r'ignored') + ignored(r'ignored'), + @JsonValue(r'unknown_default_open_api') + unknownDefaultOpenApi(r'unknown_default_open_api'); + + const EventStatus(this.value); + + final String value; + + @override + String toString() => value; +} diff --git a/app/packages/api_client/lib/src/model/holding_out.dart b/app/packages/api_client/lib/src/model/holding_out.dart new file mode 100644 index 0000000..23a46d5 --- /dev/null +++ b/app/packages/api_client/lib/src/model/holding_out.dart @@ -0,0 +1,472 @@ +// +// 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 'holding_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HoldingOut { + /// Returns a new [HoldingOut] instance. + HoldingOut({ + + required this.accruedInterestRub, + + required this.assetClass, + + required this.avgCost, + + required this.board, + + required this.costCurrency, + + required this.costTotalRub, + + required this.currency, + + required this.daysHeld, + + required this.firstBuyDate, + + required this.incomeRub, + + required this.instrumentId, + + required this.ldvEligibleQty, + + required this.marketPrice, + + required this.name, + + required this.priceCurrency, + + required this.priceDate, + + required this.priceStatus, + + required this.qty, + + required this.realizedPnlRub, + + required this.ticker, + + required this.unrealizedPnlNative, + + required this.unrealizedPnlRub, + + required this.valueNative, + + required this.valueRub, + + required this.weight, + + required this.xirr, + }); + + /// decimal as string + @JsonKey( + + name: r'accrued_interest_rub', + required: true, + includeIfNull: true, + ) + + + final String? accruedInterestRub; + + + + @JsonKey( + + name: r'asset_class', + required: true, + includeIfNull: false, + ) + + + final String assetClass; + + + + /// decimal as string + @JsonKey( + + name: r'avg_cost', + required: true, + includeIfNull: true, + ) + + + final String? avgCost; + + + + @JsonKey( + + name: r'board', + required: true, + includeIfNull: true, + ) + + + final String? board; + + + + @JsonKey( + + name: r'cost_currency', + required: true, + includeIfNull: true, + ) + + + final String? costCurrency; + + + + /// decimal as string + @JsonKey( + + name: r'cost_total_rub', + required: true, + includeIfNull: true, + ) + + + final String? costTotalRub; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'days_held', + required: true, + includeIfNull: true, + ) + + + final int? daysHeld; + + + + @JsonKey( + + name: r'first_buy_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? firstBuyDate; + + + + /// decimal as string + @JsonKey( + + name: r'income_rub', + required: true, + includeIfNull: true, + ) + + + final String? incomeRub; + + + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: false, + ) + + + final int instrumentId; + + + + /// decimal as string + @JsonKey( + + name: r'ldv_eligible_qty', + required: true, + includeIfNull: false, + ) + + + final String ldvEligibleQty; + + + + /// decimal as string + @JsonKey( + + name: r'market_price', + required: true, + includeIfNull: true, + ) + + + final String? marketPrice; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'price_currency', + required: true, + includeIfNull: true, + ) + + + final String? priceCurrency; + + + + @JsonKey( + + name: r'price_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? priceDate; + + + + @JsonKey( + + name: r'price_status', + required: true, + includeIfNull: false, + ) + + + final String priceStatus; + + + + /// decimal as string + @JsonKey( + + name: r'qty', + required: true, + includeIfNull: false, + ) + + + final String qty; + + + + /// decimal as string + @JsonKey( + + name: r'realized_pnl_rub', + required: true, + includeIfNull: true, + ) + + + final String? realizedPnlRub; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: true, + ) + + + final String? ticker; + + + + /// decimal as string + @JsonKey( + + name: r'unrealized_pnl_native', + required: true, + includeIfNull: true, + ) + + + final String? unrealizedPnlNative; + + + + /// decimal as string + @JsonKey( + + name: r'unrealized_pnl_rub', + required: true, + includeIfNull: true, + ) + + + final String? unrealizedPnlRub; + + + + /// decimal as string + @JsonKey( + + name: r'value_native', + required: true, + includeIfNull: true, + ) + + + final String? valueNative; + + + + /// decimal as string + @JsonKey( + + name: r'value_rub', + required: true, + includeIfNull: true, + ) + + + final String? valueRub; + + + + /// decimal as string + @JsonKey( + + name: r'weight', + required: true, + includeIfNull: true, + ) + + + final String? weight; + + + + /// decimal as string + @JsonKey( + + name: r'xirr', + required: true, + includeIfNull: true, + ) + + + final String? xirr; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HoldingOut && + other.accruedInterestRub == accruedInterestRub && + other.assetClass == assetClass && + other.avgCost == avgCost && + other.board == board && + other.costCurrency == costCurrency && + other.costTotalRub == costTotalRub && + other.currency == currency && + other.daysHeld == daysHeld && + other.firstBuyDate == firstBuyDate && + other.incomeRub == incomeRub && + other.instrumentId == instrumentId && + other.ldvEligibleQty == ldvEligibleQty && + other.marketPrice == marketPrice && + other.name == name && + other.priceCurrency == priceCurrency && + other.priceDate == priceDate && + other.priceStatus == priceStatus && + other.qty == qty && + other.realizedPnlRub == realizedPnlRub && + other.ticker == ticker && + other.unrealizedPnlNative == unrealizedPnlNative && + other.unrealizedPnlRub == unrealizedPnlRub && + other.valueNative == valueNative && + other.valueRub == valueRub && + other.weight == weight && + other.xirr == xirr; + + @override + int get hashCode => + (accruedInterestRub == null ? 0 : accruedInterestRub.hashCode) + + assetClass.hashCode + + (avgCost == null ? 0 : avgCost.hashCode) + + (board == null ? 0 : board.hashCode) + + (costCurrency == null ? 0 : costCurrency.hashCode) + + (costTotalRub == null ? 0 : costTotalRub.hashCode) + + currency.hashCode + + (daysHeld == null ? 0 : daysHeld.hashCode) + + (firstBuyDate == null ? 0 : firstBuyDate.hashCode) + + (incomeRub == null ? 0 : incomeRub.hashCode) + + instrumentId.hashCode + + ldvEligibleQty.hashCode + + (marketPrice == null ? 0 : marketPrice.hashCode) + + name.hashCode + + (priceCurrency == null ? 0 : priceCurrency.hashCode) + + (priceDate == null ? 0 : priceDate.hashCode) + + priceStatus.hashCode + + qty.hashCode + + (realizedPnlRub == null ? 0 : realizedPnlRub.hashCode) + + (ticker == null ? 0 : ticker.hashCode) + + (unrealizedPnlNative == null ? 0 : unrealizedPnlNative.hashCode) + + (unrealizedPnlRub == null ? 0 : unrealizedPnlRub.hashCode) + + (valueNative == null ? 0 : valueNative.hashCode) + + (valueRub == null ? 0 : valueRub.hashCode) + + (weight == null ? 0 : weight.hashCode) + + (xirr == null ? 0 : xirr.hashCode); + + factory HoldingOut.fromJson(Map json) => _$HoldingOutFromJson(json); + + Map toJson() => _$HoldingOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + 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 new file mode 100644 index 0000000..9bde774 --- /dev/null +++ b/app/packages/api_client/lib/src/model/holding_out.g.dart @@ -0,0 +1,476 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'holding_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$HoldingOutCWProxy { + HoldingOut accruedInterestRub(String? accruedInterestRub); + + HoldingOut assetClass(String assetClass); + + HoldingOut avgCost(String? avgCost); + + HoldingOut board(String? board); + + HoldingOut costCurrency(String? costCurrency); + + HoldingOut costTotalRub(String? costTotalRub); + + HoldingOut currency(String currency); + + HoldingOut daysHeld(int? daysHeld); + + HoldingOut firstBuyDate(DateTime? firstBuyDate); + + HoldingOut incomeRub(String? incomeRub); + + HoldingOut instrumentId(int instrumentId); + + HoldingOut ldvEligibleQty(String ldvEligibleQty); + + HoldingOut marketPrice(String? marketPrice); + + HoldingOut name(String name); + + HoldingOut priceCurrency(String? priceCurrency); + + HoldingOut priceDate(DateTime? priceDate); + + HoldingOut priceStatus(String priceStatus); + + HoldingOut qty(String qty); + + HoldingOut realizedPnlRub(String? realizedPnlRub); + + HoldingOut ticker(String? ticker); + + HoldingOut unrealizedPnlNative(String? unrealizedPnlNative); + + HoldingOut unrealizedPnlRub(String? unrealizedPnlRub); + + HoldingOut valueNative(String? valueNative); + + HoldingOut valueRub(String? valueRub); + + HoldingOut weight(String? weight); + + HoldingOut 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 `HoldingOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HoldingOut(...).copyWith(id: 12, name: "My name") + /// ```` + HoldingOut call({ + String? accruedInterestRub, + String assetClass, + String? avgCost, + String? board, + String? costCurrency, + String? costTotalRub, + String currency, + int? daysHeld, + DateTime? firstBuyDate, + String? incomeRub, + int instrumentId, + String ldvEligibleQty, + String? marketPrice, + String name, + String? priceCurrency, + DateTime? priceDate, + String priceStatus, + String qty, + String? realizedPnlRub, + String? ticker, + String? unrealizedPnlNative, + String? unrealizedPnlRub, + String? valueNative, + String? valueRub, + String? weight, + String? xirr, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHoldingOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHoldingOut.copyWith.fieldName(...)` +class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy { + const _$HoldingOutCWProxyImpl(this._value); + + final HoldingOut _value; + + @override + HoldingOut accruedInterestRub(String? accruedInterestRub) => + this(accruedInterestRub: accruedInterestRub); + + @override + HoldingOut assetClass(String assetClass) => this(assetClass: assetClass); + + @override + HoldingOut avgCost(String? avgCost) => this(avgCost: avgCost); + + @override + HoldingOut board(String? board) => this(board: board); + + @override + HoldingOut costCurrency(String? costCurrency) => + this(costCurrency: costCurrency); + + @override + HoldingOut costTotalRub(String? costTotalRub) => + this(costTotalRub: costTotalRub); + + @override + HoldingOut currency(String currency) => this(currency: currency); + + @override + HoldingOut daysHeld(int? daysHeld) => this(daysHeld: daysHeld); + + @override + HoldingOut firstBuyDate(DateTime? firstBuyDate) => + this(firstBuyDate: firstBuyDate); + + @override + HoldingOut incomeRub(String? incomeRub) => this(incomeRub: incomeRub); + + @override + HoldingOut instrumentId(int instrumentId) => this(instrumentId: instrumentId); + + @override + HoldingOut ldvEligibleQty(String ldvEligibleQty) => + this(ldvEligibleQty: ldvEligibleQty); + + @override + HoldingOut marketPrice(String? marketPrice) => this(marketPrice: marketPrice); + + @override + HoldingOut name(String name) => this(name: name); + + @override + HoldingOut priceCurrency(String? priceCurrency) => + this(priceCurrency: priceCurrency); + + @override + HoldingOut priceDate(DateTime? priceDate) => this(priceDate: priceDate); + + @override + HoldingOut priceStatus(String priceStatus) => this(priceStatus: priceStatus); + + @override + HoldingOut qty(String qty) => this(qty: qty); + + @override + HoldingOut realizedPnlRub(String? realizedPnlRub) => + this(realizedPnlRub: realizedPnlRub); + + @override + HoldingOut ticker(String? ticker) => this(ticker: ticker); + + @override + HoldingOut unrealizedPnlNative(String? unrealizedPnlNative) => + this(unrealizedPnlNative: unrealizedPnlNative); + + @override + HoldingOut unrealizedPnlRub(String? unrealizedPnlRub) => + this(unrealizedPnlRub: unrealizedPnlRub); + + @override + HoldingOut valueNative(String? valueNative) => this(valueNative: valueNative); + + @override + HoldingOut valueRub(String? valueRub) => this(valueRub: valueRub); + + @override + HoldingOut weight(String? weight) => this(weight: weight); + + @override + HoldingOut 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 `HoldingOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HoldingOut(...).copyWith(id: 12, name: "My name") + /// ```` + HoldingOut call({ + Object? accruedInterestRub = const $CopyWithPlaceholder(), + Object? assetClass = const $CopyWithPlaceholder(), + Object? avgCost = const $CopyWithPlaceholder(), + Object? board = const $CopyWithPlaceholder(), + Object? costCurrency = const $CopyWithPlaceholder(), + Object? costTotalRub = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? daysHeld = const $CopyWithPlaceholder(), + Object? firstBuyDate = const $CopyWithPlaceholder(), + Object? incomeRub = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? ldvEligibleQty = const $CopyWithPlaceholder(), + Object? marketPrice = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? priceCurrency = const $CopyWithPlaceholder(), + Object? priceDate = const $CopyWithPlaceholder(), + Object? priceStatus = const $CopyWithPlaceholder(), + Object? qty = const $CopyWithPlaceholder(), + Object? realizedPnlRub = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + Object? unrealizedPnlNative = const $CopyWithPlaceholder(), + Object? unrealizedPnlRub = const $CopyWithPlaceholder(), + Object? valueNative = const $CopyWithPlaceholder(), + Object? valueRub = const $CopyWithPlaceholder(), + Object? weight = const $CopyWithPlaceholder(), + Object? xirr = const $CopyWithPlaceholder(), + }) { + return HoldingOut( + accruedInterestRub: accruedInterestRub == const $CopyWithPlaceholder() + ? _value.accruedInterestRub + // ignore: cast_nullable_to_non_nullable + : accruedInterestRub as String?, + assetClass: assetClass == const $CopyWithPlaceholder() + ? _value.assetClass + // ignore: cast_nullable_to_non_nullable + : assetClass as String, + avgCost: avgCost == const $CopyWithPlaceholder() + ? _value.avgCost + // ignore: cast_nullable_to_non_nullable + : avgCost as String?, + board: board == const $CopyWithPlaceholder() + ? _value.board + // ignore: cast_nullable_to_non_nullable + : board as String?, + costCurrency: costCurrency == const $CopyWithPlaceholder() + ? _value.costCurrency + // ignore: cast_nullable_to_non_nullable + : costCurrency as String?, + costTotalRub: costTotalRub == const $CopyWithPlaceholder() + ? _value.costTotalRub + // ignore: cast_nullable_to_non_nullable + : costTotalRub as String?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + daysHeld: daysHeld == const $CopyWithPlaceholder() + ? _value.daysHeld + // ignore: cast_nullable_to_non_nullable + : daysHeld as int?, + firstBuyDate: firstBuyDate == const $CopyWithPlaceholder() + ? _value.firstBuyDate + // ignore: cast_nullable_to_non_nullable + : firstBuyDate as DateTime?, + incomeRub: incomeRub == const $CopyWithPlaceholder() + ? _value.incomeRub + // ignore: cast_nullable_to_non_nullable + : incomeRub as String?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int, + ldvEligibleQty: ldvEligibleQty == const $CopyWithPlaceholder() + ? _value.ldvEligibleQty + // ignore: cast_nullable_to_non_nullable + : ldvEligibleQty as String, + marketPrice: marketPrice == const $CopyWithPlaceholder() + ? _value.marketPrice + // ignore: cast_nullable_to_non_nullable + : marketPrice as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + priceCurrency: priceCurrency == const $CopyWithPlaceholder() + ? _value.priceCurrency + // ignore: cast_nullable_to_non_nullable + : priceCurrency as String?, + priceDate: priceDate == const $CopyWithPlaceholder() + ? _value.priceDate + // ignore: cast_nullable_to_non_nullable + : priceDate as DateTime?, + priceStatus: priceStatus == const $CopyWithPlaceholder() + ? _value.priceStatus + // ignore: cast_nullable_to_non_nullable + : priceStatus as String, + qty: qty == const $CopyWithPlaceholder() + ? _value.qty + // ignore: cast_nullable_to_non_nullable + : qty as String, + realizedPnlRub: realizedPnlRub == const $CopyWithPlaceholder() + ? _value.realizedPnlRub + // ignore: cast_nullable_to_non_nullable + : realizedPnlRub as String?, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + unrealizedPnlNative: unrealizedPnlNative == const $CopyWithPlaceholder() + ? _value.unrealizedPnlNative + // ignore: cast_nullable_to_non_nullable + : unrealizedPnlNative as String?, + unrealizedPnlRub: unrealizedPnlRub == const $CopyWithPlaceholder() + ? _value.unrealizedPnlRub + // ignore: cast_nullable_to_non_nullable + : unrealizedPnlRub as String?, + valueNative: valueNative == const $CopyWithPlaceholder() + ? _value.valueNative + // ignore: cast_nullable_to_non_nullable + : valueNative as String?, + valueRub: valueRub == const $CopyWithPlaceholder() + ? _value.valueRub + // ignore: cast_nullable_to_non_nullable + : valueRub as String?, + weight: weight == const $CopyWithPlaceholder() + ? _value.weight + // ignore: cast_nullable_to_non_nullable + : weight as String?, + xirr: xirr == const $CopyWithPlaceholder() + ? _value.xirr + // ignore: cast_nullable_to_non_nullable + : xirr as String?, + ); + } +} + +extension $HoldingOutCopyWith on HoldingOut { + /// Returns a callable class that can be used as follows: `instanceOfHoldingOut.copyWith(...)` or like so:`instanceOfHoldingOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$HoldingOutCWProxy get copyWith => _$HoldingOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HoldingOut _$HoldingOutFromJson(Map json) => $checkedCreate( + 'HoldingOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'accrued_interest_rub', + 'asset_class', + 'avg_cost', + 'board', + 'cost_currency', + 'cost_total_rub', + 'currency', + 'days_held', + 'first_buy_date', + 'income_rub', + 'instrument_id', + 'ldv_eligible_qty', + 'market_price', + 'name', + 'price_currency', + 'price_date', + 'price_status', + 'qty', + 'realized_pnl_rub', + 'ticker', + 'unrealized_pnl_native', + 'unrealized_pnl_rub', + 'value_native', + 'value_rub', + 'weight', + 'xirr', + ], + ); + final val = HoldingOut( + accruedInterestRub: $checkedConvert( + 'accrued_interest_rub', + (v) => v as String?, + ), + assetClass: $checkedConvert('asset_class', (v) => v as String), + avgCost: $checkedConvert('avg_cost', (v) => v as String?), + board: $checkedConvert('board', (v) => v as String?), + costCurrency: $checkedConvert('cost_currency', (v) => v as String?), + costTotalRub: $checkedConvert('cost_total_rub', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String), + daysHeld: $checkedConvert('days_held', (v) => (v as num?)?.toInt()), + firstBuyDate: $checkedConvert( + 'first_buy_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + 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), + marketPrice: $checkedConvert('market_price', (v) => v as String?), + name: $checkedConvert('name', (v) => v as String), + priceCurrency: $checkedConvert('price_currency', (v) => v as String?), + priceDate: $checkedConvert( + 'price_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + priceStatus: $checkedConvert('price_status', (v) => v as String), + qty: $checkedConvert('qty', (v) => v as String), + realizedPnlRub: $checkedConvert('realized_pnl_rub', (v) => v as String?), + ticker: $checkedConvert('ticker', (v) => v as String?), + unrealizedPnlNative: $checkedConvert( + 'unrealized_pnl_native', + (v) => v as String?, + ), + unrealizedPnlRub: $checkedConvert( + 'unrealized_pnl_rub', + (v) => v as String?, + ), + valueNative: $checkedConvert('value_native', (v) => v as String?), + valueRub: $checkedConvert('value_rub', (v) => v as String?), + weight: $checkedConvert('weight', (v) => v as String?), + xirr: $checkedConvert('xirr', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'accruedInterestRub': 'accrued_interest_rub', + 'assetClass': 'asset_class', + 'avgCost': 'avg_cost', + 'costCurrency': 'cost_currency', + 'costTotalRub': 'cost_total_rub', + 'daysHeld': 'days_held', + 'firstBuyDate': 'first_buy_date', + 'incomeRub': 'income_rub', + 'instrumentId': 'instrument_id', + 'ldvEligibleQty': 'ldv_eligible_qty', + 'marketPrice': 'market_price', + 'priceCurrency': 'price_currency', + 'priceDate': 'price_date', + 'priceStatus': 'price_status', + 'realizedPnlRub': 'realized_pnl_rub', + 'unrealizedPnlNative': 'unrealized_pnl_native', + 'unrealizedPnlRub': 'unrealized_pnl_rub', + 'valueNative': 'value_native', + 'valueRub': 'value_rub', + }, +); + +Map _$HoldingOutToJson(HoldingOut instance) => + { + 'accrued_interest_rub': instance.accruedInterestRub, + 'asset_class': instance.assetClass, + 'avg_cost': instance.avgCost, + 'board': instance.board, + 'cost_currency': instance.costCurrency, + 'cost_total_rub': instance.costTotalRub, + 'currency': instance.currency, + 'days_held': instance.daysHeld, + 'first_buy_date': instance.firstBuyDate?.toIso8601String(), + 'income_rub': instance.incomeRub, + 'instrument_id': instance.instrumentId, + 'ldv_eligible_qty': instance.ldvEligibleQty, + 'market_price': instance.marketPrice, + 'name': instance.name, + 'price_currency': instance.priceCurrency, + 'price_date': instance.priceDate?.toIso8601String(), + 'price_status': instance.priceStatus, + 'qty': instance.qty, + 'realized_pnl_rub': instance.realizedPnlRub, + 'ticker': instance.ticker, + 'unrealized_pnl_native': instance.unrealizedPnlNative, + 'unrealized_pnl_rub': instance.unrealizedPnlRub, + 'value_native': instance.valueNative, + 'value_rub': instance.valueRub, + 'weight': instance.weight, + 'xirr': instance.xirr, + }; diff --git a/app/packages/api_client/lib/src/model/instrument_detail.dart b/app/packages/api_client/lib/src/model/instrument_detail.dart new file mode 100644 index 0000000..6f9377e --- /dev/null +++ b/app/packages/api_client/lib/src/model/instrument_detail.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/price_point.dart'; +import 'package:fintracker_api/src/model/lot_out.dart'; +import 'package:fintracker_api/src/model/event_out.dart'; +import 'package:fintracker_api/src/model/instrument_out.dart'; +import 'package:fintracker_api/src/model/holding_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'instrument_detail.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class InstrumentDetail { + /// Returns a new [InstrumentDetail] instance. + InstrumentDetail({ + + required this.events, + + required this.holding, + + required this.instrument, + + required this.lots, + + required this.prices, + }); + + @JsonKey( + + name: r'events', + required: true, + includeIfNull: false, + ) + + + final List events; + + + + @JsonKey( + + name: r'holding', + required: true, + includeIfNull: true, + ) + + + final HoldingOut? holding; + + + + @JsonKey( + + name: r'instrument', + required: true, + includeIfNull: false, + ) + + + final InstrumentOut instrument; + + + + @JsonKey( + + name: r'lots', + required: true, + includeIfNull: false, + ) + + + final List lots; + + + + @JsonKey( + + name: r'prices', + required: true, + includeIfNull: false, + ) + + + final List prices; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is InstrumentDetail && + other.events == events && + other.holding == holding && + other.instrument == instrument && + other.lots == lots && + other.prices == prices; + + @override + int get hashCode => + events.hashCode + + (holding == null ? 0 : holding.hashCode) + + instrument.hashCode + + lots.hashCode + + prices.hashCode; + + factory InstrumentDetail.fromJson(Map json) => _$InstrumentDetailFromJson(json); + + Map toJson() => _$InstrumentDetailToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/instrument_detail.g.dart b/app/packages/api_client/lib/src/model/instrument_detail.g.dart new file mode 100644 index 0000000..bd21b90 --- /dev/null +++ b/app/packages/api_client/lib/src/model/instrument_detail.g.dart @@ -0,0 +1,157 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'instrument_detail.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$InstrumentDetailCWProxy { + InstrumentDetail events(List events); + + InstrumentDetail holding(HoldingOut? holding); + + InstrumentDetail instrument(InstrumentOut instrument); + + InstrumentDetail lots(List lots); + + InstrumentDetail prices(List prices); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentDetail(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// InstrumentDetail(...).copyWith(id: 12, name: "My name") + /// ```` + InstrumentDetail call({ + List events, + HoldingOut? holding, + InstrumentOut instrument, + List lots, + List prices, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfInstrumentDetail.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfInstrumentDetail.copyWith.fieldName(...)` +class _$InstrumentDetailCWProxyImpl implements _$InstrumentDetailCWProxy { + const _$InstrumentDetailCWProxyImpl(this._value); + + final InstrumentDetail _value; + + @override + InstrumentDetail events(List events) => this(events: events); + + @override + InstrumentDetail holding(HoldingOut? holding) => this(holding: holding); + + @override + InstrumentDetail instrument(InstrumentOut instrument) => + this(instrument: instrument); + + @override + InstrumentDetail lots(List lots) => this(lots: lots); + + @override + InstrumentDetail prices(List prices) => this(prices: prices); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentDetail(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// InstrumentDetail(...).copyWith(id: 12, name: "My name") + /// ```` + InstrumentDetail call({ + Object? events = const $CopyWithPlaceholder(), + Object? holding = const $CopyWithPlaceholder(), + Object? instrument = const $CopyWithPlaceholder(), + Object? lots = const $CopyWithPlaceholder(), + Object? prices = const $CopyWithPlaceholder(), + }) { + return InstrumentDetail( + events: events == const $CopyWithPlaceholder() + ? _value.events + // ignore: cast_nullable_to_non_nullable + : events as List, + holding: holding == const $CopyWithPlaceholder() + ? _value.holding + // ignore: cast_nullable_to_non_nullable + : holding as HoldingOut?, + instrument: instrument == const $CopyWithPlaceholder() + ? _value.instrument + // ignore: cast_nullable_to_non_nullable + : instrument as InstrumentOut, + lots: lots == const $CopyWithPlaceholder() + ? _value.lots + // ignore: cast_nullable_to_non_nullable + : lots as List, + prices: prices == const $CopyWithPlaceholder() + ? _value.prices + // ignore: cast_nullable_to_non_nullable + : prices as List, + ); + } +} + +extension $InstrumentDetailCopyWith on InstrumentDetail { + /// Returns a callable class that can be used as follows: `instanceOfInstrumentDetail.copyWith(...)` or like so:`instanceOfInstrumentDetail.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$InstrumentDetailCWProxy get copyWith => _$InstrumentDetailCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +InstrumentDetail _$InstrumentDetailFromJson(Map json) => + $checkedCreate('InstrumentDetail', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'events', + 'holding', + 'instrument', + 'lots', + 'prices', + ], + ); + final val = InstrumentDetail( + events: $checkedConvert( + 'events', + (v) => (v as List) + .map((e) => EventOut.fromJson(e as Map)) + .toList(), + ), + holding: $checkedConvert( + 'holding', + (v) => + v == null ? null : HoldingOut.fromJson(v as Map), + ), + instrument: $checkedConvert( + 'instrument', + (v) => InstrumentOut.fromJson(v as Map), + ), + lots: $checkedConvert( + 'lots', + (v) => (v as List) + .map((e) => LotOut.fromJson(e as Map)) + .toList(), + ), + prices: $checkedConvert( + 'prices', + (v) => (v as List) + .map((e) => PricePoint.fromJson(e as Map)) + .toList(), + ), + ); + return val; + }); + +Map _$InstrumentDetailToJson(InstrumentDetail instance) => + { + 'events': instance.events.map((e) => e.toJson()).toList(), + 'holding': instance.holding?.toJson(), + 'instrument': instance.instrument.toJson(), + 'lots': instance.lots.map((e) => e.toJson()).toList(), + 'prices': instance.prices.map((e) => e.toJson()).toList(), + }; diff --git a/app/packages/api_client/lib/src/model/instrument_out.dart b/app/packages/api_client/lib/src/model/instrument_out.dart new file mode 100644 index 0000000..8bc5b72 --- /dev/null +++ b/app/packages/api_client/lib/src/model/instrument_out.dart @@ -0,0 +1,315 @@ +// +// 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_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class InstrumentOut { + /// Returns a new [InstrumentOut] instance. + InstrumentOut({ + + required this.assetClass, + + required this.board, + + required this.country, + + required this.currency, + + required this.exchange, + + required this.figi, + + required this.id, + + required this.isActive, + + required this.isin, + + required this.issuer, + + required this.lot, + + required this.maturityDate, + + required this.name, + + required this.nominal, + + required this.nominalCurrency, + + required this.sector, + + required this.ticker, + }); + + @JsonKey( + + name: r'asset_class', + required: true, + includeIfNull: false, + ) + + + final String assetClass; + + + + @JsonKey( + + name: r'board', + required: true, + includeIfNull: true, + ) + + + final String? board; + + + + @JsonKey( + + name: r'country', + required: true, + includeIfNull: true, + ) + + + final String? country; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'exchange', + required: true, + includeIfNull: true, + ) + + + final String? exchange; + + + + @JsonKey( + + name: r'figi', + required: true, + includeIfNull: true, + ) + + + final String? figi; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'is_active', + required: true, + includeIfNull: false, + ) + + + final bool isActive; + + + + @JsonKey( + + name: r'isin', + required: true, + includeIfNull: true, + ) + + + final String? isin; + + + + @JsonKey( + + name: r'issuer', + required: true, + includeIfNull: true, + ) + + + final String? issuer; + + + + @JsonKey( + + name: r'lot', + required: true, + includeIfNull: false, + ) + + + final int lot; + + + + @JsonKey( + + name: r'maturity_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? maturityDate; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + /// decimal as string + @JsonKey( + + name: r'nominal', + required: true, + includeIfNull: true, + ) + + + final String? nominal; + + + + @JsonKey( + + name: r'nominal_currency', + required: true, + includeIfNull: true, + ) + + + final String? nominalCurrency; + + + + @JsonKey( + + name: r'sector', + required: true, + includeIfNull: true, + ) + + + final String? sector; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: true, + ) + + + final String? ticker; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is InstrumentOut && + other.assetClass == assetClass && + other.board == board && + other.country == country && + other.currency == currency && + other.exchange == exchange && + other.figi == figi && + other.id == id && + other.isActive == isActive && + other.isin == isin && + other.issuer == issuer && + other.lot == lot && + other.maturityDate == maturityDate && + other.name == name && + other.nominal == nominal && + other.nominalCurrency == nominalCurrency && + other.sector == sector && + other.ticker == ticker; + + @override + int get hashCode => + assetClass.hashCode + + (board == null ? 0 : board.hashCode) + + (country == null ? 0 : country.hashCode) + + currency.hashCode + + (exchange == null ? 0 : exchange.hashCode) + + (figi == null ? 0 : figi.hashCode) + + id.hashCode + + isActive.hashCode + + (isin == null ? 0 : isin.hashCode) + + (issuer == null ? 0 : issuer.hashCode) + + lot.hashCode + + (maturityDate == null ? 0 : maturityDate.hashCode) + + name.hashCode + + (nominal == null ? 0 : nominal.hashCode) + + (nominalCurrency == null ? 0 : nominalCurrency.hashCode) + + (sector == null ? 0 : sector.hashCode) + + (ticker == null ? 0 : ticker.hashCode); + + factory InstrumentOut.fromJson(Map json) => _$InstrumentOutFromJson(json); + + Map toJson() => _$InstrumentOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + 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 new file mode 100644 index 0000000..c2bd59b --- /dev/null +++ b/app/packages/api_client/lib/src/model/instrument_out.g.dart @@ -0,0 +1,320 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'instrument_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$InstrumentOutCWProxy { + InstrumentOut assetClass(String assetClass); + + InstrumentOut board(String? board); + + InstrumentOut country(String? country); + + InstrumentOut currency(String currency); + + InstrumentOut exchange(String? exchange); + + InstrumentOut figi(String? figi); + + InstrumentOut id(int id); + + InstrumentOut isActive(bool isActive); + + InstrumentOut isin(String? isin); + + InstrumentOut issuer(String? issuer); + + InstrumentOut lot(int lot); + + InstrumentOut maturityDate(DateTime? maturityDate); + + InstrumentOut name(String name); + + InstrumentOut nominal(String? nominal); + + InstrumentOut nominalCurrency(String? nominalCurrency); + + InstrumentOut sector(String? sector); + + InstrumentOut ticker(String? ticker); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// InstrumentOut(...).copyWith(id: 12, name: "My name") + /// ```` + InstrumentOut call({ + String assetClass, + String? board, + String? country, + String currency, + String? exchange, + String? figi, + int id, + bool isActive, + String? isin, + String? issuer, + int lot, + DateTime? maturityDate, + String name, + String? nominal, + String? nominalCurrency, + String? sector, + String? ticker, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfInstrumentOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfInstrumentOut.copyWith.fieldName(...)` +class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy { + const _$InstrumentOutCWProxyImpl(this._value); + + final InstrumentOut _value; + + @override + InstrumentOut assetClass(String assetClass) => this(assetClass: assetClass); + + @override + InstrumentOut board(String? board) => this(board: board); + + @override + InstrumentOut country(String? country) => this(country: country); + + @override + InstrumentOut currency(String currency) => this(currency: currency); + + @override + InstrumentOut exchange(String? exchange) => this(exchange: exchange); + + @override + InstrumentOut figi(String? figi) => this(figi: figi); + + @override + InstrumentOut id(int id) => this(id: id); + + @override + InstrumentOut isActive(bool isActive) => this(isActive: isActive); + + @override + InstrumentOut isin(String? isin) => this(isin: isin); + + @override + InstrumentOut issuer(String? issuer) => this(issuer: issuer); + + @override + InstrumentOut lot(int lot) => this(lot: lot); + + @override + InstrumentOut maturityDate(DateTime? maturityDate) => + this(maturityDate: maturityDate); + + @override + InstrumentOut name(String name) => this(name: name); + + @override + InstrumentOut nominal(String? nominal) => this(nominal: nominal); + + @override + InstrumentOut nominalCurrency(String? nominalCurrency) => + this(nominalCurrency: nominalCurrency); + + @override + InstrumentOut sector(String? sector) => this(sector: sector); + + @override + InstrumentOut ticker(String? ticker) => this(ticker: ticker); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// InstrumentOut(...).copyWith(id: 12, name: "My name") + /// ```` + InstrumentOut call({ + Object? assetClass = const $CopyWithPlaceholder(), + Object? board = const $CopyWithPlaceholder(), + Object? country = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? exchange = const $CopyWithPlaceholder(), + Object? figi = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? isActive = const $CopyWithPlaceholder(), + Object? isin = const $CopyWithPlaceholder(), + Object? issuer = const $CopyWithPlaceholder(), + Object? lot = const $CopyWithPlaceholder(), + Object? maturityDate = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? nominal = const $CopyWithPlaceholder(), + Object? nominalCurrency = const $CopyWithPlaceholder(), + Object? sector = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + }) { + return InstrumentOut( + 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?, + country: country == const $CopyWithPlaceholder() + ? _value.country + // ignore: cast_nullable_to_non_nullable + : country as String?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + exchange: exchange == const $CopyWithPlaceholder() + ? _value.exchange + // ignore: cast_nullable_to_non_nullable + : exchange as String?, + figi: figi == const $CopyWithPlaceholder() + ? _value.figi + // ignore: cast_nullable_to_non_nullable + : figi as String?, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + isActive: isActive == const $CopyWithPlaceholder() + ? _value.isActive + // ignore: cast_nullable_to_non_nullable + : isActive as bool, + isin: isin == const $CopyWithPlaceholder() + ? _value.isin + // ignore: cast_nullable_to_non_nullable + : isin as String?, + issuer: issuer == const $CopyWithPlaceholder() + ? _value.issuer + // ignore: cast_nullable_to_non_nullable + : issuer as String?, + lot: lot == const $CopyWithPlaceholder() + ? _value.lot + // ignore: cast_nullable_to_non_nullable + : lot as int, + maturityDate: maturityDate == const $CopyWithPlaceholder() + ? _value.maturityDate + // ignore: cast_nullable_to_non_nullable + : maturityDate as DateTime?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + nominal: nominal == const $CopyWithPlaceholder() + ? _value.nominal + // ignore: cast_nullable_to_non_nullable + : nominal as String?, + nominalCurrency: nominalCurrency == const $CopyWithPlaceholder() + ? _value.nominalCurrency + // ignore: cast_nullable_to_non_nullable + : nominalCurrency as String?, + sector: sector == const $CopyWithPlaceholder() + ? _value.sector + // ignore: cast_nullable_to_non_nullable + : sector as String?, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + ); + } +} + +extension $InstrumentOutCopyWith on InstrumentOut { + /// Returns a callable class that can be used as follows: `instanceOfInstrumentOut.copyWith(...)` or like so:`instanceOfInstrumentOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$InstrumentOutCWProxy get copyWith => _$InstrumentOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +InstrumentOut _$InstrumentOutFromJson(Map json) => + $checkedCreate( + 'InstrumentOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'asset_class', + 'board', + 'country', + 'currency', + 'exchange', + 'figi', + 'id', + 'is_active', + 'isin', + 'issuer', + 'lot', + 'maturity_date', + 'name', + 'nominal', + 'nominal_currency', + 'sector', + 'ticker', + ], + ); + final val = InstrumentOut( + assetClass: $checkedConvert('asset_class', (v) => v as String), + board: $checkedConvert('board', (v) => v as String?), + country: $checkedConvert('country', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String), + exchange: $checkedConvert('exchange', (v) => v as String?), + figi: $checkedConvert('figi', (v) => v as String?), + id: $checkedConvert('id', (v) => (v as num).toInt()), + isActive: $checkedConvert('is_active', (v) => v as bool), + isin: $checkedConvert('isin', (v) => v as String?), + issuer: $checkedConvert('issuer', (v) => v as String?), + lot: $checkedConvert('lot', (v) => (v as num).toInt()), + maturityDate: $checkedConvert( + 'maturity_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + name: $checkedConvert('name', (v) => v as String), + nominal: $checkedConvert('nominal', (v) => v as String?), + nominalCurrency: $checkedConvert( + 'nominal_currency', + (v) => v as String?, + ), + sector: $checkedConvert('sector', (v) => v as String?), + ticker: $checkedConvert('ticker', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'assetClass': 'asset_class', + 'isActive': 'is_active', + 'maturityDate': 'maturity_date', + 'nominalCurrency': 'nominal_currency', + }, + ); + +Map _$InstrumentOutToJson(InstrumentOut instance) => + { + 'asset_class': instance.assetClass, + 'board': instance.board, + 'country': instance.country, + 'currency': instance.currency, + 'exchange': instance.exchange, + 'figi': instance.figi, + 'id': instance.id, + 'is_active': instance.isActive, + 'isin': instance.isin, + 'issuer': instance.issuer, + 'lot': instance.lot, + 'maturity_date': instance.maturityDate?.toIso8601String(), + 'name': instance.name, + 'nominal': instance.nominal, + 'nominal_currency': instance.nominalCurrency, + 'sector': instance.sector, + 'ticker': instance.ticker, + }; diff --git a/app/packages/api_client/lib/src/model/lot_out.dart b/app/packages/api_client/lib/src/model/lot_out.dart new file mode 100644 index 0000000..a95c028 --- /dev/null +++ b/app/packages/api_client/lib/src/model/lot_out.dart @@ -0,0 +1,190 @@ +// +// 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 'lot_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class LotOut { + /// Returns a new [LotOut] instance. + LotOut({ + + required this.accountId, + + required this.closedAt, + + required this.costCurrency, + + required this.costPerUnit, + + required this.costTotalRub, + + required this.id, + + required this.openDate, + + required this.qtyOpen, + + required this.qtyRemaining, + }); + + @JsonKey( + + name: r'account_id', + required: true, + includeIfNull: false, + ) + + + final int accountId; + + + + @JsonKey( + + name: r'closed_at', + required: true, + includeIfNull: true, + ) + + + final DateTime? closedAt; + + + + @JsonKey( + + name: r'cost_currency', + required: true, + includeIfNull: false, + ) + + + final String costCurrency; + + + + /// decimal as string + @JsonKey( + + name: r'cost_per_unit', + required: true, + includeIfNull: false, + ) + + + final String costPerUnit; + + + + /// decimal as string + @JsonKey( + + name: r'cost_total_rub', + required: true, + includeIfNull: true, + ) + + + final String? costTotalRub; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'open_date', + required: true, + includeIfNull: false, + ) + + + final DateTime openDate; + + + + /// decimal as string + @JsonKey( + + name: r'qty_open', + required: true, + includeIfNull: false, + ) + + + final String qtyOpen; + + + + /// decimal as string + @JsonKey( + + name: r'qty_remaining', + required: true, + includeIfNull: false, + ) + + + final String qtyRemaining; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is LotOut && + other.accountId == accountId && + other.closedAt == closedAt && + other.costCurrency == costCurrency && + other.costPerUnit == costPerUnit && + other.costTotalRub == costTotalRub && + other.id == id && + other.openDate == openDate && + other.qtyOpen == qtyOpen && + other.qtyRemaining == qtyRemaining; + + @override + int get hashCode => + accountId.hashCode + + (closedAt == null ? 0 : closedAt.hashCode) + + costCurrency.hashCode + + costPerUnit.hashCode + + (costTotalRub == null ? 0 : costTotalRub.hashCode) + + id.hashCode + + openDate.hashCode + + qtyOpen.hashCode + + qtyRemaining.hashCode; + + factory LotOut.fromJson(Map json) => _$LotOutFromJson(json); + + Map toJson() => _$LotOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/lot_out.g.dart b/app/packages/api_client/lib/src/model/lot_out.g.dart new file mode 100644 index 0000000..f13ffb2 --- /dev/null +++ b/app/packages/api_client/lib/src/model/lot_out.g.dart @@ -0,0 +1,208 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'lot_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$LotOutCWProxy { + LotOut accountId(int accountId); + + LotOut closedAt(DateTime? closedAt); + + LotOut costCurrency(String costCurrency); + + LotOut costPerUnit(String costPerUnit); + + LotOut costTotalRub(String? costTotalRub); + + LotOut id(int id); + + LotOut openDate(DateTime openDate); + + LotOut qtyOpen(String qtyOpen); + + LotOut qtyRemaining(String qtyRemaining); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// LotOut(...).copyWith(id: 12, name: "My name") + /// ```` + LotOut call({ + int accountId, + DateTime? closedAt, + String costCurrency, + String costPerUnit, + String? costTotalRub, + int id, + DateTime openDate, + String qtyOpen, + String qtyRemaining, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLotOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLotOut.copyWith.fieldName(...)` +class _$LotOutCWProxyImpl implements _$LotOutCWProxy { + const _$LotOutCWProxyImpl(this._value); + + final LotOut _value; + + @override + LotOut accountId(int accountId) => this(accountId: accountId); + + @override + LotOut closedAt(DateTime? closedAt) => this(closedAt: closedAt); + + @override + LotOut costCurrency(String costCurrency) => this(costCurrency: costCurrency); + + @override + LotOut costPerUnit(String costPerUnit) => this(costPerUnit: costPerUnit); + + @override + LotOut costTotalRub(String? costTotalRub) => this(costTotalRub: costTotalRub); + + @override + LotOut id(int id) => this(id: id); + + @override + LotOut openDate(DateTime openDate) => this(openDate: openDate); + + @override + LotOut qtyOpen(String qtyOpen) => this(qtyOpen: qtyOpen); + + @override + LotOut qtyRemaining(String qtyRemaining) => this(qtyRemaining: qtyRemaining); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// LotOut(...).copyWith(id: 12, name: "My name") + /// ```` + LotOut call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? closedAt = const $CopyWithPlaceholder(), + Object? costCurrency = const $CopyWithPlaceholder(), + Object? costPerUnit = const $CopyWithPlaceholder(), + Object? costTotalRub = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? openDate = const $CopyWithPlaceholder(), + Object? qtyOpen = const $CopyWithPlaceholder(), + Object? qtyRemaining = const $CopyWithPlaceholder(), + }) { + return LotOut( + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int, + closedAt: closedAt == const $CopyWithPlaceholder() + ? _value.closedAt + // ignore: cast_nullable_to_non_nullable + : closedAt as DateTime?, + costCurrency: costCurrency == const $CopyWithPlaceholder() + ? _value.costCurrency + // ignore: cast_nullable_to_non_nullable + : costCurrency as String, + costPerUnit: costPerUnit == const $CopyWithPlaceholder() + ? _value.costPerUnit + // ignore: cast_nullable_to_non_nullable + : costPerUnit as String, + costTotalRub: costTotalRub == const $CopyWithPlaceholder() + ? _value.costTotalRub + // ignore: cast_nullable_to_non_nullable + : costTotalRub as String?, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + openDate: openDate == const $CopyWithPlaceholder() + ? _value.openDate + // ignore: cast_nullable_to_non_nullable + : openDate as DateTime, + qtyOpen: qtyOpen == const $CopyWithPlaceholder() + ? _value.qtyOpen + // ignore: cast_nullable_to_non_nullable + : qtyOpen as String, + qtyRemaining: qtyRemaining == const $CopyWithPlaceholder() + ? _value.qtyRemaining + // ignore: cast_nullable_to_non_nullable + : qtyRemaining as String, + ); + } +} + +extension $LotOutCopyWith on LotOut { + /// Returns a callable class that can be used as follows: `instanceOfLotOut.copyWith(...)` or like so:`instanceOfLotOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$LotOutCWProxy get copyWith => _$LotOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LotOut _$LotOutFromJson(Map json) => $checkedCreate( + 'LotOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'account_id', + 'closed_at', + 'cost_currency', + 'cost_per_unit', + 'cost_total_rub', + 'id', + 'open_date', + 'qty_open', + 'qty_remaining', + ], + ); + final val = LotOut( + accountId: $checkedConvert('account_id', (v) => (v as num).toInt()), + closedAt: $checkedConvert( + 'closed_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + costCurrency: $checkedConvert('cost_currency', (v) => v as String), + costPerUnit: $checkedConvert('cost_per_unit', (v) => v as String), + costTotalRub: $checkedConvert('cost_total_rub', (v) => v as String?), + id: $checkedConvert('id', (v) => (v as num).toInt()), + openDate: $checkedConvert( + 'open_date', + (v) => DateTime.parse(v as String), + ), + qtyOpen: $checkedConvert('qty_open', (v) => v as String), + qtyRemaining: $checkedConvert('qty_remaining', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'accountId': 'account_id', + 'closedAt': 'closed_at', + 'costCurrency': 'cost_currency', + 'costPerUnit': 'cost_per_unit', + 'costTotalRub': 'cost_total_rub', + 'openDate': 'open_date', + 'qtyOpen': 'qty_open', + 'qtyRemaining': 'qty_remaining', + }, +); + +Map _$LotOutToJson(LotOut instance) => { + 'account_id': instance.accountId, + 'closed_at': instance.closedAt?.toIso8601String(), + 'cost_currency': instance.costCurrency, + 'cost_per_unit': instance.costPerUnit, + 'cost_total_rub': instance.costTotalRub, + 'id': instance.id, + 'open_date': instance.openDate.toIso8601String(), + 'qty_open': instance.qtyOpen, + 'qty_remaining': instance.qtyRemaining, +}; diff --git a/app/packages/api_client/lib/src/model/price_point.dart b/app/packages/api_client/lib/src/model/price_point.dart new file mode 100644 index 0000000..a552272 --- /dev/null +++ b/app/packages/api_client/lib/src/model/price_point.dart @@ -0,0 +1,108 @@ +// +// 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 'price_point.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PricePoint { + /// Returns a new [PricePoint] instance. + PricePoint({ + + required this.accruedInterest, + + required this.close, + + required this.currency, + + required this.d, + }); + + /// decimal as string + @JsonKey( + + name: r'accrued_interest', + required: true, + includeIfNull: true, + ) + + + final String? accruedInterest; + + + + /// decimal as string + @JsonKey( + + name: r'close', + required: true, + includeIfNull: false, + ) + + + final String close; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'd', + required: true, + includeIfNull: false, + ) + + + final DateTime d; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PricePoint && + other.accruedInterest == accruedInterest && + other.close == close && + other.currency == currency && + other.d == d; + + @override + int get hashCode => + (accruedInterest == null ? 0 : accruedInterest.hashCode) + + close.hashCode + + currency.hashCode + + d.hashCode; + + factory PricePoint.fromJson(Map json) => _$PricePointFromJson(json); + + Map toJson() => _$PricePointToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/price_point.g.dart b/app/packages/api_client/lib/src/model/price_point.g.dart new file mode 100644 index 0000000..1a9584a --- /dev/null +++ b/app/packages/api_client/lib/src/model/price_point.g.dart @@ -0,0 +1,120 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'price_point.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PricePointCWProxy { + PricePoint accruedInterest(String? accruedInterest); + + PricePoint close(String close); + + PricePoint currency(String currency); + + PricePoint d(DateTime d); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PricePoint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PricePoint(...).copyWith(id: 12, name: "My name") + /// ```` + PricePoint call({ + String? accruedInterest, + String close, + String currency, + DateTime d, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPricePoint.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPricePoint.copyWith.fieldName(...)` +class _$PricePointCWProxyImpl implements _$PricePointCWProxy { + const _$PricePointCWProxyImpl(this._value); + + final PricePoint _value; + + @override + PricePoint accruedInterest(String? accruedInterest) => + this(accruedInterest: accruedInterest); + + @override + PricePoint close(String close) => this(close: close); + + @override + PricePoint currency(String currency) => this(currency: currency); + + @override + PricePoint d(DateTime d) => this(d: d); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PricePoint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PricePoint(...).copyWith(id: 12, name: "My name") + /// ```` + PricePoint call({ + Object? accruedInterest = const $CopyWithPlaceholder(), + Object? close = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? d = const $CopyWithPlaceholder(), + }) { + return PricePoint( + accruedInterest: accruedInterest == const $CopyWithPlaceholder() + ? _value.accruedInterest + // ignore: cast_nullable_to_non_nullable + : accruedInterest as String?, + close: close == const $CopyWithPlaceholder() + ? _value.close + // ignore: cast_nullable_to_non_nullable + : close as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + d: d == const $CopyWithPlaceholder() + ? _value.d + // ignore: cast_nullable_to_non_nullable + : d as DateTime, + ); + } +} + +extension $PricePointCopyWith on PricePoint { + /// Returns a callable class that can be used as follows: `instanceOfPricePoint.copyWith(...)` or like so:`instanceOfPricePoint.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PricePointCWProxy get copyWith => _$PricePointCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PricePoint _$PricePointFromJson(Map json) => $checkedCreate( + 'PricePoint', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['accrued_interest', 'close', 'currency', 'd'], + ); + final val = PricePoint( + accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?), + close: $checkedConvert('close', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + d: $checkedConvert('d', (v) => DateTime.parse(v as String)), + ); + return val; + }, + fieldKeyMap: const {'accruedInterest': 'accrued_interest'}, +); + +Map _$PricePointToJson(PricePoint instance) => + { + 'accrued_interest': instance.accruedInterest, + 'close': instance.close, + 'currency': instance.currency, + 'd': instance.d.toIso8601String(), + }; diff --git a/app/packages/api_client/lib/src/model/returns_out.dart b/app/packages/api_client/lib/src/model/returns_out.dart new file mode 100644 index 0000000..187ec69 --- /dev/null +++ b/app/packages/api_client/lib/src/model/returns_out.dart @@ -0,0 +1,225 @@ +// +// 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 'returns_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReturnsOut { + /// Returns a new [ReturnsOut] instance. + ReturnsOut({ + + required this.absPnlRub, + + required this.dateFrom, + + required this.dateTo, + + required this.externalFlowRub, + + required this.period, + + required this.twr, + + required this.twrAnnualized, + + required this.twrDaysSkipped, + + required this.valueEndRub, + + required this.valueStartRub, + + required this.xirr, + }); + + /// decimal as string + @JsonKey( + + name: r'abs_pnl_rub', + required: true, + includeIfNull: false, + ) + + + final String absPnlRub; + + + + @JsonKey( + + name: r'date_from', + required: true, + includeIfNull: false, + ) + + + final DateTime dateFrom; + + + + @JsonKey( + + name: r'date_to', + required: true, + includeIfNull: false, + ) + + + final DateTime dateTo; + + + + /// decimal as string + @JsonKey( + + name: r'external_flow_rub', + required: true, + includeIfNull: false, + ) + + + final String externalFlowRub; + + + + @JsonKey( + + name: r'period', + required: true, + includeIfNull: false, + ) + + + final String period; + + + + /// decimal as string + @JsonKey( + + name: r'twr', + required: true, + includeIfNull: true, + ) + + + final String? twr; + + + + /// decimal as string + @JsonKey( + + name: r'twr_annualized', + required: true, + includeIfNull: true, + ) + + + final String? twrAnnualized; + + + + @JsonKey( + + name: r'twr_days_skipped', + required: true, + includeIfNull: false, + ) + + + final int twrDaysSkipped; + + + + /// decimal as string + @JsonKey( + + name: r'value_end_rub', + required: true, + includeIfNull: false, + ) + + + final String valueEndRub; + + + + /// decimal as string + @JsonKey( + + name: r'value_start_rub', + required: true, + includeIfNull: false, + ) + + + final String valueStartRub; + + + + /// decimal as string + @JsonKey( + + name: r'xirr', + required: true, + includeIfNull: true, + ) + + + final String? xirr; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReturnsOut && + other.absPnlRub == absPnlRub && + other.dateFrom == dateFrom && + other.dateTo == dateTo && + other.externalFlowRub == externalFlowRub && + other.period == period && + other.twr == twr && + other.twrAnnualized == twrAnnualized && + other.twrDaysSkipped == twrDaysSkipped && + other.valueEndRub == valueEndRub && + other.valueStartRub == valueStartRub && + other.xirr == xirr; + + @override + int get hashCode => + absPnlRub.hashCode + + dateFrom.hashCode + + dateTo.hashCode + + externalFlowRub.hashCode + + period.hashCode + + (twr == null ? 0 : twr.hashCode) + + (twrAnnualized == null ? 0 : twrAnnualized.hashCode) + + twrDaysSkipped.hashCode + + valueEndRub.hashCode + + valueStartRub.hashCode + + (xirr == null ? 0 : xirr.hashCode); + + factory ReturnsOut.fromJson(Map json) => _$ReturnsOutFromJson(json); + + Map toJson() => _$ReturnsOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/returns_out.g.dart b/app/packages/api_client/lib/src/model/returns_out.g.dart new file mode 100644 index 0000000..4943d68 --- /dev/null +++ b/app/packages/api_client/lib/src/model/returns_out.g.dart @@ -0,0 +1,241 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'returns_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ReturnsOutCWProxy { + ReturnsOut absPnlRub(String absPnlRub); + + ReturnsOut dateFrom(DateTime dateFrom); + + ReturnsOut dateTo(DateTime dateTo); + + ReturnsOut externalFlowRub(String externalFlowRub); + + ReturnsOut period(String period); + + ReturnsOut twr(String? twr); + + ReturnsOut twrAnnualized(String? twrAnnualized); + + ReturnsOut twrDaysSkipped(int twrDaysSkipped); + + ReturnsOut valueEndRub(String valueEndRub); + + ReturnsOut valueStartRub(String valueStartRub); + + ReturnsOut 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 `ReturnsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReturnsOut(...).copyWith(id: 12, name: "My name") + /// ```` + ReturnsOut call({ + String absPnlRub, + DateTime dateFrom, + DateTime dateTo, + String externalFlowRub, + String period, + String? twr, + String? twrAnnualized, + int twrDaysSkipped, + String valueEndRub, + String valueStartRub, + String? xirr, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReturnsOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReturnsOut.copyWith.fieldName(...)` +class _$ReturnsOutCWProxyImpl implements _$ReturnsOutCWProxy { + const _$ReturnsOutCWProxyImpl(this._value); + + final ReturnsOut _value; + + @override + ReturnsOut absPnlRub(String absPnlRub) => this(absPnlRub: absPnlRub); + + @override + ReturnsOut dateFrom(DateTime dateFrom) => this(dateFrom: dateFrom); + + @override + ReturnsOut dateTo(DateTime dateTo) => this(dateTo: dateTo); + + @override + ReturnsOut externalFlowRub(String externalFlowRub) => + this(externalFlowRub: externalFlowRub); + + @override + ReturnsOut period(String period) => this(period: period); + + @override + ReturnsOut twr(String? twr) => this(twr: twr); + + @override + ReturnsOut twrAnnualized(String? twrAnnualized) => + this(twrAnnualized: twrAnnualized); + + @override + ReturnsOut twrDaysSkipped(int twrDaysSkipped) => + this(twrDaysSkipped: twrDaysSkipped); + + @override + ReturnsOut valueEndRub(String valueEndRub) => this(valueEndRub: valueEndRub); + + @override + ReturnsOut valueStartRub(String valueStartRub) => + this(valueStartRub: valueStartRub); + + @override + ReturnsOut 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 `ReturnsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReturnsOut(...).copyWith(id: 12, name: "My name") + /// ```` + ReturnsOut call({ + Object? absPnlRub = const $CopyWithPlaceholder(), + Object? dateFrom = const $CopyWithPlaceholder(), + Object? dateTo = const $CopyWithPlaceholder(), + Object? externalFlowRub = const $CopyWithPlaceholder(), + Object? period = const $CopyWithPlaceholder(), + Object? twr = const $CopyWithPlaceholder(), + Object? twrAnnualized = const $CopyWithPlaceholder(), + Object? twrDaysSkipped = const $CopyWithPlaceholder(), + Object? valueEndRub = const $CopyWithPlaceholder(), + Object? valueStartRub = const $CopyWithPlaceholder(), + Object? xirr = const $CopyWithPlaceholder(), + }) { + return ReturnsOut( + absPnlRub: absPnlRub == const $CopyWithPlaceholder() + ? _value.absPnlRub + // ignore: cast_nullable_to_non_nullable + : absPnlRub as String, + dateFrom: dateFrom == const $CopyWithPlaceholder() + ? _value.dateFrom + // ignore: cast_nullable_to_non_nullable + : dateFrom as DateTime, + dateTo: dateTo == const $CopyWithPlaceholder() + ? _value.dateTo + // ignore: cast_nullable_to_non_nullable + : dateTo as DateTime, + externalFlowRub: externalFlowRub == const $CopyWithPlaceholder() + ? _value.externalFlowRub + // ignore: cast_nullable_to_non_nullable + : externalFlowRub as String, + period: period == const $CopyWithPlaceholder() + ? _value.period + // ignore: cast_nullable_to_non_nullable + : period as String, + twr: twr == const $CopyWithPlaceholder() + ? _value.twr + // ignore: cast_nullable_to_non_nullable + : twr as String?, + twrAnnualized: twrAnnualized == const $CopyWithPlaceholder() + ? _value.twrAnnualized + // ignore: cast_nullable_to_non_nullable + : twrAnnualized as String?, + twrDaysSkipped: twrDaysSkipped == const $CopyWithPlaceholder() + ? _value.twrDaysSkipped + // ignore: cast_nullable_to_non_nullable + : twrDaysSkipped as int, + valueEndRub: valueEndRub == const $CopyWithPlaceholder() + ? _value.valueEndRub + // ignore: cast_nullable_to_non_nullable + : valueEndRub as String, + valueStartRub: valueStartRub == const $CopyWithPlaceholder() + ? _value.valueStartRub + // ignore: cast_nullable_to_non_nullable + : valueStartRub as String, + xirr: xirr == const $CopyWithPlaceholder() + ? _value.xirr + // ignore: cast_nullable_to_non_nullable + : xirr as String?, + ); + } +} + +extension $ReturnsOutCopyWith on ReturnsOut { + /// Returns a callable class that can be used as follows: `instanceOfReturnsOut.copyWith(...)` or like so:`instanceOfReturnsOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ReturnsOutCWProxy get copyWith => _$ReturnsOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ReturnsOut _$ReturnsOutFromJson(Map json) => $checkedCreate( + 'ReturnsOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'abs_pnl_rub', + 'date_from', + 'date_to', + 'external_flow_rub', + 'period', + 'twr', + 'twr_annualized', + 'twr_days_skipped', + 'value_end_rub', + 'value_start_rub', + 'xirr', + ], + ); + final val = ReturnsOut( + absPnlRub: $checkedConvert('abs_pnl_rub', (v) => v as String), + dateFrom: $checkedConvert( + 'date_from', + (v) => DateTime.parse(v as String), + ), + dateTo: $checkedConvert('date_to', (v) => DateTime.parse(v as String)), + externalFlowRub: $checkedConvert('external_flow_rub', (v) => v as String), + period: $checkedConvert('period', (v) => v as String), + twr: $checkedConvert('twr', (v) => v as String?), + twrAnnualized: $checkedConvert('twr_annualized', (v) => v as String?), + twrDaysSkipped: $checkedConvert( + 'twr_days_skipped', + (v) => (v as num).toInt(), + ), + valueEndRub: $checkedConvert('value_end_rub', (v) => v as String), + valueStartRub: $checkedConvert('value_start_rub', (v) => v as String), + xirr: $checkedConvert('xirr', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'absPnlRub': 'abs_pnl_rub', + 'dateFrom': 'date_from', + 'dateTo': 'date_to', + 'externalFlowRub': 'external_flow_rub', + 'twrAnnualized': 'twr_annualized', + 'twrDaysSkipped': 'twr_days_skipped', + 'valueEndRub': 'value_end_rub', + 'valueStartRub': 'value_start_rub', + }, +); + +Map _$ReturnsOutToJson(ReturnsOut instance) => + { + 'abs_pnl_rub': instance.absPnlRub, + 'date_from': instance.dateFrom.toIso8601String(), + 'date_to': instance.dateTo.toIso8601String(), + 'external_flow_rub': instance.externalFlowRub, + 'period': instance.period, + 'twr': instance.twr, + 'twr_annualized': instance.twrAnnualized, + 'twr_days_skipped': instance.twrDaysSkipped, + 'value_end_rub': instance.valueEndRub, + 'value_start_rub': instance.valueStartRub, + 'xirr': instance.xirr, + }; diff --git a/app/packages/api_client/lib/src/model/scope_out.dart b/app/packages/api_client/lib/src/model/scope_out.dart new file mode 100644 index 0000000..4e59447 --- /dev/null +++ b/app/packages/api_client/lib/src/model/scope_out.dart @@ -0,0 +1,90 @@ +// +// 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_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ScopeOut { + /// Returns a new [ScopeOut] instance. + ScopeOut({ + + required this.accountIds, + + required this.name, + + required this.scope, + }); + + @JsonKey( + + name: r'account_ids', + required: true, + includeIfNull: false, + ) + + + final List accountIds; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'scope', + required: true, + includeIfNull: false, + ) + + + final String scope; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ScopeOut && + other.accountIds == accountIds && + other.name == name && + other.scope == scope; + + @override + int get hashCode => + accountIds.hashCode + + name.hashCode + + scope.hashCode; + + factory ScopeOut.fromJson(Map json) => _$ScopeOutFromJson(json); + + Map toJson() => _$ScopeOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/scope_out.g.dart b/app/packages/api_client/lib/src/model/scope_out.g.dart new file mode 100644 index 0000000..2513447 --- /dev/null +++ b/app/packages/api_client/lib/src/model/scope_out.g.dart @@ -0,0 +1,97 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'scope_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ScopeOutCWProxy { + ScopeOut accountIds(List accountIds); + + ScopeOut name(String name); + + ScopeOut scope(String scope); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScopeOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ScopeOut(...).copyWith(id: 12, name: "My name") + /// ```` + ScopeOut call({List accountIds, String name, String scope}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfScopeOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfScopeOut.copyWith.fieldName(...)` +class _$ScopeOutCWProxyImpl implements _$ScopeOutCWProxy { + const _$ScopeOutCWProxyImpl(this._value); + + final ScopeOut _value; + + @override + ScopeOut accountIds(List accountIds) => this(accountIds: accountIds); + + @override + ScopeOut name(String name) => this(name: name); + + @override + ScopeOut scope(String scope) => this(scope: scope); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScopeOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ScopeOut(...).copyWith(id: 12, name: "My name") + /// ```` + ScopeOut call({ + Object? accountIds = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? scope = const $CopyWithPlaceholder(), + }) { + return ScopeOut( + 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, + scope: scope == const $CopyWithPlaceholder() + ? _value.scope + // ignore: cast_nullable_to_non_nullable + : scope as String, + ); + } +} + +extension $ScopeOutCopyWith on ScopeOut { + /// Returns a callable class that can be used as follows: `instanceOfScopeOut.copyWith(...)` or like so:`instanceOfScopeOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ScopeOutCWProxy get copyWith => _$ScopeOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ScopeOut _$ScopeOutFromJson(Map json) => + $checkedCreate('ScopeOut', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['account_ids', 'name', 'scope']); + final val = ScopeOut( + accountIds: $checkedConvert( + 'account_ids', + (v) => (v as List).map((e) => (e as num).toInt()).toList(), + ), + name: $checkedConvert('name', (v) => v as String), + scope: $checkedConvert('scope', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'accountIds': 'account_ids'}); + +Map _$ScopeOutToJson(ScopeOut instance) => { + 'account_ids': instance.accountIds, + 'name': instance.name, + 'scope': instance.scope, +}; diff --git a/app/packages/api_client/lib/src/model/summary_out.dart b/app/packages/api_client/lib/src/model/summary_out.dart new file mode 100644 index 0000000..5fa9f97 --- /dev/null +++ b/app/packages/api_client/lib/src/model/summary_out.dart @@ -0,0 +1,274 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/returns_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'summary_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SummaryOut { + /// Returns a new [SummaryOut] instance. + SummaryOut({ + + required this.asOf, + + required this.cashRub, + + required this.computedAt, + + required this.holdingCount, + + required this.incomeRub, + + required this.investedNetRub, + + required this.marketValueRub, + + required this.pnlTotalRub, + + required this.realizedPnlRub, + + required this.returns, + + required this.scope, + + required this.staleCount, + + required this.totalRub, + + required this.unpricedCount, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: true, + ) + + + final DateTime? asOf; + + + + /// decimal as string + @JsonKey( + + name: r'cash_rub', + required: true, + includeIfNull: false, + ) + + + final String cashRub; + + + + @JsonKey( + + name: r'computed_at', + required: true, + includeIfNull: true, + ) + + + final DateTime? computedAt; + + + + @JsonKey( + + name: r'holding_count', + required: true, + includeIfNull: false, + ) + + + final int holdingCount; + + + + /// decimal as string + @JsonKey( + + name: r'income_rub', + required: true, + includeIfNull: false, + ) + + + final String incomeRub; + + + + /// decimal as string + @JsonKey( + + name: r'invested_net_rub', + required: true, + includeIfNull: false, + ) + + + final String investedNetRub; + + + + /// decimal as string + @JsonKey( + + name: r'market_value_rub', + required: true, + includeIfNull: false, + ) + + + final String marketValueRub; + + + + /// decimal as string + @JsonKey( + + name: r'pnl_total_rub', + required: true, + includeIfNull: true, + ) + + + final String? pnlTotalRub; + + + + /// decimal as string + @JsonKey( + + name: r'realized_pnl_rub', + required: true, + includeIfNull: false, + ) + + + final String realizedPnlRub; + + + + @JsonKey( + + name: r'returns', + required: true, + includeIfNull: false, + ) + + + final List returns; + + + + @JsonKey( + + name: r'scope', + required: true, + includeIfNull: false, + ) + + + final String scope; + + + + @JsonKey( + + name: r'stale_count', + required: true, + includeIfNull: false, + ) + + + final int staleCount; + + + + /// decimal as string + @JsonKey( + + name: r'total_rub', + required: true, + includeIfNull: false, + ) + + + final String totalRub; + + + + @JsonKey( + + name: r'unpriced_count', + required: true, + includeIfNull: false, + ) + + + final int unpricedCount; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SummaryOut && + other.asOf == asOf && + other.cashRub == cashRub && + other.computedAt == computedAt && + other.holdingCount == holdingCount && + other.incomeRub == incomeRub && + other.investedNetRub == investedNetRub && + other.marketValueRub == marketValueRub && + other.pnlTotalRub == pnlTotalRub && + other.realizedPnlRub == realizedPnlRub && + other.returns == returns && + other.scope == scope && + other.staleCount == staleCount && + other.totalRub == totalRub && + other.unpricedCount == unpricedCount; + + @override + int get hashCode => + (asOf == null ? 0 : asOf.hashCode) + + cashRub.hashCode + + (computedAt == null ? 0 : computedAt.hashCode) + + holdingCount.hashCode + + incomeRub.hashCode + + investedNetRub.hashCode + + marketValueRub.hashCode + + (pnlTotalRub == null ? 0 : pnlTotalRub.hashCode) + + realizedPnlRub.hashCode + + returns.hashCode + + scope.hashCode + + staleCount.hashCode + + totalRub.hashCode + + unpricedCount.hashCode; + + factory SummaryOut.fromJson(Map json) => _$SummaryOutFromJson(json); + + Map toJson() => _$SummaryOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/summary_out.g.dart b/app/packages/api_client/lib/src/model/summary_out.g.dart new file mode 100644 index 0000000..e5928eb --- /dev/null +++ b/app/packages/api_client/lib/src/model/summary_out.g.dart @@ -0,0 +1,295 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'summary_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$SummaryOutCWProxy { + SummaryOut asOf(DateTime? asOf); + + SummaryOut cashRub(String cashRub); + + SummaryOut computedAt(DateTime? computedAt); + + SummaryOut holdingCount(int holdingCount); + + SummaryOut incomeRub(String incomeRub); + + SummaryOut investedNetRub(String investedNetRub); + + SummaryOut marketValueRub(String marketValueRub); + + SummaryOut pnlTotalRub(String? pnlTotalRub); + + SummaryOut realizedPnlRub(String realizedPnlRub); + + SummaryOut returns(List returns); + + SummaryOut scope(String scope); + + SummaryOut staleCount(int staleCount); + + SummaryOut totalRub(String totalRub); + + SummaryOut unpricedCount(int unpricedCount); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SummaryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// SummaryOut(...).copyWith(id: 12, name: "My name") + /// ```` + SummaryOut call({ + DateTime? asOf, + String cashRub, + DateTime? computedAt, + int holdingCount, + String incomeRub, + String investedNetRub, + String marketValueRub, + String? pnlTotalRub, + String realizedPnlRub, + List returns, + String scope, + int staleCount, + String totalRub, + int unpricedCount, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSummaryOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSummaryOut.copyWith.fieldName(...)` +class _$SummaryOutCWProxyImpl implements _$SummaryOutCWProxy { + const _$SummaryOutCWProxyImpl(this._value); + + final SummaryOut _value; + + @override + SummaryOut asOf(DateTime? asOf) => this(asOf: asOf); + + @override + SummaryOut cashRub(String cashRub) => this(cashRub: cashRub); + + @override + SummaryOut computedAt(DateTime? computedAt) => this(computedAt: computedAt); + + @override + SummaryOut holdingCount(int holdingCount) => this(holdingCount: holdingCount); + + @override + SummaryOut incomeRub(String incomeRub) => this(incomeRub: incomeRub); + + @override + SummaryOut investedNetRub(String investedNetRub) => + this(investedNetRub: investedNetRub); + + @override + SummaryOut marketValueRub(String marketValueRub) => + this(marketValueRub: marketValueRub); + + @override + SummaryOut pnlTotalRub(String? pnlTotalRub) => this(pnlTotalRub: pnlTotalRub); + + @override + SummaryOut realizedPnlRub(String realizedPnlRub) => + this(realizedPnlRub: realizedPnlRub); + + @override + SummaryOut returns(List returns) => this(returns: returns); + + @override + SummaryOut scope(String scope) => this(scope: scope); + + @override + SummaryOut staleCount(int staleCount) => this(staleCount: staleCount); + + @override + SummaryOut totalRub(String totalRub) => this(totalRub: totalRub); + + @override + SummaryOut unpricedCount(int unpricedCount) => + this(unpricedCount: unpricedCount); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SummaryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// SummaryOut(...).copyWith(id: 12, name: "My name") + /// ```` + SummaryOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? cashRub = const $CopyWithPlaceholder(), + Object? computedAt = const $CopyWithPlaceholder(), + Object? holdingCount = const $CopyWithPlaceholder(), + Object? incomeRub = const $CopyWithPlaceholder(), + Object? investedNetRub = const $CopyWithPlaceholder(), + Object? marketValueRub = const $CopyWithPlaceholder(), + Object? pnlTotalRub = const $CopyWithPlaceholder(), + Object? realizedPnlRub = const $CopyWithPlaceholder(), + Object? returns = const $CopyWithPlaceholder(), + Object? scope = const $CopyWithPlaceholder(), + Object? staleCount = const $CopyWithPlaceholder(), + Object? totalRub = const $CopyWithPlaceholder(), + Object? unpricedCount = const $CopyWithPlaceholder(), + }) { + return SummaryOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime?, + cashRub: cashRub == const $CopyWithPlaceholder() + ? _value.cashRub + // ignore: cast_nullable_to_non_nullable + : cashRub as String, + computedAt: computedAt == const $CopyWithPlaceholder() + ? _value.computedAt + // ignore: cast_nullable_to_non_nullable + : computedAt as DateTime?, + holdingCount: holdingCount == const $CopyWithPlaceholder() + ? _value.holdingCount + // ignore: cast_nullable_to_non_nullable + : holdingCount as int, + incomeRub: incomeRub == const $CopyWithPlaceholder() + ? _value.incomeRub + // ignore: cast_nullable_to_non_nullable + : incomeRub as String, + investedNetRub: investedNetRub == const $CopyWithPlaceholder() + ? _value.investedNetRub + // ignore: cast_nullable_to_non_nullable + : investedNetRub as String, + marketValueRub: marketValueRub == const $CopyWithPlaceholder() + ? _value.marketValueRub + // ignore: cast_nullable_to_non_nullable + : marketValueRub as String, + pnlTotalRub: pnlTotalRub == const $CopyWithPlaceholder() + ? _value.pnlTotalRub + // ignore: cast_nullable_to_non_nullable + : pnlTotalRub as String?, + realizedPnlRub: realizedPnlRub == const $CopyWithPlaceholder() + ? _value.realizedPnlRub + // ignore: cast_nullable_to_non_nullable + : realizedPnlRub as String, + returns: returns == const $CopyWithPlaceholder() + ? _value.returns + // ignore: cast_nullable_to_non_nullable + : returns as List, + scope: scope == const $CopyWithPlaceholder() + ? _value.scope + // ignore: cast_nullable_to_non_nullable + : scope as String, + staleCount: staleCount == const $CopyWithPlaceholder() + ? _value.staleCount + // ignore: cast_nullable_to_non_nullable + : staleCount as int, + totalRub: totalRub == const $CopyWithPlaceholder() + ? _value.totalRub + // ignore: cast_nullable_to_non_nullable + : totalRub as String, + unpricedCount: unpricedCount == const $CopyWithPlaceholder() + ? _value.unpricedCount + // ignore: cast_nullable_to_non_nullable + : unpricedCount as int, + ); + } +} + +extension $SummaryOutCopyWith on SummaryOut { + /// Returns a callable class that can be used as follows: `instanceOfSummaryOut.copyWith(...)` or like so:`instanceOfSummaryOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$SummaryOutCWProxy get copyWith => _$SummaryOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SummaryOut _$SummaryOutFromJson(Map json) => $checkedCreate( + 'SummaryOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'as_of', + 'cash_rub', + 'computed_at', + 'holding_count', + 'income_rub', + 'invested_net_rub', + 'market_value_rub', + 'pnl_total_rub', + 'realized_pnl_rub', + 'returns', + 'scope', + 'stale_count', + 'total_rub', + 'unpriced_count', + ], + ); + final val = SummaryOut( + asOf: $checkedConvert( + 'as_of', + (v) => v == null ? null : DateTime.parse(v as String), + ), + cashRub: $checkedConvert('cash_rub', (v) => v as String), + computedAt: $checkedConvert( + 'computed_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + holdingCount: $checkedConvert('holding_count', (v) => (v as num).toInt()), + incomeRub: $checkedConvert('income_rub', (v) => v as String), + investedNetRub: $checkedConvert('invested_net_rub', (v) => v as String), + marketValueRub: $checkedConvert('market_value_rub', (v) => v as String), + pnlTotalRub: $checkedConvert('pnl_total_rub', (v) => v as String?), + realizedPnlRub: $checkedConvert('realized_pnl_rub', (v) => v as String), + returns: $checkedConvert( + 'returns', + (v) => (v as List) + .map((e) => ReturnsOut.fromJson(e as Map)) + .toList(), + ), + scope: $checkedConvert('scope', (v) => v as String), + staleCount: $checkedConvert('stale_count', (v) => (v as num).toInt()), + totalRub: $checkedConvert('total_rub', (v) => v as String), + unpricedCount: $checkedConvert( + 'unpriced_count', + (v) => (v as num).toInt(), + ), + ); + return val; + }, + fieldKeyMap: const { + 'asOf': 'as_of', + 'cashRub': 'cash_rub', + 'computedAt': 'computed_at', + 'holdingCount': 'holding_count', + 'incomeRub': 'income_rub', + 'investedNetRub': 'invested_net_rub', + 'marketValueRub': 'market_value_rub', + 'pnlTotalRub': 'pnl_total_rub', + 'realizedPnlRub': 'realized_pnl_rub', + 'staleCount': 'stale_count', + 'totalRub': 'total_rub', + 'unpricedCount': 'unpriced_count', + }, +); + +Map _$SummaryOutToJson(SummaryOut instance) => + { + 'as_of': instance.asOf?.toIso8601String(), + 'cash_rub': instance.cashRub, + 'computed_at': instance.computedAt?.toIso8601String(), + 'holding_count': instance.holdingCount, + 'income_rub': instance.incomeRub, + 'invested_net_rub': instance.investedNetRub, + 'market_value_rub': instance.marketValueRub, + 'pnl_total_rub': instance.pnlTotalRub, + 'realized_pnl_rub': instance.realizedPnlRub, + 'returns': instance.returns.map((e) => e.toJson()).toList(), + 'scope': instance.scope, + 'stale_count': instance.staleCount, + 'total_rub': instance.totalRub, + 'unpriced_count': instance.unpricedCount, + }; diff --git a/app/packages/api_client/lib/src/model/value_day.dart b/app/packages/api_client/lib/src/model/value_day.dart new file mode 100644 index 0000000..42bfd2a --- /dev/null +++ b/app/packages/api_client/lib/src/model/value_day.dart @@ -0,0 +1,225 @@ +// +// 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 'value_day.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ValueDay { + /// Returns a new [ValueDay] instance. + ValueDay({ + + required this.accruedInterestRub, + + required this.cashRub, + + required this.d, + + required this.externalFlowRub, + + required this.investedNetRub, + + required this.marketValueRub, + + required this.missingFxCount, + + required this.missingPriceCount, + + required this.pnlTotalRub, + + required this.stalePriceCount, + + required this.totalRub, + }); + + /// decimal as string + @JsonKey( + + name: r'accrued_interest_rub', + required: true, + includeIfNull: false, + ) + + + final String accruedInterestRub; + + + + /// decimal as string + @JsonKey( + + name: r'cash_rub', + required: true, + includeIfNull: false, + ) + + + final String cashRub; + + + + @JsonKey( + + name: r'd', + required: true, + includeIfNull: false, + ) + + + final DateTime d; + + + + /// decimal as string + @JsonKey( + + name: r'external_flow_rub', + required: true, + includeIfNull: false, + ) + + + final String externalFlowRub; + + + + /// decimal as string + @JsonKey( + + name: r'invested_net_rub', + required: true, + includeIfNull: false, + ) + + + final String investedNetRub; + + + + /// decimal as string + @JsonKey( + + name: r'market_value_rub', + required: true, + includeIfNull: false, + ) + + + final String marketValueRub; + + + + @JsonKey( + + name: r'missing_fx_count', + required: true, + includeIfNull: false, + ) + + + final int missingFxCount; + + + + @JsonKey( + + name: r'missing_price_count', + required: true, + includeIfNull: false, + ) + + + final int missingPriceCount; + + + + /// decimal as string + @JsonKey( + + name: r'pnl_total_rub', + required: true, + includeIfNull: true, + ) + + + final String? pnlTotalRub; + + + + @JsonKey( + + name: r'stale_price_count', + required: true, + includeIfNull: false, + ) + + + final int stalePriceCount; + + + + /// decimal as string + @JsonKey( + + name: r'total_rub', + required: true, + includeIfNull: false, + ) + + + final String totalRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ValueDay && + other.accruedInterestRub == accruedInterestRub && + other.cashRub == cashRub && + other.d == d && + other.externalFlowRub == externalFlowRub && + other.investedNetRub == investedNetRub && + other.marketValueRub == marketValueRub && + other.missingFxCount == missingFxCount && + other.missingPriceCount == missingPriceCount && + other.pnlTotalRub == pnlTotalRub && + other.stalePriceCount == stalePriceCount && + other.totalRub == totalRub; + + @override + int get hashCode => + accruedInterestRub.hashCode + + cashRub.hashCode + + d.hashCode + + externalFlowRub.hashCode + + investedNetRub.hashCode + + marketValueRub.hashCode + + missingFxCount.hashCode + + missingPriceCount.hashCode + + (pnlTotalRub == null ? 0 : pnlTotalRub.hashCode) + + stalePriceCount.hashCode + + totalRub.hashCode; + + factory ValueDay.fromJson(Map json) => _$ValueDayFromJson(json); + + Map toJson() => _$ValueDayToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/value_day.g.dart b/app/packages/api_client/lib/src/model/value_day.g.dart new file mode 100644 index 0000000..c1050eb --- /dev/null +++ b/app/packages/api_client/lib/src/model/value_day.g.dart @@ -0,0 +1,251 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'value_day.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ValueDayCWProxy { + ValueDay accruedInterestRub(String accruedInterestRub); + + ValueDay cashRub(String cashRub); + + ValueDay d(DateTime d); + + ValueDay externalFlowRub(String externalFlowRub); + + ValueDay investedNetRub(String investedNetRub); + + ValueDay marketValueRub(String marketValueRub); + + ValueDay missingFxCount(int missingFxCount); + + ValueDay missingPriceCount(int missingPriceCount); + + ValueDay pnlTotalRub(String? pnlTotalRub); + + ValueDay stalePriceCount(int stalePriceCount); + + ValueDay totalRub(String totalRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ValueDay(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ValueDay(...).copyWith(id: 12, name: "My name") + /// ```` + ValueDay call({ + String accruedInterestRub, + String cashRub, + DateTime d, + String externalFlowRub, + String investedNetRub, + String marketValueRub, + int missingFxCount, + int missingPriceCount, + String? pnlTotalRub, + int stalePriceCount, + String totalRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfValueDay.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfValueDay.copyWith.fieldName(...)` +class _$ValueDayCWProxyImpl implements _$ValueDayCWProxy { + const _$ValueDayCWProxyImpl(this._value); + + final ValueDay _value; + + @override + ValueDay accruedInterestRub(String accruedInterestRub) => + this(accruedInterestRub: accruedInterestRub); + + @override + ValueDay cashRub(String cashRub) => this(cashRub: cashRub); + + @override + ValueDay d(DateTime d) => this(d: d); + + @override + ValueDay externalFlowRub(String externalFlowRub) => + this(externalFlowRub: externalFlowRub); + + @override + ValueDay investedNetRub(String investedNetRub) => + this(investedNetRub: investedNetRub); + + @override + ValueDay marketValueRub(String marketValueRub) => + this(marketValueRub: marketValueRub); + + @override + ValueDay missingFxCount(int missingFxCount) => + this(missingFxCount: missingFxCount); + + @override + ValueDay missingPriceCount(int missingPriceCount) => + this(missingPriceCount: missingPriceCount); + + @override + ValueDay pnlTotalRub(String? pnlTotalRub) => this(pnlTotalRub: pnlTotalRub); + + @override + ValueDay stalePriceCount(int stalePriceCount) => + this(stalePriceCount: stalePriceCount); + + @override + ValueDay totalRub(String totalRub) => this(totalRub: totalRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ValueDay(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ValueDay(...).copyWith(id: 12, name: "My name") + /// ```` + ValueDay call({ + Object? accruedInterestRub = const $CopyWithPlaceholder(), + Object? cashRub = const $CopyWithPlaceholder(), + Object? d = const $CopyWithPlaceholder(), + Object? externalFlowRub = const $CopyWithPlaceholder(), + Object? investedNetRub = const $CopyWithPlaceholder(), + Object? marketValueRub = const $CopyWithPlaceholder(), + Object? missingFxCount = const $CopyWithPlaceholder(), + Object? missingPriceCount = const $CopyWithPlaceholder(), + Object? pnlTotalRub = const $CopyWithPlaceholder(), + Object? stalePriceCount = const $CopyWithPlaceholder(), + Object? totalRub = const $CopyWithPlaceholder(), + }) { + return ValueDay( + accruedInterestRub: accruedInterestRub == const $CopyWithPlaceholder() + ? _value.accruedInterestRub + // ignore: cast_nullable_to_non_nullable + : accruedInterestRub as String, + cashRub: cashRub == const $CopyWithPlaceholder() + ? _value.cashRub + // ignore: cast_nullable_to_non_nullable + : cashRub as String, + d: d == const $CopyWithPlaceholder() + ? _value.d + // ignore: cast_nullable_to_non_nullable + : d as DateTime, + externalFlowRub: externalFlowRub == const $CopyWithPlaceholder() + ? _value.externalFlowRub + // ignore: cast_nullable_to_non_nullable + : externalFlowRub as String, + investedNetRub: investedNetRub == const $CopyWithPlaceholder() + ? _value.investedNetRub + // ignore: cast_nullable_to_non_nullable + : investedNetRub as String, + marketValueRub: marketValueRub == const $CopyWithPlaceholder() + ? _value.marketValueRub + // ignore: cast_nullable_to_non_nullable + : marketValueRub as String, + missingFxCount: missingFxCount == const $CopyWithPlaceholder() + ? _value.missingFxCount + // ignore: cast_nullable_to_non_nullable + : missingFxCount as int, + missingPriceCount: missingPriceCount == const $CopyWithPlaceholder() + ? _value.missingPriceCount + // ignore: cast_nullable_to_non_nullable + : missingPriceCount as int, + pnlTotalRub: pnlTotalRub == const $CopyWithPlaceholder() + ? _value.pnlTotalRub + // ignore: cast_nullable_to_non_nullable + : pnlTotalRub as String?, + stalePriceCount: stalePriceCount == const $CopyWithPlaceholder() + ? _value.stalePriceCount + // ignore: cast_nullable_to_non_nullable + : stalePriceCount as int, + totalRub: totalRub == const $CopyWithPlaceholder() + ? _value.totalRub + // ignore: cast_nullable_to_non_nullable + : totalRub as String, + ); + } +} + +extension $ValueDayCopyWith on ValueDay { + /// Returns a callable class that can be used as follows: `instanceOfValueDay.copyWith(...)` or like so:`instanceOfValueDay.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ValueDayCWProxy get copyWith => _$ValueDayCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ValueDay _$ValueDayFromJson(Map json) => $checkedCreate( + 'ValueDay', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'accrued_interest_rub', + 'cash_rub', + 'd', + 'external_flow_rub', + 'invested_net_rub', + 'market_value_rub', + 'missing_fx_count', + 'missing_price_count', + 'pnl_total_rub', + 'stale_price_count', + 'total_rub', + ], + ); + final val = ValueDay( + accruedInterestRub: $checkedConvert( + 'accrued_interest_rub', + (v) => v as String, + ), + cashRub: $checkedConvert('cash_rub', (v) => v as String), + d: $checkedConvert('d', (v) => DateTime.parse(v as String)), + externalFlowRub: $checkedConvert('external_flow_rub', (v) => v as String), + investedNetRub: $checkedConvert('invested_net_rub', (v) => v as String), + marketValueRub: $checkedConvert('market_value_rub', (v) => v as String), + missingFxCount: $checkedConvert( + 'missing_fx_count', + (v) => (v as num).toInt(), + ), + missingPriceCount: $checkedConvert( + 'missing_price_count', + (v) => (v as num).toInt(), + ), + pnlTotalRub: $checkedConvert('pnl_total_rub', (v) => v as String?), + stalePriceCount: $checkedConvert( + 'stale_price_count', + (v) => (v as num).toInt(), + ), + totalRub: $checkedConvert('total_rub', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'accruedInterestRub': 'accrued_interest_rub', + 'cashRub': 'cash_rub', + 'externalFlowRub': 'external_flow_rub', + 'investedNetRub': 'invested_net_rub', + 'marketValueRub': 'market_value_rub', + 'missingFxCount': 'missing_fx_count', + 'missingPriceCount': 'missing_price_count', + 'pnlTotalRub': 'pnl_total_rub', + 'stalePriceCount': 'stale_price_count', + 'totalRub': 'total_rub', + }, +); + +Map _$ValueDayToJson(ValueDay instance) => { + 'accrued_interest_rub': instance.accruedInterestRub, + 'cash_rub': instance.cashRub, + 'd': instance.d.toIso8601String(), + 'external_flow_rub': instance.externalFlowRub, + 'invested_net_rub': instance.investedNetRub, + 'market_value_rub': instance.marketValueRub, + 'missing_fx_count': instance.missingFxCount, + 'missing_price_count': instance.missingPriceCount, + 'pnl_total_rub': instance.pnlTotalRub, + 'stale_price_count': instance.stalePriceCount, + 'total_rub': instance.totalRub, +}; diff --git a/app/packages/api_client/test/allocation_bucket_test.dart b/app/packages/api_client/test/allocation_bucket_test.dart new file mode 100644 index 0000000..657dd2c --- /dev/null +++ b/app/packages/api_client/test/allocation_bucket_test.dart @@ -0,0 +1,38 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for AllocationBucket +void main() { + final AllocationBucket? instance = /* AllocationBucket(...) */ null; + // TODO add properties to the entity + + group(AllocationBucket, () { + // String bucket + test('to test the property `bucket`', () async { + // TODO + }); + + // AllocationDimension dimension + test('to test the property `dimension`', () async { + // TODO + }); + + // int holdingCount + test('to test the property `holdingCount`', () async { + // TODO + }); + + // decimal as string + // String valueRub + test('to test the property `valueRub`', () async { + // TODO + }); + + // decimal as string + // String weight + test('to test the property `weight`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/allocation_dimension_test.dart b/app/packages/api_client/test/allocation_dimension_test.dart new file mode 100644 index 0000000..40a4b3f --- /dev/null +++ b/app/packages/api_client/test/allocation_dimension_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for AllocationDimension +void main() { + + group(AllocationDimension, () { + }); +} diff --git a/app/packages/api_client/test/analytics_api_test.dart b/app/packages/api_client/test/analytics_api_test.dart new file mode 100644 index 0000000..f2d4293 --- /dev/null +++ b/app/packages/api_client/test/analytics_api_test.dart @@ -0,0 +1,65 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for AnalyticsApi +void main() { + final instance = FintrackerApi().getAnalyticsApi(); + + group(AnalyticsApi, () { + // Allocation + // + // Buckets of one dimension (or all four), largest first. + // + //Future> analyticsAllocation({ String scope, AllocationDimension dimension }) async + test('test analyticsAllocation', () async { + // TODO + }); + + // Holdings + // + // Open positions, most valuable first; unpriced ones last with null values. + // + //Future> analyticsHoldings({ String scope }) async + test('test analyticsHoldings', () async { + // TODO + }); + + // Returns + // + // XIRR and TWR per period, shortest first. + // + //Future> analyticsReturns({ String scope }) async + test('test analyticsReturns', () async { + // TODO + }); + + // Scopes + // + // Every set of accounts the metrics were built for. + // + //Future> analyticsScopes() async + test('test analyticsScopes', () async { + // TODO + }); + + // Summary + // + // One screen's worth: the latest day, the totals it adds up to, and the returns. + // + //Future analyticsSummary({ String scope }) async + test('test analyticsSummary', () async { + // TODO + }); + + // Value Series + // + // Daily portfolio value; defaults to the last 365 days. + // + //Future> analyticsValueSeries({ String scope, DateTime from, DateTime to }) async + test('test analyticsValueSeries', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/asset_class_test.dart b/app/packages/api_client/test/asset_class_test.dart new file mode 100644 index 0000000..5b83b95 --- /dev/null +++ b/app/packages/api_client/test/asset_class_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for AssetClass +void main() { + + group(AssetClass, () { + }); +} diff --git a/app/packages/api_client/test/event_kind_test.dart b/app/packages/api_client/test/event_kind_test.dart new file mode 100644 index 0000000..405222b --- /dev/null +++ b/app/packages/api_client/test/event_kind_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for EventKind +void main() { + + group(EventKind, () { + }); +} diff --git a/app/packages/api_client/test/event_out_test.dart b/app/packages/api_client/test/event_out_test.dart new file mode 100644 index 0000000..7def366 --- /dev/null +++ b/app/packages/api_client/test/event_out_test.dart @@ -0,0 +1,113 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for EventOut +void main() { + final EventOut? instance = /* EventOut(...) */ null; + // TODO add properties to the entity + + group(EventOut, () { + // 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 + }); + + // decimal as string + // String amountRub + test('to test the property `amountRub`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // bool externalFlow + test('to test the property `externalFlow`', () async { + // TODO + }); + + // decimal as string + // String fee + test('to test the property `fee`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () 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 + }); + + // String priceCurrency + test('to test the property `priceCurrency`', () async { + // TODO + }); + + // decimal as string + // String quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // EventStatus status + test('to test the property `status`', () async { + // TODO + }); + + // decimal as string + // String tax + test('to test the property `tax`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + // DateTime tradeDate + test('to test the property `tradeDate`', () async { + // TODO + }); + + // DateTime ts + test('to test the property `ts`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/event_page_test.dart b/app/packages/api_client/test/event_page_test.dart new file mode 100644 index 0000000..0254eb4 --- /dev/null +++ b/app/packages/api_client/test/event_page_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for EventPage +void main() { + final EventPage? instance = /* EventPage(...) */ null; + // TODO add properties to the entity + + group(EventPage, () { + // List items + test('to test the property `items`', () async { + // TODO + }); + + // int page + test('to test the property `page`', () async { + // TODO + }); + + // int pageSize + test('to test the property `pageSize`', () async { + // TODO + }); + + // int total + test('to test the property `total`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/event_status_test.dart b/app/packages/api_client/test/event_status_test.dart new file mode 100644 index 0000000..d3bddde --- /dev/null +++ b/app/packages/api_client/test/event_status_test.dart @@ -0,0 +1,9 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for EventStatus +void main() { + + group(EventStatus, () { + }); +} diff --git a/app/packages/api_client/test/events_api_test.dart b/app/packages/api_client/test/events_api_test.dart new file mode 100644 index 0000000..e078f3f --- /dev/null +++ b/app/packages/api_client/test/events_api_test.dart @@ -0,0 +1,20 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for EventsApi +void main() { + final instance = FintrackerApi().getEventsApi(); + + group(EventsApi, () { + // List + // + // One page of ledger events, newest first, with RUB amounts at each own date's rate. + // + //Future eventsList({ DateTime from, DateTime to, int accountId, int instrumentId, EventKind kind, EventStatus status, bool externalFlow, String q, int page, int pageSize }) async + test('test eventsList', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/holding_out_test.dart b/app/packages/api_client/test/holding_out_test.dart new file mode 100644 index 0000000..65cea7b --- /dev/null +++ b/app/packages/api_client/test/holding_out_test.dart @@ -0,0 +1,155 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for HoldingOut +void main() { + final HoldingOut? instance = /* HoldingOut(...) */ null; + // TODO add properties to the entity + + group(HoldingOut, () { + // decimal as string + // String accruedInterestRub + test('to test the property `accruedInterestRub`', () async { + // TODO + }); + + // AssetClass assetClass + test('to test the property `assetClass`', () async { + // TODO + }); + + // decimal as string + // String avgCost + test('to test the property `avgCost`', () async { + // TODO + }); + + // String board + test('to test the property `board`', () async { + // TODO + }); + + // String costCurrency + test('to test the property `costCurrency`', () async { + // TODO + }); + + // decimal as string + // String costTotalRub + test('to test the property `costTotalRub`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // int daysHeld + test('to test the property `daysHeld`', () async { + // TODO + }); + + // DateTime firstBuyDate + test('to test the property `firstBuyDate`', () async { + // TODO + }); + + // decimal as string + // String incomeRub + test('to test the property `incomeRub`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // decimal as string + // String ldvEligibleQty + test('to test the property `ldvEligibleQty`', () async { + // TODO + }); + + // decimal as string + // String marketPrice + test('to test the property `marketPrice`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String priceCurrency + test('to test the property `priceCurrency`', () async { + // TODO + }); + + // DateTime priceDate + test('to test the property `priceDate`', () async { + // TODO + }); + + // String priceStatus + test('to test the property `priceStatus`', () async { + // TODO + }); + + // decimal as string + // String qty + test('to test the property `qty`', () async { + // TODO + }); + + // decimal as string + // String realizedPnlRub + test('to test the property `realizedPnlRub`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + // decimal as string + // String unrealizedPnlNative + test('to test the property `unrealizedPnlNative`', () async { + // TODO + }); + + // decimal as string + // String unrealizedPnlRub + test('to test the property `unrealizedPnlRub`', () async { + // TODO + }); + + // decimal as string + // String valueNative + test('to test the property `valueNative`', () async { + // TODO + }); + + // decimal as string + // String valueRub + test('to test the property `valueRub`', () async { + // TODO + }); + + // decimal as string + // String weight + test('to test the property `weight`', () async { + // TODO + }); + + // decimal as string + // String xirr + test('to test the property `xirr`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/instrument_detail_test.dart b/app/packages/api_client/test/instrument_detail_test.dart new file mode 100644 index 0000000..c676ef4 --- /dev/null +++ b/app/packages/api_client/test/instrument_detail_test.dart @@ -0,0 +1,36 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for InstrumentDetail +void main() { + final InstrumentDetail? instance = /* InstrumentDetail(...) */ null; + // TODO add properties to the entity + + group(InstrumentDetail, () { + // List events + test('to test the property `events`', () async { + // TODO + }); + + // HoldingOut holding + test('to test the property `holding`', () async { + // TODO + }); + + // InstrumentOut instrument + test('to test the property `instrument`', () async { + // TODO + }); + + // List lots + test('to test the property `lots`', () async { + // TODO + }); + + // List prices + test('to test the property `prices`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/instrument_out_test.dart b/app/packages/api_client/test/instrument_out_test.dart new file mode 100644 index 0000000..8c94bc7 --- /dev/null +++ b/app/packages/api_client/test/instrument_out_test.dart @@ -0,0 +1,97 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for InstrumentOut +void main() { + final InstrumentOut? instance = /* InstrumentOut(...) */ null; + // TODO add properties to the entity + + group(InstrumentOut, () { + // AssetClass assetClass + test('to test the property `assetClass`', () async { + // TODO + }); + + // String board + test('to test the property `board`', () async { + // TODO + }); + + // String country + test('to test the property `country`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // String exchange + test('to test the property `exchange`', () async { + // TODO + }); + + // String figi + test('to test the property `figi`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // bool isActive + test('to test the property `isActive`', () async { + // TODO + }); + + // String isin + test('to test the property `isin`', () async { + // TODO + }); + + // String issuer + test('to test the property `issuer`', () async { + // TODO + }); + + // int lot + test('to test the property `lot`', () async { + // TODO + }); + + // DateTime maturityDate + test('to test the property `maturityDate`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // decimal as string + // String nominal + test('to test the property `nominal`', () async { + // TODO + }); + + // String nominalCurrency + test('to test the property `nominalCurrency`', () async { + // TODO + }); + + // String sector + test('to test the property `sector`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/instruments_api_test.dart b/app/packages/api_client/test/instruments_api_test.dart new file mode 100644 index 0000000..cc1fc2a --- /dev/null +++ b/app/packages/api_client/test/instruments_api_test.dart @@ -0,0 +1,27 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for InstrumentsApi +void main() { + final instance = FintrackerApi().getInstrumentsApi(); + + group(InstrumentsApi, () { + // Get + // + // One instrument with its position, open lots, events and price history. + // + //Future instrumentsGet(int instrumentId, { String scope, DateTime pricesFrom }) async + test('test instrumentsGet', () async { + // TODO + }); + + // List + // + //Future> instrumentsList({ String q, AssetClass assetClass, bool heldOnly, int limit }) async + test('test instrumentsList', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/lot_out_test.dart b/app/packages/api_client/test/lot_out_test.dart new file mode 100644 index 0000000..9f3ff2a --- /dev/null +++ b/app/packages/api_client/test/lot_out_test.dart @@ -0,0 +1,60 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for LotOut +void main() { + final LotOut? instance = /* LotOut(...) */ null; + // TODO add properties to the entity + + group(LotOut, () { + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // DateTime closedAt + test('to test the property `closedAt`', () async { + // TODO + }); + + // String costCurrency + test('to test the property `costCurrency`', () async { + // TODO + }); + + // decimal as string + // String costPerUnit + test('to test the property `costPerUnit`', () async { + // TODO + }); + + // decimal as string + // String costTotalRub + test('to test the property `costTotalRub`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // DateTime openDate + test('to test the property `openDate`', () async { + // TODO + }); + + // decimal as string + // String qtyOpen + test('to test the property `qtyOpen`', () async { + // TODO + }); + + // decimal as string + // String qtyRemaining + test('to test the property `qtyRemaining`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/price_point_test.dart b/app/packages/api_client/test/price_point_test.dart new file mode 100644 index 0000000..49a4249 --- /dev/null +++ b/app/packages/api_client/test/price_point_test.dart @@ -0,0 +1,33 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PricePoint +void main() { + final PricePoint? instance = /* PricePoint(...) */ null; + // TODO add properties to the entity + + group(PricePoint, () { + // decimal as string + // String accruedInterest + test('to test the property `accruedInterest`', () async { + // TODO + }); + + // decimal as string + // String close + test('to test the property `close`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime d + test('to test the property `d`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/returns_out_test.dart b/app/packages/api_client/test/returns_out_test.dart new file mode 100644 index 0000000..07d61ae --- /dev/null +++ b/app/packages/api_client/test/returns_out_test.dart @@ -0,0 +1,73 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ReturnsOut +void main() { + final ReturnsOut? instance = /* ReturnsOut(...) */ null; + // TODO add properties to the entity + + group(ReturnsOut, () { + // decimal as string + // String absPnlRub + test('to test the property `absPnlRub`', () async { + // TODO + }); + + // DateTime dateFrom + test('to test the property `dateFrom`', () async { + // TODO + }); + + // DateTime dateTo + test('to test the property `dateTo`', () async { + // TODO + }); + + // decimal as string + // String externalFlowRub + test('to test the property `externalFlowRub`', () async { + // TODO + }); + + // String period + test('to test the property `period`', () async { + // TODO + }); + + // decimal as string + // String twr + test('to test the property `twr`', () async { + // TODO + }); + + // decimal as string + // String twrAnnualized + test('to test the property `twrAnnualized`', () async { + // TODO + }); + + // int twrDaysSkipped + test('to test the property `twrDaysSkipped`', () async { + // TODO + }); + + // decimal as string + // String valueEndRub + test('to test the property `valueEndRub`', () async { + // TODO + }); + + // decimal as string + // String valueStartRub + test('to test the property `valueStartRub`', () async { + // TODO + }); + + // decimal as string + // String xirr + test('to test the property `xirr`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/scope_out_test.dart b/app/packages/api_client/test/scope_out_test.dart new file mode 100644 index 0000000..3e1aea9 --- /dev/null +++ b/app/packages/api_client/test/scope_out_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ScopeOut +void main() { + final ScopeOut? instance = /* ScopeOut(...) */ null; + // TODO add properties to the entity + + group(ScopeOut, () { + // List accountIds + test('to test the property `accountIds`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String scope + test('to test the property `scope`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/summary_out_test.dart b/app/packages/api_client/test/summary_out_test.dart new file mode 100644 index 0000000..147af97 --- /dev/null +++ b/app/packages/api_client/test/summary_out_test.dart @@ -0,0 +1,88 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for SummaryOut +void main() { + final SummaryOut? instance = /* SummaryOut(...) */ null; + // TODO add properties to the entity + + group(SummaryOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // decimal as string + // String cashRub + test('to test the property `cashRub`', () async { + // TODO + }); + + // DateTime computedAt + test('to test the property `computedAt`', () async { + // TODO + }); + + // int holdingCount + test('to test the property `holdingCount`', () async { + // TODO + }); + + // decimal as string + // String incomeRub + test('to test the property `incomeRub`', () async { + // TODO + }); + + // decimal as string + // String investedNetRub + test('to test the property `investedNetRub`', () async { + // TODO + }); + + // decimal as string + // String marketValueRub + test('to test the property `marketValueRub`', () async { + // TODO + }); + + // decimal as string + // String pnlTotalRub + test('to test the property `pnlTotalRub`', () async { + // TODO + }); + + // decimal as string + // String realizedPnlRub + test('to test the property `realizedPnlRub`', () async { + // TODO + }); + + // List returns + test('to test the property `returns`', () async { + // TODO + }); + + // String scope + test('to test the property `scope`', () async { + // TODO + }); + + // int staleCount + test('to test the property `staleCount`', () async { + // TODO + }); + + // decimal as string + // String totalRub + test('to test the property `totalRub`', () async { + // TODO + }); + + // int unpricedCount + test('to test the property `unpricedCount`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/value_day_test.dart b/app/packages/api_client/test/value_day_test.dart new file mode 100644 index 0000000..f01b9f3 --- /dev/null +++ b/app/packages/api_client/test/value_day_test.dart @@ -0,0 +1,73 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ValueDay +void main() { + final ValueDay? instance = /* ValueDay(...) */ null; + // TODO add properties to the entity + + group(ValueDay, () { + // decimal as string + // String accruedInterestRub + test('to test the property `accruedInterestRub`', () async { + // TODO + }); + + // decimal as string + // String cashRub + test('to test the property `cashRub`', () async { + // TODO + }); + + // DateTime d + test('to test the property `d`', () async { + // TODO + }); + + // decimal as string + // String externalFlowRub + test('to test the property `externalFlowRub`', () async { + // TODO + }); + + // decimal as string + // String investedNetRub + test('to test the property `investedNetRub`', () async { + // TODO + }); + + // decimal as string + // String marketValueRub + test('to test the property `marketValueRub`', () async { + // TODO + }); + + // int missingFxCount + test('to test the property `missingFxCount`', () async { + // TODO + }); + + // int missingPriceCount + test('to test the property `missingPriceCount`', () async { + // TODO + }); + + // decimal as string + // String pnlTotalRub + test('to test the property `pnlTotalRub`', () async { + // TODO + }); + + // int stalePriceCount + test('to test the property `stalePriceCount`', () async { + // TODO + }); + + // decimal as string + // String totalRub + test('to test the property `totalRub`', () async { + // TODO + }); + + }); +}