diff --git a/app/packages/api_client/.openapi-generator/FILES b/app/packages/api_client/.openapi-generator/FILES index ef45eb8..c0e6bb6 100644 --- a/app/packages/api_client/.openapi-generator/FILES +++ b/app/packages/api_client/.openapi-generator/FILES @@ -5,16 +5,29 @@ doc/AccountKind.md doc/AccountOut.md doc/AccountPatch.md doc/AccountRole.md +doc/AccountSuggestion.md doc/AccountsApi.md doc/AllocationBucket.md doc/AllocationDimension.md doc/AnalyticsApi.md doc/AuthApi.md +doc/BenchmarkComparison.md +doc/BenchmarkComparisonOut.md +doc/BenchmarkCreate.md +doc/BenchmarkOut.md +doc/BenchmarkPatch.md +doc/BenchmarkReturnOut.md +doc/BenchmarksApi.md doc/Broker.md +doc/CalendarEntry.md +doc/CalendarOut.md +doc/CashAvailable.md +doc/CashFlowBrokerMonth.md doc/CashFlowMonth.md doc/CashflowApi.md doc/CategoriesApi.md doc/CategoryOut.md +doc/CommitRequest.md doc/DataQualityRow.md doc/EventKind.md doc/EventOut.md @@ -23,21 +36,52 @@ doc/EventSource.md doc/EventStatus.md doc/EventsApi.md doc/FlowType.md +doc/ForecastMonth.md +doc/ForecastOut.md +doc/GoalCreate.md +doc/GoalOut.md +doc/GoalPatch.md +doc/GoalProgressOut.md +doc/GoalsApi.md doc/Health.md doc/HealthApi.md +doc/HistoryOut.md +doc/HistoryRow.md +doc/HistoryTotals.md doc/HoldingOut.md +doc/ImportCounts.md +doc/ImportPreview.md +doc/ImportResult.md +doc/ImportSummary.md +doc/ImportsApi.md +doc/IncomeApi.md doc/InstrumentDetail.md doc/InstrumentOut.md doc/InstrumentsApi.md doc/JobStatus.md +doc/LinkCreate.md +doc/LinkOut.md +doc/LinksApi.md doc/LoginRequest.md doc/LotOut.md doc/MetricsApi.md doc/NetWorthBreakdown.md doc/NetWorthDay.md doc/NetworthApi.md +doc/NewInstrument.md +doc/PendingInstrumentOut.md +doc/PendingResolveRequest.md +doc/PendingResolveResult.md +doc/PriceManualIn.md +doc/PriceManualOut.md doc/PricePoint.md doc/Problem.md +doc/RebalanceApi.md +doc/RebalanceBucketOut.md +doc/RebalanceOut.md +doc/ReconciliationCash.md +doc/ReconciliationOut.md +doc/ReconciliationPosition.md doc/RefreshLogOut.md doc/RefreshRequest.md doc/ReturnsOut.md @@ -49,6 +93,7 @@ doc/RulePatch.md doc/RulesApi.md doc/RunStatus.md doc/RunwayOut.md +doc/SampleEventOut.md doc/ScopeOut.md doc/SourceStatus.md doc/SpendingRow.md @@ -56,10 +101,24 @@ doc/SummaryOut.md doc/SyncApi.md doc/SyncJobOut.md doc/SyncRunOut.md +doc/TargetIn.md +doc/TargetOut.md +doc/TargetsIn.md +doc/TargetsOut.md +doc/TaxAccountOut.md +doc/TaxApi.md +doc/TaxLotOut.md +doc/TaxLotsOut.md +doc/TaxTotals.md +doc/TaxYearOut.md doc/TokenPair.md +doc/TradeOut.md doc/TransactionOut.md doc/TransactionPage.md doc/TransactionsApi.md +doc/UnmatchedBrokerOut.md +doc/UnmatchedOut.md +doc/UnmatchedZmOut.md doc/UserOut.md doc/ValueDay.md lib/fintracker_api.dart @@ -67,15 +126,22 @@ 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/benchmarks_api.dart lib/src/api/cashflow_api.dart lib/src/api/categories_api.dart lib/src/api/events_api.dart +lib/src/api/goals_api.dart lib/src/api/health_api.dart +lib/src/api/imports_api.dart +lib/src/api/income_api.dart lib/src/api/instruments_api.dart +lib/src/api/links_api.dart lib/src/api/metrics_api.dart lib/src/api/networth_api.dart +lib/src/api/rebalance_api.dart lib/src/api/rules_api.dart lib/src/api/sync_api.dart +lib/src/api/tax_api.dart lib/src/api/transactions_api.dart lib/src/auth/api_key_auth.dart lib/src/auth/auth.dart @@ -88,11 +154,23 @@ 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/account_suggestion.dart lib/src/model/allocation_bucket.dart lib/src/model/allocation_dimension.dart +lib/src/model/benchmark_comparison.dart +lib/src/model/benchmark_comparison_out.dart +lib/src/model/benchmark_create.dart +lib/src/model/benchmark_out.dart +lib/src/model/benchmark_patch.dart +lib/src/model/benchmark_return_out.dart lib/src/model/broker.dart +lib/src/model/calendar_entry.dart +lib/src/model/calendar_out.dart +lib/src/model/cash_available.dart +lib/src/model/cash_flow_broker_month.dart lib/src/model/cash_flow_month.dart lib/src/model/category_out.dart +lib/src/model/commit_request.dart lib/src/model/data_quality_row.dart lib/src/model/event_kind.dart lib/src/model/event_out.dart @@ -100,17 +178,43 @@ 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/forecast_month.dart +lib/src/model/forecast_out.dart +lib/src/model/goal_create.dart +lib/src/model/goal_out.dart +lib/src/model/goal_patch.dart +lib/src/model/goal_progress_out.dart lib/src/model/health.dart +lib/src/model/history_out.dart +lib/src/model/history_row.dart +lib/src/model/history_totals.dart lib/src/model/holding_out.dart +lib/src/model/import_counts.dart +lib/src/model/import_preview.dart +lib/src/model/import_result.dart +lib/src/model/import_summary.dart lib/src/model/instrument_detail.dart lib/src/model/instrument_out.dart lib/src/model/job_status.dart +lib/src/model/link_create.dart +lib/src/model/link_out.dart lib/src/model/login_request.dart lib/src/model/lot_out.dart lib/src/model/net_worth_breakdown.dart lib/src/model/net_worth_day.dart +lib/src/model/new_instrument.dart +lib/src/model/pending_instrument_out.dart +lib/src/model/pending_resolve_request.dart +lib/src/model/pending_resolve_result.dart +lib/src/model/price_manual_in.dart +lib/src/model/price_manual_out.dart lib/src/model/price_point.dart lib/src/model/problem.dart +lib/src/model/rebalance_bucket_out.dart +lib/src/model/rebalance_out.dart +lib/src/model/reconciliation_cash.dart +lib/src/model/reconciliation_out.dart +lib/src/model/reconciliation_position.dart lib/src/model/refresh_log_out.dart lib/src/model/refresh_request.dart lib/src/model/returns_out.dart @@ -121,15 +225,73 @@ 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/sample_event_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/target_in.dart +lib/src/model/target_out.dart +lib/src/model/targets_in.dart +lib/src/model/targets_out.dart +lib/src/model/tax_account_out.dart +lib/src/model/tax_lot_out.dart +lib/src/model/tax_lots_out.dart +lib/src/model/tax_totals.dart +lib/src/model/tax_year_out.dart lib/src/model/token_pair.dart +lib/src/model/trade_out.dart lib/src/model/transaction_out.dart lib/src/model/transaction_page.dart +lib/src/model/unmatched_broker_out.dart +lib/src/model/unmatched_out.dart +lib/src/model/unmatched_zm_out.dart lib/src/model/user_out.dart lib/src/model/value_day.dart pubspec.yaml +test/benchmark_comparison_out_test.dart +test/benchmark_comparison_test.dart +test/benchmark_create_test.dart +test/benchmark_out_test.dart +test/benchmark_patch_test.dart +test/benchmark_return_out_test.dart +test/benchmarks_api_test.dart +test/calendar_entry_test.dart +test/calendar_out_test.dart +test/cash_available_test.dart +test/cash_flow_broker_month_test.dart +test/forecast_month_test.dart +test/forecast_out_test.dart +test/goal_create_test.dart +test/goal_out_test.dart +test/goal_patch_test.dart +test/goal_progress_out_test.dart +test/goals_api_test.dart +test/history_out_test.dart +test/history_row_test.dart +test/history_totals_test.dart +test/income_api_test.dart +test/link_create_test.dart +test/link_out_test.dart +test/links_api_test.dart +test/price_manual_in_test.dart +test/price_manual_out_test.dart +test/rebalance_api_test.dart +test/rebalance_bucket_out_test.dart +test/rebalance_out_test.dart +test/target_in_test.dart +test/target_out_test.dart +test/targets_in_test.dart +test/targets_out_test.dart +test/tax_account_out_test.dart +test/tax_api_test.dart +test/tax_lot_out_test.dart +test/tax_lots_out_test.dart +test/tax_totals_test.dart +test/tax_year_out_test.dart +test/trade_out_test.dart +test/unmatched_broker_out_test.dart +test/unmatched_out_test.dart +test/unmatched_zm_out_test.dart diff --git a/app/packages/api_client/doc/AccountSuggestion.md b/app/packages/api_client/doc/AccountSuggestion.md new file mode 100644 index 0000000..5d2272c --- /dev/null +++ b/app/packages/api_client/doc/AccountSuggestion.md @@ -0,0 +1,18 @@ +# fintracker_api.model.AccountSuggestion + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**broker** | **String** | | +**id** | **int** | | +**name** | **String** | | +**sourceId** | **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/AnalyticsApi.md b/app/packages/api_client/doc/AnalyticsApi.md index f4a4ead..5cf10d0 100644 --- a/app/packages/api_client/doc/AnalyticsApi.md +++ b/app/packages/api_client/doc/AnalyticsApi.md @@ -10,6 +10,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**analyticsAllocation**](AnalyticsApi.md#analyticsallocation) | **GET** /api/v1/analytics/allocation | Allocation +[**analyticsCashflowBroker**](AnalyticsApi.md#analyticscashflowbroker) | **GET** /api/v1/analytics/cashflow-broker | Cashflow Broker [**analyticsHoldings**](AnalyticsApi.md#analyticsholdings) | **GET** /api/v1/analytics/holdings | Holdings [**analyticsReturns**](AnalyticsApi.md#analyticsreturns) | **GET** /api/v1/analytics/returns | Returns [**analyticsScopes**](AnalyticsApi.md#analyticsscopes) | **GET** /api/v1/analytics/scopes | Scopes @@ -62,6 +63,49 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **analyticsCashflowBroker** +> List analyticsCashflowBroker(scope) + +Cashflow Broker + +Money moved across the brokerage boundary, by month: the other half of cash flow that `metric_cash_flow_monthly` (ZenMoney spending) does not cover. + +### 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.analyticsCashflowBroker(scope); + print(response); +} on DioException catch (e) { + print('Exception when calling AnalyticsApi->analyticsCashflowBroker: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + +### Return type + +[**List<CashFlowBrokerMonth>**](CashFlowBrokerMonth.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) diff --git a/app/packages/api_client/doc/BenchmarkComparison.md b/app/packages/api_client/doc/BenchmarkComparison.md new file mode 100644 index 0000000..1cb35f1 --- /dev/null +++ b/app/packages/api_client/doc/BenchmarkComparison.md @@ -0,0 +1,15 @@ +# fintracker_api.model.BenchmarkComparison + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rows** | [**List<BenchmarkComparisonOut>**](BenchmarkComparisonOut.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/BenchmarkComparisonOut.md b/app/packages/api_client/doc/BenchmarkComparisonOut.md new file mode 100644 index 0000000..91d9a8e --- /dev/null +++ b/app/packages/api_client/doc/BenchmarkComparisonOut.md @@ -0,0 +1,21 @@ +# fintracker_api.model.BenchmarkComparisonOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**benchmarks** | [**List<BenchmarkReturnOut>**](BenchmarkReturnOut.md) | | +**dateFrom** | [**DateTime**](DateTime.md) | | +**dateTo** | [**DateTime**](DateTime.md) | | +**period** | **String** | | +**portfolioDaysSkipped** | **int** | | +**portfolioTwr** | **String** | decimal as string | +**portfolioTwrAnnualized** | **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/BenchmarkCreate.md b/app/packages/api_client/doc/BenchmarkCreate.md new file mode 100644 index 0000000..81e31c7 --- /dev/null +++ b/app/packages/api_client/doc/BenchmarkCreate.md @@ -0,0 +1,22 @@ +# fintracker_api.model.BenchmarkCreate + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**currency** | **String** | | [optional] [default to 'RUB'] +**instrumentId** | **int** | | [optional] +**isActive** | **bool** | | [optional] [default to true] +**isDefault** | **bool** | | [optional] [default to false] +**kind** | **String** | | +**name** | **String** | | +**source_** | **String** | | [optional] [default to 'moex'] + +[[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/BenchmarkOut.md b/app/packages/api_client/doc/BenchmarkOut.md new file mode 100644 index 0000000..69d5f89 --- /dev/null +++ b/app/packages/api_client/doc/BenchmarkOut.md @@ -0,0 +1,25 @@ +# fintracker_api.model.BenchmarkOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | +**currency** | **String** | | +**historyFrom** | [**DateTime**](DateTime.md) | | +**historyTo** | [**DateTime**](DateTime.md) | | +**id** | **int** | | +**instrumentId** | **int** | | +**isActive** | **bool** | | +**isDefault** | **bool** | | +**kind** | **String** | | +**name** | **String** | | +**source_** | **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/BenchmarkPatch.md b/app/packages/api_client/doc/BenchmarkPatch.md new file mode 100644 index 0000000..6ab1504 --- /dev/null +++ b/app/packages/api_client/doc/BenchmarkPatch.md @@ -0,0 +1,22 @@ +# fintracker_api.model.BenchmarkPatch + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | [optional] +**currency** | **String** | | [optional] +**instrumentId** | **int** | | [optional] +**isActive** | **bool** | | [optional] +**isDefault** | **bool** | | [optional] +**kind** | **String** | | [optional] +**name** | **String** | | [optional] +**source_** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/BenchmarkReturnOut.md b/app/packages/api_client/doc/BenchmarkReturnOut.md new file mode 100644 index 0000000..71dcfb4 --- /dev/null +++ b/app/packages/api_client/doc/BenchmarkReturnOut.md @@ -0,0 +1,22 @@ +# fintracker_api.model.BenchmarkReturnOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**benchmarkId** | **int** | | +**code** | **String** | | +**daysSkipped** | **int** | | +**excess** | **String** | decimal as string | +**kind** | **String** | | +**name** | **String** | | +**twr** | **String** | decimal as string | +**twrAnnualized** | **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/BenchmarksApi.md b/app/packages/api_client/doc/BenchmarksApi.md new file mode 100644 index 0000000..bff2e9b --- /dev/null +++ b/app/packages/api_client/doc/BenchmarksApi.md @@ -0,0 +1,226 @@ +# fintracker_api.api.BenchmarksApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**benchmarksBenchmarks**](BenchmarksApi.md#benchmarksbenchmarks) | **GET** /api/v1/analytics/benchmarks | Benchmarks +[**benchmarksCreate**](BenchmarksApi.md#benchmarkscreate) | **POST** /api/v1/benchmarks | Create +[**benchmarksDelete**](BenchmarksApi.md#benchmarksdelete) | **DELETE** /api/v1/benchmarks/{benchmark_id} | Delete +[**benchmarksList**](BenchmarksApi.md#benchmarkslist) | **GET** /api/v1/benchmarks | List +[**benchmarksPatch**](BenchmarksApi.md#benchmarkspatch) | **PATCH** /api/v1/benchmarks/{benchmark_id} | Patch + + +# **benchmarksBenchmarks** +> BenchmarkComparison benchmarksBenchmarks(scope, period) + +Benchmarks + +The portfolio's TWR beside each benchmark's, on the same grid of days. `days_skipped` is returned on both sides and is not cosmetic: a non-zero value on either means the two chains did not cover the same days, and the difference is then an approximation of an excess return rather than one. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getBenchmarksApi(); +final String scope = scope_example; // String | all | account: | portfolio: +final List period = ; // List | repeatable: 1m 3m 6m ytd 1y 3y all + +try { + final response = api.benchmarksBenchmarks(scope, period); + print(response); +} on DioException catch (e) { + print('Exception when calling BenchmarksApi->benchmarksBenchmarks: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **period** | [**List<String?>**](String.md)| repeatable: 1m 3m 6m ytd 1y 3y all | [optional] + +### Return type + +[**BenchmarkComparison**](BenchmarkComparison.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) + +# **benchmarksCreate** +> BenchmarkOut benchmarksCreate(benchmarkCreate) + +Create + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getBenchmarksApi(); +final BenchmarkCreate benchmarkCreate = ; // BenchmarkCreate | + +try { + final response = api.benchmarksCreate(benchmarkCreate); + print(response); +} on DioException catch (e) { + print('Exception when calling BenchmarksApi->benchmarksCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **benchmarkCreate** | [**BenchmarkCreate**](BenchmarkCreate.md)| | + +### Return type + +[**BenchmarkOut**](BenchmarkOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **benchmarksDelete** +> benchmarksDelete(benchmarkId) + +Delete + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getBenchmarksApi(); +final int benchmarkId = 56; // int | + +try { + api.benchmarksDelete(benchmarkId); +} on DioException catch (e) { + print('Exception when calling BenchmarksApi->benchmarksDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **benchmarkId** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **benchmarksList** +> List benchmarksList() + +List + +Every benchmark, defaults first — the order the comparison block shows them in. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getBenchmarksApi(); + +try { + final response = api.benchmarksList(); + print(response); +} on DioException catch (e) { + print('Exception when calling BenchmarksApi->benchmarksList: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List<BenchmarkOut>**](BenchmarkOut.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) + +# **benchmarksPatch** +> BenchmarkOut benchmarksPatch(benchmarkId, benchmarkPatch) + +Patch + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getBenchmarksApi(); +final int benchmarkId = 56; // int | +final BenchmarkPatch benchmarkPatch = ; // BenchmarkPatch | + +try { + final response = api.benchmarksPatch(benchmarkId, benchmarkPatch); + print(response); +} on DioException catch (e) { + print('Exception when calling BenchmarksApi->benchmarksPatch: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **benchmarkId** | **int**| | + **benchmarkPatch** | [**BenchmarkPatch**](BenchmarkPatch.md)| | + +### Return type + +[**BenchmarkOut**](BenchmarkOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/app/packages/api_client/doc/CalendarEntry.md b/app/packages/api_client/doc/CalendarEntry.md new file mode 100644 index 0000000..4942bae --- /dev/null +++ b/app/packages/api_client/doc/CalendarEntry.md @@ -0,0 +1,27 @@ +# fintracker_api.model.CalendarEntry + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **String** | decimal as string | +**amountRub** | **String** | decimal as string | +**basis** | **String** | | +**currency** | **String** | | +**expectedDate** | [**DateTime**](DateTime.md) | | +**instrumentId** | **int** | | +**kind** | **String** | | +**name** | **String** | | +**perUnit** | **String** | decimal as string | +**qty** | **String** | decimal as string | +**recordDate** | [**DateTime**](DateTime.md) | | +**taxWithheld** | **String** | decimal as 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/CalendarOut.md b/app/packages/api_client/doc/CalendarOut.md new file mode 100644 index 0000000..253f11c --- /dev/null +++ b/app/packages/api_client/doc/CalendarOut.md @@ -0,0 +1,19 @@ +# fintracker_api.model.CalendarOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**byBasis** | **Map<String, String>** | | +**currency** | **String** | | +**entries** | [**List<CalendarEntry>**](CalendarEntry.md) | | +**totalExpectedRub** | **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/CashAvailable.md b/app/packages/api_client/doc/CashAvailable.md new file mode 100644 index 0000000..951ea0e --- /dev/null +++ b/app/packages/api_client/doc/CashAvailable.md @@ -0,0 +1,14 @@ +# fintracker_api.model.CashAvailable + +## 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/CashFlowBrokerMonth.md b/app/packages/api_client/doc/CashFlowBrokerMonth.md new file mode 100644 index 0000000..1fcc528 --- /dev/null +++ b/app/packages/api_client/doc/CashFlowBrokerMonth.md @@ -0,0 +1,19 @@ +# fintracker_api.model.CashFlowBrokerMonth + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**depositsRub** | **String** | decimal as string | +**eventCount** | **int** | | +**month** | [**DateTime**](DateTime.md) | | +**netRub** | **String** | decimal as string | +**withdrawalsRub** | **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/CommitRequest.md b/app/packages/api_client/doc/CommitRequest.md new file mode 100644 index 0000000..bf67ad7 --- /dev/null +++ b/app/packages/api_client/doc/CommitRequest.md @@ -0,0 +1,17 @@ +# fintracker_api.model.CommitRequest + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | [optional] +**confirmDuplicates** | **bool** | | [optional] [default to false] +**dryRun** | **bool** | | [optional] [default to false] + +[[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/ForecastMonth.md b/app/packages/api_client/doc/ForecastMonth.md new file mode 100644 index 0000000..cd39a98 --- /dev/null +++ b/app/packages/api_client/doc/ForecastMonth.md @@ -0,0 +1,17 @@ +# fintracker_api.model.ForecastMonth + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amountRub** | **String** | decimal as string | +**byBasis** | **Map<String, String>** | | +**month** | [**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/ForecastOut.md b/app/packages/api_client/doc/ForecastOut.md new file mode 100644 index 0000000..aadf64e --- /dev/null +++ b/app/packages/api_client/doc/ForecastOut.md @@ -0,0 +1,18 @@ +# fintracker_api.model.ForecastOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**annualYieldOnValue** | **String** | decimal as string | +**months** | [**List<ForecastMonth>**](ForecastMonth.md) | | +**totalRub** | **String** | decimal as string | +**warnings** | **List<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/GoalCreate.md b/app/packages/api_client/doc/GoalCreate.md new file mode 100644 index 0000000..401baa2 --- /dev/null +++ b/app/packages/api_client/doc/GoalCreate.md @@ -0,0 +1,22 @@ +# fintracker_api.model.GoalCreate + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**archived** | **bool** | | [optional] [default to false] +**currency** | **String** | | [optional] [default to 'RUB'] +**monthlyContribution** | **String** | decimal as string | [optional] +**name** | **String** | | +**note** | **String** | | [optional] +**scope** | **String** | | [optional] [default to 'all'] +**targetAmount** | **String** | decimal as string | +**targetDate** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/GoalOut.md b/app/packages/api_client/doc/GoalOut.md new file mode 100644 index 0000000..98524d2 --- /dev/null +++ b/app/packages/api_client/doc/GoalOut.md @@ -0,0 +1,23 @@ +# fintracker_api.model.GoalOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**archived** | **bool** | | +**currency** | **String** | | +**id** | **int** | | +**monthlyContribution** | **String** | decimal as string | +**name** | **String** | | +**note** | **String** | | +**scope** | **String** | | +**targetAmount** | **String** | decimal as string | +**targetDate** | [**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/GoalPatch.md b/app/packages/api_client/doc/GoalPatch.md new file mode 100644 index 0000000..e3c8a86 --- /dev/null +++ b/app/packages/api_client/doc/GoalPatch.md @@ -0,0 +1,22 @@ +# fintracker_api.model.GoalPatch + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**archived** | **bool** | | [optional] +**currency** | **String** | | [optional] +**monthlyContribution** | **String** | decimal as string | [optional] +**name** | **String** | | [optional] +**note** | **String** | | [optional] +**scope** | **String** | | [optional] +**targetAmount** | **String** | decimal as string | [optional] +**targetDate** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/GoalProgressOut.md b/app/packages/api_client/doc/GoalProgressOut.md new file mode 100644 index 0000000..ee03820 --- /dev/null +++ b/app/packages/api_client/doc/GoalProgressOut.md @@ -0,0 +1,24 @@ +# fintracker_api.model.GoalProgressOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**assumedRate** | **String** | decimal as string | +**basis** | **String** | | +**currentValueRub** | **String** | decimal as string | +**goalId** | **int** | | +**monthlyNeededRub** | **String** | decimal as string | +**onTrack** | **bool** | | +**progress** | **String** | decimal as string | +**projectedDate** | [**DateTime**](DateTime.md) | | +**targetAmountRub** | **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/GoalsApi.md b/app/packages/api_client/doc/GoalsApi.md new file mode 100644 index 0000000..9406d86 --- /dev/null +++ b/app/packages/api_client/doc/GoalsApi.md @@ -0,0 +1,224 @@ +# fintracker_api.api.GoalsApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**goalsCreate**](GoalsApi.md#goalscreate) | **POST** /api/v1/goals | Create +[**goalsDelete**](GoalsApi.md#goalsdelete) | **DELETE** /api/v1/goals/{goal_id} | Delete +[**goalsList**](GoalsApi.md#goalslist) | **GET** /api/v1/goals | List +[**goalsPatch**](GoalsApi.md#goalspatch) | **PATCH** /api/v1/goals/{goal_id} | Patch +[**goalsProgress**](GoalsApi.md#goalsprogress) | **GET** /api/v1/goals/{goal_id}/progress | Progress + + +# **goalsCreate** +> GoalOut goalsCreate(goalCreate) + +Create + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getGoalsApi(); +final GoalCreate goalCreate = ; // GoalCreate | + +try { + final response = api.goalsCreate(goalCreate); + print(response); +} on DioException catch (e) { + print('Exception when calling GoalsApi->goalsCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **goalCreate** | [**GoalCreate**](GoalCreate.md)| | + +### Return type + +[**GoalOut**](GoalOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **goalsDelete** +> goalsDelete(goalId) + +Delete + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getGoalsApi(); +final int goalId = 56; // int | + +try { + api.goalsDelete(goalId); +} on DioException catch (e) { + print('Exception when calling GoalsApi->goalsDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **goalId** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **goalsList** +> List goalsList(includeArchived) + +List + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getGoalsApi(); +final bool includeArchived = true; // bool | + +try { + final response = api.goalsList(includeArchived); + print(response); +} on DioException catch (e) { + print('Exception when calling GoalsApi->goalsList: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **includeArchived** | **bool**| | [optional] [default to false] + +### Return type + +[**List<GoalOut>**](GoalOut.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) + +# **goalsPatch** +> GoalOut goalsPatch(goalId, goalPatch) + +Patch + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getGoalsApi(); +final int goalId = 56; // int | +final GoalPatch goalPatch = ; // GoalPatch | + +try { + final response = api.goalsPatch(goalId, goalPatch); + print(response); +} on DioException catch (e) { + print('Exception when calling GoalsApi->goalsPatch: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **goalId** | **int**| | + **goalPatch** | [**GoalPatch**](GoalPatch.md)| | + +### Return type + +[**GoalOut**](GoalOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **goalsProgress** +> GoalProgressOut goalsProgress(goalId) + +Progress + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getGoalsApi(); +final int goalId = 56; // int | + +try { + final response = api.goalsProgress(goalId); + print(response); +} on DioException catch (e) { + print('Exception when calling GoalsApi->goalsProgress: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **goalId** | **int**| | + +### Return type + +[**GoalProgressOut**](GoalProgressOut.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/HistoryOut.md b/app/packages/api_client/doc/HistoryOut.md new file mode 100644 index 0000000..cfa18f3 --- /dev/null +++ b/app/packages/api_client/doc/HistoryOut.md @@ -0,0 +1,16 @@ +# fintracker_api.model.HistoryOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rows** | [**List<HistoryRow>**](HistoryRow.md) | | +**totals** | [**HistoryTotals**](HistoryTotals.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/HistoryRow.md b/app/packages/api_client/doc/HistoryRow.md new file mode 100644 index 0000000..d8b0275 --- /dev/null +++ b/app/packages/api_client/doc/HistoryRow.md @@ -0,0 +1,21 @@ +# fintracker_api.model.HistoryRow + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **String** | decimal as string | +**amountRub** | **String** | decimal as string | +**currency** | **String** | | +**kind** | **String** | | +**month** | [**DateTime**](DateTime.md) | | +**paymentCount** | **int** | | +**taxWithheld** | **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/HistoryTotals.md b/app/packages/api_client/doc/HistoryTotals.md new file mode 100644 index 0000000..f873d8b --- /dev/null +++ b/app/packages/api_client/doc/HistoryTotals.md @@ -0,0 +1,16 @@ +# fintracker_api.model.HistoryTotals + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amountRub** | **String** | decimal as string | +**taxWithheldRub** | **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/ImportCounts.md b/app/packages/api_client/doc/ImportCounts.md new file mode 100644 index 0000000..1d823fb --- /dev/null +++ b/app/packages/api_client/doc/ImportCounts.md @@ -0,0 +1,21 @@ +# fintracker_api.model.ImportCounts + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**byKind** | **Map<String, int>** | | +**eventsDuplicate** | **int** | | +**eventsNew** | **int** | | +**eventsPending** | **int** | | +**eventsShadow** | **int** | | +**eventsTotal** | **int** | | +**lines** | **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/ImportPreview.md b/app/packages/api_client/doc/ImportPreview.md new file mode 100644 index 0000000..6110a87 --- /dev/null +++ b/app/packages/api_client/doc/ImportPreview.md @@ -0,0 +1,37 @@ +# fintracker_api.model.ImportPreview + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountExternalId** | **String** | | [optional] +**accountId** | **int** | | [optional] +**accountName** | **String** | | [optional] +**accountSuggestions** | [**List<AccountSuggestion>**](AccountSuggestion.md) | | [optional] +**broker** | **String** | | +**committedAt** | [**DateTime**](DateTime.md) | | [optional] +**counts** | [**ImportCounts**](ImportCounts.md) | | +**duplicateOfId** | **int** | | [optional] +**error** | **String** | | [optional] +**filename** | **String** | | +**id** | **int** | | +**parseStatus** | **String** | | +**parserName** | **String** | | [optional] +**parserVersion** | **String** | | [optional] +**pendingInstruments** | [**List<PendingInstrumentOut>**](PendingInstrumentOut.md) | | [optional] +**periodFrom** | [**DateTime**](DateTime.md) | | [optional] +**periodTo** | [**DateTime**](DateTime.md) | | [optional] +**reconciliation** | [**ReconciliationOut**](ReconciliationOut.md) | | +**sampleEvents** | [**List<SampleEventOut>**](SampleEventOut.md) | | [optional] +**sha256** | **String** | | +**sizeBytes** | **int** | | +**uploadedAt** | [**DateTime**](DateTime.md) | | [optional] +**warnings** | **List<String>** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/ImportResult.md b/app/packages/api_client/doc/ImportResult.md new file mode 100644 index 0000000..23f8811 --- /dev/null +++ b/app/packages/api_client/doc/ImportResult.md @@ -0,0 +1,23 @@ +# fintracker_api.model.ImportResult + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**committed** | **bool** | | +**eventsCreated** | **int** | | +**eventsShadow** | **int** | | +**eventsSkipped** | **int** | | +**eventsUpdated** | **int** | | +**importId** | **int** | | +**metricsRefreshed** | **bool** | | +**pendingInstruments** | **int** | | +**reconciliation** | [**ReconciliationOut**](ReconciliationOut.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/ImportSummary.md b/app/packages/api_client/doc/ImportSummary.md new file mode 100644 index 0000000..30c4a67 --- /dev/null +++ b/app/packages/api_client/doc/ImportSummary.md @@ -0,0 +1,32 @@ +# fintracker_api.model.ImportSummary + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountExternalId** | **String** | | [optional] +**accountId** | **int** | | [optional] +**accountName** | **String** | | [optional] +**broker** | **String** | | +**committedAt** | [**DateTime**](DateTime.md) | | [optional] +**counts** | [**ImportCounts**](ImportCounts.md) | | +**duplicateOfId** | **int** | | [optional] +**error** | **String** | | [optional] +**filename** | **String** | | +**id** | **int** | | +**parseStatus** | **String** | | +**parserName** | **String** | | [optional] +**parserVersion** | **String** | | [optional] +**periodFrom** | [**DateTime**](DateTime.md) | | [optional] +**periodTo** | [**DateTime**](DateTime.md) | | [optional] +**sha256** | **String** | | +**sizeBytes** | **int** | | +**uploadedAt** | [**DateTime**](DateTime.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/ImportsApi.md b/app/packages/api_client/doc/ImportsApi.md new file mode 100644 index 0000000..1d7c5ef --- /dev/null +++ b/app/packages/api_client/doc/ImportsApi.md @@ -0,0 +1,242 @@ +# fintracker_api.api.ImportsApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**importsCommit**](ImportsApi.md#importscommit) | **POST** /api/v1/imports/{import_id}/commit | Commit +[**importsCreate**](ImportsApi.md#importscreate) | **POST** /api/v1/imports | Create +[**importsDelete**](ImportsApi.md#importsdelete) | **DELETE** /api/v1/imports/{import_id} | Delete +[**importsGet**](ImportsApi.md#importsget) | **GET** /api/v1/imports/{import_id} | Get +[**importsList**](ImportsApi.md#importslist) | **GET** /api/v1/imports | List + + +# **importsCommit** +> ImportResult importsCommit(importId, commitRequest) + +Commit + +Write the file's events into the ledger and rebuild every metric. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getImportsApi(); +final int importId = 56; // int | +final CommitRequest commitRequest = ; // CommitRequest | + +try { + final response = api.importsCommit(importId, commitRequest); + print(response); +} on DioException catch (e) { + print('Exception when calling ImportsApi->importsCommit: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **importId** | **int**| | + **commitRequest** | [**CommitRequest**](CommitRequest.md)| | + +### Return type + +[**ImportResult**](ImportResult.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **importsCreate** +> ImportPreview importsCreate(file, accountId, parser) + +Create + +Upload a report, parse it and show what committing it would do. Writes no event. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getImportsApi(); +final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | the report itself +final int accountId = 56; // int | target account, if known +final String parser = parser_example; // String | force a parser from registry.names() + +try { + final response = api.importsCreate(file, accountId, parser); + print(response); +} on DioException catch (e) { + print('Exception when calling ImportsApi->importsCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **file** | **MultipartFile**| the report itself | + **accountId** | **int**| target account, if known | [optional] + **parser** | **String**| force a parser from registry.names() | [optional] + +### Return type + +[**ImportPreview**](ImportPreview.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **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) + +# **importsDelete** +> importsDelete(importId) + +Delete + +Drop an uncommitted import. A committed one stays: `raw_*` is append-only. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getImportsApi(); +final int importId = 56; // int | + +try { + api.importsDelete(importId); +} on DioException catch (e) { + print('Exception when calling ImportsApi->importsDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **importId** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **importsGet** +> ImportPreview importsGet(importId) + +Get + +The preview again — recomputed for an uncommitted import, replayed for a committed one. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getImportsApi(); +final int importId = 56; // int | + +try { + final response = api.importsGet(importId); + print(response); +} on DioException catch (e) { + print('Exception when calling ImportsApi->importsGet: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **importId** | **int**| | + +### Return type + +[**ImportPreview**](ImportPreview.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) + +# **importsList** +> List importsList(status, limit, offset) + +List + +Newest imports first, with the counters each was committed with. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getImportsApi(); +final String status = status_example; // String | uploaded | parsed | committed | failed +final int limit = 56; // int | +final int offset = 56; // int | + +try { + final response = api.importsList(status, limit, offset); + print(response); +} on DioException catch (e) { + print('Exception when calling ImportsApi->importsList: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **String**| uploaded | parsed | committed | failed | [optional] + **limit** | **int**| | [optional] [default to 50] + **offset** | **int**| | [optional] [default to 0] + +### Return type + +[**List<ImportSummary>**](ImportSummary.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/IncomeApi.md b/app/packages/api_client/doc/IncomeApi.md new file mode 100644 index 0000000..6e36ff5 --- /dev/null +++ b/app/packages/api_client/doc/IncomeApi.md @@ -0,0 +1,161 @@ +# fintracker_api.api.IncomeApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**incomeCalendar**](IncomeApi.md#incomecalendar) | **GET** /api/v1/income/calendar | Calendar +[**incomeForecast**](IncomeApi.md#incomeforecast) | **GET** /api/v1/income/forecast | Forecast +[**incomeHistory**](IncomeApi.md#incomehistory) | **GET** /api/v1/income/history | History + + +# **incomeCalendar** +> CalendarOut incomeCalendar(scope, dateFrom, dateTo, includePaid) + +Calendar + +Payments in a window, one row each; defaults to the next 12 months, forecast only. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getIncomeApi(); +final String scope = scope_example; // String | all | account: | portfolio: +final DateTime dateFrom = 2013-10-20; // DateTime | +final DateTime dateTo = 2013-10-20; // DateTime | +final bool includePaid = true; // bool | + +try { + final response = api.incomeCalendar(scope, dateFrom, dateTo, includePaid); + print(response); +} on DioException catch (e) { + print('Exception when calling IncomeApi->incomeCalendar: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **dateFrom** | **DateTime**| | [optional] + **dateTo** | **DateTime**| | [optional] + **includePaid** | **bool**| | [optional] [default to false] + +### Return type + +[**CalendarOut**](CalendarOut.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) + +# **incomeForecast** +> ForecastOut incomeForecast(scope, months) + +Forecast + +Expected income per month, split by basis, plus the yield it implies. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getIncomeApi(); +final String scope = scope_example; // String | all | account: | portfolio: +final int months = 56; // int | + +try { + final response = api.incomeForecast(scope, months); + print(response); +} on DioException catch (e) { + print('Exception when calling IncomeApi->incomeForecast: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **months** | **int**| | [optional] [default to 12] + +### Return type + +[**ForecastOut**](ForecastOut.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) + +# **incomeHistory** +> HistoryOut incomeHistory(scope, group, dateFrom, dateTo, kind) + +History + +Income actually received, grouped by month, kind and currency. `group` exists for the contract's sake and accepts only `month`: the table is stored monthly, and a finer grouping would have to re-read the ledger, which is what the calendar's `paid` rows already do per payment. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getIncomeApi(); +final String scope = scope_example; // String | all | account: | portfolio: +final String group = group_example; // String | month +final DateTime dateFrom = 2013-10-20; // DateTime | +final DateTime dateTo = 2013-10-20; // DateTime | +final String kind = kind_example; // String | dividend | coupon | … + +try { + final response = api.incomeHistory(scope, group, dateFrom, dateTo, kind); + print(response); +} on DioException catch (e) { + print('Exception when calling IncomeApi->incomeHistory: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **scope** | **String**| all | account: | portfolio: | [optional] [default to 'all'] + **group** | **String**| month | [optional] [default to 'month'] + **dateFrom** | **DateTime**| | [optional] + **dateTo** | **DateTime**| | [optional] + **kind** | **String**| dividend | coupon | … | [optional] + +### Return type + +[**HistoryOut**](HistoryOut.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/InstrumentsApi.md b/app/packages/api_client/doc/InstrumentsApi.md index 5190202..d7386a6 100644 --- a/app/packages/api_client/doc/InstrumentsApi.md +++ b/app/packages/api_client/doc/InstrumentsApi.md @@ -11,6 +11,9 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**instrumentsGet**](InstrumentsApi.md#instrumentsget) | **GET** /api/v1/instruments/{instrument_id} | Get [**instrumentsList**](InstrumentsApi.md#instrumentslist) | **GET** /api/v1/instruments | List +[**instrumentsPending**](InstrumentsApi.md#instrumentspending) | **GET** /api/v1/instruments/pending | Pending +[**instrumentsPendingResolve**](InstrumentsApi.md#instrumentspendingresolve) | **POST** /api/v1/instruments/pending/{pending_id}/resolve | Pending Resolve +[**instrumentsSetManualPrice**](InstrumentsApi.md#instrumentssetmanualprice) | **POST** /api/v1/instruments/{instrument_id}/prices | Set Manual Price # **instrumentsGet** @@ -107,3 +110,140 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **instrumentsPending** +> List instrumentsPending(status, limit, offset) + +Pending + +Instruments a report named that nothing in the master resolves to. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getInstrumentsApi(); +final String status = status_example; // String | pending | resolved | ignored | all +final int limit = 56; // int | +final int offset = 56; // int | + +try { + final response = api.instrumentsPending(status, limit, offset); + print(response); +} on DioException catch (e) { + print('Exception when calling InstrumentsApi->instrumentsPending: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **String**| pending | resolved | ignored | all | [optional] [default to 'pending'] + **limit** | **int**| | [optional] [default to 100] + **offset** | **int**| | [optional] [default to 0] + +### Return type + +[**List<PendingInstrumentOut>**](PendingInstrumentOut.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) + +# **instrumentsPendingResolve** +> PendingResolveResult instrumentsPendingResolve(pendingId, pendingResolveRequest) + +Pending Resolve + +Link, create or ignore — then bind the events that were waiting and rebuild the lots. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getInstrumentsApi(); +final int pendingId = 56; // int | +final PendingResolveRequest pendingResolveRequest = ; // PendingResolveRequest | + +try { + final response = api.instrumentsPendingResolve(pendingId, pendingResolveRequest); + print(response); +} on DioException catch (e) { + print('Exception when calling InstrumentsApi->instrumentsPendingResolve: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pendingId** | **int**| | + **pendingResolveRequest** | [**PendingResolveRequest**](PendingResolveRequest.md)| | + +### Return type + +[**PendingResolveResult**](PendingResolveResult.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **instrumentsSetManualPrice** +> PriceManualOut instrumentsSetManualPrice(instrumentId, priceManualIn) + +Set Manual Price + +Set (or replace) the manual price of `instrument_id` on `body.d`. For what no exchange quotes: real estate, crypto, a custom holding, an OTC bond nobody lists. One row per (instrument, day) — a second call for the same day replaces it rather than piling up duplicates the price series would then have to pick between. Does not itself refresh `metric_*`; call `POST /metrics/refresh` after, same as `/rules/apply`. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getInstrumentsApi(); +final int instrumentId = 56; // int | +final PriceManualIn priceManualIn = ; // PriceManualIn | + +try { + final response = api.instrumentsSetManualPrice(instrumentId, priceManualIn); + print(response); +} on DioException catch (e) { + print('Exception when calling InstrumentsApi->instrumentsSetManualPrice: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **instrumentId** | **int**| | + **priceManualIn** | [**PriceManualIn**](PriceManualIn.md)| | + +### Return type + +[**PriceManualOut**](PriceManualOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/app/packages/api_client/doc/LinkCreate.md b/app/packages/api_client/doc/LinkCreate.md new file mode 100644 index 0000000..3b523e4 --- /dev/null +++ b/app/packages/api_client/doc/LinkCreate.md @@ -0,0 +1,16 @@ +# fintracker_api.model.LinkCreate + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cashTxnId** | **int** | | +**eventId** | **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/LinkOut.md b/app/packages/api_client/doc/LinkOut.md new file mode 100644 index 0000000..24e74b8 --- /dev/null +++ b/app/packages/api_client/doc/LinkOut.md @@ -0,0 +1,23 @@ +# fintracker_api.model.LinkOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amountDelta** | **String** | decimal as string | +**cashTxnId** | **int** | | +**confidence** | **String** | decimal as string | +**currency** | **String** | | +**dayGap** | **int** | | +**eventId** | **int** | | +**id** | **int** | | +**kind** | **String** | | +**note** | **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/LinksApi.md b/app/packages/api_client/doc/LinksApi.md new file mode 100644 index 0000000..d855d94 --- /dev/null +++ b/app/packages/api_client/doc/LinksApi.md @@ -0,0 +1,140 @@ +# fintracker_api.api.LinksApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**linksCreate**](LinksApi.md#linkscreate) | **POST** /api/v1/links | Create +[**linksDelete**](LinksApi.md#linksdelete) | **DELETE** /api/v1/links/{link_id} | Delete +[**linksUnmatched**](LinksApi.md#linksunmatched) | **GET** /api/v1/links/unmatched | Unmatched + + +# **linksCreate** +> LinkOut linksCreate(linkCreate) + +Create + +Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getLinksApi(); +final LinkCreate linkCreate = ; // LinkCreate | + +try { + final response = api.linksCreate(linkCreate); + print(response); +} on DioException catch (e) { + print('Exception when calling LinksApi->linksCreate: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **linkCreate** | [**LinkCreate**](LinkCreate.md)| | + +### Return type + +[**LinkOut**](LinkOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **linksDelete** +> linksDelete(linkId) + +Delete + +Undo a link, manual or automatic. `flow_type` reverts on the next `POST /metrics/refresh`, when `classify` rebuilds it from the rules and `matching` no longer overwrites it. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getLinksApi(); +final int linkId = 56; // int | + +try { + api.linksDelete(linkId); +} on DioException catch (e) { + print('Exception when calling LinksApi->linksDelete: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **linkId** | **int**| | + +### Return type + +void (empty response body) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **linksUnmatched** +> UnmatchedOut linksUnmatched() + +Unmatched + +Every candidate that survives matching without a link, on either side. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getLinksApi(); + +try { + final response = api.linksUnmatched(); + print(response); +} on DioException catch (e) { + print('Exception when calling LinksApi->linksUnmatched: $e\n'); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**UnmatchedOut**](UnmatchedOut.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/NewInstrument.md b/app/packages/api_client/doc/NewInstrument.md new file mode 100644 index 0000000..d221d40 --- /dev/null +++ b/app/packages/api_client/doc/NewInstrument.md @@ -0,0 +1,21 @@ +# fintracker_api.model.NewInstrument + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assetClass** | **String** | | +**board** | **String** | | [optional] +**currency** | **String** | | [optional] [default to 'RUB'] +**isin** | **String** | | [optional] +**lot** | **int** | | [optional] [default to 1] +**name** | **String** | | +**ticker** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PendingInstrumentOut.md b/app/packages/api_client/doc/PendingInstrumentOut.md new file mode 100644 index 0000000..2619523 --- /dev/null +++ b/app/packages/api_client/doc/PendingInstrumentOut.md @@ -0,0 +1,30 @@ +# fintracker_api.model.PendingInstrumentOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assetClassHint** | **String** | | [optional] +**board** | **String** | | [optional] +**createdAt** | [**DateTime**](DateTime.md) | | [optional] +**currency** | **String** | | [optional] +**firstSeenFileId** | **int** | | [optional] +**id** | **int** | | +**instrumentId** | **int** | | [optional] +**isin** | **String** | | [optional] +**name** | **String** | | [optional] +**occurrences** | **int** | | +**samplePrice** | **String** | decimal as string | [optional] +**sampleQuantity** | **String** | decimal as string | [optional] +**source_** | **String** | | +**sourceKey** | **String** | | +**status** | **String** | | +**ticker** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PendingResolveRequest.md b/app/packages/api_client/doc/PendingResolveRequest.md new file mode 100644 index 0000000..6cbc379 --- /dev/null +++ b/app/packages/api_client/doc/PendingResolveRequest.md @@ -0,0 +1,17 @@ +# fintracker_api.model.PendingResolveRequest + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**instrument** | [**NewInstrument**](NewInstrument.md) | | [optional] +**instrumentId** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/PendingResolveResult.md b/app/packages/api_client/doc/PendingResolveResult.md new file mode 100644 index 0000000..bda4a22 --- /dev/null +++ b/app/packages/api_client/doc/PendingResolveResult.md @@ -0,0 +1,20 @@ +# fintracker_api.model.PendingResolveResult + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aliasCreated** | **bool** | | +**eventsBound** | **int** | | +**id** | **int** | | +**instrumentId** | **int** | | [optional] +**metricsRefreshed** | **bool** | | +**status** | **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/PriceManualIn.md b/app/packages/api_client/doc/PriceManualIn.md new file mode 100644 index 0000000..5b4aaa5 --- /dev/null +++ b/app/packages/api_client/doc/PriceManualIn.md @@ -0,0 +1,18 @@ +# fintracker_api.model.PriceManualIn + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **String** | | +**d** | [**DateTime**](DateTime.md) | | +**note** | **String** | | [optional] +**price** | **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/PriceManualOut.md b/app/packages/api_client/doc/PriceManualOut.md new file mode 100644 index 0000000..0c1aab7 --- /dev/null +++ b/app/packages/api_client/doc/PriceManualOut.md @@ -0,0 +1,20 @@ +# fintracker_api.model.PriceManualOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **String** | | +**d** | [**DateTime**](DateTime.md) | | +**id** | **int** | | +**instrumentId** | **int** | | +**note** | **String** | | +**price** | **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 index 9f4459b..366cc4b 100644 --- a/app/packages/api_client/doc/PricePoint.md +++ b/app/packages/api_client/doc/PricePoint.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **close** | **String** | decimal as string | **currency** | **String** | | **d** | [**DateTime**](DateTime.md) | | +**source_** | **String** | | [optional] [default to 'daily'] [[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/RebalanceApi.md b/app/packages/api_client/doc/RebalanceApi.md new file mode 100644 index 0000000..76dc89f --- /dev/null +++ b/app/packages/api_client/doc/RebalanceApi.md @@ -0,0 +1,149 @@ +# fintracker_api.api.RebalanceApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**rebalanceRebalance**](RebalanceApi.md#rebalancerebalance) | **GET** /api/v1/portfolios/{portfolio_id}/rebalance | Rebalance +[**rebalanceSetTargets**](RebalanceApi.md#rebalancesettargets) | **PUT** /api/v1/portfolios/{portfolio_id}/targets | Set Targets +[**rebalanceTargets**](RebalanceApi.md#rebalancetargets) | **GET** /api/v1/portfolios/{portfolio_id}/targets | Targets + + +# **rebalanceRebalance** +> RebalanceOut rebalanceRebalance(portfolioId, dimension, cashAvailable) + +Rebalance + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getRebalanceApi(); +final int portfolioId = 56; // int | +final String dimension = dimension_example; // String | asset_class | sector | country | currency +final CashAvailable cashAvailable = ; // CashAvailable | переопределяет остаток на счетах для what-if + +try { + final response = api.rebalanceRebalance(portfolioId, dimension, cashAvailable); + print(response); +} on DioException catch (e) { + print('Exception when calling RebalanceApi->rebalanceRebalance: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioId** | **int**| | + **dimension** | **String**| asset_class | sector | country | currency | [optional] [default to 'asset_class'] + **cashAvailable** | [**CashAvailable**](.md)| переопределяет остаток на счетах для what-if | [optional] + +### Return type + +[**RebalanceOut**](RebalanceOut.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) + +# **rebalanceSetTargets** +> TargetsOut rebalanceSetTargets(portfolioId, targetsIn) + +Set Targets + +Replace the whole set for one dimension. The weights must add up to 1 within `WEIGHT_TOLERANCE`; otherwise the request is refused with the actual sum in the message, so the user can see by how much the plan misses rather than being handed a silently rescaled one. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getRebalanceApi(); +final int portfolioId = 56; // int | +final TargetsIn targetsIn = ; // TargetsIn | + +try { + final response = api.rebalanceSetTargets(portfolioId, targetsIn); + print(response); +} on DioException catch (e) { + print('Exception when calling RebalanceApi->rebalanceSetTargets: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioId** | **int**| | + **targetsIn** | [**TargetsIn**](TargetsIn.md)| | + +### Return type + +[**TargetsOut**](TargetsOut.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **rebalanceTargets** +> TargetsOut rebalanceTargets(portfolioId, dimension) + +Targets + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getRebalanceApi(); +final int portfolioId = 56; // int | +final String dimension = dimension_example; // String | asset_class | sector | country | currency + +try { + final response = api.rebalanceTargets(portfolioId, dimension); + print(response); +} on DioException catch (e) { + print('Exception when calling RebalanceApi->rebalanceTargets: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **portfolioId** | **int**| | + **dimension** | **String**| asset_class | sector | country | currency | [optional] [default to 'asset_class'] + +### Return type + +[**TargetsOut**](TargetsOut.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/RebalanceBucketOut.md b/app/packages/api_client/doc/RebalanceBucketOut.md new file mode 100644 index 0000000..f674d13 --- /dev/null +++ b/app/packages/api_client/doc/RebalanceBucketOut.md @@ -0,0 +1,22 @@ +# fintracker_api.model.RebalanceBucketOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bucket** | **String** | | +**currentValueRub** | **String** | decimal as string | +**currentWeight** | **String** | decimal as string | +**deltaValueRub** | **String** | decimal as string | +**drift** | **String** | decimal as string | +**targetWeight** | **String** | decimal as string | +**trades** | [**List<TradeOut>**](TradeOut.md) | | +**withinBand** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/RebalanceOut.md b/app/packages/api_client/doc/RebalanceOut.md new file mode 100644 index 0000000..e7ad3a8 --- /dev/null +++ b/app/packages/api_client/doc/RebalanceOut.md @@ -0,0 +1,21 @@ +# fintracker_api.model.RebalanceOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**buckets** | [**List<RebalanceBucketOut>**](RebalanceBucketOut.md) | | +**cashAvailableRub** | **String** | decimal as string | +**dimension** | **String** | | +**portfolioId** | **int** | | +**totalValueRub** | **String** | decimal as string | +**warnings** | **List<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/ReconciliationCash.md b/app/packages/api_client/doc/ReconciliationCash.md new file mode 100644 index 0000000..1e50c37 --- /dev/null +++ b/app/packages/api_client/doc/ReconciliationCash.md @@ -0,0 +1,19 @@ +# fintracker_api.model.ReconciliationCash + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balanceDerived** | **String** | decimal as string | +**balanceReport** | **String** | decimal as string | +**currency** | **String** | | +**delta** | **String** | decimal as string | +**matches** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/ReconciliationOut.md b/app/packages/api_client/doc/ReconciliationOut.md new file mode 100644 index 0000000..98dd130 --- /dev/null +++ b/app/packages/api_client/doc/ReconciliationOut.md @@ -0,0 +1,18 @@ +# fintracker_api.model.ReconciliationOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**cash** | [**List<ReconciliationCash>**](ReconciliationCash.md) | | [optional] +**matches** | **bool** | | [optional] [default to true] +**positions** | [**List<ReconciliationPosition>**](ReconciliationPosition.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/ReconciliationPosition.md b/app/packages/api_client/doc/ReconciliationPosition.md new file mode 100644 index 0000000..a67a304 --- /dev/null +++ b/app/packages/api_client/doc/ReconciliationPosition.md @@ -0,0 +1,22 @@ +# fintracker_api.model.ReconciliationPosition + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instrumentId** | **int** | | +**instrumentName** | **String** | | +**isin** | **String** | | +**matches** | **bool** | | +**qtyDelta** | **String** | decimal as string | +**qtyDerived** | **String** | decimal as string | +**qtyReport** | **String** | decimal as 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/SampleEventOut.md b/app/packages/api_client/doc/SampleEventOut.md new file mode 100644 index 0000000..67cf950 --- /dev/null +++ b/app/packages/api_client/doc/SampleEventOut.md @@ -0,0 +1,30 @@ +# fintracker_api.model.SampleEventOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **String** | decimal as string | +**currency** | **String** | | +**dedupeKey** | **String** | | +**description** | **String** | | [optional] +**fee** | **String** | decimal as string | [optional] +**instrumentId** | **int** | | [optional] +**instrumentKey** | **String** | | [optional] +**instrumentName** | **String** | | [optional] +**isDuplicate** | **bool** | | +**kind** | **String** | | +**lineNo** | **int** | | +**price** | **String** | decimal as string | [optional] +**quantity** | **String** | decimal as string | [optional] +**settleDate** | [**DateTime**](DateTime.md) | | [optional] +**tradeDate** | [**DateTime**](DateTime.md) | | +**tradeNo** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/app/packages/api_client/doc/TargetIn.md b/app/packages/api_client/doc/TargetIn.md new file mode 100644 index 0000000..2bb5023 --- /dev/null +++ b/app/packages/api_client/doc/TargetIn.md @@ -0,0 +1,18 @@ +# fintracker_api.model.TargetIn + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**band** | **String** | decimal as string | [optional] +**bucket** | **String** | | +**note** | **String** | | [optional] +**targetWeight** | **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/TargetOut.md b/app/packages/api_client/doc/TargetOut.md new file mode 100644 index 0000000..1e040f8 --- /dev/null +++ b/app/packages/api_client/doc/TargetOut.md @@ -0,0 +1,18 @@ +# fintracker_api.model.TargetOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**band** | **String** | decimal as string | +**bucket** | **String** | | +**note** | **String** | | +**targetWeight** | **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/TargetsIn.md b/app/packages/api_client/doc/TargetsIn.md new file mode 100644 index 0000000..d212396 --- /dev/null +++ b/app/packages/api_client/doc/TargetsIn.md @@ -0,0 +1,16 @@ +# fintracker_api.model.TargetsIn + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimension** | **String** | asset_class | sector | country | currency | +**targets** | [**List<TargetIn>**](TargetIn.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/TargetsOut.md b/app/packages/api_client/doc/TargetsOut.md new file mode 100644 index 0000000..e3565ae --- /dev/null +++ b/app/packages/api_client/doc/TargetsOut.md @@ -0,0 +1,18 @@ +# fintracker_api.model.TargetsOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dimension** | **String** | | +**portfolioId** | **int** | | +**targets** | [**List<TargetOut>**](TargetOut.md) | | +**weightsSum** | **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/TaxAccountOut.md b/app/packages/api_client/doc/TaxAccountOut.md new file mode 100644 index 0000000..9e15d69 --- /dev/null +++ b/app/packages/api_client/doc/TaxAccountOut.md @@ -0,0 +1,24 @@ +# fintracker_api.model.TaxAccountOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | +**accountName** | **String** | | +**couponsGrossRub** | **String** | decimal as string | +**dividendsGrossRub** | **String** | decimal as string | +**estimatedTaxRub** | **String** | decimal as string | +**ldvExemptRub** | **String** | decimal as string | +**realizedGainRub** | **String** | decimal as string | +**realizedLossRub** | **String** | decimal as string | +**taxWithheldRub** | **String** | decimal as string | +**taxableBaseRub** | **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/TaxApi.md b/app/packages/api_client/doc/TaxApi.md new file mode 100644 index 0000000..2f4e63e --- /dev/null +++ b/app/packages/api_client/doc/TaxApi.md @@ -0,0 +1,105 @@ +# fintracker_api.api.TaxApi + +## Load the API package +```dart +import 'package:fintracker_api/api.dart'; +``` + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**taxLots**](TaxApi.md#taxlots) | **GET** /api/v1/tax/lots | Lots +[**taxSummary**](TaxApi.md#taxsummary) | **GET** /api/v1/tax | Summary + + +# **taxLots** +> TaxLotsOut taxLots(year, accountId) + +Lots + +Open lots with the date after which a sale falls under the long-term exemption. `year` selects the rate the \"what if I sold today\" figure is computed at; the lots themselves are always the ones open right now. `lot` is rebuilt from the ledger on every refresh and holds today's state only, so there is no honest way to answer \"which lots were open on 31 December two years ago\" — and inventing one would be worse than the limitation. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getTaxApi(); +final int year = 56; // int | +final int accountId = 56; // int | + +try { + final response = api.taxLots(year, accountId); + print(response); +} on DioException catch (e) { + print('Exception when calling TaxApi->taxLots: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **year** | **int**| | [optional] + **accountId** | **int**| | [optional] + +### Return type + +[**TaxLotsOut**](TaxLotsOut.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) + +# **taxSummary** +> TaxYearOut taxSummary(year, accountId) + +Summary + +The year's estimated tax position, per account and in total. + +### Example +```dart +import 'package:fintracker_api/api.dart'; + +final api = FintrackerApi().getTaxApi(); +final int year = 56; // int | +final int accountId = 56; // int | + +try { + final response = api.taxSummary(year, accountId); + print(response); +} on DioException catch (e) { + print('Exception when calling TaxApi->taxSummary: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **year** | **int**| | [optional] + **accountId** | **int**| | [optional] + +### Return type + +[**TaxYearOut**](TaxYearOut.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/TaxLotOut.md b/app/packages/api_client/doc/TaxLotOut.md new file mode 100644 index 0000000..171b847 --- /dev/null +++ b/app/packages/api_client/doc/TaxLotOut.md @@ -0,0 +1,29 @@ +# fintracker_api.model.TaxLotOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | +**accountName** | **String** | | +**costRub** | **String** | decimal as string | +**daysToLdv** | **int** | | +**instrumentId** | **int** | | +**ldvDate** | [**DateTime**](DateTime.md) | | +**ldvEligible** | **bool** | | +**lotId** | **int** | | +**marketValueRub** | **String** | decimal as string | +**name** | **String** | | +**openDate** | [**DateTime**](DateTime.md) | | +**qtyRemaining** | **String** | decimal as string | +**taxIfSoldNowRub** | **String** | decimal as string | +**ticker** | **String** | | +**unrealizedGainRub** | **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/TaxLotsOut.md b/app/packages/api_client/doc/TaxLotsOut.md new file mode 100644 index 0000000..b90ffe6 --- /dev/null +++ b/app/packages/api_client/doc/TaxLotsOut.md @@ -0,0 +1,20 @@ +# fintracker_api.model.TaxLotsOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asOf** | [**DateTime**](DateTime.md) | | +**disclaimer** | **String** | | +**estimated** | **bool** | | [optional] [default to true] +**lots** | [**List<TaxLotOut>**](TaxLotOut.md) | | +**taxRate** | **String** | decimal as string | +**year** | **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/TaxTotals.md b/app/packages/api_client/doc/TaxTotals.md new file mode 100644 index 0000000..02f3fd4 --- /dev/null +++ b/app/packages/api_client/doc/TaxTotals.md @@ -0,0 +1,22 @@ +# fintracker_api.model.TaxTotals + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**couponsGrossRub** | **String** | decimal as string | +**dividendsGrossRub** | **String** | decimal as string | +**estimatedTaxRub** | **String** | decimal as string | +**ldvExemptRub** | **String** | decimal as string | +**realizedGainRub** | **String** | decimal as string | +**realizedLossRub** | **String** | decimal as string | +**taxWithheldRub** | **String** | decimal as string | +**taxableBaseRub** | **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/TaxYearOut.md b/app/packages/api_client/doc/TaxYearOut.md new file mode 100644 index 0000000..a17ddc3 --- /dev/null +++ b/app/packages/api_client/doc/TaxYearOut.md @@ -0,0 +1,20 @@ +# fintracker_api.model.TaxYearOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts** | [**List<TaxAccountOut>**](TaxAccountOut.md) | | +**disclaimer** | **String** | | +**estimated** | **bool** | | [optional] [default to true] +**taxRate** | **String** | decimal as string | +**totals** | [**TaxTotals**](TaxTotals.md) | | +**year** | **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/TradeOut.md b/app/packages/api_client/doc/TradeOut.md new file mode 100644 index 0000000..622379f --- /dev/null +++ b/app/packages/api_client/doc/TradeOut.md @@ -0,0 +1,24 @@ +# fintracker_api.model.TradeOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **String** | | +**amountRub** | **String** | decimal as string | +**blockedByCash** | **bool** | | +**instrumentId** | **int** | | +**lot** | **int** | | +**name** | **String** | | +**price** | **String** | decimal as string | +**priceCurrency** | **String** | | +**suggestedQty** | **String** | decimal as 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/UnmatchedBrokerOut.md b/app/packages/api_client/doc/UnmatchedBrokerOut.md new file mode 100644 index 0000000..7add9fb --- /dev/null +++ b/app/packages/api_client/doc/UnmatchedBrokerOut.md @@ -0,0 +1,20 @@ +# fintracker_api.model.UnmatchedBrokerOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **int** | | +**amount** | **String** | decimal as string | +**currency** | **String** | | +**date** | [**DateTime**](DateTime.md) | | +**direction** | **String** | | +**eventId** | **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/UnmatchedOut.md b/app/packages/api_client/doc/UnmatchedOut.md new file mode 100644 index 0000000..6e30605 --- /dev/null +++ b/app/packages/api_client/doc/UnmatchedOut.md @@ -0,0 +1,16 @@ +# fintracker_api.model.UnmatchedOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**broker** | [**List<UnmatchedBrokerOut>**](UnmatchedBrokerOut.md) | | +**zm** | [**List<UnmatchedZmOut>**](UnmatchedZmOut.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/UnmatchedZmOut.md b/app/packages/api_client/doc/UnmatchedZmOut.md new file mode 100644 index 0000000..c152175 --- /dev/null +++ b/app/packages/api_client/doc/UnmatchedZmOut.md @@ -0,0 +1,23 @@ +# fintracker_api.model.UnmatchedZmOut + +## Load the model package +```dart +import 'package:fintracker_api/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **String** | decimal as string | +**brokerAccountId** | **int** | | +**cashTxnId** | **int** | | +**comment** | **String** | | +**currency** | **String** | | +**date** | [**DateTime**](DateTime.md) | | +**direction** | **String** | | +**payee** | **String** | | +**route** | **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 6a6fe21..e2eb166 100644 --- a/app/packages/api_client/lib/fintracker_api.dart +++ b/app/packages/api_client/lib/fintracker_api.dart @@ -12,15 +12,22 @@ 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/benchmarks_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/goals_api.dart'; export 'package:fintracker_api/src/api/health_api.dart'; +export 'package:fintracker_api/src/api/imports_api.dart'; +export 'package:fintracker_api/src/api/income_api.dart'; export 'package:fintracker_api/src/api/instruments_api.dart'; +export 'package:fintracker_api/src/api/links_api.dart'; export 'package:fintracker_api/src/api/metrics_api.dart'; export 'package:fintracker_api/src/api/networth_api.dart'; +export 'package:fintracker_api/src/api/rebalance_api.dart'; export 'package:fintracker_api/src/api/rules_api.dart'; export 'package:fintracker_api/src/api/sync_api.dart'; +export 'package:fintracker_api/src/api/tax_api.dart'; export 'package:fintracker_api/src/api/transactions_api.dart'; export 'package:fintracker_api/src/model/account_balance.dart'; @@ -28,11 +35,23 @@ 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/account_suggestion.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/benchmark_comparison.dart'; +export 'package:fintracker_api/src/model/benchmark_comparison_out.dart'; +export 'package:fintracker_api/src/model/benchmark_create.dart'; +export 'package:fintracker_api/src/model/benchmark_out.dart'; +export 'package:fintracker_api/src/model/benchmark_patch.dart'; +export 'package:fintracker_api/src/model/benchmark_return_out.dart'; export 'package:fintracker_api/src/model/broker.dart'; +export 'package:fintracker_api/src/model/calendar_entry.dart'; +export 'package:fintracker_api/src/model/calendar_out.dart'; +export 'package:fintracker_api/src/model/cash_available.dart'; +export 'package:fintracker_api/src/model/cash_flow_broker_month.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/commit_request.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'; @@ -40,17 +59,43 @@ 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/forecast_month.dart'; +export 'package:fintracker_api/src/model/forecast_out.dart'; +export 'package:fintracker_api/src/model/goal_create.dart'; +export 'package:fintracker_api/src/model/goal_out.dart'; +export 'package:fintracker_api/src/model/goal_patch.dart'; +export 'package:fintracker_api/src/model/goal_progress_out.dart'; export 'package:fintracker_api/src/model/health.dart'; +export 'package:fintracker_api/src/model/history_out.dart'; +export 'package:fintracker_api/src/model/history_row.dart'; +export 'package:fintracker_api/src/model/history_totals.dart'; export 'package:fintracker_api/src/model/holding_out.dart'; +export 'package:fintracker_api/src/model/import_counts.dart'; +export 'package:fintracker_api/src/model/import_preview.dart'; +export 'package:fintracker_api/src/model/import_result.dart'; +export 'package:fintracker_api/src/model/import_summary.dart'; export 'package:fintracker_api/src/model/instrument_detail.dart'; export 'package:fintracker_api/src/model/instrument_out.dart'; export 'package:fintracker_api/src/model/job_status.dart'; +export 'package:fintracker_api/src/model/link_create.dart'; +export 'package:fintracker_api/src/model/link_out.dart'; export 'package:fintracker_api/src/model/login_request.dart'; export 'package:fintracker_api/src/model/lot_out.dart'; export 'package:fintracker_api/src/model/net_worth_breakdown.dart'; export 'package:fintracker_api/src/model/net_worth_day.dart'; +export 'package:fintracker_api/src/model/new_instrument.dart'; +export 'package:fintracker_api/src/model/pending_instrument_out.dart'; +export 'package:fintracker_api/src/model/pending_resolve_request.dart'; +export 'package:fintracker_api/src/model/pending_resolve_result.dart'; +export 'package:fintracker_api/src/model/price_manual_in.dart'; +export 'package:fintracker_api/src/model/price_manual_out.dart'; export 'package:fintracker_api/src/model/price_point.dart'; export 'package:fintracker_api/src/model/problem.dart'; +export 'package:fintracker_api/src/model/rebalance_bucket_out.dart'; +export 'package:fintracker_api/src/model/rebalance_out.dart'; +export 'package:fintracker_api/src/model/reconciliation_cash.dart'; +export 'package:fintracker_api/src/model/reconciliation_out.dart'; +export 'package:fintracker_api/src/model/reconciliation_position.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'; @@ -61,15 +106,29 @@ 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/sample_event_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/target_in.dart'; +export 'package:fintracker_api/src/model/target_out.dart'; +export 'package:fintracker_api/src/model/targets_in.dart'; +export 'package:fintracker_api/src/model/targets_out.dart'; +export 'package:fintracker_api/src/model/tax_account_out.dart'; +export 'package:fintracker_api/src/model/tax_lot_out.dart'; +export 'package:fintracker_api/src/model/tax_lots_out.dart'; +export 'package:fintracker_api/src/model/tax_totals.dart'; +export 'package:fintracker_api/src/model/tax_year_out.dart'; export 'package:fintracker_api/src/model/token_pair.dart'; +export 'package:fintracker_api/src/model/trade_out.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/unmatched_broker_out.dart'; +export 'package:fintracker_api/src/model/unmatched_out.dart'; +export 'package:fintracker_api/src/model/unmatched_zm_out.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 6b15661..27ffc56 100644 --- a/app/packages/api_client/lib/src/api.dart +++ b/app/packages/api_client/lib/src/api.dart @@ -10,15 +10,22 @@ 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/benchmarks_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/goals_api.dart'; import 'package:fintracker_api/src/api/health_api.dart'; +import 'package:fintracker_api/src/api/imports_api.dart'; +import 'package:fintracker_api/src/api/income_api.dart'; import 'package:fintracker_api/src/api/instruments_api.dart'; +import 'package:fintracker_api/src/api/links_api.dart'; import 'package:fintracker_api/src/api/metrics_api.dart'; import 'package:fintracker_api/src/api/networth_api.dart'; +import 'package:fintracker_api/src/api/rebalance_api.dart'; import 'package:fintracker_api/src/api/rules_api.dart'; import 'package:fintracker_api/src/api/sync_api.dart'; +import 'package:fintracker_api/src/api/tax_api.dart'; import 'package:fintracker_api/src/api/transactions_api.dart'; class FintrackerApi { @@ -130,6 +137,12 @@ class FintrackerApi { return AuthApi(dio); } + /// Get BenchmarksApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + BenchmarksApi getBenchmarksApi() { + return BenchmarksApi(dio); + } + /// Get CashflowApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed CashflowApi getCashflowApi() { @@ -148,18 +161,42 @@ class FintrackerApi { return EventsApi(dio); } + /// Get GoalsApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + GoalsApi getGoalsApi() { + return GoalsApi(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 ImportsApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + ImportsApi getImportsApi() { + return ImportsApi(dio); + } + + /// Get IncomeApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + IncomeApi getIncomeApi() { + return IncomeApi(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 LinksApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + LinksApi getLinksApi() { + return LinksApi(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() { @@ -172,6 +209,12 @@ class FintrackerApi { return NetworthApi(dio); } + /// Get RebalanceApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + RebalanceApi getRebalanceApi() { + return RebalanceApi(dio); + } + /// Get RulesApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed RulesApi getRulesApi() { @@ -184,6 +227,12 @@ class FintrackerApi { return SyncApi(dio); } + /// Get TaxApi instance, base route and serializer can be overridden by a given but be careful, + /// by doing that all interceptors will not be executed + TaxApi getTaxApi() { + return TaxApi(dio); + } + /// Get TransactionsApi instance, base route and serializer can be overridden by a given but be careful, /// by doing that all interceptors will not be executed TransactionsApi getTransactionsApi() { diff --git a/app/packages/api_client/lib/src/api/analytics_api.dart b/app/packages/api_client/lib/src/api/analytics_api.dart index c6b17ee..db60343 100644 --- a/app/packages/api_client/lib/src/api/analytics_api.dart +++ b/app/packages/api_client/lib/src/api/analytics_api.dart @@ -11,6 +11,7 @@ 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/cash_flow_broker_month.dart'; import 'package:fintracker_api/src/model/holding_out.dart'; import 'package:fintracker_api/src/model/problem.dart'; import 'package:fintracker_api/src/model/returns_out.dart'; @@ -110,6 +111,89 @@ _responseData = rawData == null ? null : deserialize, All ); } + /// Cashflow Broker + /// Money moved across the brokerage boundary, by month: the other half of cash flow that `metric_cash_flow_monthly` (ZenMoney spending) does not cover. + /// + /// 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>> analyticsCashflowBroker({ + String? scope = 'all', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/cashflow-broker'; + 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, CashFlowBrokerMonth>(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. /// diff --git a/app/packages/api_client/lib/src/api/benchmarks_api.dart b/app/packages/api_client/lib/src/api/benchmarks_api.dart new file mode 100644 index 0000000..31feb0f --- /dev/null +++ b/app/packages/api_client/lib/src/api/benchmarks_api.dart @@ -0,0 +1,435 @@ +// +// 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/benchmark_comparison.dart'; +import 'package:fintracker_api/src/model/benchmark_create.dart'; +import 'package:fintracker_api/src/model/benchmark_out.dart'; +import 'package:fintracker_api/src/model/benchmark_patch.dart'; +import 'package:fintracker_api/src/model/problem.dart'; + +class BenchmarksApi { + + final Dio _dio; + + const BenchmarksApi(this._dio); + + /// Benchmarks + /// The portfolio's TWR beside each benchmark's, on the same grid of days. `days_skipped` is returned on both sides and is not cosmetic: a non-zero value on either means the two chains did not cover the same days, and the difference is then an approximation of an excess return rather than one. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [period] - repeatable: 1m 3m 6m ytd 1y 3y all + /// * [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 [BenchmarkComparison] as data + /// Throws [DioException] if API call or serialization fails + Future> benchmarksBenchmarks({ + String? scope = 'all', + List? period, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/analytics/benchmarks'; + 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 (period != null) r'period': period, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BenchmarkComparison? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'BenchmarkComparison', 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, + ); + } + + /// Create + /// + /// + /// Parameters: + /// * [benchmarkCreate] + /// * [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 [BenchmarkOut] as data + /// Throws [DioException] if API call or serialization fails + Future> benchmarksCreate({ + required BenchmarkCreate benchmarkCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/benchmarks'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(benchmarkCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BenchmarkOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'BenchmarkOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Delete + /// + /// + /// Parameters: + /// * [benchmarkId] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> benchmarksDelete({ + required int benchmarkId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/benchmarks/{benchmark_id}'.replaceAll('{' r'benchmark_id' '}', benchmarkId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// List + /// Every benchmark, defaults first — the order the comparison block shows them in. + /// + /// 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>> benchmarksList({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/benchmarks'; + 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, BenchmarkOut>(rawData, 'List', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Patch + /// + /// + /// Parameters: + /// * [benchmarkId] + /// * [benchmarkPatch] + /// * [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 [BenchmarkOut] as data + /// Throws [DioException] if API call or serialization fails + Future> benchmarksPatch({ + required int benchmarkId, + required BenchmarkPatch benchmarkPatch, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/benchmarks/{benchmark_id}'.replaceAll('{' r'benchmark_id' '}', benchmarkId.toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(benchmarkPatch); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + BenchmarkOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'BenchmarkOut', 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/goals_api.dart b/app/packages/api_client/lib/src/api/goals_api.dart new file mode 100644 index 0000000..ee407ab --- /dev/null +++ b/app/packages/api_client/lib/src/api/goals_api.dart @@ -0,0 +1,434 @@ +// +// 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/goal_create.dart'; +import 'package:fintracker_api/src/model/goal_out.dart'; +import 'package:fintracker_api/src/model/goal_patch.dart'; +import 'package:fintracker_api/src/model/goal_progress_out.dart'; +import 'package:fintracker_api/src/model/problem.dart'; + +class GoalsApi { + + final Dio _dio; + + const GoalsApi(this._dio); + + /// Create + /// + /// + /// Parameters: + /// * [goalCreate] + /// * [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 [GoalOut] as data + /// Throws [DioException] if API call or serialization fails + Future> goalsCreate({ + required GoalCreate goalCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/goals'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(goalCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + GoalOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'GoalOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Delete + /// + /// + /// Parameters: + /// * [goalId] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> goalsDelete({ + required int goalId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/goals/{goal_id}'.replaceAll('{' r'goal_id' '}', goalId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// List + /// + /// + /// Parameters: + /// * [includeArchived] + /// * [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>> goalsList({ + bool? includeArchived = false, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/goals'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (includeArchived != null) r'include_archived': includeArchived, + }; + + 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, GoalOut>(rawData, 'List', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response>( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Patch + /// + /// + /// Parameters: + /// * [goalId] + /// * [goalPatch] + /// * [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 [GoalOut] as data + /// Throws [DioException] if API call or serialization fails + Future> goalsPatch({ + required int goalId, + required GoalPatch goalPatch, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/goals/{goal_id}'.replaceAll('{' r'goal_id' '}', goalId.toString()); + final _options = Options( + method: r'PATCH', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(goalPatch); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + GoalOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'GoalOut', 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, + ); + } + + /// Progress + /// + /// + /// Parameters: + /// * [goalId] + /// * [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 [GoalProgressOut] as data + /// Throws [DioException] if API call or serialization fails + Future> goalsProgress({ + required int goalId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/goals/{goal_id}/progress'.replaceAll('{' r'goal_id' '}', goalId.toString()); + 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, + ); + + GoalProgressOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'GoalProgressOut', 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/imports_api.dart b/app/packages/api_client/lib/src/api/imports_api.dart new file mode 100644 index 0000000..a41d282 --- /dev/null +++ b/app/packages/api_client/lib/src/api/imports_api.dart @@ -0,0 +1,448 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +import 'dart:async'; + +// ignore: unused_import +import 'dart:convert'; +import 'package:fintracker_api/src/deserialize.dart'; +import 'package:dio/dio.dart'; + +import 'package:fintracker_api/src/model/commit_request.dart'; +import 'package:fintracker_api/src/model/import_preview.dart'; +import 'package:fintracker_api/src/model/import_result.dart'; +import 'package:fintracker_api/src/model/import_summary.dart'; +import 'package:fintracker_api/src/model/problem.dart'; + +class ImportsApi { + + final Dio _dio; + + const ImportsApi(this._dio); + + /// Commit + /// Write the file's events into the ledger and rebuild every metric. + /// + /// Parameters: + /// * [importId] + /// * [commitRequest] + /// * [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 [ImportResult] as data + /// Throws [DioException] if API call or serialization fails + Future> importsCommit({ + required int importId, + required CommitRequest commitRequest, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/imports/{import_id}/commit'.replaceAll('{' r'import_id' '}', importId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(commitRequest); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ImportResult? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ImportResult', 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, + ); + } + + /// Create + /// Upload a report, parse it and show what committing it would do. Writes no event. + /// + /// Parameters: + /// * [file] - the report itself + /// * [accountId] - target account, if known + /// * [parser] - force a parser from registry.names() + /// * [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 [ImportPreview] as data + /// Throws [DioException] if API call or serialization fails + Future> importsCreate({ + required MultipartFile file, + int? accountId, + String? parser, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/imports'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'multipart/form-data', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = FormData.fromMap({ + r'account_id': accountId, + r'file': file, + r'parser': parser, + }); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ImportPreview? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ImportPreview', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Delete + /// Drop an uncommitted import. A committed one stays: `raw_*` is append-only. + /// + /// Parameters: + /// * [importId] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> importsDelete({ + required int importId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/imports/{import_id}'.replaceAll('{' r'import_id' '}', importId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Get + /// The preview again — recomputed for an uncommitted import, replayed for a committed one. + /// + /// Parameters: + /// * [importId] + /// * [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 [ImportPreview] as data + /// Throws [DioException] if API call or serialization fails + Future> importsGet({ + required int importId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/imports/{import_id}'.replaceAll('{' r'import_id' '}', importId.toString()); + 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, + ); + + ImportPreview? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ImportPreview', 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 + /// Newest imports first, with the counters each was committed with. + /// + /// Parameters: + /// * [status] - uploaded | parsed | committed | failed + /// * [limit] + /// * [offset] + /// * [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>> importsList({ + String? status, + int? limit = 50, + int? offset = 0, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/imports'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (status != null) r'status': status, + if (limit != null) r'limit': limit, + if (offset != null) r'offset': offset, + }; + + 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, ImportSummary>(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/income_api.dart b/app/packages/api_client/lib/src/api/income_api.dart new file mode 100644 index 0000000..06e2c62 --- /dev/null +++ b/app/packages/api_client/lib/src/api/income_api.dart @@ -0,0 +1,296 @@ +// +// 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/calendar_out.dart'; +import 'package:fintracker_api/src/model/forecast_out.dart'; +import 'package:fintracker_api/src/model/history_out.dart'; +import 'package:fintracker_api/src/model/problem.dart'; + +class IncomeApi { + + final Dio _dio; + + const IncomeApi(this._dio); + + /// Calendar + /// Payments in a window, one row each; defaults to the next 12 months, forecast only. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [dateFrom] + /// * [dateTo] + /// * [includePaid] + /// * [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 [CalendarOut] as data + /// Throws [DioException] if API call or serialization fails + Future> incomeCalendar({ + String? scope = 'all', + DateTime? dateFrom, + DateTime? dateTo, + bool? includePaid = false, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/income/calendar'; + 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 (dateFrom != null) r'date_from': dateFrom, + if (dateTo != null) r'date_to': dateTo, + if (includePaid != null) r'include_paid': includePaid, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + CalendarOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'CalendarOut', 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, + ); + } + + /// Forecast + /// Expected income per month, split by basis, plus the yield it implies. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [months] + /// * [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 [ForecastOut] as data + /// Throws [DioException] if API call or serialization fails + Future> incomeForecast({ + String? scope = 'all', + int? months = 12, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/income/forecast'; + 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 (months != null) r'months': months, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + ForecastOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'ForecastOut', 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, + ); + } + + /// History + /// Income actually received, grouped by month, kind and currency. `group` exists for the contract's sake and accepts only `month`: the table is stored monthly, and a finer grouping would have to re-read the ledger, which is what the calendar's `paid` rows already do per payment. + /// + /// Parameters: + /// * [scope] - all | account: | portfolio: + /// * [group] - month + /// * [dateFrom] + /// * [dateTo] + /// * [kind] - dividend | coupon | … + /// * [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 [HistoryOut] as data + /// Throws [DioException] if API call or serialization fails + Future> incomeHistory({ + String? scope = 'all', + String? group = 'month', + DateTime? dateFrom, + DateTime? dateTo, + String? kind, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/income/history'; + 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 (group != null) r'group': group, + if (dateFrom != null) r'date_from': dateFrom, + if (dateTo != null) r'date_to': dateTo, + if (kind != null) r'kind': kind, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + HistoryOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'HistoryOut', 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 index b4efec9..ac7e4f3 100644 --- a/app/packages/api_client/lib/src/api/instruments_api.dart +++ b/app/packages/api_client/lib/src/api/instruments_api.dart @@ -11,6 +11,11 @@ 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/pending_instrument_out.dart'; +import 'package:fintracker_api/src/model/pending_resolve_request.dart'; +import 'package:fintracker_api/src/model/pending_resolve_result.dart'; +import 'package:fintracker_api/src/model/price_manual_in.dart'; +import 'package:fintracker_api/src/model/price_manual_out.dart'; import 'package:fintracker_api/src/model/problem.dart'; class InstrumentsApi { @@ -199,4 +204,291 @@ _responseData = rawData == null ? null : deserialize, Instru ); } + /// Pending + /// Instruments a report named that nothing in the master resolves to. + /// + /// Parameters: + /// * [status] - pending | resolved | ignored | all + /// * [limit] + /// * [offset] + /// * [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>> instrumentsPending({ + String? status = 'pending', + int? limit = 100, + int? offset = 0, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/instruments/pending'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (status != null) r'status': status, + if (limit != null) r'limit': limit, + if (offset != null) r'offset': offset, + }; + + 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, PendingInstrumentOut>(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, + ); + } + + /// Pending Resolve + /// Link, create or ignore — then bind the events that were waiting and rebuild the lots. + /// + /// Parameters: + /// * [pendingId] + /// * [pendingResolveRequest] + /// * [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 [PendingResolveResult] as data + /// Throws [DioException] if API call or serialization fails + Future> instrumentsPendingResolve({ + required int pendingId, + required PendingResolveRequest pendingResolveRequest, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/instruments/pending/{pending_id}/resolve'.replaceAll('{' r'pending_id' '}', pendingId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(pendingResolveRequest); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PendingResolveResult? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'PendingResolveResult', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Set Manual Price + /// Set (or replace) the manual price of `instrument_id` on `body.d`. For what no exchange quotes: real estate, crypto, a custom holding, an OTC bond nobody lists. One row per (instrument, day) — a second call for the same day replaces it rather than piling up duplicates the price series would then have to pick between. Does not itself refresh `metric_*`; call `POST /metrics/refresh` after, same as `/rules/apply`. + /// + /// Parameters: + /// * [instrumentId] + /// * [priceManualIn] + /// * [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 [PriceManualOut] as data + /// Throws [DioException] if API call or serialization fails + Future> instrumentsSetManualPrice({ + required int instrumentId, + required PriceManualIn priceManualIn, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/instruments/{instrument_id}/prices'.replaceAll('{' r'instrument_id' '}', instrumentId.toString()); + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(priceManualIn); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + PriceManualOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'PriceManualOut', 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/links_api.dart b/app/packages/api_client/lib/src/api/links_api.dart new file mode 100644 index 0000000..fa10eee --- /dev/null +++ b/app/packages/api_client/lib/src/api/links_api.dart @@ -0,0 +1,249 @@ +// +// 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/link_create.dart'; +import 'package:fintracker_api/src/model/link_out.dart'; +import 'package:fintracker_api/src/model/problem.dart'; +import 'package:fintracker_api/src/model/unmatched_out.dart'; + +class LinksApi { + + final Dio _dio; + + const LinksApi(this._dio); + + /// Create + /// Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards. + /// + /// Parameters: + /// * [linkCreate] + /// * [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 [LinkOut] as data + /// Throws [DioException] if API call or serialization fails + Future> linksCreate({ + required LinkCreate linkCreate, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/links'; + final _options = Options( + method: r'POST', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(linkCreate); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + LinkOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'LinkOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Delete + /// Undo a link, manual or automatic. `flow_type` reverts on the next `POST /metrics/refresh`, when `classify` rebuilds it from the rules and `matching` no longer overwrites it. + /// + /// Parameters: + /// * [linkId] + /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation + /// * [headers] - Can be used to add additional headers to the request + /// * [extras] - Can be used to add flags to the request + /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response + /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress + /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress + /// + /// Returns a [Future] + /// Throws [DioException] if API call or serialization fails + Future> linksDelete({ + required int linkId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/links/{link_id}'.replaceAll('{' r'link_id' '}', linkId.toString()); + final _options = Options( + method: r'DELETE', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _response = await _dio.request( + _path, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + return _response; + } + + /// Unmatched + /// Every candidate that survives matching without a link, on either side. + /// + /// 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 [UnmatchedOut] as data + /// Throws [DioException] if API call or serialization fails + Future> linksUnmatched({ + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/links/unmatched'; + 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, + ); + + UnmatchedOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'UnmatchedOut', 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/rebalance_api.dart b/app/packages/api_client/lib/src/api/rebalance_api.dart new file mode 100644 index 0000000..1fbacad --- /dev/null +++ b/app/packages/api_client/lib/src/api/rebalance_api.dart @@ -0,0 +1,296 @@ +// +// 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/cash_available.dart'; +import 'package:fintracker_api/src/model/problem.dart'; +import 'package:fintracker_api/src/model/rebalance_out.dart'; +import 'package:fintracker_api/src/model/targets_in.dart'; +import 'package:fintracker_api/src/model/targets_out.dart'; + +class RebalanceApi { + + final Dio _dio; + + const RebalanceApi(this._dio); + + /// Rebalance + /// + /// + /// Parameters: + /// * [portfolioId] + /// * [dimension] - asset_class | sector | country | currency + /// * [cashAvailable] - переопределяет остаток на счетах для what-if + /// * [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 [RebalanceOut] as data + /// Throws [DioException] if API call or serialization fails + Future> rebalanceRebalance({ + required int portfolioId, + String? dimension = 'asset_class', + CashAvailable? cashAvailable, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios/{portfolio_id}/rebalance'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (dimension != null) r'dimension': dimension, + if (cashAvailable != null) r'cash_available': cashAvailable, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + RebalanceOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'RebalanceOut', growable: true); + + } catch (error, stackTrace) { + throw DioException( + requestOptions: _response.requestOptions, + response: _response, + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + return Response( + data: _responseData, + headers: _response.headers, + isRedirect: _response.isRedirect, + requestOptions: _response.requestOptions, + redirects: _response.redirects, + statusCode: _response.statusCode, + statusMessage: _response.statusMessage, + extra: _response.extra, + ); + } + + /// Set Targets + /// Replace the whole set for one dimension. The weights must add up to 1 within `WEIGHT_TOLERANCE`; otherwise the request is refused with the actual sum in the message, so the user can see by how much the plan misses rather than being handed a silently rescaled one. + /// + /// Parameters: + /// * [portfolioId] + /// * [targetsIn] + /// * [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 [TargetsOut] as data + /// Throws [DioException] if API call or serialization fails + Future> rebalanceSetTargets({ + required int portfolioId, + required TargetsIn targetsIn, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios/{portfolio_id}/targets'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString()); + final _options = Options( + method: r'PUT', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + contentType: 'application/json', + validateStatus: validateStatus, + ); + + dynamic _bodyData; + + try { + _bodyData = jsonEncode(targetsIn); + + } catch(error, stackTrace) { + throw DioException( + requestOptions: _options.compose( + _dio.options, + _path, + ), + type: DioExceptionType.unknown, + error: error, + stackTrace: stackTrace, + ); + } + + final _response = await _dio.request( + _path, + data: _bodyData, + options: _options, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + TargetsOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'TargetsOut', 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, + ); + } + + /// Targets + /// + /// + /// Parameters: + /// * [portfolioId] + /// * [dimension] - asset_class | sector | country | currency + /// * [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 [TargetsOut] as data + /// Throws [DioException] if API call or serialization fails + Future> rebalanceTargets({ + required int portfolioId, + String? dimension = 'asset_class', + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/portfolios/{portfolio_id}/targets'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString()); + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (dimension != null) r'dimension': dimension, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + TargetsOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'TargetsOut', 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/tax_api.dart b/app/packages/api_client/lib/src/api/tax_api.dart new file mode 100644 index 0000000..d818546 --- /dev/null +++ b/app/packages/api_client/lib/src/api/tax_api.dart @@ -0,0 +1,194 @@ +// +// 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/problem.dart'; +import 'package:fintracker_api/src/model/tax_lots_out.dart'; +import 'package:fintracker_api/src/model/tax_year_out.dart'; + +class TaxApi { + + final Dio _dio; + + const TaxApi(this._dio); + + /// Lots + /// Open lots with the date after which a sale falls under the long-term exemption. `year` selects the rate the \"what if I sold today\" figure is computed at; the lots themselves are always the ones open right now. `lot` is rebuilt from the ledger on every refresh and holds today's state only, so there is no honest way to answer \"which lots were open on 31 December two years ago\" — and inventing one would be worse than the limitation. + /// + /// Parameters: + /// * [year] + /// * [accountId] + /// * [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 [TaxLotsOut] as data + /// Throws [DioException] if API call or serialization fails + Future> taxLots({ + int? year, + int? accountId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/tax/lots'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (year != null) r'year': year, + if (accountId != null) r'account_id': accountId, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + TaxLotsOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'TaxLotsOut', 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 + /// The year's estimated tax position, per account and in total. + /// + /// Parameters: + /// * [year] + /// * [accountId] + /// * [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 [TaxYearOut] as data + /// Throws [DioException] if API call or serialization fails + Future> taxSummary({ + int? year, + int? accountId, + CancelToken? cancelToken, + Map? headers, + Map? extra, + ValidateStatus? validateStatus, + ProgressCallback? onSendProgress, + ProgressCallback? onReceiveProgress, + }) async { + final _path = r'/api/v1/tax'; + final _options = Options( + method: r'GET', + headers: { + ...?headers, + }, + extra: { + 'secure': >[ + { + 'type': 'http', + 'scheme': 'bearer', + 'name': 'HTTPBearer', + }, + ], + ...?extra, + }, + validateStatus: validateStatus, + ); + + final _queryParameters = { + if (year != null) r'year': year, + if (accountId != null) r'account_id': accountId, + }; + + final _response = await _dio.request( + _path, + options: _options, + queryParameters: _queryParameters, + cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, + ); + + TaxYearOut? _responseData; + + try { +final rawData = _response.data; +_responseData = rawData == null ? null : deserialize(rawData, 'TaxYearOut', 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 c2c64d7..75fcc58 100644 --- a/app/packages/api_client/lib/src/deserialize.dart +++ b/app/packages/api_client/lib/src/deserialize.dart @@ -1,22 +1,60 @@ 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/account_suggestion.dart'; import 'package:fintracker_api/src/model/allocation_bucket.dart'; +import 'package:fintracker_api/src/model/benchmark_comparison.dart'; +import 'package:fintracker_api/src/model/benchmark_comparison_out.dart'; +import 'package:fintracker_api/src/model/benchmark_create.dart'; +import 'package:fintracker_api/src/model/benchmark_out.dart'; +import 'package:fintracker_api/src/model/benchmark_patch.dart'; +import 'package:fintracker_api/src/model/benchmark_return_out.dart'; +import 'package:fintracker_api/src/model/calendar_entry.dart'; +import 'package:fintracker_api/src/model/calendar_out.dart'; +import 'package:fintracker_api/src/model/cash_available.dart'; +import 'package:fintracker_api/src/model/cash_flow_broker_month.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/commit_request.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/forecast_month.dart'; +import 'package:fintracker_api/src/model/forecast_out.dart'; +import 'package:fintracker_api/src/model/goal_create.dart'; +import 'package:fintracker_api/src/model/goal_out.dart'; +import 'package:fintracker_api/src/model/goal_patch.dart'; +import 'package:fintracker_api/src/model/goal_progress_out.dart'; import 'package:fintracker_api/src/model/health.dart'; +import 'package:fintracker_api/src/model/history_out.dart'; +import 'package:fintracker_api/src/model/history_row.dart'; +import 'package:fintracker_api/src/model/history_totals.dart'; import 'package:fintracker_api/src/model/holding_out.dart'; +import 'package:fintracker_api/src/model/import_counts.dart'; +import 'package:fintracker_api/src/model/import_preview.dart'; +import 'package:fintracker_api/src/model/import_result.dart'; +import 'package:fintracker_api/src/model/import_summary.dart'; import 'package:fintracker_api/src/model/instrument_detail.dart'; import 'package:fintracker_api/src/model/instrument_out.dart'; +import 'package:fintracker_api/src/model/link_create.dart'; +import 'package:fintracker_api/src/model/link_out.dart'; import 'package:fintracker_api/src/model/login_request.dart'; import 'package:fintracker_api/src/model/lot_out.dart'; import 'package:fintracker_api/src/model/net_worth_breakdown.dart'; import 'package:fintracker_api/src/model/net_worth_day.dart'; +import 'package:fintracker_api/src/model/new_instrument.dart'; +import 'package:fintracker_api/src/model/pending_instrument_out.dart'; +import 'package:fintracker_api/src/model/pending_resolve_request.dart'; +import 'package:fintracker_api/src/model/pending_resolve_result.dart'; +import 'package:fintracker_api/src/model/price_manual_in.dart'; +import 'package:fintracker_api/src/model/price_manual_out.dart'; import 'package:fintracker_api/src/model/price_point.dart'; import 'package:fintracker_api/src/model/problem.dart'; +import 'package:fintracker_api/src/model/rebalance_bucket_out.dart'; +import 'package:fintracker_api/src/model/rebalance_out.dart'; +import 'package:fintracker_api/src/model/reconciliation_cash.dart'; +import 'package:fintracker_api/src/model/reconciliation_out.dart'; +import 'package:fintracker_api/src/model/reconciliation_position.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'; @@ -24,15 +62,29 @@ 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/sample_event_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/target_in.dart'; +import 'package:fintracker_api/src/model/target_out.dart'; +import 'package:fintracker_api/src/model/targets_in.dart'; +import 'package:fintracker_api/src/model/targets_out.dart'; +import 'package:fintracker_api/src/model/tax_account_out.dart'; +import 'package:fintracker_api/src/model/tax_lot_out.dart'; +import 'package:fintracker_api/src/model/tax_lots_out.dart'; +import 'package:fintracker_api/src/model/tax_totals.dart'; +import 'package:fintracker_api/src/model/tax_year_out.dart'; import 'package:fintracker_api/src/model/token_pair.dart'; +import 'package:fintracker_api/src/model/trade_out.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/unmatched_broker_out.dart'; +import 'package:fintracker_api/src/model/unmatched_out.dart'; +import 'package:fintracker_api/src/model/unmatched_zm_out.dart'; import 'package:fintracker_api/src/model/user_out.dart'; import 'package:fintracker_api/src/model/value_day.dart'; @@ -66,18 +118,42 @@ final _regMap = RegExp(r'^Map$'); case 'AccountRole': + case 'AccountSuggestion': + return AccountSuggestion.fromJson(value as Map) as ReturnType; case 'AllocationBucket': return AllocationBucket.fromJson(value as Map) as ReturnType; case 'AllocationDimension': + case 'BenchmarkComparison': + return BenchmarkComparison.fromJson(value as Map) as ReturnType; + case 'BenchmarkComparisonOut': + return BenchmarkComparisonOut.fromJson(value as Map) as ReturnType; + case 'BenchmarkCreate': + return BenchmarkCreate.fromJson(value as Map) as ReturnType; + case 'BenchmarkOut': + return BenchmarkOut.fromJson(value as Map) as ReturnType; + case 'BenchmarkPatch': + return BenchmarkPatch.fromJson(value as Map) as ReturnType; + case 'BenchmarkReturnOut': + return BenchmarkReturnOut.fromJson(value as Map) as ReturnType; case 'Broker': + case 'CalendarEntry': + return CalendarEntry.fromJson(value as Map) as ReturnType; + case 'CalendarOut': + return CalendarOut.fromJson(value as Map) as ReturnType; + case 'CashAvailable': + return CashAvailable.fromJson(value as Map) as ReturnType; + case 'CashFlowBrokerMonth': + return CashFlowBrokerMonth.fromJson(value as Map) as ReturnType; case 'CashFlowMonth': return CashFlowMonth.fromJson(value as Map) as ReturnType; case 'CategoryOut': return CategoryOut.fromJson(value as Map) as ReturnType; + case 'CommitRequest': + return CommitRequest.fromJson(value as Map) as ReturnType; case 'DataQualityRow': return DataQualityRow.fromJson(value as Map) as ReturnType; case 'EventKind': @@ -96,10 +172,36 @@ final _regMap = RegExp(r'^Map$'); case 'FlowType': + case 'ForecastMonth': + return ForecastMonth.fromJson(value as Map) as ReturnType; + case 'ForecastOut': + return ForecastOut.fromJson(value as Map) as ReturnType; + case 'GoalCreate': + return GoalCreate.fromJson(value as Map) as ReturnType; + case 'GoalOut': + return GoalOut.fromJson(value as Map) as ReturnType; + case 'GoalPatch': + return GoalPatch.fromJson(value as Map) as ReturnType; + case 'GoalProgressOut': + return GoalProgressOut.fromJson(value as Map) as ReturnType; case 'Health': return Health.fromJson(value as Map) as ReturnType; + case 'HistoryOut': + return HistoryOut.fromJson(value as Map) as ReturnType; + case 'HistoryRow': + return HistoryRow.fromJson(value as Map) as ReturnType; + case 'HistoryTotals': + return HistoryTotals.fromJson(value as Map) as ReturnType; case 'HoldingOut': return HoldingOut.fromJson(value as Map) as ReturnType; + case 'ImportCounts': + return ImportCounts.fromJson(value as Map) as ReturnType; + case 'ImportPreview': + return ImportPreview.fromJson(value as Map) as ReturnType; + case 'ImportResult': + return ImportResult.fromJson(value as Map) as ReturnType; + case 'ImportSummary': + return ImportSummary.fromJson(value as Map) as ReturnType; case 'InstrumentDetail': return InstrumentDetail.fromJson(value as Map) as ReturnType; case 'InstrumentOut': @@ -107,6 +209,10 @@ final _regMap = RegExp(r'^Map$'); case 'JobStatus': + case 'LinkCreate': + return LinkCreate.fromJson(value as Map) as ReturnType; + case 'LinkOut': + return LinkOut.fromJson(value as Map) as ReturnType; case 'LoginRequest': return LoginRequest.fromJson(value as Map) as ReturnType; case 'LotOut': @@ -115,10 +221,32 @@ final _regMap = RegExp(r'^Map$'); return NetWorthBreakdown.fromJson(value as Map) as ReturnType; case 'NetWorthDay': return NetWorthDay.fromJson(value as Map) as ReturnType; + case 'NewInstrument': + return NewInstrument.fromJson(value as Map) as ReturnType; + case 'PendingInstrumentOut': + return PendingInstrumentOut.fromJson(value as Map) as ReturnType; + case 'PendingResolveRequest': + return PendingResolveRequest.fromJson(value as Map) as ReturnType; + case 'PendingResolveResult': + return PendingResolveResult.fromJson(value as Map) as ReturnType; + case 'PriceManualIn': + return PriceManualIn.fromJson(value as Map) as ReturnType; + case 'PriceManualOut': + return PriceManualOut.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 'RebalanceBucketOut': + return RebalanceBucketOut.fromJson(value as Map) as ReturnType; + case 'RebalanceOut': + return RebalanceOut.fromJson(value as Map) as ReturnType; + case 'ReconciliationCash': + return ReconciliationCash.fromJson(value as Map) as ReturnType; + case 'ReconciliationOut': + return ReconciliationOut.fromJson(value as Map) as ReturnType; + case 'ReconciliationPosition': + return ReconciliationPosition.fromJson(value as Map) as ReturnType; case 'RefreshLogOut': return RefreshLogOut.fromJson(value as Map) as ReturnType; case 'RefreshRequest': @@ -142,6 +270,8 @@ final _regMap = RegExp(r'^Map$'); case 'RunwayOut': return RunwayOut.fromJson(value as Map) as ReturnType; + case 'SampleEventOut': + return SampleEventOut.fromJson(value as Map) as ReturnType; case 'ScopeOut': return ScopeOut.fromJson(value as Map) as ReturnType; case 'SourceStatus': @@ -154,12 +284,38 @@ final _regMap = RegExp(r'^Map$'); return SyncJobOut.fromJson(value as Map) as ReturnType; case 'SyncRunOut': return SyncRunOut.fromJson(value as Map) as ReturnType; + case 'TargetIn': + return TargetIn.fromJson(value as Map) as ReturnType; + case 'TargetOut': + return TargetOut.fromJson(value as Map) as ReturnType; + case 'TargetsIn': + return TargetsIn.fromJson(value as Map) as ReturnType; + case 'TargetsOut': + return TargetsOut.fromJson(value as Map) as ReturnType; + case 'TaxAccountOut': + return TaxAccountOut.fromJson(value as Map) as ReturnType; + case 'TaxLotOut': + return TaxLotOut.fromJson(value as Map) as ReturnType; + case 'TaxLotsOut': + return TaxLotsOut.fromJson(value as Map) as ReturnType; + case 'TaxTotals': + return TaxTotals.fromJson(value as Map) as ReturnType; + case 'TaxYearOut': + return TaxYearOut.fromJson(value as Map) as ReturnType; case 'TokenPair': return TokenPair.fromJson(value as Map) as ReturnType; + case 'TradeOut': + return TradeOut.fromJson(value as Map) as ReturnType; case 'TransactionOut': return TransactionOut.fromJson(value as Map) as ReturnType; case 'TransactionPage': return TransactionPage.fromJson(value as Map) as ReturnType; + case 'UnmatchedBrokerOut': + return UnmatchedBrokerOut.fromJson(value as Map) as ReturnType; + case 'UnmatchedOut': + return UnmatchedOut.fromJson(value as Map) as ReturnType; + case 'UnmatchedZmOut': + return UnmatchedZmOut.fromJson(value as Map) as ReturnType; case 'UserOut': return UserOut.fromJson(value as Map) as ReturnType; case 'ValueDay': diff --git a/app/packages/api_client/lib/src/model/account_out.g.dart b/app/packages/api_client/lib/src/model/account_out.g.dart index f35137d..97f90d6 100644 --- a/app/packages/api_client/lib/src/model/account_out.g.dart +++ b/app/packages/api_client/lib/src/model/account_out.g.dart @@ -385,6 +385,7 @@ const _$EventSourceEnumMap = { EventSource.tinvestApi: 'tinvest_api', EventSource.reportSber: 'report_sber', EventSource.reportVtb: 'report_vtb', + EventSource.csv: 'csv', EventSource.manual: 'manual', EventSource.unknownDefaultOpenApi: 'unknown_default_open_api', }; diff --git a/app/packages/api_client/lib/src/model/account_patch.g.dart b/app/packages/api_client/lib/src/model/account_patch.g.dart index 9d2d13d..42f8753 100644 --- a/app/packages/api_client/lib/src/model/account_patch.g.dart +++ b/app/packages/api_client/lib/src/model/account_patch.g.dart @@ -160,6 +160,7 @@ const _$EventSourceEnumMap = { EventSource.tinvestApi: 'tinvest_api', EventSource.reportSber: 'report_sber', EventSource.reportVtb: 'report_vtb', + EventSource.csv: 'csv', EventSource.manual: 'manual', EventSource.unknownDefaultOpenApi: 'unknown_default_open_api', }; diff --git a/app/packages/api_client/lib/src/model/account_suggestion.dart b/app/packages/api_client/lib/src/model/account_suggestion.dart new file mode 100644 index 0000000..6d20299 --- /dev/null +++ b/app/packages/api_client/lib/src/model/account_suggestion.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'account_suggestion.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class AccountSuggestion { + /// Returns a new [AccountSuggestion] instance. + AccountSuggestion({ + + required this.broker, + + required this.id, + + required this.name, + + required this.sourceId, + }); + + @JsonKey( + + name: r'broker', + required: true, + includeIfNull: true, + ) + + + final String? broker; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'source_id', + required: true, + includeIfNull: false, + ) + + + final String sourceId; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is AccountSuggestion && + other.broker == broker && + other.id == id && + other.name == name && + other.sourceId == sourceId; + + @override + int get hashCode => + (broker == null ? 0 : broker.hashCode) + + id.hashCode + + name.hashCode + + sourceId.hashCode; + + factory AccountSuggestion.fromJson(Map json) => _$AccountSuggestionFromJson(json); + + Map toJson() => _$AccountSuggestionToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/account_suggestion.g.dart b/app/packages/api_client/lib/src/model/account_suggestion.g.dart new file mode 100644 index 0000000..f2d229a --- /dev/null +++ b/app/packages/api_client/lib/src/model/account_suggestion.g.dart @@ -0,0 +1,116 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'account_suggestion.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$AccountSuggestionCWProxy { + AccountSuggestion broker(String? broker); + + AccountSuggestion id(int id); + + AccountSuggestion name(String name); + + AccountSuggestion sourceId(String sourceId); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// AccountSuggestion(...).copyWith(id: 12, name: "My name") + /// ```` + AccountSuggestion call({ + String? broker, + int id, + String name, + String sourceId, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountSuggestion.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountSuggestion.copyWith.fieldName(...)` +class _$AccountSuggestionCWProxyImpl implements _$AccountSuggestionCWProxy { + const _$AccountSuggestionCWProxyImpl(this._value); + + final AccountSuggestion _value; + + @override + AccountSuggestion broker(String? broker) => this(broker: broker); + + @override + AccountSuggestion id(int id) => this(id: id); + + @override + AccountSuggestion name(String name) => this(name: name); + + @override + AccountSuggestion sourceId(String sourceId) => this(sourceId: sourceId); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// AccountSuggestion(...).copyWith(id: 12, name: "My name") + /// ```` + AccountSuggestion call({ + Object? broker = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? sourceId = const $CopyWithPlaceholder(), + }) { + return AccountSuggestion( + broker: broker == const $CopyWithPlaceholder() + ? _value.broker + // ignore: cast_nullable_to_non_nullable + : broker as String?, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + sourceId: sourceId == const $CopyWithPlaceholder() + ? _value.sourceId + // ignore: cast_nullable_to_non_nullable + : sourceId as String, + ); + } +} + +extension $AccountSuggestionCopyWith on AccountSuggestion { + /// Returns a callable class that can be used as follows: `instanceOfAccountSuggestion.copyWith(...)` or like so:`instanceOfAccountSuggestion.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$AccountSuggestionCWProxy get copyWith => + _$AccountSuggestionCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +AccountSuggestion _$AccountSuggestionFromJson(Map json) => + $checkedCreate('AccountSuggestion', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['broker', 'id', 'name', 'source_id'], + ); + final val = AccountSuggestion( + broker: $checkedConvert('broker', (v) => v as String?), + id: $checkedConvert('id', (v) => (v as num).toInt()), + name: $checkedConvert('name', (v) => v as String), + sourceId: $checkedConvert('source_id', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'sourceId': 'source_id'}); + +Map _$AccountSuggestionToJson(AccountSuggestion instance) => + { + 'broker': instance.broker, + 'id': instance.id, + 'name': instance.name, + 'source_id': instance.sourceId, + }; diff --git a/app/packages/api_client/lib/src/model/benchmark_comparison.dart b/app/packages/api_client/lib/src/model/benchmark_comparison.dart new file mode 100644 index 0000000..910873f --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_comparison.dart @@ -0,0 +1,59 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/benchmark_comparison_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'benchmark_comparison.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BenchmarkComparison { + /// Returns a new [BenchmarkComparison] instance. + BenchmarkComparison({ + + required this.rows, + }); + + @JsonKey( + + name: r'rows', + required: true, + includeIfNull: false, + ) + + + final List rows; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparison && + other.rows == rows; + + @override + int get hashCode => + rows.hashCode; + + factory BenchmarkComparison.fromJson(Map json) => _$BenchmarkComparisonFromJson(json); + + Map toJson() => _$BenchmarkComparisonToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/benchmark_comparison.g.dart b/app/packages/api_client/lib/src/model/benchmark_comparison.g.dart new file mode 100644 index 0000000..bb0750a --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_comparison.g.dart @@ -0,0 +1,78 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'benchmark_comparison.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$BenchmarkComparisonCWProxy { + BenchmarkComparison rows(List rows); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkComparison(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkComparison call({List rows}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparison.copyWith.fieldName(...)` +class _$BenchmarkComparisonCWProxyImpl implements _$BenchmarkComparisonCWProxy { + const _$BenchmarkComparisonCWProxyImpl(this._value); + + final BenchmarkComparison _value; + + @override + BenchmarkComparison rows(List rows) => + this(rows: rows); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkComparison(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkComparison call({Object? rows = const $CopyWithPlaceholder()}) { + return BenchmarkComparison( + rows: rows == const $CopyWithPlaceholder() + ? _value.rows + // ignore: cast_nullable_to_non_nullable + : rows as List, + ); + } +} + +extension $BenchmarkComparisonCopyWith on BenchmarkComparison { + /// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)` or like so:`instanceOfBenchmarkComparison.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$BenchmarkComparisonCWProxy get copyWith => + _$BenchmarkComparisonCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BenchmarkComparison _$BenchmarkComparisonFromJson(Map json) => + $checkedCreate('BenchmarkComparison', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['rows']); + final val = BenchmarkComparison( + rows: $checkedConvert( + 'rows', + (v) => (v as List) + .map( + (e) => + BenchmarkComparisonOut.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; + }); + +Map _$BenchmarkComparisonToJson( + BenchmarkComparison instance, +) => {'rows': instance.rows.map((e) => e.toJson()).toList()}; diff --git a/app/packages/api_client/lib/src/model/benchmark_comparison_out.dart b/app/packages/api_client/lib/src/model/benchmark_comparison_out.dart new file mode 100644 index 0000000..83cd5aa --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_comparison_out.dart @@ -0,0 +1,157 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/benchmark_return_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'benchmark_comparison_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BenchmarkComparisonOut { + /// Returns a new [BenchmarkComparisonOut] instance. + BenchmarkComparisonOut({ + + required this.benchmarks, + + required this.dateFrom, + + required this.dateTo, + + required this.period, + + required this.portfolioDaysSkipped, + + required this.portfolioTwr, + + required this.portfolioTwrAnnualized, + }); + + @JsonKey( + + name: r'benchmarks', + required: true, + includeIfNull: false, + ) + + + final List benchmarks; + + + + @JsonKey( + + name: r'date_from', + required: true, + includeIfNull: false, + ) + + + final DateTime dateFrom; + + + + @JsonKey( + + name: r'date_to', + required: true, + includeIfNull: false, + ) + + + final DateTime dateTo; + + + + @JsonKey( + + name: r'period', + required: true, + includeIfNull: false, + ) + + + final String period; + + + + @JsonKey( + + name: r'portfolio_days_skipped', + required: true, + includeIfNull: false, + ) + + + final int portfolioDaysSkipped; + + + + /// decimal as string + @JsonKey( + + name: r'portfolio_twr', + required: true, + includeIfNull: true, + ) + + + final String? portfolioTwr; + + + + /// decimal as string + @JsonKey( + + name: r'portfolio_twr_annualized', + required: true, + includeIfNull: true, + ) + + + final String? portfolioTwrAnnualized; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparisonOut && + other.benchmarks == benchmarks && + other.dateFrom == dateFrom && + other.dateTo == dateTo && + other.period == period && + other.portfolioDaysSkipped == portfolioDaysSkipped && + other.portfolioTwr == portfolioTwr && + other.portfolioTwrAnnualized == portfolioTwrAnnualized; + + @override + int get hashCode => + benchmarks.hashCode + + dateFrom.hashCode + + dateTo.hashCode + + period.hashCode + + portfolioDaysSkipped.hashCode + + (portfolioTwr == null ? 0 : portfolioTwr.hashCode) + + (portfolioTwrAnnualized == null ? 0 : portfolioTwrAnnualized.hashCode); + + factory BenchmarkComparisonOut.fromJson(Map json) => _$BenchmarkComparisonOutFromJson(json); + + Map toJson() => _$BenchmarkComparisonOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/benchmark_comparison_out.g.dart b/app/packages/api_client/lib/src/model/benchmark_comparison_out.g.dart new file mode 100644 index 0000000..6175198 --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_comparison_out.g.dart @@ -0,0 +1,198 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'benchmark_comparison_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$BenchmarkComparisonOutCWProxy { + BenchmarkComparisonOut benchmarks(List benchmarks); + + BenchmarkComparisonOut dateFrom(DateTime dateFrom); + + BenchmarkComparisonOut dateTo(DateTime dateTo); + + BenchmarkComparisonOut period(String period); + + BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped); + + BenchmarkComparisonOut portfolioTwr(String? portfolioTwr); + + BenchmarkComparisonOut portfolioTwrAnnualized(String? portfolioTwrAnnualized); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkComparisonOut call({ + List benchmarks, + DateTime dateFrom, + DateTime dateTo, + String period, + int portfolioDaysSkipped, + String? portfolioTwr, + String? portfolioTwrAnnualized, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)` +class _$BenchmarkComparisonOutCWProxyImpl + implements _$BenchmarkComparisonOutCWProxy { + const _$BenchmarkComparisonOutCWProxyImpl(this._value); + + final BenchmarkComparisonOut _value; + + @override + BenchmarkComparisonOut benchmarks(List benchmarks) => + this(benchmarks: benchmarks); + + @override + BenchmarkComparisonOut dateFrom(DateTime dateFrom) => + this(dateFrom: dateFrom); + + @override + BenchmarkComparisonOut dateTo(DateTime dateTo) => this(dateTo: dateTo); + + @override + BenchmarkComparisonOut period(String period) => this(period: period); + + @override + BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped) => + this(portfolioDaysSkipped: portfolioDaysSkipped); + + @override + BenchmarkComparisonOut portfolioTwr(String? portfolioTwr) => + this(portfolioTwr: portfolioTwr); + + @override + BenchmarkComparisonOut portfolioTwrAnnualized( + String? portfolioTwrAnnualized, + ) => this(portfolioTwrAnnualized: portfolioTwrAnnualized); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkComparisonOut call({ + Object? benchmarks = const $CopyWithPlaceholder(), + Object? dateFrom = const $CopyWithPlaceholder(), + Object? dateTo = const $CopyWithPlaceholder(), + Object? period = const $CopyWithPlaceholder(), + Object? portfolioDaysSkipped = const $CopyWithPlaceholder(), + Object? portfolioTwr = const $CopyWithPlaceholder(), + Object? portfolioTwrAnnualized = const $CopyWithPlaceholder(), + }) { + return BenchmarkComparisonOut( + benchmarks: benchmarks == const $CopyWithPlaceholder() + ? _value.benchmarks + // ignore: cast_nullable_to_non_nullable + : benchmarks as List, + 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, + period: period == const $CopyWithPlaceholder() + ? _value.period + // ignore: cast_nullable_to_non_nullable + : period as String, + portfolioDaysSkipped: portfolioDaysSkipped == const $CopyWithPlaceholder() + ? _value.portfolioDaysSkipped + // ignore: cast_nullable_to_non_nullable + : portfolioDaysSkipped as int, + portfolioTwr: portfolioTwr == const $CopyWithPlaceholder() + ? _value.portfolioTwr + // ignore: cast_nullable_to_non_nullable + : portfolioTwr as String?, + portfolioTwrAnnualized: + portfolioTwrAnnualized == const $CopyWithPlaceholder() + ? _value.portfolioTwrAnnualized + // ignore: cast_nullable_to_non_nullable + : portfolioTwrAnnualized as String?, + ); + } +} + +extension $BenchmarkComparisonOutCopyWith on BenchmarkComparisonOut { + /// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)` or like so:`instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$BenchmarkComparisonOutCWProxy get copyWith => + _$BenchmarkComparisonOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BenchmarkComparisonOut _$BenchmarkComparisonOutFromJson( + Map json, +) => $checkedCreate( + 'BenchmarkComparisonOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'benchmarks', + 'date_from', + 'date_to', + 'period', + 'portfolio_days_skipped', + 'portfolio_twr', + 'portfolio_twr_annualized', + ], + ); + final val = BenchmarkComparisonOut( + benchmarks: $checkedConvert( + 'benchmarks', + (v) => (v as List) + .map((e) => BenchmarkReturnOut.fromJson(e as Map)) + .toList(), + ), + dateFrom: $checkedConvert( + 'date_from', + (v) => DateTime.parse(v as String), + ), + dateTo: $checkedConvert('date_to', (v) => DateTime.parse(v as String)), + period: $checkedConvert('period', (v) => v as String), + portfolioDaysSkipped: $checkedConvert( + 'portfolio_days_skipped', + (v) => (v as num).toInt(), + ), + portfolioTwr: $checkedConvert('portfolio_twr', (v) => v as String?), + portfolioTwrAnnualized: $checkedConvert( + 'portfolio_twr_annualized', + (v) => v as String?, + ), + ); + return val; + }, + fieldKeyMap: const { + 'dateFrom': 'date_from', + 'dateTo': 'date_to', + 'portfolioDaysSkipped': 'portfolio_days_skipped', + 'portfolioTwr': 'portfolio_twr', + 'portfolioTwrAnnualized': 'portfolio_twr_annualized', + }, +); + +Map _$BenchmarkComparisonOutToJson( + BenchmarkComparisonOut instance, +) => { + 'benchmarks': instance.benchmarks.map((e) => e.toJson()).toList(), + 'date_from': instance.dateFrom.toIso8601String(), + 'date_to': instance.dateTo.toIso8601String(), + 'period': instance.period, + 'portfolio_days_skipped': instance.portfolioDaysSkipped, + 'portfolio_twr': instance.portfolioTwr, + 'portfolio_twr_annualized': instance.portfolioTwrAnnualized, +}; diff --git a/app/packages/api_client/lib/src/model/benchmark_create.dart b/app/packages/api_client/lib/src/model/benchmark_create.dart new file mode 100644 index 0000000..4079f6a --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_create.dart @@ -0,0 +1,170 @@ +// +// 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 'benchmark_create.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BenchmarkCreate { + /// Returns a new [BenchmarkCreate] instance. + BenchmarkCreate({ + + required this.code, + + this.currency = 'RUB', + + this.instrumentId, + + this.isActive = true, + + this.isDefault = false, + + required this.kind, + + required this.name, + + this.source_ = 'moex', + }); + + @JsonKey( + + name: r'code', + required: true, + includeIfNull: false, + ) + + + final String code; + + + + @JsonKey( + defaultValue: 'RUB', + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + @JsonKey( + defaultValue: true, + name: r'is_active', + required: false, + includeIfNull: false, + ) + + + final bool? isActive; + + + + @JsonKey( + defaultValue: false, + name: r'is_default', + required: false, + includeIfNull: false, + ) + + + final bool? isDefault; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + defaultValue: 'moex', + name: r'source', + required: false, + includeIfNull: false, + ) + + + final String? source_; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BenchmarkCreate && + other.code == code && + other.currency == currency && + other.instrumentId == instrumentId && + other.isActive == isActive && + other.isDefault == isDefault && + other.kind == kind && + other.name == name && + other.source_ == source_; + + @override + int get hashCode => + code.hashCode + + currency.hashCode + + (instrumentId == null ? 0 : instrumentId.hashCode) + + isActive.hashCode + + isDefault.hashCode + + kind.hashCode + + name.hashCode + + source_.hashCode; + + factory BenchmarkCreate.fromJson(Map json) => _$BenchmarkCreateFromJson(json); + + Map toJson() => _$BenchmarkCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/benchmark_create.g.dart b/app/packages/api_client/lib/src/model/benchmark_create.g.dart new file mode 100644 index 0000000..d65f4a4 --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_create.g.dart @@ -0,0 +1,178 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'benchmark_create.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$BenchmarkCreateCWProxy { + BenchmarkCreate code(String code); + + BenchmarkCreate currency(String? currency); + + BenchmarkCreate instrumentId(int? instrumentId); + + BenchmarkCreate isActive(bool? isActive); + + BenchmarkCreate isDefault(bool? isDefault); + + BenchmarkCreate kind(String kind); + + BenchmarkCreate name(String name); + + BenchmarkCreate source_(String? source_); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkCreate(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkCreate call({ + String code, + String? currency, + int? instrumentId, + bool? isActive, + bool? isDefault, + String kind, + String name, + String? source_, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkCreate.copyWith.fieldName(...)` +class _$BenchmarkCreateCWProxyImpl implements _$BenchmarkCreateCWProxy { + const _$BenchmarkCreateCWProxyImpl(this._value); + + final BenchmarkCreate _value; + + @override + BenchmarkCreate code(String code) => this(code: code); + + @override + BenchmarkCreate currency(String? currency) => this(currency: currency); + + @override + BenchmarkCreate instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + BenchmarkCreate isActive(bool? isActive) => this(isActive: isActive); + + @override + BenchmarkCreate isDefault(bool? isDefault) => this(isDefault: isDefault); + + @override + BenchmarkCreate kind(String kind) => this(kind: kind); + + @override + BenchmarkCreate name(String name) => this(name: name); + + @override + BenchmarkCreate source_(String? source_) => this(source_: source_); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkCreate(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkCreate call({ + Object? code = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? isActive = const $CopyWithPlaceholder(), + Object? isDefault = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? source_ = const $CopyWithPlaceholder(), + }) { + return BenchmarkCreate( + code: code == const $CopyWithPlaceholder() + ? _value.code + // ignore: cast_nullable_to_non_nullable + : code as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int?, + isActive: isActive == const $CopyWithPlaceholder() + ? _value.isActive + // ignore: cast_nullable_to_non_nullable + : isActive as bool?, + isDefault: isDefault == const $CopyWithPlaceholder() + ? _value.isDefault + // ignore: cast_nullable_to_non_nullable + : isDefault as bool?, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + source_: source_ == const $CopyWithPlaceholder() + ? _value.source_ + // ignore: cast_nullable_to_non_nullable + : source_ as String?, + ); + } +} + +extension $BenchmarkCreateCopyWith on BenchmarkCreate { + /// Returns a callable class that can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)` or like so:`instanceOfBenchmarkCreate.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$BenchmarkCreateCWProxy get copyWith => _$BenchmarkCreateCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BenchmarkCreate _$BenchmarkCreateFromJson(Map json) => + $checkedCreate( + 'BenchmarkCreate', + json, + ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['code', 'kind', 'name']); + final val = BenchmarkCreate( + code: $checkedConvert('code', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + isActive: $checkedConvert('is_active', (v) => v as bool? ?? true), + isDefault: $checkedConvert('is_default', (v) => v as bool? ?? false), + kind: $checkedConvert('kind', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + source_: $checkedConvert('source', (v) => v as String? ?? 'moex'), + ); + return val; + }, + fieldKeyMap: const { + 'instrumentId': 'instrument_id', + 'isActive': 'is_active', + 'isDefault': 'is_default', + 'source_': 'source', + }, + ); + +Map _$BenchmarkCreateToJson(BenchmarkCreate instance) => + { + 'code': instance.code, + 'currency': ?instance.currency, + 'instrument_id': ?instance.instrumentId, + 'is_active': ?instance.isActive, + 'is_default': ?instance.isDefault, + 'kind': instance.kind, + 'name': instance.name, + 'source': ?instance.source_, + }; diff --git a/app/packages/api_client/lib/src/model/benchmark_out.dart b/app/packages/api_client/lib/src/model/benchmark_out.dart new file mode 100644 index 0000000..7cd9028 --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_out.dart @@ -0,0 +1,218 @@ +// +// 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 'benchmark_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BenchmarkOut { + /// Returns a new [BenchmarkOut] instance. + BenchmarkOut({ + + required this.code, + + required this.currency, + + required this.historyFrom, + + required this.historyTo, + + required this.id, + + required this.instrumentId, + + required this.isActive, + + required this.isDefault, + + required this.kind, + + required this.name, + + required this.source_, + }); + + @JsonKey( + + name: r'code', + required: true, + includeIfNull: false, + ) + + + final String code; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'history_from', + required: true, + includeIfNull: true, + ) + + + final DateTime? historyFrom; + + + + @JsonKey( + + name: r'history_to', + required: true, + includeIfNull: true, + ) + + + final DateTime? historyTo; + + + + @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'is_active', + required: true, + includeIfNull: false, + ) + + + final bool isActive; + + + + @JsonKey( + + name: r'is_default', + required: true, + includeIfNull: false, + ) + + + final bool isDefault; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'source', + required: true, + includeIfNull: false, + ) + + + final String source_; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BenchmarkOut && + other.code == code && + other.currency == currency && + other.historyFrom == historyFrom && + other.historyTo == historyTo && + other.id == id && + other.instrumentId == instrumentId && + other.isActive == isActive && + other.isDefault == isDefault && + other.kind == kind && + other.name == name && + other.source_ == source_; + + @override + int get hashCode => + code.hashCode + + currency.hashCode + + (historyFrom == null ? 0 : historyFrom.hashCode) + + (historyTo == null ? 0 : historyTo.hashCode) + + id.hashCode + + (instrumentId == null ? 0 : instrumentId.hashCode) + + isActive.hashCode + + isDefault.hashCode + + kind.hashCode + + name.hashCode + + source_.hashCode; + + factory BenchmarkOut.fromJson(Map json) => _$BenchmarkOutFromJson(json); + + Map toJson() => _$BenchmarkOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/benchmark_out.g.dart b/app/packages/api_client/lib/src/model/benchmark_out.g.dart new file mode 100644 index 0000000..c9f2e40 --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_out.g.dart @@ -0,0 +1,241 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'benchmark_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$BenchmarkOutCWProxy { + BenchmarkOut code(String code); + + BenchmarkOut currency(String currency); + + BenchmarkOut historyFrom(DateTime? historyFrom); + + BenchmarkOut historyTo(DateTime? historyTo); + + BenchmarkOut id(int id); + + BenchmarkOut instrumentId(int? instrumentId); + + BenchmarkOut isActive(bool isActive); + + BenchmarkOut isDefault(bool isDefault); + + BenchmarkOut kind(String kind); + + BenchmarkOut name(String name); + + BenchmarkOut source_(String source_); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkOut(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkOut call({ + String code, + String currency, + DateTime? historyFrom, + DateTime? historyTo, + int id, + int? instrumentId, + bool isActive, + bool isDefault, + String kind, + String name, + String source_, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkOut.copyWith.fieldName(...)` +class _$BenchmarkOutCWProxyImpl implements _$BenchmarkOutCWProxy { + const _$BenchmarkOutCWProxyImpl(this._value); + + final BenchmarkOut _value; + + @override + BenchmarkOut code(String code) => this(code: code); + + @override + BenchmarkOut currency(String currency) => this(currency: currency); + + @override + BenchmarkOut historyFrom(DateTime? historyFrom) => + this(historyFrom: historyFrom); + + @override + BenchmarkOut historyTo(DateTime? historyTo) => this(historyTo: historyTo); + + @override + BenchmarkOut id(int id) => this(id: id); + + @override + BenchmarkOut instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + BenchmarkOut isActive(bool isActive) => this(isActive: isActive); + + @override + BenchmarkOut isDefault(bool isDefault) => this(isDefault: isDefault); + + @override + BenchmarkOut kind(String kind) => this(kind: kind); + + @override + BenchmarkOut name(String name) => this(name: name); + + @override + BenchmarkOut source_(String source_) => this(source_: source_); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkOut(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkOut call({ + Object? code = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? historyFrom = const $CopyWithPlaceholder(), + Object? historyTo = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? isActive = const $CopyWithPlaceholder(), + Object? isDefault = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? source_ = const $CopyWithPlaceholder(), + }) { + return BenchmarkOut( + code: code == const $CopyWithPlaceholder() + ? _value.code + // ignore: cast_nullable_to_non_nullable + : code as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + historyFrom: historyFrom == const $CopyWithPlaceholder() + ? _value.historyFrom + // ignore: cast_nullable_to_non_nullable + : historyFrom as DateTime?, + historyTo: historyTo == const $CopyWithPlaceholder() + ? _value.historyTo + // ignore: cast_nullable_to_non_nullable + : historyTo as DateTime?, + 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?, + isActive: isActive == const $CopyWithPlaceholder() + ? _value.isActive + // ignore: cast_nullable_to_non_nullable + : isActive as bool, + isDefault: isDefault == const $CopyWithPlaceholder() + ? _value.isDefault + // ignore: cast_nullable_to_non_nullable + : isDefault as bool, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + source_: source_ == const $CopyWithPlaceholder() + ? _value.source_ + // ignore: cast_nullable_to_non_nullable + : source_ as String, + ); + } +} + +extension $BenchmarkOutCopyWith on BenchmarkOut { + /// Returns a callable class that can be used as follows: `instanceOfBenchmarkOut.copyWith(...)` or like so:`instanceOfBenchmarkOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$BenchmarkOutCWProxy get copyWith => _$BenchmarkOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BenchmarkOut _$BenchmarkOutFromJson(Map json) => + $checkedCreate( + 'BenchmarkOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'code', + 'currency', + 'history_from', + 'history_to', + 'id', + 'instrument_id', + 'is_active', + 'is_default', + 'kind', + 'name', + 'source', + ], + ); + final val = BenchmarkOut( + code: $checkedConvert('code', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + historyFrom: $checkedConvert( + 'history_from', + (v) => v == null ? null : DateTime.parse(v as String), + ), + historyTo: $checkedConvert( + 'history_to', + (v) => v == null ? null : DateTime.parse(v as String), + ), + id: $checkedConvert('id', (v) => (v as num).toInt()), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + isActive: $checkedConvert('is_active', (v) => v as bool), + isDefault: $checkedConvert('is_default', (v) => v as bool), + kind: $checkedConvert('kind', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + source_: $checkedConvert('source', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'historyFrom': 'history_from', + 'historyTo': 'history_to', + 'instrumentId': 'instrument_id', + 'isActive': 'is_active', + 'isDefault': 'is_default', + 'source_': 'source', + }, + ); + +Map _$BenchmarkOutToJson(BenchmarkOut instance) => + { + 'code': instance.code, + 'currency': instance.currency, + 'history_from': instance.historyFrom?.toIso8601String(), + 'history_to': instance.historyTo?.toIso8601String(), + 'id': instance.id, + 'instrument_id': instance.instrumentId, + 'is_active': instance.isActive, + 'is_default': instance.isDefault, + 'kind': instance.kind, + 'name': instance.name, + 'source': instance.source_, + }; diff --git a/app/packages/api_client/lib/src/model/benchmark_patch.dart b/app/packages/api_client/lib/src/model/benchmark_patch.dart new file mode 100644 index 0000000..305f65e --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_patch.dart @@ -0,0 +1,170 @@ +// +// 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 'benchmark_patch.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BenchmarkPatch { + /// Returns a new [BenchmarkPatch] instance. + BenchmarkPatch({ + + this.code, + + this.currency, + + this.instrumentId, + + this.isActive, + + this.isDefault, + + this.kind, + + this.name, + + this.source_, + }); + + @JsonKey( + + name: r'code', + required: false, + includeIfNull: false, + ) + + + final String? code; + + + + @JsonKey( + + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + @JsonKey( + + name: r'is_active', + required: false, + includeIfNull: false, + ) + + + final bool? isActive; + + + + @JsonKey( + + name: r'is_default', + required: false, + includeIfNull: false, + ) + + + final bool? isDefault; + + + + @JsonKey( + + name: r'kind', + required: false, + includeIfNull: false, + ) + + + final String? kind; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false, + ) + + + final String? name; + + + + @JsonKey( + + name: r'source', + required: false, + includeIfNull: false, + ) + + + final String? source_; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BenchmarkPatch && + other.code == code && + other.currency == currency && + other.instrumentId == instrumentId && + other.isActive == isActive && + other.isDefault == isDefault && + other.kind == kind && + other.name == name && + other.source_ == source_; + + @override + int get hashCode => + (code == null ? 0 : code.hashCode) + + (currency == null ? 0 : currency.hashCode) + + (instrumentId == null ? 0 : instrumentId.hashCode) + + (isActive == null ? 0 : isActive.hashCode) + + (isDefault == null ? 0 : isDefault.hashCode) + + (kind == null ? 0 : kind.hashCode) + + (name == null ? 0 : name.hashCode) + + (source_ == null ? 0 : source_.hashCode); + + factory BenchmarkPatch.fromJson(Map json) => _$BenchmarkPatchFromJson(json); + + Map toJson() => _$BenchmarkPatchToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/benchmark_patch.g.dart b/app/packages/api_client/lib/src/model/benchmark_patch.g.dart new file mode 100644 index 0000000..7c1d82c --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_patch.g.dart @@ -0,0 +1,177 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'benchmark_patch.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$BenchmarkPatchCWProxy { + BenchmarkPatch code(String? code); + + BenchmarkPatch currency(String? currency); + + BenchmarkPatch instrumentId(int? instrumentId); + + BenchmarkPatch isActive(bool? isActive); + + BenchmarkPatch isDefault(bool? isDefault); + + BenchmarkPatch kind(String? kind); + + BenchmarkPatch name(String? name); + + BenchmarkPatch source_(String? source_); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkPatch(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkPatch call({ + String? code, + String? currency, + int? instrumentId, + bool? isActive, + bool? isDefault, + String? kind, + String? name, + String? source_, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkPatch.copyWith.fieldName(...)` +class _$BenchmarkPatchCWProxyImpl implements _$BenchmarkPatchCWProxy { + const _$BenchmarkPatchCWProxyImpl(this._value); + + final BenchmarkPatch _value; + + @override + BenchmarkPatch code(String? code) => this(code: code); + + @override + BenchmarkPatch currency(String? currency) => this(currency: currency); + + @override + BenchmarkPatch instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + BenchmarkPatch isActive(bool? isActive) => this(isActive: isActive); + + @override + BenchmarkPatch isDefault(bool? isDefault) => this(isDefault: isDefault); + + @override + BenchmarkPatch kind(String? kind) => this(kind: kind); + + @override + BenchmarkPatch name(String? name) => this(name: name); + + @override + BenchmarkPatch source_(String? source_) => this(source_: source_); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkPatch(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkPatch call({ + Object? code = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? isActive = const $CopyWithPlaceholder(), + Object? isDefault = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? source_ = const $CopyWithPlaceholder(), + }) { + return BenchmarkPatch( + code: code == const $CopyWithPlaceholder() + ? _value.code + // ignore: cast_nullable_to_non_nullable + : code as String?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int?, + isActive: isActive == const $CopyWithPlaceholder() + ? _value.isActive + // ignore: cast_nullable_to_non_nullable + : isActive as bool?, + isDefault: isDefault == const $CopyWithPlaceholder() + ? _value.isDefault + // ignore: cast_nullable_to_non_nullable + : isDefault as bool?, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String?, + source_: source_ == const $CopyWithPlaceholder() + ? _value.source_ + // ignore: cast_nullable_to_non_nullable + : source_ as String?, + ); + } +} + +extension $BenchmarkPatchCopyWith on BenchmarkPatch { + /// Returns a callable class that can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)` or like so:`instanceOfBenchmarkPatch.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$BenchmarkPatchCWProxy get copyWith => _$BenchmarkPatchCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BenchmarkPatch _$BenchmarkPatchFromJson(Map json) => + $checkedCreate( + 'BenchmarkPatch', + json, + ($checkedConvert) { + final val = BenchmarkPatch( + code: $checkedConvert('code', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String?), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + isActive: $checkedConvert('is_active', (v) => v as bool?), + isDefault: $checkedConvert('is_default', (v) => v as bool?), + kind: $checkedConvert('kind', (v) => v as String?), + name: $checkedConvert('name', (v) => v as String?), + source_: $checkedConvert('source', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'instrumentId': 'instrument_id', + 'isActive': 'is_active', + 'isDefault': 'is_default', + 'source_': 'source', + }, + ); + +Map _$BenchmarkPatchToJson(BenchmarkPatch instance) => + { + 'code': ?instance.code, + 'currency': ?instance.currency, + 'instrument_id': ?instance.instrumentId, + 'is_active': ?instance.isActive, + 'is_default': ?instance.isDefault, + 'kind': ?instance.kind, + 'name': ?instance.name, + 'source': ?instance.source_, + }; diff --git a/app/packages/api_client/lib/src/model/benchmark_return_out.dart b/app/packages/api_client/lib/src/model/benchmark_return_out.dart new file mode 100644 index 0000000..ec18006 --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_return_out.dart @@ -0,0 +1,173 @@ +// +// 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 'benchmark_return_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class BenchmarkReturnOut { + /// Returns a new [BenchmarkReturnOut] instance. + BenchmarkReturnOut({ + + required this.benchmarkId, + + required this.code, + + required this.daysSkipped, + + required this.excess, + + required this.kind, + + required this.name, + + required this.twr, + + required this.twrAnnualized, + }); + + @JsonKey( + + name: r'benchmark_id', + required: true, + includeIfNull: false, + ) + + + final int benchmarkId; + + + + @JsonKey( + + name: r'code', + required: true, + includeIfNull: false, + ) + + + final String code; + + + + @JsonKey( + + name: r'days_skipped', + required: true, + includeIfNull: false, + ) + + + final int daysSkipped; + + + + /// decimal as string + @JsonKey( + + name: r'excess', + required: true, + includeIfNull: true, + ) + + + final String? excess; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + /// decimal as string + @JsonKey( + + name: r'twr', + required: true, + includeIfNull: true, + ) + + + final String? twr; + + + + /// decimal as string + @JsonKey( + + name: r'twr_annualized', + required: true, + includeIfNull: true, + ) + + + final String? twrAnnualized; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is BenchmarkReturnOut && + other.benchmarkId == benchmarkId && + other.code == code && + other.daysSkipped == daysSkipped && + other.excess == excess && + other.kind == kind && + other.name == name && + other.twr == twr && + other.twrAnnualized == twrAnnualized; + + @override + int get hashCode => + benchmarkId.hashCode + + code.hashCode + + daysSkipped.hashCode + + (excess == null ? 0 : excess.hashCode) + + kind.hashCode + + name.hashCode + + (twr == null ? 0 : twr.hashCode) + + (twrAnnualized == null ? 0 : twrAnnualized.hashCode); + + factory BenchmarkReturnOut.fromJson(Map json) => _$BenchmarkReturnOutFromJson(json); + + Map toJson() => _$BenchmarkReturnOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/benchmark_return_out.g.dart b/app/packages/api_client/lib/src/model/benchmark_return_out.g.dart new file mode 100644 index 0000000..9ec269c --- /dev/null +++ b/app/packages/api_client/lib/src/model/benchmark_return_out.g.dart @@ -0,0 +1,190 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'benchmark_return_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$BenchmarkReturnOutCWProxy { + BenchmarkReturnOut benchmarkId(int benchmarkId); + + BenchmarkReturnOut code(String code); + + BenchmarkReturnOut daysSkipped(int daysSkipped); + + BenchmarkReturnOut excess(String? excess); + + BenchmarkReturnOut kind(String kind); + + BenchmarkReturnOut name(String name); + + BenchmarkReturnOut twr(String? twr); + + BenchmarkReturnOut twrAnnualized(String? twrAnnualized); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkReturnOut call({ + int benchmarkId, + String code, + int daysSkipped, + String? excess, + String kind, + String name, + String? twr, + String? twrAnnualized, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkReturnOut.copyWith.fieldName(...)` +class _$BenchmarkReturnOutCWProxyImpl implements _$BenchmarkReturnOutCWProxy { + const _$BenchmarkReturnOutCWProxyImpl(this._value); + + final BenchmarkReturnOut _value; + + @override + BenchmarkReturnOut benchmarkId(int benchmarkId) => + this(benchmarkId: benchmarkId); + + @override + BenchmarkReturnOut code(String code) => this(code: code); + + @override + BenchmarkReturnOut daysSkipped(int daysSkipped) => + this(daysSkipped: daysSkipped); + + @override + BenchmarkReturnOut excess(String? excess) => this(excess: excess); + + @override + BenchmarkReturnOut kind(String kind) => this(kind: kind); + + @override + BenchmarkReturnOut name(String name) => this(name: name); + + @override + BenchmarkReturnOut twr(String? twr) => this(twr: twr); + + @override + BenchmarkReturnOut twrAnnualized(String? twrAnnualized) => + this(twrAnnualized: twrAnnualized); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name") + /// ```` + BenchmarkReturnOut call({ + Object? benchmarkId = const $CopyWithPlaceholder(), + Object? code = const $CopyWithPlaceholder(), + Object? daysSkipped = const $CopyWithPlaceholder(), + Object? excess = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? twr = const $CopyWithPlaceholder(), + Object? twrAnnualized = const $CopyWithPlaceholder(), + }) { + return BenchmarkReturnOut( + benchmarkId: benchmarkId == const $CopyWithPlaceholder() + ? _value.benchmarkId + // ignore: cast_nullable_to_non_nullable + : benchmarkId as int, + code: code == const $CopyWithPlaceholder() + ? _value.code + // ignore: cast_nullable_to_non_nullable + : code as String, + daysSkipped: daysSkipped == const $CopyWithPlaceholder() + ? _value.daysSkipped + // ignore: cast_nullable_to_non_nullable + : daysSkipped as int, + excess: excess == const $CopyWithPlaceholder() + ? _value.excess + // ignore: cast_nullable_to_non_nullable + : excess as String?, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + 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?, + ); + } +} + +extension $BenchmarkReturnOutCopyWith on BenchmarkReturnOut { + /// Returns a callable class that can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)` or like so:`instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$BenchmarkReturnOutCWProxy get copyWith => + _$BenchmarkReturnOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +BenchmarkReturnOut _$BenchmarkReturnOutFromJson( + Map json, +) => $checkedCreate( + 'BenchmarkReturnOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'benchmark_id', + 'code', + 'days_skipped', + 'excess', + 'kind', + 'name', + 'twr', + 'twr_annualized', + ], + ); + final val = BenchmarkReturnOut( + benchmarkId: $checkedConvert('benchmark_id', (v) => (v as num).toInt()), + code: $checkedConvert('code', (v) => v as String), + daysSkipped: $checkedConvert('days_skipped', (v) => (v as num).toInt()), + excess: $checkedConvert('excess', (v) => v as String?), + kind: $checkedConvert('kind', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + twr: $checkedConvert('twr', (v) => v as String?), + twrAnnualized: $checkedConvert('twr_annualized', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'benchmarkId': 'benchmark_id', + 'daysSkipped': 'days_skipped', + 'twrAnnualized': 'twr_annualized', + }, +); + +Map _$BenchmarkReturnOutToJson(BenchmarkReturnOut instance) => + { + 'benchmark_id': instance.benchmarkId, + 'code': instance.code, + 'days_skipped': instance.daysSkipped, + 'excess': instance.excess, + 'kind': instance.kind, + 'name': instance.name, + 'twr': instance.twr, + 'twr_annualized': instance.twrAnnualized, + }; diff --git a/app/packages/api_client/lib/src/model/calendar_entry.dart b/app/packages/api_client/lib/src/model/calendar_entry.dart new file mode 100644 index 0000000..32ccdf7 --- /dev/null +++ b/app/packages/api_client/lib/src/model/calendar_entry.dart @@ -0,0 +1,255 @@ +// +// 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 'calendar_entry.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CalendarEntry { + /// Returns a new [CalendarEntry] instance. + CalendarEntry({ + + required this.amount, + + required this.amountRub, + + required this.basis, + + required this.currency, + + required this.expectedDate, + + required this.instrumentId, + + required this.kind, + + required this.name, + + required this.perUnit, + + required this.qty, + + required this.recordDate, + + required this.taxWithheld, + + required this.ticker, + }); + + /// 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'basis', + required: true, + includeIfNull: false, + ) + + + final String basis; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'expected_date', + required: true, + includeIfNull: false, + ) + + + final DateTime expectedDate; + + + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: false, + ) + + + final int instrumentId; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + /// decimal as string + @JsonKey( + + name: r'per_unit', + required: true, + includeIfNull: true, + ) + + + final String? perUnit; + + + + /// decimal as string + @JsonKey( + + name: r'qty', + required: true, + includeIfNull: false, + ) + + + final String qty; + + + + @JsonKey( + + name: r'record_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? recordDate; + + + + /// decimal as string + @JsonKey( + + name: r'tax_withheld', + required: true, + includeIfNull: true, + ) + + + final String? taxWithheld; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: true, + ) + + + final String? ticker; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CalendarEntry && + other.amount == amount && + other.amountRub == amountRub && + other.basis == basis && + other.currency == currency && + other.expectedDate == expectedDate && + other.instrumentId == instrumentId && + other.kind == kind && + other.name == name && + other.perUnit == perUnit && + other.qty == qty && + other.recordDate == recordDate && + other.taxWithheld == taxWithheld && + other.ticker == ticker; + + @override + int get hashCode => + amount.hashCode + + (amountRub == null ? 0 : amountRub.hashCode) + + basis.hashCode + + currency.hashCode + + expectedDate.hashCode + + instrumentId.hashCode + + kind.hashCode + + name.hashCode + + (perUnit == null ? 0 : perUnit.hashCode) + + qty.hashCode + + (recordDate == null ? 0 : recordDate.hashCode) + + (taxWithheld == null ? 0 : taxWithheld.hashCode) + + (ticker == null ? 0 : ticker.hashCode); + + factory CalendarEntry.fromJson(Map json) => _$CalendarEntryFromJson(json); + + Map toJson() => _$CalendarEntryToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/calendar_entry.g.dart b/app/packages/api_client/lib/src/model/calendar_entry.g.dart new file mode 100644 index 0000000..ce9c6b0 --- /dev/null +++ b/app/packages/api_client/lib/src/model/calendar_entry.g.dart @@ -0,0 +1,271 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'calendar_entry.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$CalendarEntryCWProxy { + CalendarEntry amount(String amount); + + CalendarEntry amountRub(String? amountRub); + + CalendarEntry basis(String basis); + + CalendarEntry currency(String currency); + + CalendarEntry expectedDate(DateTime expectedDate); + + CalendarEntry instrumentId(int instrumentId); + + CalendarEntry kind(String kind); + + CalendarEntry name(String name); + + CalendarEntry perUnit(String? perUnit); + + CalendarEntry qty(String qty); + + CalendarEntry recordDate(DateTime? recordDate); + + CalendarEntry taxWithheld(String? taxWithheld); + + CalendarEntry 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 `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CalendarEntry(...).copyWith(id: 12, name: "My name") + /// ```` + CalendarEntry call({ + String amount, + String? amountRub, + String basis, + String currency, + DateTime expectedDate, + int instrumentId, + String kind, + String name, + String? perUnit, + String qty, + DateTime? recordDate, + String? taxWithheld, + String? ticker, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarEntry.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarEntry.copyWith.fieldName(...)` +class _$CalendarEntryCWProxyImpl implements _$CalendarEntryCWProxy { + const _$CalendarEntryCWProxyImpl(this._value); + + final CalendarEntry _value; + + @override + CalendarEntry amount(String amount) => this(amount: amount); + + @override + CalendarEntry amountRub(String? amountRub) => this(amountRub: amountRub); + + @override + CalendarEntry basis(String basis) => this(basis: basis); + + @override + CalendarEntry currency(String currency) => this(currency: currency); + + @override + CalendarEntry expectedDate(DateTime expectedDate) => + this(expectedDate: expectedDate); + + @override + CalendarEntry instrumentId(int instrumentId) => + this(instrumentId: instrumentId); + + @override + CalendarEntry kind(String kind) => this(kind: kind); + + @override + CalendarEntry name(String name) => this(name: name); + + @override + CalendarEntry perUnit(String? perUnit) => this(perUnit: perUnit); + + @override + CalendarEntry qty(String qty) => this(qty: qty); + + @override + CalendarEntry recordDate(DateTime? recordDate) => + this(recordDate: recordDate); + + @override + CalendarEntry taxWithheld(String? taxWithheld) => + this(taxWithheld: taxWithheld); + + @override + CalendarEntry 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 `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CalendarEntry(...).copyWith(id: 12, name: "My name") + /// ```` + CalendarEntry call({ + Object? amount = const $CopyWithPlaceholder(), + Object? amountRub = const $CopyWithPlaceholder(), + Object? basis = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? expectedDate = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? perUnit = const $CopyWithPlaceholder(), + Object? qty = const $CopyWithPlaceholder(), + Object? recordDate = const $CopyWithPlaceholder(), + Object? taxWithheld = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + }) { + return CalendarEntry( + 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?, + basis: basis == const $CopyWithPlaceholder() + ? _value.basis + // ignore: cast_nullable_to_non_nullable + : basis as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + expectedDate: expectedDate == const $CopyWithPlaceholder() + ? _value.expectedDate + // ignore: cast_nullable_to_non_nullable + : expectedDate as DateTime, + 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 String, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + perUnit: perUnit == const $CopyWithPlaceholder() + ? _value.perUnit + // ignore: cast_nullable_to_non_nullable + : perUnit as String?, + qty: qty == const $CopyWithPlaceholder() + ? _value.qty + // ignore: cast_nullable_to_non_nullable + : qty as String, + recordDate: recordDate == const $CopyWithPlaceholder() + ? _value.recordDate + // ignore: cast_nullable_to_non_nullable + : recordDate as DateTime?, + taxWithheld: taxWithheld == const $CopyWithPlaceholder() + ? _value.taxWithheld + // ignore: cast_nullable_to_non_nullable + : taxWithheld as String?, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + ); + } +} + +extension $CalendarEntryCopyWith on CalendarEntry { + /// Returns a callable class that can be used as follows: `instanceOfCalendarEntry.copyWith(...)` or like so:`instanceOfCalendarEntry.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$CalendarEntryCWProxy get copyWith => _$CalendarEntryCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CalendarEntry _$CalendarEntryFromJson(Map json) => + $checkedCreate( + 'CalendarEntry', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'amount', + 'amount_rub', + 'basis', + 'currency', + 'expected_date', + 'instrument_id', + 'kind', + 'name', + 'per_unit', + 'qty', + 'record_date', + 'tax_withheld', + 'ticker', + ], + ); + final val = CalendarEntry( + amount: $checkedConvert('amount', (v) => v as String), + amountRub: $checkedConvert('amount_rub', (v) => v as String?), + basis: $checkedConvert('basis', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + expectedDate: $checkedConvert( + 'expected_date', + (v) => DateTime.parse(v as String), + ), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num).toInt(), + ), + kind: $checkedConvert('kind', (v) => v as String), + name: $checkedConvert('name', (v) => v as String), + perUnit: $checkedConvert('per_unit', (v) => v as String?), + qty: $checkedConvert('qty', (v) => v as String), + recordDate: $checkedConvert( + 'record_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + taxWithheld: $checkedConvert('tax_withheld', (v) => v as String?), + ticker: $checkedConvert('ticker', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'amountRub': 'amount_rub', + 'expectedDate': 'expected_date', + 'instrumentId': 'instrument_id', + 'perUnit': 'per_unit', + 'recordDate': 'record_date', + 'taxWithheld': 'tax_withheld', + }, + ); + +Map _$CalendarEntryToJson(CalendarEntry instance) => + { + 'amount': instance.amount, + 'amount_rub': instance.amountRub, + 'basis': instance.basis, + 'currency': instance.currency, + 'expected_date': instance.expectedDate.toIso8601String(), + 'instrument_id': instance.instrumentId, + 'kind': instance.kind, + 'name': instance.name, + 'per_unit': instance.perUnit, + 'qty': instance.qty, + 'record_date': instance.recordDate?.toIso8601String(), + 'tax_withheld': instance.taxWithheld, + 'ticker': instance.ticker, + }; diff --git a/app/packages/api_client/lib/src/model/calendar_out.dart b/app/packages/api_client/lib/src/model/calendar_out.dart new file mode 100644 index 0000000..08e4907 --- /dev/null +++ b/app/packages/api_client/lib/src/model/calendar_out.dart @@ -0,0 +1,124 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/calendar_entry.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'calendar_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CalendarOut { + /// Returns a new [CalendarOut] instance. + CalendarOut({ + + required this.asOf, + + required this.byBasis, + + required this.currency, + + required this.entries, + + required this.totalExpectedRub, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: false, + ) + + + final DateTime asOf; + + + + @JsonKey( + + name: r'by_basis', + required: true, + includeIfNull: false, + ) + + + final Map byBasis; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'entries', + required: true, + includeIfNull: false, + ) + + + final List entries; + + + + /// decimal as string + @JsonKey( + + name: r'total_expected_rub', + required: true, + includeIfNull: false, + ) + + + final String totalExpectedRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CalendarOut && + other.asOf == asOf && + other.byBasis == byBasis && + other.currency == currency && + other.entries == entries && + other.totalExpectedRub == totalExpectedRub; + + @override + int get hashCode => + asOf.hashCode + + byBasis.hashCode + + currency.hashCode + + entries.hashCode + + totalExpectedRub.hashCode; + + factory CalendarOut.fromJson(Map json) => _$CalendarOutFromJson(json); + + Map toJson() => _$CalendarOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/calendar_out.g.dart b/app/packages/api_client/lib/src/model/calendar_out.g.dart new file mode 100644 index 0000000..967fda2 --- /dev/null +++ b/app/packages/api_client/lib/src/model/calendar_out.g.dart @@ -0,0 +1,154 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'calendar_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$CalendarOutCWProxy { + CalendarOut asOf(DateTime asOf); + + CalendarOut byBasis(Map byBasis); + + CalendarOut currency(String currency); + + CalendarOut entries(List entries); + + CalendarOut totalExpectedRub(String totalExpectedRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CalendarOut(...).copyWith(id: 12, name: "My name") + /// ```` + CalendarOut call({ + DateTime asOf, + Map byBasis, + String currency, + List entries, + String totalExpectedRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarOut.copyWith.fieldName(...)` +class _$CalendarOutCWProxyImpl implements _$CalendarOutCWProxy { + const _$CalendarOutCWProxyImpl(this._value); + + final CalendarOut _value; + + @override + CalendarOut asOf(DateTime asOf) => this(asOf: asOf); + + @override + CalendarOut byBasis(Map byBasis) => this(byBasis: byBasis); + + @override + CalendarOut currency(String currency) => this(currency: currency); + + @override + CalendarOut entries(List entries) => this(entries: entries); + + @override + CalendarOut totalExpectedRub(String totalExpectedRub) => + this(totalExpectedRub: totalExpectedRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CalendarOut(...).copyWith(id: 12, name: "My name") + /// ```` + CalendarOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? byBasis = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? entries = const $CopyWithPlaceholder(), + Object? totalExpectedRub = const $CopyWithPlaceholder(), + }) { + return CalendarOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime, + byBasis: byBasis == const $CopyWithPlaceholder() + ? _value.byBasis + // ignore: cast_nullable_to_non_nullable + : byBasis as Map, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + entries: entries == const $CopyWithPlaceholder() + ? _value.entries + // ignore: cast_nullable_to_non_nullable + : entries as List, + totalExpectedRub: totalExpectedRub == const $CopyWithPlaceholder() + ? _value.totalExpectedRub + // ignore: cast_nullable_to_non_nullable + : totalExpectedRub as String, + ); + } +} + +extension $CalendarOutCopyWith on CalendarOut { + /// Returns a callable class that can be used as follows: `instanceOfCalendarOut.copyWith(...)` or like so:`instanceOfCalendarOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$CalendarOutCWProxy get copyWith => _$CalendarOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CalendarOut _$CalendarOutFromJson(Map json) => $checkedCreate( + 'CalendarOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'as_of', + 'by_basis', + 'currency', + 'entries', + 'total_expected_rub', + ], + ); + final val = CalendarOut( + asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)), + byBasis: $checkedConvert( + 'by_basis', + (v) => Map.from(v as Map), + ), + currency: $checkedConvert('currency', (v) => v as String), + entries: $checkedConvert( + 'entries', + (v) => (v as List) + .map((e) => CalendarEntry.fromJson(e as Map)) + .toList(), + ), + totalExpectedRub: $checkedConvert( + 'total_expected_rub', + (v) => v as String, + ), + ); + return val; + }, + fieldKeyMap: const { + 'asOf': 'as_of', + 'byBasis': 'by_basis', + 'totalExpectedRub': 'total_expected_rub', + }, +); + +Map _$CalendarOutToJson(CalendarOut instance) => + { + 'as_of': instance.asOf.toIso8601String(), + 'by_basis': instance.byBasis, + 'currency': instance.currency, + 'entries': instance.entries.map((e) => e.toJson()).toList(), + 'total_expected_rub': instance.totalExpectedRub, + }; diff --git a/app/packages/api_client/lib/src/model/cash_available.dart b/app/packages/api_client/lib/src/model/cash_available.dart new file mode 100644 index 0000000..d983a04 --- /dev/null +++ b/app/packages/api_client/lib/src/model/cash_available.dart @@ -0,0 +1,42 @@ +// +// 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 'cash_available.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CashAvailable { + /// Returns a new [CashAvailable] instance. + CashAvailable({ + }); + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CashAvailable && + + @override + int get hashCode => + + factory CashAvailable.fromJson(Map json) => _$CashAvailableFromJson(json); + + Map toJson() => _$CashAvailableToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/cash_flow_broker_month.dart b/app/packages/api_client/lib/src/model/cash_flow_broker_month.dart new file mode 100644 index 0000000..91206d3 --- /dev/null +++ b/app/packages/api_client/lib/src/model/cash_flow_broker_month.dart @@ -0,0 +1,125 @@ +// +// 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 'cash_flow_broker_month.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CashFlowBrokerMonth { + /// Returns a new [CashFlowBrokerMonth] instance. + CashFlowBrokerMonth({ + + required this.depositsRub, + + required this.eventCount, + + required this.month, + + required this.netRub, + + required this.withdrawalsRub, + }); + + /// decimal as string + @JsonKey( + + name: r'deposits_rub', + required: true, + includeIfNull: false, + ) + + + final String depositsRub; + + + + @JsonKey( + + name: r'event_count', + required: true, + includeIfNull: false, + ) + + + final int eventCount; + + + + @JsonKey( + + name: r'month', + required: true, + includeIfNull: false, + ) + + + final DateTime month; + + + + /// decimal as string + @JsonKey( + + name: r'net_rub', + required: true, + includeIfNull: false, + ) + + + final String netRub; + + + + /// decimal as string + @JsonKey( + + name: r'withdrawals_rub', + required: true, + includeIfNull: false, + ) + + + final String withdrawalsRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CashFlowBrokerMonth && + other.depositsRub == depositsRub && + other.eventCount == eventCount && + other.month == month && + other.netRub == netRub && + other.withdrawalsRub == withdrawalsRub; + + @override + int get hashCode => + depositsRub.hashCode + + eventCount.hashCode + + month.hashCode + + netRub.hashCode + + withdrawalsRub.hashCode; + + factory CashFlowBrokerMonth.fromJson(Map json) => _$CashFlowBrokerMonthFromJson(json); + + Map toJson() => _$CashFlowBrokerMonthToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/cash_flow_broker_month.g.dart b/app/packages/api_client/lib/src/model/cash_flow_broker_month.g.dart new file mode 100644 index 0000000..59a80b2 --- /dev/null +++ b/app/packages/api_client/lib/src/model/cash_flow_broker_month.g.dart @@ -0,0 +1,152 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'cash_flow_broker_month.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$CashFlowBrokerMonthCWProxy { + CashFlowBrokerMonth depositsRub(String depositsRub); + + CashFlowBrokerMonth eventCount(int eventCount); + + CashFlowBrokerMonth month(DateTime month); + + CashFlowBrokerMonth netRub(String netRub); + + CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name") + /// ```` + CashFlowBrokerMonth call({ + String depositsRub, + int eventCount, + DateTime month, + String netRub, + String withdrawalsRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)` +class _$CashFlowBrokerMonthCWProxyImpl implements _$CashFlowBrokerMonthCWProxy { + const _$CashFlowBrokerMonthCWProxyImpl(this._value); + + final CashFlowBrokerMonth _value; + + @override + CashFlowBrokerMonth depositsRub(String depositsRub) => + this(depositsRub: depositsRub); + + @override + CashFlowBrokerMonth eventCount(int eventCount) => + this(eventCount: eventCount); + + @override + CashFlowBrokerMonth month(DateTime month) => this(month: month); + + @override + CashFlowBrokerMonth netRub(String netRub) => this(netRub: netRub); + + @override + CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub) => + this(withdrawalsRub: withdrawalsRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name") + /// ```` + CashFlowBrokerMonth call({ + Object? depositsRub = const $CopyWithPlaceholder(), + Object? eventCount = const $CopyWithPlaceholder(), + Object? month = const $CopyWithPlaceholder(), + Object? netRub = const $CopyWithPlaceholder(), + Object? withdrawalsRub = const $CopyWithPlaceholder(), + }) { + return CashFlowBrokerMonth( + depositsRub: depositsRub == const $CopyWithPlaceholder() + ? _value.depositsRub + // ignore: cast_nullable_to_non_nullable + : depositsRub as String, + eventCount: eventCount == const $CopyWithPlaceholder() + ? _value.eventCount + // ignore: cast_nullable_to_non_nullable + : eventCount as int, + month: month == const $CopyWithPlaceholder() + ? _value.month + // ignore: cast_nullable_to_non_nullable + : month as DateTime, + netRub: netRub == const $CopyWithPlaceholder() + ? _value.netRub + // ignore: cast_nullable_to_non_nullable + : netRub as String, + withdrawalsRub: withdrawalsRub == const $CopyWithPlaceholder() + ? _value.withdrawalsRub + // ignore: cast_nullable_to_non_nullable + : withdrawalsRub as String, + ); + } +} + +extension $CashFlowBrokerMonthCopyWith on CashFlowBrokerMonth { + /// Returns a callable class that can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)` or like so:`instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$CashFlowBrokerMonthCWProxy get copyWith => + _$CashFlowBrokerMonthCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CashFlowBrokerMonth _$CashFlowBrokerMonthFromJson(Map json) => + $checkedCreate( + 'CashFlowBrokerMonth', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'deposits_rub', + 'event_count', + 'month', + 'net_rub', + 'withdrawals_rub', + ], + ); + final val = CashFlowBrokerMonth( + depositsRub: $checkedConvert('deposits_rub', (v) => v as String), + eventCount: $checkedConvert('event_count', (v) => (v as num).toInt()), + month: $checkedConvert('month', (v) => DateTime.parse(v as String)), + netRub: $checkedConvert('net_rub', (v) => v as String), + withdrawalsRub: $checkedConvert( + 'withdrawals_rub', + (v) => v as String, + ), + ); + return val; + }, + fieldKeyMap: const { + 'depositsRub': 'deposits_rub', + 'eventCount': 'event_count', + 'netRub': 'net_rub', + 'withdrawalsRub': 'withdrawals_rub', + }, + ); + +Map _$CashFlowBrokerMonthToJson( + CashFlowBrokerMonth instance, +) => { + 'deposits_rub': instance.depositsRub, + 'event_count': instance.eventCount, + 'month': instance.month.toIso8601String(), + 'net_rub': instance.netRub, + 'withdrawals_rub': instance.withdrawalsRub, +}; diff --git a/app/packages/api_client/lib/src/model/commit_request.dart b/app/packages/api_client/lib/src/model/commit_request.dart new file mode 100644 index 0000000..d0b902e --- /dev/null +++ b/app/packages/api_client/lib/src/model/commit_request.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 'commit_request.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class CommitRequest { + /// Returns a new [CommitRequest] instance. + CommitRequest({ + + this.accountId, + + this.confirmDuplicates = false, + + this.dryRun = false, + }); + + @JsonKey( + + name: r'account_id', + required: false, + includeIfNull: false, + ) + + + final int? accountId; + + + + @JsonKey( + defaultValue: false, + name: r'confirm_duplicates', + required: false, + includeIfNull: false, + ) + + + final bool? confirmDuplicates; + + + + @JsonKey( + defaultValue: false, + name: r'dry_run', + required: false, + includeIfNull: false, + ) + + + final bool? dryRun; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is CommitRequest && + other.accountId == accountId && + other.confirmDuplicates == confirmDuplicates && + other.dryRun == dryRun; + + @override + int get hashCode => + (accountId == null ? 0 : accountId.hashCode) + + confirmDuplicates.hashCode + + dryRun.hashCode; + + factory CommitRequest.fromJson(Map json) => _$CommitRequestFromJson(json); + + Map toJson() => _$CommitRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/commit_request.g.dart b/app/packages/api_client/lib/src/model/commit_request.g.dart new file mode 100644 index 0000000..a216074 --- /dev/null +++ b/app/packages/api_client/lib/src/model/commit_request.g.dart @@ -0,0 +1,107 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'commit_request.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$CommitRequestCWProxy { + CommitRequest accountId(int? accountId); + + CommitRequest confirmDuplicates(bool? confirmDuplicates); + + CommitRequest dryRun(bool? dryRun); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CommitRequest(...).copyWith(id: 12, name: "My name") + /// ```` + CommitRequest call({int? accountId, bool? confirmDuplicates, bool? dryRun}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCommitRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCommitRequest.copyWith.fieldName(...)` +class _$CommitRequestCWProxyImpl implements _$CommitRequestCWProxy { + const _$CommitRequestCWProxyImpl(this._value); + + final CommitRequest _value; + + @override + CommitRequest accountId(int? accountId) => this(accountId: accountId); + + @override + CommitRequest confirmDuplicates(bool? confirmDuplicates) => + this(confirmDuplicates: confirmDuplicates); + + @override + CommitRequest dryRun(bool? dryRun) => this(dryRun: dryRun); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// CommitRequest(...).copyWith(id: 12, name: "My name") + /// ```` + CommitRequest call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? confirmDuplicates = const $CopyWithPlaceholder(), + Object? dryRun = const $CopyWithPlaceholder(), + }) { + return CommitRequest( + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int?, + confirmDuplicates: confirmDuplicates == const $CopyWithPlaceholder() + ? _value.confirmDuplicates + // ignore: cast_nullable_to_non_nullable + : confirmDuplicates as bool?, + dryRun: dryRun == const $CopyWithPlaceholder() + ? _value.dryRun + // ignore: cast_nullable_to_non_nullable + : dryRun as bool?, + ); + } +} + +extension $CommitRequestCopyWith on CommitRequest { + /// Returns a callable class that can be used as follows: `instanceOfCommitRequest.copyWith(...)` or like so:`instanceOfCommitRequest.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$CommitRequestCWProxy get copyWith => _$CommitRequestCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +CommitRequest _$CommitRequestFromJson(Map json) => + $checkedCreate( + 'CommitRequest', + json, + ($checkedConvert) { + final val = CommitRequest( + accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()), + confirmDuplicates: $checkedConvert( + 'confirm_duplicates', + (v) => v as bool? ?? false, + ), + dryRun: $checkedConvert('dry_run', (v) => v as bool? ?? false), + ); + return val; + }, + fieldKeyMap: const { + 'accountId': 'account_id', + 'confirmDuplicates': 'confirm_duplicates', + 'dryRun': 'dry_run', + }, + ); + +Map _$CommitRequestToJson(CommitRequest instance) => + { + 'account_id': ?instance.accountId, + 'confirm_duplicates': ?instance.confirmDuplicates, + 'dry_run': ?instance.dryRun, + }; diff --git a/app/packages/api_client/lib/src/model/event_source.dart b/app/packages/api_client/lib/src/model/event_source.dart index bdb209b..d7ea33b 100644 --- a/app/packages/api_client/lib/src/model/event_source.dart +++ b/app/packages/api_client/lib/src/model/event_source.dart @@ -13,6 +13,8 @@ enum EventSource { reportSber(r'report_sber'), @JsonValue(r'report_vtb') reportVtb(r'report_vtb'), + @JsonValue(r'csv') + csv(r'csv'), @JsonValue(r'manual') manual(r'manual'), @JsonValue(r'unknown_default_open_api') diff --git a/app/packages/api_client/lib/src/model/forecast_month.dart b/app/packages/api_client/lib/src/model/forecast_month.dart new file mode 100644 index 0000000..6637273 --- /dev/null +++ b/app/packages/api_client/lib/src/model/forecast_month.dart @@ -0,0 +1,91 @@ +// +// 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 'forecast_month.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ForecastMonth { + /// Returns a new [ForecastMonth] instance. + ForecastMonth({ + + required this.amountRub, + + required this.byBasis, + + required this.month, + }); + + /// decimal as string + @JsonKey( + + name: r'amount_rub', + required: true, + includeIfNull: false, + ) + + + final String amountRub; + + + + @JsonKey( + + name: r'by_basis', + required: true, + includeIfNull: false, + ) + + + final Map byBasis; + + + + @JsonKey( + + name: r'month', + required: true, + includeIfNull: false, + ) + + + final DateTime month; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ForecastMonth && + other.amountRub == amountRub && + other.byBasis == byBasis && + other.month == month; + + @override + int get hashCode => + amountRub.hashCode + + byBasis.hashCode + + month.hashCode; + + factory ForecastMonth.fromJson(Map json) => _$ForecastMonthFromJson(json); + + Map toJson() => _$ForecastMonthToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/forecast_month.g.dart b/app/packages/api_client/lib/src/model/forecast_month.g.dart new file mode 100644 index 0000000..7cf3f7c --- /dev/null +++ b/app/packages/api_client/lib/src/model/forecast_month.g.dart @@ -0,0 +1,110 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'forecast_month.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ForecastMonthCWProxy { + ForecastMonth amountRub(String amountRub); + + ForecastMonth byBasis(Map byBasis); + + ForecastMonth month(DateTime month); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ForecastMonth(...).copyWith(id: 12, name: "My name") + /// ```` + ForecastMonth call({ + String amountRub, + Map byBasis, + DateTime month, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfForecastMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfForecastMonth.copyWith.fieldName(...)` +class _$ForecastMonthCWProxyImpl implements _$ForecastMonthCWProxy { + const _$ForecastMonthCWProxyImpl(this._value); + + final ForecastMonth _value; + + @override + ForecastMonth amountRub(String amountRub) => this(amountRub: amountRub); + + @override + ForecastMonth byBasis(Map byBasis) => this(byBasis: byBasis); + + @override + ForecastMonth month(DateTime month) => this(month: month); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ForecastMonth(...).copyWith(id: 12, name: "My name") + /// ```` + ForecastMonth call({ + Object? amountRub = const $CopyWithPlaceholder(), + Object? byBasis = const $CopyWithPlaceholder(), + Object? month = const $CopyWithPlaceholder(), + }) { + return ForecastMonth( + amountRub: amountRub == const $CopyWithPlaceholder() + ? _value.amountRub + // ignore: cast_nullable_to_non_nullable + : amountRub as String, + byBasis: byBasis == const $CopyWithPlaceholder() + ? _value.byBasis + // ignore: cast_nullable_to_non_nullable + : byBasis as Map, + month: month == const $CopyWithPlaceholder() + ? _value.month + // ignore: cast_nullable_to_non_nullable + : month as DateTime, + ); + } +} + +extension $ForecastMonthCopyWith on ForecastMonth { + /// Returns a callable class that can be used as follows: `instanceOfForecastMonth.copyWith(...)` or like so:`instanceOfForecastMonth.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ForecastMonthCWProxy get copyWith => _$ForecastMonthCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ForecastMonth _$ForecastMonthFromJson(Map json) => + $checkedCreate( + 'ForecastMonth', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['amount_rub', 'by_basis', 'month'], + ); + final val = ForecastMonth( + amountRub: $checkedConvert('amount_rub', (v) => v as String), + byBasis: $checkedConvert( + 'by_basis', + (v) => Map.from(v as Map), + ), + month: $checkedConvert('month', (v) => DateTime.parse(v as String)), + ); + return val; + }, + fieldKeyMap: const {'amountRub': 'amount_rub', 'byBasis': 'by_basis'}, + ); + +Map _$ForecastMonthToJson(ForecastMonth instance) => + { + 'amount_rub': instance.amountRub, + 'by_basis': instance.byBasis, + 'month': instance.month.toIso8601String(), + }; diff --git a/app/packages/api_client/lib/src/model/forecast_out.dart b/app/packages/api_client/lib/src/model/forecast_out.dart new file mode 100644 index 0000000..5bbdbda --- /dev/null +++ b/app/packages/api_client/lib/src/model/forecast_out.dart @@ -0,0 +1,109 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/forecast_month.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'forecast_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ForecastOut { + /// Returns a new [ForecastOut] instance. + ForecastOut({ + + required this.annualYieldOnValue, + + required this.months, + + required this.totalRub, + + required this.warnings, + }); + + /// decimal as string + @JsonKey( + + name: r'annual_yield_on_value', + required: true, + includeIfNull: true, + ) + + + final String? annualYieldOnValue; + + + + @JsonKey( + + name: r'months', + required: true, + includeIfNull: false, + ) + + + final List months; + + + + /// decimal as string + @JsonKey( + + name: r'total_rub', + required: true, + includeIfNull: false, + ) + + + final String totalRub; + + + + @JsonKey( + + name: r'warnings', + required: true, + includeIfNull: false, + ) + + + final List warnings; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ForecastOut && + other.annualYieldOnValue == annualYieldOnValue && + other.months == months && + other.totalRub == totalRub && + other.warnings == warnings; + + @override + int get hashCode => + (annualYieldOnValue == null ? 0 : annualYieldOnValue.hashCode) + + months.hashCode + + totalRub.hashCode + + warnings.hashCode; + + factory ForecastOut.fromJson(Map json) => _$ForecastOutFromJson(json); + + Map toJson() => _$ForecastOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/forecast_out.g.dart b/app/packages/api_client/lib/src/model/forecast_out.g.dart new file mode 100644 index 0000000..6681dc6 --- /dev/null +++ b/app/packages/api_client/lib/src/model/forecast_out.g.dart @@ -0,0 +1,139 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'forecast_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ForecastOutCWProxy { + ForecastOut annualYieldOnValue(String? annualYieldOnValue); + + ForecastOut months(List months); + + ForecastOut totalRub(String totalRub); + + ForecastOut warnings(List warnings); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ForecastOut(...).copyWith(id: 12, name: "My name") + /// ```` + ForecastOut call({ + String? annualYieldOnValue, + List months, + String totalRub, + List warnings, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfForecastOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfForecastOut.copyWith.fieldName(...)` +class _$ForecastOutCWProxyImpl implements _$ForecastOutCWProxy { + const _$ForecastOutCWProxyImpl(this._value); + + final ForecastOut _value; + + @override + ForecastOut annualYieldOnValue(String? annualYieldOnValue) => + this(annualYieldOnValue: annualYieldOnValue); + + @override + ForecastOut months(List months) => this(months: months); + + @override + ForecastOut totalRub(String totalRub) => this(totalRub: totalRub); + + @override + ForecastOut warnings(List warnings) => this(warnings: warnings); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ForecastOut(...).copyWith(id: 12, name: "My name") + /// ```` + ForecastOut call({ + Object? annualYieldOnValue = const $CopyWithPlaceholder(), + Object? months = const $CopyWithPlaceholder(), + Object? totalRub = const $CopyWithPlaceholder(), + Object? warnings = const $CopyWithPlaceholder(), + }) { + return ForecastOut( + annualYieldOnValue: annualYieldOnValue == const $CopyWithPlaceholder() + ? _value.annualYieldOnValue + // ignore: cast_nullable_to_non_nullable + : annualYieldOnValue as String?, + months: months == const $CopyWithPlaceholder() + ? _value.months + // ignore: cast_nullable_to_non_nullable + : months as List, + totalRub: totalRub == const $CopyWithPlaceholder() + ? _value.totalRub + // ignore: cast_nullable_to_non_nullable + : totalRub as String, + warnings: warnings == const $CopyWithPlaceholder() + ? _value.warnings + // ignore: cast_nullable_to_non_nullable + : warnings as List, + ); + } +} + +extension $ForecastOutCopyWith on ForecastOut { + /// Returns a callable class that can be used as follows: `instanceOfForecastOut.copyWith(...)` or like so:`instanceOfForecastOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ForecastOutCWProxy get copyWith => _$ForecastOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ForecastOut _$ForecastOutFromJson(Map json) => $checkedCreate( + 'ForecastOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'annual_yield_on_value', + 'months', + 'total_rub', + 'warnings', + ], + ); + final val = ForecastOut( + annualYieldOnValue: $checkedConvert( + 'annual_yield_on_value', + (v) => v as String?, + ), + months: $checkedConvert( + 'months', + (v) => (v as List) + .map((e) => ForecastMonth.fromJson(e as Map)) + .toList(), + ), + totalRub: $checkedConvert('total_rub', (v) => v as String), + warnings: $checkedConvert( + 'warnings', + (v) => (v as List).map((e) => e as String).toList(), + ), + ); + return val; + }, + fieldKeyMap: const { + 'annualYieldOnValue': 'annual_yield_on_value', + 'totalRub': 'total_rub', + }, +); + +Map _$ForecastOutToJson(ForecastOut instance) => + { + 'annual_yield_on_value': instance.annualYieldOnValue, + 'months': instance.months.map((e) => e.toJson()).toList(), + 'total_rub': instance.totalRub, + 'warnings': instance.warnings, + }; diff --git a/app/packages/api_client/lib/src/model/goal_create.dart b/app/packages/api_client/lib/src/model/goal_create.dart new file mode 100644 index 0000000..6c1b980 --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_create.dart @@ -0,0 +1,172 @@ +// +// 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 'goal_create.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GoalCreate { + /// Returns a new [GoalCreate] instance. + GoalCreate({ + + this.archived = false, + + this.currency = 'RUB', + + this.monthlyContribution, + + required this.name, + + this.note, + + this.scope = 'all', + + required this.targetAmount, + + this.targetDate, + }); + + @JsonKey( + defaultValue: false, + name: r'archived', + required: false, + includeIfNull: false, + ) + + + final bool? archived; + + + + @JsonKey( + defaultValue: 'RUB', + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + /// decimal as string + @JsonKey( + + name: r'monthly_contribution', + required: false, + includeIfNull: false, + ) + + + final String? monthlyContribution; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'note', + required: false, + includeIfNull: false, + ) + + + final String? note; + + + + @JsonKey( + defaultValue: 'all', + name: r'scope', + required: false, + includeIfNull: false, + ) + + + final String? scope; + + + + /// decimal as string + @JsonKey( + + name: r'target_amount', + required: true, + includeIfNull: false, + ) + + + final String targetAmount; + + + + @JsonKey( + + name: r'target_date', + required: false, + includeIfNull: false, + ) + + + final DateTime? targetDate; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is GoalCreate && + other.archived == archived && + other.currency == currency && + other.monthlyContribution == monthlyContribution && + other.name == name && + other.note == note && + other.scope == scope && + other.targetAmount == targetAmount && + other.targetDate == targetDate; + + @override + int get hashCode => + archived.hashCode + + currency.hashCode + + (monthlyContribution == null ? 0 : monthlyContribution.hashCode) + + name.hashCode + + (note == null ? 0 : note.hashCode) + + scope.hashCode + + targetAmount.hashCode + + (targetDate == null ? 0 : targetDate.hashCode); + + factory GoalCreate.fromJson(Map json) => _$GoalCreateFromJson(json); + + Map toJson() => _$GoalCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/goal_create.g.dart b/app/packages/api_client/lib/src/model/goal_create.g.dart new file mode 100644 index 0000000..0e16a2c --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_create.g.dart @@ -0,0 +1,180 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'goal_create.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$GoalCreateCWProxy { + GoalCreate archived(bool? archived); + + GoalCreate currency(String? currency); + + GoalCreate monthlyContribution(String? monthlyContribution); + + GoalCreate name(String name); + + GoalCreate note(String? note); + + GoalCreate scope(String? scope); + + GoalCreate targetAmount(String targetAmount); + + GoalCreate targetDate(DateTime? targetDate); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalCreate(...).copyWith(id: 12, name: "My name") + /// ```` + GoalCreate call({ + bool? archived, + String? currency, + String? monthlyContribution, + String name, + String? note, + String? scope, + String targetAmount, + DateTime? targetDate, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalCreate.copyWith.fieldName(...)` +class _$GoalCreateCWProxyImpl implements _$GoalCreateCWProxy { + const _$GoalCreateCWProxyImpl(this._value); + + final GoalCreate _value; + + @override + GoalCreate archived(bool? archived) => this(archived: archived); + + @override + GoalCreate currency(String? currency) => this(currency: currency); + + @override + GoalCreate monthlyContribution(String? monthlyContribution) => + this(monthlyContribution: monthlyContribution); + + @override + GoalCreate name(String name) => this(name: name); + + @override + GoalCreate note(String? note) => this(note: note); + + @override + GoalCreate scope(String? scope) => this(scope: scope); + + @override + GoalCreate targetAmount(String targetAmount) => + this(targetAmount: targetAmount); + + @override + GoalCreate targetDate(DateTime? targetDate) => this(targetDate: targetDate); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalCreate(...).copyWith(id: 12, name: "My name") + /// ```` + GoalCreate call({ + Object? archived = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? monthlyContribution = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? scope = const $CopyWithPlaceholder(), + Object? targetAmount = const $CopyWithPlaceholder(), + Object? targetDate = const $CopyWithPlaceholder(), + }) { + return GoalCreate( + archived: archived == const $CopyWithPlaceholder() + ? _value.archived + // ignore: cast_nullable_to_non_nullable + : archived as bool?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + monthlyContribution: monthlyContribution == const $CopyWithPlaceholder() + ? _value.monthlyContribution + // ignore: cast_nullable_to_non_nullable + : monthlyContribution as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + scope: scope == const $CopyWithPlaceholder() + ? _value.scope + // ignore: cast_nullable_to_non_nullable + : scope as String?, + targetAmount: targetAmount == const $CopyWithPlaceholder() + ? _value.targetAmount + // ignore: cast_nullable_to_non_nullable + : targetAmount as String, + targetDate: targetDate == const $CopyWithPlaceholder() + ? _value.targetDate + // ignore: cast_nullable_to_non_nullable + : targetDate as DateTime?, + ); + } +} + +extension $GoalCreateCopyWith on GoalCreate { + /// Returns a callable class that can be used as follows: `instanceOfGoalCreate.copyWith(...)` or like so:`instanceOfGoalCreate.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$GoalCreateCWProxy get copyWith => _$GoalCreateCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GoalCreate _$GoalCreateFromJson(Map json) => $checkedCreate( + 'GoalCreate', + json, + ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['name', 'target_amount']); + final val = GoalCreate( + archived: $checkedConvert('archived', (v) => v as bool? ?? false), + currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'), + monthlyContribution: $checkedConvert( + 'monthly_contribution', + (v) => v as String?, + ), + name: $checkedConvert('name', (v) => v as String), + note: $checkedConvert('note', (v) => v as String?), + scope: $checkedConvert('scope', (v) => v as String? ?? 'all'), + targetAmount: $checkedConvert('target_amount', (v) => v as String), + targetDate: $checkedConvert( + 'target_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; + }, + fieldKeyMap: const { + 'monthlyContribution': 'monthly_contribution', + 'targetAmount': 'target_amount', + 'targetDate': 'target_date', + }, +); + +Map _$GoalCreateToJson(GoalCreate instance) => + { + 'archived': ?instance.archived, + 'currency': ?instance.currency, + 'monthly_contribution': ?instance.monthlyContribution, + 'name': instance.name, + 'note': ?instance.note, + 'scope': ?instance.scope, + 'target_amount': instance.targetAmount, + 'target_date': ?instance.targetDate?.toIso8601String(), + }; diff --git a/app/packages/api_client/lib/src/model/goal_out.dart b/app/packages/api_client/lib/src/model/goal_out.dart new file mode 100644 index 0000000..0e9bf3a --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_out.dart @@ -0,0 +1,188 @@ +// +// 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 'goal_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GoalOut { + /// Returns a new [GoalOut] instance. + GoalOut({ + + required this.archived, + + required this.currency, + + required this.id, + + required this.monthlyContribution, + + required this.name, + + required this.note, + + required this.scope, + + required this.targetAmount, + + required this.targetDate, + }); + + @JsonKey( + + name: r'archived', + required: true, + includeIfNull: false, + ) + + + final bool archived; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + /// decimal as string + @JsonKey( + + name: r'monthly_contribution', + required: true, + includeIfNull: true, + ) + + + final String? monthlyContribution; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'note', + required: true, + includeIfNull: true, + ) + + + final String? note; + + + + @JsonKey( + + name: r'scope', + required: true, + includeIfNull: false, + ) + + + final String scope; + + + + /// decimal as string + @JsonKey( + + name: r'target_amount', + required: true, + includeIfNull: false, + ) + + + final String targetAmount; + + + + @JsonKey( + + name: r'target_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? targetDate; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is GoalOut && + other.archived == archived && + other.currency == currency && + other.id == id && + other.monthlyContribution == monthlyContribution && + other.name == name && + other.note == note && + other.scope == scope && + other.targetAmount == targetAmount && + other.targetDate == targetDate; + + @override + int get hashCode => + archived.hashCode + + currency.hashCode + + id.hashCode + + (monthlyContribution == null ? 0 : monthlyContribution.hashCode) + + name.hashCode + + (note == null ? 0 : note.hashCode) + + scope.hashCode + + targetAmount.hashCode + + (targetDate == null ? 0 : targetDate.hashCode); + + factory GoalOut.fromJson(Map json) => _$GoalOutFromJson(json); + + Map toJson() => _$GoalOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/goal_out.g.dart b/app/packages/api_client/lib/src/model/goal_out.g.dart new file mode 100644 index 0000000..ec1184e --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_out.g.dart @@ -0,0 +1,204 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'goal_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$GoalOutCWProxy { + GoalOut archived(bool archived); + + GoalOut currency(String currency); + + GoalOut id(int id); + + GoalOut monthlyContribution(String? monthlyContribution); + + GoalOut name(String name); + + GoalOut note(String? note); + + GoalOut scope(String scope); + + GoalOut targetAmount(String targetAmount); + + GoalOut targetDate(DateTime? targetDate); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalOut(...).copyWith(id: 12, name: "My name") + /// ```` + GoalOut call({ + bool archived, + String currency, + int id, + String? monthlyContribution, + String name, + String? note, + String scope, + String targetAmount, + DateTime? targetDate, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalOut.copyWith.fieldName(...)` +class _$GoalOutCWProxyImpl implements _$GoalOutCWProxy { + const _$GoalOutCWProxyImpl(this._value); + + final GoalOut _value; + + @override + GoalOut archived(bool archived) => this(archived: archived); + + @override + GoalOut currency(String currency) => this(currency: currency); + + @override + GoalOut id(int id) => this(id: id); + + @override + GoalOut monthlyContribution(String? monthlyContribution) => + this(monthlyContribution: monthlyContribution); + + @override + GoalOut name(String name) => this(name: name); + + @override + GoalOut note(String? note) => this(note: note); + + @override + GoalOut scope(String scope) => this(scope: scope); + + @override + GoalOut targetAmount(String targetAmount) => this(targetAmount: targetAmount); + + @override + GoalOut targetDate(DateTime? targetDate) => this(targetDate: targetDate); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalOut(...).copyWith(id: 12, name: "My name") + /// ```` + GoalOut call({ + Object? archived = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? monthlyContribution = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? scope = const $CopyWithPlaceholder(), + Object? targetAmount = const $CopyWithPlaceholder(), + Object? targetDate = const $CopyWithPlaceholder(), + }) { + return GoalOut( + archived: archived == const $CopyWithPlaceholder() + ? _value.archived + // ignore: cast_nullable_to_non_nullable + : archived as bool, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + monthlyContribution: monthlyContribution == const $CopyWithPlaceholder() + ? _value.monthlyContribution + // ignore: cast_nullable_to_non_nullable + : monthlyContribution as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + scope: scope == const $CopyWithPlaceholder() + ? _value.scope + // ignore: cast_nullable_to_non_nullable + : scope as String, + targetAmount: targetAmount == const $CopyWithPlaceholder() + ? _value.targetAmount + // ignore: cast_nullable_to_non_nullable + : targetAmount as String, + targetDate: targetDate == const $CopyWithPlaceholder() + ? _value.targetDate + // ignore: cast_nullable_to_non_nullable + : targetDate as DateTime?, + ); + } +} + +extension $GoalOutCopyWith on GoalOut { + /// Returns a callable class that can be used as follows: `instanceOfGoalOut.copyWith(...)` or like so:`instanceOfGoalOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$GoalOutCWProxy get copyWith => _$GoalOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GoalOut _$GoalOutFromJson(Map json) => $checkedCreate( + 'GoalOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'archived', + 'currency', + 'id', + 'monthly_contribution', + 'name', + 'note', + 'scope', + 'target_amount', + 'target_date', + ], + ); + final val = GoalOut( + archived: $checkedConvert('archived', (v) => v as bool), + currency: $checkedConvert('currency', (v) => v as String), + id: $checkedConvert('id', (v) => (v as num).toInt()), + monthlyContribution: $checkedConvert( + 'monthly_contribution', + (v) => v as String?, + ), + name: $checkedConvert('name', (v) => v as String), + note: $checkedConvert('note', (v) => v as String?), + scope: $checkedConvert('scope', (v) => v as String), + targetAmount: $checkedConvert('target_amount', (v) => v as String), + targetDate: $checkedConvert( + 'target_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; + }, + fieldKeyMap: const { + 'monthlyContribution': 'monthly_contribution', + 'targetAmount': 'target_amount', + 'targetDate': 'target_date', + }, +); + +Map _$GoalOutToJson(GoalOut instance) => { + 'archived': instance.archived, + 'currency': instance.currency, + 'id': instance.id, + 'monthly_contribution': instance.monthlyContribution, + 'name': instance.name, + 'note': instance.note, + 'scope': instance.scope, + 'target_amount': instance.targetAmount, + 'target_date': instance.targetDate?.toIso8601String(), +}; diff --git a/app/packages/api_client/lib/src/model/goal_patch.dart b/app/packages/api_client/lib/src/model/goal_patch.dart new file mode 100644 index 0000000..6d95833 --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_patch.dart @@ -0,0 +1,172 @@ +// +// 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 'goal_patch.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GoalPatch { + /// Returns a new [GoalPatch] instance. + GoalPatch({ + + this.archived, + + this.currency, + + this.monthlyContribution, + + this.name, + + this.note, + + this.scope, + + this.targetAmount, + + this.targetDate, + }); + + @JsonKey( + + name: r'archived', + required: false, + includeIfNull: false, + ) + + + final bool? archived; + + + + @JsonKey( + + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + /// decimal as string + @JsonKey( + + name: r'monthly_contribution', + required: false, + includeIfNull: false, + ) + + + final String? monthlyContribution; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false, + ) + + + final String? name; + + + + @JsonKey( + + name: r'note', + required: false, + includeIfNull: false, + ) + + + final String? note; + + + + @JsonKey( + + name: r'scope', + required: false, + includeIfNull: false, + ) + + + final String? scope; + + + + /// decimal as string + @JsonKey( + + name: r'target_amount', + required: false, + includeIfNull: false, + ) + + + final String? targetAmount; + + + + @JsonKey( + + name: r'target_date', + required: false, + includeIfNull: false, + ) + + + final DateTime? targetDate; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is GoalPatch && + other.archived == archived && + other.currency == currency && + other.monthlyContribution == monthlyContribution && + other.name == name && + other.note == note && + other.scope == scope && + other.targetAmount == targetAmount && + other.targetDate == targetDate; + + @override + int get hashCode => + (archived == null ? 0 : archived.hashCode) + + (currency == null ? 0 : currency.hashCode) + + (monthlyContribution == null ? 0 : monthlyContribution.hashCode) + + (name == null ? 0 : name.hashCode) + + (note == null ? 0 : note.hashCode) + + (scope == null ? 0 : scope.hashCode) + + (targetAmount == null ? 0 : targetAmount.hashCode) + + (targetDate == null ? 0 : targetDate.hashCode); + + factory GoalPatch.fromJson(Map json) => _$GoalPatchFromJson(json); + + Map toJson() => _$GoalPatchToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/goal_patch.g.dart b/app/packages/api_client/lib/src/model/goal_patch.g.dart new file mode 100644 index 0000000..60983f8 --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_patch.g.dart @@ -0,0 +1,178 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'goal_patch.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$GoalPatchCWProxy { + GoalPatch archived(bool? archived); + + GoalPatch currency(String? currency); + + GoalPatch monthlyContribution(String? monthlyContribution); + + GoalPatch name(String? name); + + GoalPatch note(String? note); + + GoalPatch scope(String? scope); + + GoalPatch targetAmount(String? targetAmount); + + GoalPatch targetDate(DateTime? targetDate); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalPatch(...).copyWith(id: 12, name: "My name") + /// ```` + GoalPatch call({ + bool? archived, + String? currency, + String? monthlyContribution, + String? name, + String? note, + String? scope, + String? targetAmount, + DateTime? targetDate, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalPatch.copyWith.fieldName(...)` +class _$GoalPatchCWProxyImpl implements _$GoalPatchCWProxy { + const _$GoalPatchCWProxyImpl(this._value); + + final GoalPatch _value; + + @override + GoalPatch archived(bool? archived) => this(archived: archived); + + @override + GoalPatch currency(String? currency) => this(currency: currency); + + @override + GoalPatch monthlyContribution(String? monthlyContribution) => + this(monthlyContribution: monthlyContribution); + + @override + GoalPatch name(String? name) => this(name: name); + + @override + GoalPatch note(String? note) => this(note: note); + + @override + GoalPatch scope(String? scope) => this(scope: scope); + + @override + GoalPatch targetAmount(String? targetAmount) => + this(targetAmount: targetAmount); + + @override + GoalPatch targetDate(DateTime? targetDate) => this(targetDate: targetDate); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalPatch(...).copyWith(id: 12, name: "My name") + /// ```` + GoalPatch call({ + Object? archived = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? monthlyContribution = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? scope = const $CopyWithPlaceholder(), + Object? targetAmount = const $CopyWithPlaceholder(), + Object? targetDate = const $CopyWithPlaceholder(), + }) { + return GoalPatch( + archived: archived == const $CopyWithPlaceholder() + ? _value.archived + // ignore: cast_nullable_to_non_nullable + : archived as bool?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + monthlyContribution: monthlyContribution == const $CopyWithPlaceholder() + ? _value.monthlyContribution + // ignore: cast_nullable_to_non_nullable + : monthlyContribution as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String?, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + scope: scope == const $CopyWithPlaceholder() + ? _value.scope + // ignore: cast_nullable_to_non_nullable + : scope as String?, + targetAmount: targetAmount == const $CopyWithPlaceholder() + ? _value.targetAmount + // ignore: cast_nullable_to_non_nullable + : targetAmount as String?, + targetDate: targetDate == const $CopyWithPlaceholder() + ? _value.targetDate + // ignore: cast_nullable_to_non_nullable + : targetDate as DateTime?, + ); + } +} + +extension $GoalPatchCopyWith on GoalPatch { + /// Returns a callable class that can be used as follows: `instanceOfGoalPatch.copyWith(...)` or like so:`instanceOfGoalPatch.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$GoalPatchCWProxy get copyWith => _$GoalPatchCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GoalPatch _$GoalPatchFromJson(Map json) => $checkedCreate( + 'GoalPatch', + json, + ($checkedConvert) { + final val = GoalPatch( + archived: $checkedConvert('archived', (v) => v as bool?), + currency: $checkedConvert('currency', (v) => v as String?), + monthlyContribution: $checkedConvert( + 'monthly_contribution', + (v) => v as String?, + ), + name: $checkedConvert('name', (v) => v as String?), + note: $checkedConvert('note', (v) => v as String?), + scope: $checkedConvert('scope', (v) => v as String?), + targetAmount: $checkedConvert('target_amount', (v) => v as String?), + targetDate: $checkedConvert( + 'target_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; + }, + fieldKeyMap: const { + 'monthlyContribution': 'monthly_contribution', + 'targetAmount': 'target_amount', + 'targetDate': 'target_date', + }, +); + +Map _$GoalPatchToJson(GoalPatch instance) => { + 'archived': ?instance.archived, + 'currency': ?instance.currency, + 'monthly_contribution': ?instance.monthlyContribution, + 'name': ?instance.name, + 'note': ?instance.note, + 'scope': ?instance.scope, + 'target_amount': ?instance.targetAmount, + 'target_date': ?instance.targetDate?.toIso8601String(), +}; diff --git a/app/packages/api_client/lib/src/model/goal_progress_out.dart b/app/packages/api_client/lib/src/model/goal_progress_out.dart new file mode 100644 index 0000000..9867f81 --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_progress_out.dart @@ -0,0 +1,207 @@ +// +// 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 'goal_progress_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class GoalProgressOut { + /// Returns a new [GoalProgressOut] instance. + GoalProgressOut({ + + required this.asOf, + + required this.assumedRate, + + required this.basis, + + required this.currentValueRub, + + required this.goalId, + + required this.monthlyNeededRub, + + required this.onTrack, + + required this.progress, + + required this.projectedDate, + + required this.targetAmountRub, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: false, + ) + + + final DateTime asOf; + + + + /// decimal as string + @JsonKey( + + name: r'assumed_rate', + required: true, + includeIfNull: true, + ) + + + final String? assumedRate; + + + + @JsonKey( + + name: r'basis', + required: true, + includeIfNull: false, + ) + + + final String basis; + + + + /// decimal as string + @JsonKey( + + name: r'current_value_rub', + required: true, + includeIfNull: false, + ) + + + final String currentValueRub; + + + + @JsonKey( + + name: r'goal_id', + required: true, + includeIfNull: false, + ) + + + final int goalId; + + + + /// decimal as string + @JsonKey( + + name: r'monthly_needed_rub', + required: true, + includeIfNull: true, + ) + + + final String? monthlyNeededRub; + + + + @JsonKey( + + name: r'on_track', + required: true, + includeIfNull: true, + ) + + + final bool? onTrack; + + + + /// decimal as string + @JsonKey( + + name: r'progress', + required: true, + includeIfNull: false, + ) + + + final String progress; + + + + @JsonKey( + + name: r'projected_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? projectedDate; + + + + /// decimal as string + @JsonKey( + + name: r'target_amount_rub', + required: true, + includeIfNull: false, + ) + + + final String targetAmountRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is GoalProgressOut && + other.asOf == asOf && + other.assumedRate == assumedRate && + other.basis == basis && + other.currentValueRub == currentValueRub && + other.goalId == goalId && + other.monthlyNeededRub == monthlyNeededRub && + other.onTrack == onTrack && + other.progress == progress && + other.projectedDate == projectedDate && + other.targetAmountRub == targetAmountRub; + + @override + int get hashCode => + asOf.hashCode + + (assumedRate == null ? 0 : assumedRate.hashCode) + + basis.hashCode + + currentValueRub.hashCode + + goalId.hashCode + + (monthlyNeededRub == null ? 0 : monthlyNeededRub.hashCode) + + (onTrack == null ? 0 : onTrack.hashCode) + + progress.hashCode + + (projectedDate == null ? 0 : projectedDate.hashCode) + + targetAmountRub.hashCode; + + factory GoalProgressOut.fromJson(Map json) => _$GoalProgressOutFromJson(json); + + Map toJson() => _$GoalProgressOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/goal_progress_out.g.dart b/app/packages/api_client/lib/src/model/goal_progress_out.g.dart new file mode 100644 index 0000000..c6433c5 --- /dev/null +++ b/app/packages/api_client/lib/src/model/goal_progress_out.g.dart @@ -0,0 +1,230 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'goal_progress_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$GoalProgressOutCWProxy { + GoalProgressOut asOf(DateTime asOf); + + GoalProgressOut assumedRate(String? assumedRate); + + GoalProgressOut basis(String basis); + + GoalProgressOut currentValueRub(String currentValueRub); + + GoalProgressOut goalId(int goalId); + + GoalProgressOut monthlyNeededRub(String? monthlyNeededRub); + + GoalProgressOut onTrack(bool? onTrack); + + GoalProgressOut progress(String progress); + + GoalProgressOut projectedDate(DateTime? projectedDate); + + GoalProgressOut targetAmountRub(String targetAmountRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalProgressOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalProgressOut(...).copyWith(id: 12, name: "My name") + /// ```` + GoalProgressOut call({ + DateTime asOf, + String? assumedRate, + String basis, + String currentValueRub, + int goalId, + String? monthlyNeededRub, + bool? onTrack, + String progress, + DateTime? projectedDate, + String targetAmountRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalProgressOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalProgressOut.copyWith.fieldName(...)` +class _$GoalProgressOutCWProxyImpl implements _$GoalProgressOutCWProxy { + const _$GoalProgressOutCWProxyImpl(this._value); + + final GoalProgressOut _value; + + @override + GoalProgressOut asOf(DateTime asOf) => this(asOf: asOf); + + @override + GoalProgressOut assumedRate(String? assumedRate) => + this(assumedRate: assumedRate); + + @override + GoalProgressOut basis(String basis) => this(basis: basis); + + @override + GoalProgressOut currentValueRub(String currentValueRub) => + this(currentValueRub: currentValueRub); + + @override + GoalProgressOut goalId(int goalId) => this(goalId: goalId); + + @override + GoalProgressOut monthlyNeededRub(String? monthlyNeededRub) => + this(monthlyNeededRub: monthlyNeededRub); + + @override + GoalProgressOut onTrack(bool? onTrack) => this(onTrack: onTrack); + + @override + GoalProgressOut progress(String progress) => this(progress: progress); + + @override + GoalProgressOut projectedDate(DateTime? projectedDate) => + this(projectedDate: projectedDate); + + @override + GoalProgressOut targetAmountRub(String targetAmountRub) => + this(targetAmountRub: targetAmountRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalProgressOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// GoalProgressOut(...).copyWith(id: 12, name: "My name") + /// ```` + GoalProgressOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? assumedRate = const $CopyWithPlaceholder(), + Object? basis = const $CopyWithPlaceholder(), + Object? currentValueRub = const $CopyWithPlaceholder(), + Object? goalId = const $CopyWithPlaceholder(), + Object? monthlyNeededRub = const $CopyWithPlaceholder(), + Object? onTrack = const $CopyWithPlaceholder(), + Object? progress = const $CopyWithPlaceholder(), + Object? projectedDate = const $CopyWithPlaceholder(), + Object? targetAmountRub = const $CopyWithPlaceholder(), + }) { + return GoalProgressOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime, + assumedRate: assumedRate == const $CopyWithPlaceholder() + ? _value.assumedRate + // ignore: cast_nullable_to_non_nullable + : assumedRate as String?, + basis: basis == const $CopyWithPlaceholder() + ? _value.basis + // ignore: cast_nullable_to_non_nullable + : basis as String, + currentValueRub: currentValueRub == const $CopyWithPlaceholder() + ? _value.currentValueRub + // ignore: cast_nullable_to_non_nullable + : currentValueRub as String, + goalId: goalId == const $CopyWithPlaceholder() + ? _value.goalId + // ignore: cast_nullable_to_non_nullable + : goalId as int, + monthlyNeededRub: monthlyNeededRub == const $CopyWithPlaceholder() + ? _value.monthlyNeededRub + // ignore: cast_nullable_to_non_nullable + : monthlyNeededRub as String?, + onTrack: onTrack == const $CopyWithPlaceholder() + ? _value.onTrack + // ignore: cast_nullable_to_non_nullable + : onTrack as bool?, + progress: progress == const $CopyWithPlaceholder() + ? _value.progress + // ignore: cast_nullable_to_non_nullable + : progress as String, + projectedDate: projectedDate == const $CopyWithPlaceholder() + ? _value.projectedDate + // ignore: cast_nullable_to_non_nullable + : projectedDate as DateTime?, + targetAmountRub: targetAmountRub == const $CopyWithPlaceholder() + ? _value.targetAmountRub + // ignore: cast_nullable_to_non_nullable + : targetAmountRub as String, + ); + } +} + +extension $GoalProgressOutCopyWith on GoalProgressOut { + /// Returns a callable class that can be used as follows: `instanceOfGoalProgressOut.copyWith(...)` or like so:`instanceOfGoalProgressOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$GoalProgressOutCWProxy get copyWith => _$GoalProgressOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +GoalProgressOut _$GoalProgressOutFromJson( + Map json, +) => $checkedCreate( + 'GoalProgressOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'as_of', + 'assumed_rate', + 'basis', + 'current_value_rub', + 'goal_id', + 'monthly_needed_rub', + 'on_track', + 'progress', + 'projected_date', + 'target_amount_rub', + ], + ); + final val = GoalProgressOut( + asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)), + assumedRate: $checkedConvert('assumed_rate', (v) => v as String?), + basis: $checkedConvert('basis', (v) => v as String), + currentValueRub: $checkedConvert('current_value_rub', (v) => v as String), + goalId: $checkedConvert('goal_id', (v) => (v as num).toInt()), + monthlyNeededRub: $checkedConvert( + 'monthly_needed_rub', + (v) => v as String?, + ), + onTrack: $checkedConvert('on_track', (v) => v as bool?), + progress: $checkedConvert('progress', (v) => v as String), + projectedDate: $checkedConvert( + 'projected_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + targetAmountRub: $checkedConvert('target_amount_rub', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'asOf': 'as_of', + 'assumedRate': 'assumed_rate', + 'currentValueRub': 'current_value_rub', + 'goalId': 'goal_id', + 'monthlyNeededRub': 'monthly_needed_rub', + 'onTrack': 'on_track', + 'projectedDate': 'projected_date', + 'targetAmountRub': 'target_amount_rub', + }, +); + +Map _$GoalProgressOutToJson(GoalProgressOut instance) => + { + 'as_of': instance.asOf.toIso8601String(), + 'assumed_rate': instance.assumedRate, + 'basis': instance.basis, + 'current_value_rub': instance.currentValueRub, + 'goal_id': instance.goalId, + 'monthly_needed_rub': instance.monthlyNeededRub, + 'on_track': instance.onTrack, + 'progress': instance.progress, + 'projected_date': instance.projectedDate?.toIso8601String(), + 'target_amount_rub': instance.targetAmountRub, + }; diff --git a/app/packages/api_client/lib/src/model/history_out.dart b/app/packages/api_client/lib/src/model/history_out.dart new file mode 100644 index 0000000..c65dceb --- /dev/null +++ b/app/packages/api_client/lib/src/model/history_out.dart @@ -0,0 +1,76 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/history_row.dart'; +import 'package:fintracker_api/src/model/history_totals.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'history_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HistoryOut { + /// Returns a new [HistoryOut] instance. + HistoryOut({ + + required this.rows, + + required this.totals, + }); + + @JsonKey( + + name: r'rows', + required: true, + includeIfNull: false, + ) + + + final List rows; + + + + @JsonKey( + + name: r'totals', + required: true, + includeIfNull: false, + ) + + + final HistoryTotals totals; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HistoryOut && + other.rows == rows && + other.totals == totals; + + @override + int get hashCode => + rows.hashCode + + totals.hashCode; + + factory HistoryOut.fromJson(Map json) => _$HistoryOutFromJson(json); + + Map toJson() => _$HistoryOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/history_out.g.dart b/app/packages/api_client/lib/src/model/history_out.g.dart new file mode 100644 index 0000000..991bc30 --- /dev/null +++ b/app/packages/api_client/lib/src/model/history_out.g.dart @@ -0,0 +1,91 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'history_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$HistoryOutCWProxy { + HistoryOut rows(List rows); + + HistoryOut totals(HistoryTotals totals); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HistoryOut(...).copyWith(id: 12, name: "My name") + /// ```` + HistoryOut call({List rows, HistoryTotals totals}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryOut.copyWith.fieldName(...)` +class _$HistoryOutCWProxyImpl implements _$HistoryOutCWProxy { + const _$HistoryOutCWProxyImpl(this._value); + + final HistoryOut _value; + + @override + HistoryOut rows(List rows) => this(rows: rows); + + @override + HistoryOut totals(HistoryTotals totals) => this(totals: totals); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HistoryOut(...).copyWith(id: 12, name: "My name") + /// ```` + HistoryOut call({ + Object? rows = const $CopyWithPlaceholder(), + Object? totals = const $CopyWithPlaceholder(), + }) { + return HistoryOut( + rows: rows == const $CopyWithPlaceholder() + ? _value.rows + // ignore: cast_nullable_to_non_nullable + : rows as List, + totals: totals == const $CopyWithPlaceholder() + ? _value.totals + // ignore: cast_nullable_to_non_nullable + : totals as HistoryTotals, + ); + } +} + +extension $HistoryOutCopyWith on HistoryOut { + /// Returns a callable class that can be used as follows: `instanceOfHistoryOut.copyWith(...)` or like so:`instanceOfHistoryOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$HistoryOutCWProxy get copyWith => _$HistoryOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HistoryOut _$HistoryOutFromJson(Map json) => + $checkedCreate('HistoryOut', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['rows', 'totals']); + final val = HistoryOut( + rows: $checkedConvert( + 'rows', + (v) => (v as List) + .map((e) => HistoryRow.fromJson(e as Map)) + .toList(), + ), + totals: $checkedConvert( + 'totals', + (v) => HistoryTotals.fromJson(v as Map), + ), + ); + return val; + }); + +Map _$HistoryOutToJson(HistoryOut instance) => + { + 'rows': instance.rows.map((e) => e.toJson()).toList(), + 'totals': instance.totals.toJson(), + }; diff --git a/app/packages/api_client/lib/src/model/history_row.dart b/app/packages/api_client/lib/src/model/history_row.dart new file mode 100644 index 0000000..45fbf4e --- /dev/null +++ b/app/packages/api_client/lib/src/model/history_row.dart @@ -0,0 +1,157 @@ +// +// 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 'history_row.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HistoryRow { + /// Returns a new [HistoryRow] instance. + HistoryRow({ + + required this.amount, + + required this.amountRub, + + required this.currency, + + required this.kind, + + required this.month, + + required this.paymentCount, + + required this.taxWithheld, + }); + + /// 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'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'month', + required: true, + includeIfNull: false, + ) + + + final DateTime month; + + + + @JsonKey( + + name: r'payment_count', + required: true, + includeIfNull: false, + ) + + + final int paymentCount; + + + + /// decimal as string + @JsonKey( + + name: r'tax_withheld', + required: true, + includeIfNull: false, + ) + + + final String taxWithheld; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HistoryRow && + other.amount == amount && + other.amountRub == amountRub && + other.currency == currency && + other.kind == kind && + other.month == month && + other.paymentCount == paymentCount && + other.taxWithheld == taxWithheld; + + @override + int get hashCode => + amount.hashCode + + (amountRub == null ? 0 : amountRub.hashCode) + + currency.hashCode + + kind.hashCode + + month.hashCode + + paymentCount.hashCode + + taxWithheld.hashCode; + + factory HistoryRow.fromJson(Map json) => _$HistoryRowFromJson(json); + + Map toJson() => _$HistoryRowToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/history_row.g.dart b/app/packages/api_client/lib/src/model/history_row.g.dart new file mode 100644 index 0000000..732a7e0 --- /dev/null +++ b/app/packages/api_client/lib/src/model/history_row.g.dart @@ -0,0 +1,170 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'history_row.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$HistoryRowCWProxy { + HistoryRow amount(String amount); + + HistoryRow amountRub(String? amountRub); + + HistoryRow currency(String currency); + + HistoryRow kind(String kind); + + HistoryRow month(DateTime month); + + HistoryRow paymentCount(int paymentCount); + + HistoryRow taxWithheld(String taxWithheld); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HistoryRow(...).copyWith(id: 12, name: "My name") + /// ```` + HistoryRow call({ + String amount, + String? amountRub, + String currency, + String kind, + DateTime month, + int paymentCount, + String taxWithheld, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryRow.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryRow.copyWith.fieldName(...)` +class _$HistoryRowCWProxyImpl implements _$HistoryRowCWProxy { + const _$HistoryRowCWProxyImpl(this._value); + + final HistoryRow _value; + + @override + HistoryRow amount(String amount) => this(amount: amount); + + @override + HistoryRow amountRub(String? amountRub) => this(amountRub: amountRub); + + @override + HistoryRow currency(String currency) => this(currency: currency); + + @override + HistoryRow kind(String kind) => this(kind: kind); + + @override + HistoryRow month(DateTime month) => this(month: month); + + @override + HistoryRow paymentCount(int paymentCount) => this(paymentCount: paymentCount); + + @override + HistoryRow taxWithheld(String taxWithheld) => this(taxWithheld: taxWithheld); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HistoryRow(...).copyWith(id: 12, name: "My name") + /// ```` + HistoryRow call({ + Object? amount = const $CopyWithPlaceholder(), + Object? amountRub = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? month = const $CopyWithPlaceholder(), + Object? paymentCount = const $CopyWithPlaceholder(), + Object? taxWithheld = const $CopyWithPlaceholder(), + }) { + return HistoryRow( + 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, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + month: month == const $CopyWithPlaceholder() + ? _value.month + // ignore: cast_nullable_to_non_nullable + : month as DateTime, + paymentCount: paymentCount == const $CopyWithPlaceholder() + ? _value.paymentCount + // ignore: cast_nullable_to_non_nullable + : paymentCount as int, + taxWithheld: taxWithheld == const $CopyWithPlaceholder() + ? _value.taxWithheld + // ignore: cast_nullable_to_non_nullable + : taxWithheld as String, + ); + } +} + +extension $HistoryRowCopyWith on HistoryRow { + /// Returns a callable class that can be used as follows: `instanceOfHistoryRow.copyWith(...)` or like so:`instanceOfHistoryRow.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$HistoryRowCWProxy get copyWith => _$HistoryRowCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HistoryRow _$HistoryRowFromJson(Map json) => $checkedCreate( + 'HistoryRow', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'amount', + 'amount_rub', + 'currency', + 'kind', + 'month', + 'payment_count', + 'tax_withheld', + ], + ); + final val = HistoryRow( + amount: $checkedConvert('amount', (v) => v as String), + amountRub: $checkedConvert('amount_rub', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String), + kind: $checkedConvert('kind', (v) => v as String), + month: $checkedConvert('month', (v) => DateTime.parse(v as String)), + paymentCount: $checkedConvert('payment_count', (v) => (v as num).toInt()), + taxWithheld: $checkedConvert('tax_withheld', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'amountRub': 'amount_rub', + 'paymentCount': 'payment_count', + 'taxWithheld': 'tax_withheld', + }, +); + +Map _$HistoryRowToJson(HistoryRow instance) => + { + 'amount': instance.amount, + 'amount_rub': instance.amountRub, + 'currency': instance.currency, + 'kind': instance.kind, + 'month': instance.month.toIso8601String(), + 'payment_count': instance.paymentCount, + 'tax_withheld': instance.taxWithheld, + }; diff --git a/app/packages/api_client/lib/src/model/history_totals.dart b/app/packages/api_client/lib/src/model/history_totals.dart new file mode 100644 index 0000000..bce0b34 --- /dev/null +++ b/app/packages/api_client/lib/src/model/history_totals.dart @@ -0,0 +1,76 @@ +// +// 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 'history_totals.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class HistoryTotals { + /// Returns a new [HistoryTotals] instance. + HistoryTotals({ + + required this.amountRub, + + required this.taxWithheldRub, + }); + + /// decimal as string + @JsonKey( + + name: r'amount_rub', + required: true, + includeIfNull: false, + ) + + + final String amountRub; + + + + /// decimal as string + @JsonKey( + + name: r'tax_withheld_rub', + required: true, + includeIfNull: false, + ) + + + final String taxWithheldRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is HistoryTotals && + other.amountRub == amountRub && + other.taxWithheldRub == taxWithheldRub; + + @override + int get hashCode => + amountRub.hashCode + + taxWithheldRub.hashCode; + + factory HistoryTotals.fromJson(Map json) => _$HistoryTotalsFromJson(json); + + Map toJson() => _$HistoryTotalsToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/history_totals.g.dart b/app/packages/api_client/lib/src/model/history_totals.g.dart new file mode 100644 index 0000000..bb55b9a --- /dev/null +++ b/app/packages/api_client/lib/src/model/history_totals.g.dart @@ -0,0 +1,93 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'history_totals.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$HistoryTotalsCWProxy { + HistoryTotals amountRub(String amountRub); + + HistoryTotals taxWithheldRub(String taxWithheldRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HistoryTotals(...).copyWith(id: 12, name: "My name") + /// ```` + HistoryTotals call({String amountRub, String taxWithheldRub}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryTotals.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryTotals.copyWith.fieldName(...)` +class _$HistoryTotalsCWProxyImpl implements _$HistoryTotalsCWProxy { + const _$HistoryTotalsCWProxyImpl(this._value); + + final HistoryTotals _value; + + @override + HistoryTotals amountRub(String amountRub) => this(amountRub: amountRub); + + @override + HistoryTotals taxWithheldRub(String taxWithheldRub) => + this(taxWithheldRub: taxWithheldRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// HistoryTotals(...).copyWith(id: 12, name: "My name") + /// ```` + HistoryTotals call({ + Object? amountRub = const $CopyWithPlaceholder(), + Object? taxWithheldRub = const $CopyWithPlaceholder(), + }) { + return HistoryTotals( + amountRub: amountRub == const $CopyWithPlaceholder() + ? _value.amountRub + // ignore: cast_nullable_to_non_nullable + : amountRub as String, + taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder() + ? _value.taxWithheldRub + // ignore: cast_nullable_to_non_nullable + : taxWithheldRub as String, + ); + } +} + +extension $HistoryTotalsCopyWith on HistoryTotals { + /// Returns a callable class that can be used as follows: `instanceOfHistoryTotals.copyWith(...)` or like so:`instanceOfHistoryTotals.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$HistoryTotalsCWProxy get copyWith => _$HistoryTotalsCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HistoryTotals _$HistoryTotalsFromJson( + Map json, +) => $checkedCreate( + 'HistoryTotals', + json, + ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['amount_rub', 'tax_withheld_rub']); + final val = HistoryTotals( + amountRub: $checkedConvert('amount_rub', (v) => v as String), + taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'amountRub': 'amount_rub', + 'taxWithheldRub': 'tax_withheld_rub', + }, +); + +Map _$HistoryTotalsToJson(HistoryTotals instance) => + { + 'amount_rub': instance.amountRub, + 'tax_withheld_rub': instance.taxWithheldRub, + }; diff --git a/app/packages/api_client/lib/src/model/import_counts.dart b/app/packages/api_client/lib/src/model/import_counts.dart new file mode 100644 index 0000000..b20dcf4 --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_counts.dart @@ -0,0 +1,154 @@ +// +// 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 'import_counts.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ImportCounts { + /// Returns a new [ImportCounts] instance. + ImportCounts({ + + required this.byKind, + + required this.eventsDuplicate, + + required this.eventsNew, + + required this.eventsPending, + + required this.eventsShadow, + + required this.eventsTotal, + + required this.lines, + }); + + @JsonKey( + + name: r'by_kind', + required: true, + includeIfNull: false, + ) + + + final Map byKind; + + + + @JsonKey( + + name: r'events_duplicate', + required: true, + includeIfNull: false, + ) + + + final int eventsDuplicate; + + + + @JsonKey( + + name: r'events_new', + required: true, + includeIfNull: false, + ) + + + final int eventsNew; + + + + @JsonKey( + + name: r'events_pending', + required: true, + includeIfNull: false, + ) + + + final int eventsPending; + + + + @JsonKey( + + name: r'events_shadow', + required: true, + includeIfNull: false, + ) + + + final int eventsShadow; + + + + @JsonKey( + + name: r'events_total', + required: true, + includeIfNull: false, + ) + + + final int eventsTotal; + + + + @JsonKey( + + name: r'lines', + required: true, + includeIfNull: false, + ) + + + final int lines; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ImportCounts && + other.byKind == byKind && + other.eventsDuplicate == eventsDuplicate && + other.eventsNew == eventsNew && + other.eventsPending == eventsPending && + other.eventsShadow == eventsShadow && + other.eventsTotal == eventsTotal && + other.lines == lines; + + @override + int get hashCode => + byKind.hashCode + + eventsDuplicate.hashCode + + eventsNew.hashCode + + eventsPending.hashCode + + eventsShadow.hashCode + + eventsTotal.hashCode + + lines.hashCode; + + factory ImportCounts.fromJson(Map json) => _$ImportCountsFromJson(json); + + Map toJson() => _$ImportCountsToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/import_counts.g.dart b/app/packages/api_client/lib/src/model/import_counts.g.dart new file mode 100644 index 0000000..11dcb35 --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_counts.g.dart @@ -0,0 +1,187 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'import_counts.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ImportCountsCWProxy { + ImportCounts byKind(Map byKind); + + ImportCounts eventsDuplicate(int eventsDuplicate); + + ImportCounts eventsNew(int eventsNew); + + ImportCounts eventsPending(int eventsPending); + + ImportCounts eventsShadow(int eventsShadow); + + ImportCounts eventsTotal(int eventsTotal); + + ImportCounts lines(int lines); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportCounts(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportCounts(...).copyWith(id: 12, name: "My name") + /// ```` + ImportCounts call({ + Map byKind, + int eventsDuplicate, + int eventsNew, + int eventsPending, + int eventsShadow, + int eventsTotal, + int lines, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportCounts.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportCounts.copyWith.fieldName(...)` +class _$ImportCountsCWProxyImpl implements _$ImportCountsCWProxy { + const _$ImportCountsCWProxyImpl(this._value); + + final ImportCounts _value; + + @override + ImportCounts byKind(Map byKind) => this(byKind: byKind); + + @override + ImportCounts eventsDuplicate(int eventsDuplicate) => + this(eventsDuplicate: eventsDuplicate); + + @override + ImportCounts eventsNew(int eventsNew) => this(eventsNew: eventsNew); + + @override + ImportCounts eventsPending(int eventsPending) => + this(eventsPending: eventsPending); + + @override + ImportCounts eventsShadow(int eventsShadow) => + this(eventsShadow: eventsShadow); + + @override + ImportCounts eventsTotal(int eventsTotal) => this(eventsTotal: eventsTotal); + + @override + ImportCounts lines(int lines) => this(lines: lines); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportCounts(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportCounts(...).copyWith(id: 12, name: "My name") + /// ```` + ImportCounts call({ + Object? byKind = const $CopyWithPlaceholder(), + Object? eventsDuplicate = const $CopyWithPlaceholder(), + Object? eventsNew = const $CopyWithPlaceholder(), + Object? eventsPending = const $CopyWithPlaceholder(), + Object? eventsShadow = const $CopyWithPlaceholder(), + Object? eventsTotal = const $CopyWithPlaceholder(), + Object? lines = const $CopyWithPlaceholder(), + }) { + return ImportCounts( + byKind: byKind == const $CopyWithPlaceholder() + ? _value.byKind + // ignore: cast_nullable_to_non_nullable + : byKind as Map, + eventsDuplicate: eventsDuplicate == const $CopyWithPlaceholder() + ? _value.eventsDuplicate + // ignore: cast_nullable_to_non_nullable + : eventsDuplicate as int, + eventsNew: eventsNew == const $CopyWithPlaceholder() + ? _value.eventsNew + // ignore: cast_nullable_to_non_nullable + : eventsNew as int, + eventsPending: eventsPending == const $CopyWithPlaceholder() + ? _value.eventsPending + // ignore: cast_nullable_to_non_nullable + : eventsPending as int, + eventsShadow: eventsShadow == const $CopyWithPlaceholder() + ? _value.eventsShadow + // ignore: cast_nullable_to_non_nullable + : eventsShadow as int, + eventsTotal: eventsTotal == const $CopyWithPlaceholder() + ? _value.eventsTotal + // ignore: cast_nullable_to_non_nullable + : eventsTotal as int, + lines: lines == const $CopyWithPlaceholder() + ? _value.lines + // ignore: cast_nullable_to_non_nullable + : lines as int, + ); + } +} + +extension $ImportCountsCopyWith on ImportCounts { + /// Returns a callable class that can be used as follows: `instanceOfImportCounts.copyWith(...)` or like so:`instanceOfImportCounts.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ImportCountsCWProxy get copyWith => _$ImportCountsCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ImportCounts _$ImportCountsFromJson( + Map json, +) => $checkedCreate( + 'ImportCounts', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'by_kind', + 'events_duplicate', + 'events_new', + 'events_pending', + 'events_shadow', + 'events_total', + 'lines', + ], + ); + final val = ImportCounts( + byKind: $checkedConvert( + 'by_kind', + (v) => Map.from(v as Map), + ), + eventsDuplicate: $checkedConvert( + 'events_duplicate', + (v) => (v as num).toInt(), + ), + eventsNew: $checkedConvert('events_new', (v) => (v as num).toInt()), + eventsPending: $checkedConvert( + 'events_pending', + (v) => (v as num).toInt(), + ), + eventsShadow: $checkedConvert('events_shadow', (v) => (v as num).toInt()), + eventsTotal: $checkedConvert('events_total', (v) => (v as num).toInt()), + lines: $checkedConvert('lines', (v) => (v as num).toInt()), + ); + return val; + }, + fieldKeyMap: const { + 'byKind': 'by_kind', + 'eventsDuplicate': 'events_duplicate', + 'eventsNew': 'events_new', + 'eventsPending': 'events_pending', + 'eventsShadow': 'events_shadow', + 'eventsTotal': 'events_total', + }, +); + +Map _$ImportCountsToJson(ImportCounts instance) => + { + 'by_kind': instance.byKind, + 'events_duplicate': instance.eventsDuplicate, + 'events_new': instance.eventsNew, + 'events_pending': instance.eventsPending, + 'events_shadow': instance.eventsShadow, + 'events_total': instance.eventsTotal, + 'lines': instance.lines, + }; diff --git a/app/packages/api_client/lib/src/model/import_preview.dart b/app/packages/api_client/lib/src/model/import_preview.dart new file mode 100644 index 0000000..d8f96b1 --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_preview.dart @@ -0,0 +1,415 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/pending_instrument_out.dart'; +import 'package:fintracker_api/src/model/import_counts.dart'; +import 'package:fintracker_api/src/model/sample_event_out.dart'; +import 'package:fintracker_api/src/model/reconciliation_out.dart'; +import 'package:fintracker_api/src/model/account_suggestion.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'import_preview.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ImportPreview { + /// Returns a new [ImportPreview] instance. + ImportPreview({ + + this.accountExternalId, + + this.accountId, + + this.accountName, + + this.accountSuggestions, + + required this.broker, + + this.committedAt, + + required this.counts, + + this.duplicateOfId, + + this.error, + + required this.filename, + + required this.id, + + required this.parseStatus, + + this.parserName, + + this.parserVersion, + + this.pendingInstruments, + + this.periodFrom, + + this.periodTo, + + required this.reconciliation, + + this.sampleEvents, + + required this.sha256, + + required this.sizeBytes, + + this.uploadedAt, + + this.warnings, + }); + + @JsonKey( + + name: r'account_external_id', + required: false, + includeIfNull: false, + ) + + + final String? accountExternalId; + + + + @JsonKey( + + name: r'account_id', + required: false, + includeIfNull: false, + ) + + + final int? accountId; + + + + @JsonKey( + + name: r'account_name', + required: false, + includeIfNull: false, + ) + + + final String? accountName; + + + + @JsonKey( + + name: r'account_suggestions', + required: false, + includeIfNull: false, + ) + + + final List? accountSuggestions; + + + + @JsonKey( + + name: r'broker', + required: true, + includeIfNull: false, + ) + + + final String broker; + + + + @JsonKey( + + name: r'committed_at', + required: false, + includeIfNull: false, + ) + + + final DateTime? committedAt; + + + + @JsonKey( + + name: r'counts', + required: true, + includeIfNull: false, + ) + + + final ImportCounts counts; + + + + @JsonKey( + + name: r'duplicate_of_id', + required: false, + includeIfNull: false, + ) + + + final int? duplicateOfId; + + + + @JsonKey( + + name: r'error', + required: false, + includeIfNull: false, + ) + + + final String? error; + + + + @JsonKey( + + name: r'filename', + required: true, + includeIfNull: false, + ) + + + final String filename; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'parse_status', + required: true, + includeIfNull: false, + ) + + + final String parseStatus; + + + + @JsonKey( + + name: r'parser_name', + required: false, + includeIfNull: false, + ) + + + final String? parserName; + + + + @JsonKey( + + name: r'parser_version', + required: false, + includeIfNull: false, + ) + + + final String? parserVersion; + + + + @JsonKey( + + name: r'pending_instruments', + required: false, + includeIfNull: false, + ) + + + final List? pendingInstruments; + + + + @JsonKey( + + name: r'period_from', + required: false, + includeIfNull: false, + ) + + + final DateTime? periodFrom; + + + + @JsonKey( + + name: r'period_to', + required: false, + includeIfNull: false, + ) + + + final DateTime? periodTo; + + + + @JsonKey( + + name: r'reconciliation', + required: true, + includeIfNull: false, + ) + + + final ReconciliationOut reconciliation; + + + + @JsonKey( + + name: r'sample_events', + required: false, + includeIfNull: false, + ) + + + final List? sampleEvents; + + + + @JsonKey( + + name: r'sha256', + required: true, + includeIfNull: false, + ) + + + final String sha256; + + + + @JsonKey( + + name: r'size_bytes', + required: true, + includeIfNull: false, + ) + + + final int sizeBytes; + + + + @JsonKey( + + name: r'uploaded_at', + required: false, + includeIfNull: false, + ) + + + final DateTime? uploadedAt; + + + + @JsonKey( + + name: r'warnings', + required: false, + includeIfNull: false, + ) + + + final List? warnings; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ImportPreview && + other.accountExternalId == accountExternalId && + other.accountId == accountId && + other.accountName == accountName && + other.accountSuggestions == accountSuggestions && + other.broker == broker && + other.committedAt == committedAt && + other.counts == counts && + other.duplicateOfId == duplicateOfId && + other.error == error && + other.filename == filename && + other.id == id && + other.parseStatus == parseStatus && + other.parserName == parserName && + other.parserVersion == parserVersion && + other.pendingInstruments == pendingInstruments && + other.periodFrom == periodFrom && + other.periodTo == periodTo && + other.reconciliation == reconciliation && + other.sampleEvents == sampleEvents && + other.sha256 == sha256 && + other.sizeBytes == sizeBytes && + other.uploadedAt == uploadedAt && + other.warnings == warnings; + + @override + int get hashCode => + (accountExternalId == null ? 0 : accountExternalId.hashCode) + + (accountId == null ? 0 : accountId.hashCode) + + (accountName == null ? 0 : accountName.hashCode) + + accountSuggestions.hashCode + + broker.hashCode + + (committedAt == null ? 0 : committedAt.hashCode) + + counts.hashCode + + (duplicateOfId == null ? 0 : duplicateOfId.hashCode) + + (error == null ? 0 : error.hashCode) + + filename.hashCode + + id.hashCode + + parseStatus.hashCode + + (parserName == null ? 0 : parserName.hashCode) + + (parserVersion == null ? 0 : parserVersion.hashCode) + + pendingInstruments.hashCode + + (periodFrom == null ? 0 : periodFrom.hashCode) + + (periodTo == null ? 0 : periodTo.hashCode) + + reconciliation.hashCode + + sampleEvents.hashCode + + sha256.hashCode + + sizeBytes.hashCode + + (uploadedAt == null ? 0 : uploadedAt.hashCode) + + warnings.hashCode; + + factory ImportPreview.fromJson(Map json) => _$ImportPreviewFromJson(json); + + Map toJson() => _$ImportPreviewToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/import_preview.g.dart b/app/packages/api_client/lib/src/model/import_preview.g.dart new file mode 100644 index 0000000..82568d7 --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_preview.g.dart @@ -0,0 +1,459 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'import_preview.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ImportPreviewCWProxy { + ImportPreview accountExternalId(String? accountExternalId); + + ImportPreview accountId(int? accountId); + + ImportPreview accountName(String? accountName); + + ImportPreview accountSuggestions(List? accountSuggestions); + + ImportPreview broker(String broker); + + ImportPreview committedAt(DateTime? committedAt); + + ImportPreview counts(ImportCounts counts); + + ImportPreview duplicateOfId(int? duplicateOfId); + + ImportPreview error(String? error); + + ImportPreview filename(String filename); + + ImportPreview id(int id); + + ImportPreview parseStatus(String parseStatus); + + ImportPreview parserName(String? parserName); + + ImportPreview parserVersion(String? parserVersion); + + ImportPreview pendingInstruments( + List? pendingInstruments, + ); + + ImportPreview periodFrom(DateTime? periodFrom); + + ImportPreview periodTo(DateTime? periodTo); + + ImportPreview reconciliation(ReconciliationOut reconciliation); + + ImportPreview sampleEvents(List? sampleEvents); + + ImportPreview sha256(String sha256); + + ImportPreview sizeBytes(int sizeBytes); + + ImportPreview uploadedAt(DateTime? uploadedAt); + + ImportPreview warnings(List? warnings); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportPreview(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportPreview(...).copyWith(id: 12, name: "My name") + /// ```` + ImportPreview call({ + String? accountExternalId, + int? accountId, + String? accountName, + List? accountSuggestions, + String broker, + DateTime? committedAt, + ImportCounts counts, + int? duplicateOfId, + String? error, + String filename, + int id, + String parseStatus, + String? parserName, + String? parserVersion, + List? pendingInstruments, + DateTime? periodFrom, + DateTime? periodTo, + ReconciliationOut reconciliation, + List? sampleEvents, + String sha256, + int sizeBytes, + DateTime? uploadedAt, + List? warnings, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportPreview.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportPreview.copyWith.fieldName(...)` +class _$ImportPreviewCWProxyImpl implements _$ImportPreviewCWProxy { + const _$ImportPreviewCWProxyImpl(this._value); + + final ImportPreview _value; + + @override + ImportPreview accountExternalId(String? accountExternalId) => + this(accountExternalId: accountExternalId); + + @override + ImportPreview accountId(int? accountId) => this(accountId: accountId); + + @override + ImportPreview accountName(String? accountName) => + this(accountName: accountName); + + @override + ImportPreview accountSuggestions( + List? accountSuggestions, + ) => this(accountSuggestions: accountSuggestions); + + @override + ImportPreview broker(String broker) => this(broker: broker); + + @override + ImportPreview committedAt(DateTime? committedAt) => + this(committedAt: committedAt); + + @override + ImportPreview counts(ImportCounts counts) => this(counts: counts); + + @override + ImportPreview duplicateOfId(int? duplicateOfId) => + this(duplicateOfId: duplicateOfId); + + @override + ImportPreview error(String? error) => this(error: error); + + @override + ImportPreview filename(String filename) => this(filename: filename); + + @override + ImportPreview id(int id) => this(id: id); + + @override + ImportPreview parseStatus(String parseStatus) => + this(parseStatus: parseStatus); + + @override + ImportPreview parserName(String? parserName) => this(parserName: parserName); + + @override + ImportPreview parserVersion(String? parserVersion) => + this(parserVersion: parserVersion); + + @override + ImportPreview pendingInstruments( + List? pendingInstruments, + ) => this(pendingInstruments: pendingInstruments); + + @override + ImportPreview periodFrom(DateTime? periodFrom) => + this(periodFrom: periodFrom); + + @override + ImportPreview periodTo(DateTime? periodTo) => this(periodTo: periodTo); + + @override + ImportPreview reconciliation(ReconciliationOut reconciliation) => + this(reconciliation: reconciliation); + + @override + ImportPreview sampleEvents(List? sampleEvents) => + this(sampleEvents: sampleEvents); + + @override + ImportPreview sha256(String sha256) => this(sha256: sha256); + + @override + ImportPreview sizeBytes(int sizeBytes) => this(sizeBytes: sizeBytes); + + @override + ImportPreview uploadedAt(DateTime? uploadedAt) => + this(uploadedAt: uploadedAt); + + @override + ImportPreview warnings(List? warnings) => this(warnings: warnings); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportPreview(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportPreview(...).copyWith(id: 12, name: "My name") + /// ```` + ImportPreview call({ + Object? accountExternalId = const $CopyWithPlaceholder(), + Object? accountId = const $CopyWithPlaceholder(), + Object? accountName = const $CopyWithPlaceholder(), + Object? accountSuggestions = const $CopyWithPlaceholder(), + Object? broker = const $CopyWithPlaceholder(), + Object? committedAt = const $CopyWithPlaceholder(), + Object? counts = const $CopyWithPlaceholder(), + Object? duplicateOfId = const $CopyWithPlaceholder(), + Object? error = const $CopyWithPlaceholder(), + Object? filename = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? parseStatus = const $CopyWithPlaceholder(), + Object? parserName = const $CopyWithPlaceholder(), + Object? parserVersion = const $CopyWithPlaceholder(), + Object? pendingInstruments = const $CopyWithPlaceholder(), + Object? periodFrom = const $CopyWithPlaceholder(), + Object? periodTo = const $CopyWithPlaceholder(), + Object? reconciliation = const $CopyWithPlaceholder(), + Object? sampleEvents = const $CopyWithPlaceholder(), + Object? sha256 = const $CopyWithPlaceholder(), + Object? sizeBytes = const $CopyWithPlaceholder(), + Object? uploadedAt = const $CopyWithPlaceholder(), + Object? warnings = const $CopyWithPlaceholder(), + }) { + return ImportPreview( + accountExternalId: accountExternalId == const $CopyWithPlaceholder() + ? _value.accountExternalId + // ignore: cast_nullable_to_non_nullable + : accountExternalId as String?, + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int?, + accountName: accountName == const $CopyWithPlaceholder() + ? _value.accountName + // ignore: cast_nullable_to_non_nullable + : accountName as String?, + accountSuggestions: accountSuggestions == const $CopyWithPlaceholder() + ? _value.accountSuggestions + // ignore: cast_nullable_to_non_nullable + : accountSuggestions as List?, + broker: broker == const $CopyWithPlaceholder() + ? _value.broker + // ignore: cast_nullable_to_non_nullable + : broker as String, + committedAt: committedAt == const $CopyWithPlaceholder() + ? _value.committedAt + // ignore: cast_nullable_to_non_nullable + : committedAt as DateTime?, + counts: counts == const $CopyWithPlaceholder() + ? _value.counts + // ignore: cast_nullable_to_non_nullable + : counts as ImportCounts, + duplicateOfId: duplicateOfId == const $CopyWithPlaceholder() + ? _value.duplicateOfId + // ignore: cast_nullable_to_non_nullable + : duplicateOfId as int?, + error: error == const $CopyWithPlaceholder() + ? _value.error + // ignore: cast_nullable_to_non_nullable + : error as String?, + filename: filename == const $CopyWithPlaceholder() + ? _value.filename + // ignore: cast_nullable_to_non_nullable + : filename as String, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + parseStatus: parseStatus == const $CopyWithPlaceholder() + ? _value.parseStatus + // ignore: cast_nullable_to_non_nullable + : parseStatus as String, + parserName: parserName == const $CopyWithPlaceholder() + ? _value.parserName + // ignore: cast_nullable_to_non_nullable + : parserName as String?, + parserVersion: parserVersion == const $CopyWithPlaceholder() + ? _value.parserVersion + // ignore: cast_nullable_to_non_nullable + : parserVersion as String?, + pendingInstruments: pendingInstruments == const $CopyWithPlaceholder() + ? _value.pendingInstruments + // ignore: cast_nullable_to_non_nullable + : pendingInstruments as List?, + periodFrom: periodFrom == const $CopyWithPlaceholder() + ? _value.periodFrom + // ignore: cast_nullable_to_non_nullable + : periodFrom as DateTime?, + periodTo: periodTo == const $CopyWithPlaceholder() + ? _value.periodTo + // ignore: cast_nullable_to_non_nullable + : periodTo as DateTime?, + reconciliation: reconciliation == const $CopyWithPlaceholder() + ? _value.reconciliation + // ignore: cast_nullable_to_non_nullable + : reconciliation as ReconciliationOut, + sampleEvents: sampleEvents == const $CopyWithPlaceholder() + ? _value.sampleEvents + // ignore: cast_nullable_to_non_nullable + : sampleEvents as List?, + sha256: sha256 == const $CopyWithPlaceholder() + ? _value.sha256 + // ignore: cast_nullable_to_non_nullable + : sha256 as String, + sizeBytes: sizeBytes == const $CopyWithPlaceholder() + ? _value.sizeBytes + // ignore: cast_nullable_to_non_nullable + : sizeBytes as int, + uploadedAt: uploadedAt == const $CopyWithPlaceholder() + ? _value.uploadedAt + // ignore: cast_nullable_to_non_nullable + : uploadedAt as DateTime?, + warnings: warnings == const $CopyWithPlaceholder() + ? _value.warnings + // ignore: cast_nullable_to_non_nullable + : warnings as List?, + ); + } +} + +extension $ImportPreviewCopyWith on ImportPreview { + /// Returns a callable class that can be used as follows: `instanceOfImportPreview.copyWith(...)` or like so:`instanceOfImportPreview.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ImportPreviewCWProxy get copyWith => _$ImportPreviewCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ImportPreview _$ImportPreviewFromJson(Map json) => + $checkedCreate( + 'ImportPreview', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'broker', + 'counts', + 'filename', + 'id', + 'parse_status', + 'reconciliation', + 'sha256', + 'size_bytes', + ], + ); + final val = ImportPreview( + accountExternalId: $checkedConvert( + 'account_external_id', + (v) => v as String?, + ), + accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()), + accountName: $checkedConvert('account_name', (v) => v as String?), + accountSuggestions: $checkedConvert( + 'account_suggestions', + (v) => (v as List?) + ?.map( + (e) => AccountSuggestion.fromJson(e as Map), + ) + .toList(), + ), + broker: $checkedConvert('broker', (v) => v as String), + committedAt: $checkedConvert( + 'committed_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + counts: $checkedConvert( + 'counts', + (v) => ImportCounts.fromJson(v as Map), + ), + duplicateOfId: $checkedConvert( + 'duplicate_of_id', + (v) => (v as num?)?.toInt(), + ), + error: $checkedConvert('error', (v) => v as String?), + filename: $checkedConvert('filename', (v) => v as String), + id: $checkedConvert('id', (v) => (v as num).toInt()), + parseStatus: $checkedConvert('parse_status', (v) => v as String), + parserName: $checkedConvert('parser_name', (v) => v as String?), + parserVersion: $checkedConvert('parser_version', (v) => v as String?), + pendingInstruments: $checkedConvert( + 'pending_instruments', + (v) => (v as List?) + ?.map( + (e) => + PendingInstrumentOut.fromJson(e as Map), + ) + .toList(), + ), + periodFrom: $checkedConvert( + 'period_from', + (v) => v == null ? null : DateTime.parse(v as String), + ), + periodTo: $checkedConvert( + 'period_to', + (v) => v == null ? null : DateTime.parse(v as String), + ), + reconciliation: $checkedConvert( + 'reconciliation', + (v) => ReconciliationOut.fromJson(v as Map), + ), + sampleEvents: $checkedConvert( + 'sample_events', + (v) => (v as List?) + ?.map((e) => SampleEventOut.fromJson(e as Map)) + .toList(), + ), + sha256: $checkedConvert('sha256', (v) => v as String), + sizeBytes: $checkedConvert('size_bytes', (v) => (v as num).toInt()), + uploadedAt: $checkedConvert( + 'uploaded_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + warnings: $checkedConvert( + 'warnings', + (v) => (v as List?)?.map((e) => e as String).toList(), + ), + ); + return val; + }, + fieldKeyMap: const { + 'accountExternalId': 'account_external_id', + 'accountId': 'account_id', + 'accountName': 'account_name', + 'accountSuggestions': 'account_suggestions', + 'committedAt': 'committed_at', + 'duplicateOfId': 'duplicate_of_id', + 'parseStatus': 'parse_status', + 'parserName': 'parser_name', + 'parserVersion': 'parser_version', + 'pendingInstruments': 'pending_instruments', + 'periodFrom': 'period_from', + 'periodTo': 'period_to', + 'sampleEvents': 'sample_events', + 'sizeBytes': 'size_bytes', + 'uploadedAt': 'uploaded_at', + }, + ); + +Map _$ImportPreviewToJson(ImportPreview instance) => + { + 'account_external_id': ?instance.accountExternalId, + 'account_id': ?instance.accountId, + 'account_name': ?instance.accountName, + 'account_suggestions': ?instance.accountSuggestions + ?.map((e) => e.toJson()) + .toList(), + 'broker': instance.broker, + 'committed_at': ?instance.committedAt?.toIso8601String(), + 'counts': instance.counts.toJson(), + 'duplicate_of_id': ?instance.duplicateOfId, + 'error': ?instance.error, + 'filename': instance.filename, + 'id': instance.id, + 'parse_status': instance.parseStatus, + 'parser_name': ?instance.parserName, + 'parser_version': ?instance.parserVersion, + 'pending_instruments': ?instance.pendingInstruments + ?.map((e) => e.toJson()) + .toList(), + 'period_from': ?instance.periodFrom?.toIso8601String(), + 'period_to': ?instance.periodTo?.toIso8601String(), + 'reconciliation': instance.reconciliation.toJson(), + 'sample_events': ?instance.sampleEvents?.map((e) => e.toJson()).toList(), + 'sha256': instance.sha256, + 'size_bytes': instance.sizeBytes, + 'uploaded_at': ?instance.uploadedAt?.toIso8601String(), + 'warnings': ?instance.warnings, + }; diff --git a/app/packages/api_client/lib/src/model/import_result.dart b/app/packages/api_client/lib/src/model/import_result.dart new file mode 100644 index 0000000..cbd4068 --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_result.dart @@ -0,0 +1,187 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/reconciliation_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'import_result.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ImportResult { + /// Returns a new [ImportResult] instance. + ImportResult({ + + required this.committed, + + required this.eventsCreated, + + required this.eventsShadow, + + required this.eventsSkipped, + + required this.eventsUpdated, + + required this.importId, + + required this.metricsRefreshed, + + required this.pendingInstruments, + + required this.reconciliation, + }); + + @JsonKey( + + name: r'committed', + required: true, + includeIfNull: false, + ) + + + final bool committed; + + + + @JsonKey( + + name: r'events_created', + required: true, + includeIfNull: false, + ) + + + final int eventsCreated; + + + + @JsonKey( + + name: r'events_shadow', + required: true, + includeIfNull: false, + ) + + + final int eventsShadow; + + + + @JsonKey( + + name: r'events_skipped', + required: true, + includeIfNull: false, + ) + + + final int eventsSkipped; + + + + @JsonKey( + + name: r'events_updated', + required: true, + includeIfNull: false, + ) + + + final int eventsUpdated; + + + + @JsonKey( + + name: r'import_id', + required: true, + includeIfNull: false, + ) + + + final int importId; + + + + @JsonKey( + + name: r'metrics_refreshed', + required: true, + includeIfNull: false, + ) + + + final bool metricsRefreshed; + + + + @JsonKey( + + name: r'pending_instruments', + required: true, + includeIfNull: false, + ) + + + final int pendingInstruments; + + + + @JsonKey( + + name: r'reconciliation', + required: true, + includeIfNull: false, + ) + + + final ReconciliationOut reconciliation; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ImportResult && + other.committed == committed && + other.eventsCreated == eventsCreated && + other.eventsShadow == eventsShadow && + other.eventsSkipped == eventsSkipped && + other.eventsUpdated == eventsUpdated && + other.importId == importId && + other.metricsRefreshed == metricsRefreshed && + other.pendingInstruments == pendingInstruments && + other.reconciliation == reconciliation; + + @override + int get hashCode => + committed.hashCode + + eventsCreated.hashCode + + eventsShadow.hashCode + + eventsSkipped.hashCode + + eventsUpdated.hashCode + + importId.hashCode + + metricsRefreshed.hashCode + + pendingInstruments.hashCode + + reconciliation.hashCode; + + factory ImportResult.fromJson(Map json) => _$ImportResultFromJson(json); + + Map toJson() => _$ImportResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/import_result.g.dart b/app/packages/api_client/lib/src/model/import_result.g.dart new file mode 100644 index 0000000..ba1b04f --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_result.g.dart @@ -0,0 +1,226 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'import_result.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ImportResultCWProxy { + ImportResult committed(bool committed); + + ImportResult eventsCreated(int eventsCreated); + + ImportResult eventsShadow(int eventsShadow); + + ImportResult eventsSkipped(int eventsSkipped); + + ImportResult eventsUpdated(int eventsUpdated); + + ImportResult importId(int importId); + + ImportResult metricsRefreshed(bool metricsRefreshed); + + ImportResult pendingInstruments(int pendingInstruments); + + ImportResult reconciliation(ReconciliationOut reconciliation); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportResult(...).copyWith(id: 12, name: "My name") + /// ```` + ImportResult call({ + bool committed, + int eventsCreated, + int eventsShadow, + int eventsSkipped, + int eventsUpdated, + int importId, + bool metricsRefreshed, + int pendingInstruments, + ReconciliationOut reconciliation, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportResult.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportResult.copyWith.fieldName(...)` +class _$ImportResultCWProxyImpl implements _$ImportResultCWProxy { + const _$ImportResultCWProxyImpl(this._value); + + final ImportResult _value; + + @override + ImportResult committed(bool committed) => this(committed: committed); + + @override + ImportResult eventsCreated(int eventsCreated) => + this(eventsCreated: eventsCreated); + + @override + ImportResult eventsShadow(int eventsShadow) => + this(eventsShadow: eventsShadow); + + @override + ImportResult eventsSkipped(int eventsSkipped) => + this(eventsSkipped: eventsSkipped); + + @override + ImportResult eventsUpdated(int eventsUpdated) => + this(eventsUpdated: eventsUpdated); + + @override + ImportResult importId(int importId) => this(importId: importId); + + @override + ImportResult metricsRefreshed(bool metricsRefreshed) => + this(metricsRefreshed: metricsRefreshed); + + @override + ImportResult pendingInstruments(int pendingInstruments) => + this(pendingInstruments: pendingInstruments); + + @override + ImportResult reconciliation(ReconciliationOut reconciliation) => + this(reconciliation: reconciliation); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportResult(...).copyWith(id: 12, name: "My name") + /// ```` + ImportResult call({ + Object? committed = const $CopyWithPlaceholder(), + Object? eventsCreated = const $CopyWithPlaceholder(), + Object? eventsShadow = const $CopyWithPlaceholder(), + Object? eventsSkipped = const $CopyWithPlaceholder(), + Object? eventsUpdated = const $CopyWithPlaceholder(), + Object? importId = const $CopyWithPlaceholder(), + Object? metricsRefreshed = const $CopyWithPlaceholder(), + Object? pendingInstruments = const $CopyWithPlaceholder(), + Object? reconciliation = const $CopyWithPlaceholder(), + }) { + return ImportResult( + committed: committed == const $CopyWithPlaceholder() + ? _value.committed + // ignore: cast_nullable_to_non_nullable + : committed as bool, + eventsCreated: eventsCreated == const $CopyWithPlaceholder() + ? _value.eventsCreated + // ignore: cast_nullable_to_non_nullable + : eventsCreated as int, + eventsShadow: eventsShadow == const $CopyWithPlaceholder() + ? _value.eventsShadow + // ignore: cast_nullable_to_non_nullable + : eventsShadow as int, + eventsSkipped: eventsSkipped == const $CopyWithPlaceholder() + ? _value.eventsSkipped + // ignore: cast_nullable_to_non_nullable + : eventsSkipped as int, + eventsUpdated: eventsUpdated == const $CopyWithPlaceholder() + ? _value.eventsUpdated + // ignore: cast_nullable_to_non_nullable + : eventsUpdated as int, + importId: importId == const $CopyWithPlaceholder() + ? _value.importId + // ignore: cast_nullable_to_non_nullable + : importId as int, + metricsRefreshed: metricsRefreshed == const $CopyWithPlaceholder() + ? _value.metricsRefreshed + // ignore: cast_nullable_to_non_nullable + : metricsRefreshed as bool, + pendingInstruments: pendingInstruments == const $CopyWithPlaceholder() + ? _value.pendingInstruments + // ignore: cast_nullable_to_non_nullable + : pendingInstruments as int, + reconciliation: reconciliation == const $CopyWithPlaceholder() + ? _value.reconciliation + // ignore: cast_nullable_to_non_nullable + : reconciliation as ReconciliationOut, + ); + } +} + +extension $ImportResultCopyWith on ImportResult { + /// Returns a callable class that can be used as follows: `instanceOfImportResult.copyWith(...)` or like so:`instanceOfImportResult.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ImportResultCWProxy get copyWith => _$ImportResultCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ImportResult _$ImportResultFromJson( + Map json, +) => $checkedCreate( + 'ImportResult', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'committed', + 'events_created', + 'events_shadow', + 'events_skipped', + 'events_updated', + 'import_id', + 'metrics_refreshed', + 'pending_instruments', + 'reconciliation', + ], + ); + final val = ImportResult( + committed: $checkedConvert('committed', (v) => v as bool), + eventsCreated: $checkedConvert( + 'events_created', + (v) => (v as num).toInt(), + ), + eventsShadow: $checkedConvert('events_shadow', (v) => (v as num).toInt()), + eventsSkipped: $checkedConvert( + 'events_skipped', + (v) => (v as num).toInt(), + ), + eventsUpdated: $checkedConvert( + 'events_updated', + (v) => (v as num).toInt(), + ), + importId: $checkedConvert('import_id', (v) => (v as num).toInt()), + metricsRefreshed: $checkedConvert('metrics_refreshed', (v) => v as bool), + pendingInstruments: $checkedConvert( + 'pending_instruments', + (v) => (v as num).toInt(), + ), + reconciliation: $checkedConvert( + 'reconciliation', + (v) => ReconciliationOut.fromJson(v as Map), + ), + ); + return val; + }, + fieldKeyMap: const { + 'eventsCreated': 'events_created', + 'eventsShadow': 'events_shadow', + 'eventsSkipped': 'events_skipped', + 'eventsUpdated': 'events_updated', + 'importId': 'import_id', + 'metricsRefreshed': 'metrics_refreshed', + 'pendingInstruments': 'pending_instruments', + }, +); + +Map _$ImportResultToJson(ImportResult instance) => + { + 'committed': instance.committed, + 'events_created': instance.eventsCreated, + 'events_shadow': instance.eventsShadow, + 'events_skipped': instance.eventsSkipped, + 'events_updated': instance.eventsUpdated, + 'import_id': instance.importId, + 'metrics_refreshed': instance.metricsRefreshed, + 'pending_instruments': instance.pendingInstruments, + 'reconciliation': instance.reconciliation.toJson(), + }; diff --git a/app/packages/api_client/lib/src/model/import_summary.dart b/app/packages/api_client/lib/src/model/import_summary.dart new file mode 100644 index 0000000..81cf348 --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_summary.dart @@ -0,0 +1,331 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/import_counts.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'import_summary.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ImportSummary { + /// Returns a new [ImportSummary] instance. + ImportSummary({ + + this.accountExternalId, + + this.accountId, + + this.accountName, + + required this.broker, + + this.committedAt, + + required this.counts, + + this.duplicateOfId, + + this.error, + + required this.filename, + + required this.id, + + required this.parseStatus, + + this.parserName, + + this.parserVersion, + + this.periodFrom, + + this.periodTo, + + required this.sha256, + + required this.sizeBytes, + + this.uploadedAt, + }); + + @JsonKey( + + name: r'account_external_id', + required: false, + includeIfNull: false, + ) + + + final String? accountExternalId; + + + + @JsonKey( + + name: r'account_id', + required: false, + includeIfNull: false, + ) + + + final int? accountId; + + + + @JsonKey( + + name: r'account_name', + required: false, + includeIfNull: false, + ) + + + final String? accountName; + + + + @JsonKey( + + name: r'broker', + required: true, + includeIfNull: false, + ) + + + final String broker; + + + + @JsonKey( + + name: r'committed_at', + required: false, + includeIfNull: false, + ) + + + final DateTime? committedAt; + + + + @JsonKey( + + name: r'counts', + required: true, + includeIfNull: false, + ) + + + final ImportCounts counts; + + + + @JsonKey( + + name: r'duplicate_of_id', + required: false, + includeIfNull: false, + ) + + + final int? duplicateOfId; + + + + @JsonKey( + + name: r'error', + required: false, + includeIfNull: false, + ) + + + final String? error; + + + + @JsonKey( + + name: r'filename', + required: true, + includeIfNull: false, + ) + + + final String filename; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'parse_status', + required: true, + includeIfNull: false, + ) + + + final String parseStatus; + + + + @JsonKey( + + name: r'parser_name', + required: false, + includeIfNull: false, + ) + + + final String? parserName; + + + + @JsonKey( + + name: r'parser_version', + required: false, + includeIfNull: false, + ) + + + final String? parserVersion; + + + + @JsonKey( + + name: r'period_from', + required: false, + includeIfNull: false, + ) + + + final DateTime? periodFrom; + + + + @JsonKey( + + name: r'period_to', + required: false, + includeIfNull: false, + ) + + + final DateTime? periodTo; + + + + @JsonKey( + + name: r'sha256', + required: true, + includeIfNull: false, + ) + + + final String sha256; + + + + @JsonKey( + + name: r'size_bytes', + required: true, + includeIfNull: false, + ) + + + final int sizeBytes; + + + + @JsonKey( + + name: r'uploaded_at', + required: false, + includeIfNull: false, + ) + + + final DateTime? uploadedAt; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ImportSummary && + other.accountExternalId == accountExternalId && + other.accountId == accountId && + other.accountName == accountName && + other.broker == broker && + other.committedAt == committedAt && + other.counts == counts && + other.duplicateOfId == duplicateOfId && + other.error == error && + other.filename == filename && + other.id == id && + other.parseStatus == parseStatus && + other.parserName == parserName && + other.parserVersion == parserVersion && + other.periodFrom == periodFrom && + other.periodTo == periodTo && + other.sha256 == sha256 && + other.sizeBytes == sizeBytes && + other.uploadedAt == uploadedAt; + + @override + int get hashCode => + (accountExternalId == null ? 0 : accountExternalId.hashCode) + + (accountId == null ? 0 : accountId.hashCode) + + (accountName == null ? 0 : accountName.hashCode) + + broker.hashCode + + (committedAt == null ? 0 : committedAt.hashCode) + + counts.hashCode + + (duplicateOfId == null ? 0 : duplicateOfId.hashCode) + + (error == null ? 0 : error.hashCode) + + filename.hashCode + + id.hashCode + + parseStatus.hashCode + + (parserName == null ? 0 : parserName.hashCode) + + (parserVersion == null ? 0 : parserVersion.hashCode) + + (periodFrom == null ? 0 : periodFrom.hashCode) + + (periodTo == null ? 0 : periodTo.hashCode) + + sha256.hashCode + + sizeBytes.hashCode + + (uploadedAt == null ? 0 : uploadedAt.hashCode); + + factory ImportSummary.fromJson(Map json) => _$ImportSummaryFromJson(json); + + Map toJson() => _$ImportSummaryToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/import_summary.g.dart b/app/packages/api_client/lib/src/model/import_summary.g.dart new file mode 100644 index 0000000..352bf2b --- /dev/null +++ b/app/packages/api_client/lib/src/model/import_summary.g.dart @@ -0,0 +1,352 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'import_summary.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ImportSummaryCWProxy { + ImportSummary accountExternalId(String? accountExternalId); + + ImportSummary accountId(int? accountId); + + ImportSummary accountName(String? accountName); + + ImportSummary broker(String broker); + + ImportSummary committedAt(DateTime? committedAt); + + ImportSummary counts(ImportCounts counts); + + ImportSummary duplicateOfId(int? duplicateOfId); + + ImportSummary error(String? error); + + ImportSummary filename(String filename); + + ImportSummary id(int id); + + ImportSummary parseStatus(String parseStatus); + + ImportSummary parserName(String? parserName); + + ImportSummary parserVersion(String? parserVersion); + + ImportSummary periodFrom(DateTime? periodFrom); + + ImportSummary periodTo(DateTime? periodTo); + + ImportSummary sha256(String sha256); + + ImportSummary sizeBytes(int sizeBytes); + + ImportSummary uploadedAt(DateTime? uploadedAt); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportSummary(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportSummary(...).copyWith(id: 12, name: "My name") + /// ```` + ImportSummary call({ + String? accountExternalId, + int? accountId, + String? accountName, + String broker, + DateTime? committedAt, + ImportCounts counts, + int? duplicateOfId, + String? error, + String filename, + int id, + String parseStatus, + String? parserName, + String? parserVersion, + DateTime? periodFrom, + DateTime? periodTo, + String sha256, + int sizeBytes, + DateTime? uploadedAt, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportSummary.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportSummary.copyWith.fieldName(...)` +class _$ImportSummaryCWProxyImpl implements _$ImportSummaryCWProxy { + const _$ImportSummaryCWProxyImpl(this._value); + + final ImportSummary _value; + + @override + ImportSummary accountExternalId(String? accountExternalId) => + this(accountExternalId: accountExternalId); + + @override + ImportSummary accountId(int? accountId) => this(accountId: accountId); + + @override + ImportSummary accountName(String? accountName) => + this(accountName: accountName); + + @override + ImportSummary broker(String broker) => this(broker: broker); + + @override + ImportSummary committedAt(DateTime? committedAt) => + this(committedAt: committedAt); + + @override + ImportSummary counts(ImportCounts counts) => this(counts: counts); + + @override + ImportSummary duplicateOfId(int? duplicateOfId) => + this(duplicateOfId: duplicateOfId); + + @override + ImportSummary error(String? error) => this(error: error); + + @override + ImportSummary filename(String filename) => this(filename: filename); + + @override + ImportSummary id(int id) => this(id: id); + + @override + ImportSummary parseStatus(String parseStatus) => + this(parseStatus: parseStatus); + + @override + ImportSummary parserName(String? parserName) => this(parserName: parserName); + + @override + ImportSummary parserVersion(String? parserVersion) => + this(parserVersion: parserVersion); + + @override + ImportSummary periodFrom(DateTime? periodFrom) => + this(periodFrom: periodFrom); + + @override + ImportSummary periodTo(DateTime? periodTo) => this(periodTo: periodTo); + + @override + ImportSummary sha256(String sha256) => this(sha256: sha256); + + @override + ImportSummary sizeBytes(int sizeBytes) => this(sizeBytes: sizeBytes); + + @override + ImportSummary uploadedAt(DateTime? uploadedAt) => + this(uploadedAt: uploadedAt); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportSummary(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ImportSummary(...).copyWith(id: 12, name: "My name") + /// ```` + ImportSummary call({ + Object? accountExternalId = const $CopyWithPlaceholder(), + Object? accountId = const $CopyWithPlaceholder(), + Object? accountName = const $CopyWithPlaceholder(), + Object? broker = const $CopyWithPlaceholder(), + Object? committedAt = const $CopyWithPlaceholder(), + Object? counts = const $CopyWithPlaceholder(), + Object? duplicateOfId = const $CopyWithPlaceholder(), + Object? error = const $CopyWithPlaceholder(), + Object? filename = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? parseStatus = const $CopyWithPlaceholder(), + Object? parserName = const $CopyWithPlaceholder(), + Object? parserVersion = const $CopyWithPlaceholder(), + Object? periodFrom = const $CopyWithPlaceholder(), + Object? periodTo = const $CopyWithPlaceholder(), + Object? sha256 = const $CopyWithPlaceholder(), + Object? sizeBytes = const $CopyWithPlaceholder(), + Object? uploadedAt = const $CopyWithPlaceholder(), + }) { + return ImportSummary( + accountExternalId: accountExternalId == const $CopyWithPlaceholder() + ? _value.accountExternalId + // ignore: cast_nullable_to_non_nullable + : accountExternalId as String?, + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int?, + accountName: accountName == const $CopyWithPlaceholder() + ? _value.accountName + // ignore: cast_nullable_to_non_nullable + : accountName as String?, + broker: broker == const $CopyWithPlaceholder() + ? _value.broker + // ignore: cast_nullable_to_non_nullable + : broker as String, + committedAt: committedAt == const $CopyWithPlaceholder() + ? _value.committedAt + // ignore: cast_nullable_to_non_nullable + : committedAt as DateTime?, + counts: counts == const $CopyWithPlaceholder() + ? _value.counts + // ignore: cast_nullable_to_non_nullable + : counts as ImportCounts, + duplicateOfId: duplicateOfId == const $CopyWithPlaceholder() + ? _value.duplicateOfId + // ignore: cast_nullable_to_non_nullable + : duplicateOfId as int?, + error: error == const $CopyWithPlaceholder() + ? _value.error + // ignore: cast_nullable_to_non_nullable + : error as String?, + filename: filename == const $CopyWithPlaceholder() + ? _value.filename + // ignore: cast_nullable_to_non_nullable + : filename as String, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + parseStatus: parseStatus == const $CopyWithPlaceholder() + ? _value.parseStatus + // ignore: cast_nullable_to_non_nullable + : parseStatus as String, + parserName: parserName == const $CopyWithPlaceholder() + ? _value.parserName + // ignore: cast_nullable_to_non_nullable + : parserName as String?, + parserVersion: parserVersion == const $CopyWithPlaceholder() + ? _value.parserVersion + // ignore: cast_nullable_to_non_nullable + : parserVersion as String?, + periodFrom: periodFrom == const $CopyWithPlaceholder() + ? _value.periodFrom + // ignore: cast_nullable_to_non_nullable + : periodFrom as DateTime?, + periodTo: periodTo == const $CopyWithPlaceholder() + ? _value.periodTo + // ignore: cast_nullable_to_non_nullable + : periodTo as DateTime?, + sha256: sha256 == const $CopyWithPlaceholder() + ? _value.sha256 + // ignore: cast_nullable_to_non_nullable + : sha256 as String, + sizeBytes: sizeBytes == const $CopyWithPlaceholder() + ? _value.sizeBytes + // ignore: cast_nullable_to_non_nullable + : sizeBytes as int, + uploadedAt: uploadedAt == const $CopyWithPlaceholder() + ? _value.uploadedAt + // ignore: cast_nullable_to_non_nullable + : uploadedAt as DateTime?, + ); + } +} + +extension $ImportSummaryCopyWith on ImportSummary { + /// Returns a callable class that can be used as follows: `instanceOfImportSummary.copyWith(...)` or like so:`instanceOfImportSummary.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ImportSummaryCWProxy get copyWith => _$ImportSummaryCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ImportSummary _$ImportSummaryFromJson(Map json) => + $checkedCreate( + 'ImportSummary', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'broker', + 'counts', + 'filename', + 'id', + 'parse_status', + 'sha256', + 'size_bytes', + ], + ); + final val = ImportSummary( + accountExternalId: $checkedConvert( + 'account_external_id', + (v) => v as String?, + ), + accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()), + accountName: $checkedConvert('account_name', (v) => v as String?), + broker: $checkedConvert('broker', (v) => v as String), + committedAt: $checkedConvert( + 'committed_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + counts: $checkedConvert( + 'counts', + (v) => ImportCounts.fromJson(v as Map), + ), + duplicateOfId: $checkedConvert( + 'duplicate_of_id', + (v) => (v as num?)?.toInt(), + ), + error: $checkedConvert('error', (v) => v as String?), + filename: $checkedConvert('filename', (v) => v as String), + id: $checkedConvert('id', (v) => (v as num).toInt()), + parseStatus: $checkedConvert('parse_status', (v) => v as String), + parserName: $checkedConvert('parser_name', (v) => v as String?), + parserVersion: $checkedConvert('parser_version', (v) => v as String?), + periodFrom: $checkedConvert( + 'period_from', + (v) => v == null ? null : DateTime.parse(v as String), + ), + periodTo: $checkedConvert( + 'period_to', + (v) => v == null ? null : DateTime.parse(v as String), + ), + sha256: $checkedConvert('sha256', (v) => v as String), + sizeBytes: $checkedConvert('size_bytes', (v) => (v as num).toInt()), + uploadedAt: $checkedConvert( + 'uploaded_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ); + return val; + }, + fieldKeyMap: const { + 'accountExternalId': 'account_external_id', + 'accountId': 'account_id', + 'accountName': 'account_name', + 'committedAt': 'committed_at', + 'duplicateOfId': 'duplicate_of_id', + 'parseStatus': 'parse_status', + 'parserName': 'parser_name', + 'parserVersion': 'parser_version', + 'periodFrom': 'period_from', + 'periodTo': 'period_to', + 'sizeBytes': 'size_bytes', + 'uploadedAt': 'uploaded_at', + }, + ); + +Map _$ImportSummaryToJson(ImportSummary instance) => + { + 'account_external_id': ?instance.accountExternalId, + 'account_id': ?instance.accountId, + 'account_name': ?instance.accountName, + 'broker': instance.broker, + 'committed_at': ?instance.committedAt?.toIso8601String(), + 'counts': instance.counts.toJson(), + 'duplicate_of_id': ?instance.duplicateOfId, + 'error': ?instance.error, + 'filename': instance.filename, + 'id': instance.id, + 'parse_status': instance.parseStatus, + 'parser_name': ?instance.parserName, + 'parser_version': ?instance.parserVersion, + 'period_from': ?instance.periodFrom?.toIso8601String(), + 'period_to': ?instance.periodTo?.toIso8601String(), + 'sha256': instance.sha256, + 'size_bytes': instance.sizeBytes, + 'uploaded_at': ?instance.uploadedAt?.toIso8601String(), + }; diff --git a/app/packages/api_client/lib/src/model/link_create.dart b/app/packages/api_client/lib/src/model/link_create.dart new file mode 100644 index 0000000..3d28f87 --- /dev/null +++ b/app/packages/api_client/lib/src/model/link_create.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'link_create.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class LinkCreate { + /// Returns a new [LinkCreate] instance. + LinkCreate({ + + required this.cashTxnId, + + required this.eventId, + }); + + @JsonKey( + + name: r'cash_txn_id', + required: true, + includeIfNull: false, + ) + + + final int cashTxnId; + + + + @JsonKey( + + name: r'event_id', + required: true, + includeIfNull: false, + ) + + + final int eventId; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is LinkCreate && + other.cashTxnId == cashTxnId && + other.eventId == eventId; + + @override + int get hashCode => + cashTxnId.hashCode + + eventId.hashCode; + + factory LinkCreate.fromJson(Map json) => _$LinkCreateFromJson(json); + + Map toJson() => _$LinkCreateToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/link_create.g.dart b/app/packages/api_client/lib/src/model/link_create.g.dart new file mode 100644 index 0000000..8478663 --- /dev/null +++ b/app/packages/api_client/lib/src/model/link_create.g.dart @@ -0,0 +1,87 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'link_create.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$LinkCreateCWProxy { + LinkCreate cashTxnId(int cashTxnId); + + LinkCreate eventId(int eventId); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// LinkCreate(...).copyWith(id: 12, name: "My name") + /// ```` + LinkCreate call({int cashTxnId, int eventId}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLinkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLinkCreate.copyWith.fieldName(...)` +class _$LinkCreateCWProxyImpl implements _$LinkCreateCWProxy { + const _$LinkCreateCWProxyImpl(this._value); + + final LinkCreate _value; + + @override + LinkCreate cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId); + + @override + LinkCreate eventId(int eventId) => this(eventId: eventId); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// LinkCreate(...).copyWith(id: 12, name: "My name") + /// ```` + LinkCreate call({ + Object? cashTxnId = const $CopyWithPlaceholder(), + Object? eventId = const $CopyWithPlaceholder(), + }) { + return LinkCreate( + cashTxnId: cashTxnId == const $CopyWithPlaceholder() + ? _value.cashTxnId + // ignore: cast_nullable_to_non_nullable + : cashTxnId as int, + eventId: eventId == const $CopyWithPlaceholder() + ? _value.eventId + // ignore: cast_nullable_to_non_nullable + : eventId as int, + ); + } +} + +extension $LinkCreateCopyWith on LinkCreate { + /// Returns a callable class that can be used as follows: `instanceOfLinkCreate.copyWith(...)` or like so:`instanceOfLinkCreate.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$LinkCreateCWProxy get copyWith => _$LinkCreateCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LinkCreate _$LinkCreateFromJson(Map json) => $checkedCreate( + 'LinkCreate', + json, + ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['cash_txn_id', 'event_id']); + final val = LinkCreate( + cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()), + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + ); + return val; + }, + fieldKeyMap: const {'cashTxnId': 'cash_txn_id', 'eventId': 'event_id'}, +); + +Map _$LinkCreateToJson(LinkCreate instance) => + { + 'cash_txn_id': instance.cashTxnId, + 'event_id': instance.eventId, + }; diff --git a/app/packages/api_client/lib/src/model/link_out.dart b/app/packages/api_client/lib/src/model/link_out.dart new file mode 100644 index 0000000..3121fbc --- /dev/null +++ b/app/packages/api_client/lib/src/model/link_out.dart @@ -0,0 +1,188 @@ +// +// 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 'link_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class LinkOut { + /// Returns a new [LinkOut] instance. + LinkOut({ + + required this.amountDelta, + + required this.cashTxnId, + + required this.confidence, + + required this.currency, + + required this.dayGap, + + required this.eventId, + + required this.id, + + required this.kind, + + required this.note, + }); + + /// decimal as string + @JsonKey( + + name: r'amount_delta', + required: true, + includeIfNull: false, + ) + + + final String amountDelta; + + + + @JsonKey( + + name: r'cash_txn_id', + required: true, + includeIfNull: false, + ) + + + final int cashTxnId; + + + + /// decimal as string + @JsonKey( + + name: r'confidence', + required: true, + includeIfNull: false, + ) + + + final String confidence; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'day_gap', + required: true, + includeIfNull: false, + ) + + + final int dayGap; + + + + @JsonKey( + + name: r'event_id', + required: true, + includeIfNull: false, + ) + + + final int eventId; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'note', + required: true, + includeIfNull: true, + ) + + + final String? note; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is LinkOut && + other.amountDelta == amountDelta && + other.cashTxnId == cashTxnId && + other.confidence == confidence && + other.currency == currency && + other.dayGap == dayGap && + other.eventId == eventId && + other.id == id && + other.kind == kind && + other.note == note; + + @override + int get hashCode => + amountDelta.hashCode + + cashTxnId.hashCode + + confidence.hashCode + + currency.hashCode + + dayGap.hashCode + + eventId.hashCode + + id.hashCode + + kind.hashCode + + (note == null ? 0 : note.hashCode); + + factory LinkOut.fromJson(Map json) => _$LinkOutFromJson(json); + + Map toJson() => _$LinkOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/link_out.g.dart b/app/packages/api_client/lib/src/model/link_out.g.dart new file mode 100644 index 0000000..917f85b --- /dev/null +++ b/app/packages/api_client/lib/src/model/link_out.g.dart @@ -0,0 +1,198 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'link_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$LinkOutCWProxy { + LinkOut amountDelta(String amountDelta); + + LinkOut cashTxnId(int cashTxnId); + + LinkOut confidence(String confidence); + + LinkOut currency(String currency); + + LinkOut dayGap(int dayGap); + + LinkOut eventId(int eventId); + + LinkOut id(int id); + + LinkOut kind(String kind); + + LinkOut note(String? note); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// LinkOut(...).copyWith(id: 12, name: "My name") + /// ```` + LinkOut call({ + String amountDelta, + int cashTxnId, + String confidence, + String currency, + int dayGap, + int eventId, + int id, + String kind, + String? note, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLinkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLinkOut.copyWith.fieldName(...)` +class _$LinkOutCWProxyImpl implements _$LinkOutCWProxy { + const _$LinkOutCWProxyImpl(this._value); + + final LinkOut _value; + + @override + LinkOut amountDelta(String amountDelta) => this(amountDelta: amountDelta); + + @override + LinkOut cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId); + + @override + LinkOut confidence(String confidence) => this(confidence: confidence); + + @override + LinkOut currency(String currency) => this(currency: currency); + + @override + LinkOut dayGap(int dayGap) => this(dayGap: dayGap); + + @override + LinkOut eventId(int eventId) => this(eventId: eventId); + + @override + LinkOut id(int id) => this(id: id); + + @override + LinkOut kind(String kind) => this(kind: kind); + + @override + LinkOut note(String? note) => this(note: note); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// LinkOut(...).copyWith(id: 12, name: "My name") + /// ```` + LinkOut call({ + Object? amountDelta = const $CopyWithPlaceholder(), + Object? cashTxnId = const $CopyWithPlaceholder(), + Object? confidence = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? dayGap = const $CopyWithPlaceholder(), + Object? eventId = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + }) { + return LinkOut( + amountDelta: amountDelta == const $CopyWithPlaceholder() + ? _value.amountDelta + // ignore: cast_nullable_to_non_nullable + : amountDelta as String, + cashTxnId: cashTxnId == const $CopyWithPlaceholder() + ? _value.cashTxnId + // ignore: cast_nullable_to_non_nullable + : cashTxnId as int, + confidence: confidence == const $CopyWithPlaceholder() + ? _value.confidence + // ignore: cast_nullable_to_non_nullable + : confidence as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + dayGap: dayGap == const $CopyWithPlaceholder() + ? _value.dayGap + // ignore: cast_nullable_to_non_nullable + : dayGap as int, + eventId: eventId == const $CopyWithPlaceholder() + ? _value.eventId + // ignore: cast_nullable_to_non_nullable + : eventId as int, + id: id == const $CopyWithPlaceholder() + ? _value.id + // ignore: cast_nullable_to_non_nullable + : id as int, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + ); + } +} + +extension $LinkOutCopyWith on LinkOut { + /// Returns a callable class that can be used as follows: `instanceOfLinkOut.copyWith(...)` or like so:`instanceOfLinkOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$LinkOutCWProxy get copyWith => _$LinkOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LinkOut _$LinkOutFromJson(Map json) => $checkedCreate( + 'LinkOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'amount_delta', + 'cash_txn_id', + 'confidence', + 'currency', + 'day_gap', + 'event_id', + 'id', + 'kind', + 'note', + ], + ); + final val = LinkOut( + amountDelta: $checkedConvert('amount_delta', (v) => v as String), + cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()), + confidence: $checkedConvert('confidence', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + dayGap: $checkedConvert('day_gap', (v) => (v as num).toInt()), + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + id: $checkedConvert('id', (v) => (v as num).toInt()), + kind: $checkedConvert('kind', (v) => v as String), + note: $checkedConvert('note', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'amountDelta': 'amount_delta', + 'cashTxnId': 'cash_txn_id', + 'dayGap': 'day_gap', + 'eventId': 'event_id', + }, +); + +Map _$LinkOutToJson(LinkOut instance) => { + 'amount_delta': instance.amountDelta, + 'cash_txn_id': instance.cashTxnId, + 'confidence': instance.confidence, + 'currency': instance.currency, + 'day_gap': instance.dayGap, + 'event_id': instance.eventId, + 'id': instance.id, + 'kind': instance.kind, + 'note': instance.note, +}; diff --git a/app/packages/api_client/lib/src/model/new_instrument.dart b/app/packages/api_client/lib/src/model/new_instrument.dart new file mode 100644 index 0000000..20090d5 --- /dev/null +++ b/app/packages/api_client/lib/src/model/new_instrument.dart @@ -0,0 +1,154 @@ +// +// 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 'new_instrument.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class NewInstrument { + /// Returns a new [NewInstrument] instance. + NewInstrument({ + + required this.assetClass, + + this.board, + + this.currency = 'RUB', + + this.isin, + + this.lot = 1, + + required this.name, + + this.ticker, + }); + + @JsonKey( + + name: r'asset_class', + required: true, + includeIfNull: false, + ) + + + final String assetClass; + + + + @JsonKey( + + name: r'board', + required: false, + includeIfNull: false, + ) + + + final String? board; + + + + @JsonKey( + defaultValue: 'RUB', + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + @JsonKey( + + name: r'isin', + required: false, + includeIfNull: false, + ) + + + final String? isin; + + + + @JsonKey( + defaultValue: 1, + name: r'lot', + required: false, + includeIfNull: false, + ) + + + final int? lot; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'ticker', + required: false, + includeIfNull: false, + ) + + + final String? ticker; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is NewInstrument && + other.assetClass == assetClass && + other.board == board && + other.currency == currency && + other.isin == isin && + other.lot == lot && + other.name == name && + other.ticker == ticker; + + @override + int get hashCode => + assetClass.hashCode + + (board == null ? 0 : board.hashCode) + + currency.hashCode + + (isin == null ? 0 : isin.hashCode) + + lot.hashCode + + name.hashCode + + (ticker == null ? 0 : ticker.hashCode); + + factory NewInstrument.fromJson(Map json) => _$NewInstrumentFromJson(json); + + Map toJson() => _$NewInstrumentToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/new_instrument.g.dart b/app/packages/api_client/lib/src/model/new_instrument.g.dart new file mode 100644 index 0000000..6444698 --- /dev/null +++ b/app/packages/api_client/lib/src/model/new_instrument.g.dart @@ -0,0 +1,151 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'new_instrument.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$NewInstrumentCWProxy { + NewInstrument assetClass(String assetClass); + + NewInstrument board(String? board); + + NewInstrument currency(String? currency); + + NewInstrument isin(String? isin); + + NewInstrument lot(int? lot); + + NewInstrument name(String name); + + NewInstrument 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 `NewInstrument(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// NewInstrument(...).copyWith(id: 12, name: "My name") + /// ```` + NewInstrument call({ + String assetClass, + String? board, + String? currency, + String? isin, + int? lot, + String name, + String? ticker, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNewInstrument.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNewInstrument.copyWith.fieldName(...)` +class _$NewInstrumentCWProxyImpl implements _$NewInstrumentCWProxy { + const _$NewInstrumentCWProxyImpl(this._value); + + final NewInstrument _value; + + @override + NewInstrument assetClass(String assetClass) => this(assetClass: assetClass); + + @override + NewInstrument board(String? board) => this(board: board); + + @override + NewInstrument currency(String? currency) => this(currency: currency); + + @override + NewInstrument isin(String? isin) => this(isin: isin); + + @override + NewInstrument lot(int? lot) => this(lot: lot); + + @override + NewInstrument name(String name) => this(name: name); + + @override + NewInstrument 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 `NewInstrument(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// NewInstrument(...).copyWith(id: 12, name: "My name") + /// ```` + NewInstrument call({ + Object? assetClass = const $CopyWithPlaceholder(), + Object? board = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? isin = const $CopyWithPlaceholder(), + Object? lot = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + }) { + return NewInstrument( + 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?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + isin: isin == const $CopyWithPlaceholder() + ? _value.isin + // ignore: cast_nullable_to_non_nullable + : isin as String?, + lot: lot == const $CopyWithPlaceholder() + ? _value.lot + // ignore: cast_nullable_to_non_nullable + : lot as int?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + ); + } +} + +extension $NewInstrumentCopyWith on NewInstrument { + /// Returns a callable class that can be used as follows: `instanceOfNewInstrument.copyWith(...)` or like so:`instanceOfNewInstrument.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$NewInstrumentCWProxy get copyWith => _$NewInstrumentCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +NewInstrument _$NewInstrumentFromJson(Map json) => + $checkedCreate('NewInstrument', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['asset_class', 'name']); + final val = NewInstrument( + assetClass: $checkedConvert('asset_class', (v) => v as String), + board: $checkedConvert('board', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'), + isin: $checkedConvert('isin', (v) => v as String?), + lot: $checkedConvert('lot', (v) => (v as num?)?.toInt() ?? 1), + name: $checkedConvert('name', (v) => v as String), + ticker: $checkedConvert('ticker', (v) => v as String?), + ); + return val; + }, fieldKeyMap: const {'assetClass': 'asset_class'}); + +Map _$NewInstrumentToJson(NewInstrument instance) => + { + 'asset_class': instance.assetClass, + 'board': ?instance.board, + 'currency': ?instance.currency, + 'isin': ?instance.isin, + 'lot': ?instance.lot, + 'name': instance.name, + 'ticker': ?instance.ticker, + }; diff --git a/app/packages/api_client/lib/src/model/pending_instrument_out.dart b/app/packages/api_client/lib/src/model/pending_instrument_out.dart new file mode 100644 index 0000000..55da745 --- /dev/null +++ b/app/packages/api_client/lib/src/model/pending_instrument_out.dart @@ -0,0 +1,300 @@ +// +// 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 'pending_instrument_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PendingInstrumentOut { + /// Returns a new [PendingInstrumentOut] instance. + PendingInstrumentOut({ + + this.assetClassHint, + + this.board, + + this.createdAt, + + this.currency, + + this.firstSeenFileId, + + required this.id, + + this.instrumentId, + + this.isin, + + this.name, + + required this.occurrences, + + this.samplePrice, + + this.sampleQuantity, + + required this.source_, + + required this.sourceKey, + + required this.status, + + this.ticker, + }); + + @JsonKey( + + name: r'asset_class_hint', + required: false, + includeIfNull: false, + ) + + + final String? assetClassHint; + + + + @JsonKey( + + name: r'board', + required: false, + includeIfNull: false, + ) + + + final String? board; + + + + @JsonKey( + + name: r'created_at', + required: false, + includeIfNull: false, + ) + + + final DateTime? createdAt; + + + + @JsonKey( + + name: r'currency', + required: false, + includeIfNull: false, + ) + + + final String? currency; + + + + @JsonKey( + + name: r'first_seen_file_id', + required: false, + includeIfNull: false, + ) + + + final int? firstSeenFileId; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + @JsonKey( + + name: r'isin', + required: false, + includeIfNull: false, + ) + + + final String? isin; + + + + @JsonKey( + + name: r'name', + required: false, + includeIfNull: false, + ) + + + final String? name; + + + + @JsonKey( + + name: r'occurrences', + required: true, + includeIfNull: false, + ) + + + final int occurrences; + + + + /// decimal as string + @JsonKey( + + name: r'sample_price', + required: false, + includeIfNull: false, + ) + + + final String? samplePrice; + + + + /// decimal as string + @JsonKey( + + name: r'sample_quantity', + required: false, + includeIfNull: false, + ) + + + final String? sampleQuantity; + + + + @JsonKey( + + name: r'source', + required: true, + includeIfNull: false, + ) + + + final String source_; + + + + @JsonKey( + + name: r'source_key', + required: true, + includeIfNull: false, + ) + + + final String sourceKey; + + + + @JsonKey( + + name: r'status', + required: true, + includeIfNull: false, + ) + + + final String status; + + + + @JsonKey( + + name: r'ticker', + required: false, + includeIfNull: false, + ) + + + final String? ticker; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PendingInstrumentOut && + other.assetClassHint == assetClassHint && + other.board == board && + other.createdAt == createdAt && + other.currency == currency && + other.firstSeenFileId == firstSeenFileId && + other.id == id && + other.instrumentId == instrumentId && + other.isin == isin && + other.name == name && + other.occurrences == occurrences && + other.samplePrice == samplePrice && + other.sampleQuantity == sampleQuantity && + other.source_ == source_ && + other.sourceKey == sourceKey && + other.status == status && + other.ticker == ticker; + + @override + int get hashCode => + (assetClassHint == null ? 0 : assetClassHint.hashCode) + + (board == null ? 0 : board.hashCode) + + (createdAt == null ? 0 : createdAt.hashCode) + + (currency == null ? 0 : currency.hashCode) + + (firstSeenFileId == null ? 0 : firstSeenFileId.hashCode) + + id.hashCode + + (instrumentId == null ? 0 : instrumentId.hashCode) + + (isin == null ? 0 : isin.hashCode) + + (name == null ? 0 : name.hashCode) + + occurrences.hashCode + + (samplePrice == null ? 0 : samplePrice.hashCode) + + (sampleQuantity == null ? 0 : sampleQuantity.hashCode) + + source_.hashCode + + sourceKey.hashCode + + status.hashCode + + (ticker == null ? 0 : ticker.hashCode); + + factory PendingInstrumentOut.fromJson(Map json) => _$PendingInstrumentOutFromJson(json); + + Map toJson() => _$PendingInstrumentOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/pending_instrument_out.g.dart b/app/packages/api_client/lib/src/model/pending_instrument_out.g.dart new file mode 100644 index 0000000..221f558 --- /dev/null +++ b/app/packages/api_client/lib/src/model/pending_instrument_out.g.dart @@ -0,0 +1,312 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pending_instrument_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PendingInstrumentOutCWProxy { + PendingInstrumentOut assetClassHint(String? assetClassHint); + + PendingInstrumentOut board(String? board); + + PendingInstrumentOut createdAt(DateTime? createdAt); + + PendingInstrumentOut currency(String? currency); + + PendingInstrumentOut firstSeenFileId(int? firstSeenFileId); + + PendingInstrumentOut id(int id); + + PendingInstrumentOut instrumentId(int? instrumentId); + + PendingInstrumentOut isin(String? isin); + + PendingInstrumentOut name(String? name); + + PendingInstrumentOut occurrences(int occurrences); + + PendingInstrumentOut samplePrice(String? samplePrice); + + PendingInstrumentOut sampleQuantity(String? sampleQuantity); + + PendingInstrumentOut source_(String source_); + + PendingInstrumentOut sourceKey(String sourceKey); + + PendingInstrumentOut status(String status); + + PendingInstrumentOut 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 `PendingInstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PendingInstrumentOut(...).copyWith(id: 12, name: "My name") + /// ```` + PendingInstrumentOut call({ + String? assetClassHint, + String? board, + DateTime? createdAt, + String? currency, + int? firstSeenFileId, + int id, + int? instrumentId, + String? isin, + String? name, + int occurrences, + String? samplePrice, + String? sampleQuantity, + String source_, + String sourceKey, + String status, + String? ticker, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingInstrumentOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingInstrumentOut.copyWith.fieldName(...)` +class _$PendingInstrumentOutCWProxyImpl + implements _$PendingInstrumentOutCWProxy { + const _$PendingInstrumentOutCWProxyImpl(this._value); + + final PendingInstrumentOut _value; + + @override + PendingInstrumentOut assetClassHint(String? assetClassHint) => + this(assetClassHint: assetClassHint); + + @override + PendingInstrumentOut board(String? board) => this(board: board); + + @override + PendingInstrumentOut createdAt(DateTime? createdAt) => + this(createdAt: createdAt); + + @override + PendingInstrumentOut currency(String? currency) => this(currency: currency); + + @override + PendingInstrumentOut firstSeenFileId(int? firstSeenFileId) => + this(firstSeenFileId: firstSeenFileId); + + @override + PendingInstrumentOut id(int id) => this(id: id); + + @override + PendingInstrumentOut instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + PendingInstrumentOut isin(String? isin) => this(isin: isin); + + @override + PendingInstrumentOut name(String? name) => this(name: name); + + @override + PendingInstrumentOut occurrences(int occurrences) => + this(occurrences: occurrences); + + @override + PendingInstrumentOut samplePrice(String? samplePrice) => + this(samplePrice: samplePrice); + + @override + PendingInstrumentOut sampleQuantity(String? sampleQuantity) => + this(sampleQuantity: sampleQuantity); + + @override + PendingInstrumentOut source_(String source_) => this(source_: source_); + + @override + PendingInstrumentOut sourceKey(String sourceKey) => + this(sourceKey: sourceKey); + + @override + PendingInstrumentOut status(String status) => this(status: status); + + @override + PendingInstrumentOut 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 `PendingInstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PendingInstrumentOut(...).copyWith(id: 12, name: "My name") + /// ```` + PendingInstrumentOut call({ + Object? assetClassHint = const $CopyWithPlaceholder(), + Object? board = const $CopyWithPlaceholder(), + Object? createdAt = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? firstSeenFileId = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? isin = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? occurrences = const $CopyWithPlaceholder(), + Object? samplePrice = const $CopyWithPlaceholder(), + Object? sampleQuantity = const $CopyWithPlaceholder(), + Object? source_ = const $CopyWithPlaceholder(), + Object? sourceKey = const $CopyWithPlaceholder(), + Object? status = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + }) { + return PendingInstrumentOut( + assetClassHint: assetClassHint == const $CopyWithPlaceholder() + ? _value.assetClassHint + // ignore: cast_nullable_to_non_nullable + : assetClassHint as String?, + board: board == const $CopyWithPlaceholder() + ? _value.board + // ignore: cast_nullable_to_non_nullable + : board as String?, + createdAt: createdAt == const $CopyWithPlaceholder() + ? _value.createdAt + // ignore: cast_nullable_to_non_nullable + : createdAt as DateTime?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String?, + firstSeenFileId: firstSeenFileId == const $CopyWithPlaceholder() + ? _value.firstSeenFileId + // ignore: cast_nullable_to_non_nullable + : firstSeenFileId as int?, + 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?, + isin: isin == const $CopyWithPlaceholder() + ? _value.isin + // ignore: cast_nullable_to_non_nullable + : isin as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String?, + occurrences: occurrences == const $CopyWithPlaceholder() + ? _value.occurrences + // ignore: cast_nullable_to_non_nullable + : occurrences as int, + samplePrice: samplePrice == const $CopyWithPlaceholder() + ? _value.samplePrice + // ignore: cast_nullable_to_non_nullable + : samplePrice as String?, + sampleQuantity: sampleQuantity == const $CopyWithPlaceholder() + ? _value.sampleQuantity + // ignore: cast_nullable_to_non_nullable + : sampleQuantity as String?, + source_: source_ == const $CopyWithPlaceholder() + ? _value.source_ + // ignore: cast_nullable_to_non_nullable + : source_ as String, + sourceKey: sourceKey == const $CopyWithPlaceholder() + ? _value.sourceKey + // ignore: cast_nullable_to_non_nullable + : sourceKey as String, + status: status == const $CopyWithPlaceholder() + ? _value.status + // ignore: cast_nullable_to_non_nullable + : status as String, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + ); + } +} + +extension $PendingInstrumentOutCopyWith on PendingInstrumentOut { + /// Returns a callable class that can be used as follows: `instanceOfPendingInstrumentOut.copyWith(...)` or like so:`instanceOfPendingInstrumentOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PendingInstrumentOutCWProxy get copyWith => + _$PendingInstrumentOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PendingInstrumentOut _$PendingInstrumentOutFromJson( + Map json, +) => $checkedCreate( + 'PendingInstrumentOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'id', + 'occurrences', + 'source', + 'source_key', + 'status', + ], + ); + final val = PendingInstrumentOut( + assetClassHint: $checkedConvert('asset_class_hint', (v) => v as String?), + board: $checkedConvert('board', (v) => v as String?), + createdAt: $checkedConvert( + 'created_at', + (v) => v == null ? null : DateTime.parse(v as String), + ), + currency: $checkedConvert('currency', (v) => v as String?), + firstSeenFileId: $checkedConvert( + 'first_seen_file_id', + (v) => (v as num?)?.toInt(), + ), + id: $checkedConvert('id', (v) => (v as num).toInt()), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + isin: $checkedConvert('isin', (v) => v as String?), + name: $checkedConvert('name', (v) => v as String?), + occurrences: $checkedConvert('occurrences', (v) => (v as num).toInt()), + samplePrice: $checkedConvert('sample_price', (v) => v as String?), + sampleQuantity: $checkedConvert('sample_quantity', (v) => v as String?), + source_: $checkedConvert('source', (v) => v as String), + sourceKey: $checkedConvert('source_key', (v) => v as String), + status: $checkedConvert('status', (v) => v as String), + ticker: $checkedConvert('ticker', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'assetClassHint': 'asset_class_hint', + 'createdAt': 'created_at', + 'firstSeenFileId': 'first_seen_file_id', + 'instrumentId': 'instrument_id', + 'samplePrice': 'sample_price', + 'sampleQuantity': 'sample_quantity', + 'source_': 'source', + 'sourceKey': 'source_key', + }, +); + +Map _$PendingInstrumentOutToJson( + PendingInstrumentOut instance, +) => { + 'asset_class_hint': ?instance.assetClassHint, + 'board': ?instance.board, + 'created_at': ?instance.createdAt?.toIso8601String(), + 'currency': ?instance.currency, + 'first_seen_file_id': ?instance.firstSeenFileId, + 'id': instance.id, + 'instrument_id': ?instance.instrumentId, + 'isin': ?instance.isin, + 'name': ?instance.name, + 'occurrences': instance.occurrences, + 'sample_price': ?instance.samplePrice, + 'sample_quantity': ?instance.sampleQuantity, + 'source': instance.source_, + 'source_key': instance.sourceKey, + 'status': instance.status, + 'ticker': ?instance.ticker, +}; diff --git a/app/packages/api_client/lib/src/model/pending_resolve_request.dart b/app/packages/api_client/lib/src/model/pending_resolve_request.dart new file mode 100644 index 0000000..c925896 --- /dev/null +++ b/app/packages/api_client/lib/src/model/pending_resolve_request.dart @@ -0,0 +1,111 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/new_instrument.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'pending_resolve_request.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PendingResolveRequest { + /// Returns a new [PendingResolveRequest] instance. + PendingResolveRequest({ + + required this.action, + + this.instrument, + + this.instrumentId, + }); + + @JsonKey( + + name: r'action', + required: true, + includeIfNull: false, + unknownEnumValue: PendingResolveRequestActionEnum.unknownDefaultOpenApi, + ) + + + final PendingResolveRequestActionEnum action; + + + + @JsonKey( + + name: r'instrument', + required: false, + includeIfNull: false, + ) + + + final NewInstrument? instrument; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PendingResolveRequest && + other.action == action && + other.instrument == instrument && + other.instrumentId == instrumentId; + + @override + int get hashCode => + action.hashCode + + (instrument == null ? 0 : instrument.hashCode) + + (instrumentId == null ? 0 : instrumentId.hashCode); + + factory PendingResolveRequest.fromJson(Map json) => _$PendingResolveRequestFromJson(json); + + Map toJson() => _$PendingResolveRequestToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + +enum PendingResolveRequestActionEnum { +@JsonValue(r'link') +link(r'link'), +@JsonValue(r'create') +create(r'create'), +@JsonValue(r'ignore') +ignore(r'ignore'), +@JsonValue(r'unknown_default_open_api') +unknownDefaultOpenApi(r'unknown_default_open_api'); + +const PendingResolveRequestActionEnum(this.value); + +final String value; + +@override +String toString() => value; +} + + diff --git a/app/packages/api_client/lib/src/model/pending_resolve_request.g.dart b/app/packages/api_client/lib/src/model/pending_resolve_request.g.dart new file mode 100644 index 0000000..59d29cf --- /dev/null +++ b/app/packages/api_client/lib/src/model/pending_resolve_request.g.dart @@ -0,0 +1,125 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pending_resolve_request.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PendingResolveRequestCWProxy { + PendingResolveRequest action(PendingResolveRequestActionEnum action); + + PendingResolveRequest instrument(NewInstrument? instrument); + + PendingResolveRequest instrumentId(int? instrumentId); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PendingResolveRequest(...).copyWith(id: 12, name: "My name") + /// ```` + PendingResolveRequest call({ + PendingResolveRequestActionEnum action, + NewInstrument? instrument, + int? instrumentId, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingResolveRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingResolveRequest.copyWith.fieldName(...)` +class _$PendingResolveRequestCWProxyImpl + implements _$PendingResolveRequestCWProxy { + const _$PendingResolveRequestCWProxyImpl(this._value); + + final PendingResolveRequest _value; + + @override + PendingResolveRequest action(PendingResolveRequestActionEnum action) => + this(action: action); + + @override + PendingResolveRequest instrument(NewInstrument? instrument) => + this(instrument: instrument); + + @override + PendingResolveRequest instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PendingResolveRequest(...).copyWith(id: 12, name: "My name") + /// ```` + PendingResolveRequest call({ + Object? action = const $CopyWithPlaceholder(), + Object? instrument = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + }) { + return PendingResolveRequest( + action: action == const $CopyWithPlaceholder() + ? _value.action + // ignore: cast_nullable_to_non_nullable + : action as PendingResolveRequestActionEnum, + instrument: instrument == const $CopyWithPlaceholder() + ? _value.instrument + // ignore: cast_nullable_to_non_nullable + : instrument as NewInstrument?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int?, + ); + } +} + +extension $PendingResolveRequestCopyWith on PendingResolveRequest { + /// Returns a callable class that can be used as follows: `instanceOfPendingResolveRequest.copyWith(...)` or like so:`instanceOfPendingResolveRequest.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PendingResolveRequestCWProxy get copyWith => + _$PendingResolveRequestCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PendingResolveRequest _$PendingResolveRequestFromJson( + Map json, +) => $checkedCreate('PendingResolveRequest', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['action']); + final val = PendingResolveRequest( + action: $checkedConvert( + 'action', + (v) => $enumDecode( + _$PendingResolveRequestActionEnumEnumMap, + v, + unknownValue: PendingResolveRequestActionEnum.unknownDefaultOpenApi, + ), + ), + instrument: $checkedConvert( + 'instrument', + (v) => + v == null ? null : NewInstrument.fromJson(v as Map), + ), + instrumentId: $checkedConvert('instrument_id', (v) => (v as num?)?.toInt()), + ); + return val; +}, fieldKeyMap: const {'instrumentId': 'instrument_id'}); + +Map _$PendingResolveRequestToJson( + PendingResolveRequest instance, +) => { + 'action': _$PendingResolveRequestActionEnumEnumMap[instance.action]!, + 'instrument': ?instance.instrument?.toJson(), + 'instrument_id': ?instance.instrumentId, +}; + +const _$PendingResolveRequestActionEnumEnumMap = { + PendingResolveRequestActionEnum.link: 'link', + PendingResolveRequestActionEnum.create: 'create', + PendingResolveRequestActionEnum.ignore: 'ignore', + PendingResolveRequestActionEnum.unknownDefaultOpenApi: + 'unknown_default_open_api', +}; diff --git a/app/packages/api_client/lib/src/model/pending_resolve_result.dart b/app/packages/api_client/lib/src/model/pending_resolve_result.dart new file mode 100644 index 0000000..bda5f9c --- /dev/null +++ b/app/packages/api_client/lib/src/model/pending_resolve_result.dart @@ -0,0 +1,138 @@ +// +// 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 'pending_resolve_result.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PendingResolveResult { + /// Returns a new [PendingResolveResult] instance. + PendingResolveResult({ + + required this.aliasCreated, + + required this.eventsBound, + + required this.id, + + this.instrumentId, + + required this.metricsRefreshed, + + required this.status, + }); + + @JsonKey( + + name: r'alias_created', + required: true, + includeIfNull: false, + ) + + + final bool aliasCreated; + + + + @JsonKey( + + name: r'events_bound', + required: true, + includeIfNull: false, + ) + + + final int eventsBound; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + @JsonKey( + + name: r'metrics_refreshed', + required: true, + includeIfNull: false, + ) + + + final bool metricsRefreshed; + + + + @JsonKey( + + name: r'status', + required: true, + includeIfNull: false, + ) + + + final String status; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PendingResolveResult && + other.aliasCreated == aliasCreated && + other.eventsBound == eventsBound && + other.id == id && + other.instrumentId == instrumentId && + other.metricsRefreshed == metricsRefreshed && + other.status == status; + + @override + int get hashCode => + aliasCreated.hashCode + + eventsBound.hashCode + + id.hashCode + + (instrumentId == null ? 0 : instrumentId.hashCode) + + metricsRefreshed.hashCode + + status.hashCode; + + factory PendingResolveResult.fromJson(Map json) => _$PendingResolveResultFromJson(json); + + Map toJson() => _$PendingResolveResultToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/pending_resolve_result.g.dart b/app/packages/api_client/lib/src/model/pending_resolve_result.g.dart new file mode 100644 index 0000000..30b0bef --- /dev/null +++ b/app/packages/api_client/lib/src/model/pending_resolve_result.g.dart @@ -0,0 +1,168 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pending_resolve_result.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PendingResolveResultCWProxy { + PendingResolveResult aliasCreated(bool aliasCreated); + + PendingResolveResult eventsBound(int eventsBound); + + PendingResolveResult id(int id); + + PendingResolveResult instrumentId(int? instrumentId); + + PendingResolveResult metricsRefreshed(bool metricsRefreshed); + + PendingResolveResult status(String status); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PendingResolveResult(...).copyWith(id: 12, name: "My name") + /// ```` + PendingResolveResult call({ + bool aliasCreated, + int eventsBound, + int id, + int? instrumentId, + bool metricsRefreshed, + String status, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingResolveResult.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingResolveResult.copyWith.fieldName(...)` +class _$PendingResolveResultCWProxyImpl + implements _$PendingResolveResultCWProxy { + const _$PendingResolveResultCWProxyImpl(this._value); + + final PendingResolveResult _value; + + @override + PendingResolveResult aliasCreated(bool aliasCreated) => + this(aliasCreated: aliasCreated); + + @override + PendingResolveResult eventsBound(int eventsBound) => + this(eventsBound: eventsBound); + + @override + PendingResolveResult id(int id) => this(id: id); + + @override + PendingResolveResult instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + PendingResolveResult metricsRefreshed(bool metricsRefreshed) => + this(metricsRefreshed: metricsRefreshed); + + @override + PendingResolveResult status(String status) => this(status: status); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PendingResolveResult(...).copyWith(id: 12, name: "My name") + /// ```` + PendingResolveResult call({ + Object? aliasCreated = const $CopyWithPlaceholder(), + Object? eventsBound = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? metricsRefreshed = const $CopyWithPlaceholder(), + Object? status = const $CopyWithPlaceholder(), + }) { + return PendingResolveResult( + aliasCreated: aliasCreated == const $CopyWithPlaceholder() + ? _value.aliasCreated + // ignore: cast_nullable_to_non_nullable + : aliasCreated as bool, + eventsBound: eventsBound == const $CopyWithPlaceholder() + ? _value.eventsBound + // ignore: cast_nullable_to_non_nullable + : eventsBound as int, + 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?, + metricsRefreshed: metricsRefreshed == const $CopyWithPlaceholder() + ? _value.metricsRefreshed + // ignore: cast_nullable_to_non_nullable + : metricsRefreshed as bool, + status: status == const $CopyWithPlaceholder() + ? _value.status + // ignore: cast_nullable_to_non_nullable + : status as String, + ); + } +} + +extension $PendingResolveResultCopyWith on PendingResolveResult { + /// Returns a callable class that can be used as follows: `instanceOfPendingResolveResult.copyWith(...)` or like so:`instanceOfPendingResolveResult.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PendingResolveResultCWProxy get copyWith => + _$PendingResolveResultCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PendingResolveResult _$PendingResolveResultFromJson( + Map json, +) => $checkedCreate( + 'PendingResolveResult', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'alias_created', + 'events_bound', + 'id', + 'metrics_refreshed', + 'status', + ], + ); + final val = PendingResolveResult( + aliasCreated: $checkedConvert('alias_created', (v) => v as bool), + eventsBound: $checkedConvert('events_bound', (v) => (v as num).toInt()), + id: $checkedConvert('id', (v) => (v as num).toInt()), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + metricsRefreshed: $checkedConvert('metrics_refreshed', (v) => v as bool), + status: $checkedConvert('status', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'aliasCreated': 'alias_created', + 'eventsBound': 'events_bound', + 'instrumentId': 'instrument_id', + 'metricsRefreshed': 'metrics_refreshed', + }, +); + +Map _$PendingResolveResultToJson( + PendingResolveResult instance, +) => { + 'alias_created': instance.aliasCreated, + 'events_bound': instance.eventsBound, + 'id': instance.id, + 'instrument_id': ?instance.instrumentId, + 'metrics_refreshed': instance.metricsRefreshed, + 'status': instance.status, +}; diff --git a/app/packages/api_client/lib/src/model/price_manual_in.dart b/app/packages/api_client/lib/src/model/price_manual_in.dart new file mode 100644 index 0000000..5c94cbf --- /dev/null +++ b/app/packages/api_client/lib/src/model/price_manual_in.dart @@ -0,0 +1,107 @@ +// +// 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_manual_in.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PriceManualIn { + /// Returns a new [PriceManualIn] instance. + PriceManualIn({ + + required this.currency, + + required this.d, + + this.note, + + required this.price, + }); + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'd', + required: true, + includeIfNull: false, + ) + + + final DateTime d; + + + + @JsonKey( + + name: r'note', + required: false, + includeIfNull: false, + ) + + + final String? note; + + + + /// decimal as string + @JsonKey( + + name: r'price', + required: true, + includeIfNull: false, + ) + + + final String price; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PriceManualIn && + other.currency == currency && + other.d == d && + other.note == note && + other.price == price; + + @override + int get hashCode => + currency.hashCode + + d.hashCode + + (note == null ? 0 : note.hashCode) + + price.hashCode; + + factory PriceManualIn.fromJson(Map json) => _$PriceManualInFromJson(json); + + Map toJson() => _$PriceManualInToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/price_manual_in.g.dart b/app/packages/api_client/lib/src/model/price_manual_in.g.dart new file mode 100644 index 0000000..d290ea7 --- /dev/null +++ b/app/packages/api_client/lib/src/model/price_manual_in.g.dart @@ -0,0 +1,107 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'price_manual_in.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PriceManualInCWProxy { + PriceManualIn currency(String currency); + + PriceManualIn d(DateTime d); + + PriceManualIn note(String? note); + + PriceManualIn price(String price); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PriceManualIn(...).copyWith(id: 12, name: "My name") + /// ```` + PriceManualIn call({String currency, DateTime d, String? note, String price}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPriceManualIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPriceManualIn.copyWith.fieldName(...)` +class _$PriceManualInCWProxyImpl implements _$PriceManualInCWProxy { + const _$PriceManualInCWProxyImpl(this._value); + + final PriceManualIn _value; + + @override + PriceManualIn currency(String currency) => this(currency: currency); + + @override + PriceManualIn d(DateTime d) => this(d: d); + + @override + PriceManualIn note(String? note) => this(note: note); + + @override + PriceManualIn price(String price) => this(price: price); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PriceManualIn(...).copyWith(id: 12, name: "My name") + /// ```` + PriceManualIn call({ + Object? currency = const $CopyWithPlaceholder(), + Object? d = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? price = const $CopyWithPlaceholder(), + }) { + return PriceManualIn( + 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, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + price: price == const $CopyWithPlaceholder() + ? _value.price + // ignore: cast_nullable_to_non_nullable + : price as String, + ); + } +} + +extension $PriceManualInCopyWith on PriceManualIn { + /// Returns a callable class that can be used as follows: `instanceOfPriceManualIn.copyWith(...)` or like so:`instanceOfPriceManualIn.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PriceManualInCWProxy get copyWith => _$PriceManualInCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PriceManualIn _$PriceManualInFromJson(Map json) => + $checkedCreate('PriceManualIn', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['currency', 'd', 'price']); + final val = PriceManualIn( + currency: $checkedConvert('currency', (v) => v as String), + d: $checkedConvert('d', (v) => DateTime.parse(v as String)), + note: $checkedConvert('note', (v) => v as String?), + price: $checkedConvert('price', (v) => v as String), + ); + return val; + }); + +Map _$PriceManualInToJson(PriceManualIn instance) => + { + 'currency': instance.currency, + 'd': instance.d.toIso8601String(), + 'note': ?instance.note, + 'price': instance.price, + }; diff --git a/app/packages/api_client/lib/src/model/price_manual_out.dart b/app/packages/api_client/lib/src/model/price_manual_out.dart new file mode 100644 index 0000000..7f51c3a --- /dev/null +++ b/app/packages/api_client/lib/src/model/price_manual_out.dart @@ -0,0 +1,139 @@ +// +// 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_manual_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class PriceManualOut { + /// Returns a new [PriceManualOut] instance. + PriceManualOut({ + + required this.currency, + + required this.d, + + required this.id, + + required this.instrumentId, + + required this.note, + + required this.price, + }); + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'd', + required: true, + includeIfNull: false, + ) + + + final DateTime d; + + + + @JsonKey( + + name: r'id', + required: true, + includeIfNull: false, + ) + + + final int id; + + + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: false, + ) + + + final int instrumentId; + + + + @JsonKey( + + name: r'note', + required: true, + includeIfNull: true, + ) + + + final String? note; + + + + /// decimal as string + @JsonKey( + + name: r'price', + required: true, + includeIfNull: false, + ) + + + final String price; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is PriceManualOut && + other.currency == currency && + other.d == d && + other.id == id && + other.instrumentId == instrumentId && + other.note == note && + other.price == price; + + @override + int get hashCode => + currency.hashCode + + d.hashCode + + id.hashCode + + instrumentId.hashCode + + (note == null ? 0 : note.hashCode) + + price.hashCode; + + factory PriceManualOut.fromJson(Map json) => _$PriceManualOutFromJson(json); + + Map toJson() => _$PriceManualOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/price_manual_out.g.dart b/app/packages/api_client/lib/src/model/price_manual_out.g.dart new file mode 100644 index 0000000..4e274e0 --- /dev/null +++ b/app/packages/api_client/lib/src/model/price_manual_out.g.dart @@ -0,0 +1,152 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'price_manual_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$PriceManualOutCWProxy { + PriceManualOut currency(String currency); + + PriceManualOut d(DateTime d); + + PriceManualOut id(int id); + + PriceManualOut instrumentId(int instrumentId); + + PriceManualOut note(String? note); + + PriceManualOut price(String price); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PriceManualOut(...).copyWith(id: 12, name: "My name") + /// ```` + PriceManualOut call({ + String currency, + DateTime d, + int id, + int instrumentId, + String? note, + String price, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPriceManualOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPriceManualOut.copyWith.fieldName(...)` +class _$PriceManualOutCWProxyImpl implements _$PriceManualOutCWProxy { + const _$PriceManualOutCWProxyImpl(this._value); + + final PriceManualOut _value; + + @override + PriceManualOut currency(String currency) => this(currency: currency); + + @override + PriceManualOut d(DateTime d) => this(d: d); + + @override + PriceManualOut id(int id) => this(id: id); + + @override + PriceManualOut instrumentId(int instrumentId) => + this(instrumentId: instrumentId); + + @override + PriceManualOut note(String? note) => this(note: note); + + @override + PriceManualOut price(String price) => this(price: price); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// PriceManualOut(...).copyWith(id: 12, name: "My name") + /// ```` + PriceManualOut call({ + Object? currency = const $CopyWithPlaceholder(), + Object? d = const $CopyWithPlaceholder(), + Object? id = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? price = const $CopyWithPlaceholder(), + }) { + return PriceManualOut( + 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, + 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, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + price: price == const $CopyWithPlaceholder() + ? _value.price + // ignore: cast_nullable_to_non_nullable + : price as String, + ); + } +} + +extension $PriceManualOutCopyWith on PriceManualOut { + /// Returns a callable class that can be used as follows: `instanceOfPriceManualOut.copyWith(...)` or like so:`instanceOfPriceManualOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$PriceManualOutCWProxy get copyWith => _$PriceManualOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +PriceManualOut _$PriceManualOutFromJson(Map json) => + $checkedCreate('PriceManualOut', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'currency', + 'd', + 'id', + 'instrument_id', + 'note', + 'price', + ], + ); + final val = PriceManualOut( + currency: $checkedConvert('currency', (v) => v as String), + d: $checkedConvert('d', (v) => DateTime.parse(v as String)), + id: $checkedConvert('id', (v) => (v as num).toInt()), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num).toInt(), + ), + note: $checkedConvert('note', (v) => v as String?), + price: $checkedConvert('price', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'instrumentId': 'instrument_id'}); + +Map _$PriceManualOutToJson(PriceManualOut instance) => + { + 'currency': instance.currency, + 'd': instance.d.toIso8601String(), + 'id': instance.id, + 'instrument_id': instance.instrumentId, + 'note': instance.note, + 'price': instance.price, + }; diff --git a/app/packages/api_client/lib/src/model/price_point.dart b/app/packages/api_client/lib/src/model/price_point.dart index a552272..933d3ff 100644 --- a/app/packages/api_client/lib/src/model/price_point.dart +++ b/app/packages/api_client/lib/src/model/price_point.dart @@ -27,6 +27,8 @@ class PricePoint { required this.currency, required this.d, + + this.source_ = 'daily', }); /// decimal as string @@ -79,6 +81,18 @@ class PricePoint { + @JsonKey( + defaultValue: 'daily', + name: r'source', + required: false, + includeIfNull: false, + ) + + + final String? source_; + + + @override @@ -86,14 +100,16 @@ class PricePoint { other.accruedInterest == accruedInterest && other.close == close && other.currency == currency && - other.d == d; + other.d == d && + other.source_ == source_; @override int get hashCode => (accruedInterest == null ? 0 : accruedInterest.hashCode) + close.hashCode + currency.hashCode + - d.hashCode; + d.hashCode + + source_.hashCode; factory PricePoint.fromJson(Map json) => _$PricePointFromJson(json); 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 index 1a9584a..deaaa4a 100644 --- a/app/packages/api_client/lib/src/model/price_point.g.dart +++ b/app/packages/api_client/lib/src/model/price_point.g.dart @@ -15,6 +15,8 @@ abstract class _$PricePointCWProxy { PricePoint d(DateTime d); + PricePoint source_(String? source_); + /// 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 @@ -26,6 +28,7 @@ abstract class _$PricePointCWProxy { String close, String currency, DateTime d, + String? source_, }); } @@ -48,6 +51,9 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy { @override PricePoint d(DateTime d) => this(d: d); + @override + PricePoint source_(String? source_) => this(source_: source_); + @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. /// @@ -60,6 +66,7 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy { Object? close = const $CopyWithPlaceholder(), Object? currency = const $CopyWithPlaceholder(), Object? d = const $CopyWithPlaceholder(), + Object? source_ = const $CopyWithPlaceholder(), }) { return PricePoint( accruedInterest: accruedInterest == const $CopyWithPlaceholder() @@ -78,6 +85,10 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy { ? _value.d // ignore: cast_nullable_to_non_nullable : d as DateTime, + source_: source_ == const $CopyWithPlaceholder() + ? _value.source_ + // ignore: cast_nullable_to_non_nullable + : source_ as String?, ); } } @@ -105,10 +116,14 @@ PricePoint _$PricePointFromJson(Map json) => $checkedCreate( close: $checkedConvert('close', (v) => v as String), currency: $checkedConvert('currency', (v) => v as String), d: $checkedConvert('d', (v) => DateTime.parse(v as String)), + source_: $checkedConvert('source', (v) => v as String? ?? 'daily'), ); return val; }, - fieldKeyMap: const {'accruedInterest': 'accrued_interest'}, + fieldKeyMap: const { + 'accruedInterest': 'accrued_interest', + 'source_': 'source', + }, ); Map _$PricePointToJson(PricePoint instance) => @@ -117,4 +132,5 @@ Map _$PricePointToJson(PricePoint instance) => 'close': instance.close, 'currency': instance.currency, 'd': instance.d.toIso8601String(), + 'source': ?instance.source_, }; diff --git a/app/packages/api_client/lib/src/model/rebalance_bucket_out.dart b/app/packages/api_client/lib/src/model/rebalance_bucket_out.dart new file mode 100644 index 0000000..59c7f09 --- /dev/null +++ b/app/packages/api_client/lib/src/model/rebalance_bucket_out.dart @@ -0,0 +1,176 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/trade_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'rebalance_bucket_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class RebalanceBucketOut { + /// Returns a new [RebalanceBucketOut] instance. + RebalanceBucketOut({ + + required this.bucket, + + required this.currentValueRub, + + required this.currentWeight, + + required this.deltaValueRub, + + required this.drift, + + required this.targetWeight, + + required this.trades, + + required this.withinBand, + }); + + @JsonKey( + + name: r'bucket', + required: true, + includeIfNull: false, + ) + + + final String bucket; + + + + /// decimal as string + @JsonKey( + + name: r'current_value_rub', + required: true, + includeIfNull: false, + ) + + + final String currentValueRub; + + + + /// decimal as string + @JsonKey( + + name: r'current_weight', + required: true, + includeIfNull: false, + ) + + + final String currentWeight; + + + + /// decimal as string + @JsonKey( + + name: r'delta_value_rub', + required: true, + includeIfNull: false, + ) + + + final String deltaValueRub; + + + + /// decimal as string + @JsonKey( + + name: r'drift', + required: true, + includeIfNull: true, + ) + + + final String? drift; + + + + /// decimal as string + @JsonKey( + + name: r'target_weight', + required: true, + includeIfNull: true, + ) + + + final String? targetWeight; + + + + @JsonKey( + + name: r'trades', + required: true, + includeIfNull: false, + ) + + + final List trades; + + + + @JsonKey( + + name: r'within_band', + required: true, + includeIfNull: false, + ) + + + final bool withinBand; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is RebalanceBucketOut && + other.bucket == bucket && + other.currentValueRub == currentValueRub && + other.currentWeight == currentWeight && + other.deltaValueRub == deltaValueRub && + other.drift == drift && + other.targetWeight == targetWeight && + other.trades == trades && + other.withinBand == withinBand; + + @override + int get hashCode => + bucket.hashCode + + currentValueRub.hashCode + + currentWeight.hashCode + + deltaValueRub.hashCode + + (drift == null ? 0 : drift.hashCode) + + (targetWeight == null ? 0 : targetWeight.hashCode) + + trades.hashCode + + withinBand.hashCode; + + factory RebalanceBucketOut.fromJson(Map json) => _$RebalanceBucketOutFromJson(json); + + Map toJson() => _$RebalanceBucketOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/rebalance_bucket_out.g.dart b/app/packages/api_client/lib/src/model/rebalance_bucket_out.g.dart new file mode 100644 index 0000000..5b80359 --- /dev/null +++ b/app/packages/api_client/lib/src/model/rebalance_bucket_out.g.dart @@ -0,0 +1,201 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'rebalance_bucket_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$RebalanceBucketOutCWProxy { + RebalanceBucketOut bucket(String bucket); + + RebalanceBucketOut currentValueRub(String currentValueRub); + + RebalanceBucketOut currentWeight(String currentWeight); + + RebalanceBucketOut deltaValueRub(String deltaValueRub); + + RebalanceBucketOut drift(String? drift); + + RebalanceBucketOut targetWeight(String? targetWeight); + + RebalanceBucketOut trades(List trades); + + RebalanceBucketOut withinBand(bool withinBand); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceBucketOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// RebalanceBucketOut(...).copyWith(id: 12, name: "My name") + /// ```` + RebalanceBucketOut call({ + String bucket, + String currentValueRub, + String currentWeight, + String deltaValueRub, + String? drift, + String? targetWeight, + List trades, + bool withinBand, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRebalanceBucketOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRebalanceBucketOut.copyWith.fieldName(...)` +class _$RebalanceBucketOutCWProxyImpl implements _$RebalanceBucketOutCWProxy { + const _$RebalanceBucketOutCWProxyImpl(this._value); + + final RebalanceBucketOut _value; + + @override + RebalanceBucketOut bucket(String bucket) => this(bucket: bucket); + + @override + RebalanceBucketOut currentValueRub(String currentValueRub) => + this(currentValueRub: currentValueRub); + + @override + RebalanceBucketOut currentWeight(String currentWeight) => + this(currentWeight: currentWeight); + + @override + RebalanceBucketOut deltaValueRub(String deltaValueRub) => + this(deltaValueRub: deltaValueRub); + + @override + RebalanceBucketOut drift(String? drift) => this(drift: drift); + + @override + RebalanceBucketOut targetWeight(String? targetWeight) => + this(targetWeight: targetWeight); + + @override + RebalanceBucketOut trades(List trades) => this(trades: trades); + + @override + RebalanceBucketOut withinBand(bool withinBand) => + this(withinBand: withinBand); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceBucketOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// RebalanceBucketOut(...).copyWith(id: 12, name: "My name") + /// ```` + RebalanceBucketOut call({ + Object? bucket = const $CopyWithPlaceholder(), + Object? currentValueRub = const $CopyWithPlaceholder(), + Object? currentWeight = const $CopyWithPlaceholder(), + Object? deltaValueRub = const $CopyWithPlaceholder(), + Object? drift = const $CopyWithPlaceholder(), + Object? targetWeight = const $CopyWithPlaceholder(), + Object? trades = const $CopyWithPlaceholder(), + Object? withinBand = const $CopyWithPlaceholder(), + }) { + return RebalanceBucketOut( + bucket: bucket == const $CopyWithPlaceholder() + ? _value.bucket + // ignore: cast_nullable_to_non_nullable + : bucket as String, + currentValueRub: currentValueRub == const $CopyWithPlaceholder() + ? _value.currentValueRub + // ignore: cast_nullable_to_non_nullable + : currentValueRub as String, + currentWeight: currentWeight == const $CopyWithPlaceholder() + ? _value.currentWeight + // ignore: cast_nullable_to_non_nullable + : currentWeight as String, + deltaValueRub: deltaValueRub == const $CopyWithPlaceholder() + ? _value.deltaValueRub + // ignore: cast_nullable_to_non_nullable + : deltaValueRub as String, + drift: drift == const $CopyWithPlaceholder() + ? _value.drift + // ignore: cast_nullable_to_non_nullable + : drift as String?, + targetWeight: targetWeight == const $CopyWithPlaceholder() + ? _value.targetWeight + // ignore: cast_nullable_to_non_nullable + : targetWeight as String?, + trades: trades == const $CopyWithPlaceholder() + ? _value.trades + // ignore: cast_nullable_to_non_nullable + : trades as List, + withinBand: withinBand == const $CopyWithPlaceholder() + ? _value.withinBand + // ignore: cast_nullable_to_non_nullable + : withinBand as bool, + ); + } +} + +extension $RebalanceBucketOutCopyWith on RebalanceBucketOut { + /// Returns a callable class that can be used as follows: `instanceOfRebalanceBucketOut.copyWith(...)` or like so:`instanceOfRebalanceBucketOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$RebalanceBucketOutCWProxy get copyWith => + _$RebalanceBucketOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RebalanceBucketOut _$RebalanceBucketOutFromJson(Map json) => + $checkedCreate( + 'RebalanceBucketOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'bucket', + 'current_value_rub', + 'current_weight', + 'delta_value_rub', + 'drift', + 'target_weight', + 'trades', + 'within_band', + ], + ); + final val = RebalanceBucketOut( + bucket: $checkedConvert('bucket', (v) => v as String), + currentValueRub: $checkedConvert( + 'current_value_rub', + (v) => v as String, + ), + currentWeight: $checkedConvert('current_weight', (v) => v as String), + deltaValueRub: $checkedConvert('delta_value_rub', (v) => v as String), + drift: $checkedConvert('drift', (v) => v as String?), + targetWeight: $checkedConvert('target_weight', (v) => v as String?), + trades: $checkedConvert( + 'trades', + (v) => (v as List) + .map((e) => TradeOut.fromJson(e as Map)) + .toList(), + ), + withinBand: $checkedConvert('within_band', (v) => v as bool), + ); + return val; + }, + fieldKeyMap: const { + 'currentValueRub': 'current_value_rub', + 'currentWeight': 'current_weight', + 'deltaValueRub': 'delta_value_rub', + 'targetWeight': 'target_weight', + 'withinBand': 'within_band', + }, + ); + +Map _$RebalanceBucketOutToJson(RebalanceBucketOut instance) => + { + 'bucket': instance.bucket, + 'current_value_rub': instance.currentValueRub, + 'current_weight': instance.currentWeight, + 'delta_value_rub': instance.deltaValueRub, + 'drift': instance.drift, + 'target_weight': instance.targetWeight, + 'trades': instance.trades.map((e) => e.toJson()).toList(), + 'within_band': instance.withinBand, + }; diff --git a/app/packages/api_client/lib/src/model/rebalance_out.dart b/app/packages/api_client/lib/src/model/rebalance_out.dart new file mode 100644 index 0000000..01ad751 --- /dev/null +++ b/app/packages/api_client/lib/src/model/rebalance_out.dart @@ -0,0 +1,157 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/rebalance_bucket_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'rebalance_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class RebalanceOut { + /// Returns a new [RebalanceOut] instance. + RebalanceOut({ + + required this.asOf, + + required this.buckets, + + required this.cashAvailableRub, + + required this.dimension, + + required this.portfolioId, + + required this.totalValueRub, + + required this.warnings, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: false, + ) + + + final DateTime asOf; + + + + @JsonKey( + + name: r'buckets', + required: true, + includeIfNull: false, + ) + + + final List buckets; + + + + /// decimal as string + @JsonKey( + + name: r'cash_available_rub', + required: true, + includeIfNull: false, + ) + + + final String cashAvailableRub; + + + + @JsonKey( + + name: r'dimension', + required: true, + includeIfNull: false, + ) + + + final String dimension; + + + + @JsonKey( + + name: r'portfolio_id', + required: true, + includeIfNull: false, + ) + + + final int portfolioId; + + + + /// decimal as string + @JsonKey( + + name: r'total_value_rub', + required: true, + includeIfNull: false, + ) + + + final String totalValueRub; + + + + @JsonKey( + + name: r'warnings', + required: true, + includeIfNull: false, + ) + + + final List warnings; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is RebalanceOut && + other.asOf == asOf && + other.buckets == buckets && + other.cashAvailableRub == cashAvailableRub && + other.dimension == dimension && + other.portfolioId == portfolioId && + other.totalValueRub == totalValueRub && + other.warnings == warnings; + + @override + int get hashCode => + asOf.hashCode + + buckets.hashCode + + cashAvailableRub.hashCode + + dimension.hashCode + + portfolioId.hashCode + + totalValueRub.hashCode + + warnings.hashCode; + + factory RebalanceOut.fromJson(Map json) => _$RebalanceOutFromJson(json); + + Map toJson() => _$RebalanceOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/rebalance_out.g.dart b/app/packages/api_client/lib/src/model/rebalance_out.g.dart new file mode 100644 index 0000000..65f927e --- /dev/null +++ b/app/packages/api_client/lib/src/model/rebalance_out.g.dart @@ -0,0 +1,187 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'rebalance_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$RebalanceOutCWProxy { + RebalanceOut asOf(DateTime asOf); + + RebalanceOut buckets(List buckets); + + RebalanceOut cashAvailableRub(String cashAvailableRub); + + RebalanceOut dimension(String dimension); + + RebalanceOut portfolioId(int portfolioId); + + RebalanceOut totalValueRub(String totalValueRub); + + RebalanceOut warnings(List warnings); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// RebalanceOut(...).copyWith(id: 12, name: "My name") + /// ```` + RebalanceOut call({ + DateTime asOf, + List buckets, + String cashAvailableRub, + String dimension, + int portfolioId, + String totalValueRub, + List warnings, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRebalanceOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRebalanceOut.copyWith.fieldName(...)` +class _$RebalanceOutCWProxyImpl implements _$RebalanceOutCWProxy { + const _$RebalanceOutCWProxyImpl(this._value); + + final RebalanceOut _value; + + @override + RebalanceOut asOf(DateTime asOf) => this(asOf: asOf); + + @override + RebalanceOut buckets(List buckets) => + this(buckets: buckets); + + @override + RebalanceOut cashAvailableRub(String cashAvailableRub) => + this(cashAvailableRub: cashAvailableRub); + + @override + RebalanceOut dimension(String dimension) => this(dimension: dimension); + + @override + RebalanceOut portfolioId(int portfolioId) => this(portfolioId: portfolioId); + + @override + RebalanceOut totalValueRub(String totalValueRub) => + this(totalValueRub: totalValueRub); + + @override + RebalanceOut warnings(List warnings) => this(warnings: warnings); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// RebalanceOut(...).copyWith(id: 12, name: "My name") + /// ```` + RebalanceOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? buckets = const $CopyWithPlaceholder(), + Object? cashAvailableRub = const $CopyWithPlaceholder(), + Object? dimension = const $CopyWithPlaceholder(), + Object? portfolioId = const $CopyWithPlaceholder(), + Object? totalValueRub = const $CopyWithPlaceholder(), + Object? warnings = const $CopyWithPlaceholder(), + }) { + return RebalanceOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime, + buckets: buckets == const $CopyWithPlaceholder() + ? _value.buckets + // ignore: cast_nullable_to_non_nullable + : buckets as List, + cashAvailableRub: cashAvailableRub == const $CopyWithPlaceholder() + ? _value.cashAvailableRub + // ignore: cast_nullable_to_non_nullable + : cashAvailableRub as String, + dimension: dimension == const $CopyWithPlaceholder() + ? _value.dimension + // ignore: cast_nullable_to_non_nullable + : dimension as String, + portfolioId: portfolioId == const $CopyWithPlaceholder() + ? _value.portfolioId + // ignore: cast_nullable_to_non_nullable + : portfolioId as int, + totalValueRub: totalValueRub == const $CopyWithPlaceholder() + ? _value.totalValueRub + // ignore: cast_nullable_to_non_nullable + : totalValueRub as String, + warnings: warnings == const $CopyWithPlaceholder() + ? _value.warnings + // ignore: cast_nullable_to_non_nullable + : warnings as List, + ); + } +} + +extension $RebalanceOutCopyWith on RebalanceOut { + /// Returns a callable class that can be used as follows: `instanceOfRebalanceOut.copyWith(...)` or like so:`instanceOfRebalanceOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$RebalanceOutCWProxy get copyWith => _$RebalanceOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +RebalanceOut _$RebalanceOutFromJson( + Map json, +) => $checkedCreate( + 'RebalanceOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'as_of', + 'buckets', + 'cash_available_rub', + 'dimension', + 'portfolio_id', + 'total_value_rub', + 'warnings', + ], + ); + final val = RebalanceOut( + asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)), + buckets: $checkedConvert( + 'buckets', + (v) => (v as List) + .map((e) => RebalanceBucketOut.fromJson(e as Map)) + .toList(), + ), + cashAvailableRub: $checkedConvert( + 'cash_available_rub', + (v) => v as String, + ), + dimension: $checkedConvert('dimension', (v) => v as String), + portfolioId: $checkedConvert('portfolio_id', (v) => (v as num).toInt()), + totalValueRub: $checkedConvert('total_value_rub', (v) => v as String), + warnings: $checkedConvert( + 'warnings', + (v) => (v as List).map((e) => e as String).toList(), + ), + ); + return val; + }, + fieldKeyMap: const { + 'asOf': 'as_of', + 'cashAvailableRub': 'cash_available_rub', + 'portfolioId': 'portfolio_id', + 'totalValueRub': 'total_value_rub', + }, +); + +Map _$RebalanceOutToJson(RebalanceOut instance) => + { + 'as_of': instance.asOf.toIso8601String(), + 'buckets': instance.buckets.map((e) => e.toJson()).toList(), + 'cash_available_rub': instance.cashAvailableRub, + 'dimension': instance.dimension, + 'portfolio_id': instance.portfolioId, + 'total_value_rub': instance.totalValueRub, + 'warnings': instance.warnings, + }; diff --git a/app/packages/api_client/lib/src/model/reconciliation_cash.dart b/app/packages/api_client/lib/src/model/reconciliation_cash.dart new file mode 100644 index 0000000..b425aad --- /dev/null +++ b/app/packages/api_client/lib/src/model/reconciliation_cash.dart @@ -0,0 +1,125 @@ +// +// 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 'reconciliation_cash.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReconciliationCash { + /// Returns a new [ReconciliationCash] instance. + ReconciliationCash({ + + required this.balanceDerived, + + required this.balanceReport, + + required this.currency, + + required this.delta, + + required this.matches, + }); + + /// decimal as string + @JsonKey( + + name: r'balance_derived', + required: true, + includeIfNull: true, + ) + + + final String? balanceDerived; + + + + /// decimal as string + @JsonKey( + + name: r'balance_report', + required: true, + includeIfNull: false, + ) + + + final String balanceReport; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + /// decimal as string + @JsonKey( + + name: r'delta', + required: true, + includeIfNull: true, + ) + + + final String? delta; + + + + @JsonKey( + + name: r'matches', + required: true, + includeIfNull: false, + ) + + + final bool matches; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReconciliationCash && + other.balanceDerived == balanceDerived && + other.balanceReport == balanceReport && + other.currency == currency && + other.delta == delta && + other.matches == matches; + + @override + int get hashCode => + (balanceDerived == null ? 0 : balanceDerived.hashCode) + + balanceReport.hashCode + + currency.hashCode + + (delta == null ? 0 : delta.hashCode) + + matches.hashCode; + + factory ReconciliationCash.fromJson(Map json) => _$ReconciliationCashFromJson(json); + + Map toJson() => _$ReconciliationCashToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/reconciliation_cash.g.dart b/app/packages/api_client/lib/src/model/reconciliation_cash.g.dart new file mode 100644 index 0000000..77eed63 --- /dev/null +++ b/app/packages/api_client/lib/src/model/reconciliation_cash.g.dart @@ -0,0 +1,148 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'reconciliation_cash.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ReconciliationCashCWProxy { + ReconciliationCash balanceDerived(String? balanceDerived); + + ReconciliationCash balanceReport(String balanceReport); + + ReconciliationCash currency(String currency); + + ReconciliationCash delta(String? delta); + + ReconciliationCash matches(bool matches); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationCash(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReconciliationCash(...).copyWith(id: 12, name: "My name") + /// ```` + ReconciliationCash call({ + String? balanceDerived, + String balanceReport, + String currency, + String? delta, + bool matches, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationCash.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationCash.copyWith.fieldName(...)` +class _$ReconciliationCashCWProxyImpl implements _$ReconciliationCashCWProxy { + const _$ReconciliationCashCWProxyImpl(this._value); + + final ReconciliationCash _value; + + @override + ReconciliationCash balanceDerived(String? balanceDerived) => + this(balanceDerived: balanceDerived); + + @override + ReconciliationCash balanceReport(String balanceReport) => + this(balanceReport: balanceReport); + + @override + ReconciliationCash currency(String currency) => this(currency: currency); + + @override + ReconciliationCash delta(String? delta) => this(delta: delta); + + @override + ReconciliationCash matches(bool matches) => this(matches: matches); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationCash(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReconciliationCash(...).copyWith(id: 12, name: "My name") + /// ```` + ReconciliationCash call({ + Object? balanceDerived = const $CopyWithPlaceholder(), + Object? balanceReport = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? delta = const $CopyWithPlaceholder(), + Object? matches = const $CopyWithPlaceholder(), + }) { + return ReconciliationCash( + balanceDerived: balanceDerived == const $CopyWithPlaceholder() + ? _value.balanceDerived + // ignore: cast_nullable_to_non_nullable + : balanceDerived as String?, + balanceReport: balanceReport == const $CopyWithPlaceholder() + ? _value.balanceReport + // ignore: cast_nullable_to_non_nullable + : balanceReport as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + delta: delta == const $CopyWithPlaceholder() + ? _value.delta + // ignore: cast_nullable_to_non_nullable + : delta as String?, + matches: matches == const $CopyWithPlaceholder() + ? _value.matches + // ignore: cast_nullable_to_non_nullable + : matches as bool, + ); + } +} + +extension $ReconciliationCashCopyWith on ReconciliationCash { + /// Returns a callable class that can be used as follows: `instanceOfReconciliationCash.copyWith(...)` or like so:`instanceOfReconciliationCash.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ReconciliationCashCWProxy get copyWith => + _$ReconciliationCashCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ReconciliationCash _$ReconciliationCashFromJson(Map json) => + $checkedCreate( + 'ReconciliationCash', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'balance_derived', + 'balance_report', + 'currency', + 'delta', + 'matches', + ], + ); + final val = ReconciliationCash( + balanceDerived: $checkedConvert( + 'balance_derived', + (v) => v as String?, + ), + balanceReport: $checkedConvert('balance_report', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + delta: $checkedConvert('delta', (v) => v as String?), + matches: $checkedConvert('matches', (v) => v as bool), + ); + return val; + }, + fieldKeyMap: const { + 'balanceDerived': 'balance_derived', + 'balanceReport': 'balance_report', + }, + ); + +Map _$ReconciliationCashToJson(ReconciliationCash instance) => + { + 'balance_derived': instance.balanceDerived, + 'balance_report': instance.balanceReport, + 'currency': instance.currency, + 'delta': instance.delta, + 'matches': instance.matches, + }; diff --git a/app/packages/api_client/lib/src/model/reconciliation_out.dart b/app/packages/api_client/lib/src/model/reconciliation_out.dart new file mode 100644 index 0000000..ab88155 --- /dev/null +++ b/app/packages/api_client/lib/src/model/reconciliation_out.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/reconciliation_cash.dart'; +import 'package:fintracker_api/src/model/reconciliation_position.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'reconciliation_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReconciliationOut { + /// Returns a new [ReconciliationOut] instance. + ReconciliationOut({ + + required this.asOf, + + this.cash, + + this.matches = true, + + this.positions, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: true, + ) + + + final DateTime? asOf; + + + + @JsonKey( + + name: r'cash', + required: false, + includeIfNull: false, + ) + + + final List? cash; + + + + @JsonKey( + defaultValue: true, + name: r'matches', + required: false, + includeIfNull: false, + ) + + + final bool? matches; + + + + @JsonKey( + + name: r'positions', + required: false, + includeIfNull: false, + ) + + + final List? positions; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReconciliationOut && + other.asOf == asOf && + other.cash == cash && + other.matches == matches && + other.positions == positions; + + @override + int get hashCode => + (asOf == null ? 0 : asOf.hashCode) + + cash.hashCode + + matches.hashCode + + positions.hashCode; + + factory ReconciliationOut.fromJson(Map json) => _$ReconciliationOutFromJson(json); + + Map toJson() => _$ReconciliationOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/reconciliation_out.g.dart b/app/packages/api_client/lib/src/model/reconciliation_out.g.dart new file mode 100644 index 0000000..c5dbf74 --- /dev/null +++ b/app/packages/api_client/lib/src/model/reconciliation_out.g.dart @@ -0,0 +1,132 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'reconciliation_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ReconciliationOutCWProxy { + ReconciliationOut asOf(DateTime? asOf); + + ReconciliationOut cash(List? cash); + + ReconciliationOut matches(bool? matches); + + ReconciliationOut positions(List? positions); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReconciliationOut(...).copyWith(id: 12, name: "My name") + /// ```` + ReconciliationOut call({ + DateTime? asOf, + List? cash, + bool? matches, + List? positions, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationOut.copyWith.fieldName(...)` +class _$ReconciliationOutCWProxyImpl implements _$ReconciliationOutCWProxy { + const _$ReconciliationOutCWProxyImpl(this._value); + + final ReconciliationOut _value; + + @override + ReconciliationOut asOf(DateTime? asOf) => this(asOf: asOf); + + @override + ReconciliationOut cash(List? cash) => this(cash: cash); + + @override + ReconciliationOut matches(bool? matches) => this(matches: matches); + + @override + ReconciliationOut positions(List? positions) => + this(positions: positions); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReconciliationOut(...).copyWith(id: 12, name: "My name") + /// ```` + ReconciliationOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? cash = const $CopyWithPlaceholder(), + Object? matches = const $CopyWithPlaceholder(), + Object? positions = const $CopyWithPlaceholder(), + }) { + return ReconciliationOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime?, + cash: cash == const $CopyWithPlaceholder() + ? _value.cash + // ignore: cast_nullable_to_non_nullable + : cash as List?, + matches: matches == const $CopyWithPlaceholder() + ? _value.matches + // ignore: cast_nullable_to_non_nullable + : matches as bool?, + positions: positions == const $CopyWithPlaceholder() + ? _value.positions + // ignore: cast_nullable_to_non_nullable + : positions as List?, + ); + } +} + +extension $ReconciliationOutCopyWith on ReconciliationOut { + /// Returns a callable class that can be used as follows: `instanceOfReconciliationOut.copyWith(...)` or like so:`instanceOfReconciliationOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ReconciliationOutCWProxy get copyWith => + _$ReconciliationOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ReconciliationOut _$ReconciliationOutFromJson(Map json) => + $checkedCreate('ReconciliationOut', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['as_of']); + final val = ReconciliationOut( + asOf: $checkedConvert( + 'as_of', + (v) => v == null ? null : DateTime.parse(v as String), + ), + cash: $checkedConvert( + 'cash', + (v) => (v as List?) + ?.map( + (e) => ReconciliationCash.fromJson(e as Map), + ) + .toList(), + ), + matches: $checkedConvert('matches', (v) => v as bool? ?? true), + positions: $checkedConvert( + 'positions', + (v) => (v as List?) + ?.map( + (e) => + ReconciliationPosition.fromJson(e as Map), + ) + .toList(), + ), + ); + return val; + }, fieldKeyMap: const {'asOf': 'as_of'}); + +Map _$ReconciliationOutToJson(ReconciliationOut instance) => + { + 'as_of': instance.asOf?.toIso8601String(), + 'cash': ?instance.cash?.map((e) => e.toJson()).toList(), + 'matches': ?instance.matches, + 'positions': ?instance.positions?.map((e) => e.toJson()).toList(), + }; diff --git a/app/packages/api_client/lib/src/model/reconciliation_position.dart b/app/packages/api_client/lib/src/model/reconciliation_position.dart new file mode 100644 index 0000000..3d70e70 --- /dev/null +++ b/app/packages/api_client/lib/src/model/reconciliation_position.dart @@ -0,0 +1,173 @@ +// +// 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 'reconciliation_position.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class ReconciliationPosition { + /// Returns a new [ReconciliationPosition] instance. + ReconciliationPosition({ + + required this.instrumentId, + + required this.instrumentName, + + required this.isin, + + required this.matches, + + required this.qtyDelta, + + required this.qtyDerived, + + required this.qtyReport, + + required this.ticker, + }); + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: true, + ) + + + final int? instrumentId; + + + + @JsonKey( + + name: r'instrument_name', + required: true, + includeIfNull: false, + ) + + + final String instrumentName; + + + + @JsonKey( + + name: r'isin', + required: true, + includeIfNull: true, + ) + + + final String? isin; + + + + @JsonKey( + + name: r'matches', + required: true, + includeIfNull: false, + ) + + + final bool matches; + + + + /// decimal as string + @JsonKey( + + name: r'qty_delta', + required: true, + includeIfNull: true, + ) + + + final String? qtyDelta; + + + + /// decimal as string + @JsonKey( + + name: r'qty_derived', + required: true, + includeIfNull: true, + ) + + + final String? qtyDerived; + + + + /// decimal as string + @JsonKey( + + name: r'qty_report', + required: true, + includeIfNull: false, + ) + + + final String qtyReport; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: true, + ) + + + final String? ticker; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is ReconciliationPosition && + other.instrumentId == instrumentId && + other.instrumentName == instrumentName && + other.isin == isin && + other.matches == matches && + other.qtyDelta == qtyDelta && + other.qtyDerived == qtyDerived && + other.qtyReport == qtyReport && + other.ticker == ticker; + + @override + int get hashCode => + (instrumentId == null ? 0 : instrumentId.hashCode) + + instrumentName.hashCode + + (isin == null ? 0 : isin.hashCode) + + matches.hashCode + + (qtyDelta == null ? 0 : qtyDelta.hashCode) + + (qtyDerived == null ? 0 : qtyDerived.hashCode) + + qtyReport.hashCode + + (ticker == null ? 0 : ticker.hashCode); + + factory ReconciliationPosition.fromJson(Map json) => _$ReconciliationPositionFromJson(json); + + Map toJson() => _$ReconciliationPositionToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/reconciliation_position.g.dart b/app/packages/api_client/lib/src/model/reconciliation_position.g.dart new file mode 100644 index 0000000..50c425d --- /dev/null +++ b/app/packages/api_client/lib/src/model/reconciliation_position.g.dart @@ -0,0 +1,198 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'reconciliation_position.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$ReconciliationPositionCWProxy { + ReconciliationPosition instrumentId(int? instrumentId); + + ReconciliationPosition instrumentName(String instrumentName); + + ReconciliationPosition isin(String? isin); + + ReconciliationPosition matches(bool matches); + + ReconciliationPosition qtyDelta(String? qtyDelta); + + ReconciliationPosition qtyDerived(String? qtyDerived); + + ReconciliationPosition qtyReport(String qtyReport); + + ReconciliationPosition 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 `ReconciliationPosition(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReconciliationPosition(...).copyWith(id: 12, name: "My name") + /// ```` + ReconciliationPosition call({ + int? instrumentId, + String instrumentName, + String? isin, + bool matches, + String? qtyDelta, + String? qtyDerived, + String qtyReport, + String? ticker, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationPosition.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationPosition.copyWith.fieldName(...)` +class _$ReconciliationPositionCWProxyImpl + implements _$ReconciliationPositionCWProxy { + const _$ReconciliationPositionCWProxyImpl(this._value); + + final ReconciliationPosition _value; + + @override + ReconciliationPosition instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + ReconciliationPosition instrumentName(String instrumentName) => + this(instrumentName: instrumentName); + + @override + ReconciliationPosition isin(String? isin) => this(isin: isin); + + @override + ReconciliationPosition matches(bool matches) => this(matches: matches); + + @override + ReconciliationPosition qtyDelta(String? qtyDelta) => this(qtyDelta: qtyDelta); + + @override + ReconciliationPosition qtyDerived(String? qtyDerived) => + this(qtyDerived: qtyDerived); + + @override + ReconciliationPosition qtyReport(String qtyReport) => + this(qtyReport: qtyReport); + + @override + ReconciliationPosition 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 `ReconciliationPosition(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// ReconciliationPosition(...).copyWith(id: 12, name: "My name") + /// ```` + ReconciliationPosition call({ + Object? instrumentId = const $CopyWithPlaceholder(), + Object? instrumentName = const $CopyWithPlaceholder(), + Object? isin = const $CopyWithPlaceholder(), + Object? matches = const $CopyWithPlaceholder(), + Object? qtyDelta = const $CopyWithPlaceholder(), + Object? qtyDerived = const $CopyWithPlaceholder(), + Object? qtyReport = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + }) { + return ReconciliationPosition( + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int?, + instrumentName: instrumentName == const $CopyWithPlaceholder() + ? _value.instrumentName + // ignore: cast_nullable_to_non_nullable + : instrumentName as String, + isin: isin == const $CopyWithPlaceholder() + ? _value.isin + // ignore: cast_nullable_to_non_nullable + : isin as String?, + matches: matches == const $CopyWithPlaceholder() + ? _value.matches + // ignore: cast_nullable_to_non_nullable + : matches as bool, + qtyDelta: qtyDelta == const $CopyWithPlaceholder() + ? _value.qtyDelta + // ignore: cast_nullable_to_non_nullable + : qtyDelta as String?, + qtyDerived: qtyDerived == const $CopyWithPlaceholder() + ? _value.qtyDerived + // ignore: cast_nullable_to_non_nullable + : qtyDerived as String?, + qtyReport: qtyReport == const $CopyWithPlaceholder() + ? _value.qtyReport + // ignore: cast_nullable_to_non_nullable + : qtyReport as String, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + ); + } +} + +extension $ReconciliationPositionCopyWith on ReconciliationPosition { + /// Returns a callable class that can be used as follows: `instanceOfReconciliationPosition.copyWith(...)` or like so:`instanceOfReconciliationPosition.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$ReconciliationPositionCWProxy get copyWith => + _$ReconciliationPositionCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ReconciliationPosition _$ReconciliationPositionFromJson( + Map json, +) => $checkedCreate( + 'ReconciliationPosition', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'instrument_id', + 'instrument_name', + 'isin', + 'matches', + 'qty_delta', + 'qty_derived', + 'qty_report', + 'ticker', + ], + ); + final val = ReconciliationPosition( + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + instrumentName: $checkedConvert('instrument_name', (v) => v as String), + isin: $checkedConvert('isin', (v) => v as String?), + matches: $checkedConvert('matches', (v) => v as bool), + qtyDelta: $checkedConvert('qty_delta', (v) => v as String?), + qtyDerived: $checkedConvert('qty_derived', (v) => v as String?), + qtyReport: $checkedConvert('qty_report', (v) => v as String), + ticker: $checkedConvert('ticker', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'instrumentId': 'instrument_id', + 'instrumentName': 'instrument_name', + 'qtyDelta': 'qty_delta', + 'qtyDerived': 'qty_derived', + 'qtyReport': 'qty_report', + }, +); + +Map _$ReconciliationPositionToJson( + ReconciliationPosition instance, +) => { + 'instrument_id': instance.instrumentId, + 'instrument_name': instance.instrumentName, + 'isin': instance.isin, + 'matches': instance.matches, + 'qty_delta': instance.qtyDelta, + 'qty_derived': instance.qtyDerived, + 'qty_report': instance.qtyReport, + 'ticker': instance.ticker, +}; diff --git a/app/packages/api_client/lib/src/model/sample_event_out.dart b/app/packages/api_client/lib/src/model/sample_event_out.dart new file mode 100644 index 0000000..d5d9eb8 --- /dev/null +++ b/app/packages/api_client/lib/src/model/sample_event_out.dart @@ -0,0 +1,302 @@ +// +// 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 'sample_event_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class SampleEventOut { + /// Returns a new [SampleEventOut] instance. + SampleEventOut({ + + required this.amount, + + required this.currency, + + required this.dedupeKey, + + this.description, + + this.fee, + + this.instrumentId, + + this.instrumentKey, + + this.instrumentName, + + required this.isDuplicate, + + required this.kind, + + required this.lineNo, + + this.price, + + this.quantity, + + this.settleDate, + + required this.tradeDate, + + this.tradeNo, + }); + + /// decimal as string + @JsonKey( + + name: r'amount', + required: true, + includeIfNull: false, + ) + + + final String amount; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'dedupe_key', + required: true, + includeIfNull: false, + ) + + + final String dedupeKey; + + + + @JsonKey( + + name: r'description', + required: false, + includeIfNull: false, + ) + + + final String? description; + + + + /// decimal as string + @JsonKey( + + name: r'fee', + required: false, + includeIfNull: false, + ) + + + final String? fee; + + + + @JsonKey( + + name: r'instrument_id', + required: false, + includeIfNull: false, + ) + + + final int? instrumentId; + + + + @JsonKey( + + name: r'instrument_key', + required: false, + includeIfNull: false, + ) + + + final String? instrumentKey; + + + + @JsonKey( + + name: r'instrument_name', + required: false, + includeIfNull: false, + ) + + + final String? instrumentName; + + + + @JsonKey( + + name: r'is_duplicate', + required: true, + includeIfNull: false, + ) + + + final bool isDuplicate; + + + + @JsonKey( + + name: r'kind', + required: true, + includeIfNull: false, + ) + + + final String kind; + + + + @JsonKey( + + name: r'line_no', + required: true, + includeIfNull: false, + ) + + + final int lineNo; + + + + /// decimal as string + @JsonKey( + + name: r'price', + required: false, + includeIfNull: false, + ) + + + final String? price; + + + + /// decimal as string + @JsonKey( + + name: r'quantity', + required: false, + includeIfNull: false, + ) + + + final String? quantity; + + + + @JsonKey( + + name: r'settle_date', + required: false, + includeIfNull: false, + ) + + + final DateTime? settleDate; + + + + @JsonKey( + + name: r'trade_date', + required: true, + includeIfNull: false, + ) + + + final DateTime tradeDate; + + + + @JsonKey( + + name: r'trade_no', + required: false, + includeIfNull: false, + ) + + + final String? tradeNo; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is SampleEventOut && + other.amount == amount && + other.currency == currency && + other.dedupeKey == dedupeKey && + other.description == description && + other.fee == fee && + other.instrumentId == instrumentId && + other.instrumentKey == instrumentKey && + other.instrumentName == instrumentName && + other.isDuplicate == isDuplicate && + other.kind == kind && + other.lineNo == lineNo && + other.price == price && + other.quantity == quantity && + other.settleDate == settleDate && + other.tradeDate == tradeDate && + other.tradeNo == tradeNo; + + @override + int get hashCode => + amount.hashCode + + currency.hashCode + + dedupeKey.hashCode + + (description == null ? 0 : description.hashCode) + + (fee == null ? 0 : fee.hashCode) + + (instrumentId == null ? 0 : instrumentId.hashCode) + + (instrumentKey == null ? 0 : instrumentKey.hashCode) + + (instrumentName == null ? 0 : instrumentName.hashCode) + + isDuplicate.hashCode + + kind.hashCode + + lineNo.hashCode + + (price == null ? 0 : price.hashCode) + + (quantity == null ? 0 : quantity.hashCode) + + (settleDate == null ? 0 : settleDate.hashCode) + + tradeDate.hashCode + + (tradeNo == null ? 0 : tradeNo.hashCode); + + factory SampleEventOut.fromJson(Map json) => _$SampleEventOutFromJson(json); + + Map toJson() => _$SampleEventOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/sample_event_out.g.dart b/app/packages/api_client/lib/src/model/sample_event_out.g.dart new file mode 100644 index 0000000..927a4af --- /dev/null +++ b/app/packages/api_client/lib/src/model/sample_event_out.g.dart @@ -0,0 +1,312 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'sample_event_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$SampleEventOutCWProxy { + SampleEventOut amount(String amount); + + SampleEventOut currency(String currency); + + SampleEventOut dedupeKey(String dedupeKey); + + SampleEventOut description(String? description); + + SampleEventOut fee(String? fee); + + SampleEventOut instrumentId(int? instrumentId); + + SampleEventOut instrumentKey(String? instrumentKey); + + SampleEventOut instrumentName(String? instrumentName); + + SampleEventOut isDuplicate(bool isDuplicate); + + SampleEventOut kind(String kind); + + SampleEventOut lineNo(int lineNo); + + SampleEventOut price(String? price); + + SampleEventOut quantity(String? quantity); + + SampleEventOut settleDate(DateTime? settleDate); + + SampleEventOut tradeDate(DateTime tradeDate); + + SampleEventOut tradeNo(String? tradeNo); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SampleEventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// SampleEventOut(...).copyWith(id: 12, name: "My name") + /// ```` + SampleEventOut call({ + String amount, + String currency, + String dedupeKey, + String? description, + String? fee, + int? instrumentId, + String? instrumentKey, + String? instrumentName, + bool isDuplicate, + String kind, + int lineNo, + String? price, + String? quantity, + DateTime? settleDate, + DateTime tradeDate, + String? tradeNo, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSampleEventOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSampleEventOut.copyWith.fieldName(...)` +class _$SampleEventOutCWProxyImpl implements _$SampleEventOutCWProxy { + const _$SampleEventOutCWProxyImpl(this._value); + + final SampleEventOut _value; + + @override + SampleEventOut amount(String amount) => this(amount: amount); + + @override + SampleEventOut currency(String currency) => this(currency: currency); + + @override + SampleEventOut dedupeKey(String dedupeKey) => this(dedupeKey: dedupeKey); + + @override + SampleEventOut description(String? description) => + this(description: description); + + @override + SampleEventOut fee(String? fee) => this(fee: fee); + + @override + SampleEventOut instrumentId(int? instrumentId) => + this(instrumentId: instrumentId); + + @override + SampleEventOut instrumentKey(String? instrumentKey) => + this(instrumentKey: instrumentKey); + + @override + SampleEventOut instrumentName(String? instrumentName) => + this(instrumentName: instrumentName); + + @override + SampleEventOut isDuplicate(bool isDuplicate) => + this(isDuplicate: isDuplicate); + + @override + SampleEventOut kind(String kind) => this(kind: kind); + + @override + SampleEventOut lineNo(int lineNo) => this(lineNo: lineNo); + + @override + SampleEventOut price(String? price) => this(price: price); + + @override + SampleEventOut quantity(String? quantity) => this(quantity: quantity); + + @override + SampleEventOut settleDate(DateTime? settleDate) => + this(settleDate: settleDate); + + @override + SampleEventOut tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate); + + @override + SampleEventOut tradeNo(String? tradeNo) => this(tradeNo: tradeNo); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SampleEventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// SampleEventOut(...).copyWith(id: 12, name: "My name") + /// ```` + SampleEventOut call({ + Object? amount = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? dedupeKey = const $CopyWithPlaceholder(), + Object? description = const $CopyWithPlaceholder(), + Object? fee = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? instrumentKey = const $CopyWithPlaceholder(), + Object? instrumentName = const $CopyWithPlaceholder(), + Object? isDuplicate = const $CopyWithPlaceholder(), + Object? kind = const $CopyWithPlaceholder(), + Object? lineNo = const $CopyWithPlaceholder(), + Object? price = const $CopyWithPlaceholder(), + Object? quantity = const $CopyWithPlaceholder(), + Object? settleDate = const $CopyWithPlaceholder(), + Object? tradeDate = const $CopyWithPlaceholder(), + Object? tradeNo = const $CopyWithPlaceholder(), + }) { + return SampleEventOut( + amount: amount == const $CopyWithPlaceholder() + ? _value.amount + // ignore: cast_nullable_to_non_nullable + : amount as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + dedupeKey: dedupeKey == const $CopyWithPlaceholder() + ? _value.dedupeKey + // ignore: cast_nullable_to_non_nullable + : dedupeKey as String, + description: description == const $CopyWithPlaceholder() + ? _value.description + // ignore: cast_nullable_to_non_nullable + : description as String?, + fee: fee == const $CopyWithPlaceholder() + ? _value.fee + // ignore: cast_nullable_to_non_nullable + : fee as String?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int?, + instrumentKey: instrumentKey == const $CopyWithPlaceholder() + ? _value.instrumentKey + // ignore: cast_nullable_to_non_nullable + : instrumentKey as String?, + instrumentName: instrumentName == const $CopyWithPlaceholder() + ? _value.instrumentName + // ignore: cast_nullable_to_non_nullable + : instrumentName as String?, + isDuplicate: isDuplicate == const $CopyWithPlaceholder() + ? _value.isDuplicate + // ignore: cast_nullable_to_non_nullable + : isDuplicate as bool, + kind: kind == const $CopyWithPlaceholder() + ? _value.kind + // ignore: cast_nullable_to_non_nullable + : kind as String, + lineNo: lineNo == const $CopyWithPlaceholder() + ? _value.lineNo + // ignore: cast_nullable_to_non_nullable + : lineNo as int, + price: price == const $CopyWithPlaceholder() + ? _value.price + // ignore: cast_nullable_to_non_nullable + : price as String?, + quantity: quantity == const $CopyWithPlaceholder() + ? _value.quantity + // ignore: cast_nullable_to_non_nullable + : quantity as String?, + settleDate: settleDate == const $CopyWithPlaceholder() + ? _value.settleDate + // ignore: cast_nullable_to_non_nullable + : settleDate as DateTime?, + tradeDate: tradeDate == const $CopyWithPlaceholder() + ? _value.tradeDate + // ignore: cast_nullable_to_non_nullable + : tradeDate as DateTime, + tradeNo: tradeNo == const $CopyWithPlaceholder() + ? _value.tradeNo + // ignore: cast_nullable_to_non_nullable + : tradeNo as String?, + ); + } +} + +extension $SampleEventOutCopyWith on SampleEventOut { + /// Returns a callable class that can be used as follows: `instanceOfSampleEventOut.copyWith(...)` or like so:`instanceOfSampleEventOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$SampleEventOutCWProxy get copyWith => _$SampleEventOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SampleEventOut _$SampleEventOutFromJson(Map json) => + $checkedCreate( + 'SampleEventOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'amount', + 'currency', + 'dedupe_key', + 'is_duplicate', + 'kind', + 'line_no', + 'trade_date', + ], + ); + final val = SampleEventOut( + amount: $checkedConvert('amount', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + dedupeKey: $checkedConvert('dedupe_key', (v) => v as String), + description: $checkedConvert('description', (v) => v as String?), + fee: $checkedConvert('fee', (v) => v as String?), + instrumentId: $checkedConvert( + 'instrument_id', + (v) => (v as num?)?.toInt(), + ), + instrumentKey: $checkedConvert('instrument_key', (v) => v as String?), + instrumentName: $checkedConvert( + 'instrument_name', + (v) => v as String?, + ), + isDuplicate: $checkedConvert('is_duplicate', (v) => v as bool), + kind: $checkedConvert('kind', (v) => v as String), + lineNo: $checkedConvert('line_no', (v) => (v as num).toInt()), + price: $checkedConvert('price', (v) => v as String?), + quantity: $checkedConvert('quantity', (v) => v as String?), + settleDate: $checkedConvert( + 'settle_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + tradeDate: $checkedConvert( + 'trade_date', + (v) => DateTime.parse(v as String), + ), + tradeNo: $checkedConvert('trade_no', (v) => v as String?), + ); + return val; + }, + fieldKeyMap: const { + 'dedupeKey': 'dedupe_key', + 'instrumentId': 'instrument_id', + 'instrumentKey': 'instrument_key', + 'instrumentName': 'instrument_name', + 'isDuplicate': 'is_duplicate', + 'lineNo': 'line_no', + 'settleDate': 'settle_date', + 'tradeDate': 'trade_date', + 'tradeNo': 'trade_no', + }, + ); + +Map _$SampleEventOutToJson(SampleEventOut instance) => + { + 'amount': instance.amount, + 'currency': instance.currency, + 'dedupe_key': instance.dedupeKey, + 'description': ?instance.description, + 'fee': ?instance.fee, + 'instrument_id': ?instance.instrumentId, + 'instrument_key': ?instance.instrumentKey, + 'instrument_name': ?instance.instrumentName, + 'is_duplicate': instance.isDuplicate, + 'kind': instance.kind, + 'line_no': instance.lineNo, + 'price': ?instance.price, + 'quantity': ?instance.quantity, + 'settle_date': ?instance.settleDate?.toIso8601String(), + 'trade_date': instance.tradeDate.toIso8601String(), + 'trade_no': ?instance.tradeNo, + }; diff --git a/app/packages/api_client/lib/src/model/target_in.dart b/app/packages/api_client/lib/src/model/target_in.dart new file mode 100644 index 0000000..31000cb --- /dev/null +++ b/app/packages/api_client/lib/src/model/target_in.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 'target_in.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TargetIn { + /// Returns a new [TargetIn] instance. + TargetIn({ + + this.band, + + required this.bucket, + + this.note, + + required this.targetWeight, + }); + + /// decimal as string + @JsonKey( + + name: r'band', + required: false, + includeIfNull: false, + ) + + + final String? band; + + + + @JsonKey( + + name: r'bucket', + required: true, + includeIfNull: false, + ) + + + final String bucket; + + + + @JsonKey( + + name: r'note', + required: false, + includeIfNull: false, + ) + + + final String? note; + + + + /// decimal as string + @JsonKey( + + name: r'target_weight', + required: true, + includeIfNull: false, + ) + + + final String targetWeight; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TargetIn && + other.band == band && + other.bucket == bucket && + other.note == note && + other.targetWeight == targetWeight; + + @override + int get hashCode => + (band == null ? 0 : band.hashCode) + + bucket.hashCode + + (note == null ? 0 : note.hashCode) + + targetWeight.hashCode; + + factory TargetIn.fromJson(Map json) => _$TargetInFromJson(json); + + Map toJson() => _$TargetInToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/target_in.g.dart b/app/packages/api_client/lib/src/model/target_in.g.dart new file mode 100644 index 0000000..f48eab3 --- /dev/null +++ b/app/packages/api_client/lib/src/model/target_in.g.dart @@ -0,0 +1,112 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'target_in.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TargetInCWProxy { + TargetIn band(String? band); + + TargetIn bucket(String bucket); + + TargetIn note(String? note); + + TargetIn targetWeight(String targetWeight); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetIn(...).copyWith(id: 12, name: "My name") + /// ```` + TargetIn call({ + String? band, + String bucket, + String? note, + String targetWeight, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetIn.copyWith.fieldName(...)` +class _$TargetInCWProxyImpl implements _$TargetInCWProxy { + const _$TargetInCWProxyImpl(this._value); + + final TargetIn _value; + + @override + TargetIn band(String? band) => this(band: band); + + @override + TargetIn bucket(String bucket) => this(bucket: bucket); + + @override + TargetIn note(String? note) => this(note: note); + + @override + TargetIn targetWeight(String targetWeight) => + this(targetWeight: targetWeight); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetIn(...).copyWith(id: 12, name: "My name") + /// ```` + TargetIn call({ + Object? band = const $CopyWithPlaceholder(), + Object? bucket = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? targetWeight = const $CopyWithPlaceholder(), + }) { + return TargetIn( + band: band == const $CopyWithPlaceholder() + ? _value.band + // ignore: cast_nullable_to_non_nullable + : band as String?, + bucket: bucket == const $CopyWithPlaceholder() + ? _value.bucket + // ignore: cast_nullable_to_non_nullable + : bucket as String, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + targetWeight: targetWeight == const $CopyWithPlaceholder() + ? _value.targetWeight + // ignore: cast_nullable_to_non_nullable + : targetWeight as String, + ); + } +} + +extension $TargetInCopyWith on TargetIn { + /// Returns a callable class that can be used as follows: `instanceOfTargetIn.copyWith(...)` or like so:`instanceOfTargetIn.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TargetInCWProxy get copyWith => _$TargetInCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TargetIn _$TargetInFromJson(Map json) => + $checkedCreate('TargetIn', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['bucket', 'target_weight']); + final val = TargetIn( + band: $checkedConvert('band', (v) => v as String?), + bucket: $checkedConvert('bucket', (v) => v as String), + note: $checkedConvert('note', (v) => v as String?), + targetWeight: $checkedConvert('target_weight', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'targetWeight': 'target_weight'}); + +Map _$TargetInToJson(TargetIn instance) => { + 'band': ?instance.band, + 'bucket': instance.bucket, + 'note': ?instance.note, + 'target_weight': instance.targetWeight, +}; diff --git a/app/packages/api_client/lib/src/model/target_out.dart b/app/packages/api_client/lib/src/model/target_out.dart new file mode 100644 index 0000000..6d95e38 --- /dev/null +++ b/app/packages/api_client/lib/src/model/target_out.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 'target_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TargetOut { + /// Returns a new [TargetOut] instance. + TargetOut({ + + required this.band, + + required this.bucket, + + required this.note, + + required this.targetWeight, + }); + + /// decimal as string + @JsonKey( + + name: r'band', + required: true, + includeIfNull: true, + ) + + + final String? band; + + + + @JsonKey( + + name: r'bucket', + required: true, + includeIfNull: false, + ) + + + final String bucket; + + + + @JsonKey( + + name: r'note', + required: true, + includeIfNull: true, + ) + + + final String? note; + + + + /// decimal as string + @JsonKey( + + name: r'target_weight', + required: true, + includeIfNull: false, + ) + + + final String targetWeight; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TargetOut && + other.band == band && + other.bucket == bucket && + other.note == note && + other.targetWeight == targetWeight; + + @override + int get hashCode => + (band == null ? 0 : band.hashCode) + + bucket.hashCode + + (note == null ? 0 : note.hashCode) + + targetWeight.hashCode; + + factory TargetOut.fromJson(Map json) => _$TargetOutFromJson(json); + + Map toJson() => _$TargetOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/target_out.g.dart b/app/packages/api_client/lib/src/model/target_out.g.dart new file mode 100644 index 0000000..f39a74a --- /dev/null +++ b/app/packages/api_client/lib/src/model/target_out.g.dart @@ -0,0 +1,115 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'target_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TargetOutCWProxy { + TargetOut band(String? band); + + TargetOut bucket(String bucket); + + TargetOut note(String? note); + + TargetOut targetWeight(String targetWeight); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetOut(...).copyWith(id: 12, name: "My name") + /// ```` + TargetOut call({ + String? band, + String bucket, + String? note, + String targetWeight, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetOut.copyWith.fieldName(...)` +class _$TargetOutCWProxyImpl implements _$TargetOutCWProxy { + const _$TargetOutCWProxyImpl(this._value); + + final TargetOut _value; + + @override + TargetOut band(String? band) => this(band: band); + + @override + TargetOut bucket(String bucket) => this(bucket: bucket); + + @override + TargetOut note(String? note) => this(note: note); + + @override + TargetOut targetWeight(String targetWeight) => + this(targetWeight: targetWeight); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetOut(...).copyWith(id: 12, name: "My name") + /// ```` + TargetOut call({ + Object? band = const $CopyWithPlaceholder(), + Object? bucket = const $CopyWithPlaceholder(), + Object? note = const $CopyWithPlaceholder(), + Object? targetWeight = const $CopyWithPlaceholder(), + }) { + return TargetOut( + band: band == const $CopyWithPlaceholder() + ? _value.band + // ignore: cast_nullable_to_non_nullable + : band as String?, + bucket: bucket == const $CopyWithPlaceholder() + ? _value.bucket + // ignore: cast_nullable_to_non_nullable + : bucket as String, + note: note == const $CopyWithPlaceholder() + ? _value.note + // ignore: cast_nullable_to_non_nullable + : note as String?, + targetWeight: targetWeight == const $CopyWithPlaceholder() + ? _value.targetWeight + // ignore: cast_nullable_to_non_nullable + : targetWeight as String, + ); + } +} + +extension $TargetOutCopyWith on TargetOut { + /// Returns a callable class that can be used as follows: `instanceOfTargetOut.copyWith(...)` or like so:`instanceOfTargetOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TargetOutCWProxy get copyWith => _$TargetOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TargetOut _$TargetOutFromJson(Map json) => + $checkedCreate('TargetOut', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['band', 'bucket', 'note', 'target_weight'], + ); + final val = TargetOut( + band: $checkedConvert('band', (v) => v as String?), + bucket: $checkedConvert('bucket', (v) => v as String), + note: $checkedConvert('note', (v) => v as String?), + targetWeight: $checkedConvert('target_weight', (v) => v as String), + ); + return val; + }, fieldKeyMap: const {'targetWeight': 'target_weight'}); + +Map _$TargetOutToJson(TargetOut instance) => { + 'band': instance.band, + 'bucket': instance.bucket, + 'note': instance.note, + 'target_weight': instance.targetWeight, +}; diff --git a/app/packages/api_client/lib/src/model/targets_in.dart b/app/packages/api_client/lib/src/model/targets_in.dart new file mode 100644 index 0000000..779c169 --- /dev/null +++ b/app/packages/api_client/lib/src/model/targets_in.dart @@ -0,0 +1,76 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/target_in.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'targets_in.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TargetsIn { + /// Returns a new [TargetsIn] instance. + TargetsIn({ + + required this.dimension, + + required this.targets, + }); + + /// asset_class | sector | country | currency + @JsonKey( + + name: r'dimension', + required: true, + includeIfNull: false, + ) + + + final String dimension; + + + + @JsonKey( + + name: r'targets', + required: true, + includeIfNull: false, + ) + + + final List targets; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TargetsIn && + other.dimension == dimension && + other.targets == targets; + + @override + int get hashCode => + dimension.hashCode + + targets.hashCode; + + factory TargetsIn.fromJson(Map json) => _$TargetsInFromJson(json); + + Map toJson() => _$TargetsInToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/targets_in.g.dart b/app/packages/api_client/lib/src/model/targets_in.g.dart new file mode 100644 index 0000000..6b55ac4 --- /dev/null +++ b/app/packages/api_client/lib/src/model/targets_in.g.dart @@ -0,0 +1,87 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'targets_in.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TargetsInCWProxy { + TargetsIn dimension(String dimension); + + TargetsIn targets(List targets); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetsIn(...).copyWith(id: 12, name: "My name") + /// ```` + TargetsIn call({String dimension, List targets}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetsIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetsIn.copyWith.fieldName(...)` +class _$TargetsInCWProxyImpl implements _$TargetsInCWProxy { + const _$TargetsInCWProxyImpl(this._value); + + final TargetsIn _value; + + @override + TargetsIn dimension(String dimension) => this(dimension: dimension); + + @override + TargetsIn targets(List targets) => this(targets: targets); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetsIn(...).copyWith(id: 12, name: "My name") + /// ```` + TargetsIn call({ + Object? dimension = const $CopyWithPlaceholder(), + Object? targets = const $CopyWithPlaceholder(), + }) { + return TargetsIn( + dimension: dimension == const $CopyWithPlaceholder() + ? _value.dimension + // ignore: cast_nullable_to_non_nullable + : dimension as String, + targets: targets == const $CopyWithPlaceholder() + ? _value.targets + // ignore: cast_nullable_to_non_nullable + : targets as List, + ); + } +} + +extension $TargetsInCopyWith on TargetsIn { + /// Returns a callable class that can be used as follows: `instanceOfTargetsIn.copyWith(...)` or like so:`instanceOfTargetsIn.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TargetsInCWProxy get copyWith => _$TargetsInCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TargetsIn _$TargetsInFromJson(Map json) => + $checkedCreate('TargetsIn', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['dimension', 'targets']); + final val = TargetsIn( + dimension: $checkedConvert('dimension', (v) => v as String), + targets: $checkedConvert( + 'targets', + (v) => (v as List) + .map((e) => TargetIn.fromJson(e as Map)) + .toList(), + ), + ); + return val; + }); + +Map _$TargetsInToJson(TargetsIn instance) => { + 'dimension': instance.dimension, + 'targets': instance.targets.map((e) => e.toJson()).toList(), +}; diff --git a/app/packages/api_client/lib/src/model/targets_out.dart b/app/packages/api_client/lib/src/model/targets_out.dart new file mode 100644 index 0000000..c5ff31c --- /dev/null +++ b/app/packages/api_client/lib/src/model/targets_out.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/target_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'targets_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TargetsOut { + /// Returns a new [TargetsOut] instance. + TargetsOut({ + + required this.dimension, + + required this.portfolioId, + + required this.targets, + + required this.weightsSum, + }); + + @JsonKey( + + name: r'dimension', + required: true, + includeIfNull: false, + ) + + + final String dimension; + + + + @JsonKey( + + name: r'portfolio_id', + required: true, + includeIfNull: false, + ) + + + final int portfolioId; + + + + @JsonKey( + + name: r'targets', + required: true, + includeIfNull: false, + ) + + + final List targets; + + + + /// decimal as string + @JsonKey( + + name: r'weights_sum', + required: true, + includeIfNull: false, + ) + + + final String weightsSum; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TargetsOut && + other.dimension == dimension && + other.portfolioId == portfolioId && + other.targets == targets && + other.weightsSum == weightsSum; + + @override + int get hashCode => + dimension.hashCode + + portfolioId.hashCode + + targets.hashCode + + weightsSum.hashCode; + + factory TargetsOut.fromJson(Map json) => _$TargetsOutFromJson(json); + + Map toJson() => _$TargetsOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/targets_out.g.dart b/app/packages/api_client/lib/src/model/targets_out.g.dart new file mode 100644 index 0000000..722432d --- /dev/null +++ b/app/packages/api_client/lib/src/model/targets_out.g.dart @@ -0,0 +1,132 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'targets_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TargetsOutCWProxy { + TargetsOut dimension(String dimension); + + TargetsOut portfolioId(int portfolioId); + + TargetsOut targets(List targets); + + TargetsOut weightsSum(String weightsSum); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetsOut(...).copyWith(id: 12, name: "My name") + /// ```` + TargetsOut call({ + String dimension, + int portfolioId, + List targets, + String weightsSum, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetsOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetsOut.copyWith.fieldName(...)` +class _$TargetsOutCWProxyImpl implements _$TargetsOutCWProxy { + const _$TargetsOutCWProxyImpl(this._value); + + final TargetsOut _value; + + @override + TargetsOut dimension(String dimension) => this(dimension: dimension); + + @override + TargetsOut portfolioId(int portfolioId) => this(portfolioId: portfolioId); + + @override + TargetsOut targets(List targets) => this(targets: targets); + + @override + TargetsOut weightsSum(String weightsSum) => this(weightsSum: weightsSum); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TargetsOut(...).copyWith(id: 12, name: "My name") + /// ```` + TargetsOut call({ + Object? dimension = const $CopyWithPlaceholder(), + Object? portfolioId = const $CopyWithPlaceholder(), + Object? targets = const $CopyWithPlaceholder(), + Object? weightsSum = const $CopyWithPlaceholder(), + }) { + return TargetsOut( + dimension: dimension == const $CopyWithPlaceholder() + ? _value.dimension + // ignore: cast_nullable_to_non_nullable + : dimension as String, + portfolioId: portfolioId == const $CopyWithPlaceholder() + ? _value.portfolioId + // ignore: cast_nullable_to_non_nullable + : portfolioId as int, + targets: targets == const $CopyWithPlaceholder() + ? _value.targets + // ignore: cast_nullable_to_non_nullable + : targets as List, + weightsSum: weightsSum == const $CopyWithPlaceholder() + ? _value.weightsSum + // ignore: cast_nullable_to_non_nullable + : weightsSum as String, + ); + } +} + +extension $TargetsOutCopyWith on TargetsOut { + /// Returns a callable class that can be used as follows: `instanceOfTargetsOut.copyWith(...)` or like so:`instanceOfTargetsOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TargetsOutCWProxy get copyWith => _$TargetsOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TargetsOut _$TargetsOutFromJson(Map json) => $checkedCreate( + 'TargetsOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'dimension', + 'portfolio_id', + 'targets', + 'weights_sum', + ], + ); + final val = TargetsOut( + dimension: $checkedConvert('dimension', (v) => v as String), + portfolioId: $checkedConvert('portfolio_id', (v) => (v as num).toInt()), + targets: $checkedConvert( + 'targets', + (v) => (v as List) + .map((e) => TargetOut.fromJson(e as Map)) + .toList(), + ), + weightsSum: $checkedConvert('weights_sum', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'portfolioId': 'portfolio_id', + 'weightsSum': 'weights_sum', + }, +); + +Map _$TargetsOutToJson(TargetsOut instance) => + { + 'dimension': instance.dimension, + 'portfolio_id': instance.portfolioId, + 'targets': instance.targets.map((e) => e.toJson()).toList(), + 'weights_sum': instance.weightsSum, + }; diff --git a/app/packages/api_client/lib/src/model/tax_account_out.dart b/app/packages/api_client/lib/src/model/tax_account_out.dart new file mode 100644 index 0000000..0eb0307 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_account_out.dart @@ -0,0 +1,210 @@ +// +// 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 'tax_account_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TaxAccountOut { + /// Returns a new [TaxAccountOut] instance. + TaxAccountOut({ + + required this.accountId, + + required this.accountName, + + required this.couponsGrossRub, + + required this.dividendsGrossRub, + + required this.estimatedTaxRub, + + required this.ldvExemptRub, + + required this.realizedGainRub, + + required this.realizedLossRub, + + required this.taxWithheldRub, + + required this.taxableBaseRub, + }); + + @JsonKey( + + name: r'account_id', + required: true, + includeIfNull: false, + ) + + + final int accountId; + + + + @JsonKey( + + name: r'account_name', + required: true, + includeIfNull: false, + ) + + + final String accountName; + + + + /// decimal as string + @JsonKey( + + name: r'coupons_gross_rub', + required: true, + includeIfNull: false, + ) + + + final String couponsGrossRub; + + + + /// decimal as string + @JsonKey( + + name: r'dividends_gross_rub', + required: true, + includeIfNull: false, + ) + + + final String dividendsGrossRub; + + + + /// decimal as string + @JsonKey( + + name: r'estimated_tax_rub', + required: true, + includeIfNull: false, + ) + + + final String estimatedTaxRub; + + + + /// decimal as string + @JsonKey( + + name: r'ldv_exempt_rub', + required: true, + includeIfNull: false, + ) + + + final String ldvExemptRub; + + + + /// decimal as string + @JsonKey( + + name: r'realized_gain_rub', + required: true, + includeIfNull: false, + ) + + + final String realizedGainRub; + + + + /// decimal as string + @JsonKey( + + name: r'realized_loss_rub', + required: true, + includeIfNull: false, + ) + + + final String realizedLossRub; + + + + /// decimal as string + @JsonKey( + + name: r'tax_withheld_rub', + required: true, + includeIfNull: false, + ) + + + final String taxWithheldRub; + + + + /// decimal as string + @JsonKey( + + name: r'taxable_base_rub', + required: true, + includeIfNull: false, + ) + + + final String taxableBaseRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TaxAccountOut && + other.accountId == accountId && + other.accountName == accountName && + other.couponsGrossRub == couponsGrossRub && + other.dividendsGrossRub == dividendsGrossRub && + other.estimatedTaxRub == estimatedTaxRub && + other.ldvExemptRub == ldvExemptRub && + other.realizedGainRub == realizedGainRub && + other.realizedLossRub == realizedLossRub && + other.taxWithheldRub == taxWithheldRub && + other.taxableBaseRub == taxableBaseRub; + + @override + int get hashCode => + accountId.hashCode + + accountName.hashCode + + couponsGrossRub.hashCode + + dividendsGrossRub.hashCode + + estimatedTaxRub.hashCode + + ldvExemptRub.hashCode + + realizedGainRub.hashCode + + realizedLossRub.hashCode + + taxWithheldRub.hashCode + + taxableBaseRub.hashCode; + + factory TaxAccountOut.fromJson(Map json) => _$TaxAccountOutFromJson(json); + + Map toJson() => _$TaxAccountOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/tax_account_out.g.dart b/app/packages/api_client/lib/src/model/tax_account_out.g.dart new file mode 100644 index 0000000..a680d30 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_account_out.g.dart @@ -0,0 +1,233 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tax_account_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TaxAccountOutCWProxy { + TaxAccountOut accountId(int accountId); + + TaxAccountOut accountName(String accountName); + + TaxAccountOut couponsGrossRub(String couponsGrossRub); + + TaxAccountOut dividendsGrossRub(String dividendsGrossRub); + + TaxAccountOut estimatedTaxRub(String estimatedTaxRub); + + TaxAccountOut ldvExemptRub(String ldvExemptRub); + + TaxAccountOut realizedGainRub(String realizedGainRub); + + TaxAccountOut realizedLossRub(String realizedLossRub); + + TaxAccountOut taxWithheldRub(String taxWithheldRub); + + TaxAccountOut taxableBaseRub(String taxableBaseRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxAccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxAccountOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxAccountOut call({ + int accountId, + String accountName, + String couponsGrossRub, + String dividendsGrossRub, + String estimatedTaxRub, + String ldvExemptRub, + String realizedGainRub, + String realizedLossRub, + String taxWithheldRub, + String taxableBaseRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxAccountOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxAccountOut.copyWith.fieldName(...)` +class _$TaxAccountOutCWProxyImpl implements _$TaxAccountOutCWProxy { + const _$TaxAccountOutCWProxyImpl(this._value); + + final TaxAccountOut _value; + + @override + TaxAccountOut accountId(int accountId) => this(accountId: accountId); + + @override + TaxAccountOut accountName(String accountName) => + this(accountName: accountName); + + @override + TaxAccountOut couponsGrossRub(String couponsGrossRub) => + this(couponsGrossRub: couponsGrossRub); + + @override + TaxAccountOut dividendsGrossRub(String dividendsGrossRub) => + this(dividendsGrossRub: dividendsGrossRub); + + @override + TaxAccountOut estimatedTaxRub(String estimatedTaxRub) => + this(estimatedTaxRub: estimatedTaxRub); + + @override + TaxAccountOut ldvExemptRub(String ldvExemptRub) => + this(ldvExemptRub: ldvExemptRub); + + @override + TaxAccountOut realizedGainRub(String realizedGainRub) => + this(realizedGainRub: realizedGainRub); + + @override + TaxAccountOut realizedLossRub(String realizedLossRub) => + this(realizedLossRub: realizedLossRub); + + @override + TaxAccountOut taxWithheldRub(String taxWithheldRub) => + this(taxWithheldRub: taxWithheldRub); + + @override + TaxAccountOut taxableBaseRub(String taxableBaseRub) => + this(taxableBaseRub: taxableBaseRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxAccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxAccountOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxAccountOut call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? accountName = const $CopyWithPlaceholder(), + Object? couponsGrossRub = const $CopyWithPlaceholder(), + Object? dividendsGrossRub = const $CopyWithPlaceholder(), + Object? estimatedTaxRub = const $CopyWithPlaceholder(), + Object? ldvExemptRub = const $CopyWithPlaceholder(), + Object? realizedGainRub = const $CopyWithPlaceholder(), + Object? realizedLossRub = const $CopyWithPlaceholder(), + Object? taxWithheldRub = const $CopyWithPlaceholder(), + Object? taxableBaseRub = const $CopyWithPlaceholder(), + }) { + return TaxAccountOut( + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int, + accountName: accountName == const $CopyWithPlaceholder() + ? _value.accountName + // ignore: cast_nullable_to_non_nullable + : accountName as String, + couponsGrossRub: couponsGrossRub == const $CopyWithPlaceholder() + ? _value.couponsGrossRub + // ignore: cast_nullable_to_non_nullable + : couponsGrossRub as String, + dividendsGrossRub: dividendsGrossRub == const $CopyWithPlaceholder() + ? _value.dividendsGrossRub + // ignore: cast_nullable_to_non_nullable + : dividendsGrossRub as String, + estimatedTaxRub: estimatedTaxRub == const $CopyWithPlaceholder() + ? _value.estimatedTaxRub + // ignore: cast_nullable_to_non_nullable + : estimatedTaxRub as String, + ldvExemptRub: ldvExemptRub == const $CopyWithPlaceholder() + ? _value.ldvExemptRub + // ignore: cast_nullable_to_non_nullable + : ldvExemptRub as String, + realizedGainRub: realizedGainRub == const $CopyWithPlaceholder() + ? _value.realizedGainRub + // ignore: cast_nullable_to_non_nullable + : realizedGainRub as String, + realizedLossRub: realizedLossRub == const $CopyWithPlaceholder() + ? _value.realizedLossRub + // ignore: cast_nullable_to_non_nullable + : realizedLossRub as String, + taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder() + ? _value.taxWithheldRub + // ignore: cast_nullable_to_non_nullable + : taxWithheldRub as String, + taxableBaseRub: taxableBaseRub == const $CopyWithPlaceholder() + ? _value.taxableBaseRub + // ignore: cast_nullable_to_non_nullable + : taxableBaseRub as String, + ); + } +} + +extension $TaxAccountOutCopyWith on TaxAccountOut { + /// Returns a callable class that can be used as follows: `instanceOfTaxAccountOut.copyWith(...)` or like so:`instanceOfTaxAccountOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TaxAccountOutCWProxy get copyWith => _$TaxAccountOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaxAccountOut _$TaxAccountOutFromJson( + Map json, +) => $checkedCreate( + 'TaxAccountOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'account_id', + 'account_name', + 'coupons_gross_rub', + 'dividends_gross_rub', + 'estimated_tax_rub', + 'ldv_exempt_rub', + 'realized_gain_rub', + 'realized_loss_rub', + 'tax_withheld_rub', + 'taxable_base_rub', + ], + ); + final val = TaxAccountOut( + accountId: $checkedConvert('account_id', (v) => (v as num).toInt()), + accountName: $checkedConvert('account_name', (v) => v as String), + couponsGrossRub: $checkedConvert('coupons_gross_rub', (v) => v as String), + dividendsGrossRub: $checkedConvert( + 'dividends_gross_rub', + (v) => v as String, + ), + estimatedTaxRub: $checkedConvert('estimated_tax_rub', (v) => v as String), + ldvExemptRub: $checkedConvert('ldv_exempt_rub', (v) => v as String), + realizedGainRub: $checkedConvert('realized_gain_rub', (v) => v as String), + realizedLossRub: $checkedConvert('realized_loss_rub', (v) => v as String), + taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String), + taxableBaseRub: $checkedConvert('taxable_base_rub', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'accountId': 'account_id', + 'accountName': 'account_name', + 'couponsGrossRub': 'coupons_gross_rub', + 'dividendsGrossRub': 'dividends_gross_rub', + 'estimatedTaxRub': 'estimated_tax_rub', + 'ldvExemptRub': 'ldv_exempt_rub', + 'realizedGainRub': 'realized_gain_rub', + 'realizedLossRub': 'realized_loss_rub', + 'taxWithheldRub': 'tax_withheld_rub', + 'taxableBaseRub': 'taxable_base_rub', + }, +); + +Map _$TaxAccountOutToJson(TaxAccountOut instance) => + { + 'account_id': instance.accountId, + 'account_name': instance.accountName, + 'coupons_gross_rub': instance.couponsGrossRub, + 'dividends_gross_rub': instance.dividendsGrossRub, + 'estimated_tax_rub': instance.estimatedTaxRub, + 'ldv_exempt_rub': instance.ldvExemptRub, + 'realized_gain_rub': instance.realizedGainRub, + 'realized_loss_rub': instance.realizedLossRub, + 'tax_withheld_rub': instance.taxWithheldRub, + 'taxable_base_rub': instance.taxableBaseRub, + }; diff --git a/app/packages/api_client/lib/src/model/tax_lot_out.dart b/app/packages/api_client/lib/src/model/tax_lot_out.dart new file mode 100644 index 0000000..ab756c7 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_lot_out.dart @@ -0,0 +1,287 @@ +// +// 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 'tax_lot_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TaxLotOut { + /// Returns a new [TaxLotOut] instance. + TaxLotOut({ + + required this.accountId, + + required this.accountName, + + required this.costRub, + + required this.daysToLdv, + + required this.instrumentId, + + required this.ldvDate, + + required this.ldvEligible, + + required this.lotId, + + required this.marketValueRub, + + required this.name, + + required this.openDate, + + required this.qtyRemaining, + + required this.taxIfSoldNowRub, + + required this.ticker, + + required this.unrealizedGainRub, + }); + + @JsonKey( + + name: r'account_id', + required: true, + includeIfNull: false, + ) + + + final int accountId; + + + + @JsonKey( + + name: r'account_name', + required: true, + includeIfNull: false, + ) + + + final String accountName; + + + + /// decimal as string + @JsonKey( + + name: r'cost_rub', + required: true, + includeIfNull: true, + ) + + + final String? costRub; + + + + @JsonKey( + + name: r'days_to_ldv', + required: true, + includeIfNull: true, + ) + + + final int? daysToLdv; + + + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: false, + ) + + + final int instrumentId; + + + + @JsonKey( + + name: r'ldv_date', + required: true, + includeIfNull: true, + ) + + + final DateTime? ldvDate; + + + + @JsonKey( + + name: r'ldv_eligible', + required: true, + includeIfNull: false, + ) + + + final bool ldvEligible; + + + + @JsonKey( + + name: r'lot_id', + required: true, + includeIfNull: false, + ) + + + final int lotId; + + + + /// decimal as string + @JsonKey( + + name: r'market_value_rub', + required: true, + includeIfNull: true, + ) + + + final String? marketValueRub; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + @JsonKey( + + name: r'open_date', + required: true, + includeIfNull: false, + ) + + + final DateTime openDate; + + + + /// decimal as string + @JsonKey( + + name: r'qty_remaining', + required: true, + includeIfNull: false, + ) + + + final String qtyRemaining; + + + + /// decimal as string + @JsonKey( + + name: r'tax_if_sold_now_rub', + required: true, + includeIfNull: true, + ) + + + final String? taxIfSoldNowRub; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: true, + ) + + + final String? ticker; + + + + /// decimal as string + @JsonKey( + + name: r'unrealized_gain_rub', + required: true, + includeIfNull: true, + ) + + + final String? unrealizedGainRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TaxLotOut && + other.accountId == accountId && + other.accountName == accountName && + other.costRub == costRub && + other.daysToLdv == daysToLdv && + other.instrumentId == instrumentId && + other.ldvDate == ldvDate && + other.ldvEligible == ldvEligible && + other.lotId == lotId && + other.marketValueRub == marketValueRub && + other.name == name && + other.openDate == openDate && + other.qtyRemaining == qtyRemaining && + other.taxIfSoldNowRub == taxIfSoldNowRub && + other.ticker == ticker && + other.unrealizedGainRub == unrealizedGainRub; + + @override + int get hashCode => + accountId.hashCode + + accountName.hashCode + + (costRub == null ? 0 : costRub.hashCode) + + (daysToLdv == null ? 0 : daysToLdv.hashCode) + + instrumentId.hashCode + + (ldvDate == null ? 0 : ldvDate.hashCode) + + ldvEligible.hashCode + + lotId.hashCode + + (marketValueRub == null ? 0 : marketValueRub.hashCode) + + name.hashCode + + openDate.hashCode + + qtyRemaining.hashCode + + (taxIfSoldNowRub == null ? 0 : taxIfSoldNowRub.hashCode) + + (ticker == null ? 0 : ticker.hashCode) + + (unrealizedGainRub == null ? 0 : unrealizedGainRub.hashCode); + + factory TaxLotOut.fromJson(Map json) => _$TaxLotOutFromJson(json); + + Map toJson() => _$TaxLotOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/tax_lot_out.g.dart b/app/packages/api_client/lib/src/model/tax_lot_out.g.dart new file mode 100644 index 0000000..06f4d7c --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_lot_out.g.dart @@ -0,0 +1,307 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tax_lot_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TaxLotOutCWProxy { + TaxLotOut accountId(int accountId); + + TaxLotOut accountName(String accountName); + + TaxLotOut costRub(String? costRub); + + TaxLotOut daysToLdv(int? daysToLdv); + + TaxLotOut instrumentId(int instrumentId); + + TaxLotOut ldvDate(DateTime? ldvDate); + + TaxLotOut ldvEligible(bool ldvEligible); + + TaxLotOut lotId(int lotId); + + TaxLotOut marketValueRub(String? marketValueRub); + + TaxLotOut name(String name); + + TaxLotOut openDate(DateTime openDate); + + TaxLotOut qtyRemaining(String qtyRemaining); + + TaxLotOut taxIfSoldNowRub(String? taxIfSoldNowRub); + + TaxLotOut ticker(String? ticker); + + TaxLotOut unrealizedGainRub(String? unrealizedGainRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxLotOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxLotOut call({ + int accountId, + String accountName, + String? costRub, + int? daysToLdv, + int instrumentId, + DateTime? ldvDate, + bool ldvEligible, + int lotId, + String? marketValueRub, + String name, + DateTime openDate, + String qtyRemaining, + String? taxIfSoldNowRub, + String? ticker, + String? unrealizedGainRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxLotOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxLotOut.copyWith.fieldName(...)` +class _$TaxLotOutCWProxyImpl implements _$TaxLotOutCWProxy { + const _$TaxLotOutCWProxyImpl(this._value); + + final TaxLotOut _value; + + @override + TaxLotOut accountId(int accountId) => this(accountId: accountId); + + @override + TaxLotOut accountName(String accountName) => this(accountName: accountName); + + @override + TaxLotOut costRub(String? costRub) => this(costRub: costRub); + + @override + TaxLotOut daysToLdv(int? daysToLdv) => this(daysToLdv: daysToLdv); + + @override + TaxLotOut instrumentId(int instrumentId) => this(instrumentId: instrumentId); + + @override + TaxLotOut ldvDate(DateTime? ldvDate) => this(ldvDate: ldvDate); + + @override + TaxLotOut ldvEligible(bool ldvEligible) => this(ldvEligible: ldvEligible); + + @override + TaxLotOut lotId(int lotId) => this(lotId: lotId); + + @override + TaxLotOut marketValueRub(String? marketValueRub) => + this(marketValueRub: marketValueRub); + + @override + TaxLotOut name(String name) => this(name: name); + + @override + TaxLotOut openDate(DateTime openDate) => this(openDate: openDate); + + @override + TaxLotOut qtyRemaining(String qtyRemaining) => + this(qtyRemaining: qtyRemaining); + + @override + TaxLotOut taxIfSoldNowRub(String? taxIfSoldNowRub) => + this(taxIfSoldNowRub: taxIfSoldNowRub); + + @override + TaxLotOut ticker(String? ticker) => this(ticker: ticker); + + @override + TaxLotOut unrealizedGainRub(String? unrealizedGainRub) => + this(unrealizedGainRub: unrealizedGainRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxLotOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxLotOut call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? accountName = const $CopyWithPlaceholder(), + Object? costRub = const $CopyWithPlaceholder(), + Object? daysToLdv = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? ldvDate = const $CopyWithPlaceholder(), + Object? ldvEligible = const $CopyWithPlaceholder(), + Object? lotId = const $CopyWithPlaceholder(), + Object? marketValueRub = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? openDate = const $CopyWithPlaceholder(), + Object? qtyRemaining = const $CopyWithPlaceholder(), + Object? taxIfSoldNowRub = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + Object? unrealizedGainRub = const $CopyWithPlaceholder(), + }) { + return TaxLotOut( + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int, + accountName: accountName == const $CopyWithPlaceholder() + ? _value.accountName + // ignore: cast_nullable_to_non_nullable + : accountName as String, + costRub: costRub == const $CopyWithPlaceholder() + ? _value.costRub + // ignore: cast_nullable_to_non_nullable + : costRub as String?, + daysToLdv: daysToLdv == const $CopyWithPlaceholder() + ? _value.daysToLdv + // ignore: cast_nullable_to_non_nullable + : daysToLdv as int?, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int, + ldvDate: ldvDate == const $CopyWithPlaceholder() + ? _value.ldvDate + // ignore: cast_nullable_to_non_nullable + : ldvDate as DateTime?, + ldvEligible: ldvEligible == const $CopyWithPlaceholder() + ? _value.ldvEligible + // ignore: cast_nullable_to_non_nullable + : ldvEligible as bool, + lotId: lotId == const $CopyWithPlaceholder() + ? _value.lotId + // ignore: cast_nullable_to_non_nullable + : lotId as int, + marketValueRub: marketValueRub == const $CopyWithPlaceholder() + ? _value.marketValueRub + // ignore: cast_nullable_to_non_nullable + : marketValueRub as String?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + openDate: openDate == const $CopyWithPlaceholder() + ? _value.openDate + // ignore: cast_nullable_to_non_nullable + : openDate as DateTime, + qtyRemaining: qtyRemaining == const $CopyWithPlaceholder() + ? _value.qtyRemaining + // ignore: cast_nullable_to_non_nullable + : qtyRemaining as String, + taxIfSoldNowRub: taxIfSoldNowRub == const $CopyWithPlaceholder() + ? _value.taxIfSoldNowRub + // ignore: cast_nullable_to_non_nullable + : taxIfSoldNowRub as String?, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String?, + unrealizedGainRub: unrealizedGainRub == const $CopyWithPlaceholder() + ? _value.unrealizedGainRub + // ignore: cast_nullable_to_non_nullable + : unrealizedGainRub as String?, + ); + } +} + +extension $TaxLotOutCopyWith on TaxLotOut { + /// Returns a callable class that can be used as follows: `instanceOfTaxLotOut.copyWith(...)` or like so:`instanceOfTaxLotOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TaxLotOutCWProxy get copyWith => _$TaxLotOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaxLotOut _$TaxLotOutFromJson(Map json) => $checkedCreate( + 'TaxLotOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'account_id', + 'account_name', + 'cost_rub', + 'days_to_ldv', + 'instrument_id', + 'ldv_date', + 'ldv_eligible', + 'lot_id', + 'market_value_rub', + 'name', + 'open_date', + 'qty_remaining', + 'tax_if_sold_now_rub', + 'ticker', + 'unrealized_gain_rub', + ], + ); + final val = TaxLotOut( + accountId: $checkedConvert('account_id', (v) => (v as num).toInt()), + accountName: $checkedConvert('account_name', (v) => v as String), + costRub: $checkedConvert('cost_rub', (v) => v as String?), + daysToLdv: $checkedConvert('days_to_ldv', (v) => (v as num?)?.toInt()), + instrumentId: $checkedConvert('instrument_id', (v) => (v as num).toInt()), + ldvDate: $checkedConvert( + 'ldv_date', + (v) => v == null ? null : DateTime.parse(v as String), + ), + ldvEligible: $checkedConvert('ldv_eligible', (v) => v as bool), + lotId: $checkedConvert('lot_id', (v) => (v as num).toInt()), + marketValueRub: $checkedConvert('market_value_rub', (v) => v as String?), + name: $checkedConvert('name', (v) => v as String), + openDate: $checkedConvert( + 'open_date', + (v) => DateTime.parse(v as String), + ), + qtyRemaining: $checkedConvert('qty_remaining', (v) => v as String), + taxIfSoldNowRub: $checkedConvert( + 'tax_if_sold_now_rub', + (v) => v as String?, + ), + ticker: $checkedConvert('ticker', (v) => v as String?), + unrealizedGainRub: $checkedConvert( + 'unrealized_gain_rub', + (v) => v as String?, + ), + ); + return val; + }, + fieldKeyMap: const { + 'accountId': 'account_id', + 'accountName': 'account_name', + 'costRub': 'cost_rub', + 'daysToLdv': 'days_to_ldv', + 'instrumentId': 'instrument_id', + 'ldvDate': 'ldv_date', + 'ldvEligible': 'ldv_eligible', + 'lotId': 'lot_id', + 'marketValueRub': 'market_value_rub', + 'openDate': 'open_date', + 'qtyRemaining': 'qty_remaining', + 'taxIfSoldNowRub': 'tax_if_sold_now_rub', + 'unrealizedGainRub': 'unrealized_gain_rub', + }, +); + +Map _$TaxLotOutToJson(TaxLotOut instance) => { + 'account_id': instance.accountId, + 'account_name': instance.accountName, + 'cost_rub': instance.costRub, + 'days_to_ldv': instance.daysToLdv, + 'instrument_id': instance.instrumentId, + 'ldv_date': instance.ldvDate?.toIso8601String(), + 'ldv_eligible': instance.ldvEligible, + 'lot_id': instance.lotId, + 'market_value_rub': instance.marketValueRub, + 'name': instance.name, + 'open_date': instance.openDate.toIso8601String(), + 'qty_remaining': instance.qtyRemaining, + 'tax_if_sold_now_rub': instance.taxIfSoldNowRub, + 'ticker': instance.ticker, + 'unrealized_gain_rub': instance.unrealizedGainRub, +}; diff --git a/app/packages/api_client/lib/src/model/tax_lots_out.dart b/app/packages/api_client/lib/src/model/tax_lots_out.dart new file mode 100644 index 0000000..b380281 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_lots_out.dart @@ -0,0 +1,140 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/tax_lot_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'tax_lots_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TaxLotsOut { + /// Returns a new [TaxLotsOut] instance. + TaxLotsOut({ + + required this.asOf, + + required this.disclaimer, + + this.estimated = true, + + required this.lots, + + required this.taxRate, + + required this.year, + }); + + @JsonKey( + + name: r'as_of', + required: true, + includeIfNull: false, + ) + + + final DateTime asOf; + + + + @JsonKey( + + name: r'disclaimer', + required: true, + includeIfNull: false, + ) + + + final String disclaimer; + + + + @JsonKey( + defaultValue: true, + name: r'estimated', + required: false, + includeIfNull: false, + ) + + + final bool? estimated; + + + + @JsonKey( + + name: r'lots', + required: true, + includeIfNull: false, + ) + + + final List lots; + + + + /// decimal as string + @JsonKey( + + name: r'tax_rate', + required: true, + includeIfNull: false, + ) + + + final String taxRate; + + + + @JsonKey( + + name: r'year', + required: true, + includeIfNull: false, + ) + + + final int year; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TaxLotsOut && + other.asOf == asOf && + other.disclaimer == disclaimer && + other.estimated == estimated && + other.lots == lots && + other.taxRate == taxRate && + other.year == year; + + @override + int get hashCode => + asOf.hashCode + + disclaimer.hashCode + + estimated.hashCode + + lots.hashCode + + taxRate.hashCode + + year.hashCode; + + factory TaxLotsOut.fromJson(Map json) => _$TaxLotsOutFromJson(json); + + Map toJson() => _$TaxLotsOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/tax_lots_out.g.dart b/app/packages/api_client/lib/src/model/tax_lots_out.g.dart new file mode 100644 index 0000000..da737c0 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_lots_out.g.dart @@ -0,0 +1,146 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tax_lots_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TaxLotsOutCWProxy { + TaxLotsOut asOf(DateTime asOf); + + TaxLotsOut disclaimer(String disclaimer); + + TaxLotsOut estimated(bool? estimated); + + TaxLotsOut lots(List lots); + + TaxLotsOut taxRate(String taxRate); + + TaxLotsOut year(int year); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxLotsOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxLotsOut call({ + DateTime asOf, + String disclaimer, + bool? estimated, + List lots, + String taxRate, + int year, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxLotsOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxLotsOut.copyWith.fieldName(...)` +class _$TaxLotsOutCWProxyImpl implements _$TaxLotsOutCWProxy { + const _$TaxLotsOutCWProxyImpl(this._value); + + final TaxLotsOut _value; + + @override + TaxLotsOut asOf(DateTime asOf) => this(asOf: asOf); + + @override + TaxLotsOut disclaimer(String disclaimer) => this(disclaimer: disclaimer); + + @override + TaxLotsOut estimated(bool? estimated) => this(estimated: estimated); + + @override + TaxLotsOut lots(List lots) => this(lots: lots); + + @override + TaxLotsOut taxRate(String taxRate) => this(taxRate: taxRate); + + @override + TaxLotsOut year(int year) => this(year: year); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxLotsOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxLotsOut call({ + Object? asOf = const $CopyWithPlaceholder(), + Object? disclaimer = const $CopyWithPlaceholder(), + Object? estimated = const $CopyWithPlaceholder(), + Object? lots = const $CopyWithPlaceholder(), + Object? taxRate = const $CopyWithPlaceholder(), + Object? year = const $CopyWithPlaceholder(), + }) { + return TaxLotsOut( + asOf: asOf == const $CopyWithPlaceholder() + ? _value.asOf + // ignore: cast_nullable_to_non_nullable + : asOf as DateTime, + disclaimer: disclaimer == const $CopyWithPlaceholder() + ? _value.disclaimer + // ignore: cast_nullable_to_non_nullable + : disclaimer as String, + estimated: estimated == const $CopyWithPlaceholder() + ? _value.estimated + // ignore: cast_nullable_to_non_nullable + : estimated as bool?, + lots: lots == const $CopyWithPlaceholder() + ? _value.lots + // ignore: cast_nullable_to_non_nullable + : lots as List, + taxRate: taxRate == const $CopyWithPlaceholder() + ? _value.taxRate + // ignore: cast_nullable_to_non_nullable + : taxRate as String, + year: year == const $CopyWithPlaceholder() + ? _value.year + // ignore: cast_nullable_to_non_nullable + : year as int, + ); + } +} + +extension $TaxLotsOutCopyWith on TaxLotsOut { + /// Returns a callable class that can be used as follows: `instanceOfTaxLotsOut.copyWith(...)` or like so:`instanceOfTaxLotsOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TaxLotsOutCWProxy get copyWith => _$TaxLotsOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaxLotsOut _$TaxLotsOutFromJson(Map json) => + $checkedCreate('TaxLotsOut', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const ['as_of', 'disclaimer', 'lots', 'tax_rate', 'year'], + ); + final val = TaxLotsOut( + asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)), + disclaimer: $checkedConvert('disclaimer', (v) => v as String), + estimated: $checkedConvert('estimated', (v) => v as bool? ?? true), + lots: $checkedConvert( + 'lots', + (v) => (v as List) + .map((e) => TaxLotOut.fromJson(e as Map)) + .toList(), + ), + taxRate: $checkedConvert('tax_rate', (v) => v as String), + year: $checkedConvert('year', (v) => (v as num).toInt()), + ); + return val; + }, fieldKeyMap: const {'asOf': 'as_of', 'taxRate': 'tax_rate'}); + +Map _$TaxLotsOutToJson(TaxLotsOut instance) => + { + 'as_of': instance.asOf.toIso8601String(), + 'disclaimer': instance.disclaimer, + 'estimated': ?instance.estimated, + 'lots': instance.lots.map((e) => e.toJson()).toList(), + 'tax_rate': instance.taxRate, + 'year': instance.year, + }; diff --git a/app/packages/api_client/lib/src/model/tax_totals.dart b/app/packages/api_client/lib/src/model/tax_totals.dart new file mode 100644 index 0000000..3103117 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_totals.dart @@ -0,0 +1,178 @@ +// +// 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 'tax_totals.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TaxTotals { + /// Returns a new [TaxTotals] instance. + TaxTotals({ + + required this.couponsGrossRub, + + required this.dividendsGrossRub, + + required this.estimatedTaxRub, + + required this.ldvExemptRub, + + required this.realizedGainRub, + + required this.realizedLossRub, + + required this.taxWithheldRub, + + required this.taxableBaseRub, + }); + + /// decimal as string + @JsonKey( + + name: r'coupons_gross_rub', + required: true, + includeIfNull: false, + ) + + + final String couponsGrossRub; + + + + /// decimal as string + @JsonKey( + + name: r'dividends_gross_rub', + required: true, + includeIfNull: false, + ) + + + final String dividendsGrossRub; + + + + /// decimal as string + @JsonKey( + + name: r'estimated_tax_rub', + required: true, + includeIfNull: false, + ) + + + final String estimatedTaxRub; + + + + /// decimal as string + @JsonKey( + + name: r'ldv_exempt_rub', + required: true, + includeIfNull: false, + ) + + + final String ldvExemptRub; + + + + /// decimal as string + @JsonKey( + + name: r'realized_gain_rub', + required: true, + includeIfNull: false, + ) + + + final String realizedGainRub; + + + + /// decimal as string + @JsonKey( + + name: r'realized_loss_rub', + required: true, + includeIfNull: false, + ) + + + final String realizedLossRub; + + + + /// decimal as string + @JsonKey( + + name: r'tax_withheld_rub', + required: true, + includeIfNull: false, + ) + + + final String taxWithheldRub; + + + + /// decimal as string + @JsonKey( + + name: r'taxable_base_rub', + required: true, + includeIfNull: false, + ) + + + final String taxableBaseRub; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TaxTotals && + other.couponsGrossRub == couponsGrossRub && + other.dividendsGrossRub == dividendsGrossRub && + other.estimatedTaxRub == estimatedTaxRub && + other.ldvExemptRub == ldvExemptRub && + other.realizedGainRub == realizedGainRub && + other.realizedLossRub == realizedLossRub && + other.taxWithheldRub == taxWithheldRub && + other.taxableBaseRub == taxableBaseRub; + + @override + int get hashCode => + couponsGrossRub.hashCode + + dividendsGrossRub.hashCode + + estimatedTaxRub.hashCode + + ldvExemptRub.hashCode + + realizedGainRub.hashCode + + realizedLossRub.hashCode + + taxWithheldRub.hashCode + + taxableBaseRub.hashCode; + + factory TaxTotals.fromJson(Map json) => _$TaxTotalsFromJson(json); + + Map toJson() => _$TaxTotalsToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/tax_totals.g.dart b/app/packages/api_client/lib/src/model/tax_totals.g.dart new file mode 100644 index 0000000..be0faa9 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_totals.g.dart @@ -0,0 +1,199 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tax_totals.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TaxTotalsCWProxy { + TaxTotals couponsGrossRub(String couponsGrossRub); + + TaxTotals dividendsGrossRub(String dividendsGrossRub); + + TaxTotals estimatedTaxRub(String estimatedTaxRub); + + TaxTotals ldvExemptRub(String ldvExemptRub); + + TaxTotals realizedGainRub(String realizedGainRub); + + TaxTotals realizedLossRub(String realizedLossRub); + + TaxTotals taxWithheldRub(String taxWithheldRub); + + TaxTotals taxableBaseRub(String taxableBaseRub); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxTotals(...).copyWith(id: 12, name: "My name") + /// ```` + TaxTotals call({ + String couponsGrossRub, + String dividendsGrossRub, + String estimatedTaxRub, + String ldvExemptRub, + String realizedGainRub, + String realizedLossRub, + String taxWithheldRub, + String taxableBaseRub, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxTotals.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxTotals.copyWith.fieldName(...)` +class _$TaxTotalsCWProxyImpl implements _$TaxTotalsCWProxy { + const _$TaxTotalsCWProxyImpl(this._value); + + final TaxTotals _value; + + @override + TaxTotals couponsGrossRub(String couponsGrossRub) => + this(couponsGrossRub: couponsGrossRub); + + @override + TaxTotals dividendsGrossRub(String dividendsGrossRub) => + this(dividendsGrossRub: dividendsGrossRub); + + @override + TaxTotals estimatedTaxRub(String estimatedTaxRub) => + this(estimatedTaxRub: estimatedTaxRub); + + @override + TaxTotals ldvExemptRub(String ldvExemptRub) => + this(ldvExemptRub: ldvExemptRub); + + @override + TaxTotals realizedGainRub(String realizedGainRub) => + this(realizedGainRub: realizedGainRub); + + @override + TaxTotals realizedLossRub(String realizedLossRub) => + this(realizedLossRub: realizedLossRub); + + @override + TaxTotals taxWithheldRub(String taxWithheldRub) => + this(taxWithheldRub: taxWithheldRub); + + @override + TaxTotals taxableBaseRub(String taxableBaseRub) => + this(taxableBaseRub: taxableBaseRub); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxTotals(...).copyWith(id: 12, name: "My name") + /// ```` + TaxTotals call({ + Object? couponsGrossRub = const $CopyWithPlaceholder(), + Object? dividendsGrossRub = const $CopyWithPlaceholder(), + Object? estimatedTaxRub = const $CopyWithPlaceholder(), + Object? ldvExemptRub = const $CopyWithPlaceholder(), + Object? realizedGainRub = const $CopyWithPlaceholder(), + Object? realizedLossRub = const $CopyWithPlaceholder(), + Object? taxWithheldRub = const $CopyWithPlaceholder(), + Object? taxableBaseRub = const $CopyWithPlaceholder(), + }) { + return TaxTotals( + couponsGrossRub: couponsGrossRub == const $CopyWithPlaceholder() + ? _value.couponsGrossRub + // ignore: cast_nullable_to_non_nullable + : couponsGrossRub as String, + dividendsGrossRub: dividendsGrossRub == const $CopyWithPlaceholder() + ? _value.dividendsGrossRub + // ignore: cast_nullable_to_non_nullable + : dividendsGrossRub as String, + estimatedTaxRub: estimatedTaxRub == const $CopyWithPlaceholder() + ? _value.estimatedTaxRub + // ignore: cast_nullable_to_non_nullable + : estimatedTaxRub as String, + ldvExemptRub: ldvExemptRub == const $CopyWithPlaceholder() + ? _value.ldvExemptRub + // ignore: cast_nullable_to_non_nullable + : ldvExemptRub as String, + realizedGainRub: realizedGainRub == const $CopyWithPlaceholder() + ? _value.realizedGainRub + // ignore: cast_nullable_to_non_nullable + : realizedGainRub as String, + realizedLossRub: realizedLossRub == const $CopyWithPlaceholder() + ? _value.realizedLossRub + // ignore: cast_nullable_to_non_nullable + : realizedLossRub as String, + taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder() + ? _value.taxWithheldRub + // ignore: cast_nullable_to_non_nullable + : taxWithheldRub as String, + taxableBaseRub: taxableBaseRub == const $CopyWithPlaceholder() + ? _value.taxableBaseRub + // ignore: cast_nullable_to_non_nullable + : taxableBaseRub as String, + ); + } +} + +extension $TaxTotalsCopyWith on TaxTotals { + /// Returns a callable class that can be used as follows: `instanceOfTaxTotals.copyWith(...)` or like so:`instanceOfTaxTotals.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TaxTotalsCWProxy get copyWith => _$TaxTotalsCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaxTotals _$TaxTotalsFromJson(Map json) => $checkedCreate( + 'TaxTotals', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'coupons_gross_rub', + 'dividends_gross_rub', + 'estimated_tax_rub', + 'ldv_exempt_rub', + 'realized_gain_rub', + 'realized_loss_rub', + 'tax_withheld_rub', + 'taxable_base_rub', + ], + ); + final val = TaxTotals( + couponsGrossRub: $checkedConvert('coupons_gross_rub', (v) => v as String), + dividendsGrossRub: $checkedConvert( + 'dividends_gross_rub', + (v) => v as String, + ), + estimatedTaxRub: $checkedConvert('estimated_tax_rub', (v) => v as String), + ldvExemptRub: $checkedConvert('ldv_exempt_rub', (v) => v as String), + realizedGainRub: $checkedConvert('realized_gain_rub', (v) => v as String), + realizedLossRub: $checkedConvert('realized_loss_rub', (v) => v as String), + taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String), + taxableBaseRub: $checkedConvert('taxable_base_rub', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'couponsGrossRub': 'coupons_gross_rub', + 'dividendsGrossRub': 'dividends_gross_rub', + 'estimatedTaxRub': 'estimated_tax_rub', + 'ldvExemptRub': 'ldv_exempt_rub', + 'realizedGainRub': 'realized_gain_rub', + 'realizedLossRub': 'realized_loss_rub', + 'taxWithheldRub': 'tax_withheld_rub', + 'taxableBaseRub': 'taxable_base_rub', + }, +); + +Map _$TaxTotalsToJson(TaxTotals instance) => { + 'coupons_gross_rub': instance.couponsGrossRub, + 'dividends_gross_rub': instance.dividendsGrossRub, + 'estimated_tax_rub': instance.estimatedTaxRub, + 'ldv_exempt_rub': instance.ldvExemptRub, + 'realized_gain_rub': instance.realizedGainRub, + 'realized_loss_rub': instance.realizedLossRub, + 'tax_withheld_rub': instance.taxWithheldRub, + 'taxable_base_rub': instance.taxableBaseRub, +}; diff --git a/app/packages/api_client/lib/src/model/tax_year_out.dart b/app/packages/api_client/lib/src/model/tax_year_out.dart new file mode 100644 index 0000000..3127c78 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_year_out.dart @@ -0,0 +1,141 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/tax_totals.dart'; +import 'package:fintracker_api/src/model/tax_account_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'tax_year_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TaxYearOut { + /// Returns a new [TaxYearOut] instance. + TaxYearOut({ + + required this.accounts, + + required this.disclaimer, + + this.estimated = true, + + required this.taxRate, + + required this.totals, + + required this.year, + }); + + @JsonKey( + + name: r'accounts', + required: true, + includeIfNull: false, + ) + + + final List accounts; + + + + @JsonKey( + + name: r'disclaimer', + required: true, + includeIfNull: false, + ) + + + final String disclaimer; + + + + @JsonKey( + defaultValue: true, + name: r'estimated', + required: false, + includeIfNull: false, + ) + + + final bool? estimated; + + + + /// decimal as string + @JsonKey( + + name: r'tax_rate', + required: true, + includeIfNull: false, + ) + + + final String taxRate; + + + + @JsonKey( + + name: r'totals', + required: true, + includeIfNull: false, + ) + + + final TaxTotals totals; + + + + @JsonKey( + + name: r'year', + required: true, + includeIfNull: false, + ) + + + final int year; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TaxYearOut && + other.accounts == accounts && + other.disclaimer == disclaimer && + other.estimated == estimated && + other.taxRate == taxRate && + other.totals == totals && + other.year == year; + + @override + int get hashCode => + accounts.hashCode + + disclaimer.hashCode + + estimated.hashCode + + taxRate.hashCode + + totals.hashCode + + year.hashCode; + + factory TaxYearOut.fromJson(Map json) => _$TaxYearOutFromJson(json); + + Map toJson() => _$TaxYearOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/tax_year_out.g.dart b/app/packages/api_client/lib/src/model/tax_year_out.g.dart new file mode 100644 index 0000000..c821ef2 --- /dev/null +++ b/app/packages/api_client/lib/src/model/tax_year_out.g.dart @@ -0,0 +1,155 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'tax_year_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TaxYearOutCWProxy { + TaxYearOut accounts(List accounts); + + TaxYearOut disclaimer(String disclaimer); + + TaxYearOut estimated(bool? estimated); + + TaxYearOut taxRate(String taxRate); + + TaxYearOut totals(TaxTotals totals); + + TaxYearOut year(int year); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxYearOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxYearOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxYearOut call({ + List accounts, + String disclaimer, + bool? estimated, + String taxRate, + TaxTotals totals, + int year, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxYearOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxYearOut.copyWith.fieldName(...)` +class _$TaxYearOutCWProxyImpl implements _$TaxYearOutCWProxy { + const _$TaxYearOutCWProxyImpl(this._value); + + final TaxYearOut _value; + + @override + TaxYearOut accounts(List accounts) => this(accounts: accounts); + + @override + TaxYearOut disclaimer(String disclaimer) => this(disclaimer: disclaimer); + + @override + TaxYearOut estimated(bool? estimated) => this(estimated: estimated); + + @override + TaxYearOut taxRate(String taxRate) => this(taxRate: taxRate); + + @override + TaxYearOut totals(TaxTotals totals) => this(totals: totals); + + @override + TaxYearOut year(int year) => this(year: year); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxYearOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TaxYearOut(...).copyWith(id: 12, name: "My name") + /// ```` + TaxYearOut call({ + Object? accounts = const $CopyWithPlaceholder(), + Object? disclaimer = const $CopyWithPlaceholder(), + Object? estimated = const $CopyWithPlaceholder(), + Object? taxRate = const $CopyWithPlaceholder(), + Object? totals = const $CopyWithPlaceholder(), + Object? year = const $CopyWithPlaceholder(), + }) { + return TaxYearOut( + accounts: accounts == const $CopyWithPlaceholder() + ? _value.accounts + // ignore: cast_nullable_to_non_nullable + : accounts as List, + disclaimer: disclaimer == const $CopyWithPlaceholder() + ? _value.disclaimer + // ignore: cast_nullable_to_non_nullable + : disclaimer as String, + estimated: estimated == const $CopyWithPlaceholder() + ? _value.estimated + // ignore: cast_nullable_to_non_nullable + : estimated as bool?, + taxRate: taxRate == const $CopyWithPlaceholder() + ? _value.taxRate + // ignore: cast_nullable_to_non_nullable + : taxRate as String, + totals: totals == const $CopyWithPlaceholder() + ? _value.totals + // ignore: cast_nullable_to_non_nullable + : totals as TaxTotals, + year: year == const $CopyWithPlaceholder() + ? _value.year + // ignore: cast_nullable_to_non_nullable + : year as int, + ); + } +} + +extension $TaxYearOutCopyWith on TaxYearOut { + /// Returns a callable class that can be used as follows: `instanceOfTaxYearOut.copyWith(...)` or like so:`instanceOfTaxYearOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TaxYearOutCWProxy get copyWith => _$TaxYearOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TaxYearOut _$TaxYearOutFromJson(Map json) => + $checkedCreate('TaxYearOut', json, ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'accounts', + 'disclaimer', + 'tax_rate', + 'totals', + 'year', + ], + ); + final val = TaxYearOut( + accounts: $checkedConvert( + 'accounts', + (v) => (v as List) + .map((e) => TaxAccountOut.fromJson(e as Map)) + .toList(), + ), + disclaimer: $checkedConvert('disclaimer', (v) => v as String), + estimated: $checkedConvert('estimated', (v) => v as bool? ?? true), + taxRate: $checkedConvert('tax_rate', (v) => v as String), + totals: $checkedConvert( + 'totals', + (v) => TaxTotals.fromJson(v as Map), + ), + year: $checkedConvert('year', (v) => (v as num).toInt()), + ); + return val; + }, fieldKeyMap: const {'taxRate': 'tax_rate'}); + +Map _$TaxYearOutToJson(TaxYearOut instance) => + { + 'accounts': instance.accounts.map((e) => e.toJson()).toList(), + 'disclaimer': instance.disclaimer, + 'estimated': ?instance.estimated, + 'tax_rate': instance.taxRate, + 'totals': instance.totals.toJson(), + 'year': instance.year, + }; diff --git a/app/packages/api_client/lib/src/model/trade_out.dart b/app/packages/api_client/lib/src/model/trade_out.dart new file mode 100644 index 0000000..d6fe37e --- /dev/null +++ b/app/packages/api_client/lib/src/model/trade_out.dart @@ -0,0 +1,205 @@ +// +// 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 'trade_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class TradeOut { + /// Returns a new [TradeOut] instance. + TradeOut({ + + required this.action, + + required this.amountRub, + + required this.blockedByCash, + + required this.instrumentId, + + required this.lot, + + required this.name, + + required this.price, + + required this.priceCurrency, + + required this.suggestedQty, + + required this.ticker, + }); + + @JsonKey( + + name: r'action', + required: true, + includeIfNull: false, + ) + + + final String action; + + + + /// decimal as string + @JsonKey( + + name: r'amount_rub', + required: true, + includeIfNull: false, + ) + + + final String amountRub; + + + + @JsonKey( + + name: r'blocked_by_cash', + required: true, + includeIfNull: false, + ) + + + final bool blockedByCash; + + + + @JsonKey( + + name: r'instrument_id', + required: true, + includeIfNull: false, + ) + + + final int instrumentId; + + + + @JsonKey( + + name: r'lot', + required: true, + includeIfNull: true, + ) + + + final int? lot; + + + + @JsonKey( + + name: r'name', + required: true, + includeIfNull: false, + ) + + + final String name; + + + + /// 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'suggested_qty', + required: true, + includeIfNull: true, + ) + + + final String? suggestedQty; + + + + @JsonKey( + + name: r'ticker', + required: true, + includeIfNull: false, + ) + + + final String ticker; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is TradeOut && + other.action == action && + other.amountRub == amountRub && + other.blockedByCash == blockedByCash && + other.instrumentId == instrumentId && + other.lot == lot && + other.name == name && + other.price == price && + other.priceCurrency == priceCurrency && + other.suggestedQty == suggestedQty && + other.ticker == ticker; + + @override + int get hashCode => + action.hashCode + + amountRub.hashCode + + blockedByCash.hashCode + + instrumentId.hashCode + + (lot == null ? 0 : lot.hashCode) + + name.hashCode + + (price == null ? 0 : price.hashCode) + + (priceCurrency == null ? 0 : priceCurrency.hashCode) + + (suggestedQty == null ? 0 : suggestedQty.hashCode) + + ticker.hashCode; + + factory TradeOut.fromJson(Map json) => _$TradeOutFromJson(json); + + Map toJson() => _$TradeOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/trade_out.g.dart b/app/packages/api_client/lib/src/model/trade_out.g.dart new file mode 100644 index 0000000..4170643 --- /dev/null +++ b/app/packages/api_client/lib/src/model/trade_out.g.dart @@ -0,0 +1,216 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'trade_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$TradeOutCWProxy { + TradeOut action(String action); + + TradeOut amountRub(String amountRub); + + TradeOut blockedByCash(bool blockedByCash); + + TradeOut instrumentId(int instrumentId); + + TradeOut lot(int? lot); + + TradeOut name(String name); + + TradeOut price(String? price); + + TradeOut priceCurrency(String? priceCurrency); + + TradeOut suggestedQty(String? suggestedQty); + + TradeOut 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 `TradeOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TradeOut(...).copyWith(id: 12, name: "My name") + /// ```` + TradeOut call({ + String action, + String amountRub, + bool blockedByCash, + int instrumentId, + int? lot, + String name, + String? price, + String? priceCurrency, + String? suggestedQty, + String ticker, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTradeOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTradeOut.copyWith.fieldName(...)` +class _$TradeOutCWProxyImpl implements _$TradeOutCWProxy { + const _$TradeOutCWProxyImpl(this._value); + + final TradeOut _value; + + @override + TradeOut action(String action) => this(action: action); + + @override + TradeOut amountRub(String amountRub) => this(amountRub: amountRub); + + @override + TradeOut blockedByCash(bool blockedByCash) => + this(blockedByCash: blockedByCash); + + @override + TradeOut instrumentId(int instrumentId) => this(instrumentId: instrumentId); + + @override + TradeOut lot(int? lot) => this(lot: lot); + + @override + TradeOut name(String name) => this(name: name); + + @override + TradeOut price(String? price) => this(price: price); + + @override + TradeOut priceCurrency(String? priceCurrency) => + this(priceCurrency: priceCurrency); + + @override + TradeOut suggestedQty(String? suggestedQty) => + this(suggestedQty: suggestedQty); + + @override + TradeOut 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 `TradeOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// TradeOut(...).copyWith(id: 12, name: "My name") + /// ```` + TradeOut call({ + Object? action = const $CopyWithPlaceholder(), + Object? amountRub = const $CopyWithPlaceholder(), + Object? blockedByCash = const $CopyWithPlaceholder(), + Object? instrumentId = const $CopyWithPlaceholder(), + Object? lot = const $CopyWithPlaceholder(), + Object? name = const $CopyWithPlaceholder(), + Object? price = const $CopyWithPlaceholder(), + Object? priceCurrency = const $CopyWithPlaceholder(), + Object? suggestedQty = const $CopyWithPlaceholder(), + Object? ticker = const $CopyWithPlaceholder(), + }) { + return TradeOut( + action: action == const $CopyWithPlaceholder() + ? _value.action + // ignore: cast_nullable_to_non_nullable + : action as String, + amountRub: amountRub == const $CopyWithPlaceholder() + ? _value.amountRub + // ignore: cast_nullable_to_non_nullable + : amountRub as String, + blockedByCash: blockedByCash == const $CopyWithPlaceholder() + ? _value.blockedByCash + // ignore: cast_nullable_to_non_nullable + : blockedByCash as bool, + instrumentId: instrumentId == const $CopyWithPlaceholder() + ? _value.instrumentId + // ignore: cast_nullable_to_non_nullable + : instrumentId as int, + lot: lot == const $CopyWithPlaceholder() + ? _value.lot + // ignore: cast_nullable_to_non_nullable + : lot as int?, + name: name == const $CopyWithPlaceholder() + ? _value.name + // ignore: cast_nullable_to_non_nullable + : name as String, + 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?, + suggestedQty: suggestedQty == const $CopyWithPlaceholder() + ? _value.suggestedQty + // ignore: cast_nullable_to_non_nullable + : suggestedQty as String?, + ticker: ticker == const $CopyWithPlaceholder() + ? _value.ticker + // ignore: cast_nullable_to_non_nullable + : ticker as String, + ); + } +} + +extension $TradeOutCopyWith on TradeOut { + /// Returns a callable class that can be used as follows: `instanceOfTradeOut.copyWith(...)` or like so:`instanceOfTradeOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$TradeOutCWProxy get copyWith => _$TradeOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TradeOut _$TradeOutFromJson(Map json) => $checkedCreate( + 'TradeOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'action', + 'amount_rub', + 'blocked_by_cash', + 'instrument_id', + 'lot', + 'name', + 'price', + 'price_currency', + 'suggested_qty', + 'ticker', + ], + ); + final val = TradeOut( + action: $checkedConvert('action', (v) => v as String), + amountRub: $checkedConvert('amount_rub', (v) => v as String), + blockedByCash: $checkedConvert('blocked_by_cash', (v) => v as bool), + instrumentId: $checkedConvert('instrument_id', (v) => (v as num).toInt()), + lot: $checkedConvert('lot', (v) => (v as num?)?.toInt()), + name: $checkedConvert('name', (v) => v as String), + price: $checkedConvert('price', (v) => v as String?), + priceCurrency: $checkedConvert('price_currency', (v) => v as String?), + suggestedQty: $checkedConvert('suggested_qty', (v) => v as String?), + ticker: $checkedConvert('ticker', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'amountRub': 'amount_rub', + 'blockedByCash': 'blocked_by_cash', + 'instrumentId': 'instrument_id', + 'priceCurrency': 'price_currency', + 'suggestedQty': 'suggested_qty', + }, +); + +Map _$TradeOutToJson(TradeOut instance) => { + 'action': instance.action, + 'amount_rub': instance.amountRub, + 'blocked_by_cash': instance.blockedByCash, + 'instrument_id': instance.instrumentId, + 'lot': instance.lot, + 'name': instance.name, + 'price': instance.price, + 'price_currency': instance.priceCurrency, + 'suggested_qty': instance.suggestedQty, + 'ticker': instance.ticker, +}; diff --git a/app/packages/api_client/lib/src/model/unmatched_broker_out.dart b/app/packages/api_client/lib/src/model/unmatched_broker_out.dart new file mode 100644 index 0000000..4dbd964 --- /dev/null +++ b/app/packages/api_client/lib/src/model/unmatched_broker_out.dart @@ -0,0 +1,139 @@ +// +// 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 'unmatched_broker_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class UnmatchedBrokerOut { + /// Returns a new [UnmatchedBrokerOut] instance. + UnmatchedBrokerOut({ + + required this.accountId, + + required this.amount, + + required this.currency, + + required this.date, + + required this.direction, + + required this.eventId, + }); + + @JsonKey( + + name: r'account_id', + required: true, + includeIfNull: false, + ) + + + final int accountId; + + + + /// decimal as string + @JsonKey( + + name: r'amount', + required: true, + includeIfNull: false, + ) + + + final String amount; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'date', + required: true, + includeIfNull: false, + ) + + + final DateTime date; + + + + @JsonKey( + + name: r'direction', + required: true, + includeIfNull: false, + ) + + + final String direction; + + + + @JsonKey( + + name: r'event_id', + required: true, + includeIfNull: false, + ) + + + final int eventId; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is UnmatchedBrokerOut && + other.accountId == accountId && + other.amount == amount && + other.currency == currency && + other.date == date && + other.direction == direction && + other.eventId == eventId; + + @override + int get hashCode => + accountId.hashCode + + amount.hashCode + + currency.hashCode + + date.hashCode + + direction.hashCode + + eventId.hashCode; + + factory UnmatchedBrokerOut.fromJson(Map json) => _$UnmatchedBrokerOutFromJson(json); + + Map toJson() => _$UnmatchedBrokerOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/unmatched_broker_out.g.dart b/app/packages/api_client/lib/src/model/unmatched_broker_out.g.dart new file mode 100644 index 0000000..4a5b308 --- /dev/null +++ b/app/packages/api_client/lib/src/model/unmatched_broker_out.g.dart @@ -0,0 +1,154 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'unmatched_broker_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$UnmatchedBrokerOutCWProxy { + UnmatchedBrokerOut accountId(int accountId); + + UnmatchedBrokerOut amount(String amount); + + UnmatchedBrokerOut currency(String currency); + + UnmatchedBrokerOut date(DateTime date); + + UnmatchedBrokerOut direction(String direction); + + UnmatchedBrokerOut eventId(int eventId); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UnmatchedBrokerOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// UnmatchedBrokerOut(...).copyWith(id: 12, name: "My name") + /// ```` + UnmatchedBrokerOut call({ + int accountId, + String amount, + String currency, + DateTime date, + String direction, + int eventId, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfUnmatchedBrokerOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfUnmatchedBrokerOut.copyWith.fieldName(...)` +class _$UnmatchedBrokerOutCWProxyImpl implements _$UnmatchedBrokerOutCWProxy { + const _$UnmatchedBrokerOutCWProxyImpl(this._value); + + final UnmatchedBrokerOut _value; + + @override + UnmatchedBrokerOut accountId(int accountId) => this(accountId: accountId); + + @override + UnmatchedBrokerOut amount(String amount) => this(amount: amount); + + @override + UnmatchedBrokerOut currency(String currency) => this(currency: currency); + + @override + UnmatchedBrokerOut date(DateTime date) => this(date: date); + + @override + UnmatchedBrokerOut direction(String direction) => this(direction: direction); + + @override + UnmatchedBrokerOut eventId(int eventId) => this(eventId: eventId); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UnmatchedBrokerOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// UnmatchedBrokerOut(...).copyWith(id: 12, name: "My name") + /// ```` + UnmatchedBrokerOut call({ + Object? accountId = const $CopyWithPlaceholder(), + Object? amount = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? date = const $CopyWithPlaceholder(), + Object? direction = const $CopyWithPlaceholder(), + Object? eventId = const $CopyWithPlaceholder(), + }) { + return UnmatchedBrokerOut( + accountId: accountId == const $CopyWithPlaceholder() + ? _value.accountId + // ignore: cast_nullable_to_non_nullable + : accountId as int, + amount: amount == const $CopyWithPlaceholder() + ? _value.amount + // ignore: cast_nullable_to_non_nullable + : amount as String, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + date: date == const $CopyWithPlaceholder() + ? _value.date + // ignore: cast_nullable_to_non_nullable + : date as DateTime, + direction: direction == const $CopyWithPlaceholder() + ? _value.direction + // ignore: cast_nullable_to_non_nullable + : direction as String, + eventId: eventId == const $CopyWithPlaceholder() + ? _value.eventId + // ignore: cast_nullable_to_non_nullable + : eventId as int, + ); + } +} + +extension $UnmatchedBrokerOutCopyWith on UnmatchedBrokerOut { + /// Returns a callable class that can be used as follows: `instanceOfUnmatchedBrokerOut.copyWith(...)` or like so:`instanceOfUnmatchedBrokerOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$UnmatchedBrokerOutCWProxy get copyWith => + _$UnmatchedBrokerOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UnmatchedBrokerOut _$UnmatchedBrokerOutFromJson(Map json) => + $checkedCreate( + 'UnmatchedBrokerOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'account_id', + 'amount', + 'currency', + 'date', + 'direction', + 'event_id', + ], + ); + final val = UnmatchedBrokerOut( + accountId: $checkedConvert('account_id', (v) => (v as num).toInt()), + amount: $checkedConvert('amount', (v) => v as String), + currency: $checkedConvert('currency', (v) => v as String), + date: $checkedConvert('date', (v) => DateTime.parse(v as String)), + direction: $checkedConvert('direction', (v) => v as String), + eventId: $checkedConvert('event_id', (v) => (v as num).toInt()), + ); + return val; + }, + fieldKeyMap: const {'accountId': 'account_id', 'eventId': 'event_id'}, + ); + +Map _$UnmatchedBrokerOutToJson(UnmatchedBrokerOut instance) => + { + 'account_id': instance.accountId, + 'amount': instance.amount, + 'currency': instance.currency, + 'date': instance.date.toIso8601String(), + 'direction': instance.direction, + 'event_id': instance.eventId, + }; diff --git a/app/packages/api_client/lib/src/model/unmatched_out.dart b/app/packages/api_client/lib/src/model/unmatched_out.dart new file mode 100644 index 0000000..f528118 --- /dev/null +++ b/app/packages/api_client/lib/src/model/unmatched_out.dart @@ -0,0 +1,76 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// + +// ignore_for_file: unused_element +import 'package:fintracker_api/src/model/unmatched_zm_out.dart'; +import 'package:fintracker_api/src/model/unmatched_broker_out.dart'; +import 'package:copy_with_extension/copy_with_extension.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'unmatched_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class UnmatchedOut { + /// Returns a new [UnmatchedOut] instance. + UnmatchedOut({ + + required this.broker, + + required this.zm, + }); + + @JsonKey( + + name: r'broker', + required: true, + includeIfNull: false, + ) + + + final List broker; + + + + @JsonKey( + + name: r'zm', + required: true, + includeIfNull: false, + ) + + + final List zm; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is UnmatchedOut && + other.broker == broker && + other.zm == zm; + + @override + int get hashCode => + broker.hashCode + + zm.hashCode; + + factory UnmatchedOut.fromJson(Map json) => _$UnmatchedOutFromJson(json); + + Map toJson() => _$UnmatchedOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/unmatched_out.g.dart b/app/packages/api_client/lib/src/model/unmatched_out.g.dart new file mode 100644 index 0000000..b1f9ef0 --- /dev/null +++ b/app/packages/api_client/lib/src/model/unmatched_out.g.dart @@ -0,0 +1,95 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'unmatched_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$UnmatchedOutCWProxy { + UnmatchedOut broker(List broker); + + UnmatchedOut zm(List zm); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UnmatchedOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// UnmatchedOut(...).copyWith(id: 12, name: "My name") + /// ```` + UnmatchedOut call({List broker, List zm}); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfUnmatchedOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfUnmatchedOut.copyWith.fieldName(...)` +class _$UnmatchedOutCWProxyImpl implements _$UnmatchedOutCWProxy { + const _$UnmatchedOutCWProxyImpl(this._value); + + final UnmatchedOut _value; + + @override + UnmatchedOut broker(List broker) => this(broker: broker); + + @override + UnmatchedOut zm(List zm) => this(zm: zm); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UnmatchedOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// UnmatchedOut(...).copyWith(id: 12, name: "My name") + /// ```` + UnmatchedOut call({ + Object? broker = const $CopyWithPlaceholder(), + Object? zm = const $CopyWithPlaceholder(), + }) { + return UnmatchedOut( + broker: broker == const $CopyWithPlaceholder() + ? _value.broker + // ignore: cast_nullable_to_non_nullable + : broker as List, + zm: zm == const $CopyWithPlaceholder() + ? _value.zm + // ignore: cast_nullable_to_non_nullable + : zm as List, + ); + } +} + +extension $UnmatchedOutCopyWith on UnmatchedOut { + /// Returns a callable class that can be used as follows: `instanceOfUnmatchedOut.copyWith(...)` or like so:`instanceOfUnmatchedOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$UnmatchedOutCWProxy get copyWith => _$UnmatchedOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UnmatchedOut _$UnmatchedOutFromJson(Map json) => + $checkedCreate('UnmatchedOut', json, ($checkedConvert) { + $checkKeys(json, requiredKeys: const ['broker', 'zm']); + final val = UnmatchedOut( + broker: $checkedConvert( + 'broker', + (v) => (v as List) + .map( + (e) => UnmatchedBrokerOut.fromJson(e as Map), + ) + .toList(), + ), + zm: $checkedConvert( + 'zm', + (v) => (v as List) + .map((e) => UnmatchedZmOut.fromJson(e as Map)) + .toList(), + ), + ); + return val; + }); + +Map _$UnmatchedOutToJson(UnmatchedOut instance) => + { + 'broker': instance.broker.map((e) => e.toJson()).toList(), + 'zm': instance.zm.map((e) => e.toJson()).toList(), + }; diff --git a/app/packages/api_client/lib/src/model/unmatched_zm_out.dart b/app/packages/api_client/lib/src/model/unmatched_zm_out.dart new file mode 100644 index 0000000..052038d --- /dev/null +++ b/app/packages/api_client/lib/src/model/unmatched_zm_out.dart @@ -0,0 +1,187 @@ +// +// 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 'unmatched_zm_out.g.dart'; + + +@CopyWith() +@JsonSerializable( + checked: true, + createToJson: true, + disallowUnrecognizedKeys: false, + explicitToJson: true, +) +class UnmatchedZmOut { + /// Returns a new [UnmatchedZmOut] instance. + UnmatchedZmOut({ + + required this.amount, + + required this.brokerAccountId, + + required this.cashTxnId, + + required this.comment, + + required this.currency, + + required this.date, + + required this.direction, + + required this.payee, + + required this.route, + }); + + /// decimal as string + @JsonKey( + + name: r'amount', + required: true, + includeIfNull: false, + ) + + + final String amount; + + + + @JsonKey( + + name: r'broker_account_id', + required: true, + includeIfNull: false, + ) + + + final int brokerAccountId; + + + + @JsonKey( + + name: r'cash_txn_id', + required: true, + includeIfNull: false, + ) + + + final int cashTxnId; + + + + @JsonKey( + + name: r'comment', + required: true, + includeIfNull: true, + ) + + + final String? comment; + + + + @JsonKey( + + name: r'currency', + required: true, + includeIfNull: false, + ) + + + final String currency; + + + + @JsonKey( + + name: r'date', + required: true, + includeIfNull: false, + ) + + + final DateTime date; + + + + @JsonKey( + + name: r'direction', + required: true, + includeIfNull: false, + ) + + + final String direction; + + + + @JsonKey( + + name: r'payee', + required: true, + includeIfNull: true, + ) + + + final String? payee; + + + + @JsonKey( + + name: r'route', + required: true, + includeIfNull: false, + ) + + + final String route; + + + + + + @override + bool operator ==(Object other) => identical(this, other) || other is UnmatchedZmOut && + other.amount == amount && + other.brokerAccountId == brokerAccountId && + other.cashTxnId == cashTxnId && + other.comment == comment && + other.currency == currency && + other.date == date && + other.direction == direction && + other.payee == payee && + other.route == route; + + @override + int get hashCode => + amount.hashCode + + brokerAccountId.hashCode + + cashTxnId.hashCode + + (comment == null ? 0 : comment.hashCode) + + currency.hashCode + + date.hashCode + + direction.hashCode + + (payee == null ? 0 : payee.hashCode) + + route.hashCode; + + factory UnmatchedZmOut.fromJson(Map json) => _$UnmatchedZmOutFromJson(json); + + Map toJson() => _$UnmatchedZmOutToJson(this); + + @override + String toString() { + return toJson().toString(); + } + +} + diff --git a/app/packages/api_client/lib/src/model/unmatched_zm_out.g.dart b/app/packages/api_client/lib/src/model/unmatched_zm_out.g.dart new file mode 100644 index 0000000..f0cc55e --- /dev/null +++ b/app/packages/api_client/lib/src/model/unmatched_zm_out.g.dart @@ -0,0 +1,202 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'unmatched_zm_out.dart'; + +// ************************************************************************** +// CopyWithGenerator +// ************************************************************************** + +abstract class _$UnmatchedZmOutCWProxy { + UnmatchedZmOut amount(String amount); + + UnmatchedZmOut brokerAccountId(int brokerAccountId); + + UnmatchedZmOut cashTxnId(int cashTxnId); + + UnmatchedZmOut comment(String? comment); + + UnmatchedZmOut currency(String currency); + + UnmatchedZmOut date(DateTime date); + + UnmatchedZmOut direction(String direction); + + UnmatchedZmOut payee(String? payee); + + UnmatchedZmOut route(String route); + + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UnmatchedZmOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// UnmatchedZmOut(...).copyWith(id: 12, name: "My name") + /// ```` + UnmatchedZmOut call({ + String amount, + int brokerAccountId, + int cashTxnId, + String? comment, + String currency, + DateTime date, + String direction, + String? payee, + String route, + }); +} + +/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfUnmatchedZmOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfUnmatchedZmOut.copyWith.fieldName(...)` +class _$UnmatchedZmOutCWProxyImpl implements _$UnmatchedZmOutCWProxy { + const _$UnmatchedZmOutCWProxyImpl(this._value); + + final UnmatchedZmOut _value; + + @override + UnmatchedZmOut amount(String amount) => this(amount: amount); + + @override + UnmatchedZmOut brokerAccountId(int brokerAccountId) => + this(brokerAccountId: brokerAccountId); + + @override + UnmatchedZmOut cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId); + + @override + UnmatchedZmOut comment(String? comment) => this(comment: comment); + + @override + UnmatchedZmOut currency(String currency) => this(currency: currency); + + @override + UnmatchedZmOut date(DateTime date) => this(date: date); + + @override + UnmatchedZmOut direction(String direction) => this(direction: direction); + + @override + UnmatchedZmOut payee(String? payee) => this(payee: payee); + + @override + UnmatchedZmOut route(String route) => this(route: route); + + @override + /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UnmatchedZmOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. + /// + /// Usage + /// ```dart + /// UnmatchedZmOut(...).copyWith(id: 12, name: "My name") + /// ```` + UnmatchedZmOut call({ + Object? amount = const $CopyWithPlaceholder(), + Object? brokerAccountId = const $CopyWithPlaceholder(), + Object? cashTxnId = const $CopyWithPlaceholder(), + Object? comment = const $CopyWithPlaceholder(), + Object? currency = const $CopyWithPlaceholder(), + Object? date = const $CopyWithPlaceholder(), + Object? direction = const $CopyWithPlaceholder(), + Object? payee = const $CopyWithPlaceholder(), + Object? route = const $CopyWithPlaceholder(), + }) { + return UnmatchedZmOut( + amount: amount == const $CopyWithPlaceholder() + ? _value.amount + // ignore: cast_nullable_to_non_nullable + : amount as String, + brokerAccountId: brokerAccountId == const $CopyWithPlaceholder() + ? _value.brokerAccountId + // ignore: cast_nullable_to_non_nullable + : brokerAccountId as int, + cashTxnId: cashTxnId == const $CopyWithPlaceholder() + ? _value.cashTxnId + // ignore: cast_nullable_to_non_nullable + : cashTxnId as int, + comment: comment == const $CopyWithPlaceholder() + ? _value.comment + // ignore: cast_nullable_to_non_nullable + : comment as String?, + currency: currency == const $CopyWithPlaceholder() + ? _value.currency + // ignore: cast_nullable_to_non_nullable + : currency as String, + date: date == const $CopyWithPlaceholder() + ? _value.date + // ignore: cast_nullable_to_non_nullable + : date as DateTime, + direction: direction == const $CopyWithPlaceholder() + ? _value.direction + // ignore: cast_nullable_to_non_nullable + : direction as String, + payee: payee == const $CopyWithPlaceholder() + ? _value.payee + // ignore: cast_nullable_to_non_nullable + : payee as String?, + route: route == const $CopyWithPlaceholder() + ? _value.route + // ignore: cast_nullable_to_non_nullable + : route as String, + ); + } +} + +extension $UnmatchedZmOutCopyWith on UnmatchedZmOut { + /// Returns a callable class that can be used as follows: `instanceOfUnmatchedZmOut.copyWith(...)` or like so:`instanceOfUnmatchedZmOut.copyWith.fieldName(...)`. + // ignore: library_private_types_in_public_api + _$UnmatchedZmOutCWProxy get copyWith => _$UnmatchedZmOutCWProxyImpl(this); +} + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +UnmatchedZmOut _$UnmatchedZmOutFromJson(Map json) => + $checkedCreate( + 'UnmatchedZmOut', + json, + ($checkedConvert) { + $checkKeys( + json, + requiredKeys: const [ + 'amount', + 'broker_account_id', + 'cash_txn_id', + 'comment', + 'currency', + 'date', + 'direction', + 'payee', + 'route', + ], + ); + final val = UnmatchedZmOut( + amount: $checkedConvert('amount', (v) => v as String), + brokerAccountId: $checkedConvert( + 'broker_account_id', + (v) => (v as num).toInt(), + ), + cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()), + comment: $checkedConvert('comment', (v) => v as String?), + currency: $checkedConvert('currency', (v) => v as String), + date: $checkedConvert('date', (v) => DateTime.parse(v as String)), + direction: $checkedConvert('direction', (v) => v as String), + payee: $checkedConvert('payee', (v) => v as String?), + route: $checkedConvert('route', (v) => v as String), + ); + return val; + }, + fieldKeyMap: const { + 'brokerAccountId': 'broker_account_id', + 'cashTxnId': 'cash_txn_id', + }, + ); + +Map _$UnmatchedZmOutToJson(UnmatchedZmOut instance) => + { + 'amount': instance.amount, + 'broker_account_id': instance.brokerAccountId, + 'cash_txn_id': instance.cashTxnId, + 'comment': instance.comment, + 'currency': instance.currency, + 'date': instance.date.toIso8601String(), + 'direction': instance.direction, + 'payee': instance.payee, + 'route': instance.route, + }; diff --git a/app/packages/api_client/test/account_suggestion_test.dart b/app/packages/api_client/test/account_suggestion_test.dart new file mode 100644 index 0000000..43f3711 --- /dev/null +++ b/app/packages/api_client/test/account_suggestion_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for AccountSuggestion +void main() { + final AccountSuggestion? instance = /* AccountSuggestion(...) */ null; + // TODO add properties to the entity + + group(AccountSuggestion, () { + // String broker + test('to test the property `broker`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String sourceId + test('to test the property `sourceId`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmark_comparison_out_test.dart b/app/packages/api_client/test/benchmark_comparison_out_test.dart new file mode 100644 index 0000000..7aed3bf --- /dev/null +++ b/app/packages/api_client/test/benchmark_comparison_out_test.dart @@ -0,0 +1,48 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for BenchmarkComparisonOut +void main() { + final BenchmarkComparisonOut? instance = /* BenchmarkComparisonOut(...) */ null; + // TODO add properties to the entity + + group(BenchmarkComparisonOut, () { + // List benchmarks + test('to test the property `benchmarks`', () async { + // TODO + }); + + // DateTime dateFrom + test('to test the property `dateFrom`', () async { + // TODO + }); + + // DateTime dateTo + test('to test the property `dateTo`', () async { + // TODO + }); + + // String period + test('to test the property `period`', () async { + // TODO + }); + + // int portfolioDaysSkipped + test('to test the property `portfolioDaysSkipped`', () async { + // TODO + }); + + // decimal as string + // String portfolioTwr + test('to test the property `portfolioTwr`', () async { + // TODO + }); + + // decimal as string + // String portfolioTwrAnnualized + test('to test the property `portfolioTwrAnnualized`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmark_comparison_test.dart b/app/packages/api_client/test/benchmark_comparison_test.dart new file mode 100644 index 0000000..14bef31 --- /dev/null +++ b/app/packages/api_client/test/benchmark_comparison_test.dart @@ -0,0 +1,16 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for BenchmarkComparison +void main() { + final BenchmarkComparison? instance = /* BenchmarkComparison(...) */ null; + // TODO add properties to the entity + + group(BenchmarkComparison, () { + // List rows + test('to test the property `rows`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmark_create_test.dart b/app/packages/api_client/test/benchmark_create_test.dart new file mode 100644 index 0000000..c5c547a --- /dev/null +++ b/app/packages/api_client/test/benchmark_create_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for BenchmarkCreate +void main() { + final BenchmarkCreate? instance = /* BenchmarkCreate(...) */ null; + // TODO add properties to the entity + + group(BenchmarkCreate, () { + // String code + test('to test the property `code`', () async { + // TODO + }); + + // String currency (default value: 'RUB') + test('to test the property `currency`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // bool isActive (default value: true) + test('to test the property `isActive`', () async { + // TODO + }); + + // bool isDefault (default value: false) + test('to test the property `isDefault`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String source_ (default value: 'moex') + test('to test the property `source_`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmark_out_test.dart b/app/packages/api_client/test/benchmark_out_test.dart new file mode 100644 index 0000000..03982f5 --- /dev/null +++ b/app/packages/api_client/test/benchmark_out_test.dart @@ -0,0 +1,66 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for BenchmarkOut +void main() { + final BenchmarkOut? instance = /* BenchmarkOut(...) */ null; + // TODO add properties to the entity + + group(BenchmarkOut, () { + // String code + test('to test the property `code`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime historyFrom + test('to test the property `historyFrom`', () async { + // TODO + }); + + // DateTime historyTo + test('to test the property `historyTo`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // bool isActive + test('to test the property `isActive`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmark_patch_test.dart b/app/packages/api_client/test/benchmark_patch_test.dart new file mode 100644 index 0000000..6214a33 --- /dev/null +++ b/app/packages/api_client/test/benchmark_patch_test.dart @@ -0,0 +1,51 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for BenchmarkPatch +void main() { + final BenchmarkPatch? instance = /* BenchmarkPatch(...) */ null; + // TODO add properties to the entity + + group(BenchmarkPatch, () { + // String code + test('to test the property `code`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // bool isActive + test('to test the property `isActive`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmark_return_out_test.dart b/app/packages/api_client/test/benchmark_return_out_test.dart new file mode 100644 index 0000000..f31f772 --- /dev/null +++ b/app/packages/api_client/test/benchmark_return_out_test.dart @@ -0,0 +1,54 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for BenchmarkReturnOut +void main() { + final BenchmarkReturnOut? instance = /* BenchmarkReturnOut(...) */ null; + // TODO add properties to the entity + + group(BenchmarkReturnOut, () { + // int benchmarkId + test('to test the property `benchmarkId`', () async { + // TODO + }); + + // String code + test('to test the property `code`', () async { + // TODO + }); + + // int daysSkipped + test('to test the property `daysSkipped`', () async { + // TODO + }); + + // decimal as string + // String excess + test('to test the property `excess`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // decimal as string + // String twr + test('to test the property `twr`', () async { + // TODO + }); + + // decimal as string + // String twrAnnualized + test('to test the property `twrAnnualized`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/benchmarks_api_test.dart b/app/packages/api_client/test/benchmarks_api_test.dart new file mode 100644 index 0000000..c1f1ba0 --- /dev/null +++ b/app/packages/api_client/test/benchmarks_api_test.dart @@ -0,0 +1,50 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for BenchmarksApi +void main() { + final instance = FintrackerApi().getBenchmarksApi(); + + group(BenchmarksApi, () { + // Benchmarks + // + // The portfolio's TWR beside each benchmark's, on the same grid of days. `days_skipped` is returned on both sides and is not cosmetic: a non-zero value on either means the two chains did not cover the same days, and the difference is then an approximation of an excess return rather than one. + // + //Future benchmarksBenchmarks({ String scope, List period }) async + test('test benchmarksBenchmarks', () async { + // TODO + }); + + // Create + // + //Future benchmarksCreate(BenchmarkCreate benchmarkCreate) async + test('test benchmarksCreate', () async { + // TODO + }); + + // Delete + // + //Future benchmarksDelete(int benchmarkId) async + test('test benchmarksDelete', () async { + // TODO + }); + + // List + // + // Every benchmark, defaults first — the order the comparison block shows them in. + // + //Future> benchmarksList() async + test('test benchmarksList', () async { + // TODO + }); + + // Patch + // + //Future benchmarksPatch(int benchmarkId, BenchmarkPatch benchmarkPatch) async + test('test benchmarksPatch', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/calendar_entry_test.dart b/app/packages/api_client/test/calendar_entry_test.dart new file mode 100644 index 0000000..6a388e9 --- /dev/null +++ b/app/packages/api_client/test/calendar_entry_test.dart @@ -0,0 +1,81 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for CalendarEntry +void main() { + final CalendarEntry? instance = /* CalendarEntry(...) */ null; + // TODO add properties to the entity + + group(CalendarEntry, () { + // 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 basis + test('to test the property `basis`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime expectedDate + test('to test the property `expectedDate`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // decimal as string + // String perUnit + test('to test the property `perUnit`', () async { + // TODO + }); + + // decimal as string + // String qty + test('to test the property `qty`', () async { + // TODO + }); + + // DateTime recordDate + test('to test the property `recordDate`', () async { + // TODO + }); + + // decimal as string + // String taxWithheld + test('to test the property `taxWithheld`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/calendar_out_test.dart b/app/packages/api_client/test/calendar_out_test.dart new file mode 100644 index 0000000..bb6f5d6 --- /dev/null +++ b/app/packages/api_client/test/calendar_out_test.dart @@ -0,0 +1,37 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for CalendarOut +void main() { + final CalendarOut? instance = /* CalendarOut(...) */ null; + // TODO add properties to the entity + + group(CalendarOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // Map byBasis + test('to test the property `byBasis`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // List entries + test('to test the property `entries`', () async { + // TODO + }); + + // decimal as string + // String totalExpectedRub + test('to test the property `totalExpectedRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/cash_available_test.dart b/app/packages/api_client/test/cash_available_test.dart new file mode 100644 index 0000000..67c1a7f --- /dev/null +++ b/app/packages/api_client/test/cash_available_test.dart @@ -0,0 +1,11 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for CashAvailable +void main() { + final CashAvailable? instance = /* CashAvailable(...) */ null; + // TODO add properties to the entity + + group(CashAvailable, () { + }); +} diff --git a/app/packages/api_client/test/cash_flow_broker_month_test.dart b/app/packages/api_client/test/cash_flow_broker_month_test.dart new file mode 100644 index 0000000..c79d602 --- /dev/null +++ b/app/packages/api_client/test/cash_flow_broker_month_test.dart @@ -0,0 +1,39 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for CashFlowBrokerMonth +void main() { + final CashFlowBrokerMonth? instance = /* CashFlowBrokerMonth(...) */ null; + // TODO add properties to the entity + + group(CashFlowBrokerMonth, () { + // decimal as string + // String depositsRub + test('to test the property `depositsRub`', () async { + // TODO + }); + + // int eventCount + test('to test the property `eventCount`', () async { + // TODO + }); + + // DateTime month + test('to test the property `month`', () async { + // TODO + }); + + // decimal as string + // String netRub + test('to test the property `netRub`', () async { + // TODO + }); + + // decimal as string + // String withdrawalsRub + test('to test the property `withdrawalsRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/commit_request_test.dart b/app/packages/api_client/test/commit_request_test.dart new file mode 100644 index 0000000..8cc598f --- /dev/null +++ b/app/packages/api_client/test/commit_request_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for CommitRequest +void main() { + final CommitRequest? instance = /* CommitRequest(...) */ null; + // TODO add properties to the entity + + group(CommitRequest, () { + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // bool confirmDuplicates (default value: false) + test('to test the property `confirmDuplicates`', () async { + // TODO + }); + + // bool dryRun (default value: false) + test('to test the property `dryRun`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/forecast_month_test.dart b/app/packages/api_client/test/forecast_month_test.dart new file mode 100644 index 0000000..68d16ec --- /dev/null +++ b/app/packages/api_client/test/forecast_month_test.dart @@ -0,0 +1,27 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ForecastMonth +void main() { + final ForecastMonth? instance = /* ForecastMonth(...) */ null; + // TODO add properties to the entity + + group(ForecastMonth, () { + // decimal as string + // String amountRub + test('to test the property `amountRub`', () async { + // TODO + }); + + // Map byBasis + test('to test the property `byBasis`', () async { + // TODO + }); + + // DateTime month + test('to test the property `month`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/forecast_out_test.dart b/app/packages/api_client/test/forecast_out_test.dart new file mode 100644 index 0000000..10248bb --- /dev/null +++ b/app/packages/api_client/test/forecast_out_test.dart @@ -0,0 +1,33 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ForecastOut +void main() { + final ForecastOut? instance = /* ForecastOut(...) */ null; + // TODO add properties to the entity + + group(ForecastOut, () { + // decimal as string + // String annualYieldOnValue + test('to test the property `annualYieldOnValue`', () async { + // TODO + }); + + // List months + test('to test the property `months`', () async { + // TODO + }); + + // decimal as string + // String totalRub + test('to test the property `totalRub`', () async { + // TODO + }); + + // List warnings + test('to test the property `warnings`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/goal_create_test.dart b/app/packages/api_client/test/goal_create_test.dart new file mode 100644 index 0000000..2235b6c --- /dev/null +++ b/app/packages/api_client/test/goal_create_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for GoalCreate +void main() { + final GoalCreate? instance = /* GoalCreate(...) */ null; + // TODO add properties to the entity + + group(GoalCreate, () { + // bool archived (default value: false) + test('to test the property `archived`', () async { + // TODO + }); + + // String currency (default value: 'RUB') + test('to test the property `currency`', () async { + // TODO + }); + + // decimal as string + // String monthlyContribution + test('to test the property `monthlyContribution`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // String scope (default value: 'all') + test('to test the property `scope`', () async { + // TODO + }); + + // decimal as string + // String targetAmount + test('to test the property `targetAmount`', () async { + // TODO + }); + + // DateTime targetDate + test('to test the property `targetDate`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/goal_out_test.dart b/app/packages/api_client/test/goal_out_test.dart new file mode 100644 index 0000000..54bf730 --- /dev/null +++ b/app/packages/api_client/test/goal_out_test.dart @@ -0,0 +1,58 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for GoalOut +void main() { + final GoalOut? instance = /* GoalOut(...) */ null; + // TODO add properties to the entity + + group(GoalOut, () { + // bool archived + test('to test the property `archived`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // decimal as string + // String monthlyContribution + test('to test the property `monthlyContribution`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // String scope + test('to test the property `scope`', () async { + // TODO + }); + + // decimal as string + // String targetAmount + test('to test the property `targetAmount`', () async { + // TODO + }); + + // DateTime targetDate + test('to test the property `targetDate`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/goal_patch_test.dart b/app/packages/api_client/test/goal_patch_test.dart new file mode 100644 index 0000000..5bfc988 --- /dev/null +++ b/app/packages/api_client/test/goal_patch_test.dart @@ -0,0 +1,53 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for GoalPatch +void main() { + final GoalPatch? instance = /* GoalPatch(...) */ null; + // TODO add properties to the entity + + group(GoalPatch, () { + // bool archived + test('to test the property `archived`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // decimal as string + // String monthlyContribution + test('to test the property `monthlyContribution`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // String scope + test('to test the property `scope`', () async { + // TODO + }); + + // decimal as string + // String targetAmount + test('to test the property `targetAmount`', () async { + // TODO + }); + + // DateTime targetDate + test('to test the property `targetDate`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/goal_progress_out_test.dart b/app/packages/api_client/test/goal_progress_out_test.dart new file mode 100644 index 0000000..22232db --- /dev/null +++ b/app/packages/api_client/test/goal_progress_out_test.dart @@ -0,0 +1,66 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for GoalProgressOut +void main() { + final GoalProgressOut? instance = /* GoalProgressOut(...) */ null; + // TODO add properties to the entity + + group(GoalProgressOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // decimal as string + // String assumedRate + test('to test the property `assumedRate`', () async { + // TODO + }); + + // String basis + test('to test the property `basis`', () async { + // TODO + }); + + // decimal as string + // String currentValueRub + test('to test the property `currentValueRub`', () async { + // TODO + }); + + // int goalId + test('to test the property `goalId`', () async { + // TODO + }); + + // decimal as string + // String monthlyNeededRub + test('to test the property `monthlyNeededRub`', () async { + // TODO + }); + + // bool onTrack + test('to test the property `onTrack`', () async { + // TODO + }); + + // decimal as string + // String progress + test('to test the property `progress`', () async { + // TODO + }); + + // DateTime projectedDate + test('to test the property `projectedDate`', () async { + // TODO + }); + + // decimal as string + // String targetAmountRub + test('to test the property `targetAmountRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/goals_api_test.dart b/app/packages/api_client/test/goals_api_test.dart new file mode 100644 index 0000000..152ee0a --- /dev/null +++ b/app/packages/api_client/test/goals_api_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for GoalsApi +void main() { + final instance = FintrackerApi().getGoalsApi(); + + group(GoalsApi, () { + // Create + // + //Future goalsCreate(GoalCreate goalCreate) async + test('test goalsCreate', () async { + // TODO + }); + + // Delete + // + //Future goalsDelete(int goalId) async + test('test goalsDelete', () async { + // TODO + }); + + // List + // + //Future> goalsList({ bool includeArchived }) async + test('test goalsList', () async { + // TODO + }); + + // Patch + // + //Future goalsPatch(int goalId, GoalPatch goalPatch) async + test('test goalsPatch', () async { + // TODO + }); + + // Progress + // + //Future goalsProgress(int goalId) async + test('test goalsProgress', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/history_out_test.dart b/app/packages/api_client/test/history_out_test.dart new file mode 100644 index 0000000..a6d52ae --- /dev/null +++ b/app/packages/api_client/test/history_out_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for HistoryOut +void main() { + final HistoryOut? instance = /* HistoryOut(...) */ null; + // TODO add properties to the entity + + group(HistoryOut, () { + // List rows + test('to test the property `rows`', () async { + // TODO + }); + + // HistoryTotals totals + test('to test the property `totals`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/history_row_test.dart b/app/packages/api_client/test/history_row_test.dart new file mode 100644 index 0000000..c716c08 --- /dev/null +++ b/app/packages/api_client/test/history_row_test.dart @@ -0,0 +1,49 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for HistoryRow +void main() { + final HistoryRow? instance = /* HistoryRow(...) */ null; + // TODO add properties to the entity + + group(HistoryRow, () { + // 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 kind + test('to test the property `kind`', () async { + // TODO + }); + + // DateTime month + test('to test the property `month`', () async { + // TODO + }); + + // int paymentCount + test('to test the property `paymentCount`', () async { + // TODO + }); + + // decimal as string + // String taxWithheld + test('to test the property `taxWithheld`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/history_totals_test.dart b/app/packages/api_client/test/history_totals_test.dart new file mode 100644 index 0000000..c09404c --- /dev/null +++ b/app/packages/api_client/test/history_totals_test.dart @@ -0,0 +1,23 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for HistoryTotals +void main() { + final HistoryTotals? instance = /* HistoryTotals(...) */ null; + // TODO add properties to the entity + + group(HistoryTotals, () { + // decimal as string + // String amountRub + test('to test the property `amountRub`', () async { + // TODO + }); + + // decimal as string + // String taxWithheldRub + test('to test the property `taxWithheldRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/import_counts_test.dart b/app/packages/api_client/test/import_counts_test.dart new file mode 100644 index 0000000..2a0ead2 --- /dev/null +++ b/app/packages/api_client/test/import_counts_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ImportCounts +void main() { + final ImportCounts? instance = /* ImportCounts(...) */ null; + // TODO add properties to the entity + + group(ImportCounts, () { + // Map byKind + test('to test the property `byKind`', () async { + // TODO + }); + + // int eventsDuplicate + test('to test the property `eventsDuplicate`', () async { + // TODO + }); + + // int eventsNew + test('to test the property `eventsNew`', () async { + // TODO + }); + + // int eventsPending + test('to test the property `eventsPending`', () async { + // TODO + }); + + // int eventsShadow + test('to test the property `eventsShadow`', () async { + // TODO + }); + + // int eventsTotal + test('to test the property `eventsTotal`', () async { + // TODO + }); + + // int lines + test('to test the property `lines`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/import_preview_test.dart b/app/packages/api_client/test/import_preview_test.dart new file mode 100644 index 0000000..bbadb92 --- /dev/null +++ b/app/packages/api_client/test/import_preview_test.dart @@ -0,0 +1,126 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ImportPreview +void main() { + final ImportPreview? instance = /* ImportPreview(...) */ null; + // TODO add properties to the entity + + group(ImportPreview, () { + // String accountExternalId + test('to test the property `accountExternalId`', () async { + // TODO + }); + + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // String accountName + test('to test the property `accountName`', () async { + // TODO + }); + + // List accountSuggestions + test('to test the property `accountSuggestions`', () async { + // TODO + }); + + // String broker + test('to test the property `broker`', () async { + // TODO + }); + + // DateTime committedAt + test('to test the property `committedAt`', () async { + // TODO + }); + + // ImportCounts counts + test('to test the property `counts`', () async { + // TODO + }); + + // int duplicateOfId + test('to test the property `duplicateOfId`', () async { + // TODO + }); + + // String error + test('to test the property `error`', () async { + // TODO + }); + + // String filename + test('to test the property `filename`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String parseStatus + test('to test the property `parseStatus`', () async { + // TODO + }); + + // String parserName + test('to test the property `parserName`', () async { + // TODO + }); + + // String parserVersion + test('to test the property `parserVersion`', () async { + // TODO + }); + + // List pendingInstruments + test('to test the property `pendingInstruments`', () async { + // TODO + }); + + // DateTime periodFrom + test('to test the property `periodFrom`', () async { + // TODO + }); + + // DateTime periodTo + test('to test the property `periodTo`', () async { + // TODO + }); + + // ReconciliationOut reconciliation + test('to test the property `reconciliation`', () async { + // TODO + }); + + // List sampleEvents + test('to test the property `sampleEvents`', () async { + // TODO + }); + + // String sha256 + test('to test the property `sha256`', () async { + // TODO + }); + + // int sizeBytes + test('to test the property `sizeBytes`', () async { + // TODO + }); + + // DateTime uploadedAt + test('to test the property `uploadedAt`', () async { + // TODO + }); + + // List warnings + test('to test the property `warnings`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/import_result_test.dart b/app/packages/api_client/test/import_result_test.dart new file mode 100644 index 0000000..f7a59f9 --- /dev/null +++ b/app/packages/api_client/test/import_result_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ImportResult +void main() { + final ImportResult? instance = /* ImportResult(...) */ null; + // TODO add properties to the entity + + group(ImportResult, () { + // bool committed + test('to test the property `committed`', () async { + // TODO + }); + + // int eventsCreated + test('to test the property `eventsCreated`', () async { + // TODO + }); + + // int eventsShadow + test('to test the property `eventsShadow`', () async { + // TODO + }); + + // int eventsSkipped + test('to test the property `eventsSkipped`', () async { + // TODO + }); + + // int eventsUpdated + test('to test the property `eventsUpdated`', () async { + // TODO + }); + + // int importId + test('to test the property `importId`', () async { + // TODO + }); + + // bool metricsRefreshed + test('to test the property `metricsRefreshed`', () async { + // TODO + }); + + // int pendingInstruments + test('to test the property `pendingInstruments`', () async { + // TODO + }); + + // ReconciliationOut reconciliation + test('to test the property `reconciliation`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/import_summary_test.dart b/app/packages/api_client/test/import_summary_test.dart new file mode 100644 index 0000000..935d559 --- /dev/null +++ b/app/packages/api_client/test/import_summary_test.dart @@ -0,0 +1,101 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ImportSummary +void main() { + final ImportSummary? instance = /* ImportSummary(...) */ null; + // TODO add properties to the entity + + group(ImportSummary, () { + // String accountExternalId + test('to test the property `accountExternalId`', () async { + // TODO + }); + + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // String accountName + test('to test the property `accountName`', () async { + // TODO + }); + + // String broker + test('to test the property `broker`', () async { + // TODO + }); + + // DateTime committedAt + test('to test the property `committedAt`', () async { + // TODO + }); + + // ImportCounts counts + test('to test the property `counts`', () async { + // TODO + }); + + // int duplicateOfId + test('to test the property `duplicateOfId`', () async { + // TODO + }); + + // String error + test('to test the property `error`', () async { + // TODO + }); + + // String filename + test('to test the property `filename`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String parseStatus + test('to test the property `parseStatus`', () async { + // TODO + }); + + // String parserName + test('to test the property `parserName`', () async { + // TODO + }); + + // String parserVersion + test('to test the property `parserVersion`', () async { + // TODO + }); + + // DateTime periodFrom + test('to test the property `periodFrom`', () async { + // TODO + }); + + // DateTime periodTo + test('to test the property `periodTo`', () async { + // TODO + }); + + // String sha256 + test('to test the property `sha256`', () async { + // TODO + }); + + // int sizeBytes + test('to test the property `sizeBytes`', () async { + // TODO + }); + + // DateTime uploadedAt + test('to test the property `uploadedAt`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/imports_api_test.dart b/app/packages/api_client/test/imports_api_test.dart new file mode 100644 index 0000000..07e993b --- /dev/null +++ b/app/packages/api_client/test/imports_api_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for ImportsApi +void main() { + final instance = FintrackerApi().getImportsApi(); + + group(ImportsApi, () { + // Commit + // + // Write the file's events into the ledger and rebuild every metric. + // + //Future importsCommit(int importId, CommitRequest commitRequest) async + test('test importsCommit', () async { + // TODO + }); + + // Create + // + // Upload a report, parse it and show what committing it would do. Writes no event. + // + //Future importsCreate(MultipartFile file, { int accountId, String parser }) async + test('test importsCreate', () async { + // TODO + }); + + // Delete + // + // Drop an uncommitted import. A committed one stays: `raw_*` is append-only. + // + //Future importsDelete(int importId) async + test('test importsDelete', () async { + // TODO + }); + + // Get + // + // The preview again — recomputed for an uncommitted import, replayed for a committed one. + // + //Future importsGet(int importId) async + test('test importsGet', () async { + // TODO + }); + + // List + // + // Newest imports first, with the counters each was committed with. + // + //Future> importsList({ String status, int limit, int offset }) async + test('test importsList', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/income_api_test.dart b/app/packages/api_client/test/income_api_test.dart new file mode 100644 index 0000000..dc306fc --- /dev/null +++ b/app/packages/api_client/test/income_api_test.dart @@ -0,0 +1,38 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for IncomeApi +void main() { + final instance = FintrackerApi().getIncomeApi(); + + group(IncomeApi, () { + // Calendar + // + // Payments in a window, one row each; defaults to the next 12 months, forecast only. + // + //Future incomeCalendar({ String scope, DateTime dateFrom, DateTime dateTo, bool includePaid }) async + test('test incomeCalendar', () async { + // TODO + }); + + // Forecast + // + // Expected income per month, split by basis, plus the yield it implies. + // + //Future incomeForecast({ String scope, int months }) async + test('test incomeForecast', () async { + // TODO + }); + + // History + // + // Income actually received, grouped by month, kind and currency. `group` exists for the contract's sake and accepts only `month`: the table is stored monthly, and a finer grouping would have to re-read the ledger, which is what the calendar's `paid` rows already do per payment. + // + //Future incomeHistory({ String scope, String group, DateTime dateFrom, DateTime dateTo, String kind }) async + test('test incomeHistory', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/link_create_test.dart b/app/packages/api_client/test/link_create_test.dart new file mode 100644 index 0000000..8786e1d --- /dev/null +++ b/app/packages/api_client/test/link_create_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for LinkCreate +void main() { + final LinkCreate? instance = /* LinkCreate(...) */ null; + // TODO add properties to the entity + + group(LinkCreate, () { + // int cashTxnId + test('to test the property `cashTxnId`', () async { + // TODO + }); + + // int eventId + test('to test the property `eventId`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/link_out_test.dart b/app/packages/api_client/test/link_out_test.dart new file mode 100644 index 0000000..07040ea --- /dev/null +++ b/app/packages/api_client/test/link_out_test.dart @@ -0,0 +1,58 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for LinkOut +void main() { + final LinkOut? instance = /* LinkOut(...) */ null; + // TODO add properties to the entity + + group(LinkOut, () { + // decimal as string + // String amountDelta + test('to test the property `amountDelta`', () async { + // TODO + }); + + // int cashTxnId + test('to test the property `cashTxnId`', () async { + // TODO + }); + + // decimal as string + // String confidence + test('to test the property `confidence`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // int dayGap + test('to test the property `dayGap`', () async { + // TODO + }); + + // int eventId + test('to test the property `eventId`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/links_api_test.dart b/app/packages/api_client/test/links_api_test.dart new file mode 100644 index 0000000..b824318 --- /dev/null +++ b/app/packages/api_client/test/links_api_test.dart @@ -0,0 +1,38 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for LinksApi +void main() { + final instance = FintrackerApi().getLinksApi(); + + group(LinksApi, () { + // Create + // + // Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards. + // + //Future linksCreate(LinkCreate linkCreate) async + test('test linksCreate', () async { + // TODO + }); + + // Delete + // + // Undo a link, manual or automatic. `flow_type` reverts on the next `POST /metrics/refresh`, when `classify` rebuilds it from the rules and `matching` no longer overwrites it. + // + //Future linksDelete(int linkId) async + test('test linksDelete', () async { + // TODO + }); + + // Unmatched + // + // Every candidate that survives matching without a link, on either side. + // + //Future linksUnmatched() async + test('test linksUnmatched', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/new_instrument_test.dart b/app/packages/api_client/test/new_instrument_test.dart new file mode 100644 index 0000000..ae11405 --- /dev/null +++ b/app/packages/api_client/test/new_instrument_test.dart @@ -0,0 +1,46 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for NewInstrument +void main() { + final NewInstrument? instance = /* NewInstrument(...) */ null; + // TODO add properties to the entity + + group(NewInstrument, () { + // String assetClass + test('to test the property `assetClass`', () async { + // TODO + }); + + // String board + test('to test the property `board`', () async { + // TODO + }); + + // String currency (default value: 'RUB') + test('to test the property `currency`', () async { + // TODO + }); + + // String isin + test('to test the property `isin`', () async { + // TODO + }); + + // int lot (default value: 1) + test('to test the property `lot`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/pending_instrument_out_test.dart b/app/packages/api_client/test/pending_instrument_out_test.dart new file mode 100644 index 0000000..e3549ed --- /dev/null +++ b/app/packages/api_client/test/pending_instrument_out_test.dart @@ -0,0 +1,93 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PendingInstrumentOut +void main() { + final PendingInstrumentOut? instance = /* PendingInstrumentOut(...) */ null; + // TODO add properties to the entity + + group(PendingInstrumentOut, () { + // String assetClassHint + test('to test the property `assetClassHint`', () async { + // TODO + }); + + // String board + test('to test the property `board`', () async { + // TODO + }); + + // DateTime createdAt + test('to test the property `createdAt`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // int firstSeenFileId + test('to test the property `firstSeenFileId`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // String isin + test('to test the property `isin`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // int occurrences + test('to test the property `occurrences`', () async { + // TODO + }); + + // decimal as string + // String samplePrice + test('to test the property `samplePrice`', () async { + // TODO + }); + + // decimal as string + // String sampleQuantity + test('to test the property `sampleQuantity`', () async { + // TODO + }); + + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + // String sourceKey + test('to test the property `sourceKey`', () async { + // TODO + }); + + // String status + test('to test the property `status`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/pending_resolve_request_test.dart b/app/packages/api_client/test/pending_resolve_request_test.dart new file mode 100644 index 0000000..b6ed031 --- /dev/null +++ b/app/packages/api_client/test/pending_resolve_request_test.dart @@ -0,0 +1,26 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PendingResolveRequest +void main() { + final PendingResolveRequest? instance = /* PendingResolveRequest(...) */ null; + // TODO add properties to the entity + + group(PendingResolveRequest, () { + // String action + test('to test the property `action`', () async { + // TODO + }); + + // NewInstrument instrument + test('to test the property `instrument`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/pending_resolve_result_test.dart b/app/packages/api_client/test/pending_resolve_result_test.dart new file mode 100644 index 0000000..6383a9b --- /dev/null +++ b/app/packages/api_client/test/pending_resolve_result_test.dart @@ -0,0 +1,41 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PendingResolveResult +void main() { + final PendingResolveResult? instance = /* PendingResolveResult(...) */ null; + // TODO add properties to the entity + + group(PendingResolveResult, () { + // bool aliasCreated + test('to test the property `aliasCreated`', () async { + // TODO + }); + + // int eventsBound + test('to test the property `eventsBound`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // bool metricsRefreshed + test('to test the property `metricsRefreshed`', () async { + // TODO + }); + + // String status + test('to test the property `status`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/price_manual_in_test.dart b/app/packages/api_client/test/price_manual_in_test.dart new file mode 100644 index 0000000..826024d --- /dev/null +++ b/app/packages/api_client/test/price_manual_in_test.dart @@ -0,0 +1,32 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PriceManualIn +void main() { + final PriceManualIn? instance = /* PriceManualIn(...) */ null; + // TODO add properties to the entity + + group(PriceManualIn, () { + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime d + test('to test the property `d`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // decimal as string + // String price + test('to test the property `price`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/price_manual_out_test.dart b/app/packages/api_client/test/price_manual_out_test.dart new file mode 100644 index 0000000..bd72456 --- /dev/null +++ b/app/packages/api_client/test/price_manual_out_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for PriceManualOut +void main() { + final PriceManualOut? instance = /* PriceManualOut(...) */ null; + // TODO add properties to the entity + + group(PriceManualOut, () { + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime d + test('to test the property `d`', () async { + // TODO + }); + + // int id + test('to test the property `id`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // decimal as string + // String price + test('to test the property `price`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/rebalance_api_test.dart b/app/packages/api_client/test/rebalance_api_test.dart new file mode 100644 index 0000000..440711c --- /dev/null +++ b/app/packages/api_client/test/rebalance_api_test.dart @@ -0,0 +1,34 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for RebalanceApi +void main() { + final instance = FintrackerApi().getRebalanceApi(); + + group(RebalanceApi, () { + // Rebalance + // + //Future rebalanceRebalance(int portfolioId, { String dimension, CashAvailable cashAvailable }) async + test('test rebalanceRebalance', () async { + // TODO + }); + + // Set Targets + // + // Replace the whole set for one dimension. The weights must add up to 1 within `WEIGHT_TOLERANCE`; otherwise the request is refused with the actual sum in the message, so the user can see by how much the plan misses rather than being handed a silently rescaled one. + // + //Future rebalanceSetTargets(int portfolioId, TargetsIn targetsIn) async + test('test rebalanceSetTargets', () async { + // TODO + }); + + // Targets + // + //Future rebalanceTargets(int portfolioId, { String dimension }) async + test('test rebalanceTargets', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/rebalance_bucket_out_test.dart b/app/packages/api_client/test/rebalance_bucket_out_test.dart new file mode 100644 index 0000000..562064b --- /dev/null +++ b/app/packages/api_client/test/rebalance_bucket_out_test.dart @@ -0,0 +1,56 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for RebalanceBucketOut +void main() { + final RebalanceBucketOut? instance = /* RebalanceBucketOut(...) */ null; + // TODO add properties to the entity + + group(RebalanceBucketOut, () { + // String bucket + test('to test the property `bucket`', () async { + // TODO + }); + + // decimal as string + // String currentValueRub + test('to test the property `currentValueRub`', () async { + // TODO + }); + + // decimal as string + // String currentWeight + test('to test the property `currentWeight`', () async { + // TODO + }); + + // decimal as string + // String deltaValueRub + test('to test the property `deltaValueRub`', () async { + // TODO + }); + + // decimal as string + // String drift + test('to test the property `drift`', () async { + // TODO + }); + + // decimal as string + // String targetWeight + test('to test the property `targetWeight`', () async { + // TODO + }); + + // List trades + test('to test the property `trades`', () async { + // TODO + }); + + // bool withinBand + test('to test the property `withinBand`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/rebalance_out_test.dart b/app/packages/api_client/test/rebalance_out_test.dart new file mode 100644 index 0000000..b44314f --- /dev/null +++ b/app/packages/api_client/test/rebalance_out_test.dart @@ -0,0 +1,48 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for RebalanceOut +void main() { + final RebalanceOut? instance = /* RebalanceOut(...) */ null; + // TODO add properties to the entity + + group(RebalanceOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // List buckets + test('to test the property `buckets`', () async { + // TODO + }); + + // decimal as string + // String cashAvailableRub + test('to test the property `cashAvailableRub`', () async { + // TODO + }); + + // String dimension + test('to test the property `dimension`', () async { + // TODO + }); + + // int portfolioId + test('to test the property `portfolioId`', () async { + // TODO + }); + + // decimal as string + // String totalValueRub + test('to test the property `totalValueRub`', () async { + // TODO + }); + + // List warnings + test('to test the property `warnings`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/reconciliation_cash_test.dart b/app/packages/api_client/test/reconciliation_cash_test.dart new file mode 100644 index 0000000..6e41e9d --- /dev/null +++ b/app/packages/api_client/test/reconciliation_cash_test.dart @@ -0,0 +1,39 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ReconciliationCash +void main() { + final ReconciliationCash? instance = /* ReconciliationCash(...) */ null; + // TODO add properties to the entity + + group(ReconciliationCash, () { + // decimal as string + // String balanceDerived + test('to test the property `balanceDerived`', () async { + // TODO + }); + + // decimal as string + // String balanceReport + test('to test the property `balanceReport`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // decimal as string + // String delta + test('to test the property `delta`', () async { + // TODO + }); + + // bool matches + test('to test the property `matches`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/reconciliation_out_test.dart b/app/packages/api_client/test/reconciliation_out_test.dart new file mode 100644 index 0000000..8c1e935 --- /dev/null +++ b/app/packages/api_client/test/reconciliation_out_test.dart @@ -0,0 +1,31 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ReconciliationOut +void main() { + final ReconciliationOut? instance = /* ReconciliationOut(...) */ null; + // TODO add properties to the entity + + group(ReconciliationOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // List cash + test('to test the property `cash`', () async { + // TODO + }); + + // bool matches (default value: true) + test('to test the property `matches`', () async { + // TODO + }); + + // List positions + test('to test the property `positions`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/reconciliation_position_test.dart b/app/packages/api_client/test/reconciliation_position_test.dart new file mode 100644 index 0000000..675d1b1 --- /dev/null +++ b/app/packages/api_client/test/reconciliation_position_test.dart @@ -0,0 +1,54 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for ReconciliationPosition +void main() { + final ReconciliationPosition? instance = /* ReconciliationPosition(...) */ null; + // TODO add properties to the entity + + group(ReconciliationPosition, () { + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // String instrumentName + test('to test the property `instrumentName`', () async { + // TODO + }); + + // String isin + test('to test the property `isin`', () async { + // TODO + }); + + // bool matches + test('to test the property `matches`', () async { + // TODO + }); + + // decimal as string + // String qtyDelta + test('to test the property `qtyDelta`', () async { + // TODO + }); + + // decimal as string + // String qtyDerived + test('to test the property `qtyDerived`', () async { + // TODO + }); + + // decimal as string + // String qtyReport + test('to test the property `qtyReport`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/sample_event_out_test.dart b/app/packages/api_client/test/sample_event_out_test.dart new file mode 100644 index 0000000..bd44174 --- /dev/null +++ b/app/packages/api_client/test/sample_event_out_test.dart @@ -0,0 +1,95 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for SampleEventOut +void main() { + final SampleEventOut? instance = /* SampleEventOut(...) */ null; + // TODO add properties to the entity + + group(SampleEventOut, () { + // decimal as string + // String amount + test('to test the property `amount`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // String dedupeKey + test('to test the property `dedupeKey`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // decimal as string + // String fee + test('to test the property `fee`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // String instrumentKey + test('to test the property `instrumentKey`', () async { + // TODO + }); + + // String instrumentName + test('to test the property `instrumentName`', () async { + // TODO + }); + + // bool isDuplicate + test('to test the property `isDuplicate`', () async { + // TODO + }); + + // String kind + test('to test the property `kind`', () async { + // TODO + }); + + // int lineNo + test('to test the property `lineNo`', () async { + // TODO + }); + + // decimal as string + // String price + test('to test the property `price`', () async { + // TODO + }); + + // decimal as string + // String quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime settleDate + test('to test the property `settleDate`', () async { + // TODO + }); + + // DateTime tradeDate + test('to test the property `tradeDate`', () async { + // TODO + }); + + // String tradeNo + test('to test the property `tradeNo`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/target_in_test.dart b/app/packages/api_client/test/target_in_test.dart new file mode 100644 index 0000000..21a822b --- /dev/null +++ b/app/packages/api_client/test/target_in_test.dart @@ -0,0 +1,33 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TargetIn +void main() { + final TargetIn? instance = /* TargetIn(...) */ null; + // TODO add properties to the entity + + group(TargetIn, () { + // decimal as string + // String band + test('to test the property `band`', () async { + // TODO + }); + + // String bucket + test('to test the property `bucket`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // decimal as string + // String targetWeight + test('to test the property `targetWeight`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/target_out_test.dart b/app/packages/api_client/test/target_out_test.dart new file mode 100644 index 0000000..bfac061 --- /dev/null +++ b/app/packages/api_client/test/target_out_test.dart @@ -0,0 +1,33 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TargetOut +void main() { + final TargetOut? instance = /* TargetOut(...) */ null; + // TODO add properties to the entity + + group(TargetOut, () { + // decimal as string + // String band + test('to test the property `band`', () async { + // TODO + }); + + // String bucket + test('to test the property `bucket`', () async { + // TODO + }); + + // String note + test('to test the property `note`', () async { + // TODO + }); + + // decimal as string + // String targetWeight + test('to test the property `targetWeight`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/targets_in_test.dart b/app/packages/api_client/test/targets_in_test.dart new file mode 100644 index 0000000..8733208 --- /dev/null +++ b/app/packages/api_client/test/targets_in_test.dart @@ -0,0 +1,22 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TargetsIn +void main() { + final TargetsIn? instance = /* TargetsIn(...) */ null; + // TODO add properties to the entity + + group(TargetsIn, () { + // asset_class | sector | country | currency + // String dimension + test('to test the property `dimension`', () async { + // TODO + }); + + // List targets + test('to test the property `targets`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/targets_out_test.dart b/app/packages/api_client/test/targets_out_test.dart new file mode 100644 index 0000000..32b76a1 --- /dev/null +++ b/app/packages/api_client/test/targets_out_test.dart @@ -0,0 +1,32 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TargetsOut +void main() { + final TargetsOut? instance = /* TargetsOut(...) */ null; + // TODO add properties to the entity + + group(TargetsOut, () { + // String dimension + test('to test the property `dimension`', () async { + // TODO + }); + + // int portfolioId + test('to test the property `portfolioId`', () async { + // TODO + }); + + // List targets + test('to test the property `targets`', () async { + // TODO + }); + + // decimal as string + // String weightsSum + test('to test the property `weightsSum`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/tax_account_out_test.dart b/app/packages/api_client/test/tax_account_out_test.dart new file mode 100644 index 0000000..e190e63 --- /dev/null +++ b/app/packages/api_client/test/tax_account_out_test.dart @@ -0,0 +1,69 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TaxAccountOut +void main() { + final TaxAccountOut? instance = /* TaxAccountOut(...) */ null; + // TODO add properties to the entity + + group(TaxAccountOut, () { + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // String accountName + test('to test the property `accountName`', () async { + // TODO + }); + + // decimal as string + // String couponsGrossRub + test('to test the property `couponsGrossRub`', () async { + // TODO + }); + + // decimal as string + // String dividendsGrossRub + test('to test the property `dividendsGrossRub`', () async { + // TODO + }); + + // decimal as string + // String estimatedTaxRub + test('to test the property `estimatedTaxRub`', () async { + // TODO + }); + + // decimal as string + // String ldvExemptRub + test('to test the property `ldvExemptRub`', () async { + // TODO + }); + + // decimal as string + // String realizedGainRub + test('to test the property `realizedGainRub`', () async { + // TODO + }); + + // decimal as string + // String realizedLossRub + test('to test the property `realizedLossRub`', () async { + // TODO + }); + + // decimal as string + // String taxWithheldRub + test('to test the property `taxWithheldRub`', () async { + // TODO + }); + + // decimal as string + // String taxableBaseRub + test('to test the property `taxableBaseRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/tax_api_test.dart b/app/packages/api_client/test/tax_api_test.dart new file mode 100644 index 0000000..34c6b9d --- /dev/null +++ b/app/packages/api_client/test/tax_api_test.dart @@ -0,0 +1,29 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + + +/// tests for TaxApi +void main() { + final instance = FintrackerApi().getTaxApi(); + + group(TaxApi, () { + // Lots + // + // Open lots with the date after which a sale falls under the long-term exemption. `year` selects the rate the \"what if I sold today\" figure is computed at; the lots themselves are always the ones open right now. `lot` is rebuilt from the ledger on every refresh and holds today's state only, so there is no honest way to answer \"which lots were open on 31 December two years ago\" — and inventing one would be worse than the limitation. + // + //Future taxLots({ int year, int accountId }) async + test('test taxLots', () async { + // TODO + }); + + // Summary + // + // The year's estimated tax position, per account and in total. + // + //Future taxSummary({ int year, int accountId }) async + test('test taxSummary', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/tax_lot_out_test.dart b/app/packages/api_client/test/tax_lot_out_test.dart new file mode 100644 index 0000000..58c64c3 --- /dev/null +++ b/app/packages/api_client/test/tax_lot_out_test.dart @@ -0,0 +1,91 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TaxLotOut +void main() { + final TaxLotOut? instance = /* TaxLotOut(...) */ null; + // TODO add properties to the entity + + group(TaxLotOut, () { + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // String accountName + test('to test the property `accountName`', () async { + // TODO + }); + + // decimal as string + // String costRub + test('to test the property `costRub`', () async { + // TODO + }); + + // int daysToLdv + test('to test the property `daysToLdv`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // DateTime ldvDate + test('to test the property `ldvDate`', () async { + // TODO + }); + + // bool ldvEligible + test('to test the property `ldvEligible`', () async { + // TODO + }); + + // int lotId + test('to test the property `lotId`', () async { + // TODO + }); + + // decimal as string + // String marketValueRub + test('to test the property `marketValueRub`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () async { + // TODO + }); + + // DateTime openDate + test('to test the property `openDate`', () async { + // TODO + }); + + // decimal as string + // String qtyRemaining + test('to test the property `qtyRemaining`', () async { + // TODO + }); + + // decimal as string + // String taxIfSoldNowRub + test('to test the property `taxIfSoldNowRub`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + // decimal as string + // String unrealizedGainRub + test('to test the property `unrealizedGainRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/tax_lots_out_test.dart b/app/packages/api_client/test/tax_lots_out_test.dart new file mode 100644 index 0000000..c40654d --- /dev/null +++ b/app/packages/api_client/test/tax_lots_out_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TaxLotsOut +void main() { + final TaxLotsOut? instance = /* TaxLotsOut(...) */ null; + // TODO add properties to the entity + + group(TaxLotsOut, () { + // DateTime asOf + test('to test the property `asOf`', () async { + // TODO + }); + + // String disclaimer + test('to test the property `disclaimer`', () async { + // TODO + }); + + // bool estimated (default value: true) + test('to test the property `estimated`', () async { + // TODO + }); + + // List lots + test('to test the property `lots`', () async { + // TODO + }); + + // decimal as string + // String taxRate + test('to test the property `taxRate`', () async { + // TODO + }); + + // int year + test('to test the property `year`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/tax_totals_test.dart b/app/packages/api_client/test/tax_totals_test.dart new file mode 100644 index 0000000..e690ee2 --- /dev/null +++ b/app/packages/api_client/test/tax_totals_test.dart @@ -0,0 +1,59 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TaxTotals +void main() { + final TaxTotals? instance = /* TaxTotals(...) */ null; + // TODO add properties to the entity + + group(TaxTotals, () { + // decimal as string + // String couponsGrossRub + test('to test the property `couponsGrossRub`', () async { + // TODO + }); + + // decimal as string + // String dividendsGrossRub + test('to test the property `dividendsGrossRub`', () async { + // TODO + }); + + // decimal as string + // String estimatedTaxRub + test('to test the property `estimatedTaxRub`', () async { + // TODO + }); + + // decimal as string + // String ldvExemptRub + test('to test the property `ldvExemptRub`', () async { + // TODO + }); + + // decimal as string + // String realizedGainRub + test('to test the property `realizedGainRub`', () async { + // TODO + }); + + // decimal as string + // String realizedLossRub + test('to test the property `realizedLossRub`', () async { + // TODO + }); + + // decimal as string + // String taxWithheldRub + test('to test the property `taxWithheldRub`', () async { + // TODO + }); + + // decimal as string + // String taxableBaseRub + test('to test the property `taxableBaseRub`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/tax_year_out_test.dart b/app/packages/api_client/test/tax_year_out_test.dart new file mode 100644 index 0000000..882008d --- /dev/null +++ b/app/packages/api_client/test/tax_year_out_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TaxYearOut +void main() { + final TaxYearOut? instance = /* TaxYearOut(...) */ null; + // TODO add properties to the entity + + group(TaxYearOut, () { + // List accounts + test('to test the property `accounts`', () async { + // TODO + }); + + // String disclaimer + test('to test the property `disclaimer`', () async { + // TODO + }); + + // bool estimated (default value: true) + test('to test the property `estimated`', () async { + // TODO + }); + + // decimal as string + // String taxRate + test('to test the property `taxRate`', () async { + // TODO + }); + + // TaxTotals totals + test('to test the property `totals`', () async { + // TODO + }); + + // int year + test('to test the property `year`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/trade_out_test.dart b/app/packages/api_client/test/trade_out_test.dart new file mode 100644 index 0000000..4ac2c73 --- /dev/null +++ b/app/packages/api_client/test/trade_out_test.dart @@ -0,0 +1,64 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for TradeOut +void main() { + final TradeOut? instance = /* TradeOut(...) */ null; + // TODO add properties to the entity + + group(TradeOut, () { + // String action + test('to test the property `action`', () async { + // TODO + }); + + // decimal as string + // String amountRub + test('to test the property `amountRub`', () async { + // TODO + }); + + // bool blockedByCash + test('to test the property `blockedByCash`', () async { + // TODO + }); + + // int instrumentId + test('to test the property `instrumentId`', () async { + // TODO + }); + + // int lot + test('to test the property `lot`', () async { + // TODO + }); + + // String name + test('to test the property `name`', () 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 suggestedQty + test('to test the property `suggestedQty`', () async { + // TODO + }); + + // String ticker + test('to test the property `ticker`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/unmatched_broker_out_test.dart b/app/packages/api_client/test/unmatched_broker_out_test.dart new file mode 100644 index 0000000..912dff8 --- /dev/null +++ b/app/packages/api_client/test/unmatched_broker_out_test.dart @@ -0,0 +1,42 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for UnmatchedBrokerOut +void main() { + final UnmatchedBrokerOut? instance = /* UnmatchedBrokerOut(...) */ null; + // TODO add properties to the entity + + group(UnmatchedBrokerOut, () { + // int accountId + test('to test the property `accountId`', () async { + // TODO + }); + + // decimal as string + // String amount + test('to test the property `amount`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // String direction + test('to test the property `direction`', () async { + // TODO + }); + + // int eventId + test('to test the property `eventId`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/unmatched_out_test.dart b/app/packages/api_client/test/unmatched_out_test.dart new file mode 100644 index 0000000..aba683e --- /dev/null +++ b/app/packages/api_client/test/unmatched_out_test.dart @@ -0,0 +1,21 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for UnmatchedOut +void main() { + final UnmatchedOut? instance = /* UnmatchedOut(...) */ null; + // TODO add properties to the entity + + group(UnmatchedOut, () { + // List broker + test('to test the property `broker`', () async { + // TODO + }); + + // List zm + test('to test the property `zm`', () async { + // TODO + }); + + }); +} diff --git a/app/packages/api_client/test/unmatched_zm_out_test.dart b/app/packages/api_client/test/unmatched_zm_out_test.dart new file mode 100644 index 0000000..e5f8dd3 --- /dev/null +++ b/app/packages/api_client/test/unmatched_zm_out_test.dart @@ -0,0 +1,57 @@ +import 'package:test/test.dart'; +import 'package:fintracker_api/fintracker_api.dart'; + +// tests for UnmatchedZmOut +void main() { + final UnmatchedZmOut? instance = /* UnmatchedZmOut(...) */ null; + // TODO add properties to the entity + + group(UnmatchedZmOut, () { + // decimal as string + // String amount + test('to test the property `amount`', () async { + // TODO + }); + + // int brokerAccountId + test('to test the property `brokerAccountId`', () async { + // TODO + }); + + // int cashTxnId + test('to test the property `cashTxnId`', () async { + // TODO + }); + + // String comment + test('to test the property `comment`', () async { + // TODO + }); + + // String currency + test('to test the property `currency`', () async { + // TODO + }); + + // DateTime date + test('to test the property `date`', () async { + // TODO + }); + + // String direction + test('to test the property `direction`', () async { + // TODO + }); + + // String payee + test('to test the property `payee`', () async { + // TODO + }); + + // String route + test('to test the property `route`', () async { + // TODO + }); + + }); +}