@firela/api-types 0.0.0-canary.6feee68d → 0.0.0-canary.744d37cc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,8 @@ import type {
17
17
  AccountControllerCloseResponse,
18
18
  AccountControllerReopenData,
19
19
  AccountControllerReopenResponse,
20
+ AccountControllerAddOpeningBalanceData,
21
+ AccountControllerAddOpeningBalanceResponse,
20
22
  AccountStandardsControllerGetTemplatesData,
21
23
  AccountStandardsControllerGetTemplatesResponse,
22
24
  AccountStandardsControllerGetTemplateMetadataData,
@@ -29,6 +31,10 @@ import type {
29
31
  TransactionControllerListResponse,
30
32
  TransactionControllerCreateBatchData,
31
33
  TransactionControllerCreateBatchResponse,
34
+ TransactionControllerCorrectData,
35
+ TransactionControllerCorrectResponse,
36
+ TransactionControllerSuggestTagsData,
37
+ TransactionControllerSuggestTagsResponse,
32
38
  TransactionControllerGetDetailData,
33
39
  TransactionControllerGetDetailResponse,
34
40
  TransactionControllerUpdateData,
@@ -93,6 +99,18 @@ import type {
93
99
  CommodityControllerGetOrCreateResponse,
94
100
  CommodityControllerBulkCreateData,
95
101
  CommodityControllerBulkCreateResponse,
102
+ PriceControllerCreateData,
103
+ PriceControllerCreateResponse,
104
+ PriceControllerFindAllData,
105
+ PriceControllerFindAllResponse,
106
+ PriceControllerFindOneData,
107
+ PriceControllerFindOneResponse,
108
+ PriceControllerUpdateData,
109
+ PriceControllerUpdateResponse,
110
+ PriceControllerDeleteData,
111
+ PriceControllerDeleteResponse,
112
+ PriceControllerBulkCreateData,
113
+ PriceControllerBulkCreateResponse,
96
114
  RecurringRuleControllerCreateData,
97
115
  RecurringRuleControllerCreateResponse,
98
116
  RecurringRuleControllerFindAllData,
@@ -125,26 +143,14 @@ import type {
125
143
  ExpectedTransactionControllerEnterNowResponse,
126
144
  ForecastControllerGetForecastData,
127
145
  ForecastControllerGetForecastResponse,
128
- TransactionRuleControllerCreateData,
129
- TransactionRuleControllerCreateResponse,
130
- TransactionRuleControllerListData,
131
- TransactionRuleControllerListResponse,
132
- TransactionRuleControllerValidateData,
133
- TransactionRuleControllerValidateResponse,
134
- TransactionRuleControllerBulkCreateData,
135
- TransactionRuleControllerBulkCreateResponse,
136
- TransactionRuleControllerExportData,
137
- TransactionRuleControllerExportResponse,
138
- TransactionRuleControllerGetStatisticsData,
139
- TransactionRuleControllerGetStatisticsResponse,
140
- TransactionRuleControllerGetDetailData,
141
- TransactionRuleControllerGetDetailResponse,
142
- TransactionRuleControllerUpdateData,
143
- TransactionRuleControllerUpdateResponse,
144
- TransactionRuleControllerDeleteData,
145
- TransactionRuleControllerDeleteResponse,
146
- TransactionRuleControllerTestData,
147
- TransactionRuleControllerTestResponse,
146
+ ReportingControllerGetPortfolioTrendsData,
147
+ ReportingControllerGetPortfolioTrendsResponse,
148
+ ReportingControllerGetCashFlowTrendsData,
149
+ ReportingControllerGetCashFlowTrendsResponse,
150
+ ReportingControllerGenerateSnapshotData,
151
+ ReportingControllerGenerateSnapshotResponse,
152
+ ReportingControllerBackfillSnapshotsData,
153
+ ReportingControllerBackfillSnapshotsResponse,
148
154
  UserControllerDeleteOwnUserData,
149
155
  UserControllerDeleteOwnUserResponse,
150
156
  UserControllerGetUserData,
@@ -167,6 +173,50 @@ import type {
167
173
  PropertyControllerUpdateResponse,
168
174
  PropertyControllerDeleteData,
169
175
  PropertyControllerDeleteResponse,
176
+ TransactionRuleControllerCreateData,
177
+ TransactionRuleControllerCreateResponse,
178
+ TransactionRuleControllerListData,
179
+ TransactionRuleControllerListResponse,
180
+ TransactionRuleControllerValidateData,
181
+ TransactionRuleControllerValidateResponse,
182
+ TransactionRuleControllerBulkCreateData,
183
+ TransactionRuleControllerBulkCreateResponse,
184
+ TransactionRuleControllerExportData,
185
+ TransactionRuleControllerExportResponse,
186
+ TransactionRuleControllerGetStatisticsData,
187
+ TransactionRuleControllerGetStatisticsResponse,
188
+ TransactionRuleControllerGetDetailData,
189
+ TransactionRuleControllerGetDetailResponse,
190
+ TransactionRuleControllerUpdateData,
191
+ TransactionRuleControllerUpdateResponse,
192
+ TransactionRuleControllerDeleteData,
193
+ TransactionRuleControllerDeleteResponse,
194
+ TransactionRuleControllerTestData,
195
+ TransactionRuleControllerTestResponse,
196
+ CategoryCatalogControllerListData,
197
+ CategoryCatalogControllerListResponse,
198
+ EventControllerCreateData,
199
+ EventControllerCreateResponse,
200
+ EventControllerFindAllData,
201
+ EventControllerFindAllResponse,
202
+ EventControllerFindOneData,
203
+ EventControllerFindOneResponse,
204
+ EventControllerUpdateData,
205
+ EventControllerUpdateResponse,
206
+ EventControllerDeleteData,
207
+ EventControllerDeleteResponse,
208
+ EventControllerGetSliceData,
209
+ EventControllerGetSliceResponse,
210
+ OnboardingControllerBootstrapData,
211
+ OnboardingControllerBootstrapResponse,
212
+ ReconciliationControllerComputeData,
213
+ ReconciliationControllerComputeResponse,
214
+ ReconciliationControllerAssertData,
215
+ ReconciliationControllerAssertResponse,
216
+ ReconciliationControllerPadData,
217
+ ReconciliationControllerPadResponse,
218
+ ReconciliationControllerHistoryData,
219
+ ReconciliationControllerHistoryResponse,
170
220
  ExportControllerExportBeancountResponse,
171
221
  FileImportControllerImportFileData,
172
222
  FileImportControllerImportFileResponse,
@@ -180,42 +230,53 @@ import type {
180
230
  ImporterConfigControllerUpdateConfigResponse,
181
231
  ImporterConfigControllerResetConfigData,
182
232
  ImporterConfigControllerResetConfigResponse,
183
- PlatformControllerFindAllResponse,
184
- PlatformControllerCreateData,
185
- PlatformControllerCreateResponse,
186
- PlatformControllerGetPlatformListResponse,
187
- PlatformControllerMatchPlatformsData,
188
- PlatformControllerMatchPlatformsResponse,
189
- PlatformControllerUpdateData,
190
- PlatformControllerUpdateResponse,
191
- PlatformControllerDeleteData,
192
- PlatformControllerDeleteResponse,
193
233
  ProviderSyncControllerSyncData,
194
234
  ProviderSyncControllerSyncResponse,
195
235
  ProviderSyncControllerGetSupportedProvidersData,
196
236
  ProviderSyncControllerGetSupportedProvidersResponse,
197
237
  ProviderSyncControllerIsProviderSupportedData,
198
238
  ProviderSyncControllerIsProviderSupportedResponse,
239
+ ExternalAccountLinkControllerCreateData,
240
+ ExternalAccountLinkControllerCreateResponse,
241
+ ExternalAccountLinkControllerFindAllData,
242
+ ExternalAccountLinkControllerFindAllResponse,
243
+ ExternalAccountLinkControllerFindOneData,
244
+ ExternalAccountLinkControllerFindOneResponse,
245
+ ExternalAccountLinkControllerRemoveData,
246
+ ExternalAccountLinkControllerRemoveResponse,
199
247
  TelemetryControllerReportTelemetryData,
200
248
  TelemetryControllerReportTelemetryResponse,
249
+ TelemetryControllerReportCoverageMissData,
250
+ TelemetryControllerReportCoverageMissResponse,
251
+ TelemetryControllerGetCoverageMetricsData,
252
+ TelemetryControllerGetCoverageMetricsResponse,
201
253
  NlpControllerProcessNaturalLanguageData,
202
254
  NlpControllerProcessNaturalLanguageResponse,
203
255
  NlpControllerClearSessionData,
204
256
  NlpControllerClearSessionResponse,
205
257
  NlpControllerGetSessionData,
206
258
  NlpControllerGetSessionResponse,
259
+ PlatformControllerFindAllResponse,
260
+ PlatformControllerCreateData,
261
+ PlatformControllerCreateResponse,
262
+ PlatformControllerGetPlatformListData,
263
+ PlatformControllerGetPlatformListResponse,
264
+ PlatformControllerMatchPlatformsData,
265
+ PlatformControllerMatchPlatformsResponse,
266
+ PlatformControllerUpdateData,
267
+ PlatformControllerUpdateResponse,
268
+ PlatformControllerDeleteData,
269
+ PlatformControllerDeleteResponse,
207
270
  DashboardControllerGetNetWorthData,
208
271
  DashboardControllerGetNetWorthResponse,
209
272
  DashboardControllerGetAccountsData,
210
273
  DashboardControllerGetAccountsResponse,
211
274
  DashboardControllerGetCashFlowData,
212
275
  DashboardControllerGetCashFlowResponse,
213
- ReportingControllerGetPortfolioTrendsData,
214
- ReportingControllerGetPortfolioTrendsResponse,
215
- ReportingControllerGenerateSnapshotData,
216
- ReportingControllerGenerateSnapshotResponse,
217
- ReportingControllerBackfillSnapshotsData,
218
- ReportingControllerBackfillSnapshotsResponse,
276
+ DashboardControllerGetExpensesData,
277
+ DashboardControllerGetExpensesResponse,
278
+ HoldingPnlControllerGetHoldingPnlData,
279
+ HoldingPnlControllerGetHoldingPnlResponse,
219
280
  ApiKeysControllerCreateApiKeyResponse,
220
281
  AuthControllerAccessTokenLoginData,
221
282
  AuthControllerAccessTokenLoginResponse,
@@ -230,7 +291,11 @@ import type {
230
291
  HealthControllerResetCircuitBreakerData,
231
292
  HealthControllerResetCircuitBreakerResponse,
232
293
  HealthControllerGetMetricsResponse,
233
- InfoControllerGetInfoResponse
294
+ InfoControllerGetInfoResponse,
295
+ SymbolControllerSearchData,
296
+ SymbolControllerSearchResponse,
297
+ SymbolControllerGetQuoteData,
298
+ SymbolControllerGetQuoteResponse
234
299
  } from './types.gen';
235
300
 
236
301
  export class BeanAccountsService {
@@ -268,7 +333,7 @@ export class BeanAccountsService {
268
333
  * @param data.type Filter by account type
269
334
  * @param data.status Filter by status
270
335
  * @param data.isCustom Filter by custom (user-created) accounts only
271
- * @param data.search Search term for path or i18nKey
336
+ * @param data.search Search term for account path
272
337
  * @param data.limit Maximum number of results
273
338
  * @param data.offset Number of results to skip
274
339
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -349,7 +414,7 @@ export class BeanAccountsService {
349
414
 
350
415
  /**
351
416
  * Delete account
352
- * Deletes an account (only if no transactions)
417
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
353
418
  * @param data The data for the request.
354
419
  * @param data.id Account UUID
355
420
  * @param data.region Region code for tenant context
@@ -368,7 +433,7 @@ export class BeanAccountsService {
368
433
  },
369
434
  errors: {
370
435
  404: 'Account not found',
371
- 409: 'Account has transactions and cannot be deleted'
436
+ 409: 'Account has active transactions and cannot be deleted'
372
437
  }
373
438
  });
374
439
  }
@@ -430,6 +495,35 @@ export class BeanAccountsService {
430
495
  }
431
496
  });
432
497
  }
498
+
499
+ /**
500
+ * Post an opening-balance transaction
501
+ * Posts a double-entry opening-balance transaction against Equity:Opening-Balances for an existing Assets/Liabilities account. At most one active opening balance per account.
502
+ * @param data The data for the request.
503
+ * @param data.id Account UUID
504
+ * @param data.region Region code for tenant context
505
+ * @param data.requestBody
506
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
507
+ * @throws ApiError
508
+ */
509
+ public static accountControllerAddOpeningBalance(
510
+ data: AccountControllerAddOpeningBalanceData
511
+ ): CancelablePromise<AccountControllerAddOpeningBalanceResponse> {
512
+ return __request(OpenAPI, {
513
+ method: 'POST',
514
+ url: '/api/v1/{region}/bean/accounts/{id}/opening-balance',
515
+ path: {
516
+ id: data.id,
517
+ region: data.region
518
+ },
519
+ body: data.requestBody,
520
+ mediaType: 'application/json',
521
+ errors: {
522
+ 404: 'Account not found',
523
+ 409: 'An opening balance already exists for this account'
524
+ }
525
+ });
526
+ }
433
527
  }
434
528
 
435
529
  export class BeanAccountStandardsService {
@@ -461,7 +555,7 @@ export class BeanAccountStandardsService {
461
555
 
462
556
  /**
463
557
  * Get template metadata for an account path
464
- * Returns extendable status and root type for a template path.
558
+ * Returns root type for a template path.
465
559
  * @param data The data for the request.
466
560
  * @param data.region Region code for tenant context
467
561
  * @param data.path Account path to check
@@ -547,6 +641,7 @@ export class BeanTransactionsService {
547
641
  * @param data.status Filter by transaction status
548
642
  * @param data.search Search in narration and payee fields (max 200 chars)
549
643
  * @param data.accountId Filter by account ID (transactions with postings to this account)
644
+ * @param data.category Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
550
645
  * @returns TransactionListResponseDto Transaction list
551
646
  * @throws ApiError
552
647
  */
@@ -566,7 +661,8 @@ export class BeanTransactionsService {
566
661
  dateTo: data.dateTo,
567
662
  status: data.status,
568
663
  search: data.search,
569
- accountId: data.accountId
664
+ accountId: data.accountId,
665
+ category: data.category
570
666
  },
571
667
  errors: {
572
668
  400: 'Validation failed',
@@ -603,6 +699,68 @@ export class BeanTransactionsService {
603
699
  });
604
700
  }
605
701
 
702
+ /**
703
+ * Correct (supersede) a transaction
704
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
705
+ * @param data The data for the request.
706
+ * @param data.id Original transaction ID to correct
707
+ * @param data.region Region code for tenant context
708
+ * @param data.requestBody
709
+ * @returns TransactionDetailDto Corrected transaction created
710
+ * @throws ApiError
711
+ */
712
+ public static transactionControllerCorrect(
713
+ data: TransactionControllerCorrectData
714
+ ): CancelablePromise<TransactionControllerCorrectResponse> {
715
+ return __request(OpenAPI, {
716
+ method: 'POST',
717
+ url: '/api/v1/{region}/bean/transactions/{id}/correct',
718
+ path: {
719
+ id: data.id,
720
+ region: data.region
721
+ },
722
+ body: data.requestBody,
723
+ mediaType: 'application/json',
724
+ errors: {
725
+ 404: 'Original transaction not found',
726
+ 409: 'Original no longer ACTIVE (concurrent modification)',
727
+ 422: 'Pipeline validation failed (does not balance, invalid accounts)'
728
+ }
729
+ });
730
+ }
731
+
732
+ /**
733
+ * Suggest transaction tags
734
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
735
+ * @param data The data for the request.
736
+ * @param data.region Region code for tenant context
737
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
738
+ * @param data.sort usage (default) or name
739
+ * @param data.limit Max suggestions (1-100, default 10)
740
+ * @returns TagSuggestionsResponseDto Tag suggestions
741
+ * @throws ApiError
742
+ */
743
+ public static transactionControllerSuggestTags(
744
+ data: TransactionControllerSuggestTagsData
745
+ ): CancelablePromise<TransactionControllerSuggestTagsResponse> {
746
+ return __request(OpenAPI, {
747
+ method: 'GET',
748
+ url: '/api/v1/{region}/bean/transactions/tags',
749
+ path: {
750
+ region: data.region
751
+ },
752
+ query: {
753
+ q: data.q,
754
+ sort: data.sort,
755
+ limit: data.limit
756
+ },
757
+ errors: {
758
+ 400: 'Validation failed',
759
+ 401: 'Authentication required'
760
+ }
761
+ });
762
+ }
763
+
606
764
  /**
607
765
  * Get transaction detail
608
766
  * Returns transaction details including all postings
@@ -692,7 +850,7 @@ export class BeanBalancesService {
692
850
  * Query account balance
693
851
  * Calculate account balance at a specific date for a single currency
694
852
  * @param data The data for the request.
695
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
853
+ * @param data.account Account name (e.g., "Assets:Checking")
696
854
  * @param data.region Region code for tenant context
697
855
  * @param data.date Date to calculate balance at (ISO 8601 format)
698
856
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1413,6 +1571,173 @@ export class BeanCommoditiesService {
1413
1571
  }
1414
1572
  }
1415
1573
 
1574
+ export class BeanPricesService {
1575
+ /**
1576
+ * Create a new price
1577
+ * Creates a new price entry for the authenticated user
1578
+ * @param data The data for the request.
1579
+ * @param data.region Region code for tenant context
1580
+ * @param data.requestBody
1581
+ * @returns PriceResponseDto Price created successfully
1582
+ * @throws ApiError
1583
+ */
1584
+ public static priceControllerCreate(
1585
+ data: PriceControllerCreateData
1586
+ ): CancelablePromise<PriceControllerCreateResponse> {
1587
+ return __request(OpenAPI, {
1588
+ method: 'POST',
1589
+ url: '/api/v1/{region}/bean/prices',
1590
+ path: {
1591
+ region: data.region
1592
+ },
1593
+ body: data.requestBody,
1594
+ mediaType: 'application/json',
1595
+ errors: {
1596
+ 404: 'Currency or quoteCurrency commodity not found',
1597
+ 409: 'Price already exists for this currency pair and date'
1598
+ }
1599
+ });
1600
+ }
1601
+
1602
+ /**
1603
+ * List user prices
1604
+ * Returns all price entries for the authenticated user with optional filtering
1605
+ * @param data The data for the request.
1606
+ * @param data.region Region code for tenant context
1607
+ * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
1608
+ * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
1609
+ * @param data.dateFrom Filter prices from this date (ISO 8601 format)
1610
+ * @param data.dateTo Filter prices to this date (ISO 8601 format)
1611
+ * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
1612
+ * @param data.page Page number for pagination (default: 1)
1613
+ * @param data.limit Number of items per page (default: 20, max: 100)
1614
+ * @returns PriceListResponseDto Prices retrieved successfully
1615
+ * @throws ApiError
1616
+ */
1617
+ public static priceControllerFindAll(
1618
+ data: PriceControllerFindAllData
1619
+ ): CancelablePromise<PriceControllerFindAllResponse> {
1620
+ return __request(OpenAPI, {
1621
+ method: 'GET',
1622
+ url: '/api/v1/{region}/bean/prices',
1623
+ path: {
1624
+ region: data.region
1625
+ },
1626
+ query: {
1627
+ currency: data.currency,
1628
+ quoteCurrency: data.quoteCurrency,
1629
+ dateFrom: data.dateFrom,
1630
+ dateTo: data.dateTo,
1631
+ search: data.search,
1632
+ page: data.page,
1633
+ limit: data.limit
1634
+ }
1635
+ });
1636
+ }
1637
+
1638
+ /**
1639
+ * Get price by ID
1640
+ * Returns a single price entry by its ID
1641
+ * @param data The data for the request.
1642
+ * @param data.id Price ID
1643
+ * @param data.region Region code for tenant context
1644
+ * @returns PriceResponseDto Price retrieved successfully
1645
+ * @throws ApiError
1646
+ */
1647
+ public static priceControllerFindOne(
1648
+ data: PriceControllerFindOneData
1649
+ ): CancelablePromise<PriceControllerFindOneResponse> {
1650
+ return __request(OpenAPI, {
1651
+ method: 'GET',
1652
+ url: '/api/v1/{region}/bean/prices/{id}',
1653
+ path: {
1654
+ id: data.id,
1655
+ region: data.region
1656
+ },
1657
+ errors: {
1658
+ 404: 'Price not found'
1659
+ }
1660
+ });
1661
+ }
1662
+
1663
+ /**
1664
+ * Update a price
1665
+ * Updates an existing price entry
1666
+ * @param data The data for the request.
1667
+ * @param data.id Price ID
1668
+ * @param data.region Region code for tenant context
1669
+ * @param data.requestBody
1670
+ * @returns PriceResponseDto Price updated successfully
1671
+ * @throws ApiError
1672
+ */
1673
+ public static priceControllerUpdate(
1674
+ data: PriceControllerUpdateData
1675
+ ): CancelablePromise<PriceControllerUpdateResponse> {
1676
+ return __request(OpenAPI, {
1677
+ method: 'PUT',
1678
+ url: '/api/v1/{region}/bean/prices/{id}',
1679
+ path: {
1680
+ id: data.id,
1681
+ region: data.region
1682
+ },
1683
+ body: data.requestBody,
1684
+ mediaType: 'application/json',
1685
+ errors: {
1686
+ 404: 'Price not found',
1687
+ 409: 'Updated price conflicts with existing price'
1688
+ }
1689
+ });
1690
+ }
1691
+
1692
+ /**
1693
+ * Delete a price
1694
+ * Deletes a price entry (hard delete)
1695
+ * @param data The data for the request.
1696
+ * @param data.id Price ID
1697
+ * @param data.region Region code for tenant context
1698
+ * @returns void Price deleted successfully
1699
+ * @throws ApiError
1700
+ */
1701
+ public static priceControllerDelete(
1702
+ data: PriceControllerDeleteData
1703
+ ): CancelablePromise<PriceControllerDeleteResponse> {
1704
+ return __request(OpenAPI, {
1705
+ method: 'DELETE',
1706
+ url: '/api/v1/{region}/bean/prices/{id}',
1707
+ path: {
1708
+ id: data.id,
1709
+ region: data.region
1710
+ },
1711
+ errors: {
1712
+ 404: 'Price not found'
1713
+ }
1714
+ });
1715
+ }
1716
+
1717
+ /**
1718
+ * Bulk create prices
1719
+ * Creates multiple price entries at once (skips duplicates)
1720
+ * @param data The data for the request.
1721
+ * @param data.region Region code for tenant context
1722
+ * @param data.requestBody
1723
+ * @returns PriceResponseDto Prices created successfully
1724
+ * @throws ApiError
1725
+ */
1726
+ public static priceControllerBulkCreate(
1727
+ data: PriceControllerBulkCreateData
1728
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
1729
+ return __request(OpenAPI, {
1730
+ method: 'POST',
1731
+ url: '/api/v1/{region}/bean/prices/bulk',
1732
+ path: {
1733
+ region: data.region
1734
+ },
1735
+ body: data.requestBody,
1736
+ mediaType: 'application/json'
1737
+ });
1738
+ }
1739
+ }
1740
+
1416
1741
  export class RecurringRulesService {
1417
1742
  /**
1418
1743
  * Create a new recurring rule
@@ -1843,22 +2168,434 @@ export class RecurringForecastService {
1843
2168
  }
1844
2169
  }
1845
2170
 
1846
- export class BeanTransactionRulesService {
2171
+ export class ReportingService {
1847
2172
  /**
1848
- * Create a new transaction rule (or upsert if upsertByPayee=true)
1849
- * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
1850
- * @param data The data for the request.
1851
- * @param data.region Region code for tenant context
1852
- * @param data.requestBody
1853
- * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
1854
- * @throws ApiError
1855
- */
1856
- public static transactionRuleControllerCreate(
1857
- data: TransactionRuleControllerCreateData
1858
- ): CancelablePromise<TransactionRuleControllerCreateResponse> {
1859
- return __request(OpenAPI, {
1860
- method: 'POST',
1861
- url: '/api/v1/{region}/bean/transaction-rules',
2173
+ * Get portfolio value trends
2174
+ *
2175
+ * Returns time series data of portfolio net worth.
2176
+ *
2177
+ * **Multi-currency Support:**
2178
+ * - `series[].byCurrency` - Currency breakdown for each data point
2179
+ * - `byCurrency` - Separate time series grouped by currency
2180
+ * - `warnings` - Exchange rate warnings if conversion failed
2181
+ *
2182
+ * **Parameters:**
2183
+ * - `period`: Time period (1m, 3m, 6m, 1y)
2184
+ * - `granularity`: Data granularity (day, week, month)
2185
+ *
2186
+ * @param data The data for the request.
2187
+ * @param data.region Region code for tenant context
2188
+ * @param data.period Time period
2189
+ * @param data.granularity Data granularity
2190
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
2191
+ * @throws ApiError
2192
+ */
2193
+ public static reportingControllerGetPortfolioTrends(
2194
+ data: ReportingControllerGetPortfolioTrendsData
2195
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
2196
+ return __request(OpenAPI, {
2197
+ method: 'GET',
2198
+ url: '/api/v1/{region}/reporting/portfolio/trends',
2199
+ path: {
2200
+ region: data.region
2201
+ },
2202
+ query: {
2203
+ period: data.period,
2204
+ granularity: data.granularity
2205
+ },
2206
+ errors: {
2207
+ 401: 'User not authenticated'
2208
+ }
2209
+ });
2210
+ }
2211
+
2212
+ /**
2213
+ * Get cash-flow trends
2214
+ *
2215
+ * Monthly income / expense / netSavings over a fixed N-month window
2216
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
2217
+ *
2218
+ * **Parameters:**
2219
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
2220
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
2221
+ *
2222
+ * @param data The data for the request.
2223
+ * @param data.region Region code for tenant context
2224
+ * @param data.period Time period
2225
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
2226
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
2227
+ * @throws ApiError
2228
+ */
2229
+ public static reportingControllerGetCashFlowTrends(
2230
+ data: ReportingControllerGetCashFlowTrendsData
2231
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
2232
+ return __request(OpenAPI, {
2233
+ method: 'GET',
2234
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
2235
+ path: {
2236
+ region: data.region
2237
+ },
2238
+ query: {
2239
+ period: data.period,
2240
+ granularity: data.granularity
2241
+ },
2242
+ errors: {
2243
+ 401: 'User not authenticated'
2244
+ }
2245
+ });
2246
+ }
2247
+
2248
+ /**
2249
+ * Generate portfolio snapshot
2250
+ *
2251
+ * Manually generate a portfolio snapshot for a specific date.
2252
+ *
2253
+ * **Multi-currency Support:**
2254
+ * - Fetches balances grouped by currency
2255
+ * - Uses user's baseCurrency setting for conversion
2256
+ * - Stores exchange rates and warnings
2257
+ *
2258
+ * **Use Cases:**
2259
+ * - Testing snapshot generation
2260
+ * - Force regeneration after data correction
2261
+ * - Initial setup for new users
2262
+ *
2263
+ * @param data The data for the request.
2264
+ * @param data.region Region code for tenant context
2265
+ * @param data.requestBody Optional date (defaults to today)
2266
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
2267
+ * @throws ApiError
2268
+ */
2269
+ public static reportingControllerGenerateSnapshot(
2270
+ data: ReportingControllerGenerateSnapshotData
2271
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
2272
+ return __request(OpenAPI, {
2273
+ method: 'POST',
2274
+ url: '/api/v1/{region}/reporting/snapshots/generate',
2275
+ path: {
2276
+ region: data.region
2277
+ },
2278
+ body: data.requestBody,
2279
+ mediaType: 'application/json',
2280
+ errors: {
2281
+ 400: 'Invalid date format',
2282
+ 401: 'User not authenticated'
2283
+ }
2284
+ });
2285
+ }
2286
+
2287
+ /**
2288
+ * Backfill portfolio snapshots
2289
+ *
2290
+ * Generate snapshots for a date range (historical data backfill).
2291
+ *
2292
+ * **Multi-currency Support:**
2293
+ * - Each snapshot includes multi-currency data
2294
+ * - Uses exchange rates available at generation time
2295
+ * - Warnings stored for missing exchange rates
2296
+ *
2297
+ * **Best Practices:**
2298
+ * - Use for initial setup after account configuration
2299
+ * - Run during low-traffic periods for large date ranges
2300
+ * - Existing snapshots are skipped (not regenerated)
2301
+ *
2302
+ * @param data The data for the request.
2303
+ * @param data.region Region code for tenant context
2304
+ * @param data.requestBody
2305
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
2306
+ * @throws ApiError
2307
+ */
2308
+ public static reportingControllerBackfillSnapshots(
2309
+ data: ReportingControllerBackfillSnapshotsData
2310
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
2311
+ return __request(OpenAPI, {
2312
+ method: 'POST',
2313
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
2314
+ path: {
2315
+ region: data.region
2316
+ },
2317
+ body: data.requestBody,
2318
+ mediaType: 'application/json',
2319
+ errors: {
2320
+ 400: 'Invalid date format or range',
2321
+ 401: 'User not authenticated',
2322
+ 409: 'Backfill already in progress for this user'
2323
+ }
2324
+ });
2325
+ }
2326
+ }
2327
+
2328
+ export class UsersService {
2329
+ /**
2330
+ * Delete own user account
2331
+ * @param data The data for the request.
2332
+ * @param data.requestBody
2333
+ * @returns void User deleted successfully
2334
+ * @throws ApiError
2335
+ */
2336
+ public static userControllerDeleteOwnUser(
2337
+ data: UserControllerDeleteOwnUserData
2338
+ ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
2339
+ return __request(OpenAPI, {
2340
+ method: 'DELETE',
2341
+ url: '/api/v1/users',
2342
+ body: data.requestBody,
2343
+ mediaType: 'application/json',
2344
+ errors: {
2345
+ 403: 'Invalid access token'
2346
+ }
2347
+ });
2348
+ }
2349
+
2350
+ /**
2351
+ * Get current authenticated user
2352
+ * @param data The data for the request.
2353
+ * @param data.acceptLanguage
2354
+ * @returns UserResponseDto User retrieved successfully
2355
+ * @throws ApiError
2356
+ */
2357
+ public static userControllerGetUser(
2358
+ data: UserControllerGetUserData
2359
+ ): CancelablePromise<UserControllerGetUserResponse> {
2360
+ return __request(OpenAPI, {
2361
+ method: 'GET',
2362
+ url: '/api/v1/users',
2363
+ headers: {
2364
+ 'accept-language': data.acceptLanguage
2365
+ }
2366
+ });
2367
+ }
2368
+
2369
+ /**
2370
+ * Sign up new user
2371
+ * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2372
+ * @param data The data for the request.
2373
+ * @param data.requestBody
2374
+ * @returns SignupResponseDto User created successfully
2375
+ * @throws ApiError
2376
+ */
2377
+ public static userControllerSignupUser(
2378
+ data: UserControllerSignupUserData
2379
+ ): CancelablePromise<UserControllerSignupUserResponse> {
2380
+ return __request(OpenAPI, {
2381
+ method: 'POST',
2382
+ url: '/api/v1/users',
2383
+ body: data.requestBody,
2384
+ mediaType: 'application/json',
2385
+ errors: {
2386
+ 400: 'Invalid Turnstile token (when Turnstile is enabled)',
2387
+ 403: 'User signup is disabled'
2388
+ }
2389
+ });
2390
+ }
2391
+
2392
+ /**
2393
+ * Delete user by ID (admin only)
2394
+ * @param data The data for the request.
2395
+ * @param data.id User ID to delete
2396
+ * @returns void User deleted successfully
2397
+ * @throws ApiError
2398
+ */
2399
+ public static userControllerDeleteUser(
2400
+ data: UserControllerDeleteUserData
2401
+ ): CancelablePromise<UserControllerDeleteUserResponse> {
2402
+ return __request(OpenAPI, {
2403
+ method: 'DELETE',
2404
+ url: '/api/v1/users/{id}',
2405
+ path: {
2406
+ id: data.id
2407
+ },
2408
+ errors: {
2409
+ 403: 'Cannot delete own account or insufficient permissions'
2410
+ }
2411
+ });
2412
+ }
2413
+
2414
+ /**
2415
+ * Get user info by user ID
2416
+ * @param data The data for the request.
2417
+ * @param data.id User ID
2418
+ * @returns unknown User info retrieved successfully
2419
+ * @throws ApiError
2420
+ */
2421
+ public static userControllerGetUserInfo(
2422
+ data: UserControllerGetUserInfoData
2423
+ ): CancelablePromise<UserControllerGetUserInfoResponse> {
2424
+ return __request(OpenAPI, {
2425
+ method: 'GET',
2426
+ url: '/api/v1/users/{id}/info',
2427
+ path: {
2428
+ id: data.id
2429
+ },
2430
+ errors: {
2431
+ 403: 'Cannot access other user info without admin permission'
2432
+ }
2433
+ });
2434
+ }
2435
+
2436
+ /**
2437
+ * Update user settings
2438
+ * @param data The data for the request.
2439
+ * @param data.requestBody
2440
+ * @returns unknown Settings updated successfully
2441
+ * @throws ApiError
2442
+ */
2443
+ public static userControllerUpdateUserSetting(
2444
+ data: UserControllerUpdateUserSettingData
2445
+ ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
2446
+ return __request(OpenAPI, {
2447
+ method: 'PUT',
2448
+ url: '/api/v1/users/setting',
2449
+ body: data.requestBody,
2450
+ mediaType: 'application/json',
2451
+ errors: {
2452
+ 403: 'Insufficient permissions'
2453
+ }
2454
+ });
2455
+ }
2456
+
2457
+ /**
2458
+ * Get all user settings paginated (admin only)
2459
+ * @param data The data for the request.
2460
+ * @param data.pageNo Page number
2461
+ * @param data.pageSize Page size
2462
+ * @returns unknown Settings list retrieved successfully
2463
+ * @throws ApiError
2464
+ */
2465
+ public static userControllerGetAllUserSettingsByPage(
2466
+ data: UserControllerGetAllUserSettingsByPageData
2467
+ ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
2468
+ return __request(OpenAPI, {
2469
+ method: 'GET',
2470
+ url: '/api/v1/users/settings-by-page',
2471
+ query: {
2472
+ pageNo: data.pageNo,
2473
+ pageSize: data.pageSize
2474
+ }
2475
+ });
2476
+ }
2477
+
2478
+ /**
2479
+ * Get asset and liability summary for current user
2480
+ * @returns unknown Summary retrieved successfully
2481
+ * @throws ApiError
2482
+ */
2483
+ public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
2484
+ return __request(OpenAPI, {
2485
+ method: 'GET',
2486
+ url: '/api/v1/users/asset-liability-summary'
2487
+ });
2488
+ }
2489
+ }
2490
+
2491
+ export class PropertiesService {
2492
+ /**
2493
+ * Get all system properties
2494
+ * @returns unknown Properties retrieved successfully
2495
+ * @throws ApiError
2496
+ */
2497
+ public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
2498
+ return __request(OpenAPI, {
2499
+ method: 'GET',
2500
+ url: '/api/v1/admin/properties',
2501
+ errors: {
2502
+ 401: 'Unauthorized',
2503
+ 403: 'Forbidden - insufficient permissions'
2504
+ }
2505
+ });
2506
+ }
2507
+
2508
+ /**
2509
+ * Get property by key
2510
+ * @param data The data for the request.
2511
+ * @param data.key Property key
2512
+ * @returns unknown Property retrieved successfully
2513
+ * @throws ApiError
2514
+ */
2515
+ public static propertyControllerGetByKey(
2516
+ data: PropertyControllerGetByKeyData
2517
+ ): CancelablePromise<PropertyControllerGetByKeyResponse> {
2518
+ return __request(OpenAPI, {
2519
+ method: 'GET',
2520
+ url: '/api/v1/admin/properties/{key}',
2521
+ path: {
2522
+ key: data.key
2523
+ },
2524
+ errors: {
2525
+ 401: 'Unauthorized',
2526
+ 403: 'Forbidden - insufficient permissions',
2527
+ 404: 'Property not found'
2528
+ }
2529
+ });
2530
+ }
2531
+
2532
+ /**
2533
+ * Update a system property
2534
+ * @param data The data for the request.
2535
+ * @param data.key Property key
2536
+ * @param data.requestBody
2537
+ * @returns unknown Property updated successfully
2538
+ * @throws ApiError
2539
+ */
2540
+ public static propertyControllerUpdate(
2541
+ data: PropertyControllerUpdateData
2542
+ ): CancelablePromise<PropertyControllerUpdateResponse> {
2543
+ return __request(OpenAPI, {
2544
+ method: 'PUT',
2545
+ url: '/api/v1/admin/properties/{key}',
2546
+ path: {
2547
+ key: data.key
2548
+ },
2549
+ body: data.requestBody,
2550
+ mediaType: 'application/json',
2551
+ errors: {
2552
+ 401: 'Unauthorized',
2553
+ 403: 'Forbidden - insufficient permissions'
2554
+ }
2555
+ });
2556
+ }
2557
+
2558
+ /**
2559
+ * Delete a system property
2560
+ * @param data The data for the request.
2561
+ * @param data.key Property key
2562
+ * @returns void Property deleted successfully
2563
+ * @throws ApiError
2564
+ */
2565
+ public static propertyControllerDelete(
2566
+ data: PropertyControllerDeleteData
2567
+ ): CancelablePromise<PropertyControllerDeleteResponse> {
2568
+ return __request(OpenAPI, {
2569
+ method: 'DELETE',
2570
+ url: '/api/v1/admin/properties/{key}',
2571
+ path: {
2572
+ key: data.key
2573
+ },
2574
+ errors: {
2575
+ 401: 'Unauthorized',
2576
+ 403: 'Forbidden - insufficient permissions',
2577
+ 404: 'Property not found'
2578
+ }
2579
+ });
2580
+ }
2581
+ }
2582
+
2583
+ export class BeanTransactionRulesService {
2584
+ /**
2585
+ * Create a new transaction rule (or upsert if upsertByPayee=true)
2586
+ * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2587
+ * @param data The data for the request.
2588
+ * @param data.region Region code for tenant context
2589
+ * @param data.requestBody
2590
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2591
+ * @throws ApiError
2592
+ */
2593
+ public static transactionRuleControllerCreate(
2594
+ data: TransactionRuleControllerCreateData
2595
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2596
+ return __request(OpenAPI, {
2597
+ method: 'POST',
2598
+ url: '/api/v1/{region}/bean/transaction-rules',
1862
2599
  path: {
1863
2600
  region: data.region
1864
2601
  },
@@ -2121,256 +2858,337 @@ export class BeanTransactionRulesService {
2121
2858
  }
2122
2859
  }
2123
2860
 
2124
- export class UsersService {
2125
- /**
2126
- * Delete own user account
2127
- * @param data The data for the request.
2128
- * @param data.requestBody
2129
- * @returns void User deleted successfully
2130
- * @throws ApiError
2131
- */
2132
- public static userControllerDeleteOwnUser(
2133
- data: UserControllerDeleteOwnUserData
2134
- ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
2135
- return __request(OpenAPI, {
2136
- method: 'DELETE',
2137
- url: '/api/v1/users',
2138
- body: data.requestBody,
2139
- mediaType: 'application/json',
2140
- errors: {
2141
- 403: 'Invalid access token'
2142
- }
2143
- });
2144
- }
2145
-
2861
+ export class BeanCategoryCatalogService {
2146
2862
  /**
2147
- * Get current authenticated user
2863
+ * List category catalog for a region
2864
+ * Returns the region-scoped category slugs (expense/income/investment/banking/transfer/payment) for the NLP result picker. CN-exclusive payment instruments (huabei/baitiao) appear only under /cn.
2148
2865
  * @param data The data for the request.
2149
- * @param data.acceptLanguage
2150
- * @returns unknown User retrieved successfully
2866
+ * @param data.region Region code for tenant context
2867
+ * @param data.scenario Filter by scenario
2868
+ * @param data.routeBearing Filter by routeBearing (entity-router route() consumes it)
2869
+ * @returns CategoryCatalogListResponseDto Category catalog retrieved successfully
2151
2870
  * @throws ApiError
2152
2871
  */
2153
- public static userControllerGetUser(
2154
- data: UserControllerGetUserData
2155
- ): CancelablePromise<UserControllerGetUserResponse> {
2872
+ public static categoryCatalogControllerList(
2873
+ data: CategoryCatalogControllerListData
2874
+ ): CancelablePromise<CategoryCatalogControllerListResponse> {
2156
2875
  return __request(OpenAPI, {
2157
2876
  method: 'GET',
2158
- url: '/api/v1/users',
2159
- headers: {
2160
- 'accept-language': data.acceptLanguage
2877
+ url: '/api/v1/{region}/bean/categories',
2878
+ path: {
2879
+ region: data.region
2880
+ },
2881
+ query: {
2882
+ scenario: data.scenario,
2883
+ routeBearing: data.routeBearing
2161
2884
  }
2162
2885
  });
2163
2886
  }
2887
+ }
2164
2888
 
2889
+ export class LifeEventsService {
2165
2890
  /**
2166
- * Sign up new user
2167
- * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2891
+ * Create a new life event
2892
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2168
2893
  * @param data The data for the request.
2894
+ * @param data.region Region code for tenant context (decorative for life events)
2169
2895
  * @param data.requestBody
2170
- * @returns unknown User created successfully
2896
+ * @returns EventResponseDto Life event created successfully
2171
2897
  * @throws ApiError
2172
2898
  */
2173
- public static userControllerSignupUser(
2174
- data: UserControllerSignupUserData
2175
- ): CancelablePromise<UserControllerSignupUserResponse> {
2899
+ public static eventControllerCreate(
2900
+ data: EventControllerCreateData
2901
+ ): CancelablePromise<EventControllerCreateResponse> {
2176
2902
  return __request(OpenAPI, {
2177
2903
  method: 'POST',
2178
- url: '/api/v1/users',
2904
+ url: '/api/v1/{region}/bean/events',
2905
+ path: {
2906
+ region: data.region
2907
+ },
2179
2908
  body: data.requestBody,
2180
2909
  mediaType: 'application/json',
2181
2910
  errors: {
2182
- 400: 'Invalid Turnstile token (when Turnstile is enabled)',
2183
- 403: 'User signup is disabled'
2911
+ 409: 'Life event already exists for this (userId, type, date) combination'
2184
2912
  }
2185
2913
  });
2186
2914
  }
2187
2915
 
2188
2916
  /**
2189
- * Delete user by ID (admin only)
2917
+ * List user life events
2918
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2190
2919
  * @param data The data for the request.
2191
- * @param data.id User ID to delete
2192
- * @returns void User deleted successfully
2920
+ * @param data.region Region code for tenant context (decorative for life events)
2921
+ * @param data.type Filter by life event type (exact match)
2922
+ * @param data.q Search term for description (case-insensitive partial match)
2923
+ * @param data.from Filter life events from this date (ISO 8601 format)
2924
+ * @param data.to Filter life events to this date (ISO 8601 format)
2925
+ * @param data.page Page number for pagination (default: 1)
2926
+ * @param data.limit Number of items per page (default: 20, max: 100)
2927
+ * @returns EventListResponseDto Life events retrieved successfully
2193
2928
  * @throws ApiError
2194
2929
  */
2195
- public static userControllerDeleteUser(
2196
- data: UserControllerDeleteUserData
2197
- ): CancelablePromise<UserControllerDeleteUserResponse> {
2930
+ public static eventControllerFindAll(
2931
+ data: EventControllerFindAllData
2932
+ ): CancelablePromise<EventControllerFindAllResponse> {
2198
2933
  return __request(OpenAPI, {
2199
- method: 'DELETE',
2200
- url: '/api/v1/users/{id}',
2934
+ method: 'GET',
2935
+ url: '/api/v1/{region}/bean/events',
2201
2936
  path: {
2202
- id: data.id
2937
+ region: data.region
2203
2938
  },
2204
- errors: {
2205
- 403: 'Cannot delete own account or insufficient permissions'
2939
+ query: {
2940
+ type: data.type,
2941
+ q: data.q,
2942
+ from: data.from,
2943
+ to: data.to,
2944
+ page: data.page,
2945
+ limit: data.limit
2206
2946
  }
2207
2947
  });
2208
2948
  }
2209
2949
 
2210
2950
  /**
2211
- * Get user info by user ID
2951
+ * Get life event by ID
2952
+ * Returns a single life event by its ID. Returns ETag header.
2212
2953
  * @param data The data for the request.
2213
- * @param data.id User ID
2214
- * @returns unknown User info retrieved successfully
2954
+ * @param data.id Life event ID
2955
+ * @param data.region Region code for tenant context (decorative for life events)
2956
+ * @returns EventResponseDto Life event retrieved successfully
2215
2957
  * @throws ApiError
2216
2958
  */
2217
- public static userControllerGetUserInfo(
2218
- data: UserControllerGetUserInfoData
2219
- ): CancelablePromise<UserControllerGetUserInfoResponse> {
2959
+ public static eventControllerFindOne(
2960
+ data: EventControllerFindOneData
2961
+ ): CancelablePromise<EventControllerFindOneResponse> {
2220
2962
  return __request(OpenAPI, {
2221
2963
  method: 'GET',
2222
- url: '/api/v1/users/{id}/info',
2964
+ url: '/api/v1/{region}/bean/events/{id}',
2223
2965
  path: {
2224
- id: data.id
2966
+ id: data.id,
2967
+ region: data.region
2225
2968
  },
2226
2969
  errors: {
2227
- 403: 'Cannot access other user info without admin permission'
2970
+ 404: 'Life event not found'
2228
2971
  }
2229
2972
  });
2230
2973
  }
2231
2974
 
2232
2975
  /**
2233
- * Update user settings
2976
+ * Update a life event
2977
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2234
2978
  * @param data The data for the request.
2979
+ * @param data.id Life event ID
2980
+ * @param data.region Region code for tenant context (decorative for life events)
2235
2981
  * @param data.requestBody
2236
- * @returns unknown Settings updated successfully
2982
+ * @returns EventResponseDto Life event updated successfully
2237
2983
  * @throws ApiError
2238
2984
  */
2239
- public static userControllerUpdateUserSetting(
2240
- data: UserControllerUpdateUserSettingData
2241
- ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
2985
+ public static eventControllerUpdate(
2986
+ data: EventControllerUpdateData
2987
+ ): CancelablePromise<EventControllerUpdateResponse> {
2242
2988
  return __request(OpenAPI, {
2243
2989
  method: 'PUT',
2244
- url: '/api/v1/users/setting',
2990
+ url: '/api/v1/{region}/bean/events/{id}',
2991
+ path: {
2992
+ id: data.id,
2993
+ region: data.region
2994
+ },
2245
2995
  body: data.requestBody,
2246
2996
  mediaType: 'application/json',
2247
2997
  errors: {
2248
- 403: 'Insufficient permissions'
2998
+ 400: 'If-Match header is not a valid ISO 8601 date',
2999
+ 404: 'Life event not found',
3000
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
3001
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2249
3002
  }
2250
3003
  });
2251
3004
  }
2252
3005
 
2253
3006
  /**
2254
- * Get all user settings paginated (admin only)
3007
+ * Delete a life event
3008
+ * Deletes a life event entry (hard delete). Returns 204.
2255
3009
  * @param data The data for the request.
2256
- * @param data.pageNo Page number
2257
- * @param data.pageSize Page size
2258
- * @returns unknown Settings list retrieved successfully
3010
+ * @param data.id Life event ID
3011
+ * @param data.region Region code for tenant context (decorative for life events)
3012
+ * @returns void Life event deleted successfully
2259
3013
  * @throws ApiError
2260
3014
  */
2261
- public static userControllerGetAllUserSettingsByPage(
2262
- data: UserControllerGetAllUserSettingsByPageData
2263
- ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
3015
+ public static eventControllerDelete(
3016
+ data: EventControllerDeleteData
3017
+ ): CancelablePromise<EventControllerDeleteResponse> {
2264
3018
  return __request(OpenAPI, {
2265
- method: 'GET',
2266
- url: '/api/v1/users/settings-by-page',
2267
- query: {
2268
- pageNo: data.pageNo,
2269
- pageSize: data.pageSize
3019
+ method: 'DELETE',
3020
+ url: '/api/v1/{region}/bean/events/{id}',
3021
+ path: {
3022
+ id: data.id,
3023
+ region: data.region
3024
+ },
3025
+ errors: {
3026
+ 404: 'Life event not found'
2270
3027
  }
2271
3028
  });
2272
3029
  }
2273
3030
 
2274
3031
  /**
2275
- * Get asset and liability summary for current user
2276
- * @returns unknown Summary retrieved successfully
3032
+ * Slice time-series by a life event (Phase 79)
3033
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
3034
+ * @param data The data for the request.
3035
+ * @param data.id Life event ID
3036
+ * @param data.accountPattern
3037
+ * @param data.granularity
3038
+ * @param data.region Region code for tenant context (decorative for life events)
3039
+ * @returns unknown Time-series sliced by the life event range
2277
3040
  * @throws ApiError
2278
3041
  */
2279
- public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
3042
+ public static eventControllerGetSlice(
3043
+ data: EventControllerGetSliceData
3044
+ ): CancelablePromise<EventControllerGetSliceResponse> {
2280
3045
  return __request(OpenAPI, {
2281
3046
  method: 'GET',
2282
- url: '/api/v1/users/asset-liability-summary'
3047
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3048
+ path: {
3049
+ id: data.id,
3050
+ region: data.region
3051
+ },
3052
+ query: {
3053
+ accountPattern: data.accountPattern,
3054
+ granularity: data.granularity
3055
+ },
3056
+ errors: {
3057
+ 400: 'accountPattern query param is empty',
3058
+ 404: 'Life event not found'
3059
+ }
2283
3060
  });
2284
3061
  }
2285
3062
  }
2286
3063
 
2287
- export class PropertiesService {
3064
+ export class OnboardingService {
2288
3065
  /**
2289
- * Get all system properties
2290
- * @returns unknown Properties retrieved successfully
3066
+ * Bootstrap core accounts + register asset accounts with opening balances (ADR-0113)
3067
+ * @param data The data for the request.
3068
+ * @param data.region Region code for tenant context
3069
+ * @param data.requestBody
3070
+ * @returns unknown Onboarding bootstrap result.
2291
3071
  * @throws ApiError
2292
3072
  */
2293
- public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
3073
+ public static onboardingControllerBootstrap(
3074
+ data: OnboardingControllerBootstrapData
3075
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
2294
3076
  return __request(OpenAPI, {
2295
- method: 'GET',
2296
- url: '/api/v1/admin/properties',
3077
+ method: 'POST',
3078
+ url: '/api/v1/{region}/bean/onboarding',
3079
+ path: {
3080
+ region: data.region
3081
+ },
3082
+ body: data.requestBody,
3083
+ mediaType: 'application/json',
2297
3084
  errors: {
2298
- 401: 'Unauthorized',
2299
- 403: 'Forbidden - insufficient permissions'
3085
+ 422: 'Invalid region/account path/duplicate paths.'
2300
3086
  }
2301
3087
  });
2302
3088
  }
3089
+ }
2303
3090
 
3091
+ export class BalanceReconciliationService {
2304
3092
  /**
2305
- * Get property by key
3093
+ * Preview reconciliation (book vs actual)
3094
+ * Computes book balance, diff, Beancount-inferred tolerance, and suggested action without persisting.
2306
3095
  * @param data The data for the request.
2307
- * @param data.key Property key
2308
- * @returns unknown Property retrieved successfully
3096
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3097
+ * @param data.requestBody
3098
+ * @returns ReconciliationComputeResultDto Reconciliation preview
2309
3099
  * @throws ApiError
2310
3100
  */
2311
- public static propertyControllerGetByKey(
2312
- data: PropertyControllerGetByKeyData
2313
- ): CancelablePromise<PropertyControllerGetByKeyResponse> {
3101
+ public static reconciliationControllerCompute(
3102
+ data: ReconciliationControllerComputeData
3103
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
3104
+ return __request(OpenAPI, {
3105
+ method: 'POST',
3106
+ url: '/api/v1/{region}/bean/reconciliations',
3107
+ path: {
3108
+ region: data.region
3109
+ },
3110
+ body: data.requestBody,
3111
+ mediaType: 'application/json',
3112
+ errors: {
3113
+ 404: 'Account not found'
3114
+ }
3115
+ });
3116
+ }
3117
+
3118
+ /**
3119
+ * Record a balance assertion
3120
+ * Persists the reconciliation as a BeanBalance assertion (amount = actual, diffAmount = book − actual). Re-reconciling the same day/currency upserts.
3121
+ * @param data The data for the request.
3122
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3123
+ * @param data.requestBody
3124
+ * @returns ReconciliationRecordDto Balance assertion recorded
3125
+ * @throws ApiError
3126
+ */
3127
+ public static reconciliationControllerAssert(
3128
+ data: ReconciliationControllerAssertData
3129
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
2314
3130
  return __request(OpenAPI, {
2315
- method: 'GET',
2316
- url: '/api/v1/admin/properties/{key}',
3131
+ method: 'POST',
3132
+ url: '/api/v1/{region}/bean/reconciliations/assert',
2317
3133
  path: {
2318
- key: data.key
3134
+ region: data.region
2319
3135
  },
3136
+ body: data.requestBody,
3137
+ mediaType: 'application/json',
2320
3138
  errors: {
2321
- 401: 'Unauthorized',
2322
- 403: 'Forbidden - insufficient permissions',
2323
- 404: 'Property not found'
3139
+ 404: 'Account not found'
2324
3140
  }
2325
3141
  });
2326
3142
  }
2327
3143
 
2328
3144
  /**
2329
- * Update a system property
3145
+ * Generate a pad adjusting entry
3146
+ * When book is outside tolerance, synthesizes a Beancount pad transaction (flag P) booking the diff from source_account and persists it. Source defaults to Equity:Opening-Balances.
2330
3147
  * @param data The data for the request.
2331
- * @param data.key Property key
3148
+ * @param data.region Region code for tenant context (decorative for reconciliation)
2332
3149
  * @param data.requestBody
2333
- * @returns unknown Property updated successfully
3150
+ * @returns PadResultDto Pad adjusting entry generated
2334
3151
  * @throws ApiError
2335
3152
  */
2336
- public static propertyControllerUpdate(
2337
- data: PropertyControllerUpdateData
2338
- ): CancelablePromise<PropertyControllerUpdateResponse> {
3153
+ public static reconciliationControllerPad(
3154
+ data: ReconciliationControllerPadData
3155
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
2339
3156
  return __request(OpenAPI, {
2340
- method: 'PUT',
2341
- url: '/api/v1/admin/properties/{key}',
3157
+ method: 'POST',
3158
+ url: '/api/v1/{region}/bean/reconciliations/pad',
2342
3159
  path: {
2343
- key: data.key
3160
+ region: data.region
2344
3161
  },
2345
3162
  body: data.requestBody,
2346
3163
  mediaType: 'application/json',
2347
3164
  errors: {
2348
- 401: 'Unauthorized',
2349
- 403: 'Forbidden - insufficient permissions'
3165
+ 400: 'Book already within tolerance — no pad needed',
3166
+ 404: 'Account not found'
2350
3167
  }
2351
3168
  });
2352
3169
  }
2353
3170
 
2354
3171
  /**
2355
- * Delete a system property
3172
+ * List reconciliation history for an account
3173
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
2356
3174
  * @param data The data for the request.
2357
- * @param data.key Property key
2358
- * @returns void Property deleted successfully
3175
+ * @param data.accountId BeanAccount id
3176
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3177
+ * @returns ReconciliationRecordDto Reconciliation history
2359
3178
  * @throws ApiError
2360
3179
  */
2361
- public static propertyControllerDelete(
2362
- data: PropertyControllerDeleteData
2363
- ): CancelablePromise<PropertyControllerDeleteResponse> {
3180
+ public static reconciliationControllerHistory(
3181
+ data: ReconciliationControllerHistoryData
3182
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
2364
3183
  return __request(OpenAPI, {
2365
- method: 'DELETE',
2366
- url: '/api/v1/admin/properties/{key}',
3184
+ method: 'GET',
3185
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
2367
3186
  path: {
2368
- key: data.key
3187
+ accountId: data.accountId,
3188
+ region: data.region
2369
3189
  },
2370
3190
  errors: {
2371
- 401: 'Unauthorized',
2372
- 403: 'Forbidden - insufficient permissions',
2373
- 404: 'Property not found'
3191
+ 404: 'Account not found'
2374
3192
  }
2375
3193
  });
2376
3194
  }
@@ -2554,243 +3372,271 @@ export class BeanImportService {
2554
3372
  }
2555
3373
  }
2556
3374
 
2557
- export class BeanPlatformsService {
2558
- /**
2559
- * Get all platforms with statistics
2560
- * @returns unknown List of platforms with binding and account counts
2561
- * @throws ApiError
2562
- */
2563
- public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2564
- return __request(OpenAPI, {
2565
- method: 'GET',
2566
- url: '/api/v1/bean/platforms'
2567
- });
2568
- }
2569
-
3375
+ export class ProviderSyncService {
2570
3376
  /**
2571
- * Create a new platform
3377
+ * Sync transactions from financial data provider
3378
+ *
3379
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
3380
+ *
3381
+ * **Supported Providers:**
3382
+ * - **plaid**: Plaid API (US, Canada, Europe)
3383
+ * - **teller**: Teller API (US)
3384
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
3385
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
3386
+ * - **simplefin**: SimpleFIN (Self-hosted)
3387
+ * - **yodlee**: Yodlee (Global)
3388
+ * - **beancount-direct**: Beancount format transactions
3389
+ * - **parsed-bill**: Client-side parsed bill transactions
3390
+ *
3391
+ * **Processing Flow:**
3392
+ * 1. Transform raw data via provider adapter
3393
+ * 2. Validate transaction format
3394
+ * 3. Deduplicate using originalId
3395
+ * 4. Classify using rule engine
3396
+ * 5. Route low-confidence to Review Center
3397
+ * 6. Persist validated transactions
3398
+ *
2572
3399
  * @param data The data for the request.
3400
+ * @param data.providerName Provider name
3401
+ * @param data.region Region code for tenant context
2573
3402
  * @param data.requestBody
2574
- * @returns unknown Platform created successfully
3403
+ * @returns ProviderSyncResponseDto Sync completed successfully
2575
3404
  * @throws ApiError
2576
3405
  */
2577
- public static platformControllerCreate(
2578
- data: PlatformControllerCreateData
2579
- ): CancelablePromise<PlatformControllerCreateResponse> {
3406
+ public static providerSyncControllerSync(
3407
+ data: ProviderSyncControllerSyncData
3408
+ ): CancelablePromise<ProviderSyncControllerSyncResponse> {
2580
3409
  return __request(OpenAPI, {
2581
3410
  method: 'POST',
2582
- url: '/api/v1/bean/platforms',
3411
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3412
+ path: {
3413
+ providerName: data.providerName,
3414
+ region: data.region
3415
+ },
2583
3416
  body: data.requestBody,
2584
3417
  mediaType: 'application/json',
2585
3418
  errors: {
2586
- 409: 'Platform already exists'
3419
+ 400: 'Invalid request data',
3420
+ 401: 'Missing or invalid authentication',
3421
+ 404: 'Provider not supported'
2587
3422
  }
2588
3423
  });
2589
3424
  }
2590
3425
 
2591
3426
  /**
2592
- * Get platform list for current user
2593
- * @returns unknown List of platforms with user binding status
3427
+ * Get supported providers
3428
+ * Returns a list of all providers supported by the sync endpoint.
3429
+ * @param data The data for the request.
3430
+ * @param data.region Region code for tenant context
3431
+ * @returns SupportedProvidersResponseDto List of supported providers
2594
3432
  * @throws ApiError
2595
3433
  */
2596
- public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3434
+ public static providerSyncControllerGetSupportedProviders(
3435
+ data: ProviderSyncControllerGetSupportedProvidersData
3436
+ ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
2597
3437
  return __request(OpenAPI, {
2598
3438
  method: 'GET',
2599
- url: '/api/v1/bean/platforms/list'
3439
+ url: '/api/v1/{region}/bean/import/provider/supported',
3440
+ path: {
3441
+ region: data.region
3442
+ },
3443
+ errors: {
3444
+ 401: 'Missing or invalid authentication'
3445
+ }
2600
3446
  });
2601
3447
  }
2602
3448
 
2603
3449
  /**
2604
- * Match platforms by name or alias
3450
+ * Check if provider is supported
3451
+ * Returns whether a specific provider is supported.
2605
3452
  * @param data The data for the request.
2606
- * @param data.q Search query — Chinese name, English name, or abbreviation
2607
- * @param data.region Region code for category override lookup
2608
- * @returns unknown List of matching platforms with suggested segment names
3453
+ * @param data.providerName Provider name to check
3454
+ * @param data.region Region code for tenant context
3455
+ * @returns unknown Provider support status
2609
3456
  * @throws ApiError
2610
3457
  */
2611
- public static platformControllerMatchPlatforms(
2612
- data: PlatformControllerMatchPlatformsData
2613
- ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3458
+ public static providerSyncControllerIsProviderSupported(
3459
+ data: ProviderSyncControllerIsProviderSupportedData
3460
+ ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
2614
3461
  return __request(OpenAPI, {
2615
3462
  method: 'GET',
2616
- url: '/api/v1/bean/platforms/match',
2617
- query: {
2618
- q: data.q,
3463
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3464
+ path: {
3465
+ providerName: data.providerName,
2619
3466
  region: data.region
3467
+ },
3468
+ errors: {
3469
+ 401: 'Missing or invalid authentication'
2620
3470
  }
2621
3471
  });
2622
3472
  }
3473
+ }
2623
3474
 
3475
+ export class ExternalAccountLinksService {
2624
3476
  /**
2625
- * Update a platform
3477
+ * Create an external account → BeanAccount mapping (ADR-0113)
2626
3478
  * @param data The data for the request.
2627
- * @param data.id Platform ID
3479
+ * @param data.region Region code for tenant context
2628
3480
  * @param data.requestBody
2629
- * @returns unknown Platform updated successfully
3481
+ * @returns ExternalAccountLinkResponseDto Link created.
2630
3482
  * @throws ApiError
2631
3483
  */
2632
- public static platformControllerUpdate(
2633
- data: PlatformControllerUpdateData
2634
- ): CancelablePromise<PlatformControllerUpdateResponse> {
3484
+ public static externalAccountLinkControllerCreate(
3485
+ data: ExternalAccountLinkControllerCreateData
3486
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
2635
3487
  return __request(OpenAPI, {
2636
- method: 'PUT',
2637
- url: '/api/v1/bean/platforms/{id}',
3488
+ method: 'POST',
3489
+ url: '/api/v1/{region}/bean/external-account-links',
2638
3490
  path: {
2639
- id: data.id
3491
+ region: data.region
2640
3492
  },
2641
3493
  body: data.requestBody,
2642
3494
  mediaType: 'application/json',
2643
3495
  errors: {
2644
- 404: 'Platform not found'
3496
+ 422: 'beanAccountId not owned, or an active link already exists.'
2645
3497
  }
2646
3498
  });
2647
3499
  }
2648
3500
 
2649
3501
  /**
2650
- * Delete a platform
3502
+ * List the user's active external account links
2651
3503
  * @param data The data for the request.
2652
- * @param data.id Platform ID
2653
- * @returns void Platform deleted successfully
3504
+ * @param data.provider
3505
+ * @param data.region Region code for tenant context
3506
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
2654
3507
  * @throws ApiError
2655
3508
  */
2656
- public static platformControllerDelete(
2657
- data: PlatformControllerDeleteData
2658
- ): CancelablePromise<PlatformControllerDeleteResponse> {
3509
+ public static externalAccountLinkControllerFindAll(
3510
+ data: ExternalAccountLinkControllerFindAllData
3511
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
2659
3512
  return __request(OpenAPI, {
2660
- method: 'DELETE',
2661
- url: '/api/v1/bean/platforms/{id}',
3513
+ method: 'GET',
3514
+ url: '/api/v1/{region}/bean/external-account-links',
2662
3515
  path: {
2663
- id: data.id
3516
+ region: data.region
2664
3517
  },
2665
- errors: {
2666
- 404: 'Platform not found'
3518
+ query: {
3519
+ provider: data.provider
2667
3520
  }
2668
3521
  });
2669
3522
  }
2670
- }
2671
3523
 
2672
- export class ProviderSyncService {
2673
3524
  /**
2674
- * Sync transactions from financial data provider
2675
- *
2676
- * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
2677
- *
2678
- * **Supported Providers:**
2679
- * - **plaid**: Plaid API (US, Canada, Europe)
2680
- * - **teller**: Teller API (US)
2681
- * - **truelayer**: TrueLayer Open Banking (UK, Europe)
2682
- * - **gocardless**: GoCardless Bank Account Data (Europe)
2683
- * - **simplefin**: SimpleFIN (Self-hosted)
2684
- * - **yodlee**: Yodlee (Global)
2685
- * - **beancount-direct**: Beancount format transactions
2686
- * - **parsed-bill**: Client-side parsed bill transactions
2687
- *
2688
- * **Processing Flow:**
2689
- * 1. Transform raw data via provider adapter
2690
- * 2. Validate transaction format
2691
- * 3. Deduplicate using originalId
2692
- * 4. Classify using rule engine
2693
- * 5. Route low-confidence to Review Center
2694
- * 6. Persist validated transactions
2695
- *
3525
+ * Get a single external account link
2696
3526
  * @param data The data for the request.
2697
- * @param data.providerName Provider name
2698
- * @param data.region Region code
2699
- * @param data.requestBody
2700
- * @returns ProviderSyncResponseDto Sync completed successfully
3527
+ * @param data.id
3528
+ * @param data.region Region code for tenant context
3529
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
2701
3530
  * @throws ApiError
2702
3531
  */
2703
- public static providerSyncControllerSync(
2704
- data: ProviderSyncControllerSyncData
2705
- ): CancelablePromise<ProviderSyncControllerSyncResponse> {
3532
+ public static externalAccountLinkControllerFindOne(
3533
+ data: ExternalAccountLinkControllerFindOneData
3534
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
2706
3535
  return __request(OpenAPI, {
2707
- method: 'POST',
2708
- url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3536
+ method: 'GET',
3537
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
2709
3538
  path: {
2710
- providerName: data.providerName,
3539
+ id: data.id,
2711
3540
  region: data.region
2712
3541
  },
2713
- body: data.requestBody,
2714
- mediaType: 'application/json',
2715
3542
  errors: {
2716
- 400: 'Invalid request data',
2717
- 401: 'Missing or invalid authentication',
2718
- 404: 'Provider not supported'
3543
+ 422: 'Link not found or not owned by the user.'
2719
3544
  }
2720
3545
  });
2721
3546
  }
2722
3547
 
2723
3548
  /**
2724
- * Get supported providers
2725
- * Returns a list of all providers supported by the sync endpoint.
3549
+ * Soft-delete (disconnect) an external account link
2726
3550
  * @param data The data for the request.
3551
+ * @param data.id
2727
3552
  * @param data.region Region code for tenant context
2728
- * @returns SupportedProvidersResponseDto List of supported providers
3553
+ * @returns void Link soft-deleted; historical transactions are unaffected.
2729
3554
  * @throws ApiError
2730
3555
  */
2731
- public static providerSyncControllerGetSupportedProviders(
2732
- data: ProviderSyncControllerGetSupportedProvidersData
2733
- ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
3556
+ public static externalAccountLinkControllerRemove(
3557
+ data: ExternalAccountLinkControllerRemoveData
3558
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
2734
3559
  return __request(OpenAPI, {
2735
- method: 'GET',
2736
- url: '/api/v1/{region}/bean/import/provider/supported',
3560
+ method: 'DELETE',
3561
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3562
+ path: {
3563
+ id: data.id,
3564
+ region: data.region
3565
+ }
3566
+ });
3567
+ }
3568
+ }
3569
+
3570
+ export class ImportTelemetryService {
3571
+ /**
3572
+ * Receive anonymous parser failure telemetry
3573
+ * @param data The data for the request.
3574
+ * @param data.region Region code for tenant context
3575
+ * @param data.requestBody
3576
+ * @returns unknown Telemetry report received
3577
+ * @throws ApiError
3578
+ */
3579
+ public static telemetryControllerReportTelemetry(
3580
+ data: TelemetryControllerReportTelemetryData
3581
+ ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
3582
+ return __request(OpenAPI, {
3583
+ method: 'POST',
3584
+ url: '/api/v1/{region}/bean/import/parser-telemetry',
2737
3585
  path: {
2738
3586
  region: data.region
2739
3587
  },
3588
+ body: data.requestBody,
3589
+ mediaType: 'application/json',
2740
3590
  errors: {
2741
- 401: 'Missing or invalid authentication'
3591
+ 401: 'Unauthorized'
2742
3592
  }
2743
3593
  });
2744
3594
  }
2745
3595
 
2746
3596
  /**
2747
- * Check if provider is supported
2748
- * Returns whether a specific provider is supported.
3597
+ * Receive anonymous zero-hit coverage miss report
2749
3598
  * @param data The data for the request.
2750
- * @param data.providerName Provider name to check
2751
3599
  * @param data.region Region code for tenant context
2752
- * @returns unknown Provider support status
3600
+ * @param data.requestBody
3601
+ * @returns unknown Coverage miss report received
2753
3602
  * @throws ApiError
2754
3603
  */
2755
- public static providerSyncControllerIsProviderSupported(
2756
- data: ProviderSyncControllerIsProviderSupportedData
2757
- ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
3604
+ public static telemetryControllerReportCoverageMiss(
3605
+ data: TelemetryControllerReportCoverageMissData
3606
+ ): CancelablePromise<TelemetryControllerReportCoverageMissResponse> {
2758
3607
  return __request(OpenAPI, {
2759
- method: 'GET',
2760
- url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3608
+ method: 'POST',
3609
+ url: '/api/v1/{region}/bean/import/parser-coverage-miss',
2761
3610
  path: {
2762
- providerName: data.providerName,
2763
3611
  region: data.region
2764
3612
  },
3613
+ body: data.requestBody,
3614
+ mediaType: 'application/json',
2765
3615
  errors: {
2766
- 401: 'Missing or invalid authentication'
3616
+ 401: 'Unauthorized'
2767
3617
  }
2768
3618
  });
2769
3619
  }
2770
- }
2771
3620
 
2772
- export class ImportTelemetryService {
2773
3621
  /**
2774
- * Receive anonymous parser failure telemetry
3622
+ * Coverage metrics (uncovered format aggregation)
2775
3623
  * @param data The data for the request.
2776
3624
  * @param data.region Region code for tenant context
2777
- * @param data.requestBody
2778
- * @returns unknown Telemetry report received
3625
+ * @param data.topN Top-N uncovered formats (default 10)
3626
+ * @returns unknown Coverage metrics
2779
3627
  * @throws ApiError
2780
3628
  */
2781
- public static telemetryControllerReportTelemetry(
2782
- data: TelemetryControllerReportTelemetryData
2783
- ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
3629
+ public static telemetryControllerGetCoverageMetrics(
3630
+ data: TelemetryControllerGetCoverageMetricsData
3631
+ ): CancelablePromise<TelemetryControllerGetCoverageMetricsResponse> {
2784
3632
  return __request(OpenAPI, {
2785
- method: 'POST',
2786
- url: '/api/v1/{region}/bean/import/parser-telemetry',
3633
+ method: 'GET',
3634
+ url: '/api/v1/{region}/bean/import/parser-coverage-metrics',
2787
3635
  path: {
2788
3636
  region: data.region
2789
3637
  },
2790
- body: data.requestBody,
2791
- mediaType: 'application/json',
2792
- errors: {
2793
- 401: 'Unauthorized'
3638
+ query: {
3639
+ topN: data.topN
2794
3640
  }
2795
3641
  });
2796
3642
  }
@@ -2879,6 +3725,128 @@ export class BeanNlpService {
2879
3725
  }
2880
3726
  }
2881
3727
 
3728
+ export class BeanPlatformsService {
3729
+ /**
3730
+ * Get all platforms with statistics
3731
+ * @returns unknown List of platforms with binding and account counts
3732
+ * @throws ApiError
3733
+ */
3734
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
3735
+ return __request(OpenAPI, {
3736
+ method: 'GET',
3737
+ url: '/api/v1/bean/platforms'
3738
+ });
3739
+ }
3740
+
3741
+ /**
3742
+ * Create a new platform
3743
+ * @param data The data for the request.
3744
+ * @param data.requestBody
3745
+ * @returns unknown Platform created successfully
3746
+ * @throws ApiError
3747
+ */
3748
+ public static platformControllerCreate(
3749
+ data: PlatformControllerCreateData
3750
+ ): CancelablePromise<PlatformControllerCreateResponse> {
3751
+ return __request(OpenAPI, {
3752
+ method: 'POST',
3753
+ url: '/api/v1/bean/platforms',
3754
+ body: data.requestBody,
3755
+ mediaType: 'application/json',
3756
+ errors: {
3757
+ 409: 'Platform already exists'
3758
+ }
3759
+ });
3760
+ }
3761
+
3762
+ /**
3763
+ * Get platform list for current user
3764
+ * @param data The data for the request.
3765
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-type-bucket ordering (local-region platforms first). Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3766
+ * @returns PlatformListItemDto List of platforms with user binding status
3767
+ * @throws ApiError
3768
+ */
3769
+ public static platformControllerGetPlatformList(
3770
+ data: PlatformControllerGetPlatformListData = {}
3771
+ ): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3772
+ return __request(OpenAPI, {
3773
+ method: 'GET',
3774
+ url: '/api/v1/bean/platforms/list',
3775
+ query: {
3776
+ region: data.region
3777
+ }
3778
+ });
3779
+ }
3780
+
3781
+ /**
3782
+ * Match platforms by name or alias
3783
+ * @param data The data for the request.
3784
+ * @param data.q Search query — Chinese name, English name, or abbreviation
3785
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-tier ordering (local-region platforms first); also the intended categoryOverrides key. Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3786
+ * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3787
+ * @throws ApiError
3788
+ */
3789
+ public static platformControllerMatchPlatforms(
3790
+ data: PlatformControllerMatchPlatformsData
3791
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3792
+ return __request(OpenAPI, {
3793
+ method: 'GET',
3794
+ url: '/api/v1/bean/platforms/match',
3795
+ query: {
3796
+ q: data.q,
3797
+ region: data.region
3798
+ }
3799
+ });
3800
+ }
3801
+
3802
+ /**
3803
+ * Update a platform
3804
+ * @param data The data for the request.
3805
+ * @param data.id Platform ID
3806
+ * @param data.requestBody
3807
+ * @returns unknown Platform updated successfully
3808
+ * @throws ApiError
3809
+ */
3810
+ public static platformControllerUpdate(
3811
+ data: PlatformControllerUpdateData
3812
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3813
+ return __request(OpenAPI, {
3814
+ method: 'PUT',
3815
+ url: '/api/v1/bean/platforms/{id}',
3816
+ path: {
3817
+ id: data.id
3818
+ },
3819
+ body: data.requestBody,
3820
+ mediaType: 'application/json',
3821
+ errors: {
3822
+ 404: 'Platform not found'
3823
+ }
3824
+ });
3825
+ }
3826
+
3827
+ /**
3828
+ * Delete a platform
3829
+ * @param data The data for the request.
3830
+ * @param data.id Platform ID
3831
+ * @returns void Platform deleted successfully
3832
+ * @throws ApiError
3833
+ */
3834
+ public static platformControllerDelete(
3835
+ data: PlatformControllerDeleteData
3836
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3837
+ return __request(OpenAPI, {
3838
+ method: 'DELETE',
3839
+ url: '/api/v1/bean/platforms/{id}',
3840
+ path: {
3841
+ id: data.id
3842
+ },
3843
+ errors: {
3844
+ 404: 'Platform not found'
3845
+ }
3846
+ });
3847
+ }
3848
+ }
3849
+
2882
3850
  export class DashboardService {
2883
3851
  /**
2884
3852
  * Get net worth overview
@@ -2914,6 +3882,7 @@ export class DashboardService {
2914
3882
  * @param data.region Region code for tenant context
2915
3883
  * @param data.groupBy Grouping strategy
2916
3884
  * @param data.date Date for balance calculation (ISO 8601 format)
3885
+ * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
2917
3886
  * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
2918
3887
  * @throws ApiError
2919
3888
  */
@@ -2928,7 +3897,8 @@ export class DashboardService {
2928
3897
  },
2929
3898
  query: {
2930
3899
  groupBy: data.groupBy,
2931
- date: data.date
3900
+ date: data.date,
3901
+ accountId: data.accountId
2932
3902
  },
2933
3903
  errors: {
2934
3904
  401: 'User not authenticated'
@@ -2963,124 +3933,69 @@ export class DashboardService {
2963
3933
  }
2964
3934
  });
2965
3935
  }
2966
- }
2967
3936
 
2968
- export class ReportingService {
2969
3937
  /**
2970
- * Get portfolio value trends
2971
- *
2972
- * Returns time series data of portfolio net worth.
2973
- *
2974
- * **Multi-currency Support:**
2975
- * - `series[].byCurrency` - Currency breakdown for each data point
2976
- * - `byCurrency` - Separate time series grouped by currency
2977
- * - `warnings` - Exchange rate warnings if conversion failed
2978
- *
2979
- * **Parameters:**
2980
- * - `period`: Time period (1m, 3m, 6m, 1y)
2981
- * - `granularity`: Data granularity (day, week, month)
2982
- *
3938
+ * Get expenses/income grouped by functional category
3939
+ * Returns amounts pre-aggregated by functional category (account-path Group segment) with server-side multi-currency conversion. flow=expense (default) aggregates ^Expenses: accounts; flow=income aggregates ^Income: accounts (issue #518)
2983
3940
  * @param data The data for the request.
2984
3941
  * @param data.region Region code for tenant context
2985
- * @param data.period Time period
2986
- * @param data.granularity Data granularity
2987
- * @returns PortfolioTrendsResponseDto Trends retrieved successfully
3942
+ * @param data.groupBy Grouping strategy
3943
+ * @param data.period Time window (1m = current calendar month)
3944
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
3945
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
2988
3946
  * @throws ApiError
2989
3947
  */
2990
- public static reportingControllerGetPortfolioTrends(
2991
- data: ReportingControllerGetPortfolioTrendsData
2992
- ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
3948
+ public static dashboardControllerGetExpenses(
3949
+ data: DashboardControllerGetExpensesData
3950
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
2993
3951
  return __request(OpenAPI, {
2994
3952
  method: 'GET',
2995
- url: '/api/v1/{region}/reporting/portfolio/trends',
3953
+ url: '/api/v1/{region}/dashboard/expenses',
2996
3954
  path: {
2997
3955
  region: data.region
2998
3956
  },
2999
3957
  query: {
3958
+ groupBy: data.groupBy,
3000
3959
  period: data.period,
3001
- granularity: data.granularity
3960
+ flow: data.flow
3002
3961
  },
3003
3962
  errors: {
3963
+ 400: 'Invalid groupBy or period',
3004
3964
  401: 'User not authenticated'
3005
3965
  }
3006
3966
  });
3007
3967
  }
3968
+ }
3008
3969
 
3970
+ export class InvestmentService {
3009
3971
  /**
3010
- * Generate portfolio snapshot
3011
- *
3012
- * Manually generate a portfolio snapshot for a specific date.
3013
- *
3014
- * **Multi-currency Support:**
3015
- * - Fetches balances grouped by currency
3016
- * - Uses user's baseCurrency setting for conversion
3017
- * - Stores exchange rates and warnings
3018
- *
3019
- * **Use Cases:**
3020
- * - Testing snapshot generation
3021
- * - Force regeneration after data correction
3022
- * - Initial setup for new users
3023
- *
3972
+ * Get per-holding unrealized + realized P&L
3973
+ * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3024
3974
  * @param data The data for the request.
3025
3975
  * @param data.region Region code for tenant context
3026
- * @param data.requestBody Optional date (defaults to today)
3027
- * @returns GenerateSnapshotResponse Snapshot generated successfully
3976
+ * @param data.asOf As-of date (ISO 8601), defaults to today
3977
+ * @param data.accountId Scope to a single account
3978
+ * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3979
+ * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3028
3980
  * @throws ApiError
3029
3981
  */
3030
- public static reportingControllerGenerateSnapshot(
3031
- data: ReportingControllerGenerateSnapshotData
3032
- ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
3982
+ public static holdingPnlControllerGetHoldingPnl(
3983
+ data: HoldingPnlControllerGetHoldingPnlData
3984
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3033
3985
  return __request(OpenAPI, {
3034
- method: 'POST',
3035
- url: '/api/v1/{region}/reporting/snapshots/generate',
3986
+ method: 'GET',
3987
+ url: '/api/v1/{region}/investment/holdings/pnl',
3036
3988
  path: {
3037
3989
  region: data.region
3038
3990
  },
3039
- body: data.requestBody,
3040
- mediaType: 'application/json',
3041
- errors: {
3042
- 400: 'Invalid date format',
3043
- 401: 'User not authenticated'
3044
- }
3045
- });
3046
- }
3047
-
3048
- /**
3049
- * Backfill portfolio snapshots
3050
- *
3051
- * Generate snapshots for a date range (historical data backfill).
3052
- *
3053
- * **Multi-currency Support:**
3054
- * - Each snapshot includes multi-currency data
3055
- * - Uses exchange rates available at generation time
3056
- * - Warnings stored for missing exchange rates
3057
- *
3058
- * **Best Practices:**
3059
- * - Use for initial setup after account configuration
3060
- * - Run during low-traffic periods for large date ranges
3061
- * - Existing snapshots are skipped (not regenerated)
3062
- *
3063
- * @param data The data for the request.
3064
- * @param data.region Region code for tenant context
3065
- * @param data.requestBody
3066
- * @returns BackfillSnapshotsResponse Backfill completed successfully
3067
- * @throws ApiError
3068
- */
3069
- public static reportingControllerBackfillSnapshots(
3070
- data: ReportingControllerBackfillSnapshotsData
3071
- ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
3072
- return __request(OpenAPI, {
3073
- method: 'POST',
3074
- url: '/api/v1/{region}/reporting/snapshots/backfill',
3075
- path: {
3076
- region: data.region
3991
+ query: {
3992
+ asOf: data.asOf,
3993
+ accountId: data.accountId,
3994
+ method: data.method
3077
3995
  },
3078
- body: data.requestBody,
3079
- mediaType: 'application/json',
3080
3996
  errors: {
3081
- 400: 'Invalid date format or range',
3082
- 401: 'User not authenticated',
3083
- 409: 'Backfill already in progress for this user'
3997
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3998
+ 401: 'User not authenticated'
3084
3999
  }
3085
4000
  });
3086
4001
  }
@@ -3109,7 +4024,7 @@ export class AuthService {
3109
4024
  * Anonymous login with access token
3110
4025
  * @param data The data for the request.
3111
4026
  * @param data.requestBody
3112
- * @returns unknown Login successful
4027
+ * @returns AnonymousLoginResponseDto Login successful
3113
4028
  * @throws ApiError
3114
4029
  */
3115
4030
  public static authControllerAccessTokenLogin(
@@ -3296,3 +4211,53 @@ export class InfoService {
3296
4211
  });
3297
4212
  }
3298
4213
  }
4214
+
4215
+ export class MarketDataService {
4216
+ /**
4217
+ * Search market symbols by name or code
4218
+ * Ranked search over the openbb catalog. Empty `q` returns [].
4219
+ * @param data The data for the request.
4220
+ * @param data.q Search term — matched against symbol and instrument name. Empty string returns [].
4221
+ * @param data.limit Maximum number of results (clamped 1..50)
4222
+ * @param data.exchange Filter by exchange code (e.g. US, HK, SS, SZ)
4223
+ * @param data.assetType Filter by OpenBB asset_type (e.g. stock, etf)
4224
+ * @returns SymbolSearchResultDto Ranked search results
4225
+ * @throws ApiError
4226
+ */
4227
+ public static symbolControllerSearch(
4228
+ data: SymbolControllerSearchData
4229
+ ): CancelablePromise<SymbolControllerSearchResponse> {
4230
+ return __request(OpenAPI, {
4231
+ method: 'GET',
4232
+ url: '/api/v1/market/symbols/search',
4233
+ query: {
4234
+ q: data.q,
4235
+ limit: data.limit,
4236
+ exchange: data.exchange,
4237
+ assetType: data.assetType
4238
+ }
4239
+ });
4240
+ }
4241
+
4242
+ /**
4243
+ * Get a market symbol quote
4244
+ * @param data The data for the request.
4245
+ * @param data.symbol
4246
+ * @returns SymbolQuoteDto Symbol quote
4247
+ * @throws ApiError
4248
+ */
4249
+ public static symbolControllerGetQuote(
4250
+ data: SymbolControllerGetQuoteData
4251
+ ): CancelablePromise<SymbolControllerGetQuoteResponse> {
4252
+ return __request(OpenAPI, {
4253
+ method: 'GET',
4254
+ url: '/api/v1/market/symbols/{symbol}/quote',
4255
+ path: {
4256
+ symbol: data.symbol
4257
+ },
4258
+ errors: {
4259
+ 404: 'Symbol not found in the openbb catalog'
4260
+ }
4261
+ });
4262
+ }
4263
+ }