@firela/api-types 0.0.0-canary.8c68ebbe → 0.0.0-canary.92035f3d

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,
@@ -97,6 +99,18 @@ import type {
97
99
  CommodityControllerGetOrCreateResponse,
98
100
  CommodityControllerBulkCreateData,
99
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,
100
114
  RecurringRuleControllerCreateData,
101
115
  RecurringRuleControllerCreateResponse,
102
116
  RecurringRuleControllerFindAllData,
@@ -129,26 +143,14 @@ import type {
129
143
  ExpectedTransactionControllerEnterNowResponse,
130
144
  ForecastControllerGetForecastData,
131
145
  ForecastControllerGetForecastResponse,
132
- TransactionRuleControllerCreateData,
133
- TransactionRuleControllerCreateResponse,
134
- TransactionRuleControllerListData,
135
- TransactionRuleControllerListResponse,
136
- TransactionRuleControllerValidateData,
137
- TransactionRuleControllerValidateResponse,
138
- TransactionRuleControllerBulkCreateData,
139
- TransactionRuleControllerBulkCreateResponse,
140
- TransactionRuleControllerExportData,
141
- TransactionRuleControllerExportResponse,
142
- TransactionRuleControllerGetStatisticsData,
143
- TransactionRuleControllerGetStatisticsResponse,
144
- TransactionRuleControllerGetDetailData,
145
- TransactionRuleControllerGetDetailResponse,
146
- TransactionRuleControllerUpdateData,
147
- TransactionRuleControllerUpdateResponse,
148
- TransactionRuleControllerDeleteData,
149
- TransactionRuleControllerDeleteResponse,
150
- TransactionRuleControllerTestData,
151
- TransactionRuleControllerTestResponse,
146
+ ReportingControllerGetPortfolioTrendsData,
147
+ ReportingControllerGetPortfolioTrendsResponse,
148
+ ReportingControllerGetCashFlowTrendsData,
149
+ ReportingControllerGetCashFlowTrendsResponse,
150
+ ReportingControllerGenerateSnapshotData,
151
+ ReportingControllerGenerateSnapshotResponse,
152
+ ReportingControllerBackfillSnapshotsData,
153
+ ReportingControllerBackfillSnapshotsResponse,
152
154
  UserControllerDeleteOwnUserData,
153
155
  UserControllerDeleteOwnUserResponse,
154
156
  UserControllerGetUserData,
@@ -171,6 +173,26 @@ import type {
171
173
  PropertyControllerUpdateResponse,
172
174
  PropertyControllerDeleteData,
173
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,
174
196
  EventControllerCreateData,
175
197
  EventControllerCreateResponse,
176
198
  EventControllerFindAllData,
@@ -181,6 +203,18 @@ import type {
181
203
  EventControllerUpdateResponse,
182
204
  EventControllerDeleteData,
183
205
  EventControllerDeleteResponse,
206
+ EventControllerGetSliceData,
207
+ EventControllerGetSliceResponse,
208
+ OnboardingControllerBootstrapData,
209
+ OnboardingControllerBootstrapResponse,
210
+ ReconciliationControllerComputeData,
211
+ ReconciliationControllerComputeResponse,
212
+ ReconciliationControllerAssertData,
213
+ ReconciliationControllerAssertResponse,
214
+ ReconciliationControllerPadData,
215
+ ReconciliationControllerPadResponse,
216
+ ReconciliationControllerHistoryData,
217
+ ReconciliationControllerHistoryResponse,
184
218
  ExportControllerExportBeancountResponse,
185
219
  FileImportControllerImportFileData,
186
220
  FileImportControllerImportFileResponse,
@@ -194,22 +228,20 @@ import type {
194
228
  ImporterConfigControllerUpdateConfigResponse,
195
229
  ImporterConfigControllerResetConfigData,
196
230
  ImporterConfigControllerResetConfigResponse,
197
- PlatformControllerFindAllResponse,
198
- PlatformControllerCreateData,
199
- PlatformControllerCreateResponse,
200
- PlatformControllerGetPlatformListResponse,
201
- PlatformControllerMatchPlatformsData,
202
- PlatformControllerMatchPlatformsResponse,
203
- PlatformControllerUpdateData,
204
- PlatformControllerUpdateResponse,
205
- PlatformControllerDeleteData,
206
- PlatformControllerDeleteResponse,
207
231
  ProviderSyncControllerSyncData,
208
232
  ProviderSyncControllerSyncResponse,
209
233
  ProviderSyncControllerGetSupportedProvidersData,
210
234
  ProviderSyncControllerGetSupportedProvidersResponse,
211
235
  ProviderSyncControllerIsProviderSupportedData,
212
236
  ProviderSyncControllerIsProviderSupportedResponse,
237
+ ExternalAccountLinkControllerCreateData,
238
+ ExternalAccountLinkControllerCreateResponse,
239
+ ExternalAccountLinkControllerFindAllData,
240
+ ExternalAccountLinkControllerFindAllResponse,
241
+ ExternalAccountLinkControllerFindOneData,
242
+ ExternalAccountLinkControllerFindOneResponse,
243
+ ExternalAccountLinkControllerRemoveData,
244
+ ExternalAccountLinkControllerRemoveResponse,
213
245
  TelemetryControllerReportTelemetryData,
214
246
  TelemetryControllerReportTelemetryResponse,
215
247
  TelemetryControllerReportCoverageMissData,
@@ -222,32 +254,26 @@ import type {
222
254
  NlpControllerClearSessionResponse,
223
255
  NlpControllerGetSessionData,
224
256
  NlpControllerGetSessionResponse,
257
+ PlatformControllerFindAllResponse,
258
+ PlatformControllerCreateData,
259
+ PlatformControllerCreateResponse,
260
+ PlatformControllerGetPlatformListResponse,
261
+ PlatformControllerMatchPlatformsData,
262
+ PlatformControllerMatchPlatformsResponse,
263
+ PlatformControllerUpdateData,
264
+ PlatformControllerUpdateResponse,
265
+ PlatformControllerDeleteData,
266
+ PlatformControllerDeleteResponse,
225
267
  DashboardControllerGetNetWorthData,
226
268
  DashboardControllerGetNetWorthResponse,
227
269
  DashboardControllerGetAccountsData,
228
270
  DashboardControllerGetAccountsResponse,
229
271
  DashboardControllerGetCashFlowData,
230
272
  DashboardControllerGetCashFlowResponse,
273
+ DashboardControllerGetExpensesData,
274
+ DashboardControllerGetExpensesResponse,
231
275
  HoldingPnlControllerGetHoldingPnlData,
232
276
  HoldingPnlControllerGetHoldingPnlResponse,
233
- PriceControllerCreateData,
234
- PriceControllerCreateResponse,
235
- PriceControllerFindAllData,
236
- PriceControllerFindAllResponse,
237
- PriceControllerFindOneData,
238
- PriceControllerFindOneResponse,
239
- PriceControllerUpdateData,
240
- PriceControllerUpdateResponse,
241
- PriceControllerDeleteData,
242
- PriceControllerDeleteResponse,
243
- PriceControllerBulkCreateData,
244
- PriceControllerBulkCreateResponse,
245
- ReportingControllerGetPortfolioTrendsData,
246
- ReportingControllerGetPortfolioTrendsResponse,
247
- ReportingControllerGenerateSnapshotData,
248
- ReportingControllerGenerateSnapshotResponse,
249
- ReportingControllerBackfillSnapshotsData,
250
- ReportingControllerBackfillSnapshotsResponse,
251
277
  ApiKeysControllerCreateApiKeyResponse,
252
278
  AuthControllerAccessTokenLoginData,
253
279
  AuthControllerAccessTokenLoginResponse,
@@ -262,7 +288,11 @@ import type {
262
288
  HealthControllerResetCircuitBreakerData,
263
289
  HealthControllerResetCircuitBreakerResponse,
264
290
  HealthControllerGetMetricsResponse,
265
- InfoControllerGetInfoResponse
291
+ InfoControllerGetInfoResponse,
292
+ SymbolControllerSearchData,
293
+ SymbolControllerSearchResponse,
294
+ SymbolControllerGetQuoteData,
295
+ SymbolControllerGetQuoteResponse
266
296
  } from './types.gen';
267
297
 
268
298
  export class BeanAccountsService {
@@ -300,7 +330,7 @@ export class BeanAccountsService {
300
330
  * @param data.type Filter by account type
301
331
  * @param data.status Filter by status
302
332
  * @param data.isCustom Filter by custom (user-created) accounts only
303
- * @param data.search Search term for path or i18nKey
333
+ * @param data.search Search term for account path
304
334
  * @param data.limit Maximum number of results
305
335
  * @param data.offset Number of results to skip
306
336
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -462,6 +492,35 @@ export class BeanAccountsService {
462
492
  }
463
493
  });
464
494
  }
495
+
496
+ /**
497
+ * Post an opening-balance transaction
498
+ * 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.
499
+ * @param data The data for the request.
500
+ * @param data.id Account UUID
501
+ * @param data.region Region code for tenant context
502
+ * @param data.requestBody
503
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
504
+ * @throws ApiError
505
+ */
506
+ public static accountControllerAddOpeningBalance(
507
+ data: AccountControllerAddOpeningBalanceData
508
+ ): CancelablePromise<AccountControllerAddOpeningBalanceResponse> {
509
+ return __request(OpenAPI, {
510
+ method: 'POST',
511
+ url: '/api/v1/{region}/bean/accounts/{id}/opening-balance',
512
+ path: {
513
+ id: data.id,
514
+ region: data.region
515
+ },
516
+ body: data.requestBody,
517
+ mediaType: 'application/json',
518
+ errors: {
519
+ 404: 'Account not found',
520
+ 409: 'An opening balance already exists for this account'
521
+ }
522
+ });
523
+ }
465
524
  }
466
525
 
467
526
  export class BeanAccountStandardsService {
@@ -493,7 +552,7 @@ export class BeanAccountStandardsService {
493
552
 
494
553
  /**
495
554
  * Get template metadata for an account path
496
- * Returns extendable status and root type for a template path.
555
+ * Returns root type for a template path.
497
556
  * @param data The data for the request.
498
557
  * @param data.region Region code for tenant context
499
558
  * @param data.path Account path to check
@@ -579,6 +638,7 @@ export class BeanTransactionsService {
579
638
  * @param data.status Filter by transaction status
580
639
  * @param data.search Search in narration and payee fields (max 200 chars)
581
640
  * @param data.accountId Filter by account ID (transactions with postings to this account)
641
+ * @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
582
642
  * @returns TransactionListResponseDto Transaction list
583
643
  * @throws ApiError
584
644
  */
@@ -598,7 +658,8 @@ export class BeanTransactionsService {
598
658
  dateTo: data.dateTo,
599
659
  status: data.status,
600
660
  search: data.search,
601
- accountId: data.accountId
661
+ accountId: data.accountId,
662
+ category: data.category
602
663
  },
603
664
  errors: {
604
665
  400: 'Validation failed',
@@ -786,7 +847,7 @@ export class BeanBalancesService {
786
847
  * Query account balance
787
848
  * Calculate account balance at a specific date for a single currency
788
849
  * @param data The data for the request.
789
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
850
+ * @param data.account Account name (e.g., "Assets:Checking")
790
851
  * @param data.region Region code for tenant context
791
852
  * @param data.date Date to calculate balance at (ISO 8601 format)
792
853
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1507,155 +1568,322 @@ export class BeanCommoditiesService {
1507
1568
  }
1508
1569
  }
1509
1570
 
1510
- export class RecurringRulesService {
1571
+ export class BeanPricesService {
1511
1572
  /**
1512
- * Create a new recurring rule
1513
- * Creates a new recurring transaction rule for the authenticated user
1573
+ * Create a new price
1574
+ * Creates a new price entry for the authenticated user
1514
1575
  * @param data The data for the request.
1515
1576
  * @param data.region Region code for tenant context
1516
1577
  * @param data.requestBody
1517
- * @returns RecurringRuleResponseDto Rule created successfully
1578
+ * @returns PriceResponseDto Price created successfully
1518
1579
  * @throws ApiError
1519
1580
  */
1520
- public static recurringRuleControllerCreate(
1521
- data: RecurringRuleControllerCreateData
1522
- ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1581
+ public static priceControllerCreate(
1582
+ data: PriceControllerCreateData
1583
+ ): CancelablePromise<PriceControllerCreateResponse> {
1523
1584
  return __request(OpenAPI, {
1524
1585
  method: 'POST',
1525
- url: '/api/v1/{region}/bean/recurring-rules',
1586
+ url: '/api/v1/{region}/bean/prices',
1526
1587
  path: {
1527
1588
  region: data.region
1528
1589
  },
1529
1590
  body: data.requestBody,
1530
1591
  mediaType: 'application/json',
1531
1592
  errors: {
1532
- 400: 'Invalid input data (e.g., autoCreate without accounts)',
1533
- 409: 'Rule with same name already exists'
1593
+ 404: 'Currency or quoteCurrency commodity not found',
1594
+ 409: 'Price already exists for this currency pair and date'
1534
1595
  }
1535
1596
  });
1536
1597
  }
1537
1598
 
1538
1599
  /**
1539
- * List recurring rules
1540
- * Returns all recurring rules for the authenticated user with optional filtering
1600
+ * List user prices
1601
+ * Returns all price entries for the authenticated user with optional filtering
1541
1602
  * @param data The data for the request.
1542
1603
  * @param data.region Region code for tenant context
1543
- * @param data.isActive Filter by active status
1544
- * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1545
- * @param data.hasAutoCreate Filter by autoCreate enabled
1546
- * @returns RecurringRuleResponseDto Rules retrieved successfully
1604
+ * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
1605
+ * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
1606
+ * @param data.dateFrom Filter prices from this date (ISO 8601 format)
1607
+ * @param data.dateTo Filter prices to this date (ISO 8601 format)
1608
+ * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
1609
+ * @param data.page Page number for pagination (default: 1)
1610
+ * @param data.limit Number of items per page (default: 20, max: 100)
1611
+ * @returns PriceListResponseDto Prices retrieved successfully
1547
1612
  * @throws ApiError
1548
1613
  */
1549
- public static recurringRuleControllerFindAll(
1550
- data: RecurringRuleControllerFindAllData
1551
- ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1614
+ public static priceControllerFindAll(
1615
+ data: PriceControllerFindAllData
1616
+ ): CancelablePromise<PriceControllerFindAllResponse> {
1552
1617
  return __request(OpenAPI, {
1553
1618
  method: 'GET',
1554
- url: '/api/v1/{region}/bean/recurring-rules',
1619
+ url: '/api/v1/{region}/bean/prices',
1555
1620
  path: {
1556
1621
  region: data.region
1557
1622
  },
1558
1623
  query: {
1559
- isActive: data.isActive,
1560
- frequency: data.frequency,
1561
- hasAutoCreate: data.hasAutoCreate
1624
+ currency: data.currency,
1625
+ quoteCurrency: data.quoteCurrency,
1626
+ dateFrom: data.dateFrom,
1627
+ dateTo: data.dateTo,
1628
+ search: data.search,
1629
+ page: data.page,
1630
+ limit: data.limit
1562
1631
  }
1563
1632
  });
1564
1633
  }
1565
1634
 
1566
1635
  /**
1567
- * Create recurring rule from transaction
1568
- * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1636
+ * Get price by ID
1637
+ * Returns a single price entry by its ID
1569
1638
  * @param data The data for the request.
1570
- * @param data.transactionId Source transaction ID
1639
+ * @param data.id Price ID
1571
1640
  * @param data.region Region code for tenant context
1572
- * @param data.requestBody
1573
- * @returns RecurringRuleResponseDto Rule created successfully
1641
+ * @returns PriceResponseDto Price retrieved successfully
1574
1642
  * @throws ApiError
1575
1643
  */
1576
- public static recurringRuleControllerCreateFromTransaction(
1577
- data: RecurringRuleControllerCreateFromTransactionData
1578
- ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1644
+ public static priceControllerFindOne(
1645
+ data: PriceControllerFindOneData
1646
+ ): CancelablePromise<PriceControllerFindOneResponse> {
1579
1647
  return __request(OpenAPI, {
1580
- method: 'POST',
1581
- url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1648
+ method: 'GET',
1649
+ url: '/api/v1/{region}/bean/prices/{id}',
1582
1650
  path: {
1583
- transactionId: data.transactionId,
1651
+ id: data.id,
1584
1652
  region: data.region
1585
1653
  },
1586
- body: data.requestBody,
1587
- mediaType: 'application/json',
1588
1654
  errors: {
1589
- 404: 'Transaction not found',
1590
- 409: 'Rule with same name already exists or transaction already linked'
1655
+ 404: 'Price not found'
1591
1656
  }
1592
1657
  });
1593
1658
  }
1594
1659
 
1595
1660
  /**
1596
- * Get recurring rule by ID
1597
- * Returns a specific recurring rule with its details
1661
+ * Update a price
1662
+ * Updates an existing price entry
1598
1663
  * @param data The data for the request.
1599
- * @param data.id Rule ID
1664
+ * @param data.id Price ID
1600
1665
  * @param data.region Region code for tenant context
1601
- * @returns RecurringRuleResponseDto Rule retrieved successfully
1666
+ * @param data.requestBody
1667
+ * @returns PriceResponseDto Price updated successfully
1602
1668
  * @throws ApiError
1603
1669
  */
1604
- public static recurringRuleControllerFindOne(
1605
- data: RecurringRuleControllerFindOneData
1606
- ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1670
+ public static priceControllerUpdate(
1671
+ data: PriceControllerUpdateData
1672
+ ): CancelablePromise<PriceControllerUpdateResponse> {
1607
1673
  return __request(OpenAPI, {
1608
- method: 'GET',
1609
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1674
+ method: 'PUT',
1675
+ url: '/api/v1/{region}/bean/prices/{id}',
1610
1676
  path: {
1611
1677
  id: data.id,
1612
1678
  region: data.region
1613
1679
  },
1680
+ body: data.requestBody,
1681
+ mediaType: 'application/json',
1614
1682
  errors: {
1615
- 404: 'Rule not found'
1683
+ 404: 'Price not found',
1684
+ 409: 'Updated price conflicts with existing price'
1616
1685
  }
1617
1686
  });
1618
1687
  }
1619
1688
 
1620
1689
  /**
1621
- * Update recurring rule
1622
- * Updates an existing recurring rule
1690
+ * Delete a price
1691
+ * Deletes a price entry (hard delete)
1623
1692
  * @param data The data for the request.
1624
- * @param data.id Rule ID
1693
+ * @param data.id Price ID
1625
1694
  * @param data.region Region code for tenant context
1626
- * @param data.requestBody
1627
- * @returns RecurringRuleResponseDto Rule updated successfully
1695
+ * @returns void Price deleted successfully
1628
1696
  * @throws ApiError
1629
1697
  */
1630
- public static recurringRuleControllerUpdate(
1631
- data: RecurringRuleControllerUpdateData
1632
- ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1698
+ public static priceControllerDelete(
1699
+ data: PriceControllerDeleteData
1700
+ ): CancelablePromise<PriceControllerDeleteResponse> {
1633
1701
  return __request(OpenAPI, {
1634
- method: 'PATCH',
1635
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1702
+ method: 'DELETE',
1703
+ url: '/api/v1/{region}/bean/prices/{id}',
1636
1704
  path: {
1637
1705
  id: data.id,
1638
1706
  region: data.region
1639
1707
  },
1640
- body: data.requestBody,
1641
- mediaType: 'application/json',
1642
1708
  errors: {
1643
- 400: 'Invalid input data',
1644
- 404: 'Rule not found'
1709
+ 404: 'Price not found'
1645
1710
  }
1646
1711
  });
1647
1712
  }
1648
1713
 
1649
1714
  /**
1650
- * Delete recurring rule
1651
- * Soft deletes a recurring rule (sets isActive to false)
1715
+ * Bulk create prices
1716
+ * Creates multiple price entries at once (skips duplicates)
1652
1717
  * @param data The data for the request.
1653
- * @param data.id Rule ID
1654
1718
  * @param data.region Region code for tenant context
1655
- * @returns void Rule deleted successfully
1719
+ * @param data.requestBody
1720
+ * @returns PriceResponseDto Prices created successfully
1656
1721
  * @throws ApiError
1657
1722
  */
1658
- public static recurringRuleControllerDelete(
1723
+ public static priceControllerBulkCreate(
1724
+ data: PriceControllerBulkCreateData
1725
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
1726
+ return __request(OpenAPI, {
1727
+ method: 'POST',
1728
+ url: '/api/v1/{region}/bean/prices/bulk',
1729
+ path: {
1730
+ region: data.region
1731
+ },
1732
+ body: data.requestBody,
1733
+ mediaType: 'application/json'
1734
+ });
1735
+ }
1736
+ }
1737
+
1738
+ export class RecurringRulesService {
1739
+ /**
1740
+ * Create a new recurring rule
1741
+ * Creates a new recurring transaction rule for the authenticated user
1742
+ * @param data The data for the request.
1743
+ * @param data.region Region code for tenant context
1744
+ * @param data.requestBody
1745
+ * @returns RecurringRuleResponseDto Rule created successfully
1746
+ * @throws ApiError
1747
+ */
1748
+ public static recurringRuleControllerCreate(
1749
+ data: RecurringRuleControllerCreateData
1750
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1751
+ return __request(OpenAPI, {
1752
+ method: 'POST',
1753
+ url: '/api/v1/{region}/bean/recurring-rules',
1754
+ path: {
1755
+ region: data.region
1756
+ },
1757
+ body: data.requestBody,
1758
+ mediaType: 'application/json',
1759
+ errors: {
1760
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
1761
+ 409: 'Rule with same name already exists'
1762
+ }
1763
+ });
1764
+ }
1765
+
1766
+ /**
1767
+ * List recurring rules
1768
+ * Returns all recurring rules for the authenticated user with optional filtering
1769
+ * @param data The data for the request.
1770
+ * @param data.region Region code for tenant context
1771
+ * @param data.isActive Filter by active status
1772
+ * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1773
+ * @param data.hasAutoCreate Filter by autoCreate enabled
1774
+ * @returns RecurringRuleResponseDto Rules retrieved successfully
1775
+ * @throws ApiError
1776
+ */
1777
+ public static recurringRuleControllerFindAll(
1778
+ data: RecurringRuleControllerFindAllData
1779
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1780
+ return __request(OpenAPI, {
1781
+ method: 'GET',
1782
+ url: '/api/v1/{region}/bean/recurring-rules',
1783
+ path: {
1784
+ region: data.region
1785
+ },
1786
+ query: {
1787
+ isActive: data.isActive,
1788
+ frequency: data.frequency,
1789
+ hasAutoCreate: data.hasAutoCreate
1790
+ }
1791
+ });
1792
+ }
1793
+
1794
+ /**
1795
+ * Create recurring rule from transaction
1796
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1797
+ * @param data The data for the request.
1798
+ * @param data.transactionId Source transaction ID
1799
+ * @param data.region Region code for tenant context
1800
+ * @param data.requestBody
1801
+ * @returns RecurringRuleResponseDto Rule created successfully
1802
+ * @throws ApiError
1803
+ */
1804
+ public static recurringRuleControllerCreateFromTransaction(
1805
+ data: RecurringRuleControllerCreateFromTransactionData
1806
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1807
+ return __request(OpenAPI, {
1808
+ method: 'POST',
1809
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1810
+ path: {
1811
+ transactionId: data.transactionId,
1812
+ region: data.region
1813
+ },
1814
+ body: data.requestBody,
1815
+ mediaType: 'application/json',
1816
+ errors: {
1817
+ 404: 'Transaction not found',
1818
+ 409: 'Rule with same name already exists or transaction already linked'
1819
+ }
1820
+ });
1821
+ }
1822
+
1823
+ /**
1824
+ * Get recurring rule by ID
1825
+ * Returns a specific recurring rule with its details
1826
+ * @param data The data for the request.
1827
+ * @param data.id Rule ID
1828
+ * @param data.region Region code for tenant context
1829
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
1830
+ * @throws ApiError
1831
+ */
1832
+ public static recurringRuleControllerFindOne(
1833
+ data: RecurringRuleControllerFindOneData
1834
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1835
+ return __request(OpenAPI, {
1836
+ method: 'GET',
1837
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1838
+ path: {
1839
+ id: data.id,
1840
+ region: data.region
1841
+ },
1842
+ errors: {
1843
+ 404: 'Rule not found'
1844
+ }
1845
+ });
1846
+ }
1847
+
1848
+ /**
1849
+ * Update recurring rule
1850
+ * Updates an existing recurring rule
1851
+ * @param data The data for the request.
1852
+ * @param data.id Rule ID
1853
+ * @param data.region Region code for tenant context
1854
+ * @param data.requestBody
1855
+ * @returns RecurringRuleResponseDto Rule updated successfully
1856
+ * @throws ApiError
1857
+ */
1858
+ public static recurringRuleControllerUpdate(
1859
+ data: RecurringRuleControllerUpdateData
1860
+ ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1861
+ return __request(OpenAPI, {
1862
+ method: 'PATCH',
1863
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1864
+ path: {
1865
+ id: data.id,
1866
+ region: data.region
1867
+ },
1868
+ body: data.requestBody,
1869
+ mediaType: 'application/json',
1870
+ errors: {
1871
+ 400: 'Invalid input data',
1872
+ 404: 'Rule not found'
1873
+ }
1874
+ });
1875
+ }
1876
+
1877
+ /**
1878
+ * Delete recurring rule
1879
+ * Soft deletes a recurring rule (sets isActive to false)
1880
+ * @param data The data for the request.
1881
+ * @param data.id Rule ID
1882
+ * @param data.region Region code for tenant context
1883
+ * @returns void Rule deleted successfully
1884
+ * @throws ApiError
1885
+ */
1886
+ public static recurringRuleControllerDelete(
1659
1887
  data: RecurringRuleControllerDeleteData
1660
1888
  ): CancelablePromise<RecurringRuleControllerDeleteResponse> {
1661
1889
  return __request(OpenAPI, {
@@ -1937,279 +2165,158 @@ export class RecurringForecastService {
1937
2165
  }
1938
2166
  }
1939
2167
 
1940
- export class BeanTransactionRulesService {
2168
+ export class ReportingService {
1941
2169
  /**
1942
- * Create a new transaction rule (or upsert if upsertByPayee=true)
1943
- * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2170
+ * Get portfolio value trends
2171
+ *
2172
+ * Returns time series data of portfolio net worth.
2173
+ *
2174
+ * **Multi-currency Support:**
2175
+ * - `series[].byCurrency` - Currency breakdown for each data point
2176
+ * - `byCurrency` - Separate time series grouped by currency
2177
+ * - `warnings` - Exchange rate warnings if conversion failed
2178
+ *
2179
+ * **Parameters:**
2180
+ * - `period`: Time period (1m, 3m, 6m, 1y)
2181
+ * - `granularity`: Data granularity (day, week, month)
2182
+ *
1944
2183
  * @param data The data for the request.
1945
2184
  * @param data.region Region code for tenant context
1946
- * @param data.requestBody
1947
- * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2185
+ * @param data.period Time period
2186
+ * @param data.granularity Data granularity
2187
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
1948
2188
  * @throws ApiError
1949
2189
  */
1950
- public static transactionRuleControllerCreate(
1951
- data: TransactionRuleControllerCreateData
1952
- ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2190
+ public static reportingControllerGetPortfolioTrends(
2191
+ data: ReportingControllerGetPortfolioTrendsData
2192
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
1953
2193
  return __request(OpenAPI, {
1954
- method: 'POST',
1955
- url: '/api/v1/{region}/bean/transaction-rules',
2194
+ method: 'GET',
2195
+ url: '/api/v1/{region}/reporting/portfolio/trends',
1956
2196
  path: {
1957
2197
  region: data.region
1958
2198
  },
1959
- body: data.requestBody,
1960
- mediaType: 'application/json',
2199
+ query: {
2200
+ period: data.period,
2201
+ granularity: data.granularity
2202
+ },
1961
2203
  errors: {
1962
- 400: 'Validation failed',
1963
- 401: 'Unauthorized',
1964
- 409: 'Resource conflict - another process is updating this rule'
2204
+ 401: 'User not authenticated'
1965
2205
  }
1966
2206
  });
1967
2207
  }
1968
2208
 
1969
2209
  /**
1970
- * Get all transaction rules for user
2210
+ * Get cash-flow trends
2211
+ *
2212
+ * Monthly income / expense / netSavings over a fixed N-month window
2213
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
2214
+ *
2215
+ * **Parameters:**
2216
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
2217
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
2218
+ *
1971
2219
  * @param data The data for the request.
1972
2220
  * @param data.region Region code for tenant context
1973
- * @param data.limit Max results per page (default: 20, max: 100)
1974
- * @param data.offset Pagination offset (default: 0)
1975
- * @param data.enabled Filter by enabled status
1976
- * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
1977
- * @param data.autoApplyEnabled Filter by auto-apply status
1978
- * @returns TransactionRuleListResponseDto List of rules
2221
+ * @param data.period Time period
2222
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
2223
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
1979
2224
  * @throws ApiError
1980
2225
  */
1981
- public static transactionRuleControllerList(
1982
- data: TransactionRuleControllerListData
1983
- ): CancelablePromise<TransactionRuleControllerListResponse> {
2226
+ public static reportingControllerGetCashFlowTrends(
2227
+ data: ReportingControllerGetCashFlowTrendsData
2228
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
1984
2229
  return __request(OpenAPI, {
1985
2230
  method: 'GET',
1986
- url: '/api/v1/{region}/bean/transaction-rules',
2231
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
1987
2232
  path: {
1988
2233
  region: data.region
1989
2234
  },
1990
2235
  query: {
1991
- limit: data.limit,
1992
- offset: data.offset,
1993
- enabled: data.enabled,
1994
- learningSource: data.learningSource,
1995
- autoApplyEnabled: data.autoApplyEnabled
2236
+ period: data.period,
2237
+ granularity: data.granularity
1996
2238
  },
1997
2239
  errors: {
1998
- 401: 'Unauthorized'
2240
+ 401: 'User not authenticated'
1999
2241
  }
2000
2242
  });
2001
2243
  }
2002
2244
 
2003
2245
  /**
2004
- * Validate transaction rule configuration
2246
+ * Generate portfolio snapshot
2247
+ *
2248
+ * Manually generate a portfolio snapshot for a specific date.
2249
+ *
2250
+ * **Multi-currency Support:**
2251
+ * - Fetches balances grouped by currency
2252
+ * - Uses user's baseCurrency setting for conversion
2253
+ * - Stores exchange rates and warnings
2254
+ *
2255
+ * **Use Cases:**
2256
+ * - Testing snapshot generation
2257
+ * - Force regeneration after data correction
2258
+ * - Initial setup for new users
2259
+ *
2005
2260
  * @param data The data for the request.
2006
2261
  * @param data.region Region code for tenant context
2007
- * @param data.requestBody
2008
- * @returns ValidateRuleResponseDto Validation result
2262
+ * @param data.requestBody Optional date (defaults to today)
2263
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
2009
2264
  * @throws ApiError
2010
2265
  */
2011
- public static transactionRuleControllerValidate(
2012
- data: TransactionRuleControllerValidateData
2013
- ): CancelablePromise<TransactionRuleControllerValidateResponse> {
2266
+ public static reportingControllerGenerateSnapshot(
2267
+ data: ReportingControllerGenerateSnapshotData
2268
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
2014
2269
  return __request(OpenAPI, {
2015
2270
  method: 'POST',
2016
- url: '/api/v1/{region}/bean/transaction-rules/validate',
2017
- path: {
2018
- region: data.region
2019
- },
2020
- body: data.requestBody,
2021
- mediaType: 'application/json',
2022
- errors: {
2023
- 400: 'Validation failed',
2024
- 401: 'Unauthorized'
2025
- }
2026
- });
2027
- }
2028
-
2029
- /**
2030
- * Bulk create transaction rules
2031
- * @param data The data for the request.
2032
- * @param data.region Region code for tenant context
2033
- * @param data.requestBody
2034
- * @returns BulkCreateRulesResponseDto Bulk create completed
2035
- * @throws ApiError
2036
- */
2037
- public static transactionRuleControllerBulkCreate(
2038
- data: TransactionRuleControllerBulkCreateData
2039
- ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2040
- return __request(OpenAPI, {
2041
- method: 'POST',
2042
- url: '/api/v1/{region}/bean/transaction-rules/bulk',
2043
- path: {
2044
- region: data.region
2045
- },
2046
- body: data.requestBody,
2047
- mediaType: 'application/json',
2048
- errors: {
2049
- 400: 'Invalid bulk create data',
2050
- 401: 'Unauthorized'
2051
- }
2052
- });
2053
- }
2054
-
2055
- /**
2056
- * Export transaction rules
2057
- * @param data The data for the request.
2058
- * @param data.format Export format (currently only JSON supported)
2059
- * @param data.region Region code for tenant context
2060
- * @returns ExportRulesResponseDto Exported rules
2061
- * @throws ApiError
2062
- */
2063
- public static transactionRuleControllerExport(
2064
- data: TransactionRuleControllerExportData
2065
- ): CancelablePromise<TransactionRuleControllerExportResponse> {
2066
- return __request(OpenAPI, {
2067
- method: 'GET',
2068
- url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2069
- path: {
2070
- format: data.format,
2071
- region: data.region
2072
- },
2073
- errors: {
2074
- 400: 'Unsupported format',
2075
- 401: 'Unauthorized'
2076
- }
2077
- });
2078
- }
2079
-
2080
- /**
2081
- * Get transaction rule statistics
2082
- * @param data The data for the request.
2083
- * @param data.period Statistics time period
2084
- * @param data.region Region code for tenant context
2085
- * @returns RuleStatisticsResponseDto Rule statistics
2086
- * @throws ApiError
2087
- */
2088
- public static transactionRuleControllerGetStatistics(
2089
- data: TransactionRuleControllerGetStatisticsData
2090
- ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2091
- return __request(OpenAPI, {
2092
- method: 'GET',
2093
- url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2094
- path: {
2095
- period: data.period,
2096
- region: data.region
2097
- },
2098
- errors: {
2099
- 401: 'Unauthorized'
2100
- }
2101
- });
2102
- }
2103
-
2104
- /**
2105
- * Get transaction rule detail
2106
- * @param data The data for the request.
2107
- * @param data.ruleId Rule ID
2108
- * @param data.region Region code for tenant context
2109
- * @returns TransactionRuleResponseDto Rule details
2110
- * @throws ApiError
2111
- */
2112
- public static transactionRuleControllerGetDetail(
2113
- data: TransactionRuleControllerGetDetailData
2114
- ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2115
- return __request(OpenAPI, {
2116
- method: 'GET',
2117
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2118
- path: {
2119
- ruleId: data.ruleId,
2120
- region: data.region
2121
- },
2122
- errors: {
2123
- 401: 'Unauthorized',
2124
- 403: 'Forbidden - not owner of rule',
2125
- 404: 'Rule not found'
2126
- }
2127
- });
2128
- }
2129
-
2130
- /**
2131
- * Update a transaction rule
2132
- * @param data The data for the request.
2133
- * @param data.ruleId Rule ID to update
2134
- * @param data.region Region code for tenant context
2135
- * @param data.requestBody
2136
- * @returns TransactionRuleResponseDto Rule updated successfully
2137
- * @throws ApiError
2138
- */
2139
- public static transactionRuleControllerUpdate(
2140
- data: TransactionRuleControllerUpdateData
2141
- ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2142
- return __request(OpenAPI, {
2143
- method: 'PUT',
2144
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2271
+ url: '/api/v1/{region}/reporting/snapshots/generate',
2145
2272
  path: {
2146
- ruleId: data.ruleId,
2147
2273
  region: data.region
2148
2274
  },
2149
2275
  body: data.requestBody,
2150
2276
  mediaType: 'application/json',
2151
2277
  errors: {
2152
- 400: 'Validation failed',
2153
- 401: 'Unauthorized',
2154
- 403: 'Forbidden - not owner of rule',
2155
- 404: 'Rule not found',
2156
- 409: 'Resource conflict - rule is being modified by another process'
2157
- }
2158
- });
2159
- }
2160
-
2161
- /**
2162
- * Delete a transaction rule
2163
- * @param data The data for the request.
2164
- * @param data.ruleId Rule ID to delete
2165
- * @param data.region Region code for tenant context
2166
- * @returns void Rule deleted successfully
2167
- * @throws ApiError
2168
- */
2169
- public static transactionRuleControllerDelete(
2170
- data: TransactionRuleControllerDeleteData
2171
- ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2172
- return __request(OpenAPI, {
2173
- method: 'DELETE',
2174
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2175
- path: {
2176
- ruleId: data.ruleId,
2177
- region: data.region
2178
- },
2179
- errors: {
2180
- 401: 'Unauthorized',
2181
- 403: 'Forbidden - not owner of rule',
2182
- 404: 'Rule not found',
2183
- 409: 'Resource conflict - rule is being modified by another process'
2278
+ 400: 'Invalid date format',
2279
+ 401: 'User not authenticated'
2184
2280
  }
2185
2281
  });
2186
2282
  }
2187
2283
 
2188
2284
  /**
2189
- * Test rule matching
2285
+ * Backfill portfolio snapshots
2286
+ *
2287
+ * Generate snapshots for a date range (historical data backfill).
2288
+ *
2289
+ * **Multi-currency Support:**
2290
+ * - Each snapshot includes multi-currency data
2291
+ * - Uses exchange rates available at generation time
2292
+ * - Warnings stored for missing exchange rates
2293
+ *
2294
+ * **Best Practices:**
2295
+ * - Use for initial setup after account configuration
2296
+ * - Run during low-traffic periods for large date ranges
2297
+ * - Existing snapshots are skipped (not regenerated)
2298
+ *
2190
2299
  * @param data The data for the request.
2191
- * @param data.ruleId Rule ID to test
2192
2300
  * @param data.region Region code for tenant context
2193
2301
  * @param data.requestBody
2194
- * @returns TestRuleResponseDto Test result
2302
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
2195
2303
  * @throws ApiError
2196
2304
  */
2197
- public static transactionRuleControllerTest(
2198
- data: TransactionRuleControllerTestData
2199
- ): CancelablePromise<TransactionRuleControllerTestResponse> {
2305
+ public static reportingControllerBackfillSnapshots(
2306
+ data: ReportingControllerBackfillSnapshotsData
2307
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
2200
2308
  return __request(OpenAPI, {
2201
2309
  method: 'POST',
2202
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2310
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
2203
2311
  path: {
2204
- ruleId: data.ruleId,
2205
2312
  region: data.region
2206
2313
  },
2207
2314
  body: data.requestBody,
2208
2315
  mediaType: 'application/json',
2209
2316
  errors: {
2210
- 401: 'Unauthorized',
2211
- 403: 'Forbidden - not owner of rule',
2212
- 404: 'Rule not found'
2317
+ 400: 'Invalid date format or range',
2318
+ 401: 'User not authenticated',
2319
+ 409: 'Backfill already in progress for this user'
2213
2320
  }
2214
2321
  });
2215
2322
  }
@@ -2261,7 +2368,7 @@ export class UsersService {
2261
2368
  * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2262
2369
  * @param data The data for the request.
2263
2370
  * @param data.requestBody
2264
- * @returns unknown User created successfully
2371
+ * @returns SignupResponseDto User created successfully
2265
2372
  * @throws ApiError
2266
2373
  */
2267
2374
  public static userControllerSignupUser(
@@ -2470,67 +2577,345 @@ export class PropertiesService {
2470
2577
  }
2471
2578
  }
2472
2579
 
2473
- export class LifeEventsService {
2580
+ export class BeanTransactionRulesService {
2474
2581
  /**
2475
- * Create a new life event
2476
- * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2582
+ * Create a new transaction rule (or upsert if upsertByPayee=true)
2583
+ * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2477
2584
  * @param data The data for the request.
2478
- * @param data.region Region code for tenant context (decorative for life events)
2585
+ * @param data.region Region code for tenant context
2479
2586
  * @param data.requestBody
2480
- * @returns EventResponseDto Life event created successfully
2587
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2481
2588
  * @throws ApiError
2482
2589
  */
2483
- public static eventControllerCreate(
2484
- data: EventControllerCreateData
2485
- ): CancelablePromise<EventControllerCreateResponse> {
2590
+ public static transactionRuleControllerCreate(
2591
+ data: TransactionRuleControllerCreateData
2592
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2486
2593
  return __request(OpenAPI, {
2487
2594
  method: 'POST',
2488
- url: '/api/v1/{region}/bean/events',
2595
+ url: '/api/v1/{region}/bean/transaction-rules',
2489
2596
  path: {
2490
2597
  region: data.region
2491
2598
  },
2492
2599
  body: data.requestBody,
2493
2600
  mediaType: 'application/json',
2494
2601
  errors: {
2495
- 409: 'Life event already exists for this (userId, type, date) combination'
2602
+ 400: 'Validation failed',
2603
+ 401: 'Unauthorized',
2604
+ 409: 'Resource conflict - another process is updating this rule'
2496
2605
  }
2497
2606
  });
2498
2607
  }
2499
2608
 
2500
2609
  /**
2501
- * List user life events
2502
- * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2610
+ * Get all transaction rules for user
2503
2611
  * @param data The data for the request.
2504
- * @param data.region Region code for tenant context (decorative for life events)
2505
- * @param data.type Filter by life event type (exact match)
2506
- * @param data.q Search term for description (case-insensitive partial match)
2507
- * @param data.from Filter life events from this date (ISO 8601 format)
2508
- * @param data.to Filter life events to this date (ISO 8601 format)
2509
- * @param data.page Page number for pagination (default: 1)
2510
- * @param data.limit Number of items per page (default: 20, max: 100)
2511
- * @returns EventListResponseDto Life events retrieved successfully
2612
+ * @param data.region Region code for tenant context
2613
+ * @param data.limit Max results per page (default: 20, max: 100)
2614
+ * @param data.offset Pagination offset (default: 0)
2615
+ * @param data.enabled Filter by enabled status
2616
+ * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
2617
+ * @param data.autoApplyEnabled Filter by auto-apply status
2618
+ * @returns TransactionRuleListResponseDto List of rules
2512
2619
  * @throws ApiError
2513
2620
  */
2514
- public static eventControllerFindAll(
2515
- data: EventControllerFindAllData
2516
- ): CancelablePromise<EventControllerFindAllResponse> {
2621
+ public static transactionRuleControllerList(
2622
+ data: TransactionRuleControllerListData
2623
+ ): CancelablePromise<TransactionRuleControllerListResponse> {
2517
2624
  return __request(OpenAPI, {
2518
2625
  method: 'GET',
2519
- url: '/api/v1/{region}/bean/events',
2626
+ url: '/api/v1/{region}/bean/transaction-rules',
2520
2627
  path: {
2521
2628
  region: data.region
2522
2629
  },
2523
2630
  query: {
2524
- type: data.type,
2525
- q: data.q,
2526
- from: data.from,
2527
- to: data.to,
2528
- page: data.page,
2529
- limit: data.limit
2530
- }
2531
- });
2532
- }
2533
-
2631
+ limit: data.limit,
2632
+ offset: data.offset,
2633
+ enabled: data.enabled,
2634
+ learningSource: data.learningSource,
2635
+ autoApplyEnabled: data.autoApplyEnabled
2636
+ },
2637
+ errors: {
2638
+ 401: 'Unauthorized'
2639
+ }
2640
+ });
2641
+ }
2642
+
2643
+ /**
2644
+ * Validate transaction rule configuration
2645
+ * @param data The data for the request.
2646
+ * @param data.region Region code for tenant context
2647
+ * @param data.requestBody
2648
+ * @returns ValidateRuleResponseDto Validation result
2649
+ * @throws ApiError
2650
+ */
2651
+ public static transactionRuleControllerValidate(
2652
+ data: TransactionRuleControllerValidateData
2653
+ ): CancelablePromise<TransactionRuleControllerValidateResponse> {
2654
+ return __request(OpenAPI, {
2655
+ method: 'POST',
2656
+ url: '/api/v1/{region}/bean/transaction-rules/validate',
2657
+ path: {
2658
+ region: data.region
2659
+ },
2660
+ body: data.requestBody,
2661
+ mediaType: 'application/json',
2662
+ errors: {
2663
+ 400: 'Validation failed',
2664
+ 401: 'Unauthorized'
2665
+ }
2666
+ });
2667
+ }
2668
+
2669
+ /**
2670
+ * Bulk create transaction rules
2671
+ * @param data The data for the request.
2672
+ * @param data.region Region code for tenant context
2673
+ * @param data.requestBody
2674
+ * @returns BulkCreateRulesResponseDto Bulk create completed
2675
+ * @throws ApiError
2676
+ */
2677
+ public static transactionRuleControllerBulkCreate(
2678
+ data: TransactionRuleControllerBulkCreateData
2679
+ ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2680
+ return __request(OpenAPI, {
2681
+ method: 'POST',
2682
+ url: '/api/v1/{region}/bean/transaction-rules/bulk',
2683
+ path: {
2684
+ region: data.region
2685
+ },
2686
+ body: data.requestBody,
2687
+ mediaType: 'application/json',
2688
+ errors: {
2689
+ 400: 'Invalid bulk create data',
2690
+ 401: 'Unauthorized'
2691
+ }
2692
+ });
2693
+ }
2694
+
2695
+ /**
2696
+ * Export transaction rules
2697
+ * @param data The data for the request.
2698
+ * @param data.format Export format (currently only JSON supported)
2699
+ * @param data.region Region code for tenant context
2700
+ * @returns ExportRulesResponseDto Exported rules
2701
+ * @throws ApiError
2702
+ */
2703
+ public static transactionRuleControllerExport(
2704
+ data: TransactionRuleControllerExportData
2705
+ ): CancelablePromise<TransactionRuleControllerExportResponse> {
2706
+ return __request(OpenAPI, {
2707
+ method: 'GET',
2708
+ url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2709
+ path: {
2710
+ format: data.format,
2711
+ region: data.region
2712
+ },
2713
+ errors: {
2714
+ 400: 'Unsupported format',
2715
+ 401: 'Unauthorized'
2716
+ }
2717
+ });
2718
+ }
2719
+
2720
+ /**
2721
+ * Get transaction rule statistics
2722
+ * @param data The data for the request.
2723
+ * @param data.period Statistics time period
2724
+ * @param data.region Region code for tenant context
2725
+ * @returns RuleStatisticsResponseDto Rule statistics
2726
+ * @throws ApiError
2727
+ */
2728
+ public static transactionRuleControllerGetStatistics(
2729
+ data: TransactionRuleControllerGetStatisticsData
2730
+ ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2731
+ return __request(OpenAPI, {
2732
+ method: 'GET',
2733
+ url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2734
+ path: {
2735
+ period: data.period,
2736
+ region: data.region
2737
+ },
2738
+ errors: {
2739
+ 401: 'Unauthorized'
2740
+ }
2741
+ });
2742
+ }
2743
+
2744
+ /**
2745
+ * Get transaction rule detail
2746
+ * @param data The data for the request.
2747
+ * @param data.ruleId Rule ID
2748
+ * @param data.region Region code for tenant context
2749
+ * @returns TransactionRuleResponseDto Rule details
2750
+ * @throws ApiError
2751
+ */
2752
+ public static transactionRuleControllerGetDetail(
2753
+ data: TransactionRuleControllerGetDetailData
2754
+ ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2755
+ return __request(OpenAPI, {
2756
+ method: 'GET',
2757
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2758
+ path: {
2759
+ ruleId: data.ruleId,
2760
+ region: data.region
2761
+ },
2762
+ errors: {
2763
+ 401: 'Unauthorized',
2764
+ 403: 'Forbidden - not owner of rule',
2765
+ 404: 'Rule not found'
2766
+ }
2767
+ });
2768
+ }
2769
+
2770
+ /**
2771
+ * Update a transaction rule
2772
+ * @param data The data for the request.
2773
+ * @param data.ruleId Rule ID to update
2774
+ * @param data.region Region code for tenant context
2775
+ * @param data.requestBody
2776
+ * @returns TransactionRuleResponseDto Rule updated successfully
2777
+ * @throws ApiError
2778
+ */
2779
+ public static transactionRuleControllerUpdate(
2780
+ data: TransactionRuleControllerUpdateData
2781
+ ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2782
+ return __request(OpenAPI, {
2783
+ method: 'PUT',
2784
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2785
+ path: {
2786
+ ruleId: data.ruleId,
2787
+ region: data.region
2788
+ },
2789
+ body: data.requestBody,
2790
+ mediaType: 'application/json',
2791
+ errors: {
2792
+ 400: 'Validation failed',
2793
+ 401: 'Unauthorized',
2794
+ 403: 'Forbidden - not owner of rule',
2795
+ 404: 'Rule not found',
2796
+ 409: 'Resource conflict - rule is being modified by another process'
2797
+ }
2798
+ });
2799
+ }
2800
+
2801
+ /**
2802
+ * Delete a transaction rule
2803
+ * @param data The data for the request.
2804
+ * @param data.ruleId Rule ID to delete
2805
+ * @param data.region Region code for tenant context
2806
+ * @returns void Rule deleted successfully
2807
+ * @throws ApiError
2808
+ */
2809
+ public static transactionRuleControllerDelete(
2810
+ data: TransactionRuleControllerDeleteData
2811
+ ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2812
+ return __request(OpenAPI, {
2813
+ method: 'DELETE',
2814
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2815
+ path: {
2816
+ ruleId: data.ruleId,
2817
+ region: data.region
2818
+ },
2819
+ errors: {
2820
+ 401: 'Unauthorized',
2821
+ 403: 'Forbidden - not owner of rule',
2822
+ 404: 'Rule not found',
2823
+ 409: 'Resource conflict - rule is being modified by another process'
2824
+ }
2825
+ });
2826
+ }
2827
+
2828
+ /**
2829
+ * Test rule matching
2830
+ * @param data The data for the request.
2831
+ * @param data.ruleId Rule ID to test
2832
+ * @param data.region Region code for tenant context
2833
+ * @param data.requestBody
2834
+ * @returns TestRuleResponseDto Test result
2835
+ * @throws ApiError
2836
+ */
2837
+ public static transactionRuleControllerTest(
2838
+ data: TransactionRuleControllerTestData
2839
+ ): CancelablePromise<TransactionRuleControllerTestResponse> {
2840
+ return __request(OpenAPI, {
2841
+ method: 'POST',
2842
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2843
+ path: {
2844
+ ruleId: data.ruleId,
2845
+ region: data.region
2846
+ },
2847
+ body: data.requestBody,
2848
+ mediaType: 'application/json',
2849
+ errors: {
2850
+ 401: 'Unauthorized',
2851
+ 403: 'Forbidden - not owner of rule',
2852
+ 404: 'Rule not found'
2853
+ }
2854
+ });
2855
+ }
2856
+ }
2857
+
2858
+ export class LifeEventsService {
2859
+ /**
2860
+ * Create a new life event
2861
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2862
+ * @param data The data for the request.
2863
+ * @param data.region Region code for tenant context (decorative for life events)
2864
+ * @param data.requestBody
2865
+ * @returns EventResponseDto Life event created successfully
2866
+ * @throws ApiError
2867
+ */
2868
+ public static eventControllerCreate(
2869
+ data: EventControllerCreateData
2870
+ ): CancelablePromise<EventControllerCreateResponse> {
2871
+ return __request(OpenAPI, {
2872
+ method: 'POST',
2873
+ url: '/api/v1/{region}/bean/events',
2874
+ path: {
2875
+ region: data.region
2876
+ },
2877
+ body: data.requestBody,
2878
+ mediaType: 'application/json',
2879
+ errors: {
2880
+ 409: 'Life event already exists for this (userId, type, date) combination'
2881
+ }
2882
+ });
2883
+ }
2884
+
2885
+ /**
2886
+ * List user life events
2887
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2888
+ * @param data The data for the request.
2889
+ * @param data.region Region code for tenant context (decorative for life events)
2890
+ * @param data.type Filter by life event type (exact match)
2891
+ * @param data.q Search term for description (case-insensitive partial match)
2892
+ * @param data.from Filter life events from this date (ISO 8601 format)
2893
+ * @param data.to Filter life events to this date (ISO 8601 format)
2894
+ * @param data.page Page number for pagination (default: 1)
2895
+ * @param data.limit Number of items per page (default: 20, max: 100)
2896
+ * @returns EventListResponseDto Life events retrieved successfully
2897
+ * @throws ApiError
2898
+ */
2899
+ public static eventControllerFindAll(
2900
+ data: EventControllerFindAllData
2901
+ ): CancelablePromise<EventControllerFindAllResponse> {
2902
+ return __request(OpenAPI, {
2903
+ method: 'GET',
2904
+ url: '/api/v1/{region}/bean/events',
2905
+ path: {
2906
+ region: data.region
2907
+ },
2908
+ query: {
2909
+ type: data.type,
2910
+ q: data.q,
2911
+ from: data.from,
2912
+ to: data.to,
2913
+ page: data.page,
2914
+ limit: data.limit
2915
+ }
2916
+ });
2917
+ }
2918
+
2534
2919
  /**
2535
2920
  * Get life event by ID
2536
2921
  * Returns a single life event by its ID. Returns ETag header.
@@ -2611,6 +2996,171 @@ export class LifeEventsService {
2611
2996
  }
2612
2997
  });
2613
2998
  }
2999
+
3000
+ /**
3001
+ * Slice time-series by a life event (Phase 79)
3002
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
3003
+ * @param data The data for the request.
3004
+ * @param data.id Life event ID
3005
+ * @param data.accountPattern
3006
+ * @param data.granularity
3007
+ * @param data.region Region code for tenant context (decorative for life events)
3008
+ * @returns unknown Time-series sliced by the life event range
3009
+ * @throws ApiError
3010
+ */
3011
+ public static eventControllerGetSlice(
3012
+ data: EventControllerGetSliceData
3013
+ ): CancelablePromise<EventControllerGetSliceResponse> {
3014
+ return __request(OpenAPI, {
3015
+ method: 'GET',
3016
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3017
+ path: {
3018
+ id: data.id,
3019
+ region: data.region
3020
+ },
3021
+ query: {
3022
+ accountPattern: data.accountPattern,
3023
+ granularity: data.granularity
3024
+ },
3025
+ errors: {
3026
+ 400: 'accountPattern query param is empty',
3027
+ 404: 'Life event not found'
3028
+ }
3029
+ });
3030
+ }
3031
+ }
3032
+
3033
+ export class OnboardingService {
3034
+ /**
3035
+ * Bootstrap core accounts + register asset accounts with opening balances (ADR-0113)
3036
+ * @param data The data for the request.
3037
+ * @param data.region Region code for tenant context
3038
+ * @param data.requestBody
3039
+ * @returns unknown Onboarding bootstrap result.
3040
+ * @throws ApiError
3041
+ */
3042
+ public static onboardingControllerBootstrap(
3043
+ data: OnboardingControllerBootstrapData
3044
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
3045
+ return __request(OpenAPI, {
3046
+ method: 'POST',
3047
+ url: '/api/v1/{region}/bean/onboarding',
3048
+ path: {
3049
+ region: data.region
3050
+ },
3051
+ body: data.requestBody,
3052
+ mediaType: 'application/json',
3053
+ errors: {
3054
+ 422: 'Invalid region/account path/duplicate paths.'
3055
+ }
3056
+ });
3057
+ }
3058
+ }
3059
+
3060
+ export class BalanceReconciliationService {
3061
+ /**
3062
+ * Preview reconciliation (book vs actual)
3063
+ * Computes book balance, diff, Beancount-inferred tolerance, and suggested action without persisting.
3064
+ * @param data The data for the request.
3065
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3066
+ * @param data.requestBody
3067
+ * @returns ReconciliationComputeResultDto Reconciliation preview
3068
+ * @throws ApiError
3069
+ */
3070
+ public static reconciliationControllerCompute(
3071
+ data: ReconciliationControllerComputeData
3072
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
3073
+ return __request(OpenAPI, {
3074
+ method: 'POST',
3075
+ url: '/api/v1/{region}/bean/reconciliations',
3076
+ path: {
3077
+ region: data.region
3078
+ },
3079
+ body: data.requestBody,
3080
+ mediaType: 'application/json',
3081
+ errors: {
3082
+ 404: 'Account not found'
3083
+ }
3084
+ });
3085
+ }
3086
+
3087
+ /**
3088
+ * Record a balance assertion
3089
+ * Persists the reconciliation as a BeanBalance assertion (amount = actual, diffAmount = book − actual). Re-reconciling the same day/currency upserts.
3090
+ * @param data The data for the request.
3091
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3092
+ * @param data.requestBody
3093
+ * @returns ReconciliationRecordDto Balance assertion recorded
3094
+ * @throws ApiError
3095
+ */
3096
+ public static reconciliationControllerAssert(
3097
+ data: ReconciliationControllerAssertData
3098
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
3099
+ return __request(OpenAPI, {
3100
+ method: 'POST',
3101
+ url: '/api/v1/{region}/bean/reconciliations/assert',
3102
+ path: {
3103
+ region: data.region
3104
+ },
3105
+ body: data.requestBody,
3106
+ mediaType: 'application/json',
3107
+ errors: {
3108
+ 404: 'Account not found'
3109
+ }
3110
+ });
3111
+ }
3112
+
3113
+ /**
3114
+ * Generate a pad adjusting entry
3115
+ * 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.
3116
+ * @param data The data for the request.
3117
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3118
+ * @param data.requestBody
3119
+ * @returns PadResultDto Pad adjusting entry generated
3120
+ * @throws ApiError
3121
+ */
3122
+ public static reconciliationControllerPad(
3123
+ data: ReconciliationControllerPadData
3124
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
3125
+ return __request(OpenAPI, {
3126
+ method: 'POST',
3127
+ url: '/api/v1/{region}/bean/reconciliations/pad',
3128
+ path: {
3129
+ region: data.region
3130
+ },
3131
+ body: data.requestBody,
3132
+ mediaType: 'application/json',
3133
+ errors: {
3134
+ 400: 'Book already within tolerance — no pad needed',
3135
+ 404: 'Account not found'
3136
+ }
3137
+ });
3138
+ }
3139
+
3140
+ /**
3141
+ * List reconciliation history for an account
3142
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
3143
+ * @param data The data for the request.
3144
+ * @param data.accountId BeanAccount id
3145
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3146
+ * @returns ReconciliationRecordDto Reconciliation history
3147
+ * @throws ApiError
3148
+ */
3149
+ public static reconciliationControllerHistory(
3150
+ data: ReconciliationControllerHistoryData
3151
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
3152
+ return __request(OpenAPI, {
3153
+ method: 'GET',
3154
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
3155
+ path: {
3156
+ accountId: data.accountId,
3157
+ region: data.region
3158
+ },
3159
+ errors: {
3160
+ 404: 'Account not found'
3161
+ }
3162
+ });
3163
+ }
2614
3164
  }
2615
3165
 
2616
3166
  export class BeanExportService {
@@ -2760,147 +3310,32 @@ export class BeanImportService {
2760
3310
  mediaType: 'application/json',
2761
3311
  errors: {
2762
3312
  400: 'Invalid input - Validation failed',
2763
- 404: 'Configuration not found'
2764
- }
2765
- });
2766
- }
2767
-
2768
- /**
2769
- * Reset configuration to default
2770
- * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
2771
- * @param data The data for the request.
2772
- * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
2773
- * @param data.region Region code for tenant context
2774
- * @returns ImporterConfigDto Configuration reset successfully
2775
- * @throws ApiError
2776
- */
2777
- public static importerConfigControllerResetConfig(
2778
- data: ImporterConfigControllerResetConfigData
2779
- ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
2780
- return __request(OpenAPI, {
2781
- method: 'POST',
2782
- url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
2783
- path: {
2784
- importerId: data.importerId,
2785
- region: data.region
2786
- },
2787
- errors: {
2788
- 400: 'Invalid input - Unsupported importer'
2789
- }
2790
- });
2791
- }
2792
- }
2793
-
2794
- export class BeanPlatformsService {
2795
- /**
2796
- * Get all platforms with statistics
2797
- * @returns unknown List of platforms with binding and account counts
2798
- * @throws ApiError
2799
- */
2800
- public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2801
- return __request(OpenAPI, {
2802
- method: 'GET',
2803
- url: '/api/v1/bean/platforms'
2804
- });
2805
- }
2806
-
2807
- /**
2808
- * Create a new platform
2809
- * @param data The data for the request.
2810
- * @param data.requestBody
2811
- * @returns unknown Platform created successfully
2812
- * @throws ApiError
2813
- */
2814
- public static platformControllerCreate(
2815
- data: PlatformControllerCreateData
2816
- ): CancelablePromise<PlatformControllerCreateResponse> {
2817
- return __request(OpenAPI, {
2818
- method: 'POST',
2819
- url: '/api/v1/bean/platforms',
2820
- body: data.requestBody,
2821
- mediaType: 'application/json',
2822
- errors: {
2823
- 409: 'Platform already exists'
2824
- }
2825
- });
2826
- }
2827
-
2828
- /**
2829
- * Get platform list for current user
2830
- * @returns unknown List of platforms with user binding status
2831
- * @throws ApiError
2832
- */
2833
- public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
2834
- return __request(OpenAPI, {
2835
- method: 'GET',
2836
- url: '/api/v1/bean/platforms/list'
2837
- });
2838
- }
2839
-
2840
- /**
2841
- * Match platforms by name or alias
2842
- * @param data The data for the request.
2843
- * @param data.q Search query — Chinese name, English name, or abbreviation
2844
- * @param data.region Region code for category override lookup
2845
- * @returns unknown List of matching platforms with suggested segment names
2846
- * @throws ApiError
2847
- */
2848
- public static platformControllerMatchPlatforms(
2849
- data: PlatformControllerMatchPlatformsData
2850
- ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
2851
- return __request(OpenAPI, {
2852
- method: 'GET',
2853
- url: '/api/v1/bean/platforms/match',
2854
- query: {
2855
- q: data.q,
2856
- region: data.region
2857
- }
2858
- });
2859
- }
2860
-
2861
- /**
2862
- * Update a platform
2863
- * @param data The data for the request.
2864
- * @param data.id Platform ID
2865
- * @param data.requestBody
2866
- * @returns unknown Platform updated successfully
2867
- * @throws ApiError
2868
- */
2869
- public static platformControllerUpdate(
2870
- data: PlatformControllerUpdateData
2871
- ): CancelablePromise<PlatformControllerUpdateResponse> {
2872
- return __request(OpenAPI, {
2873
- method: 'PUT',
2874
- url: '/api/v1/bean/platforms/{id}',
2875
- path: {
2876
- id: data.id
2877
- },
2878
- body: data.requestBody,
2879
- mediaType: 'application/json',
2880
- errors: {
2881
- 404: 'Platform not found'
3313
+ 404: 'Configuration not found'
2882
3314
  }
2883
3315
  });
2884
3316
  }
2885
3317
 
2886
3318
  /**
2887
- * Delete a platform
3319
+ * Reset configuration to default
3320
+ * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
2888
3321
  * @param data The data for the request.
2889
- * @param data.id Platform ID
2890
- * @returns void Platform deleted successfully
3322
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3323
+ * @param data.region Region code for tenant context
3324
+ * @returns ImporterConfigDto Configuration reset successfully
2891
3325
  * @throws ApiError
2892
3326
  */
2893
- public static platformControllerDelete(
2894
- data: PlatformControllerDeleteData
2895
- ): CancelablePromise<PlatformControllerDeleteResponse> {
3327
+ public static importerConfigControllerResetConfig(
3328
+ data: ImporterConfigControllerResetConfigData
3329
+ ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
2896
3330
  return __request(OpenAPI, {
2897
- method: 'DELETE',
2898
- url: '/api/v1/bean/platforms/{id}',
3331
+ method: 'POST',
3332
+ url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
2899
3333
  path: {
2900
- id: data.id
3334
+ importerId: data.importerId,
3335
+ region: data.region
2901
3336
  },
2902
3337
  errors: {
2903
- 404: 'Platform not found'
3338
+ 400: 'Invalid input - Unsupported importer'
2904
3339
  }
2905
3340
  });
2906
3341
  }
@@ -3006,6 +3441,101 @@ export class ProviderSyncService {
3006
3441
  }
3007
3442
  }
3008
3443
 
3444
+ export class ExternalAccountLinksService {
3445
+ /**
3446
+ * Create an external account → BeanAccount mapping (ADR-0113)
3447
+ * @param data The data for the request.
3448
+ * @param data.region Region code for tenant context
3449
+ * @param data.requestBody
3450
+ * @returns ExternalAccountLinkResponseDto Link created.
3451
+ * @throws ApiError
3452
+ */
3453
+ public static externalAccountLinkControllerCreate(
3454
+ data: ExternalAccountLinkControllerCreateData
3455
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
3456
+ return __request(OpenAPI, {
3457
+ method: 'POST',
3458
+ url: '/api/v1/{region}/bean/external-account-links',
3459
+ path: {
3460
+ region: data.region
3461
+ },
3462
+ body: data.requestBody,
3463
+ mediaType: 'application/json',
3464
+ errors: {
3465
+ 422: 'beanAccountId not owned, or an active link already exists.'
3466
+ }
3467
+ });
3468
+ }
3469
+
3470
+ /**
3471
+ * List the user's active external account links
3472
+ * @param data The data for the request.
3473
+ * @param data.provider
3474
+ * @param data.region Region code for tenant context
3475
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
3476
+ * @throws ApiError
3477
+ */
3478
+ public static externalAccountLinkControllerFindAll(
3479
+ data: ExternalAccountLinkControllerFindAllData
3480
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
3481
+ return __request(OpenAPI, {
3482
+ method: 'GET',
3483
+ url: '/api/v1/{region}/bean/external-account-links',
3484
+ path: {
3485
+ region: data.region
3486
+ },
3487
+ query: {
3488
+ provider: data.provider
3489
+ }
3490
+ });
3491
+ }
3492
+
3493
+ /**
3494
+ * Get a single external account link
3495
+ * @param data The data for the request.
3496
+ * @param data.id
3497
+ * @param data.region Region code for tenant context
3498
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
3499
+ * @throws ApiError
3500
+ */
3501
+ public static externalAccountLinkControllerFindOne(
3502
+ data: ExternalAccountLinkControllerFindOneData
3503
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
3504
+ return __request(OpenAPI, {
3505
+ method: 'GET',
3506
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3507
+ path: {
3508
+ id: data.id,
3509
+ region: data.region
3510
+ },
3511
+ errors: {
3512
+ 422: 'Link not found or not owned by the user.'
3513
+ }
3514
+ });
3515
+ }
3516
+
3517
+ /**
3518
+ * Soft-delete (disconnect) an external account link
3519
+ * @param data The data for the request.
3520
+ * @param data.id
3521
+ * @param data.region Region code for tenant context
3522
+ * @returns void Link soft-deleted; historical transactions are unaffected.
3523
+ * @throws ApiError
3524
+ */
3525
+ public static externalAccountLinkControllerRemove(
3526
+ data: ExternalAccountLinkControllerRemoveData
3527
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
3528
+ return __request(OpenAPI, {
3529
+ method: 'DELETE',
3530
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3531
+ path: {
3532
+ id: data.id,
3533
+ region: data.region
3534
+ }
3535
+ });
3536
+ }
3537
+ }
3538
+
3009
3539
  export class ImportTelemetryService {
3010
3540
  /**
3011
3541
  * Receive anonymous parser failure telemetry
@@ -3164,411 +3694,270 @@ export class BeanNlpService {
3164
3694
  }
3165
3695
  }
3166
3696
 
3167
- export class DashboardService {
3168
- /**
3169
- * Get net worth overview
3170
- * Returns total net worth with breakdown of assets and liabilities
3171
- * @param data The data for the request.
3172
- * @param data.region Region code for tenant context
3173
- * @param data.date Date for balance calculation (ISO 8601 format)
3174
- * @returns NetWorthResponseDto Net worth retrieved successfully
3175
- * @throws ApiError
3176
- */
3177
- public static dashboardControllerGetNetWorth(
3178
- data: DashboardControllerGetNetWorthData
3179
- ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3180
- return __request(OpenAPI, {
3181
- method: 'GET',
3182
- url: '/api/v1/{region}/dashboard/net-worth',
3183
- path: {
3184
- region: data.region
3185
- },
3186
- query: {
3187
- date: data.date
3188
- },
3189
- errors: {
3190
- 401: 'User not authenticated'
3191
- }
3192
- });
3193
- }
3194
-
3697
+ export class BeanPlatformsService {
3195
3698
  /**
3196
- * Get accounts grouped by platform
3197
- * Returns accounts with balances grouped by financial platform
3198
- * @param data The data for the request.
3199
- * @param data.region Region code for tenant context
3200
- * @param data.groupBy Grouping strategy
3201
- * @param data.date Date for balance calculation (ISO 8601 format)
3202
- * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3203
- * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3699
+ * Get all platforms with statistics
3700
+ * @returns unknown List of platforms with binding and account counts
3204
3701
  * @throws ApiError
3205
3702
  */
3206
- public static dashboardControllerGetAccounts(
3207
- data: DashboardControllerGetAccountsData
3208
- ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3703
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
3209
3704
  return __request(OpenAPI, {
3210
3705
  method: 'GET',
3211
- url: '/api/v1/{region}/dashboard/accounts',
3212
- path: {
3213
- region: data.region
3214
- },
3215
- query: {
3216
- groupBy: data.groupBy,
3217
- date: data.date,
3218
- accountId: data.accountId
3219
- },
3220
- errors: {
3221
- 401: 'User not authenticated'
3222
- }
3706
+ url: '/api/v1/bean/platforms'
3223
3707
  });
3224
3708
  }
3225
3709
 
3226
3710
  /**
3227
- * Get cash flow summary
3228
- * Returns income, expenses, and savings for a monthly period
3711
+ * Create a new platform
3229
3712
  * @param data The data for the request.
3230
- * @param data.period Period in YYYY-MM format
3231
- * @param data.region Region code for tenant context
3232
- * @returns CashFlowResponseDto Cash flow retrieved successfully
3713
+ * @param data.requestBody
3714
+ * @returns unknown Platform created successfully
3233
3715
  * @throws ApiError
3234
3716
  */
3235
- public static dashboardControllerGetCashFlow(
3236
- data: DashboardControllerGetCashFlowData
3237
- ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3717
+ public static platformControllerCreate(
3718
+ data: PlatformControllerCreateData
3719
+ ): CancelablePromise<PlatformControllerCreateResponse> {
3238
3720
  return __request(OpenAPI, {
3239
- method: 'GET',
3240
- url: '/api/v1/{region}/dashboard/cash-flow',
3241
- path: {
3242
- region: data.region
3243
- },
3244
- query: {
3245
- period: data.period
3246
- },
3721
+ method: 'POST',
3722
+ url: '/api/v1/bean/platforms',
3723
+ body: data.requestBody,
3724
+ mediaType: 'application/json',
3247
3725
  errors: {
3248
- 400: 'Invalid period format',
3249
- 401: 'User not authenticated'
3726
+ 409: 'Platform already exists'
3250
3727
  }
3251
3728
  });
3252
3729
  }
3253
- }
3254
3730
 
3255
- export class InvestmentService {
3256
3731
  /**
3257
- * Get per-holding unrealized + realized P&L
3258
- * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3259
- * @param data The data for the request.
3260
- * @param data.region Region code for tenant context
3261
- * @param data.asOf As-of date (ISO 8601), defaults to today
3262
- * @param data.accountId Scope to a single account
3263
- * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3264
- * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3732
+ * Get platform list for current user
3733
+ * @returns PlatformListItemDto List of platforms with user binding status
3265
3734
  * @throws ApiError
3266
3735
  */
3267
- public static holdingPnlControllerGetHoldingPnl(
3268
- data: HoldingPnlControllerGetHoldingPnlData
3269
- ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3736
+ public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3270
3737
  return __request(OpenAPI, {
3271
3738
  method: 'GET',
3272
- url: '/api/v1/{region}/investment/holdings/pnl',
3273
- path: {
3274
- region: data.region
3275
- },
3276
- query: {
3277
- asOf: data.asOf,
3278
- accountId: data.accountId,
3279
- method: data.method
3280
- },
3281
- errors: {
3282
- 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3283
- 401: 'User not authenticated'
3284
- }
3285
- });
3286
- }
3287
- }
3288
-
3289
- export class BeanPricesService {
3290
- /**
3291
- * Create a new price
3292
- * Creates a new price entry for the authenticated user
3293
- * @param data The data for the request.
3294
- * @param data.region Region code for tenant context
3295
- * @param data.requestBody
3296
- * @returns PriceResponseDto Price created successfully
3297
- * @throws ApiError
3298
- */
3299
- public static priceControllerCreate(
3300
- data: PriceControllerCreateData
3301
- ): CancelablePromise<PriceControllerCreateResponse> {
3302
- return __request(OpenAPI, {
3303
- method: 'POST',
3304
- url: '/api/v1/{region}/bean/prices',
3305
- path: {
3306
- region: data.region
3307
- },
3308
- body: data.requestBody,
3309
- mediaType: 'application/json',
3310
- errors: {
3311
- 404: 'Currency or quoteCurrency commodity not found',
3312
- 409: 'Price already exists for this currency pair and date'
3313
- }
3739
+ url: '/api/v1/bean/platforms/list'
3314
3740
  });
3315
3741
  }
3316
3742
 
3317
3743
  /**
3318
- * List user prices
3319
- * Returns all price entries for the authenticated user with optional filtering
3744
+ * Match platforms by name or alias
3320
3745
  * @param data The data for the request.
3321
- * @param data.region Region code for tenant context
3322
- * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
3323
- * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
3324
- * @param data.dateFrom Filter prices from this date (ISO 8601 format)
3325
- * @param data.dateTo Filter prices to this date (ISO 8601 format)
3326
- * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
3327
- * @param data.page Page number for pagination (default: 1)
3328
- * @param data.limit Number of items per page (default: 20, max: 100)
3329
- * @returns PriceListResponseDto Prices retrieved successfully
3746
+ * @param data.q Search query — Chinese name, English name, or abbreviation
3747
+ * @param data.region Region code for category override lookup
3748
+ * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3330
3749
  * @throws ApiError
3331
3750
  */
3332
- public static priceControllerFindAll(
3333
- data: PriceControllerFindAllData
3334
- ): CancelablePromise<PriceControllerFindAllResponse> {
3751
+ public static platformControllerMatchPlatforms(
3752
+ data: PlatformControllerMatchPlatformsData
3753
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3335
3754
  return __request(OpenAPI, {
3336
3755
  method: 'GET',
3337
- url: '/api/v1/{region}/bean/prices',
3338
- path: {
3339
- region: data.region
3340
- },
3756
+ url: '/api/v1/bean/platforms/match',
3341
3757
  query: {
3342
- currency: data.currency,
3343
- quoteCurrency: data.quoteCurrency,
3344
- dateFrom: data.dateFrom,
3345
- dateTo: data.dateTo,
3346
- search: data.search,
3347
- page: data.page,
3348
- limit: data.limit
3758
+ q: data.q,
3759
+ region: data.region
3349
3760
  }
3350
3761
  });
3351
3762
  }
3352
3763
 
3353
3764
  /**
3354
- * Get price by ID
3355
- * Returns a single price entry by its ID
3765
+ * Update a platform
3356
3766
  * @param data The data for the request.
3357
- * @param data.id Price ID
3358
- * @param data.region Region code for tenant context
3359
- * @returns PriceResponseDto Price retrieved successfully
3767
+ * @param data.id Platform ID
3768
+ * @param data.requestBody
3769
+ * @returns unknown Platform updated successfully
3360
3770
  * @throws ApiError
3361
3771
  */
3362
- public static priceControllerFindOne(
3363
- data: PriceControllerFindOneData
3364
- ): CancelablePromise<PriceControllerFindOneResponse> {
3772
+ public static platformControllerUpdate(
3773
+ data: PlatformControllerUpdateData
3774
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3365
3775
  return __request(OpenAPI, {
3366
- method: 'GET',
3367
- url: '/api/v1/{region}/bean/prices/{id}',
3776
+ method: 'PUT',
3777
+ url: '/api/v1/bean/platforms/{id}',
3368
3778
  path: {
3369
- id: data.id,
3370
- region: data.region
3779
+ id: data.id
3371
3780
  },
3781
+ body: data.requestBody,
3782
+ mediaType: 'application/json',
3372
3783
  errors: {
3373
- 404: 'Price not found'
3784
+ 404: 'Platform not found'
3374
3785
  }
3375
3786
  });
3376
3787
  }
3377
3788
 
3378
3789
  /**
3379
- * Update a price
3380
- * Updates an existing price entry
3790
+ * Delete a platform
3381
3791
  * @param data The data for the request.
3382
- * @param data.id Price ID
3383
- * @param data.region Region code for tenant context
3384
- * @param data.requestBody
3385
- * @returns PriceResponseDto Price updated successfully
3792
+ * @param data.id Platform ID
3793
+ * @returns void Platform deleted successfully
3386
3794
  * @throws ApiError
3387
3795
  */
3388
- public static priceControllerUpdate(
3389
- data: PriceControllerUpdateData
3390
- ): CancelablePromise<PriceControllerUpdateResponse> {
3796
+ public static platformControllerDelete(
3797
+ data: PlatformControllerDeleteData
3798
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3391
3799
  return __request(OpenAPI, {
3392
- method: 'PUT',
3393
- url: '/api/v1/{region}/bean/prices/{id}',
3800
+ method: 'DELETE',
3801
+ url: '/api/v1/bean/platforms/{id}',
3394
3802
  path: {
3395
- id: data.id,
3396
- region: data.region
3803
+ id: data.id
3397
3804
  },
3398
- body: data.requestBody,
3399
- mediaType: 'application/json',
3400
3805
  errors: {
3401
- 404: 'Price not found',
3402
- 409: 'Updated price conflicts with existing price'
3806
+ 404: 'Platform not found'
3403
3807
  }
3404
3808
  });
3405
3809
  }
3810
+ }
3406
3811
 
3812
+ export class DashboardService {
3407
3813
  /**
3408
- * Delete a price
3409
- * Deletes a price entry (hard delete)
3814
+ * Get net worth overview
3815
+ * Returns total net worth with breakdown of assets and liabilities
3410
3816
  * @param data The data for the request.
3411
- * @param data.id Price ID
3412
3817
  * @param data.region Region code for tenant context
3413
- * @returns void Price deleted successfully
3818
+ * @param data.date Date for balance calculation (ISO 8601 format)
3819
+ * @returns NetWorthResponseDto Net worth retrieved successfully
3414
3820
  * @throws ApiError
3415
3821
  */
3416
- public static priceControllerDelete(
3417
- data: PriceControllerDeleteData
3418
- ): CancelablePromise<PriceControllerDeleteResponse> {
3822
+ public static dashboardControllerGetNetWorth(
3823
+ data: DashboardControllerGetNetWorthData
3824
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3419
3825
  return __request(OpenAPI, {
3420
- method: 'DELETE',
3421
- url: '/api/v1/{region}/bean/prices/{id}',
3826
+ method: 'GET',
3827
+ url: '/api/v1/{region}/dashboard/net-worth',
3422
3828
  path: {
3423
- id: data.id,
3424
3829
  region: data.region
3425
3830
  },
3831
+ query: {
3832
+ date: data.date
3833
+ },
3426
3834
  errors: {
3427
- 404: 'Price not found'
3835
+ 401: 'User not authenticated'
3428
3836
  }
3429
3837
  });
3430
3838
  }
3431
3839
 
3432
3840
  /**
3433
- * Bulk create prices
3434
- * Creates multiple price entries at once (skips duplicates)
3841
+ * Get accounts grouped by platform
3842
+ * Returns accounts with balances grouped by financial platform
3435
3843
  * @param data The data for the request.
3436
3844
  * @param data.region Region code for tenant context
3437
- * @param data.requestBody
3438
- * @returns PriceResponseDto Prices created successfully
3845
+ * @param data.groupBy Grouping strategy
3846
+ * @param data.date Date for balance calculation (ISO 8601 format)
3847
+ * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3848
+ * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3439
3849
  * @throws ApiError
3440
3850
  */
3441
- public static priceControllerBulkCreate(
3442
- data: PriceControllerBulkCreateData
3443
- ): CancelablePromise<PriceControllerBulkCreateResponse> {
3851
+ public static dashboardControllerGetAccounts(
3852
+ data: DashboardControllerGetAccountsData
3853
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3444
3854
  return __request(OpenAPI, {
3445
- method: 'POST',
3446
- url: '/api/v1/{region}/bean/prices/bulk',
3855
+ method: 'GET',
3856
+ url: '/api/v1/{region}/dashboard/accounts',
3447
3857
  path: {
3448
3858
  region: data.region
3449
3859
  },
3450
- body: data.requestBody,
3451
- mediaType: 'application/json'
3860
+ query: {
3861
+ groupBy: data.groupBy,
3862
+ date: data.date,
3863
+ accountId: data.accountId
3864
+ },
3865
+ errors: {
3866
+ 401: 'User not authenticated'
3867
+ }
3452
3868
  });
3453
3869
  }
3454
- }
3455
3870
 
3456
- export class ReportingService {
3457
3871
  /**
3458
- * Get portfolio value trends
3459
- *
3460
- * Returns time series data of portfolio net worth.
3461
- *
3462
- * **Multi-currency Support:**
3463
- * - `series[].byCurrency` - Currency breakdown for each data point
3464
- * - `byCurrency` - Separate time series grouped by currency
3465
- * - `warnings` - Exchange rate warnings if conversion failed
3466
- *
3467
- * **Parameters:**
3468
- * - `period`: Time period (1m, 3m, 6m, 1y)
3469
- * - `granularity`: Data granularity (day, week, month)
3470
- *
3872
+ * Get cash flow summary
3873
+ * Returns income, expenses, and savings for a monthly period
3471
3874
  * @param data The data for the request.
3875
+ * @param data.period Period in YYYY-MM format
3472
3876
  * @param data.region Region code for tenant context
3473
- * @param data.period Time period
3474
- * @param data.granularity Data granularity
3475
- * @returns PortfolioTrendsResponseDto Trends retrieved successfully
3877
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3476
3878
  * @throws ApiError
3477
3879
  */
3478
- public static reportingControllerGetPortfolioTrends(
3479
- data: ReportingControllerGetPortfolioTrendsData
3480
- ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
3880
+ public static dashboardControllerGetCashFlow(
3881
+ data: DashboardControllerGetCashFlowData
3882
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3481
3883
  return __request(OpenAPI, {
3482
3884
  method: 'GET',
3483
- url: '/api/v1/{region}/reporting/portfolio/trends',
3885
+ url: '/api/v1/{region}/dashboard/cash-flow',
3484
3886
  path: {
3485
3887
  region: data.region
3486
3888
  },
3487
3889
  query: {
3488
- period: data.period,
3489
- granularity: data.granularity
3890
+ period: data.period
3490
3891
  },
3491
3892
  errors: {
3893
+ 400: 'Invalid period format',
3492
3894
  401: 'User not authenticated'
3493
3895
  }
3494
3896
  });
3495
3897
  }
3496
3898
 
3497
3899
  /**
3498
- * Generate portfolio snapshot
3499
- *
3500
- * Manually generate a portfolio snapshot for a specific date.
3501
- *
3502
- * **Multi-currency Support:**
3503
- * - Fetches balances grouped by currency
3504
- * - Uses user's baseCurrency setting for conversion
3505
- * - Stores exchange rates and warnings
3506
- *
3507
- * **Use Cases:**
3508
- * - Testing snapshot generation
3509
- * - Force regeneration after data correction
3510
- * - Initial setup for new users
3511
- *
3900
+ * Get expenses/income grouped by functional category
3901
+ * 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)
3512
3902
  * @param data The data for the request.
3513
3903
  * @param data.region Region code for tenant context
3514
- * @param data.requestBody Optional date (defaults to today)
3515
- * @returns GenerateSnapshotResponse Snapshot generated successfully
3904
+ * @param data.groupBy Grouping strategy
3905
+ * @param data.period Time window (1m = current calendar month)
3906
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
3907
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3516
3908
  * @throws ApiError
3517
3909
  */
3518
- public static reportingControllerGenerateSnapshot(
3519
- data: ReportingControllerGenerateSnapshotData
3520
- ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
3910
+ public static dashboardControllerGetExpenses(
3911
+ data: DashboardControllerGetExpensesData
3912
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3521
3913
  return __request(OpenAPI, {
3522
- method: 'POST',
3523
- url: '/api/v1/{region}/reporting/snapshots/generate',
3914
+ method: 'GET',
3915
+ url: '/api/v1/{region}/dashboard/expenses',
3524
3916
  path: {
3525
3917
  region: data.region
3526
3918
  },
3527
- body: data.requestBody,
3528
- mediaType: 'application/json',
3919
+ query: {
3920
+ groupBy: data.groupBy,
3921
+ period: data.period,
3922
+ flow: data.flow
3923
+ },
3529
3924
  errors: {
3530
- 400: 'Invalid date format',
3925
+ 400: 'Invalid groupBy or period',
3531
3926
  401: 'User not authenticated'
3532
3927
  }
3533
3928
  });
3534
3929
  }
3930
+ }
3535
3931
 
3932
+ export class InvestmentService {
3536
3933
  /**
3537
- * Backfill portfolio snapshots
3538
- *
3539
- * Generate snapshots for a date range (historical data backfill).
3540
- *
3541
- * **Multi-currency Support:**
3542
- * - Each snapshot includes multi-currency data
3543
- * - Uses exchange rates available at generation time
3544
- * - Warnings stored for missing exchange rates
3545
- *
3546
- * **Best Practices:**
3547
- * - Use for initial setup after account configuration
3548
- * - Run during low-traffic periods for large date ranges
3549
- * - Existing snapshots are skipped (not regenerated)
3550
- *
3934
+ * Get per-holding unrealized + realized P&L
3935
+ * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3551
3936
  * @param data The data for the request.
3552
3937
  * @param data.region Region code for tenant context
3553
- * @param data.requestBody
3554
- * @returns BackfillSnapshotsResponse Backfill completed successfully
3938
+ * @param data.asOf As-of date (ISO 8601), defaults to today
3939
+ * @param data.accountId Scope to a single account
3940
+ * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3941
+ * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3555
3942
  * @throws ApiError
3556
3943
  */
3557
- public static reportingControllerBackfillSnapshots(
3558
- data: ReportingControllerBackfillSnapshotsData
3559
- ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
3944
+ public static holdingPnlControllerGetHoldingPnl(
3945
+ data: HoldingPnlControllerGetHoldingPnlData
3946
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3560
3947
  return __request(OpenAPI, {
3561
- method: 'POST',
3562
- url: '/api/v1/{region}/reporting/snapshots/backfill',
3948
+ method: 'GET',
3949
+ url: '/api/v1/{region}/investment/holdings/pnl',
3563
3950
  path: {
3564
3951
  region: data.region
3565
3952
  },
3566
- body: data.requestBody,
3567
- mediaType: 'application/json',
3953
+ query: {
3954
+ asOf: data.asOf,
3955
+ accountId: data.accountId,
3956
+ method: data.method
3957
+ },
3568
3958
  errors: {
3569
- 400: 'Invalid date format or range',
3570
- 401: 'User not authenticated',
3571
- 409: 'Backfill already in progress for this user'
3959
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3960
+ 401: 'User not authenticated'
3572
3961
  }
3573
3962
  });
3574
3963
  }
@@ -3597,7 +3986,7 @@ export class AuthService {
3597
3986
  * Anonymous login with access token
3598
3987
  * @param data The data for the request.
3599
3988
  * @param data.requestBody
3600
- * @returns unknown Login successful
3989
+ * @returns AnonymousLoginResponseDto Login successful
3601
3990
  * @throws ApiError
3602
3991
  */
3603
3992
  public static authControllerAccessTokenLogin(
@@ -3784,3 +4173,53 @@ export class InfoService {
3784
4173
  });
3785
4174
  }
3786
4175
  }
4176
+
4177
+ export class MarketDataService {
4178
+ /**
4179
+ * Search market symbols by name or code
4180
+ * Ranked search over the openbb catalog. Empty `q` returns [].
4181
+ * @param data The data for the request.
4182
+ * @param data.q Search term — matched against symbol and instrument name. Empty string returns [].
4183
+ * @param data.limit Maximum number of results (clamped 1..50)
4184
+ * @param data.exchange Filter by exchange code (e.g. US, HK, SS, SZ)
4185
+ * @param data.assetType Filter by OpenBB asset_type (e.g. stock, etf)
4186
+ * @returns SymbolSearchResultDto Ranked search results
4187
+ * @throws ApiError
4188
+ */
4189
+ public static symbolControllerSearch(
4190
+ data: SymbolControllerSearchData
4191
+ ): CancelablePromise<SymbolControllerSearchResponse> {
4192
+ return __request(OpenAPI, {
4193
+ method: 'GET',
4194
+ url: '/api/v1/market/symbols/search',
4195
+ query: {
4196
+ q: data.q,
4197
+ limit: data.limit,
4198
+ exchange: data.exchange,
4199
+ assetType: data.assetType
4200
+ }
4201
+ });
4202
+ }
4203
+
4204
+ /**
4205
+ * Get a market symbol quote
4206
+ * @param data The data for the request.
4207
+ * @param data.symbol
4208
+ * @returns SymbolQuoteDto Symbol quote
4209
+ * @throws ApiError
4210
+ */
4211
+ public static symbolControllerGetQuote(
4212
+ data: SymbolControllerGetQuoteData
4213
+ ): CancelablePromise<SymbolControllerGetQuoteResponse> {
4214
+ return __request(OpenAPI, {
4215
+ method: 'GET',
4216
+ url: '/api/v1/market/symbols/{symbol}/quote',
4217
+ path: {
4218
+ symbol: data.symbol
4219
+ },
4220
+ errors: {
4221
+ 404: 'Symbol not found in the openbb catalog'
4222
+ }
4223
+ });
4224
+ }
4225
+ }