@firela/api-types 0.0.0-canary.285599dd → 0.0.0-canary.294433f8

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,
@@ -183,6 +205,16 @@ import type {
183
205
  EventControllerDeleteResponse,
184
206
  EventControllerGetSliceData,
185
207
  EventControllerGetSliceResponse,
208
+ OnboardingControllerBootstrapData,
209
+ OnboardingControllerBootstrapResponse,
210
+ ReconciliationControllerComputeData,
211
+ ReconciliationControllerComputeResponse,
212
+ ReconciliationControllerAssertData,
213
+ ReconciliationControllerAssertResponse,
214
+ ReconciliationControllerPadData,
215
+ ReconciliationControllerPadResponse,
216
+ ReconciliationControllerHistoryData,
217
+ ReconciliationControllerHistoryResponse,
186
218
  ExportControllerExportBeancountResponse,
187
219
  FileImportControllerImportFileData,
188
220
  FileImportControllerImportFileResponse,
@@ -196,22 +228,20 @@ import type {
196
228
  ImporterConfigControllerUpdateConfigResponse,
197
229
  ImporterConfigControllerResetConfigData,
198
230
  ImporterConfigControllerResetConfigResponse,
199
- PlatformControllerFindAllResponse,
200
- PlatformControllerCreateData,
201
- PlatformControllerCreateResponse,
202
- PlatformControllerGetPlatformListResponse,
203
- PlatformControllerMatchPlatformsData,
204
- PlatformControllerMatchPlatformsResponse,
205
- PlatformControllerUpdateData,
206
- PlatformControllerUpdateResponse,
207
- PlatformControllerDeleteData,
208
- PlatformControllerDeleteResponse,
209
231
  ProviderSyncControllerSyncData,
210
232
  ProviderSyncControllerSyncResponse,
211
233
  ProviderSyncControllerGetSupportedProvidersData,
212
234
  ProviderSyncControllerGetSupportedProvidersResponse,
213
235
  ProviderSyncControllerIsProviderSupportedData,
214
236
  ProviderSyncControllerIsProviderSupportedResponse,
237
+ ExternalAccountLinkControllerCreateData,
238
+ ExternalAccountLinkControllerCreateResponse,
239
+ ExternalAccountLinkControllerFindAllData,
240
+ ExternalAccountLinkControllerFindAllResponse,
241
+ ExternalAccountLinkControllerFindOneData,
242
+ ExternalAccountLinkControllerFindOneResponse,
243
+ ExternalAccountLinkControllerRemoveData,
244
+ ExternalAccountLinkControllerRemoveResponse,
215
245
  TelemetryControllerReportTelemetryData,
216
246
  TelemetryControllerReportTelemetryResponse,
217
247
  TelemetryControllerReportCoverageMissData,
@@ -224,6 +254,16 @@ import type {
224
254
  NlpControllerClearSessionResponse,
225
255
  NlpControllerGetSessionData,
226
256
  NlpControllerGetSessionResponse,
257
+ PlatformControllerFindAllResponse,
258
+ PlatformControllerCreateData,
259
+ PlatformControllerCreateResponse,
260
+ PlatformControllerGetPlatformListResponse,
261
+ PlatformControllerMatchPlatformsData,
262
+ PlatformControllerMatchPlatformsResponse,
263
+ PlatformControllerUpdateData,
264
+ PlatformControllerUpdateResponse,
265
+ PlatformControllerDeleteData,
266
+ PlatformControllerDeleteResponse,
227
267
  DashboardControllerGetNetWorthData,
228
268
  DashboardControllerGetNetWorthResponse,
229
269
  DashboardControllerGetAccountsData,
@@ -234,26 +274,6 @@ import type {
234
274
  DashboardControllerGetExpensesResponse,
235
275
  HoldingPnlControllerGetHoldingPnlData,
236
276
  HoldingPnlControllerGetHoldingPnlResponse,
237
- PriceControllerCreateData,
238
- PriceControllerCreateResponse,
239
- PriceControllerFindAllData,
240
- PriceControllerFindAllResponse,
241
- PriceControllerFindOneData,
242
- PriceControllerFindOneResponse,
243
- PriceControllerUpdateData,
244
- PriceControllerUpdateResponse,
245
- PriceControllerDeleteData,
246
- PriceControllerDeleteResponse,
247
- PriceControllerBulkCreateData,
248
- PriceControllerBulkCreateResponse,
249
- ReportingControllerGetPortfolioTrendsData,
250
- ReportingControllerGetPortfolioTrendsResponse,
251
- ReportingControllerGetCashFlowTrendsData,
252
- ReportingControllerGetCashFlowTrendsResponse,
253
- ReportingControllerGenerateSnapshotData,
254
- ReportingControllerGenerateSnapshotResponse,
255
- ReportingControllerBackfillSnapshotsData,
256
- ReportingControllerBackfillSnapshotsResponse,
257
277
  ApiKeysControllerCreateApiKeyResponse,
258
278
  AuthControllerAccessTokenLoginData,
259
279
  AuthControllerAccessTokenLoginResponse,
@@ -306,7 +326,7 @@ export class BeanAccountsService {
306
326
  * @param data.type Filter by account type
307
327
  * @param data.status Filter by status
308
328
  * @param data.isCustom Filter by custom (user-created) accounts only
309
- * @param data.search Search term for path or i18nKey
329
+ * @param data.search Search term for account path
310
330
  * @param data.limit Maximum number of results
311
331
  * @param data.offset Number of results to skip
312
332
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -468,6 +488,35 @@ export class BeanAccountsService {
468
488
  }
469
489
  });
470
490
  }
491
+
492
+ /**
493
+ * Post an opening-balance transaction
494
+ * 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.
495
+ * @param data The data for the request.
496
+ * @param data.id Account UUID
497
+ * @param data.region Region code for tenant context
498
+ * @param data.requestBody
499
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
500
+ * @throws ApiError
501
+ */
502
+ public static accountControllerAddOpeningBalance(
503
+ data: AccountControllerAddOpeningBalanceData
504
+ ): CancelablePromise<AccountControllerAddOpeningBalanceResponse> {
505
+ return __request(OpenAPI, {
506
+ method: 'POST',
507
+ url: '/api/v1/{region}/bean/accounts/{id}/opening-balance',
508
+ path: {
509
+ id: data.id,
510
+ region: data.region
511
+ },
512
+ body: data.requestBody,
513
+ mediaType: 'application/json',
514
+ errors: {
515
+ 404: 'Account not found',
516
+ 409: 'An opening balance already exists for this account'
517
+ }
518
+ });
519
+ }
471
520
  }
472
521
 
473
522
  export class BeanAccountStandardsService {
@@ -499,7 +548,7 @@ export class BeanAccountStandardsService {
499
548
 
500
549
  /**
501
550
  * Get template metadata for an account path
502
- * Returns extendable status and root type for a template path.
551
+ * Returns root type for a template path.
503
552
  * @param data The data for the request.
504
553
  * @param data.region Region code for tenant context
505
554
  * @param data.path Account path to check
@@ -585,6 +634,7 @@ export class BeanTransactionsService {
585
634
  * @param data.status Filter by transaction status
586
635
  * @param data.search Search in narration and payee fields (max 200 chars)
587
636
  * @param data.accountId Filter by account ID (transactions with postings to this account)
637
+ * @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
588
638
  * @returns TransactionListResponseDto Transaction list
589
639
  * @throws ApiError
590
640
  */
@@ -604,7 +654,8 @@ export class BeanTransactionsService {
604
654
  dateTo: data.dateTo,
605
655
  status: data.status,
606
656
  search: data.search,
607
- accountId: data.accountId
657
+ accountId: data.accountId,
658
+ category: data.category
608
659
  },
609
660
  errors: {
610
661
  400: 'Validation failed',
@@ -792,7 +843,7 @@ export class BeanBalancesService {
792
843
  * Query account balance
793
844
  * Calculate account balance at a specific date for a single currency
794
845
  * @param data The data for the request.
795
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
846
+ * @param data.account Account name (e.g., "Assets:Checking")
796
847
  * @param data.region Region code for tenant context
797
848
  * @param data.date Date to calculate balance at (ISO 8601 format)
798
849
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1513,150 +1564,317 @@ export class BeanCommoditiesService {
1513
1564
  }
1514
1565
  }
1515
1566
 
1516
- export class RecurringRulesService {
1567
+ export class BeanPricesService {
1517
1568
  /**
1518
- * Create a new recurring rule
1519
- * Creates a new recurring transaction rule for the authenticated user
1569
+ * Create a new price
1570
+ * Creates a new price entry for the authenticated user
1520
1571
  * @param data The data for the request.
1521
1572
  * @param data.region Region code for tenant context
1522
1573
  * @param data.requestBody
1523
- * @returns RecurringRuleResponseDto Rule created successfully
1574
+ * @returns PriceResponseDto Price created successfully
1524
1575
  * @throws ApiError
1525
1576
  */
1526
- public static recurringRuleControllerCreate(
1527
- data: RecurringRuleControllerCreateData
1528
- ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1577
+ public static priceControllerCreate(
1578
+ data: PriceControllerCreateData
1579
+ ): CancelablePromise<PriceControllerCreateResponse> {
1529
1580
  return __request(OpenAPI, {
1530
1581
  method: 'POST',
1531
- url: '/api/v1/{region}/bean/recurring-rules',
1582
+ url: '/api/v1/{region}/bean/prices',
1532
1583
  path: {
1533
1584
  region: data.region
1534
1585
  },
1535
1586
  body: data.requestBody,
1536
1587
  mediaType: 'application/json',
1537
1588
  errors: {
1538
- 400: 'Invalid input data (e.g., autoCreate without accounts)',
1539
- 409: 'Rule with same name already exists'
1589
+ 404: 'Currency or quoteCurrency commodity not found',
1590
+ 409: 'Price already exists for this currency pair and date'
1540
1591
  }
1541
1592
  });
1542
1593
  }
1543
1594
 
1544
1595
  /**
1545
- * List recurring rules
1546
- * Returns all recurring rules for the authenticated user with optional filtering
1596
+ * List user prices
1597
+ * Returns all price entries for the authenticated user with optional filtering
1547
1598
  * @param data The data for the request.
1548
1599
  * @param data.region Region code for tenant context
1549
- * @param data.isActive Filter by active status
1550
- * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1551
- * @param data.hasAutoCreate Filter by autoCreate enabled
1552
- * @returns RecurringRuleResponseDto Rules retrieved successfully
1600
+ * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
1601
+ * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
1602
+ * @param data.dateFrom Filter prices from this date (ISO 8601 format)
1603
+ * @param data.dateTo Filter prices to this date (ISO 8601 format)
1604
+ * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
1605
+ * @param data.page Page number for pagination (default: 1)
1606
+ * @param data.limit Number of items per page (default: 20, max: 100)
1607
+ * @returns PriceListResponseDto Prices retrieved successfully
1553
1608
  * @throws ApiError
1554
1609
  */
1555
- public static recurringRuleControllerFindAll(
1556
- data: RecurringRuleControllerFindAllData
1557
- ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1610
+ public static priceControllerFindAll(
1611
+ data: PriceControllerFindAllData
1612
+ ): CancelablePromise<PriceControllerFindAllResponse> {
1558
1613
  return __request(OpenAPI, {
1559
1614
  method: 'GET',
1560
- url: '/api/v1/{region}/bean/recurring-rules',
1615
+ url: '/api/v1/{region}/bean/prices',
1561
1616
  path: {
1562
1617
  region: data.region
1563
1618
  },
1564
1619
  query: {
1565
- isActive: data.isActive,
1566
- frequency: data.frequency,
1567
- hasAutoCreate: data.hasAutoCreate
1620
+ currency: data.currency,
1621
+ quoteCurrency: data.quoteCurrency,
1622
+ dateFrom: data.dateFrom,
1623
+ dateTo: data.dateTo,
1624
+ search: data.search,
1625
+ page: data.page,
1626
+ limit: data.limit
1568
1627
  }
1569
1628
  });
1570
1629
  }
1571
1630
 
1572
1631
  /**
1573
- * Create recurring rule from transaction
1574
- * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1632
+ * Get price by ID
1633
+ * Returns a single price entry by its ID
1575
1634
  * @param data The data for the request.
1576
- * @param data.transactionId Source transaction ID
1635
+ * @param data.id Price ID
1577
1636
  * @param data.region Region code for tenant context
1578
- * @param data.requestBody
1579
- * @returns RecurringRuleResponseDto Rule created successfully
1637
+ * @returns PriceResponseDto Price retrieved successfully
1580
1638
  * @throws ApiError
1581
1639
  */
1582
- public static recurringRuleControllerCreateFromTransaction(
1583
- data: RecurringRuleControllerCreateFromTransactionData
1584
- ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1640
+ public static priceControllerFindOne(
1641
+ data: PriceControllerFindOneData
1642
+ ): CancelablePromise<PriceControllerFindOneResponse> {
1585
1643
  return __request(OpenAPI, {
1586
- method: 'POST',
1587
- url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1644
+ method: 'GET',
1645
+ url: '/api/v1/{region}/bean/prices/{id}',
1588
1646
  path: {
1589
- transactionId: data.transactionId,
1647
+ id: data.id,
1590
1648
  region: data.region
1591
1649
  },
1592
- body: data.requestBody,
1593
- mediaType: 'application/json',
1594
1650
  errors: {
1595
- 404: 'Transaction not found',
1596
- 409: 'Rule with same name already exists or transaction already linked'
1651
+ 404: 'Price not found'
1597
1652
  }
1598
1653
  });
1599
1654
  }
1600
1655
 
1601
1656
  /**
1602
- * Get recurring rule by ID
1603
- * Returns a specific recurring rule with its details
1657
+ * Update a price
1658
+ * Updates an existing price entry
1604
1659
  * @param data The data for the request.
1605
- * @param data.id Rule ID
1660
+ * @param data.id Price ID
1606
1661
  * @param data.region Region code for tenant context
1607
- * @returns RecurringRuleResponseDto Rule retrieved successfully
1662
+ * @param data.requestBody
1663
+ * @returns PriceResponseDto Price updated successfully
1608
1664
  * @throws ApiError
1609
1665
  */
1610
- public static recurringRuleControllerFindOne(
1611
- data: RecurringRuleControllerFindOneData
1612
- ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1666
+ public static priceControllerUpdate(
1667
+ data: PriceControllerUpdateData
1668
+ ): CancelablePromise<PriceControllerUpdateResponse> {
1613
1669
  return __request(OpenAPI, {
1614
- method: 'GET',
1615
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1670
+ method: 'PUT',
1671
+ url: '/api/v1/{region}/bean/prices/{id}',
1616
1672
  path: {
1617
1673
  id: data.id,
1618
1674
  region: data.region
1619
1675
  },
1676
+ body: data.requestBody,
1677
+ mediaType: 'application/json',
1620
1678
  errors: {
1621
- 404: 'Rule not found'
1679
+ 404: 'Price not found',
1680
+ 409: 'Updated price conflicts with existing price'
1622
1681
  }
1623
1682
  });
1624
1683
  }
1625
1684
 
1626
1685
  /**
1627
- * Update recurring rule
1628
- * Updates an existing recurring rule
1686
+ * Delete a price
1687
+ * Deletes a price entry (hard delete)
1629
1688
  * @param data The data for the request.
1630
- * @param data.id Rule ID
1689
+ * @param data.id Price ID
1631
1690
  * @param data.region Region code for tenant context
1632
- * @param data.requestBody
1633
- * @returns RecurringRuleResponseDto Rule updated successfully
1691
+ * @returns void Price deleted successfully
1634
1692
  * @throws ApiError
1635
1693
  */
1636
- public static recurringRuleControllerUpdate(
1637
- data: RecurringRuleControllerUpdateData
1638
- ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1694
+ public static priceControllerDelete(
1695
+ data: PriceControllerDeleteData
1696
+ ): CancelablePromise<PriceControllerDeleteResponse> {
1639
1697
  return __request(OpenAPI, {
1640
- method: 'PATCH',
1641
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1698
+ method: 'DELETE',
1699
+ url: '/api/v1/{region}/bean/prices/{id}',
1642
1700
  path: {
1643
1701
  id: data.id,
1644
1702
  region: data.region
1645
1703
  },
1646
- body: data.requestBody,
1647
- mediaType: 'application/json',
1648
1704
  errors: {
1649
- 400: 'Invalid input data',
1650
- 404: 'Rule not found'
1705
+ 404: 'Price not found'
1651
1706
  }
1652
1707
  });
1653
1708
  }
1654
1709
 
1655
1710
  /**
1656
- * Delete recurring rule
1657
- * Soft deletes a recurring rule (sets isActive to false)
1711
+ * Bulk create prices
1712
+ * Creates multiple price entries at once (skips duplicates)
1658
1713
  * @param data The data for the request.
1659
- * @param data.id Rule ID
1714
+ * @param data.region Region code for tenant context
1715
+ * @param data.requestBody
1716
+ * @returns PriceResponseDto Prices created successfully
1717
+ * @throws ApiError
1718
+ */
1719
+ public static priceControllerBulkCreate(
1720
+ data: PriceControllerBulkCreateData
1721
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
1722
+ return __request(OpenAPI, {
1723
+ method: 'POST',
1724
+ url: '/api/v1/{region}/bean/prices/bulk',
1725
+ path: {
1726
+ region: data.region
1727
+ },
1728
+ body: data.requestBody,
1729
+ mediaType: 'application/json'
1730
+ });
1731
+ }
1732
+ }
1733
+
1734
+ export class RecurringRulesService {
1735
+ /**
1736
+ * Create a new recurring rule
1737
+ * Creates a new recurring transaction rule for the authenticated user
1738
+ * @param data The data for the request.
1739
+ * @param data.region Region code for tenant context
1740
+ * @param data.requestBody
1741
+ * @returns RecurringRuleResponseDto Rule created successfully
1742
+ * @throws ApiError
1743
+ */
1744
+ public static recurringRuleControllerCreate(
1745
+ data: RecurringRuleControllerCreateData
1746
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1747
+ return __request(OpenAPI, {
1748
+ method: 'POST',
1749
+ url: '/api/v1/{region}/bean/recurring-rules',
1750
+ path: {
1751
+ region: data.region
1752
+ },
1753
+ body: data.requestBody,
1754
+ mediaType: 'application/json',
1755
+ errors: {
1756
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
1757
+ 409: 'Rule with same name already exists'
1758
+ }
1759
+ });
1760
+ }
1761
+
1762
+ /**
1763
+ * List recurring rules
1764
+ * Returns all recurring rules for the authenticated user with optional filtering
1765
+ * @param data The data for the request.
1766
+ * @param data.region Region code for tenant context
1767
+ * @param data.isActive Filter by active status
1768
+ * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1769
+ * @param data.hasAutoCreate Filter by autoCreate enabled
1770
+ * @returns RecurringRuleResponseDto Rules retrieved successfully
1771
+ * @throws ApiError
1772
+ */
1773
+ public static recurringRuleControllerFindAll(
1774
+ data: RecurringRuleControllerFindAllData
1775
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1776
+ return __request(OpenAPI, {
1777
+ method: 'GET',
1778
+ url: '/api/v1/{region}/bean/recurring-rules',
1779
+ path: {
1780
+ region: data.region
1781
+ },
1782
+ query: {
1783
+ isActive: data.isActive,
1784
+ frequency: data.frequency,
1785
+ hasAutoCreate: data.hasAutoCreate
1786
+ }
1787
+ });
1788
+ }
1789
+
1790
+ /**
1791
+ * Create recurring rule from transaction
1792
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1793
+ * @param data The data for the request.
1794
+ * @param data.transactionId Source transaction ID
1795
+ * @param data.region Region code for tenant context
1796
+ * @param data.requestBody
1797
+ * @returns RecurringRuleResponseDto Rule created successfully
1798
+ * @throws ApiError
1799
+ */
1800
+ public static recurringRuleControllerCreateFromTransaction(
1801
+ data: RecurringRuleControllerCreateFromTransactionData
1802
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1803
+ return __request(OpenAPI, {
1804
+ method: 'POST',
1805
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1806
+ path: {
1807
+ transactionId: data.transactionId,
1808
+ region: data.region
1809
+ },
1810
+ body: data.requestBody,
1811
+ mediaType: 'application/json',
1812
+ errors: {
1813
+ 404: 'Transaction not found',
1814
+ 409: 'Rule with same name already exists or transaction already linked'
1815
+ }
1816
+ });
1817
+ }
1818
+
1819
+ /**
1820
+ * Get recurring rule by ID
1821
+ * Returns a specific recurring rule with its details
1822
+ * @param data The data for the request.
1823
+ * @param data.id Rule ID
1824
+ * @param data.region Region code for tenant context
1825
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
1826
+ * @throws ApiError
1827
+ */
1828
+ public static recurringRuleControllerFindOne(
1829
+ data: RecurringRuleControllerFindOneData
1830
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1831
+ return __request(OpenAPI, {
1832
+ method: 'GET',
1833
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1834
+ path: {
1835
+ id: data.id,
1836
+ region: data.region
1837
+ },
1838
+ errors: {
1839
+ 404: 'Rule not found'
1840
+ }
1841
+ });
1842
+ }
1843
+
1844
+ /**
1845
+ * Update recurring rule
1846
+ * Updates an existing recurring rule
1847
+ * @param data The data for the request.
1848
+ * @param data.id Rule ID
1849
+ * @param data.region Region code for tenant context
1850
+ * @param data.requestBody
1851
+ * @returns RecurringRuleResponseDto Rule updated successfully
1852
+ * @throws ApiError
1853
+ */
1854
+ public static recurringRuleControllerUpdate(
1855
+ data: RecurringRuleControllerUpdateData
1856
+ ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1857
+ return __request(OpenAPI, {
1858
+ method: 'PATCH',
1859
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1860
+ path: {
1861
+ id: data.id,
1862
+ region: data.region
1863
+ },
1864
+ body: data.requestBody,
1865
+ mediaType: 'application/json',
1866
+ errors: {
1867
+ 400: 'Invalid input data',
1868
+ 404: 'Rule not found'
1869
+ }
1870
+ });
1871
+ }
1872
+
1873
+ /**
1874
+ * Delete recurring rule
1875
+ * Soft deletes a recurring rule (sets isActive to false)
1876
+ * @param data The data for the request.
1877
+ * @param data.id Rule ID
1660
1878
  * @param data.region Region code for tenant context
1661
1879
  * @returns void Rule deleted successfully
1662
1880
  * @throws ApiError
@@ -1943,279 +2161,158 @@ export class RecurringForecastService {
1943
2161
  }
1944
2162
  }
1945
2163
 
1946
- export class BeanTransactionRulesService {
2164
+ export class ReportingService {
1947
2165
  /**
1948
- * Create a new transaction rule (or upsert if upsertByPayee=true)
1949
- * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2166
+ * Get portfolio value trends
2167
+ *
2168
+ * Returns time series data of portfolio net worth.
2169
+ *
2170
+ * **Multi-currency Support:**
2171
+ * - `series[].byCurrency` - Currency breakdown for each data point
2172
+ * - `byCurrency` - Separate time series grouped by currency
2173
+ * - `warnings` - Exchange rate warnings if conversion failed
2174
+ *
2175
+ * **Parameters:**
2176
+ * - `period`: Time period (1m, 3m, 6m, 1y)
2177
+ * - `granularity`: Data granularity (day, week, month)
2178
+ *
1950
2179
  * @param data The data for the request.
1951
2180
  * @param data.region Region code for tenant context
1952
- * @param data.requestBody
1953
- * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2181
+ * @param data.period Time period
2182
+ * @param data.granularity Data granularity
2183
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
1954
2184
  * @throws ApiError
1955
2185
  */
1956
- public static transactionRuleControllerCreate(
1957
- data: TransactionRuleControllerCreateData
1958
- ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2186
+ public static reportingControllerGetPortfolioTrends(
2187
+ data: ReportingControllerGetPortfolioTrendsData
2188
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
1959
2189
  return __request(OpenAPI, {
1960
- method: 'POST',
1961
- url: '/api/v1/{region}/bean/transaction-rules',
2190
+ method: 'GET',
2191
+ url: '/api/v1/{region}/reporting/portfolio/trends',
1962
2192
  path: {
1963
2193
  region: data.region
1964
2194
  },
1965
- body: data.requestBody,
1966
- mediaType: 'application/json',
2195
+ query: {
2196
+ period: data.period,
2197
+ granularity: data.granularity
2198
+ },
1967
2199
  errors: {
1968
- 400: 'Validation failed',
1969
- 401: 'Unauthorized',
1970
- 409: 'Resource conflict - another process is updating this rule'
2200
+ 401: 'User not authenticated'
1971
2201
  }
1972
2202
  });
1973
2203
  }
1974
2204
 
1975
2205
  /**
1976
- * Get all transaction rules for user
2206
+ * Get cash-flow trends
2207
+ *
2208
+ * Monthly income / expense / netSavings over a fixed N-month window
2209
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
2210
+ *
2211
+ * **Parameters:**
2212
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
2213
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
2214
+ *
1977
2215
  * @param data The data for the request.
1978
2216
  * @param data.region Region code for tenant context
1979
- * @param data.limit Max results per page (default: 20, max: 100)
1980
- * @param data.offset Pagination offset (default: 0)
1981
- * @param data.enabled Filter by enabled status
1982
- * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
1983
- * @param data.autoApplyEnabled Filter by auto-apply status
1984
- * @returns TransactionRuleListResponseDto List of rules
2217
+ * @param data.period Time period
2218
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
2219
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
1985
2220
  * @throws ApiError
1986
2221
  */
1987
- public static transactionRuleControllerList(
1988
- data: TransactionRuleControllerListData
1989
- ): CancelablePromise<TransactionRuleControllerListResponse> {
2222
+ public static reportingControllerGetCashFlowTrends(
2223
+ data: ReportingControllerGetCashFlowTrendsData
2224
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
1990
2225
  return __request(OpenAPI, {
1991
2226
  method: 'GET',
1992
- url: '/api/v1/{region}/bean/transaction-rules',
2227
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
1993
2228
  path: {
1994
2229
  region: data.region
1995
2230
  },
1996
2231
  query: {
1997
- limit: data.limit,
1998
- offset: data.offset,
1999
- enabled: data.enabled,
2000
- learningSource: data.learningSource,
2001
- autoApplyEnabled: data.autoApplyEnabled
2232
+ period: data.period,
2233
+ granularity: data.granularity
2002
2234
  },
2003
2235
  errors: {
2004
- 401: 'Unauthorized'
2236
+ 401: 'User not authenticated'
2005
2237
  }
2006
2238
  });
2007
2239
  }
2008
2240
 
2009
2241
  /**
2010
- * Validate transaction rule configuration
2011
- * @param data The data for the request.
2012
- * @param data.region Region code for tenant context
2013
- * @param data.requestBody
2014
- * @returns ValidateRuleResponseDto Validation result
2015
- * @throws ApiError
2016
- */
2017
- public static transactionRuleControllerValidate(
2018
- data: TransactionRuleControllerValidateData
2019
- ): CancelablePromise<TransactionRuleControllerValidateResponse> {
2020
- return __request(OpenAPI, {
2021
- method: 'POST',
2022
- url: '/api/v1/{region}/bean/transaction-rules/validate',
2023
- path: {
2024
- region: data.region
2025
- },
2026
- body: data.requestBody,
2027
- mediaType: 'application/json',
2028
- errors: {
2029
- 400: 'Validation failed',
2030
- 401: 'Unauthorized'
2031
- }
2032
- });
2033
- }
2034
-
2035
- /**
2036
- * Bulk create transaction rules
2242
+ * Generate portfolio snapshot
2243
+ *
2244
+ * Manually generate a portfolio snapshot for a specific date.
2245
+ *
2246
+ * **Multi-currency Support:**
2247
+ * - Fetches balances grouped by currency
2248
+ * - Uses user's baseCurrency setting for conversion
2249
+ * - Stores exchange rates and warnings
2250
+ *
2251
+ * **Use Cases:**
2252
+ * - Testing snapshot generation
2253
+ * - Force regeneration after data correction
2254
+ * - Initial setup for new users
2255
+ *
2037
2256
  * @param data The data for the request.
2038
2257
  * @param data.region Region code for tenant context
2039
- * @param data.requestBody
2040
- * @returns BulkCreateRulesResponseDto Bulk create completed
2258
+ * @param data.requestBody Optional date (defaults to today)
2259
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
2041
2260
  * @throws ApiError
2042
2261
  */
2043
- public static transactionRuleControllerBulkCreate(
2044
- data: TransactionRuleControllerBulkCreateData
2045
- ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2262
+ public static reportingControllerGenerateSnapshot(
2263
+ data: ReportingControllerGenerateSnapshotData
2264
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
2046
2265
  return __request(OpenAPI, {
2047
2266
  method: 'POST',
2048
- url: '/api/v1/{region}/bean/transaction-rules/bulk',
2049
- path: {
2050
- region: data.region
2051
- },
2052
- body: data.requestBody,
2053
- mediaType: 'application/json',
2054
- errors: {
2055
- 400: 'Invalid bulk create data',
2056
- 401: 'Unauthorized'
2057
- }
2058
- });
2059
- }
2060
-
2061
- /**
2062
- * Export transaction rules
2063
- * @param data The data for the request.
2064
- * @param data.format Export format (currently only JSON supported)
2065
- * @param data.region Region code for tenant context
2066
- * @returns ExportRulesResponseDto Exported rules
2067
- * @throws ApiError
2068
- */
2069
- public static transactionRuleControllerExport(
2070
- data: TransactionRuleControllerExportData
2071
- ): CancelablePromise<TransactionRuleControllerExportResponse> {
2072
- return __request(OpenAPI, {
2073
- method: 'GET',
2074
- url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2075
- path: {
2076
- format: data.format,
2077
- region: data.region
2078
- },
2079
- errors: {
2080
- 400: 'Unsupported format',
2081
- 401: 'Unauthorized'
2082
- }
2083
- });
2084
- }
2085
-
2086
- /**
2087
- * Get transaction rule statistics
2088
- * @param data The data for the request.
2089
- * @param data.period Statistics time period
2090
- * @param data.region Region code for tenant context
2091
- * @returns RuleStatisticsResponseDto Rule statistics
2092
- * @throws ApiError
2093
- */
2094
- public static transactionRuleControllerGetStatistics(
2095
- data: TransactionRuleControllerGetStatisticsData
2096
- ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2097
- return __request(OpenAPI, {
2098
- method: 'GET',
2099
- url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2100
- path: {
2101
- period: data.period,
2102
- region: data.region
2103
- },
2104
- errors: {
2105
- 401: 'Unauthorized'
2106
- }
2107
- });
2108
- }
2109
-
2110
- /**
2111
- * Get transaction rule detail
2112
- * @param data The data for the request.
2113
- * @param data.ruleId Rule ID
2114
- * @param data.region Region code for tenant context
2115
- * @returns TransactionRuleResponseDto Rule details
2116
- * @throws ApiError
2117
- */
2118
- public static transactionRuleControllerGetDetail(
2119
- data: TransactionRuleControllerGetDetailData
2120
- ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2121
- return __request(OpenAPI, {
2122
- method: 'GET',
2123
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2124
- path: {
2125
- ruleId: data.ruleId,
2126
- region: data.region
2127
- },
2128
- errors: {
2129
- 401: 'Unauthorized',
2130
- 403: 'Forbidden - not owner of rule',
2131
- 404: 'Rule not found'
2132
- }
2133
- });
2134
- }
2135
-
2136
- /**
2137
- * Update a transaction rule
2138
- * @param data The data for the request.
2139
- * @param data.ruleId Rule ID to update
2140
- * @param data.region Region code for tenant context
2141
- * @param data.requestBody
2142
- * @returns TransactionRuleResponseDto Rule updated successfully
2143
- * @throws ApiError
2144
- */
2145
- public static transactionRuleControllerUpdate(
2146
- data: TransactionRuleControllerUpdateData
2147
- ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2148
- return __request(OpenAPI, {
2149
- method: 'PUT',
2150
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2267
+ url: '/api/v1/{region}/reporting/snapshots/generate',
2151
2268
  path: {
2152
- ruleId: data.ruleId,
2153
2269
  region: data.region
2154
2270
  },
2155
2271
  body: data.requestBody,
2156
2272
  mediaType: 'application/json',
2157
2273
  errors: {
2158
- 400: 'Validation failed',
2159
- 401: 'Unauthorized',
2160
- 403: 'Forbidden - not owner of rule',
2161
- 404: 'Rule not found',
2162
- 409: 'Resource conflict - rule is being modified by another process'
2163
- }
2164
- });
2165
- }
2166
-
2167
- /**
2168
- * Delete a transaction rule
2169
- * @param data The data for the request.
2170
- * @param data.ruleId Rule ID to delete
2171
- * @param data.region Region code for tenant context
2172
- * @returns void Rule deleted successfully
2173
- * @throws ApiError
2174
- */
2175
- public static transactionRuleControllerDelete(
2176
- data: TransactionRuleControllerDeleteData
2177
- ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2178
- return __request(OpenAPI, {
2179
- method: 'DELETE',
2180
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2181
- path: {
2182
- ruleId: data.ruleId,
2183
- region: data.region
2184
- },
2185
- errors: {
2186
- 401: 'Unauthorized',
2187
- 403: 'Forbidden - not owner of rule',
2188
- 404: 'Rule not found',
2189
- 409: 'Resource conflict - rule is being modified by another process'
2274
+ 400: 'Invalid date format',
2275
+ 401: 'User not authenticated'
2190
2276
  }
2191
2277
  });
2192
2278
  }
2193
2279
 
2194
2280
  /**
2195
- * Test rule matching
2281
+ * Backfill portfolio snapshots
2282
+ *
2283
+ * Generate snapshots for a date range (historical data backfill).
2284
+ *
2285
+ * **Multi-currency Support:**
2286
+ * - Each snapshot includes multi-currency data
2287
+ * - Uses exchange rates available at generation time
2288
+ * - Warnings stored for missing exchange rates
2289
+ *
2290
+ * **Best Practices:**
2291
+ * - Use for initial setup after account configuration
2292
+ * - Run during low-traffic periods for large date ranges
2293
+ * - Existing snapshots are skipped (not regenerated)
2294
+ *
2196
2295
  * @param data The data for the request.
2197
- * @param data.ruleId Rule ID to test
2198
2296
  * @param data.region Region code for tenant context
2199
2297
  * @param data.requestBody
2200
- * @returns TestRuleResponseDto Test result
2298
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
2201
2299
  * @throws ApiError
2202
2300
  */
2203
- public static transactionRuleControllerTest(
2204
- data: TransactionRuleControllerTestData
2205
- ): CancelablePromise<TransactionRuleControllerTestResponse> {
2301
+ public static reportingControllerBackfillSnapshots(
2302
+ data: ReportingControllerBackfillSnapshotsData
2303
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
2206
2304
  return __request(OpenAPI, {
2207
2305
  method: 'POST',
2208
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2306
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
2209
2307
  path: {
2210
- ruleId: data.ruleId,
2211
2308
  region: data.region
2212
2309
  },
2213
2310
  body: data.requestBody,
2214
2311
  mediaType: 'application/json',
2215
2312
  errors: {
2216
- 401: 'Unauthorized',
2217
- 403: 'Forbidden - not owner of rule',
2218
- 404: 'Rule not found'
2313
+ 400: 'Invalid date format or range',
2314
+ 401: 'User not authenticated',
2315
+ 409: 'Backfill already in progress for this user'
2219
2316
  }
2220
2317
  });
2221
2318
  }
@@ -2267,7 +2364,7 @@ export class UsersService {
2267
2364
  * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2268
2365
  * @param data The data for the request.
2269
2366
  * @param data.requestBody
2270
- * @returns unknown User created successfully
2367
+ * @returns SignupResponseDto User created successfully
2271
2368
  * @throws ApiError
2272
2369
  */
2273
2370
  public static userControllerSignupUser(
@@ -2476,1085 +2573,1259 @@ export class PropertiesService {
2476
2573
  }
2477
2574
  }
2478
2575
 
2479
- export class LifeEventsService {
2576
+ export class BeanTransactionRulesService {
2480
2577
  /**
2481
- * Create a new life event
2482
- * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2578
+ * Create a new transaction rule (or upsert if upsertByPayee=true)
2579
+ * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2483
2580
  * @param data The data for the request.
2484
- * @param data.region Region code for tenant context (decorative for life events)
2581
+ * @param data.region Region code for tenant context
2485
2582
  * @param data.requestBody
2486
- * @returns EventResponseDto Life event created successfully
2583
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2487
2584
  * @throws ApiError
2488
2585
  */
2489
- public static eventControllerCreate(
2490
- data: EventControllerCreateData
2491
- ): CancelablePromise<EventControllerCreateResponse> {
2586
+ public static transactionRuleControllerCreate(
2587
+ data: TransactionRuleControllerCreateData
2588
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2492
2589
  return __request(OpenAPI, {
2493
2590
  method: 'POST',
2494
- url: '/api/v1/{region}/bean/events',
2591
+ url: '/api/v1/{region}/bean/transaction-rules',
2495
2592
  path: {
2496
2593
  region: data.region
2497
2594
  },
2498
2595
  body: data.requestBody,
2499
2596
  mediaType: 'application/json',
2500
2597
  errors: {
2501
- 409: 'Life event already exists for this (userId, type, date) combination'
2598
+ 400: 'Validation failed',
2599
+ 401: 'Unauthorized',
2600
+ 409: 'Resource conflict - another process is updating this rule'
2502
2601
  }
2503
2602
  });
2504
2603
  }
2505
2604
 
2506
2605
  /**
2507
- * List user life events
2508
- * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2606
+ * Get all transaction rules for user
2509
2607
  * @param data The data for the request.
2510
- * @param data.region Region code for tenant context (decorative for life events)
2511
- * @param data.type Filter by life event type (exact match)
2512
- * @param data.q Search term for description (case-insensitive partial match)
2513
- * @param data.from Filter life events from this date (ISO 8601 format)
2514
- * @param data.to Filter life events to this date (ISO 8601 format)
2515
- * @param data.page Page number for pagination (default: 1)
2516
- * @param data.limit Number of items per page (default: 20, max: 100)
2517
- * @returns EventListResponseDto Life events retrieved successfully
2608
+ * @param data.region Region code for tenant context
2609
+ * @param data.limit Max results per page (default: 20, max: 100)
2610
+ * @param data.offset Pagination offset (default: 0)
2611
+ * @param data.enabled Filter by enabled status
2612
+ * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
2613
+ * @param data.autoApplyEnabled Filter by auto-apply status
2614
+ * @returns TransactionRuleListResponseDto List of rules
2518
2615
  * @throws ApiError
2519
2616
  */
2520
- public static eventControllerFindAll(
2521
- data: EventControllerFindAllData
2522
- ): CancelablePromise<EventControllerFindAllResponse> {
2617
+ public static transactionRuleControllerList(
2618
+ data: TransactionRuleControllerListData
2619
+ ): CancelablePromise<TransactionRuleControllerListResponse> {
2523
2620
  return __request(OpenAPI, {
2524
2621
  method: 'GET',
2525
- url: '/api/v1/{region}/bean/events',
2622
+ url: '/api/v1/{region}/bean/transaction-rules',
2526
2623
  path: {
2527
2624
  region: data.region
2528
2625
  },
2529
2626
  query: {
2530
- type: data.type,
2531
- q: data.q,
2532
- from: data.from,
2533
- to: data.to,
2534
- page: data.page,
2535
- limit: data.limit
2627
+ limit: data.limit,
2628
+ offset: data.offset,
2629
+ enabled: data.enabled,
2630
+ learningSource: data.learningSource,
2631
+ autoApplyEnabled: data.autoApplyEnabled
2632
+ },
2633
+ errors: {
2634
+ 401: 'Unauthorized'
2536
2635
  }
2537
2636
  });
2538
2637
  }
2539
2638
 
2540
2639
  /**
2541
- * Get life event by ID
2542
- * Returns a single life event by its ID. Returns ETag header.
2640
+ * Validate transaction rule configuration
2543
2641
  * @param data The data for the request.
2544
- * @param data.id Life event ID
2545
- * @param data.region Region code for tenant context (decorative for life events)
2546
- * @returns EventResponseDto Life event retrieved successfully
2642
+ * @param data.region Region code for tenant context
2643
+ * @param data.requestBody
2644
+ * @returns ValidateRuleResponseDto Validation result
2547
2645
  * @throws ApiError
2548
2646
  */
2549
- public static eventControllerFindOne(
2550
- data: EventControllerFindOneData
2551
- ): CancelablePromise<EventControllerFindOneResponse> {
2647
+ public static transactionRuleControllerValidate(
2648
+ data: TransactionRuleControllerValidateData
2649
+ ): CancelablePromise<TransactionRuleControllerValidateResponse> {
2552
2650
  return __request(OpenAPI, {
2553
- method: 'GET',
2554
- url: '/api/v1/{region}/bean/events/{id}',
2651
+ method: 'POST',
2652
+ url: '/api/v1/{region}/bean/transaction-rules/validate',
2555
2653
  path: {
2556
- id: data.id,
2557
2654
  region: data.region
2558
2655
  },
2656
+ body: data.requestBody,
2657
+ mediaType: 'application/json',
2559
2658
  errors: {
2560
- 404: 'Life event not found'
2659
+ 400: 'Validation failed',
2660
+ 401: 'Unauthorized'
2561
2661
  }
2562
2662
  });
2563
2663
  }
2564
2664
 
2565
2665
  /**
2566
- * Update a life event
2567
- * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2666
+ * Bulk create transaction rules
2568
2667
  * @param data The data for the request.
2569
- * @param data.id Life event ID
2570
- * @param data.region Region code for tenant context (decorative for life events)
2668
+ * @param data.region Region code for tenant context
2571
2669
  * @param data.requestBody
2572
- * @returns EventResponseDto Life event updated successfully
2670
+ * @returns BulkCreateRulesResponseDto Bulk create completed
2573
2671
  * @throws ApiError
2574
2672
  */
2575
- public static eventControllerUpdate(
2576
- data: EventControllerUpdateData
2577
- ): CancelablePromise<EventControllerUpdateResponse> {
2673
+ public static transactionRuleControllerBulkCreate(
2674
+ data: TransactionRuleControllerBulkCreateData
2675
+ ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2578
2676
  return __request(OpenAPI, {
2579
- method: 'PUT',
2580
- url: '/api/v1/{region}/bean/events/{id}',
2677
+ method: 'POST',
2678
+ url: '/api/v1/{region}/bean/transaction-rules/bulk',
2581
2679
  path: {
2582
- id: data.id,
2583
2680
  region: data.region
2584
2681
  },
2585
2682
  body: data.requestBody,
2586
2683
  mediaType: 'application/json',
2587
2684
  errors: {
2588
- 400: 'If-Match header is not a valid ISO 8601 date',
2589
- 404: 'Life event not found',
2590
- 409: 'Updated event conflicts with an existing (userId, type, date) combination',
2591
- 412: 'If-Match precondition failed (updatedAt mismatch)'
2685
+ 400: 'Invalid bulk create data',
2686
+ 401: 'Unauthorized'
2592
2687
  }
2593
2688
  });
2594
2689
  }
2595
2690
 
2596
2691
  /**
2597
- * Delete a life event
2598
- * Deletes a life event entry (hard delete). Returns 204.
2692
+ * Export transaction rules
2599
2693
  * @param data The data for the request.
2600
- * @param data.id Life event ID
2601
- * @param data.region Region code for tenant context (decorative for life events)
2602
- * @returns void Life event deleted successfully
2694
+ * @param data.format Export format (currently only JSON supported)
2695
+ * @param data.region Region code for tenant context
2696
+ * @returns ExportRulesResponseDto Exported rules
2603
2697
  * @throws ApiError
2604
2698
  */
2605
- public static eventControllerDelete(
2606
- data: EventControllerDeleteData
2607
- ): CancelablePromise<EventControllerDeleteResponse> {
2699
+ public static transactionRuleControllerExport(
2700
+ data: TransactionRuleControllerExportData
2701
+ ): CancelablePromise<TransactionRuleControllerExportResponse> {
2608
2702
  return __request(OpenAPI, {
2609
- method: 'DELETE',
2610
- url: '/api/v1/{region}/bean/events/{id}',
2703
+ method: 'GET',
2704
+ url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2611
2705
  path: {
2612
- id: data.id,
2706
+ format: data.format,
2613
2707
  region: data.region
2614
2708
  },
2615
2709
  errors: {
2616
- 404: 'Life event not found'
2710
+ 400: 'Unsupported format',
2711
+ 401: 'Unauthorized'
2617
2712
  }
2618
2713
  });
2619
2714
  }
2620
2715
 
2621
2716
  /**
2622
- * Slice time-series by a life event (Phase 79)
2623
- * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
2717
+ * Get transaction rule statistics
2624
2718
  * @param data The data for the request.
2625
- * @param data.id Life event ID
2626
- * @param data.accountPattern
2627
- * @param data.granularity
2628
- * @param data.region Region code for tenant context (decorative for life events)
2629
- * @returns unknown Time-series sliced by the life event range
2719
+ * @param data.period Statistics time period
2720
+ * @param data.region Region code for tenant context
2721
+ * @returns RuleStatisticsResponseDto Rule statistics
2630
2722
  * @throws ApiError
2631
2723
  */
2632
- public static eventControllerGetSlice(
2633
- data: EventControllerGetSliceData
2634
- ): CancelablePromise<EventControllerGetSliceResponse> {
2724
+ public static transactionRuleControllerGetStatistics(
2725
+ data: TransactionRuleControllerGetStatisticsData
2726
+ ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2635
2727
  return __request(OpenAPI, {
2636
2728
  method: 'GET',
2637
- url: '/api/v1/{region}/bean/events/{id}/slice',
2729
+ url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2638
2730
  path: {
2639
- id: data.id,
2731
+ period: data.period,
2640
2732
  region: data.region
2641
2733
  },
2642
- query: {
2643
- accountPattern: data.accountPattern,
2644
- granularity: data.granularity
2645
- },
2646
2734
  errors: {
2647
- 400: 'accountPattern query param is empty',
2648
- 404: 'Life event not found'
2735
+ 401: 'Unauthorized'
2649
2736
  }
2650
2737
  });
2651
2738
  }
2652
- }
2653
2739
 
2654
- export class BeanExportService {
2655
2740
  /**
2656
- * Export Beancount ledger as ZIP
2657
- * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
2658
- * @returns unknown
2741
+ * Get transaction rule detail
2742
+ * @param data The data for the request.
2743
+ * @param data.ruleId Rule ID
2744
+ * @param data.region Region code for tenant context
2745
+ * @returns TransactionRuleResponseDto Rule details
2659
2746
  * @throws ApiError
2660
2747
  */
2661
- public static exportControllerExportBeancount(): CancelablePromise<ExportControllerExportBeancountResponse> {
2748
+ public static transactionRuleControllerGetDetail(
2749
+ data: TransactionRuleControllerGetDetailData
2750
+ ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2662
2751
  return __request(OpenAPI, {
2663
2752
  method: 'GET',
2664
- url: '/api/v1/{region}/bean/export/beancount'
2753
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2754
+ path: {
2755
+ ruleId: data.ruleId,
2756
+ region: data.region
2757
+ },
2758
+ errors: {
2759
+ 401: 'Unauthorized',
2760
+ 403: 'Forbidden - not owner of rule',
2761
+ 404: 'Rule not found'
2762
+ }
2665
2763
  });
2666
2764
  }
2667
- }
2668
2765
 
2669
- export class BeanImportService {
2670
2766
  /**
2671
- * Import a bill file
2672
- * Upload and process a bill file (CSV, PDF, OFX, etc.). The system automatically identifies the file type, extracts transactions, validates them, and stores only validated transactions to the database. Maximum file size: 50MB. Only 1 import per user at a time (concurrent imports rejected with 429).
2767
+ * Update a transaction rule
2673
2768
  * @param data The data for the request.
2769
+ * @param data.ruleId Rule ID to update
2674
2770
  * @param data.region Region code for tenant context
2675
- * @param data.formData Bill file to import
2676
- * @returns ImportResultDto File imported successfully
2771
+ * @param data.requestBody
2772
+ * @returns TransactionRuleResponseDto Rule updated successfully
2677
2773
  * @throws ApiError
2678
2774
  */
2679
- public static fileImportControllerImportFile(
2680
- data: FileImportControllerImportFileData
2681
- ): CancelablePromise<FileImportControllerImportFileResponse> {
2775
+ public static transactionRuleControllerUpdate(
2776
+ data: TransactionRuleControllerUpdateData
2777
+ ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2682
2778
  return __request(OpenAPI, {
2683
- method: 'POST',
2684
- url: '/api/v1/{region}/bean/import/file',
2779
+ method: 'PUT',
2780
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2685
2781
  path: {
2782
+ ruleId: data.ruleId,
2686
2783
  region: data.region
2687
2784
  },
2688
- formData: data.formData,
2689
- mediaType: 'multipart/form-data',
2785
+ body: data.requestBody,
2786
+ mediaType: 'application/json',
2690
2787
  errors: {
2691
- 400: 'Bad request - file-format-unsupported or file-import-failed',
2692
- 413: 'Payload too large - file exceeds 50MB limit',
2693
- 429: 'Too many requests - user already has import in progress',
2694
- 500: 'Internal server error - DATABASE_ERROR'
2788
+ 400: 'Validation failed',
2789
+ 401: 'Unauthorized',
2790
+ 403: 'Forbidden - not owner of rule',
2791
+ 404: 'Rule not found',
2792
+ 409: 'Resource conflict - rule is being modified by another process'
2695
2793
  }
2696
2794
  });
2697
2795
  }
2698
2796
 
2699
2797
  /**
2700
- * Identify file type
2701
- * Upload a file to check if it can be processed by any registered importer. Does not perform actual import - useful for pre-validation. Uses user-specific importer configuration.
2798
+ * Delete a transaction rule
2702
2799
  * @param data The data for the request.
2800
+ * @param data.ruleId Rule ID to delete
2703
2801
  * @param data.region Region code for tenant context
2704
- * @param data.formData File to identify
2705
- * @returns IdentifyResultDto File identification result
2802
+ * @returns void Rule deleted successfully
2706
2803
  * @throws ApiError
2707
2804
  */
2708
- public static fileImportControllerIdentifyFile(
2709
- data: FileImportControllerIdentifyFileData
2710
- ): CancelablePromise<FileImportControllerIdentifyFileResponse> {
2805
+ public static transactionRuleControllerDelete(
2806
+ data: TransactionRuleControllerDeleteData
2807
+ ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2711
2808
  return __request(OpenAPI, {
2712
- method: 'POST',
2713
- url: '/api/v1/{region}/bean/import/identify',
2809
+ method: 'DELETE',
2810
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2714
2811
  path: {
2812
+ ruleId: data.ruleId,
2715
2813
  region: data.region
2716
2814
  },
2717
- formData: data.formData,
2718
- mediaType: 'multipart/form-data',
2719
2815
  errors: {
2720
- 400: 'Bad request - No file uploaded'
2816
+ 401: 'Unauthorized',
2817
+ 403: 'Forbidden - not owner of rule',
2818
+ 404: 'Rule not found',
2819
+ 409: 'Resource conflict - rule is being modified by another process'
2721
2820
  }
2722
2821
  });
2723
2822
  }
2724
2823
 
2725
2824
  /**
2726
- * Import a Beancount file in community format
2727
- * Upload a .beancount file to import. The system parses community-format paths, converts to internal format using category metadata, auto-creates accounts, and imports transactions with deduplication. Maximum file size: 50MB. Only 1 import per user at a time.
2825
+ * Test rule matching
2728
2826
  * @param data The data for the request.
2827
+ * @param data.ruleId Rule ID to test
2729
2828
  * @param data.region Region code for tenant context
2730
- * @param data.formData Beancount file to import
2731
- * @returns unknown Beancount file imported successfully
2829
+ * @param data.requestBody
2830
+ * @returns TestRuleResponseDto Test result
2732
2831
  * @throws ApiError
2733
2832
  */
2734
- public static fileImportControllerImportBeancount(
2735
- data: FileImportControllerImportBeancountData
2736
- ): CancelablePromise<FileImportControllerImportBeancountResponse> {
2833
+ public static transactionRuleControllerTest(
2834
+ data: TransactionRuleControllerTestData
2835
+ ): CancelablePromise<TransactionRuleControllerTestResponse> {
2737
2836
  return __request(OpenAPI, {
2738
2837
  method: 'POST',
2739
- url: '/api/v1/{region}/bean/import/beancount',
2838
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2740
2839
  path: {
2840
+ ruleId: data.ruleId,
2741
2841
  region: data.region
2742
2842
  },
2743
- formData: data.formData,
2744
- mediaType: 'multipart/form-data',
2843
+ body: data.requestBody,
2844
+ mediaType: 'application/json',
2745
2845
  errors: {
2746
- 400: 'Bad request - invalid file or no file uploaded'
2846
+ 401: 'Unauthorized',
2847
+ 403: 'Forbidden - not owner of rule',
2848
+ 404: 'Rule not found'
2747
2849
  }
2748
2850
  });
2749
2851
  }
2852
+ }
2750
2853
 
2854
+ export class LifeEventsService {
2751
2855
  /**
2752
- * Get importer configuration
2753
- * Returns the current configuration for the specified importer. Creates default configuration if none exists.
2856
+ * Create a new life event
2857
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2754
2858
  * @param data The data for the request.
2755
- * @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
2756
- * @param data.region Region code for tenant context
2757
- * @returns ImporterConfigDto Configuration retrieved successfully
2859
+ * @param data.region Region code for tenant context (decorative for life events)
2860
+ * @param data.requestBody
2861
+ * @returns EventResponseDto Life event created successfully
2758
2862
  * @throws ApiError
2759
2863
  */
2760
- public static importerConfigControllerGetConfig(
2761
- data: ImporterConfigControllerGetConfigData
2762
- ): CancelablePromise<ImporterConfigControllerGetConfigResponse> {
2864
+ public static eventControllerCreate(
2865
+ data: EventControllerCreateData
2866
+ ): CancelablePromise<EventControllerCreateResponse> {
2763
2867
  return __request(OpenAPI, {
2764
- method: 'GET',
2765
- url: '/api/v1/{region}/bean/import/config/{importerId}',
2868
+ method: 'POST',
2869
+ url: '/api/v1/{region}/bean/events',
2766
2870
  path: {
2767
- importerId: data.importerId,
2768
2871
  region: data.region
2769
2872
  },
2873
+ body: data.requestBody,
2874
+ mediaType: 'application/json',
2770
2875
  errors: {
2771
- 400: 'Invalid input - Unsupported importer',
2772
- 401: 'Unauthorized - Authentication required'
2876
+ 409: 'Life event already exists for this (userId, type, date) combination'
2773
2877
  }
2774
2878
  });
2775
2879
  }
2776
2880
 
2777
2881
  /**
2778
- * Update importer configuration
2779
- * Updates the configuration for the specified importer. Partial updates are supported.
2882
+ * List user life events
2883
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2780
2884
  * @param data The data for the request.
2781
- * @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
2782
- * @param data.region Region code for tenant context
2783
- * @param data.requestBody Partial configuration update. Only provided fields will be updated.
2784
- * @returns ImporterConfigDto Configuration updated successfully
2885
+ * @param data.region Region code for tenant context (decorative for life events)
2886
+ * @param data.type Filter by life event type (exact match)
2887
+ * @param data.q Search term for description (case-insensitive partial match)
2888
+ * @param data.from Filter life events from this date (ISO 8601 format)
2889
+ * @param data.to Filter life events to this date (ISO 8601 format)
2890
+ * @param data.page Page number for pagination (default: 1)
2891
+ * @param data.limit Number of items per page (default: 20, max: 100)
2892
+ * @returns EventListResponseDto Life events retrieved successfully
2785
2893
  * @throws ApiError
2786
2894
  */
2787
- public static importerConfigControllerUpdateConfig(
2788
- data: ImporterConfigControllerUpdateConfigData
2789
- ): CancelablePromise<ImporterConfigControllerUpdateConfigResponse> {
2895
+ public static eventControllerFindAll(
2896
+ data: EventControllerFindAllData
2897
+ ): CancelablePromise<EventControllerFindAllResponse> {
2790
2898
  return __request(OpenAPI, {
2791
- method: 'PUT',
2792
- url: '/api/v1/{region}/bean/import/config/{importerId}',
2899
+ method: 'GET',
2900
+ url: '/api/v1/{region}/bean/events',
2793
2901
  path: {
2794
- importerId: data.importerId,
2795
2902
  region: data.region
2796
2903
  },
2797
- body: data.requestBody,
2798
- mediaType: 'application/json',
2799
- errors: {
2800
- 400: 'Invalid input - Validation failed',
2801
- 404: 'Configuration not found'
2904
+ query: {
2905
+ type: data.type,
2906
+ q: data.q,
2907
+ from: data.from,
2908
+ to: data.to,
2909
+ page: data.page,
2910
+ limit: data.limit
2802
2911
  }
2803
2912
  });
2804
2913
  }
2805
2914
 
2806
2915
  /**
2807
- * Reset configuration to default
2808
- * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
2916
+ * Get life event by ID
2917
+ * Returns a single life event by its ID. Returns ETag header.
2809
2918
  * @param data The data for the request.
2810
- * @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
2811
- * @param data.region Region code for tenant context
2812
- * @returns ImporterConfigDto Configuration reset successfully
2919
+ * @param data.id Life event ID
2920
+ * @param data.region Region code for tenant context (decorative for life events)
2921
+ * @returns EventResponseDto Life event retrieved successfully
2813
2922
  * @throws ApiError
2814
2923
  */
2815
- public static importerConfigControllerResetConfig(
2816
- data: ImporterConfigControllerResetConfigData
2817
- ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
2924
+ public static eventControllerFindOne(
2925
+ data: EventControllerFindOneData
2926
+ ): CancelablePromise<EventControllerFindOneResponse> {
2818
2927
  return __request(OpenAPI, {
2819
- method: 'POST',
2820
- url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
2928
+ method: 'GET',
2929
+ url: '/api/v1/{region}/bean/events/{id}',
2821
2930
  path: {
2822
- importerId: data.importerId,
2931
+ id: data.id,
2823
2932
  region: data.region
2824
2933
  },
2825
2934
  errors: {
2826
- 400: 'Invalid input - Unsupported importer'
2935
+ 404: 'Life event not found'
2827
2936
  }
2828
2937
  });
2829
2938
  }
2830
- }
2831
-
2832
- export class BeanPlatformsService {
2833
- /**
2834
- * Get all platforms with statistics
2835
- * @returns unknown List of platforms with binding and account counts
2836
- * @throws ApiError
2837
- */
2838
- public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2839
- return __request(OpenAPI, {
2840
- method: 'GET',
2841
- url: '/api/v1/bean/platforms'
2842
- });
2843
- }
2844
2939
 
2845
2940
  /**
2846
- * Create a new platform
2941
+ * Update a life event
2942
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2847
2943
  * @param data The data for the request.
2944
+ * @param data.id Life event ID
2945
+ * @param data.region Region code for tenant context (decorative for life events)
2848
2946
  * @param data.requestBody
2849
- * @returns unknown Platform created successfully
2947
+ * @returns EventResponseDto Life event updated successfully
2850
2948
  * @throws ApiError
2851
2949
  */
2852
- public static platformControllerCreate(
2853
- data: PlatformControllerCreateData
2854
- ): CancelablePromise<PlatformControllerCreateResponse> {
2950
+ public static eventControllerUpdate(
2951
+ data: EventControllerUpdateData
2952
+ ): CancelablePromise<EventControllerUpdateResponse> {
2855
2953
  return __request(OpenAPI, {
2856
- method: 'POST',
2857
- url: '/api/v1/bean/platforms',
2954
+ method: 'PUT',
2955
+ url: '/api/v1/{region}/bean/events/{id}',
2956
+ path: {
2957
+ id: data.id,
2958
+ region: data.region
2959
+ },
2858
2960
  body: data.requestBody,
2859
2961
  mediaType: 'application/json',
2860
2962
  errors: {
2861
- 409: 'Platform already exists'
2963
+ 400: 'If-Match header is not a valid ISO 8601 date',
2964
+ 404: 'Life event not found',
2965
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
2966
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2862
2967
  }
2863
2968
  });
2864
2969
  }
2865
2970
 
2866
2971
  /**
2867
- * Get platform list for current user
2868
- * @returns unknown List of platforms with user binding status
2972
+ * Delete a life event
2973
+ * Deletes a life event entry (hard delete). Returns 204.
2974
+ * @param data The data for the request.
2975
+ * @param data.id Life event ID
2976
+ * @param data.region Region code for tenant context (decorative for life events)
2977
+ * @returns void Life event deleted successfully
2869
2978
  * @throws ApiError
2870
2979
  */
2871
- public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
2980
+ public static eventControllerDelete(
2981
+ data: EventControllerDeleteData
2982
+ ): CancelablePromise<EventControllerDeleteResponse> {
2872
2983
  return __request(OpenAPI, {
2873
- method: 'GET',
2874
- url: '/api/v1/bean/platforms/list'
2984
+ method: 'DELETE',
2985
+ url: '/api/v1/{region}/bean/events/{id}',
2986
+ path: {
2987
+ id: data.id,
2988
+ region: data.region
2989
+ },
2990
+ errors: {
2991
+ 404: 'Life event not found'
2992
+ }
2875
2993
  });
2876
2994
  }
2877
2995
 
2878
2996
  /**
2879
- * Match platforms by name or alias
2997
+ * Slice time-series by a life event (Phase 79)
2998
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
2880
2999
  * @param data The data for the request.
2881
- * @param data.q Search query — Chinese name, English name, or abbreviation
2882
- * @param data.region Region code for category override lookup
2883
- * @returns unknown List of matching platforms with suggested segment names
3000
+ * @param data.id Life event ID
3001
+ * @param data.accountPattern
3002
+ * @param data.granularity
3003
+ * @param data.region Region code for tenant context (decorative for life events)
3004
+ * @returns unknown Time-series sliced by the life event range
2884
3005
  * @throws ApiError
2885
3006
  */
2886
- public static platformControllerMatchPlatforms(
2887
- data: PlatformControllerMatchPlatformsData
2888
- ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3007
+ public static eventControllerGetSlice(
3008
+ data: EventControllerGetSliceData
3009
+ ): CancelablePromise<EventControllerGetSliceResponse> {
2889
3010
  return __request(OpenAPI, {
2890
3011
  method: 'GET',
2891
- url: '/api/v1/bean/platforms/match',
2892
- query: {
2893
- q: data.q,
3012
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3013
+ path: {
3014
+ id: data.id,
2894
3015
  region: data.region
3016
+ },
3017
+ query: {
3018
+ accountPattern: data.accountPattern,
3019
+ granularity: data.granularity
3020
+ },
3021
+ errors: {
3022
+ 400: 'accountPattern query param is empty',
3023
+ 404: 'Life event not found'
2895
3024
  }
2896
3025
  });
2897
3026
  }
3027
+ }
2898
3028
 
3029
+ export class OnboardingService {
2899
3030
  /**
2900
- * Update a platform
3031
+ * Bootstrap core accounts + register asset accounts with opening balances (ADR-0113)
2901
3032
  * @param data The data for the request.
2902
- * @param data.id Platform ID
3033
+ * @param data.region Region code for tenant context
2903
3034
  * @param data.requestBody
2904
- * @returns unknown Platform updated successfully
3035
+ * @returns unknown Onboarding bootstrap result.
2905
3036
  * @throws ApiError
2906
3037
  */
2907
- public static platformControllerUpdate(
2908
- data: PlatformControllerUpdateData
2909
- ): CancelablePromise<PlatformControllerUpdateResponse> {
3038
+ public static onboardingControllerBootstrap(
3039
+ data: OnboardingControllerBootstrapData
3040
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
2910
3041
  return __request(OpenAPI, {
2911
- method: 'PUT',
2912
- url: '/api/v1/bean/platforms/{id}',
3042
+ method: 'POST',
3043
+ url: '/api/v1/{region}/bean/onboarding',
2913
3044
  path: {
2914
- id: data.id
3045
+ region: data.region
2915
3046
  },
2916
3047
  body: data.requestBody,
2917
3048
  mediaType: 'application/json',
2918
3049
  errors: {
2919
- 404: 'Platform not found'
3050
+ 422: 'Invalid region/account path/duplicate paths.'
2920
3051
  }
2921
3052
  });
2922
3053
  }
3054
+ }
2923
3055
 
3056
+ export class BalanceReconciliationService {
2924
3057
  /**
2925
- * Delete a platform
3058
+ * Preview reconciliation (book vs actual)
3059
+ * Computes book balance, diff, Beancount-inferred tolerance, and suggested action without persisting.
2926
3060
  * @param data The data for the request.
2927
- * @param data.id Platform ID
2928
- * @returns void Platform deleted successfully
3061
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3062
+ * @param data.requestBody
3063
+ * @returns ReconciliationComputeResultDto Reconciliation preview
2929
3064
  * @throws ApiError
2930
3065
  */
2931
- public static platformControllerDelete(
2932
- data: PlatformControllerDeleteData
2933
- ): CancelablePromise<PlatformControllerDeleteResponse> {
3066
+ public static reconciliationControllerCompute(
3067
+ data: ReconciliationControllerComputeData
3068
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
2934
3069
  return __request(OpenAPI, {
2935
- method: 'DELETE',
2936
- url: '/api/v1/bean/platforms/{id}',
3070
+ method: 'POST',
3071
+ url: '/api/v1/{region}/bean/reconciliations',
2937
3072
  path: {
2938
- id: data.id
3073
+ region: data.region
2939
3074
  },
3075
+ body: data.requestBody,
3076
+ mediaType: 'application/json',
2940
3077
  errors: {
2941
- 404: 'Platform not found'
3078
+ 404: 'Account not found'
2942
3079
  }
2943
3080
  });
2944
3081
  }
2945
- }
2946
3082
 
2947
- export class ProviderSyncService {
2948
3083
  /**
2949
- * Sync transactions from financial data provider
2950
- *
2951
- * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
2952
- *
2953
- * **Supported Providers:**
2954
- * - **plaid**: Plaid API (US, Canada, Europe)
2955
- * - **teller**: Teller API (US)
2956
- * - **truelayer**: TrueLayer Open Banking (UK, Europe)
2957
- * - **gocardless**: GoCardless Bank Account Data (Europe)
2958
- * - **simplefin**: SimpleFIN (Self-hosted)
2959
- * - **yodlee**: Yodlee (Global)
2960
- * - **beancount-direct**: Beancount format transactions
2961
- * - **parsed-bill**: Client-side parsed bill transactions
2962
- *
2963
- * **Processing Flow:**
2964
- * 1. Transform raw data via provider adapter
2965
- * 2. Validate transaction format
2966
- * 3. Deduplicate using originalId
2967
- * 4. Classify using rule engine
2968
- * 5. Route low-confidence to Review Center
2969
- * 6. Persist validated transactions
2970
- *
3084
+ * Record a balance assertion
3085
+ * Persists the reconciliation as a BeanBalance assertion (amount = actual, diffAmount = book − actual). Re-reconciling the same day/currency upserts.
2971
3086
  * @param data The data for the request.
2972
- * @param data.providerName Provider name
2973
- * @param data.region Region code for tenant context
3087
+ * @param data.region Region code for tenant context (decorative for reconciliation)
2974
3088
  * @param data.requestBody
2975
- * @returns ProviderSyncResponseDto Sync completed successfully
3089
+ * @returns ReconciliationRecordDto Balance assertion recorded
2976
3090
  * @throws ApiError
2977
3091
  */
2978
- public static providerSyncControllerSync(
2979
- data: ProviderSyncControllerSyncData
2980
- ): CancelablePromise<ProviderSyncControllerSyncResponse> {
3092
+ public static reconciliationControllerAssert(
3093
+ data: ReconciliationControllerAssertData
3094
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
2981
3095
  return __request(OpenAPI, {
2982
3096
  method: 'POST',
2983
- url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3097
+ url: '/api/v1/{region}/bean/reconciliations/assert',
2984
3098
  path: {
2985
- providerName: data.providerName,
2986
3099
  region: data.region
2987
3100
  },
2988
3101
  body: data.requestBody,
2989
3102
  mediaType: 'application/json',
2990
3103
  errors: {
2991
- 400: 'Invalid request data',
2992
- 401: 'Missing or invalid authentication',
2993
- 404: 'Provider not supported'
3104
+ 404: 'Account not found'
2994
3105
  }
2995
3106
  });
2996
3107
  }
2997
3108
 
2998
3109
  /**
2999
- * Get supported providers
3000
- * Returns a list of all providers supported by the sync endpoint.
3110
+ * Generate a pad adjusting entry
3111
+ * 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.
3001
3112
  * @param data The data for the request.
3002
- * @param data.region Region code for tenant context
3003
- * @returns SupportedProvidersResponseDto List of supported providers
3113
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3114
+ * @param data.requestBody
3115
+ * @returns PadResultDto Pad adjusting entry generated
3004
3116
  * @throws ApiError
3005
3117
  */
3006
- public static providerSyncControllerGetSupportedProviders(
3007
- data: ProviderSyncControllerGetSupportedProvidersData
3008
- ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
3118
+ public static reconciliationControllerPad(
3119
+ data: ReconciliationControllerPadData
3120
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
3009
3121
  return __request(OpenAPI, {
3010
- method: 'GET',
3011
- url: '/api/v1/{region}/bean/import/provider/supported',
3122
+ method: 'POST',
3123
+ url: '/api/v1/{region}/bean/reconciliations/pad',
3012
3124
  path: {
3013
3125
  region: data.region
3014
3126
  },
3127
+ body: data.requestBody,
3128
+ mediaType: 'application/json',
3015
3129
  errors: {
3016
- 401: 'Missing or invalid authentication'
3130
+ 400: 'Book already within tolerance — no pad needed',
3131
+ 404: 'Account not found'
3017
3132
  }
3018
3133
  });
3019
3134
  }
3020
3135
 
3021
3136
  /**
3022
- * Check if provider is supported
3023
- * Returns whether a specific provider is supported.
3137
+ * List reconciliation history for an account
3138
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
3024
3139
  * @param data The data for the request.
3025
- * @param data.providerName Provider name to check
3026
- * @param data.region Region code for tenant context
3027
- * @returns unknown Provider support status
3140
+ * @param data.accountId BeanAccount id
3141
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3142
+ * @returns ReconciliationRecordDto Reconciliation history
3028
3143
  * @throws ApiError
3029
3144
  */
3030
- public static providerSyncControllerIsProviderSupported(
3031
- data: ProviderSyncControllerIsProviderSupportedData
3032
- ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
3145
+ public static reconciliationControllerHistory(
3146
+ data: ReconciliationControllerHistoryData
3147
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
3033
3148
  return __request(OpenAPI, {
3034
3149
  method: 'GET',
3035
- url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3150
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
3036
3151
  path: {
3037
- providerName: data.providerName,
3152
+ accountId: data.accountId,
3038
3153
  region: data.region
3039
3154
  },
3040
3155
  errors: {
3041
- 401: 'Missing or invalid authentication'
3156
+ 404: 'Account not found'
3042
3157
  }
3043
3158
  });
3044
3159
  }
3045
3160
  }
3046
3161
 
3047
- export class ImportTelemetryService {
3162
+ export class BeanExportService {
3048
3163
  /**
3049
- * Receive anonymous parser failure telemetry
3050
- * @param data The data for the request.
3051
- * @param data.region Region code for tenant context
3052
- * @param data.requestBody
3053
- * @returns unknown Telemetry report received
3054
- * @throws ApiError
3164
+ * Export Beancount ledger as ZIP
3165
+ * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
3166
+ * @returns unknown
3167
+ * @throws ApiError
3055
3168
  */
3056
- public static telemetryControllerReportTelemetry(
3057
- data: TelemetryControllerReportTelemetryData
3058
- ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
3169
+ public static exportControllerExportBeancount(): CancelablePromise<ExportControllerExportBeancountResponse> {
3059
3170
  return __request(OpenAPI, {
3060
- method: 'POST',
3061
- url: '/api/v1/{region}/bean/import/parser-telemetry',
3062
- path: {
3063
- region: data.region
3064
- },
3065
- body: data.requestBody,
3066
- mediaType: 'application/json',
3067
- errors: {
3068
- 401: 'Unauthorized'
3069
- }
3171
+ method: 'GET',
3172
+ url: '/api/v1/{region}/bean/export/beancount'
3070
3173
  });
3071
3174
  }
3175
+ }
3072
3176
 
3177
+ export class BeanImportService {
3073
3178
  /**
3074
- * Receive anonymous zero-hit coverage miss report
3179
+ * Import a bill file
3180
+ * Upload and process a bill file (CSV, PDF, OFX, etc.). The system automatically identifies the file type, extracts transactions, validates them, and stores only validated transactions to the database. Maximum file size: 50MB. Only 1 import per user at a time (concurrent imports rejected with 429).
3075
3181
  * @param data The data for the request.
3076
3182
  * @param data.region Region code for tenant context
3077
- * @param data.requestBody
3078
- * @returns unknown Coverage miss report received
3183
+ * @param data.formData Bill file to import
3184
+ * @returns ImportResultDto File imported successfully
3079
3185
  * @throws ApiError
3080
3186
  */
3081
- public static telemetryControllerReportCoverageMiss(
3082
- data: TelemetryControllerReportCoverageMissData
3083
- ): CancelablePromise<TelemetryControllerReportCoverageMissResponse> {
3187
+ public static fileImportControllerImportFile(
3188
+ data: FileImportControllerImportFileData
3189
+ ): CancelablePromise<FileImportControllerImportFileResponse> {
3084
3190
  return __request(OpenAPI, {
3085
3191
  method: 'POST',
3086
- url: '/api/v1/{region}/bean/import/parser-coverage-miss',
3192
+ url: '/api/v1/{region}/bean/import/file',
3087
3193
  path: {
3088
3194
  region: data.region
3089
3195
  },
3090
- body: data.requestBody,
3091
- mediaType: 'application/json',
3196
+ formData: data.formData,
3197
+ mediaType: 'multipart/form-data',
3092
3198
  errors: {
3093
- 401: 'Unauthorized'
3199
+ 400: 'Bad request - file-format-unsupported or file-import-failed',
3200
+ 413: 'Payload too large - file exceeds 50MB limit',
3201
+ 429: 'Too many requests - user already has import in progress',
3202
+ 500: 'Internal server error - DATABASE_ERROR'
3094
3203
  }
3095
3204
  });
3096
3205
  }
3097
3206
 
3098
3207
  /**
3099
- * Coverage metrics (uncovered format aggregation)
3208
+ * Identify file type
3209
+ * Upload a file to check if it can be processed by any registered importer. Does not perform actual import - useful for pre-validation. Uses user-specific importer configuration.
3100
3210
  * @param data The data for the request.
3101
3211
  * @param data.region Region code for tenant context
3102
- * @param data.topN Top-N uncovered formats (default 10)
3103
- * @returns unknown Coverage metrics
3212
+ * @param data.formData File to identify
3213
+ * @returns IdentifyResultDto File identification result
3104
3214
  * @throws ApiError
3105
3215
  */
3106
- public static telemetryControllerGetCoverageMetrics(
3107
- data: TelemetryControllerGetCoverageMetricsData
3108
- ): CancelablePromise<TelemetryControllerGetCoverageMetricsResponse> {
3216
+ public static fileImportControllerIdentifyFile(
3217
+ data: FileImportControllerIdentifyFileData
3218
+ ): CancelablePromise<FileImportControllerIdentifyFileResponse> {
3109
3219
  return __request(OpenAPI, {
3110
- method: 'GET',
3111
- url: '/api/v1/{region}/bean/import/parser-coverage-metrics',
3220
+ method: 'POST',
3221
+ url: '/api/v1/{region}/bean/import/identify',
3112
3222
  path: {
3113
3223
  region: data.region
3114
3224
  },
3115
- query: {
3116
- topN: data.topN
3225
+ formData: data.formData,
3226
+ mediaType: 'multipart/form-data',
3227
+ errors: {
3228
+ 400: 'Bad request - No file uploaded'
3117
3229
  }
3118
3230
  });
3119
3231
  }
3120
- }
3121
3232
 
3122
- export class BeanNlpService {
3123
3233
  /**
3124
- * Process natural language input
3125
- * Parse natural language text (Chinese/English) describing a transaction. Supports multi-turn dialogue for collecting missing information. When confidence < 0.75, returns "confirm" action requiring user verification. User can reply with confirmation words (确认/yes/ok) or provide corrections. Examples: "yesterday Starbucks spent 35 yuan", "today lunch 28 yuan", "spent $50 at Walmart"
3234
+ * Import a Beancount file in community format
3235
+ * Upload a .beancount file to import. The system parses community-format paths, converts to internal format using category metadata, auto-creates accounts, and imports transactions with deduplication. Maximum file size: 50MB. Only 1 import per user at a time.
3126
3236
  * @param data The data for the request.
3127
3237
  * @param data.region Region code for tenant context
3128
- * @param data.requestBody Natural language transaction input with optional session ID
3129
- * @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
3238
+ * @param data.formData Beancount file to import
3239
+ * @returns unknown Beancount file imported successfully
3130
3240
  * @throws ApiError
3131
3241
  */
3132
- public static nlpControllerProcessNaturalLanguage(
3133
- data: NlpControllerProcessNaturalLanguageData
3134
- ): CancelablePromise<NlpControllerProcessNaturalLanguageResponse> {
3242
+ public static fileImportControllerImportBeancount(
3243
+ data: FileImportControllerImportBeancountData
3244
+ ): CancelablePromise<FileImportControllerImportBeancountResponse> {
3135
3245
  return __request(OpenAPI, {
3136
3246
  method: 'POST',
3137
- url: '/api/v1/{region}/bean/nlp/process',
3247
+ url: '/api/v1/{region}/bean/import/beancount',
3138
3248
  path: {
3139
3249
  region: data.region
3140
3250
  },
3141
- body: data.requestBody,
3142
- mediaType: 'application/json',
3251
+ formData: data.formData,
3252
+ mediaType: 'multipart/form-data',
3143
3253
  errors: {
3144
- 400: 'Invalid input',
3145
- 401: 'Unauthorized'
3254
+ 400: 'Bad request - invalid file or no file uploaded'
3146
3255
  }
3147
3256
  });
3148
3257
  }
3149
3258
 
3150
3259
  /**
3151
- * Clear dialogue session
3152
- * Clear the current NLP dialogue session. Use this to cancel an ongoing multi-turn dialogue.
3260
+ * Get importer configuration
3261
+ * Returns the current configuration for the specified importer. Creates default configuration if none exists.
3153
3262
  * @param data The data for the request.
3263
+ * @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
3154
3264
  * @param data.region Region code for tenant context
3155
- * @param data.sessionId Specific session ID to clear (defaults to user session)
3156
- * @returns void Session cleared successfully
3265
+ * @returns ImporterConfigDto Configuration retrieved successfully
3157
3266
  * @throws ApiError
3158
3267
  */
3159
- public static nlpControllerClearSession(
3160
- data: NlpControllerClearSessionData
3161
- ): CancelablePromise<NlpControllerClearSessionResponse> {
3268
+ public static importerConfigControllerGetConfig(
3269
+ data: ImporterConfigControllerGetConfigData
3270
+ ): CancelablePromise<ImporterConfigControllerGetConfigResponse> {
3162
3271
  return __request(OpenAPI, {
3163
- method: 'DELETE',
3164
- url: '/api/v1/{region}/bean/nlp/session',
3272
+ method: 'GET',
3273
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
3165
3274
  path: {
3275
+ importerId: data.importerId,
3166
3276
  region: data.region
3167
3277
  },
3168
- query: {
3169
- sessionId: data.sessionId
3170
- },
3171
3278
  errors: {
3172
- 401: 'Unauthorized'
3279
+ 400: 'Invalid input - Unsupported importer',
3280
+ 401: 'Unauthorized - Authentication required'
3173
3281
  }
3174
3282
  });
3175
3283
  }
3176
3284
 
3177
3285
  /**
3178
- * Get current session state
3179
- * Get the current NLP dialogue session state. Useful for debugging and displaying session context in UI.
3286
+ * Update importer configuration
3287
+ * Updates the configuration for the specified importer. Partial updates are supported.
3180
3288
  * @param data The data for the request.
3289
+ * @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
3181
3290
  * @param data.region Region code for tenant context
3182
- * @param data.sessionId Specific session ID to get (defaults to user session)
3183
- * @returns unknown Current session state (or null if no active session)
3291
+ * @param data.requestBody Partial configuration update. Only provided fields will be updated.
3292
+ * @returns ImporterConfigDto Configuration updated successfully
3184
3293
  * @throws ApiError
3185
3294
  */
3186
- public static nlpControllerGetSession(
3187
- data: NlpControllerGetSessionData
3188
- ): CancelablePromise<NlpControllerGetSessionResponse> {
3295
+ public static importerConfigControllerUpdateConfig(
3296
+ data: ImporterConfigControllerUpdateConfigData
3297
+ ): CancelablePromise<ImporterConfigControllerUpdateConfigResponse> {
3189
3298
  return __request(OpenAPI, {
3190
- method: 'GET',
3191
- url: '/api/v1/{region}/bean/nlp/session',
3299
+ method: 'PUT',
3300
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
3192
3301
  path: {
3302
+ importerId: data.importerId,
3193
3303
  region: data.region
3194
3304
  },
3195
- query: {
3196
- sessionId: data.sessionId
3197
- },
3305
+ body: data.requestBody,
3306
+ mediaType: 'application/json',
3198
3307
  errors: {
3199
- 401: 'Unauthorized'
3308
+ 400: 'Invalid input - Validation failed',
3309
+ 404: 'Configuration not found'
3200
3310
  }
3201
3311
  });
3202
3312
  }
3203
- }
3204
3313
 
3205
- export class DashboardService {
3206
3314
  /**
3207
- * Get net worth overview
3208
- * Returns total net worth with breakdown of assets and liabilities
3315
+ * Reset configuration to default
3316
+ * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
3209
3317
  * @param data The data for the request.
3318
+ * @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
3210
3319
  * @param data.region Region code for tenant context
3211
- * @param data.date Date for balance calculation (ISO 8601 format)
3212
- * @returns NetWorthResponseDto Net worth retrieved successfully
3320
+ * @returns ImporterConfigDto Configuration reset successfully
3213
3321
  * @throws ApiError
3214
3322
  */
3215
- public static dashboardControllerGetNetWorth(
3216
- data: DashboardControllerGetNetWorthData
3217
- ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3323
+ public static importerConfigControllerResetConfig(
3324
+ data: ImporterConfigControllerResetConfigData
3325
+ ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
3218
3326
  return __request(OpenAPI, {
3219
- method: 'GET',
3220
- url: '/api/v1/{region}/dashboard/net-worth',
3327
+ method: 'POST',
3328
+ url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
3221
3329
  path: {
3330
+ importerId: data.importerId,
3222
3331
  region: data.region
3223
3332
  },
3224
- query: {
3225
- date: data.date
3226
- },
3227
3333
  errors: {
3228
- 401: 'User not authenticated'
3334
+ 400: 'Invalid input - Unsupported importer'
3229
3335
  }
3230
3336
  });
3231
3337
  }
3338
+ }
3232
3339
 
3340
+ export class ProviderSyncService {
3233
3341
  /**
3234
- * Get accounts grouped by platform
3235
- * Returns accounts with balances grouped by financial platform
3342
+ * Sync transactions from financial data provider
3343
+ *
3344
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
3345
+ *
3346
+ * **Supported Providers:**
3347
+ * - **plaid**: Plaid API (US, Canada, Europe)
3348
+ * - **teller**: Teller API (US)
3349
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
3350
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
3351
+ * - **simplefin**: SimpleFIN (Self-hosted)
3352
+ * - **yodlee**: Yodlee (Global)
3353
+ * - **beancount-direct**: Beancount format transactions
3354
+ * - **parsed-bill**: Client-side parsed bill transactions
3355
+ *
3356
+ * **Processing Flow:**
3357
+ * 1. Transform raw data via provider adapter
3358
+ * 2. Validate transaction format
3359
+ * 3. Deduplicate using originalId
3360
+ * 4. Classify using rule engine
3361
+ * 5. Route low-confidence to Review Center
3362
+ * 6. Persist validated transactions
3363
+ *
3236
3364
  * @param data The data for the request.
3365
+ * @param data.providerName Provider name
3237
3366
  * @param data.region Region code for tenant context
3238
- * @param data.groupBy Grouping strategy
3239
- * @param data.date Date for balance calculation (ISO 8601 format)
3240
- * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3241
- * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3367
+ * @param data.requestBody
3368
+ * @returns ProviderSyncResponseDto Sync completed successfully
3242
3369
  * @throws ApiError
3243
3370
  */
3244
- public static dashboardControllerGetAccounts(
3245
- data: DashboardControllerGetAccountsData
3246
- ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3371
+ public static providerSyncControllerSync(
3372
+ data: ProviderSyncControllerSyncData
3373
+ ): CancelablePromise<ProviderSyncControllerSyncResponse> {
3247
3374
  return __request(OpenAPI, {
3248
- method: 'GET',
3249
- url: '/api/v1/{region}/dashboard/accounts',
3375
+ method: 'POST',
3376
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3250
3377
  path: {
3378
+ providerName: data.providerName,
3251
3379
  region: data.region
3252
3380
  },
3253
- query: {
3254
- groupBy: data.groupBy,
3255
- date: data.date,
3256
- accountId: data.accountId
3257
- },
3381
+ body: data.requestBody,
3382
+ mediaType: 'application/json',
3258
3383
  errors: {
3259
- 401: 'User not authenticated'
3384
+ 400: 'Invalid request data',
3385
+ 401: 'Missing or invalid authentication',
3386
+ 404: 'Provider not supported'
3260
3387
  }
3261
3388
  });
3262
3389
  }
3263
3390
 
3264
3391
  /**
3265
- * Get cash flow summary
3266
- * Returns income, expenses, and savings for a monthly period
3392
+ * Get supported providers
3393
+ * Returns a list of all providers supported by the sync endpoint.
3267
3394
  * @param data The data for the request.
3268
- * @param data.period Period in YYYY-MM format
3269
3395
  * @param data.region Region code for tenant context
3270
- * @returns CashFlowResponseDto Cash flow retrieved successfully
3396
+ * @returns SupportedProvidersResponseDto List of supported providers
3271
3397
  * @throws ApiError
3272
3398
  */
3273
- public static dashboardControllerGetCashFlow(
3274
- data: DashboardControllerGetCashFlowData
3275
- ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3399
+ public static providerSyncControllerGetSupportedProviders(
3400
+ data: ProviderSyncControllerGetSupportedProvidersData
3401
+ ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
3276
3402
  return __request(OpenAPI, {
3277
3403
  method: 'GET',
3278
- url: '/api/v1/{region}/dashboard/cash-flow',
3404
+ url: '/api/v1/{region}/bean/import/provider/supported',
3279
3405
  path: {
3280
3406
  region: data.region
3281
3407
  },
3282
- query: {
3283
- period: data.period
3284
- },
3285
3408
  errors: {
3286
- 400: 'Invalid period format',
3287
- 401: 'User not authenticated'
3409
+ 401: 'Missing or invalid authentication'
3288
3410
  }
3289
3411
  });
3290
3412
  }
3291
3413
 
3292
3414
  /**
3293
- * Get expenses grouped by functional category
3294
- * Returns expenses pre-aggregated by functional category (account-path Group segment) with server-side multi-currency conversion
3415
+ * Check if provider is supported
3416
+ * Returns whether a specific provider is supported.
3295
3417
  * @param data The data for the request.
3418
+ * @param data.providerName Provider name to check
3296
3419
  * @param data.region Region code for tenant context
3297
- * @param data.groupBy Grouping strategy
3298
- * @param data.period Time window (1m = current calendar month)
3299
- * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3420
+ * @returns unknown Provider support status
3300
3421
  * @throws ApiError
3301
3422
  */
3302
- public static dashboardControllerGetExpenses(
3303
- data: DashboardControllerGetExpensesData
3304
- ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3423
+ public static providerSyncControllerIsProviderSupported(
3424
+ data: ProviderSyncControllerIsProviderSupportedData
3425
+ ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
3305
3426
  return __request(OpenAPI, {
3306
3427
  method: 'GET',
3307
- url: '/api/v1/{region}/dashboard/expenses',
3428
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3308
3429
  path: {
3430
+ providerName: data.providerName,
3309
3431
  region: data.region
3310
3432
  },
3311
- query: {
3312
- groupBy: data.groupBy,
3313
- period: data.period
3314
- },
3315
3433
  errors: {
3316
- 400: 'Invalid groupBy or period',
3317
- 401: 'User not authenticated'
3434
+ 401: 'Missing or invalid authentication'
3318
3435
  }
3319
3436
  });
3320
3437
  }
3321
3438
  }
3322
3439
 
3323
- export class InvestmentService {
3440
+ export class ExternalAccountLinksService {
3324
3441
  /**
3325
- * Get per-holding unrealized + realized P&L
3326
- * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3442
+ * Create an external account → BeanAccount mapping (ADR-0113)
3327
3443
  * @param data The data for the request.
3328
3444
  * @param data.region Region code for tenant context
3329
- * @param data.asOf As-of date (ISO 8601), defaults to today
3330
- * @param data.accountId Scope to a single account
3331
- * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3332
- * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3445
+ * @param data.requestBody
3446
+ * @returns ExternalAccountLinkResponseDto Link created.
3333
3447
  * @throws ApiError
3334
3448
  */
3335
- public static holdingPnlControllerGetHoldingPnl(
3336
- data: HoldingPnlControllerGetHoldingPnlData
3337
- ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3449
+ public static externalAccountLinkControllerCreate(
3450
+ data: ExternalAccountLinkControllerCreateData
3451
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
3452
+ return __request(OpenAPI, {
3453
+ method: 'POST',
3454
+ url: '/api/v1/{region}/bean/external-account-links',
3455
+ path: {
3456
+ region: data.region
3457
+ },
3458
+ body: data.requestBody,
3459
+ mediaType: 'application/json',
3460
+ errors: {
3461
+ 422: 'beanAccountId not owned, or an active link already exists.'
3462
+ }
3463
+ });
3464
+ }
3465
+
3466
+ /**
3467
+ * List the user's active external account links
3468
+ * @param data The data for the request.
3469
+ * @param data.provider
3470
+ * @param data.region Region code for tenant context
3471
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
3472
+ * @throws ApiError
3473
+ */
3474
+ public static externalAccountLinkControllerFindAll(
3475
+ data: ExternalAccountLinkControllerFindAllData
3476
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
3338
3477
  return __request(OpenAPI, {
3339
3478
  method: 'GET',
3340
- url: '/api/v1/{region}/investment/holdings/pnl',
3479
+ url: '/api/v1/{region}/bean/external-account-links',
3341
3480
  path: {
3342
3481
  region: data.region
3343
3482
  },
3344
3483
  query: {
3345
- asOf: data.asOf,
3346
- accountId: data.accountId,
3347
- method: data.method
3484
+ provider: data.provider
3485
+ }
3486
+ });
3487
+ }
3488
+
3489
+ /**
3490
+ * Get a single external account link
3491
+ * @param data The data for the request.
3492
+ * @param data.id
3493
+ * @param data.region Region code for tenant context
3494
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
3495
+ * @throws ApiError
3496
+ */
3497
+ public static externalAccountLinkControllerFindOne(
3498
+ data: ExternalAccountLinkControllerFindOneData
3499
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
3500
+ return __request(OpenAPI, {
3501
+ method: 'GET',
3502
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3503
+ path: {
3504
+ id: data.id,
3505
+ region: data.region
3348
3506
  },
3349
3507
  errors: {
3350
- 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3351
- 401: 'User not authenticated'
3508
+ 422: 'Link not found or not owned by the user.'
3509
+ }
3510
+ });
3511
+ }
3512
+
3513
+ /**
3514
+ * Soft-delete (disconnect) an external account link
3515
+ * @param data The data for the request.
3516
+ * @param data.id
3517
+ * @param data.region Region code for tenant context
3518
+ * @returns void Link soft-deleted; historical transactions are unaffected.
3519
+ * @throws ApiError
3520
+ */
3521
+ public static externalAccountLinkControllerRemove(
3522
+ data: ExternalAccountLinkControllerRemoveData
3523
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
3524
+ return __request(OpenAPI, {
3525
+ method: 'DELETE',
3526
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3527
+ path: {
3528
+ id: data.id,
3529
+ region: data.region
3352
3530
  }
3353
3531
  });
3354
3532
  }
3355
3533
  }
3356
3534
 
3357
- export class BeanPricesService {
3535
+ export class ImportTelemetryService {
3358
3536
  /**
3359
- * Create a new price
3360
- * Creates a new price entry for the authenticated user
3537
+ * Receive anonymous parser failure telemetry
3361
3538
  * @param data The data for the request.
3362
3539
  * @param data.region Region code for tenant context
3363
3540
  * @param data.requestBody
3364
- * @returns PriceResponseDto Price created successfully
3541
+ * @returns unknown Telemetry report received
3365
3542
  * @throws ApiError
3366
3543
  */
3367
- public static priceControllerCreate(
3368
- data: PriceControllerCreateData
3369
- ): CancelablePromise<PriceControllerCreateResponse> {
3544
+ public static telemetryControllerReportTelemetry(
3545
+ data: TelemetryControllerReportTelemetryData
3546
+ ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
3370
3547
  return __request(OpenAPI, {
3371
3548
  method: 'POST',
3372
- url: '/api/v1/{region}/bean/prices',
3549
+ url: '/api/v1/{region}/bean/import/parser-telemetry',
3373
3550
  path: {
3374
3551
  region: data.region
3375
3552
  },
3376
3553
  body: data.requestBody,
3377
3554
  mediaType: 'application/json',
3378
3555
  errors: {
3379
- 404: 'Currency or quoteCurrency commodity not found',
3380
- 409: 'Price already exists for this currency pair and date'
3556
+ 401: 'Unauthorized'
3381
3557
  }
3382
3558
  });
3383
3559
  }
3384
3560
 
3385
3561
  /**
3386
- * List user prices
3387
- * Returns all price entries for the authenticated user with optional filtering
3562
+ * Receive anonymous zero-hit coverage miss report
3388
3563
  * @param data The data for the request.
3389
3564
  * @param data.region Region code for tenant context
3390
- * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
3391
- * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
3392
- * @param data.dateFrom Filter prices from this date (ISO 8601 format)
3393
- * @param data.dateTo Filter prices to this date (ISO 8601 format)
3394
- * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
3395
- * @param data.page Page number for pagination (default: 1)
3396
- * @param data.limit Number of items per page (default: 20, max: 100)
3397
- * @returns PriceListResponseDto Prices retrieved successfully
3565
+ * @param data.requestBody
3566
+ * @returns unknown Coverage miss report received
3398
3567
  * @throws ApiError
3399
3568
  */
3400
- public static priceControllerFindAll(
3401
- data: PriceControllerFindAllData
3402
- ): CancelablePromise<PriceControllerFindAllResponse> {
3569
+ public static telemetryControllerReportCoverageMiss(
3570
+ data: TelemetryControllerReportCoverageMissData
3571
+ ): CancelablePromise<TelemetryControllerReportCoverageMissResponse> {
3403
3572
  return __request(OpenAPI, {
3404
- method: 'GET',
3405
- url: '/api/v1/{region}/bean/prices',
3573
+ method: 'POST',
3574
+ url: '/api/v1/{region}/bean/import/parser-coverage-miss',
3406
3575
  path: {
3407
3576
  region: data.region
3408
3577
  },
3409
- query: {
3410
- currency: data.currency,
3411
- quoteCurrency: data.quoteCurrency,
3412
- dateFrom: data.dateFrom,
3413
- dateTo: data.dateTo,
3414
- search: data.search,
3415
- page: data.page,
3416
- limit: data.limit
3578
+ body: data.requestBody,
3579
+ mediaType: 'application/json',
3580
+ errors: {
3581
+ 401: 'Unauthorized'
3417
3582
  }
3418
3583
  });
3419
3584
  }
3420
3585
 
3421
3586
  /**
3422
- * Get price by ID
3423
- * Returns a single price entry by its ID
3587
+ * Coverage metrics (uncovered format aggregation)
3424
3588
  * @param data The data for the request.
3425
- * @param data.id Price ID
3426
3589
  * @param data.region Region code for tenant context
3427
- * @returns PriceResponseDto Price retrieved successfully
3590
+ * @param data.topN Top-N uncovered formats (default 10)
3591
+ * @returns unknown Coverage metrics
3428
3592
  * @throws ApiError
3429
3593
  */
3430
- public static priceControllerFindOne(
3431
- data: PriceControllerFindOneData
3432
- ): CancelablePromise<PriceControllerFindOneResponse> {
3594
+ public static telemetryControllerGetCoverageMetrics(
3595
+ data: TelemetryControllerGetCoverageMetricsData
3596
+ ): CancelablePromise<TelemetryControllerGetCoverageMetricsResponse> {
3433
3597
  return __request(OpenAPI, {
3434
3598
  method: 'GET',
3435
- url: '/api/v1/{region}/bean/prices/{id}',
3599
+ url: '/api/v1/{region}/bean/import/parser-coverage-metrics',
3436
3600
  path: {
3437
- id: data.id,
3438
3601
  region: data.region
3439
3602
  },
3440
- errors: {
3441
- 404: 'Price not found'
3603
+ query: {
3604
+ topN: data.topN
3442
3605
  }
3443
3606
  });
3444
3607
  }
3608
+ }
3445
3609
 
3610
+ export class BeanNlpService {
3446
3611
  /**
3447
- * Update a price
3448
- * Updates an existing price entry
3612
+ * Process natural language input
3613
+ * Parse natural language text (Chinese/English) describing a transaction. Supports multi-turn dialogue for collecting missing information. When confidence < 0.75, returns "confirm" action requiring user verification. User can reply with confirmation words (确认/yes/ok) or provide corrections. Examples: "yesterday Starbucks spent 35 yuan", "today lunch 28 yuan", "spent $50 at Walmart"
3449
3614
  * @param data The data for the request.
3450
- * @param data.id Price ID
3451
3615
  * @param data.region Region code for tenant context
3452
- * @param data.requestBody
3453
- * @returns PriceResponseDto Price updated successfully
3616
+ * @param data.requestBody Natural language transaction input with optional session ID
3617
+ * @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
3454
3618
  * @throws ApiError
3455
3619
  */
3456
- public static priceControllerUpdate(
3457
- data: PriceControllerUpdateData
3458
- ): CancelablePromise<PriceControllerUpdateResponse> {
3620
+ public static nlpControllerProcessNaturalLanguage(
3621
+ data: NlpControllerProcessNaturalLanguageData
3622
+ ): CancelablePromise<NlpControllerProcessNaturalLanguageResponse> {
3459
3623
  return __request(OpenAPI, {
3460
- method: 'PUT',
3461
- url: '/api/v1/{region}/bean/prices/{id}',
3624
+ method: 'POST',
3625
+ url: '/api/v1/{region}/bean/nlp/process',
3462
3626
  path: {
3463
- id: data.id,
3464
3627
  region: data.region
3465
3628
  },
3466
3629
  body: data.requestBody,
3467
3630
  mediaType: 'application/json',
3468
3631
  errors: {
3469
- 404: 'Price not found',
3470
- 409: 'Updated price conflicts with existing price'
3632
+ 400: 'Invalid input',
3633
+ 401: 'Unauthorized'
3471
3634
  }
3472
3635
  });
3473
3636
  }
3474
3637
 
3475
3638
  /**
3476
- * Delete a price
3477
- * Deletes a price entry (hard delete)
3639
+ * Clear dialogue session
3640
+ * Clear the current NLP dialogue session. Use this to cancel an ongoing multi-turn dialogue.
3478
3641
  * @param data The data for the request.
3479
- * @param data.id Price ID
3480
3642
  * @param data.region Region code for tenant context
3481
- * @returns void Price deleted successfully
3643
+ * @param data.sessionId Specific session ID to clear (defaults to user session)
3644
+ * @returns void Session cleared successfully
3482
3645
  * @throws ApiError
3483
3646
  */
3484
- public static priceControllerDelete(
3485
- data: PriceControllerDeleteData
3486
- ): CancelablePromise<PriceControllerDeleteResponse> {
3647
+ public static nlpControllerClearSession(
3648
+ data: NlpControllerClearSessionData
3649
+ ): CancelablePromise<NlpControllerClearSessionResponse> {
3487
3650
  return __request(OpenAPI, {
3488
3651
  method: 'DELETE',
3489
- url: '/api/v1/{region}/bean/prices/{id}',
3652
+ url: '/api/v1/{region}/bean/nlp/session',
3490
3653
  path: {
3491
- id: data.id,
3492
3654
  region: data.region
3493
3655
  },
3656
+ query: {
3657
+ sessionId: data.sessionId
3658
+ },
3494
3659
  errors: {
3495
- 404: 'Price not found'
3660
+ 401: 'Unauthorized'
3496
3661
  }
3497
3662
  });
3498
3663
  }
3499
3664
 
3500
3665
  /**
3501
- * Bulk create prices
3502
- * Creates multiple price entries at once (skips duplicates)
3666
+ * Get current session state
3667
+ * Get the current NLP dialogue session state. Useful for debugging and displaying session context in UI.
3503
3668
  * @param data The data for the request.
3504
3669
  * @param data.region Region code for tenant context
3670
+ * @param data.sessionId Specific session ID to get (defaults to user session)
3671
+ * @returns unknown Current session state (or null if no active session)
3672
+ * @throws ApiError
3673
+ */
3674
+ public static nlpControllerGetSession(
3675
+ data: NlpControllerGetSessionData
3676
+ ): CancelablePromise<NlpControllerGetSessionResponse> {
3677
+ return __request(OpenAPI, {
3678
+ method: 'GET',
3679
+ url: '/api/v1/{region}/bean/nlp/session',
3680
+ path: {
3681
+ region: data.region
3682
+ },
3683
+ query: {
3684
+ sessionId: data.sessionId
3685
+ },
3686
+ errors: {
3687
+ 401: 'Unauthorized'
3688
+ }
3689
+ });
3690
+ }
3691
+ }
3692
+
3693
+ export class BeanPlatformsService {
3694
+ /**
3695
+ * Get all platforms with statistics
3696
+ * @returns unknown List of platforms with binding and account counts
3697
+ * @throws ApiError
3698
+ */
3699
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
3700
+ return __request(OpenAPI, {
3701
+ method: 'GET',
3702
+ url: '/api/v1/bean/platforms'
3703
+ });
3704
+ }
3705
+
3706
+ /**
3707
+ * Create a new platform
3708
+ * @param data The data for the request.
3505
3709
  * @param data.requestBody
3506
- * @returns PriceResponseDto Prices created successfully
3710
+ * @returns unknown Platform created successfully
3507
3711
  * @throws ApiError
3508
3712
  */
3509
- public static priceControllerBulkCreate(
3510
- data: PriceControllerBulkCreateData
3511
- ): CancelablePromise<PriceControllerBulkCreateResponse> {
3713
+ public static platformControllerCreate(
3714
+ data: PlatformControllerCreateData
3715
+ ): CancelablePromise<PlatformControllerCreateResponse> {
3512
3716
  return __request(OpenAPI, {
3513
3717
  method: 'POST',
3514
- url: '/api/v1/{region}/bean/prices/bulk',
3515
- path: {
3718
+ url: '/api/v1/bean/platforms',
3719
+ body: data.requestBody,
3720
+ mediaType: 'application/json',
3721
+ errors: {
3722
+ 409: 'Platform already exists'
3723
+ }
3724
+ });
3725
+ }
3726
+
3727
+ /**
3728
+ * Get platform list for current user
3729
+ * @returns PlatformListItemDto List of platforms with user binding status
3730
+ * @throws ApiError
3731
+ */
3732
+ public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3733
+ return __request(OpenAPI, {
3734
+ method: 'GET',
3735
+ url: '/api/v1/bean/platforms/list'
3736
+ });
3737
+ }
3738
+
3739
+ /**
3740
+ * Match platforms by name or alias
3741
+ * @param data The data for the request.
3742
+ * @param data.q Search query — Chinese name, English name, or abbreviation
3743
+ * @param data.region Region code for category override lookup
3744
+ * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3745
+ * @throws ApiError
3746
+ */
3747
+ public static platformControllerMatchPlatforms(
3748
+ data: PlatformControllerMatchPlatformsData
3749
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3750
+ return __request(OpenAPI, {
3751
+ method: 'GET',
3752
+ url: '/api/v1/bean/platforms/match',
3753
+ query: {
3754
+ q: data.q,
3516
3755
  region: data.region
3756
+ }
3757
+ });
3758
+ }
3759
+
3760
+ /**
3761
+ * Update a platform
3762
+ * @param data The data for the request.
3763
+ * @param data.id Platform ID
3764
+ * @param data.requestBody
3765
+ * @returns unknown Platform updated successfully
3766
+ * @throws ApiError
3767
+ */
3768
+ public static platformControllerUpdate(
3769
+ data: PlatformControllerUpdateData
3770
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3771
+ return __request(OpenAPI, {
3772
+ method: 'PUT',
3773
+ url: '/api/v1/bean/platforms/{id}',
3774
+ path: {
3775
+ id: data.id
3517
3776
  },
3518
3777
  body: data.requestBody,
3519
- mediaType: 'application/json'
3778
+ mediaType: 'application/json',
3779
+ errors: {
3780
+ 404: 'Platform not found'
3781
+ }
3782
+ });
3783
+ }
3784
+
3785
+ /**
3786
+ * Delete a platform
3787
+ * @param data The data for the request.
3788
+ * @param data.id Platform ID
3789
+ * @returns void Platform deleted successfully
3790
+ * @throws ApiError
3791
+ */
3792
+ public static platformControllerDelete(
3793
+ data: PlatformControllerDeleteData
3794
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3795
+ return __request(OpenAPI, {
3796
+ method: 'DELETE',
3797
+ url: '/api/v1/bean/platforms/{id}',
3798
+ path: {
3799
+ id: data.id
3800
+ },
3801
+ errors: {
3802
+ 404: 'Platform not found'
3803
+ }
3520
3804
  });
3521
3805
  }
3522
3806
  }
3523
3807
 
3524
- export class ReportingService {
3808
+ export class DashboardService {
3525
3809
  /**
3526
- * Get portfolio value trends
3527
- *
3528
- * Returns time series data of portfolio net worth.
3529
- *
3530
- * **Multi-currency Support:**
3531
- * - `series[].byCurrency` - Currency breakdown for each data point
3532
- * - `byCurrency` - Separate time series grouped by currency
3533
- * - `warnings` - Exchange rate warnings if conversion failed
3534
- *
3535
- * **Parameters:**
3536
- * - `period`: Time period (1m, 3m, 6m, 1y)
3537
- * - `granularity`: Data granularity (day, week, month)
3538
- *
3810
+ * Get net worth overview
3811
+ * Returns total net worth with breakdown of assets and liabilities
3539
3812
  * @param data The data for the request.
3540
3813
  * @param data.region Region code for tenant context
3541
- * @param data.period Time period
3542
- * @param data.granularity Data granularity
3543
- * @returns PortfolioTrendsResponseDto Trends retrieved successfully
3814
+ * @param data.date Date for balance calculation (ISO 8601 format)
3815
+ * @returns NetWorthResponseDto Net worth retrieved successfully
3544
3816
  * @throws ApiError
3545
3817
  */
3546
- public static reportingControllerGetPortfolioTrends(
3547
- data: ReportingControllerGetPortfolioTrendsData
3548
- ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
3818
+ public static dashboardControllerGetNetWorth(
3819
+ data: DashboardControllerGetNetWorthData
3820
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3549
3821
  return __request(OpenAPI, {
3550
3822
  method: 'GET',
3551
- url: '/api/v1/{region}/reporting/portfolio/trends',
3823
+ url: '/api/v1/{region}/dashboard/net-worth',
3552
3824
  path: {
3553
3825
  region: data.region
3554
3826
  },
3555
3827
  query: {
3556
- period: data.period,
3557
- granularity: data.granularity
3828
+ date: data.date
3558
3829
  },
3559
3830
  errors: {
3560
3831
  401: 'User not authenticated'
@@ -3563,34 +3834,29 @@ export class ReportingService {
3563
3834
  }
3564
3835
 
3565
3836
  /**
3566
- * Get cash-flow trends
3567
- *
3568
- * Monthly income / expense / netSavings over a fixed N-month window
3569
- * (current month + N−1 prior). Missing months are zero-filled (flow metric).
3570
- *
3571
- * **Parameters:**
3572
- * - `period`: 1m | 3m | 6m | 1y (default 6m)
3573
- * - `granularity`: accepted for API symmetry; v1 returns month buckets
3574
- *
3837
+ * Get accounts grouped by platform
3838
+ * Returns accounts with balances grouped by financial platform
3575
3839
  * @param data The data for the request.
3576
3840
  * @param data.region Region code for tenant context
3577
- * @param data.period Time period
3578
- * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
3579
- * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
3841
+ * @param data.groupBy Grouping strategy
3842
+ * @param data.date Date for balance calculation (ISO 8601 format)
3843
+ * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3844
+ * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3580
3845
  * @throws ApiError
3581
3846
  */
3582
- public static reportingControllerGetCashFlowTrends(
3583
- data: ReportingControllerGetCashFlowTrendsData
3584
- ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
3847
+ public static dashboardControllerGetAccounts(
3848
+ data: DashboardControllerGetAccountsData
3849
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3585
3850
  return __request(OpenAPI, {
3586
3851
  method: 'GET',
3587
- url: '/api/v1/{region}/reporting/cash-flow/trends',
3852
+ url: '/api/v1/{region}/dashboard/accounts',
3588
3853
  path: {
3589
3854
  region: data.region
3590
3855
  },
3591
3856
  query: {
3592
- period: data.period,
3593
- granularity: data.granularity
3857
+ groupBy: data.groupBy,
3858
+ date: data.date,
3859
+ accountId: data.accountId
3594
3860
  },
3595
3861
  errors: {
3596
3862
  401: 'User not authenticated'
@@ -3599,80 +3865,95 @@ export class ReportingService {
3599
3865
  }
3600
3866
 
3601
3867
  /**
3602
- * Generate portfolio snapshot
3603
- *
3604
- * Manually generate a portfolio snapshot for a specific date.
3605
- *
3606
- * **Multi-currency Support:**
3607
- * - Fetches balances grouped by currency
3608
- * - Uses user's baseCurrency setting for conversion
3609
- * - Stores exchange rates and warnings
3610
- *
3611
- * **Use Cases:**
3612
- * - Testing snapshot generation
3613
- * - Force regeneration after data correction
3614
- * - Initial setup for new users
3615
- *
3868
+ * Get cash flow summary
3869
+ * Returns income, expenses, and savings for a monthly period
3616
3870
  * @param data The data for the request.
3871
+ * @param data.period Period in YYYY-MM format
3617
3872
  * @param data.region Region code for tenant context
3618
- * @param data.requestBody Optional date (defaults to today)
3619
- * @returns GenerateSnapshotResponse Snapshot generated successfully
3873
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3620
3874
  * @throws ApiError
3621
3875
  */
3622
- public static reportingControllerGenerateSnapshot(
3623
- data: ReportingControllerGenerateSnapshotData
3624
- ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
3876
+ public static dashboardControllerGetCashFlow(
3877
+ data: DashboardControllerGetCashFlowData
3878
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3625
3879
  return __request(OpenAPI, {
3626
- method: 'POST',
3627
- url: '/api/v1/{region}/reporting/snapshots/generate',
3880
+ method: 'GET',
3881
+ url: '/api/v1/{region}/dashboard/cash-flow',
3628
3882
  path: {
3629
3883
  region: data.region
3630
3884
  },
3631
- body: data.requestBody,
3632
- mediaType: 'application/json',
3885
+ query: {
3886
+ period: data.period
3887
+ },
3633
3888
  errors: {
3634
- 400: 'Invalid date format',
3889
+ 400: 'Invalid period format',
3635
3890
  401: 'User not authenticated'
3636
3891
  }
3637
3892
  });
3638
3893
  }
3639
3894
 
3640
3895
  /**
3641
- * Backfill portfolio snapshots
3642
- *
3643
- * Generate snapshots for a date range (historical data backfill).
3644
- *
3645
- * **Multi-currency Support:**
3646
- * - Each snapshot includes multi-currency data
3647
- * - Uses exchange rates available at generation time
3648
- * - Warnings stored for missing exchange rates
3649
- *
3650
- * **Best Practices:**
3651
- * - Use for initial setup after account configuration
3652
- * - Run during low-traffic periods for large date ranges
3653
- * - Existing snapshots are skipped (not regenerated)
3654
- *
3896
+ * Get expenses/income grouped by functional category
3897
+ * 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)
3655
3898
  * @param data The data for the request.
3656
3899
  * @param data.region Region code for tenant context
3657
- * @param data.requestBody
3658
- * @returns BackfillSnapshotsResponse Backfill completed successfully
3900
+ * @param data.groupBy Grouping strategy
3901
+ * @param data.period Time window (1m = current calendar month)
3902
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
3903
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3659
3904
  * @throws ApiError
3660
3905
  */
3661
- public static reportingControllerBackfillSnapshots(
3662
- data: ReportingControllerBackfillSnapshotsData
3663
- ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
3906
+ public static dashboardControllerGetExpenses(
3907
+ data: DashboardControllerGetExpensesData
3908
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3664
3909
  return __request(OpenAPI, {
3665
- method: 'POST',
3666
- url: '/api/v1/{region}/reporting/snapshots/backfill',
3910
+ method: 'GET',
3911
+ url: '/api/v1/{region}/dashboard/expenses',
3667
3912
  path: {
3668
3913
  region: data.region
3669
3914
  },
3670
- body: data.requestBody,
3671
- mediaType: 'application/json',
3915
+ query: {
3916
+ groupBy: data.groupBy,
3917
+ period: data.period,
3918
+ flow: data.flow
3919
+ },
3672
3920
  errors: {
3673
- 400: 'Invalid date format or range',
3674
- 401: 'User not authenticated',
3675
- 409: 'Backfill already in progress for this user'
3921
+ 400: 'Invalid groupBy or period',
3922
+ 401: 'User not authenticated'
3923
+ }
3924
+ });
3925
+ }
3926
+ }
3927
+
3928
+ export class InvestmentService {
3929
+ /**
3930
+ * Get per-holding unrealized + realized P&L
3931
+ * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3932
+ * @param data The data for the request.
3933
+ * @param data.region Region code for tenant context
3934
+ * @param data.asOf As-of date (ISO 8601), defaults to today
3935
+ * @param data.accountId Scope to a single account
3936
+ * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3937
+ * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3938
+ * @throws ApiError
3939
+ */
3940
+ public static holdingPnlControllerGetHoldingPnl(
3941
+ data: HoldingPnlControllerGetHoldingPnlData
3942
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3943
+ return __request(OpenAPI, {
3944
+ method: 'GET',
3945
+ url: '/api/v1/{region}/investment/holdings/pnl',
3946
+ path: {
3947
+ region: data.region
3948
+ },
3949
+ query: {
3950
+ asOf: data.asOf,
3951
+ accountId: data.accountId,
3952
+ method: data.method
3953
+ },
3954
+ errors: {
3955
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3956
+ 401: 'User not authenticated'
3676
3957
  }
3677
3958
  });
3678
3959
  }
@@ -3701,7 +3982,7 @@ export class AuthService {
3701
3982
  * Anonymous login with access token
3702
3983
  * @param data The data for the request.
3703
3984
  * @param data.requestBody
3704
- * @returns unknown Login successful
3985
+ * @returns AnonymousLoginResponseDto Login successful
3705
3986
  * @throws ApiError
3706
3987
  */
3707
3988
  public static authControllerAccessTokenLogin(