@firela/api-types 0.0.0-canary.efc869e1 → 0.0.0-canary.f205f876

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,48 @@ import type {
97
99
  CommodityControllerGetOrCreateResponse,
98
100
  CommodityControllerBulkCreateData,
99
101
  CommodityControllerBulkCreateResponse,
102
+ ReportingControllerGetPortfolioTrendsData,
103
+ ReportingControllerGetPortfolioTrendsResponse,
104
+ ReportingControllerGetCashFlowTrendsData,
105
+ ReportingControllerGetCashFlowTrendsResponse,
106
+ ReportingControllerGenerateSnapshotData,
107
+ ReportingControllerGenerateSnapshotResponse,
108
+ ReportingControllerBackfillSnapshotsData,
109
+ ReportingControllerBackfillSnapshotsResponse,
110
+ PriceControllerCreateData,
111
+ PriceControllerCreateResponse,
112
+ PriceControllerFindAllData,
113
+ PriceControllerFindAllResponse,
114
+ PriceControllerFindOneData,
115
+ PriceControllerFindOneResponse,
116
+ PriceControllerUpdateData,
117
+ PriceControllerUpdateResponse,
118
+ PriceControllerDeleteData,
119
+ PriceControllerDeleteResponse,
120
+ PriceControllerBulkCreateData,
121
+ PriceControllerBulkCreateResponse,
122
+ UserControllerDeleteOwnUserData,
123
+ UserControllerDeleteOwnUserResponse,
124
+ UserControllerGetUserData,
125
+ UserControllerGetUserResponse,
126
+ UserControllerSignupUserData,
127
+ UserControllerSignupUserResponse,
128
+ UserControllerDeleteUserData,
129
+ UserControllerDeleteUserResponse,
130
+ UserControllerGetUserInfoData,
131
+ UserControllerGetUserInfoResponse,
132
+ UserControllerUpdateUserSettingData,
133
+ UserControllerUpdateUserSettingResponse,
134
+ UserControllerGetAllUserSettingsByPageData,
135
+ UserControllerGetAllUserSettingsByPageResponse,
136
+ UserControllerGetAssetLiabilitySummaryResponse,
137
+ PropertyControllerGetAllResponse,
138
+ PropertyControllerGetByKeyData,
139
+ PropertyControllerGetByKeyResponse,
140
+ PropertyControllerUpdateData,
141
+ PropertyControllerUpdateResponse,
142
+ PropertyControllerDeleteData,
143
+ PropertyControllerDeleteResponse,
100
144
  RecurringRuleControllerCreateData,
101
145
  RecurringRuleControllerCreateResponse,
102
146
  RecurringRuleControllerFindAllData,
@@ -149,28 +193,30 @@ import type {
149
193
  TransactionRuleControllerDeleteResponse,
150
194
  TransactionRuleControllerTestData,
151
195
  TransactionRuleControllerTestResponse,
152
- UserControllerDeleteOwnUserData,
153
- UserControllerDeleteOwnUserResponse,
154
- UserControllerGetUserData,
155
- UserControllerGetUserResponse,
156
- UserControllerSignupUserData,
157
- UserControllerSignupUserResponse,
158
- UserControllerDeleteUserData,
159
- UserControllerDeleteUserResponse,
160
- UserControllerGetUserInfoData,
161
- UserControllerGetUserInfoResponse,
162
- UserControllerUpdateUserSettingData,
163
- UserControllerUpdateUserSettingResponse,
164
- UserControllerGetAllUserSettingsByPageData,
165
- UserControllerGetAllUserSettingsByPageResponse,
166
- UserControllerGetAssetLiabilitySummaryResponse,
167
- PropertyControllerGetAllResponse,
168
- PropertyControllerGetByKeyData,
169
- PropertyControllerGetByKeyResponse,
170
- PropertyControllerUpdateData,
171
- PropertyControllerUpdateResponse,
172
- PropertyControllerDeleteData,
173
- PropertyControllerDeleteResponse,
196
+ CategoryCatalogControllerListData,
197
+ CategoryCatalogControllerListResponse,
198
+ EventControllerCreateData,
199
+ EventControllerCreateResponse,
200
+ EventControllerFindAllData,
201
+ EventControllerFindAllResponse,
202
+ EventControllerFindOneData,
203
+ EventControllerFindOneResponse,
204
+ EventControllerUpdateData,
205
+ EventControllerUpdateResponse,
206
+ EventControllerDeleteData,
207
+ EventControllerDeleteResponse,
208
+ EventControllerGetSliceData,
209
+ EventControllerGetSliceResponse,
210
+ OnboardingControllerBootstrapData,
211
+ OnboardingControllerBootstrapResponse,
212
+ ReconciliationControllerComputeData,
213
+ ReconciliationControllerComputeResponse,
214
+ ReconciliationControllerAssertData,
215
+ ReconciliationControllerAssertResponse,
216
+ ReconciliationControllerPadData,
217
+ ReconciliationControllerPadResponse,
218
+ ReconciliationControllerHistoryData,
219
+ ReconciliationControllerHistoryResponse,
174
220
  ExportControllerExportBeancountResponse,
175
221
  FileImportControllerImportFileData,
176
222
  FileImportControllerImportFileResponse,
@@ -184,22 +230,20 @@ import type {
184
230
  ImporterConfigControllerUpdateConfigResponse,
185
231
  ImporterConfigControllerResetConfigData,
186
232
  ImporterConfigControllerResetConfigResponse,
187
- PlatformControllerFindAllResponse,
188
- PlatformControllerCreateData,
189
- PlatformControllerCreateResponse,
190
- PlatformControllerGetPlatformListResponse,
191
- PlatformControllerMatchPlatformsData,
192
- PlatformControllerMatchPlatformsResponse,
193
- PlatformControllerUpdateData,
194
- PlatformControllerUpdateResponse,
195
- PlatformControllerDeleteData,
196
- PlatformControllerDeleteResponse,
197
233
  ProviderSyncControllerSyncData,
198
234
  ProviderSyncControllerSyncResponse,
199
235
  ProviderSyncControllerGetSupportedProvidersData,
200
236
  ProviderSyncControllerGetSupportedProvidersResponse,
201
237
  ProviderSyncControllerIsProviderSupportedData,
202
238
  ProviderSyncControllerIsProviderSupportedResponse,
239
+ ExternalAccountLinkControllerCreateData,
240
+ ExternalAccountLinkControllerCreateResponse,
241
+ ExternalAccountLinkControllerFindAllData,
242
+ ExternalAccountLinkControllerFindAllResponse,
243
+ ExternalAccountLinkControllerFindOneData,
244
+ ExternalAccountLinkControllerFindOneResponse,
245
+ ExternalAccountLinkControllerRemoveData,
246
+ ExternalAccountLinkControllerRemoveResponse,
203
247
  TelemetryControllerReportTelemetryData,
204
248
  TelemetryControllerReportTelemetryResponse,
205
249
  TelemetryControllerReportCoverageMissData,
@@ -212,35 +256,34 @@ import type {
212
256
  NlpControllerClearSessionResponse,
213
257
  NlpControllerGetSessionData,
214
258
  NlpControllerGetSessionResponse,
259
+ PlatformControllerFindAllResponse,
260
+ PlatformControllerCreateData,
261
+ PlatformControllerCreateResponse,
262
+ PlatformControllerGetPlatformListData,
263
+ PlatformControllerGetPlatformListResponse,
264
+ PlatformControllerMatchPlatformsData,
265
+ PlatformControllerMatchPlatformsResponse,
266
+ PlatformControllerGetPlatformStandardsData,
267
+ PlatformControllerGetPlatformStandardsResponse,
268
+ PlatformControllerUpdateData,
269
+ PlatformControllerUpdateResponse,
270
+ PlatformControllerDeleteData,
271
+ PlatformControllerDeleteResponse,
215
272
  DashboardControllerGetNetWorthData,
216
273
  DashboardControllerGetNetWorthResponse,
217
274
  DashboardControllerGetAccountsData,
218
275
  DashboardControllerGetAccountsResponse,
219
276
  DashboardControllerGetCashFlowData,
220
277
  DashboardControllerGetCashFlowResponse,
278
+ DashboardControllerGetExpensesData,
279
+ DashboardControllerGetExpensesResponse,
221
280
  HoldingPnlControllerGetHoldingPnlData,
222
281
  HoldingPnlControllerGetHoldingPnlResponse,
223
- PriceControllerCreateData,
224
- PriceControllerCreateResponse,
225
- PriceControllerFindAllData,
226
- PriceControllerFindAllResponse,
227
- PriceControllerFindOneData,
228
- PriceControllerFindOneResponse,
229
- PriceControllerUpdateData,
230
- PriceControllerUpdateResponse,
231
- PriceControllerDeleteData,
232
- PriceControllerDeleteResponse,
233
- PriceControllerBulkCreateData,
234
- PriceControllerBulkCreateResponse,
235
- ReportingControllerGetPortfolioTrendsData,
236
- ReportingControllerGetPortfolioTrendsResponse,
237
- ReportingControllerGenerateSnapshotData,
238
- ReportingControllerGenerateSnapshotResponse,
239
- ReportingControllerBackfillSnapshotsData,
240
- ReportingControllerBackfillSnapshotsResponse,
241
282
  ApiKeysControllerCreateApiKeyResponse,
242
283
  AuthControllerAccessTokenLoginData,
243
284
  AuthControllerAccessTokenLoginResponse,
285
+ ParserContributionControllerCreateData,
286
+ ParserContributionControllerCreateResponse,
244
287
  CacheControllerFlushCacheResponse,
245
288
  ExchangeRateControllerGetExchangeRateData,
246
289
  ExchangeRateControllerGetExchangeRateResponse,
@@ -252,7 +295,11 @@ import type {
252
295
  HealthControllerResetCircuitBreakerData,
253
296
  HealthControllerResetCircuitBreakerResponse,
254
297
  HealthControllerGetMetricsResponse,
255
- InfoControllerGetInfoResponse
298
+ InfoControllerGetInfoResponse,
299
+ SymbolControllerSearchData,
300
+ SymbolControllerSearchResponse,
301
+ SymbolControllerGetQuoteData,
302
+ SymbolControllerGetQuoteResponse
256
303
  } from './types.gen';
257
304
 
258
305
  export class BeanAccountsService {
@@ -290,7 +337,7 @@ export class BeanAccountsService {
290
337
  * @param data.type Filter by account type
291
338
  * @param data.status Filter by status
292
339
  * @param data.isCustom Filter by custom (user-created) accounts only
293
- * @param data.search Search term for path or i18nKey
340
+ * @param data.search Search term matched against account path and user-set display name (case-insensitive)
294
341
  * @param data.limit Maximum number of results
295
342
  * @param data.offset Number of results to skip
296
343
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -371,7 +418,7 @@ export class BeanAccountsService {
371
418
 
372
419
  /**
373
420
  * Delete account
374
- * Deletes an account (only if no transactions)
421
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
375
422
  * @param data The data for the request.
376
423
  * @param data.id Account UUID
377
424
  * @param data.region Region code for tenant context
@@ -390,7 +437,7 @@ export class BeanAccountsService {
390
437
  },
391
438
  errors: {
392
439
  404: 'Account not found',
393
- 409: 'Account has transactions and cannot be deleted'
440
+ 409: 'Account has active transactions and cannot be deleted'
394
441
  }
395
442
  });
396
443
  }
@@ -452,16 +499,45 @@ export class BeanAccountsService {
452
499
  }
453
500
  });
454
501
  }
502
+
503
+ /**
504
+ * Post an opening-balance transaction
505
+ * 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.
506
+ * @param data The data for the request.
507
+ * @param data.id Account UUID
508
+ * @param data.region Region code for tenant context
509
+ * @param data.requestBody
510
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
511
+ * @throws ApiError
512
+ */
513
+ public static accountControllerAddOpeningBalance(
514
+ data: AccountControllerAddOpeningBalanceData
515
+ ): CancelablePromise<AccountControllerAddOpeningBalanceResponse> {
516
+ return __request(OpenAPI, {
517
+ method: 'POST',
518
+ url: '/api/v1/{region}/bean/accounts/{id}/opening-balance',
519
+ path: {
520
+ id: data.id,
521
+ region: data.region
522
+ },
523
+ body: data.requestBody,
524
+ mediaType: 'application/json',
525
+ errors: {
526
+ 404: 'Account not found',
527
+ 409: 'An opening balance already exists for this account'
528
+ }
529
+ });
530
+ }
455
531
  }
456
532
 
457
533
  export class BeanAccountStandardsService {
458
534
  /**
459
535
  * Get account templates
460
- * Returns predefined account templates for a region. Supports filtering by account type and search term.
536
+ * Returns predefined account templates for a region. Supports filtering by account type and search term. Not-yet-open region codes return the universal-only catalog (#759).
461
537
  * @param data The data for the request.
462
- * @param data.region Region code (cn, us, de)
538
+ * @param data.region Region code (any ISO alpha-2; not-yet-open codes return the universal-only catalog)
463
539
  * @param data.type Filter by account type
464
- * @param data.search Search term for path or description
540
+ * @param data.search Search term for path, description, aliases, or localized display name
465
541
  * @returns AccountStandardListResponseDto Account templates retrieved successfully
466
542
  * @throws ApiError
467
543
  */
@@ -483,9 +559,9 @@ export class BeanAccountStandardsService {
483
559
 
484
560
  /**
485
561
  * Get template metadata for an account path
486
- * Returns extendable status and root type for a template path.
562
+ * Returns root type for a template path.
487
563
  * @param data The data for the request.
488
- * @param data.region Region code for tenant context
564
+ * @param data.region Region code for tenant context. Not-yet-open codes degrade to the universal-only catalog (#759)
489
565
  * @param data.path Account path to check
490
566
  * @returns TemplateMetadataResponseDto Template metadata retrieved successfully
491
567
  * @throws ApiError
@@ -507,9 +583,9 @@ export class BeanAccountStandardsService {
507
583
 
508
584
  /**
509
585
  * Get available regions with hierarchy
510
- * Returns supported regions with inheritance metadata
586
+ * Returns the full region catalog (every ISO 3166-1 entry) with an 'open' flag and inheritance metadata (#759)
511
587
  * @param data The data for the request.
512
- * @param data.region Region code for tenant context
588
+ * @param data.region Region code for tenant context. Not-yet-open codes degrade to the universal-only catalog (#759)
513
589
  * @returns RegionsMetadataResponseDto Regions metadata retrieved successfully
514
590
  * @throws ApiError
515
591
  */
@@ -566,9 +642,11 @@ export class BeanTransactionsService {
566
642
  * @param data.offset Number of items to skip (default: 0)
567
643
  * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
568
644
  * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
569
- * @param data.status Filter by transaction status
645
+ * @param data.status Filter by transaction status: single value, comma-separated multi-value (e.g. VOIDED,SUPERSEDED), or ALL to include audit rows. Defaults to ACTIVE-only (ADR-0128; previously unfiltered — breaking change).
570
646
  * @param data.search Search in narration and payee fields (max 200 chars)
571
647
  * @param data.accountId Filter by account ID (transactions with postings to this account)
648
+ * @param data.category Filter by ADR-0075 functional category (Group segment); matches any posting to an account whose derived Group segment equals this value. Must be accompanied by flow (ADR-0126).
649
+ * @param data.flow Required when category is present (400 otherwise) and vice versa (ADR-0126). Restricts the category account set to the flow root (income → Income:, expense → Expenses:) and drives the per-leg sign normalization of row viewpointAmount and the summary. OpenAPI cannot express conditional requiredness — the pairing is enforced at runtime.
572
650
  * @returns TransactionListResponseDto Transaction list
573
651
  * @throws ApiError
574
652
  */
@@ -588,7 +666,9 @@ export class BeanTransactionsService {
588
666
  dateTo: data.dateTo,
589
667
  status: data.status,
590
668
  search: data.search,
591
- accountId: data.accountId
669
+ accountId: data.accountId,
670
+ category: data.category,
671
+ flow: data.flow
592
672
  },
593
673
  errors: {
594
674
  400: 'Validation failed',
@@ -776,7 +856,7 @@ export class BeanBalancesService {
776
856
  * Query account balance
777
857
  * Calculate account balance at a specific date for a single currency
778
858
  * @param data The data for the request.
779
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
859
+ * @param data.account Account name (e.g., "Assets:Checking")
780
860
  * @param data.region Region code for tenant context
781
861
  * @param data.date Date to calculate balance at (ISO 8601 format)
782
862
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -1301,7 +1381,7 @@ export class AdminPayeeProfilesService {
1301
1381
  * Removes verification status by setting verifiedAt to null.
1302
1382
  * @param data The data for the request.
1303
1383
  * @param data.id Payee profile ID (UUID)
1304
- * @returns PayeeProfileResponseDto Payee profile unverified successfully
1384
+ * @returns void Payee profile unverified successfully
1305
1385
  * @throws ApiError
1306
1386
  */
1307
1387
  public static payeeProfileAdminControllerUnverify(
@@ -1497,111 +1577,690 @@ export class BeanCommoditiesService {
1497
1577
  }
1498
1578
  }
1499
1579
 
1500
- export class RecurringRulesService {
1580
+ export class ReportingService {
1501
1581
  /**
1502
- * Create a new recurring rule
1503
- * Creates a new recurring transaction rule for the authenticated user
1582
+ * Get portfolio value trends
1583
+ *
1584
+ * Returns time series data of portfolio net worth.
1585
+ *
1586
+ * **Multi-currency Support:**
1587
+ * - `series[].byCurrency` - Currency breakdown for each data point
1588
+ * - `byCurrency` - Separate time series grouped by currency
1589
+ * - `warnings` - Exchange rate warnings if conversion failed
1590
+ *
1591
+ * **Parameters:**
1592
+ * - `period`: Time period (1m, 3m, 6m, 1y)
1593
+ * - `granularity`: Data granularity (day, week, month)
1594
+ *
1504
1595
  * @param data The data for the request.
1505
1596
  * @param data.region Region code for tenant context
1506
- * @param data.requestBody
1507
- * @returns RecurringRuleResponseDto Rule created successfully
1597
+ * @param data.period Time period
1598
+ * @param data.granularity Data granularity
1599
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
1508
1600
  * @throws ApiError
1509
1601
  */
1510
- public static recurringRuleControllerCreate(
1511
- data: RecurringRuleControllerCreateData
1512
- ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1602
+ public static reportingControllerGetPortfolioTrends(
1603
+ data: ReportingControllerGetPortfolioTrendsData
1604
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
1513
1605
  return __request(OpenAPI, {
1514
- method: 'POST',
1515
- url: '/api/v1/{region}/bean/recurring-rules',
1606
+ method: 'GET',
1607
+ url: '/api/v1/{region}/reporting/portfolio/trends',
1516
1608
  path: {
1517
1609
  region: data.region
1518
1610
  },
1519
- body: data.requestBody,
1520
- mediaType: 'application/json',
1611
+ query: {
1612
+ period: data.period,
1613
+ granularity: data.granularity
1614
+ },
1521
1615
  errors: {
1522
- 400: 'Invalid input data (e.g., autoCreate without accounts)',
1523
- 409: 'Rule with same name already exists'
1616
+ 401: 'User not authenticated'
1524
1617
  }
1525
1618
  });
1526
1619
  }
1527
1620
 
1528
1621
  /**
1529
- * List recurring rules
1530
- * Returns all recurring rules for the authenticated user with optional filtering
1622
+ * Get cash-flow trends
1623
+ *
1624
+ * Monthly income / expense / netSavings over a fixed N-month window
1625
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
1626
+ *
1627
+ * **Parameters:**
1628
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
1629
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
1630
+ *
1531
1631
  * @param data The data for the request.
1532
1632
  * @param data.region Region code for tenant context
1533
- * @param data.isActive Filter by active status
1534
- * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1535
- * @param data.hasAutoCreate Filter by autoCreate enabled
1536
- * @returns RecurringRuleResponseDto Rules retrieved successfully
1633
+ * @param data.period Time period
1634
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
1635
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
1537
1636
  * @throws ApiError
1538
1637
  */
1539
- public static recurringRuleControllerFindAll(
1540
- data: RecurringRuleControllerFindAllData
1541
- ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1638
+ public static reportingControllerGetCashFlowTrends(
1639
+ data: ReportingControllerGetCashFlowTrendsData
1640
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
1542
1641
  return __request(OpenAPI, {
1543
1642
  method: 'GET',
1544
- url: '/api/v1/{region}/bean/recurring-rules',
1643
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
1545
1644
  path: {
1546
1645
  region: data.region
1547
1646
  },
1548
1647
  query: {
1549
- isActive: data.isActive,
1550
- frequency: data.frequency,
1551
- hasAutoCreate: data.hasAutoCreate
1648
+ period: data.period,
1649
+ granularity: data.granularity
1650
+ },
1651
+ errors: {
1652
+ 401: 'User not authenticated'
1552
1653
  }
1553
1654
  });
1554
1655
  }
1555
1656
 
1556
1657
  /**
1557
- * Create recurring rule from transaction
1558
- * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1658
+ * Generate portfolio snapshot
1659
+ *
1660
+ * Manually generate a portfolio snapshot for a specific date.
1661
+ *
1662
+ * **Multi-currency Support:**
1663
+ * - Fetches balances grouped by currency
1664
+ * - Uses user's baseCurrency setting for conversion
1665
+ * - Stores exchange rates and warnings
1666
+ *
1667
+ * **Use Cases:**
1668
+ * - Testing snapshot generation
1669
+ * - Force regeneration after data correction
1670
+ * - Initial setup for new users
1671
+ *
1559
1672
  * @param data The data for the request.
1560
- * @param data.transactionId Source transaction ID
1561
1673
  * @param data.region Region code for tenant context
1562
- * @param data.requestBody
1563
- * @returns RecurringRuleResponseDto Rule created successfully
1674
+ * @param data.requestBody Optional date (defaults to today)
1675
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
1564
1676
  * @throws ApiError
1565
1677
  */
1566
- public static recurringRuleControllerCreateFromTransaction(
1567
- data: RecurringRuleControllerCreateFromTransactionData
1568
- ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1678
+ public static reportingControllerGenerateSnapshot(
1679
+ data: ReportingControllerGenerateSnapshotData
1680
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
1569
1681
  return __request(OpenAPI, {
1570
1682
  method: 'POST',
1571
- url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1683
+ url: '/api/v1/{region}/reporting/snapshots/generate',
1572
1684
  path: {
1573
- transactionId: data.transactionId,
1574
1685
  region: data.region
1575
1686
  },
1576
1687
  body: data.requestBody,
1577
1688
  mediaType: 'application/json',
1578
1689
  errors: {
1579
- 404: 'Transaction not found',
1580
- 409: 'Rule with same name already exists or transaction already linked'
1690
+ 400: 'Invalid date format',
1691
+ 401: 'User not authenticated'
1581
1692
  }
1582
1693
  });
1583
1694
  }
1584
1695
 
1585
1696
  /**
1586
- * Get recurring rule by ID
1587
- * Returns a specific recurring rule with its details
1697
+ * Backfill portfolio snapshots
1698
+ *
1699
+ * Generate snapshots for a date range (historical data backfill).
1700
+ *
1701
+ * **Multi-currency Support:**
1702
+ * - Each snapshot includes multi-currency data
1703
+ * - Uses exchange rates available at generation time
1704
+ * - Warnings stored for missing exchange rates
1705
+ *
1706
+ * **Best Practices:**
1707
+ * - Use for initial setup after account configuration
1708
+ * - Run during low-traffic periods for large date ranges
1709
+ * - Existing snapshots are skipped (not regenerated)
1710
+ *
1588
1711
  * @param data The data for the request.
1589
- * @param data.id Rule ID
1590
1712
  * @param data.region Region code for tenant context
1591
- * @returns RecurringRuleResponseDto Rule retrieved successfully
1713
+ * @param data.requestBody
1714
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
1592
1715
  * @throws ApiError
1593
1716
  */
1594
- public static recurringRuleControllerFindOne(
1595
- data: RecurringRuleControllerFindOneData
1596
- ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1717
+ public static reportingControllerBackfillSnapshots(
1718
+ data: ReportingControllerBackfillSnapshotsData
1719
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
1597
1720
  return __request(OpenAPI, {
1598
- method: 'GET',
1599
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1721
+ method: 'POST',
1722
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
1600
1723
  path: {
1601
- id: data.id,
1602
1724
  region: data.region
1603
1725
  },
1604
- errors: {
1726
+ body: data.requestBody,
1727
+ mediaType: 'application/json',
1728
+ errors: {
1729
+ 400: 'Invalid date format or range',
1730
+ 401: 'User not authenticated',
1731
+ 409: 'Backfill already in progress for this user'
1732
+ }
1733
+ });
1734
+ }
1735
+ }
1736
+
1737
+ export class BeanPricesService {
1738
+ /**
1739
+ * Create a new price
1740
+ * Creates a new price entry for the authenticated user
1741
+ * @param data The data for the request.
1742
+ * @param data.region Region code for tenant context
1743
+ * @param data.requestBody
1744
+ * @returns PriceResponseDto Price created successfully
1745
+ * @throws ApiError
1746
+ */
1747
+ public static priceControllerCreate(
1748
+ data: PriceControllerCreateData
1749
+ ): CancelablePromise<PriceControllerCreateResponse> {
1750
+ return __request(OpenAPI, {
1751
+ method: 'POST',
1752
+ url: '/api/v1/{region}/bean/prices',
1753
+ path: {
1754
+ region: data.region
1755
+ },
1756
+ body: data.requestBody,
1757
+ mediaType: 'application/json',
1758
+ errors: {
1759
+ 404: 'Currency or quoteCurrency commodity not found',
1760
+ 409: 'Price already exists for this currency pair and date'
1761
+ }
1762
+ });
1763
+ }
1764
+
1765
+ /**
1766
+ * List user prices
1767
+ * Returns all price entries for the authenticated user with optional filtering
1768
+ * @param data The data for the request.
1769
+ * @param data.region Region code for tenant context
1770
+ * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
1771
+ * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
1772
+ * @param data.dateFrom Filter prices from this date (ISO 8601 format)
1773
+ * @param data.dateTo Filter prices to this date (ISO 8601 format)
1774
+ * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
1775
+ * @param data.page Page number for pagination (default: 1)
1776
+ * @param data.limit Number of items per page (default: 20, max: 100)
1777
+ * @returns PriceListResponseDto Prices retrieved successfully
1778
+ * @throws ApiError
1779
+ */
1780
+ public static priceControllerFindAll(
1781
+ data: PriceControllerFindAllData
1782
+ ): CancelablePromise<PriceControllerFindAllResponse> {
1783
+ return __request(OpenAPI, {
1784
+ method: 'GET',
1785
+ url: '/api/v1/{region}/bean/prices',
1786
+ path: {
1787
+ region: data.region
1788
+ },
1789
+ query: {
1790
+ currency: data.currency,
1791
+ quoteCurrency: data.quoteCurrency,
1792
+ dateFrom: data.dateFrom,
1793
+ dateTo: data.dateTo,
1794
+ search: data.search,
1795
+ page: data.page,
1796
+ limit: data.limit
1797
+ }
1798
+ });
1799
+ }
1800
+
1801
+ /**
1802
+ * Get price by ID
1803
+ * Returns a single price entry by its ID
1804
+ * @param data The data for the request.
1805
+ * @param data.id Price ID
1806
+ * @param data.region Region code for tenant context
1807
+ * @returns PriceResponseDto Price retrieved successfully
1808
+ * @throws ApiError
1809
+ */
1810
+ public static priceControllerFindOne(
1811
+ data: PriceControllerFindOneData
1812
+ ): CancelablePromise<PriceControllerFindOneResponse> {
1813
+ return __request(OpenAPI, {
1814
+ method: 'GET',
1815
+ url: '/api/v1/{region}/bean/prices/{id}',
1816
+ path: {
1817
+ id: data.id,
1818
+ region: data.region
1819
+ },
1820
+ errors: {
1821
+ 404: 'Price not found'
1822
+ }
1823
+ });
1824
+ }
1825
+
1826
+ /**
1827
+ * Update a price
1828
+ * Updates an existing price entry
1829
+ * @param data The data for the request.
1830
+ * @param data.id Price ID
1831
+ * @param data.region Region code for tenant context
1832
+ * @param data.requestBody
1833
+ * @returns PriceResponseDto Price updated successfully
1834
+ * @throws ApiError
1835
+ */
1836
+ public static priceControllerUpdate(
1837
+ data: PriceControllerUpdateData
1838
+ ): CancelablePromise<PriceControllerUpdateResponse> {
1839
+ return __request(OpenAPI, {
1840
+ method: 'PUT',
1841
+ url: '/api/v1/{region}/bean/prices/{id}',
1842
+ path: {
1843
+ id: data.id,
1844
+ region: data.region
1845
+ },
1846
+ body: data.requestBody,
1847
+ mediaType: 'application/json',
1848
+ errors: {
1849
+ 404: 'Price not found',
1850
+ 409: 'Updated price conflicts with existing price'
1851
+ }
1852
+ });
1853
+ }
1854
+
1855
+ /**
1856
+ * Delete a price
1857
+ * Deletes a price entry (hard delete)
1858
+ * @param data The data for the request.
1859
+ * @param data.id Price ID
1860
+ * @param data.region Region code for tenant context
1861
+ * @returns void Price deleted successfully
1862
+ * @throws ApiError
1863
+ */
1864
+ public static priceControllerDelete(
1865
+ data: PriceControllerDeleteData
1866
+ ): CancelablePromise<PriceControllerDeleteResponse> {
1867
+ return __request(OpenAPI, {
1868
+ method: 'DELETE',
1869
+ url: '/api/v1/{region}/bean/prices/{id}',
1870
+ path: {
1871
+ id: data.id,
1872
+ region: data.region
1873
+ },
1874
+ errors: {
1875
+ 404: 'Price not found'
1876
+ }
1877
+ });
1878
+ }
1879
+
1880
+ /**
1881
+ * Bulk create prices
1882
+ * Creates multiple price entries at once (skips duplicates)
1883
+ * @param data The data for the request.
1884
+ * @param data.region Region code for tenant context
1885
+ * @param data.requestBody
1886
+ * @returns PriceResponseDto Prices created successfully
1887
+ * @throws ApiError
1888
+ */
1889
+ public static priceControllerBulkCreate(
1890
+ data: PriceControllerBulkCreateData
1891
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
1892
+ return __request(OpenAPI, {
1893
+ method: 'POST',
1894
+ url: '/api/v1/{region}/bean/prices/bulk',
1895
+ path: {
1896
+ region: data.region
1897
+ },
1898
+ body: data.requestBody,
1899
+ mediaType: 'application/json'
1900
+ });
1901
+ }
1902
+ }
1903
+
1904
+ export class UsersService {
1905
+ /**
1906
+ * Delete own user account
1907
+ * @param data The data for the request.
1908
+ * @param data.requestBody
1909
+ * @returns void User deleted successfully
1910
+ * @throws ApiError
1911
+ */
1912
+ public static userControllerDeleteOwnUser(
1913
+ data: UserControllerDeleteOwnUserData
1914
+ ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
1915
+ return __request(OpenAPI, {
1916
+ method: 'DELETE',
1917
+ url: '/api/v1/users',
1918
+ body: data.requestBody,
1919
+ mediaType: 'application/json',
1920
+ errors: {
1921
+ 403: 'Invalid access token'
1922
+ }
1923
+ });
1924
+ }
1925
+
1926
+ /**
1927
+ * Get current authenticated user
1928
+ * @param data The data for the request.
1929
+ * @param data.acceptLanguage
1930
+ * @returns UserResponseDto User retrieved successfully
1931
+ * @throws ApiError
1932
+ */
1933
+ public static userControllerGetUser(
1934
+ data: UserControllerGetUserData
1935
+ ): CancelablePromise<UserControllerGetUserResponse> {
1936
+ return __request(OpenAPI, {
1937
+ method: 'GET',
1938
+ url: '/api/v1/users',
1939
+ headers: {
1940
+ 'accept-language': data.acceptLanguage
1941
+ }
1942
+ });
1943
+ }
1944
+
1945
+ /**
1946
+ * Sign up new user
1947
+ * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
1948
+ * @param data The data for the request.
1949
+ * @param data.requestBody
1950
+ * @returns SignupResponseDto User created successfully
1951
+ * @throws ApiError
1952
+ */
1953
+ public static userControllerSignupUser(
1954
+ data: UserControllerSignupUserData
1955
+ ): CancelablePromise<UserControllerSignupUserResponse> {
1956
+ return __request(OpenAPI, {
1957
+ method: 'POST',
1958
+ url: '/api/v1/users',
1959
+ body: data.requestBody,
1960
+ mediaType: 'application/json',
1961
+ errors: {
1962
+ 400: 'Invalid Turnstile token (when Turnstile is enabled)',
1963
+ 403: 'User signup is disabled'
1964
+ }
1965
+ });
1966
+ }
1967
+
1968
+ /**
1969
+ * Delete user by ID (admin only)
1970
+ * @param data The data for the request.
1971
+ * @param data.id User ID to delete
1972
+ * @returns void User deleted successfully
1973
+ * @throws ApiError
1974
+ */
1975
+ public static userControllerDeleteUser(
1976
+ data: UserControllerDeleteUserData
1977
+ ): CancelablePromise<UserControllerDeleteUserResponse> {
1978
+ return __request(OpenAPI, {
1979
+ method: 'DELETE',
1980
+ url: '/api/v1/users/{id}',
1981
+ path: {
1982
+ id: data.id
1983
+ },
1984
+ errors: {
1985
+ 403: 'Cannot delete own account or insufficient permissions'
1986
+ }
1987
+ });
1988
+ }
1989
+
1990
+ /**
1991
+ * Get user info by user ID
1992
+ * @param data The data for the request.
1993
+ * @param data.id User ID
1994
+ * @returns unknown User info retrieved successfully
1995
+ * @throws ApiError
1996
+ */
1997
+ public static userControllerGetUserInfo(
1998
+ data: UserControllerGetUserInfoData
1999
+ ): CancelablePromise<UserControllerGetUserInfoResponse> {
2000
+ return __request(OpenAPI, {
2001
+ method: 'GET',
2002
+ url: '/api/v1/users/{id}/info',
2003
+ path: {
2004
+ id: data.id
2005
+ },
2006
+ errors: {
2007
+ 403: 'Cannot access other user info without admin permission'
2008
+ }
2009
+ });
2010
+ }
2011
+
2012
+ /**
2013
+ * Update user settings
2014
+ * @param data The data for the request.
2015
+ * @param data.requestBody
2016
+ * @returns unknown Settings updated successfully
2017
+ * @throws ApiError
2018
+ */
2019
+ public static userControllerUpdateUserSetting(
2020
+ data: UserControllerUpdateUserSettingData
2021
+ ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
2022
+ return __request(OpenAPI, {
2023
+ method: 'PUT',
2024
+ url: '/api/v1/users/setting',
2025
+ body: data.requestBody,
2026
+ mediaType: 'application/json',
2027
+ errors: {
2028
+ 403: 'Insufficient permissions'
2029
+ }
2030
+ });
2031
+ }
2032
+
2033
+ /**
2034
+ * Get all user settings paginated (admin only)
2035
+ * @param data The data for the request.
2036
+ * @param data.pageNo Page number
2037
+ * @param data.pageSize Page size
2038
+ * @returns unknown Settings list retrieved successfully
2039
+ * @throws ApiError
2040
+ */
2041
+ public static userControllerGetAllUserSettingsByPage(
2042
+ data: UserControllerGetAllUserSettingsByPageData
2043
+ ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
2044
+ return __request(OpenAPI, {
2045
+ method: 'GET',
2046
+ url: '/api/v1/users/settings-by-page',
2047
+ query: {
2048
+ pageNo: data.pageNo,
2049
+ pageSize: data.pageSize
2050
+ }
2051
+ });
2052
+ }
2053
+
2054
+ /**
2055
+ * Get asset and liability summary for current user
2056
+ * @returns unknown Summary retrieved successfully
2057
+ * @throws ApiError
2058
+ */
2059
+ public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
2060
+ return __request(OpenAPI, {
2061
+ method: 'GET',
2062
+ url: '/api/v1/users/asset-liability-summary'
2063
+ });
2064
+ }
2065
+ }
2066
+
2067
+ export class PropertiesService {
2068
+ /**
2069
+ * Get all system properties
2070
+ * @returns unknown Properties retrieved successfully
2071
+ * @throws ApiError
2072
+ */
2073
+ public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
2074
+ return __request(OpenAPI, {
2075
+ method: 'GET',
2076
+ url: '/api/v1/admin/properties',
2077
+ errors: {
2078
+ 401: 'Unauthorized',
2079
+ 403: 'Forbidden - insufficient permissions'
2080
+ }
2081
+ });
2082
+ }
2083
+
2084
+ /**
2085
+ * Get property by key
2086
+ * @param data The data for the request.
2087
+ * @param data.key Property key
2088
+ * @returns unknown Property retrieved successfully
2089
+ * @throws ApiError
2090
+ */
2091
+ public static propertyControllerGetByKey(
2092
+ data: PropertyControllerGetByKeyData
2093
+ ): CancelablePromise<PropertyControllerGetByKeyResponse> {
2094
+ return __request(OpenAPI, {
2095
+ method: 'GET',
2096
+ url: '/api/v1/admin/properties/{key}',
2097
+ path: {
2098
+ key: data.key
2099
+ },
2100
+ errors: {
2101
+ 401: 'Unauthorized',
2102
+ 403: 'Forbidden - insufficient permissions',
2103
+ 404: 'Property not found'
2104
+ }
2105
+ });
2106
+ }
2107
+
2108
+ /**
2109
+ * Update a system property
2110
+ * @param data The data for the request.
2111
+ * @param data.key Property key
2112
+ * @param data.requestBody
2113
+ * @returns unknown Property updated successfully
2114
+ * @throws ApiError
2115
+ */
2116
+ public static propertyControllerUpdate(
2117
+ data: PropertyControllerUpdateData
2118
+ ): CancelablePromise<PropertyControllerUpdateResponse> {
2119
+ return __request(OpenAPI, {
2120
+ method: 'PUT',
2121
+ url: '/api/v1/admin/properties/{key}',
2122
+ path: {
2123
+ key: data.key
2124
+ },
2125
+ body: data.requestBody,
2126
+ mediaType: 'application/json',
2127
+ errors: {
2128
+ 401: 'Unauthorized',
2129
+ 403: 'Forbidden - insufficient permissions'
2130
+ }
2131
+ });
2132
+ }
2133
+
2134
+ /**
2135
+ * Delete a system property
2136
+ * @param data The data for the request.
2137
+ * @param data.key Property key
2138
+ * @returns void Property deleted successfully
2139
+ * @throws ApiError
2140
+ */
2141
+ public static propertyControllerDelete(
2142
+ data: PropertyControllerDeleteData
2143
+ ): CancelablePromise<PropertyControllerDeleteResponse> {
2144
+ return __request(OpenAPI, {
2145
+ method: 'DELETE',
2146
+ url: '/api/v1/admin/properties/{key}',
2147
+ path: {
2148
+ key: data.key
2149
+ },
2150
+ errors: {
2151
+ 401: 'Unauthorized',
2152
+ 403: 'Forbidden - insufficient permissions',
2153
+ 404: 'Property not found'
2154
+ }
2155
+ });
2156
+ }
2157
+ }
2158
+
2159
+ export class RecurringRulesService {
2160
+ /**
2161
+ * Create a new recurring rule
2162
+ * Creates a new recurring transaction rule for the authenticated user
2163
+ * @param data The data for the request.
2164
+ * @param data.region Region code for tenant context
2165
+ * @param data.requestBody
2166
+ * @returns RecurringRuleResponseDto Rule created successfully
2167
+ * @throws ApiError
2168
+ */
2169
+ public static recurringRuleControllerCreate(
2170
+ data: RecurringRuleControllerCreateData
2171
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
2172
+ return __request(OpenAPI, {
2173
+ method: 'POST',
2174
+ url: '/api/v1/{region}/bean/recurring-rules',
2175
+ path: {
2176
+ region: data.region
2177
+ },
2178
+ body: data.requestBody,
2179
+ mediaType: 'application/json',
2180
+ errors: {
2181
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
2182
+ 409: 'Rule with same name already exists'
2183
+ }
2184
+ });
2185
+ }
2186
+
2187
+ /**
2188
+ * List recurring rules
2189
+ * Returns all recurring rules for the authenticated user with optional filtering
2190
+ * @param data The data for the request.
2191
+ * @param data.region Region code for tenant context
2192
+ * @param data.isActive Filter by active status
2193
+ * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
2194
+ * @param data.hasAutoCreate Filter by autoCreate enabled
2195
+ * @returns RecurringRuleResponseDto Rules retrieved successfully
2196
+ * @throws ApiError
2197
+ */
2198
+ public static recurringRuleControllerFindAll(
2199
+ data: RecurringRuleControllerFindAllData
2200
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
2201
+ return __request(OpenAPI, {
2202
+ method: 'GET',
2203
+ url: '/api/v1/{region}/bean/recurring-rules',
2204
+ path: {
2205
+ region: data.region
2206
+ },
2207
+ query: {
2208
+ isActive: data.isActive,
2209
+ frequency: data.frequency,
2210
+ hasAutoCreate: data.hasAutoCreate
2211
+ }
2212
+ });
2213
+ }
2214
+
2215
+ /**
2216
+ * Create recurring rule from transaction
2217
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
2218
+ * @param data The data for the request.
2219
+ * @param data.transactionId Source transaction ID
2220
+ * @param data.region Region code for tenant context
2221
+ * @param data.requestBody
2222
+ * @returns RecurringRuleResponseDto Rule created successfully
2223
+ * @throws ApiError
2224
+ */
2225
+ public static recurringRuleControllerCreateFromTransaction(
2226
+ data: RecurringRuleControllerCreateFromTransactionData
2227
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
2228
+ return __request(OpenAPI, {
2229
+ method: 'POST',
2230
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
2231
+ path: {
2232
+ transactionId: data.transactionId,
2233
+ region: data.region
2234
+ },
2235
+ body: data.requestBody,
2236
+ mediaType: 'application/json',
2237
+ errors: {
2238
+ 404: 'Transaction not found',
2239
+ 409: 'Rule with same name already exists or transaction already linked'
2240
+ }
2241
+ });
2242
+ }
2243
+
2244
+ /**
2245
+ * Get recurring rule by ID
2246
+ * Returns a specific recurring rule with its details
2247
+ * @param data The data for the request.
2248
+ * @param data.id Rule ID
2249
+ * @param data.region Region code for tenant context
2250
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
2251
+ * @throws ApiError
2252
+ */
2253
+ public static recurringRuleControllerFindOne(
2254
+ data: RecurringRuleControllerFindOneData
2255
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
2256
+ return __request(OpenAPI, {
2257
+ method: 'GET',
2258
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
2259
+ path: {
2260
+ id: data.id,
2261
+ region: data.region
2262
+ },
2263
+ errors: {
1605
2264
  404: 'Rule not found'
1606
2265
  }
1607
2266
  });
@@ -1795,7 +2454,7 @@ export class ExpectedTransactionsService {
1795
2454
  * @param data The data for the request.
1796
2455
  * @param data.id Expected transaction ID
1797
2456
  * @param data.region Region code for tenant context
1798
- * @returns ExpectedTransactionResponseDto Skip undone successfully
2457
+ * @returns void Skip undone successfully
1799
2458
  * @throws ApiError
1800
2459
  */
1801
2460
  public static expectedTransactionControllerUndoSkip(
@@ -1851,7 +2510,7 @@ export class ExpectedTransactionsService {
1851
2510
  * @param data The data for the request.
1852
2511
  * @param data.id Expected transaction ID
1853
2512
  * @param data.region Region code for tenant context
1854
- * @returns unknown Match removed successfully
2513
+ * @returns void Match removed successfully
1855
2514
  * @throws ApiError
1856
2515
  */
1857
2516
  public static expectedTransactionControllerUnmatch(
@@ -2205,256 +2864,337 @@ export class BeanTransactionRulesService {
2205
2864
  }
2206
2865
  }
2207
2866
 
2208
- export class UsersService {
2867
+ export class BeanCategoryCatalogService {
2209
2868
  /**
2210
- * Delete own user account
2869
+ * List category catalog for a region
2870
+ * Returns the region-scoped category slugs (expense/income/investment/banking/transfer/payment) for the NLP result picker, each with the categoryAccount paths the region-enabled system rules map it to (#816). CN-exclusive payment instruments (huabei/baitiao) appear only under /cn.
2211
2871
  * @param data The data for the request.
2212
- * @param data.requestBody
2213
- * @returns void User deleted successfully
2872
+ * @param data.region Region code for tenant context
2873
+ * @param data.scenario Filter by scenario
2874
+ * @param data.routeBearing Filter by routeBearing (entity-router route() consumes it)
2875
+ * @returns CategoryCatalogListResponseDto Category catalog retrieved successfully
2214
2876
  * @throws ApiError
2215
2877
  */
2216
- public static userControllerDeleteOwnUser(
2217
- data: UserControllerDeleteOwnUserData
2218
- ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
2878
+ public static categoryCatalogControllerList(
2879
+ data: CategoryCatalogControllerListData
2880
+ ): CancelablePromise<CategoryCatalogControllerListResponse> {
2219
2881
  return __request(OpenAPI, {
2220
- method: 'DELETE',
2221
- url: '/api/v1/users',
2222
- body: data.requestBody,
2223
- mediaType: 'application/json',
2224
- errors: {
2225
- 403: 'Invalid access token'
2882
+ method: 'GET',
2883
+ url: '/api/v1/{region}/bean/categories',
2884
+ path: {
2885
+ region: data.region
2886
+ },
2887
+ query: {
2888
+ scenario: data.scenario,
2889
+ routeBearing: data.routeBearing
2226
2890
  }
2227
2891
  });
2228
2892
  }
2893
+ }
2229
2894
 
2895
+ export class LifeEventsService {
2230
2896
  /**
2231
- * Get current authenticated user
2897
+ * Create a new life event
2898
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2232
2899
  * @param data The data for the request.
2233
- * @param data.acceptLanguage
2234
- * @returns unknown User retrieved successfully
2900
+ * @param data.region Region code for tenant context (decorative for life events)
2901
+ * @param data.requestBody
2902
+ * @returns EventResponseDto Life event created successfully
2235
2903
  * @throws ApiError
2236
2904
  */
2237
- public static userControllerGetUser(
2238
- data: UserControllerGetUserData
2239
- ): CancelablePromise<UserControllerGetUserResponse> {
2905
+ public static eventControllerCreate(
2906
+ data: EventControllerCreateData
2907
+ ): CancelablePromise<EventControllerCreateResponse> {
2240
2908
  return __request(OpenAPI, {
2241
- method: 'GET',
2242
- url: '/api/v1/users',
2243
- headers: {
2244
- 'accept-language': data.acceptLanguage
2909
+ method: 'POST',
2910
+ url: '/api/v1/{region}/bean/events',
2911
+ path: {
2912
+ region: data.region
2913
+ },
2914
+ body: data.requestBody,
2915
+ mediaType: 'application/json',
2916
+ errors: {
2917
+ 409: 'Life event already exists for this (userId, type, date) combination'
2245
2918
  }
2246
2919
  });
2247
2920
  }
2248
2921
 
2249
2922
  /**
2250
- * Sign up new user
2251
- * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2923
+ * List user life events
2924
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2252
2925
  * @param data The data for the request.
2253
- * @param data.requestBody
2254
- * @returns unknown User created successfully
2926
+ * @param data.region Region code for tenant context (decorative for life events)
2927
+ * @param data.type Filter by life event type (exact match)
2928
+ * @param data.q Search term for description (case-insensitive partial match)
2929
+ * @param data.from Filter life events from this date (ISO 8601 format)
2930
+ * @param data.to Filter life events to this date (ISO 8601 format)
2931
+ * @param data.page Page number for pagination (default: 1)
2932
+ * @param data.limit Number of items per page (default: 20, max: 100)
2933
+ * @returns EventListResponseDto Life events retrieved successfully
2255
2934
  * @throws ApiError
2256
2935
  */
2257
- public static userControllerSignupUser(
2258
- data: UserControllerSignupUserData
2259
- ): CancelablePromise<UserControllerSignupUserResponse> {
2936
+ public static eventControllerFindAll(
2937
+ data: EventControllerFindAllData
2938
+ ): CancelablePromise<EventControllerFindAllResponse> {
2260
2939
  return __request(OpenAPI, {
2261
- method: 'POST',
2262
- url: '/api/v1/users',
2263
- body: data.requestBody,
2264
- mediaType: 'application/json',
2265
- errors: {
2266
- 400: 'Invalid Turnstile token (when Turnstile is enabled)',
2267
- 403: 'User signup is disabled'
2940
+ method: 'GET',
2941
+ url: '/api/v1/{region}/bean/events',
2942
+ path: {
2943
+ region: data.region
2944
+ },
2945
+ query: {
2946
+ type: data.type,
2947
+ q: data.q,
2948
+ from: data.from,
2949
+ to: data.to,
2950
+ page: data.page,
2951
+ limit: data.limit
2268
2952
  }
2269
2953
  });
2270
2954
  }
2271
2955
 
2272
2956
  /**
2273
- * Delete user by ID (admin only)
2957
+ * Get life event by ID
2958
+ * Returns a single life event by its ID. Returns ETag header.
2274
2959
  * @param data The data for the request.
2275
- * @param data.id User ID to delete
2276
- * @returns void User deleted successfully
2960
+ * @param data.id Life event ID
2961
+ * @param data.region Region code for tenant context (decorative for life events)
2962
+ * @returns EventResponseDto Life event retrieved successfully
2277
2963
  * @throws ApiError
2278
2964
  */
2279
- public static userControllerDeleteUser(
2280
- data: UserControllerDeleteUserData
2281
- ): CancelablePromise<UserControllerDeleteUserResponse> {
2965
+ public static eventControllerFindOne(
2966
+ data: EventControllerFindOneData
2967
+ ): CancelablePromise<EventControllerFindOneResponse> {
2282
2968
  return __request(OpenAPI, {
2283
- method: 'DELETE',
2284
- url: '/api/v1/users/{id}',
2969
+ method: 'GET',
2970
+ url: '/api/v1/{region}/bean/events/{id}',
2285
2971
  path: {
2286
- id: data.id
2972
+ id: data.id,
2973
+ region: data.region
2287
2974
  },
2288
2975
  errors: {
2289
- 403: 'Cannot delete own account or insufficient permissions'
2976
+ 404: 'Life event not found'
2290
2977
  }
2291
2978
  });
2292
2979
  }
2293
2980
 
2294
2981
  /**
2295
- * Get user info by user ID
2982
+ * Update a life event
2983
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2296
2984
  * @param data The data for the request.
2297
- * @param data.id User ID
2298
- * @returns unknown User info retrieved successfully
2985
+ * @param data.id Life event ID
2986
+ * @param data.region Region code for tenant context (decorative for life events)
2987
+ * @param data.requestBody
2988
+ * @returns EventResponseDto Life event updated successfully
2299
2989
  * @throws ApiError
2300
2990
  */
2301
- public static userControllerGetUserInfo(
2302
- data: UserControllerGetUserInfoData
2303
- ): CancelablePromise<UserControllerGetUserInfoResponse> {
2991
+ public static eventControllerUpdate(
2992
+ data: EventControllerUpdateData
2993
+ ): CancelablePromise<EventControllerUpdateResponse> {
2304
2994
  return __request(OpenAPI, {
2305
- method: 'GET',
2306
- url: '/api/v1/users/{id}/info',
2995
+ method: 'PUT',
2996
+ url: '/api/v1/{region}/bean/events/{id}',
2307
2997
  path: {
2308
- id: data.id
2998
+ id: data.id,
2999
+ region: data.region
2309
3000
  },
3001
+ body: data.requestBody,
3002
+ mediaType: 'application/json',
2310
3003
  errors: {
2311
- 403: 'Cannot access other user info without admin permission'
3004
+ 400: 'If-Match header is not a valid ISO 8601 date',
3005
+ 404: 'Life event not found',
3006
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
3007
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2312
3008
  }
2313
3009
  });
2314
3010
  }
2315
3011
 
2316
3012
  /**
2317
- * Update user settings
3013
+ * Delete a life event
3014
+ * Deletes a life event entry (hard delete). Returns 204.
2318
3015
  * @param data The data for the request.
2319
- * @param data.requestBody
2320
- * @returns unknown Settings updated successfully
3016
+ * @param data.id Life event ID
3017
+ * @param data.region Region code for tenant context (decorative for life events)
3018
+ * @returns void Life event deleted successfully
2321
3019
  * @throws ApiError
2322
3020
  */
2323
- public static userControllerUpdateUserSetting(
2324
- data: UserControllerUpdateUserSettingData
2325
- ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
3021
+ public static eventControllerDelete(
3022
+ data: EventControllerDeleteData
3023
+ ): CancelablePromise<EventControllerDeleteResponse> {
2326
3024
  return __request(OpenAPI, {
2327
- method: 'PUT',
2328
- url: '/api/v1/users/setting',
2329
- body: data.requestBody,
2330
- mediaType: 'application/json',
3025
+ method: 'DELETE',
3026
+ url: '/api/v1/{region}/bean/events/{id}',
3027
+ path: {
3028
+ id: data.id,
3029
+ region: data.region
3030
+ },
2331
3031
  errors: {
2332
- 403: 'Insufficient permissions'
3032
+ 404: 'Life event not found'
2333
3033
  }
2334
3034
  });
2335
3035
  }
2336
3036
 
2337
3037
  /**
2338
- * Get all user settings paginated (admin only)
3038
+ * Slice time-series by a life event (Phase 79)
3039
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
2339
3040
  * @param data The data for the request.
2340
- * @param data.pageNo Page number
2341
- * @param data.pageSize Page size
2342
- * @returns unknown Settings list retrieved successfully
3041
+ * @param data.id Life event ID
3042
+ * @param data.accountPattern
3043
+ * @param data.granularity
3044
+ * @param data.region Region code for tenant context (decorative for life events)
3045
+ * @returns unknown Time-series sliced by the life event range
2343
3046
  * @throws ApiError
2344
3047
  */
2345
- public static userControllerGetAllUserSettingsByPage(
2346
- data: UserControllerGetAllUserSettingsByPageData
2347
- ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
3048
+ public static eventControllerGetSlice(
3049
+ data: EventControllerGetSliceData
3050
+ ): CancelablePromise<EventControllerGetSliceResponse> {
2348
3051
  return __request(OpenAPI, {
2349
3052
  method: 'GET',
2350
- url: '/api/v1/users/settings-by-page',
3053
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3054
+ path: {
3055
+ id: data.id,
3056
+ region: data.region
3057
+ },
2351
3058
  query: {
2352
- pageNo: data.pageNo,
2353
- pageSize: data.pageSize
3059
+ accountPattern: data.accountPattern,
3060
+ granularity: data.granularity
3061
+ },
3062
+ errors: {
3063
+ 400: 'accountPattern query param is empty',
3064
+ 404: 'Life event not found'
2354
3065
  }
2355
3066
  });
2356
3067
  }
3068
+ }
2357
3069
 
3070
+ export class OnboardingService {
2358
3071
  /**
2359
- * Get asset and liability summary for current user
2360
- * @returns unknown Summary retrieved successfully
3072
+ * Bootstrap core accounts + register asset accounts with opening balances (ADR-0113)
3073
+ * @param data The data for the request.
3074
+ * @param data.region Region code for tenant context. Not-yet-open codes are accepted: the universal catalog backs onboarding regardless of region (#759)
3075
+ * @param data.requestBody
3076
+ * @returns unknown Onboarding bootstrap result.
2361
3077
  * @throws ApiError
2362
3078
  */
2363
- public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
3079
+ public static onboardingControllerBootstrap(
3080
+ data: OnboardingControllerBootstrapData
3081
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
2364
3082
  return __request(OpenAPI, {
2365
- method: 'GET',
2366
- url: '/api/v1/users/asset-liability-summary'
3083
+ method: 'POST',
3084
+ url: '/api/v1/{region}/bean/onboarding',
3085
+ path: {
3086
+ region: data.region
3087
+ },
3088
+ body: data.requestBody,
3089
+ mediaType: 'application/json',
3090
+ errors: {
3091
+ 422: 'Invalid region/account path/duplicate paths.'
3092
+ }
2367
3093
  });
2368
3094
  }
2369
3095
  }
2370
3096
 
2371
- export class PropertiesService {
3097
+ export class BalanceReconciliationService {
2372
3098
  /**
2373
- * Get all system properties
2374
- * @returns unknown Properties retrieved successfully
3099
+ * Preview reconciliation (book vs actual)
3100
+ * Computes book balance, diff, Beancount-inferred tolerance, and suggested action without persisting.
3101
+ * @param data The data for the request.
3102
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3103
+ * @param data.requestBody
3104
+ * @returns ReconciliationComputeResultDto Reconciliation preview
2375
3105
  * @throws ApiError
2376
3106
  */
2377
- public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
3107
+ public static reconciliationControllerCompute(
3108
+ data: ReconciliationControllerComputeData
3109
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
2378
3110
  return __request(OpenAPI, {
2379
- method: 'GET',
2380
- url: '/api/v1/admin/properties',
3111
+ method: 'POST',
3112
+ url: '/api/v1/{region}/bean/reconciliations',
3113
+ path: {
3114
+ region: data.region
3115
+ },
3116
+ body: data.requestBody,
3117
+ mediaType: 'application/json',
2381
3118
  errors: {
2382
- 401: 'Unauthorized',
2383
- 403: 'Forbidden - insufficient permissions'
3119
+ 404: 'Account not found'
2384
3120
  }
2385
3121
  });
2386
3122
  }
2387
3123
 
2388
3124
  /**
2389
- * Get property by key
3125
+ * Record a balance assertion
3126
+ * Persists the reconciliation as a BeanBalance assertion (amount = actual, diffAmount = book − actual). Re-reconciling the same day/currency upserts.
2390
3127
  * @param data The data for the request.
2391
- * @param data.key Property key
2392
- * @returns unknown Property retrieved successfully
3128
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3129
+ * @param data.requestBody
3130
+ * @returns ReconciliationRecordDto Balance assertion recorded
2393
3131
  * @throws ApiError
2394
3132
  */
2395
- public static propertyControllerGetByKey(
2396
- data: PropertyControllerGetByKeyData
2397
- ): CancelablePromise<PropertyControllerGetByKeyResponse> {
3133
+ public static reconciliationControllerAssert(
3134
+ data: ReconciliationControllerAssertData
3135
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
2398
3136
  return __request(OpenAPI, {
2399
- method: 'GET',
2400
- url: '/api/v1/admin/properties/{key}',
3137
+ method: 'POST',
3138
+ url: '/api/v1/{region}/bean/reconciliations/assert',
2401
3139
  path: {
2402
- key: data.key
3140
+ region: data.region
2403
3141
  },
3142
+ body: data.requestBody,
3143
+ mediaType: 'application/json',
2404
3144
  errors: {
2405
- 401: 'Unauthorized',
2406
- 403: 'Forbidden - insufficient permissions',
2407
- 404: 'Property not found'
3145
+ 404: 'Account not found'
2408
3146
  }
2409
3147
  });
2410
3148
  }
2411
3149
 
2412
3150
  /**
2413
- * Update a system property
3151
+ * Generate a pad adjusting entry
3152
+ * 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.
2414
3153
  * @param data The data for the request.
2415
- * @param data.key Property key
3154
+ * @param data.region Region code for tenant context (decorative for reconciliation)
2416
3155
  * @param data.requestBody
2417
- * @returns unknown Property updated successfully
3156
+ * @returns PadResultDto Pad adjusting entry generated
2418
3157
  * @throws ApiError
2419
3158
  */
2420
- public static propertyControllerUpdate(
2421
- data: PropertyControllerUpdateData
2422
- ): CancelablePromise<PropertyControllerUpdateResponse> {
3159
+ public static reconciliationControllerPad(
3160
+ data: ReconciliationControllerPadData
3161
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
2423
3162
  return __request(OpenAPI, {
2424
- method: 'PUT',
2425
- url: '/api/v1/admin/properties/{key}',
3163
+ method: 'POST',
3164
+ url: '/api/v1/{region}/bean/reconciliations/pad',
2426
3165
  path: {
2427
- key: data.key
3166
+ region: data.region
2428
3167
  },
2429
3168
  body: data.requestBody,
2430
3169
  mediaType: 'application/json',
2431
3170
  errors: {
2432
- 401: 'Unauthorized',
2433
- 403: 'Forbidden - insufficient permissions'
3171
+ 400: 'Book already within tolerance — no pad needed',
3172
+ 404: 'Account not found'
2434
3173
  }
2435
3174
  });
2436
3175
  }
2437
3176
 
2438
3177
  /**
2439
- * Delete a system property
3178
+ * List reconciliation history for an account
3179
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
2440
3180
  * @param data The data for the request.
2441
- * @param data.key Property key
2442
- * @returns void Property deleted successfully
3181
+ * @param data.accountId BeanAccount id
3182
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3183
+ * @returns ReconciliationRecordDto Reconciliation history
2443
3184
  * @throws ApiError
2444
3185
  */
2445
- public static propertyControllerDelete(
2446
- data: PropertyControllerDeleteData
2447
- ): CancelablePromise<PropertyControllerDeleteResponse> {
3186
+ public static reconciliationControllerHistory(
3187
+ data: ReconciliationControllerHistoryData
3188
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
2448
3189
  return __request(OpenAPI, {
2449
- method: 'DELETE',
2450
- url: '/api/v1/admin/properties/{key}',
3190
+ method: 'GET',
3191
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
2451
3192
  path: {
2452
- key: data.key
3193
+ accountId: data.accountId,
3194
+ region: data.region
2453
3195
  },
2454
3196
  errors: {
2455
- 401: 'Unauthorized',
2456
- 403: 'Forbidden - insufficient permissions',
2457
- 404: 'Property not found'
3197
+ 404: 'Account not found'
2458
3198
  }
2459
3199
  });
2460
3200
  }
@@ -2464,7 +3204,7 @@ export class BeanExportService {
2464
3204
  /**
2465
3205
  * Export Beancount ledger as ZIP
2466
3206
  * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
2467
- * @returns unknown
3207
+ * @returns binary ZIP archive (application/zip) streamed as an attachment
2468
3208
  * @throws ApiError
2469
3209
  */
2470
3210
  public static exportControllerExportBeancount(): CancelablePromise<ExportControllerExportBeancountResponse> {
@@ -2614,140 +3354,25 @@ export class BeanImportService {
2614
3354
 
2615
3355
  /**
2616
3356
  * Reset configuration to default
2617
- * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
2618
- * @param data The data for the request.
2619
- * @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
2620
- * @param data.region Region code for tenant context
2621
- * @returns ImporterConfigDto Configuration reset successfully
2622
- * @throws ApiError
2623
- */
2624
- public static importerConfigControllerResetConfig(
2625
- data: ImporterConfigControllerResetConfigData
2626
- ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
2627
- return __request(OpenAPI, {
2628
- method: 'POST',
2629
- url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
2630
- path: {
2631
- importerId: data.importerId,
2632
- region: data.region
2633
- },
2634
- errors: {
2635
- 400: 'Invalid input - Unsupported importer'
2636
- }
2637
- });
2638
- }
2639
- }
2640
-
2641
- export class BeanPlatformsService {
2642
- /**
2643
- * Get all platforms with statistics
2644
- * @returns unknown List of platforms with binding and account counts
2645
- * @throws ApiError
2646
- */
2647
- public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2648
- return __request(OpenAPI, {
2649
- method: 'GET',
2650
- url: '/api/v1/bean/platforms'
2651
- });
2652
- }
2653
-
2654
- /**
2655
- * Create a new platform
2656
- * @param data The data for the request.
2657
- * @param data.requestBody
2658
- * @returns unknown Platform created successfully
2659
- * @throws ApiError
2660
- */
2661
- public static platformControllerCreate(
2662
- data: PlatformControllerCreateData
2663
- ): CancelablePromise<PlatformControllerCreateResponse> {
2664
- return __request(OpenAPI, {
2665
- method: 'POST',
2666
- url: '/api/v1/bean/platforms',
2667
- body: data.requestBody,
2668
- mediaType: 'application/json',
2669
- errors: {
2670
- 409: 'Platform already exists'
2671
- }
2672
- });
2673
- }
2674
-
2675
- /**
2676
- * Get platform list for current user
2677
- * @returns unknown List of platforms with user binding status
2678
- * @throws ApiError
2679
- */
2680
- public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
2681
- return __request(OpenAPI, {
2682
- method: 'GET',
2683
- url: '/api/v1/bean/platforms/list'
2684
- });
2685
- }
2686
-
2687
- /**
2688
- * Match platforms by name or alias
2689
- * @param data The data for the request.
2690
- * @param data.q Search query — Chinese name, English name, or abbreviation
2691
- * @param data.region Region code for category override lookup
2692
- * @returns unknown List of matching platforms with suggested segment names
2693
- * @throws ApiError
2694
- */
2695
- public static platformControllerMatchPlatforms(
2696
- data: PlatformControllerMatchPlatformsData
2697
- ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
2698
- return __request(OpenAPI, {
2699
- method: 'GET',
2700
- url: '/api/v1/bean/platforms/match',
2701
- query: {
2702
- q: data.q,
2703
- region: data.region
2704
- }
2705
- });
2706
- }
2707
-
2708
- /**
2709
- * Update a platform
2710
- * @param data The data for the request.
2711
- * @param data.id Platform ID
2712
- * @param data.requestBody
2713
- * @returns unknown Platform updated successfully
2714
- * @throws ApiError
2715
- */
2716
- public static platformControllerUpdate(
2717
- data: PlatformControllerUpdateData
2718
- ): CancelablePromise<PlatformControllerUpdateResponse> {
2719
- return __request(OpenAPI, {
2720
- method: 'PUT',
2721
- url: '/api/v1/bean/platforms/{id}',
2722
- path: {
2723
- id: data.id
2724
- },
2725
- body: data.requestBody,
2726
- mediaType: 'application/json',
2727
- errors: {
2728
- 404: 'Platform not found'
2729
- }
2730
- });
2731
- }
2732
-
2733
- /**
2734
- * Delete a platform
3357
+ * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
2735
3358
  * @param data The data for the request.
2736
- * @param data.id Platform ID
2737
- * @returns void Platform deleted successfully
3359
+ * @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
3360
+ * @param data.region Region code for tenant context
3361
+ * @returns ImporterConfigDto Configuration reset successfully
2738
3362
  * @throws ApiError
2739
3363
  */
2740
- public static platformControllerDelete(
2741
- data: PlatformControllerDeleteData
2742
- ): CancelablePromise<PlatformControllerDeleteResponse> {
3364
+ public static importerConfigControllerResetConfig(
3365
+ data: ImporterConfigControllerResetConfigData
3366
+ ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
2743
3367
  return __request(OpenAPI, {
2744
- method: 'DELETE',
2745
- url: '/api/v1/bean/platforms/{id}',
3368
+ method: 'POST',
3369
+ url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
2746
3370
  path: {
2747
- id: data.id
3371
+ importerId: data.importerId,
3372
+ region: data.region
2748
3373
  },
2749
3374
  errors: {
2750
- 404: 'Platform not found'
3375
+ 400: 'Invalid input - Unsupported importer'
2751
3376
  }
2752
3377
  });
2753
3378
  }
@@ -2853,6 +3478,101 @@ export class ProviderSyncService {
2853
3478
  }
2854
3479
  }
2855
3480
 
3481
+ export class ExternalAccountLinksService {
3482
+ /**
3483
+ * Create an external account → BeanAccount mapping (ADR-0113)
3484
+ * @param data The data for the request.
3485
+ * @param data.region Region code for tenant context
3486
+ * @param data.requestBody
3487
+ * @returns ExternalAccountLinkResponseDto Link created.
3488
+ * @throws ApiError
3489
+ */
3490
+ public static externalAccountLinkControllerCreate(
3491
+ data: ExternalAccountLinkControllerCreateData
3492
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
3493
+ return __request(OpenAPI, {
3494
+ method: 'POST',
3495
+ url: '/api/v1/{region}/bean/external-account-links',
3496
+ path: {
3497
+ region: data.region
3498
+ },
3499
+ body: data.requestBody,
3500
+ mediaType: 'application/json',
3501
+ errors: {
3502
+ 422: 'beanAccountId not owned, or an active link already exists.'
3503
+ }
3504
+ });
3505
+ }
3506
+
3507
+ /**
3508
+ * List the user's active external account links
3509
+ * @param data The data for the request.
3510
+ * @param data.provider
3511
+ * @param data.region Region code for tenant context
3512
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
3513
+ * @throws ApiError
3514
+ */
3515
+ public static externalAccountLinkControllerFindAll(
3516
+ data: ExternalAccountLinkControllerFindAllData
3517
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
3518
+ return __request(OpenAPI, {
3519
+ method: 'GET',
3520
+ url: '/api/v1/{region}/bean/external-account-links',
3521
+ path: {
3522
+ region: data.region
3523
+ },
3524
+ query: {
3525
+ provider: data.provider
3526
+ }
3527
+ });
3528
+ }
3529
+
3530
+ /**
3531
+ * Get a single external account link
3532
+ * @param data The data for the request.
3533
+ * @param data.id
3534
+ * @param data.region Region code for tenant context
3535
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
3536
+ * @throws ApiError
3537
+ */
3538
+ public static externalAccountLinkControllerFindOne(
3539
+ data: ExternalAccountLinkControllerFindOneData
3540
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
3541
+ return __request(OpenAPI, {
3542
+ method: 'GET',
3543
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3544
+ path: {
3545
+ id: data.id,
3546
+ region: data.region
3547
+ },
3548
+ errors: {
3549
+ 422: 'Link not found or not owned by the user.'
3550
+ }
3551
+ });
3552
+ }
3553
+
3554
+ /**
3555
+ * Soft-delete (disconnect) an external account link
3556
+ * @param data The data for the request.
3557
+ * @param data.id
3558
+ * @param data.region Region code for tenant context
3559
+ * @returns void Link soft-deleted; historical transactions are unaffected.
3560
+ * @throws ApiError
3561
+ */
3562
+ public static externalAccountLinkControllerRemove(
3563
+ data: ExternalAccountLinkControllerRemoveData
3564
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
3565
+ return __request(OpenAPI, {
3566
+ method: 'DELETE',
3567
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3568
+ path: {
3569
+ id: data.id,
3570
+ region: data.region
3571
+ }
3572
+ });
3573
+ }
3574
+ }
3575
+
2856
3576
  export class ImportTelemetryService {
2857
3577
  /**
2858
3578
  * Receive anonymous parser failure telemetry
@@ -3011,411 +3731,302 @@ export class BeanNlpService {
3011
3731
  }
3012
3732
  }
3013
3733
 
3014
- export class DashboardService {
3734
+ export class BeanPlatformsService {
3015
3735
  /**
3016
- * Get net worth overview
3017
- * Returns total net worth with breakdown of assets and liabilities
3018
- * @param data The data for the request.
3019
- * @param data.region Region code for tenant context
3020
- * @param data.date Date for balance calculation (ISO 8601 format)
3021
- * @returns NetWorthResponseDto Net worth retrieved successfully
3736
+ * Get all platforms with statistics
3737
+ * @returns unknown List of platforms with binding and account counts
3022
3738
  * @throws ApiError
3023
3739
  */
3024
- public static dashboardControllerGetNetWorth(
3025
- data: DashboardControllerGetNetWorthData
3026
- ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3740
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
3027
3741
  return __request(OpenAPI, {
3028
3742
  method: 'GET',
3029
- url: '/api/v1/{region}/dashboard/net-worth',
3030
- path: {
3031
- region: data.region
3032
- },
3033
- query: {
3034
- date: data.date
3035
- },
3036
- errors: {
3037
- 401: 'User not authenticated'
3038
- }
3743
+ url: '/api/v1/bean/platforms'
3039
3744
  });
3040
3745
  }
3041
3746
 
3042
3747
  /**
3043
- * Get accounts grouped by platform
3044
- * Returns accounts with balances grouped by financial platform
3748
+ * Create a new platform
3045
3749
  * @param data The data for the request.
3046
- * @param data.region Region code for tenant context
3047
- * @param data.groupBy Grouping strategy
3048
- * @param data.date Date for balance calculation (ISO 8601 format)
3049
- * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3050
- * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3750
+ * @param data.requestBody
3751
+ * @returns unknown Platform created successfully
3051
3752
  * @throws ApiError
3052
3753
  */
3053
- public static dashboardControllerGetAccounts(
3054
- data: DashboardControllerGetAccountsData
3055
- ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3754
+ public static platformControllerCreate(
3755
+ data: PlatformControllerCreateData
3756
+ ): CancelablePromise<PlatformControllerCreateResponse> {
3056
3757
  return __request(OpenAPI, {
3057
- method: 'GET',
3058
- url: '/api/v1/{region}/dashboard/accounts',
3059
- path: {
3060
- region: data.region
3061
- },
3062
- query: {
3063
- groupBy: data.groupBy,
3064
- date: data.date,
3065
- accountId: data.accountId
3066
- },
3758
+ method: 'POST',
3759
+ url: '/api/v1/bean/platforms',
3760
+ body: data.requestBody,
3761
+ mediaType: 'application/json',
3067
3762
  errors: {
3068
- 401: 'User not authenticated'
3763
+ 409: 'Platform already exists'
3069
3764
  }
3070
3765
  });
3071
3766
  }
3072
3767
 
3073
3768
  /**
3074
- * Get cash flow summary
3075
- * Returns income, expenses, and savings for a monthly period
3769
+ * Get platform list for current user
3076
3770
  * @param data The data for the request.
3077
- * @param data.period Period in YYYY-MM format
3078
- * @param data.region Region code for tenant context
3079
- * @returns CashFlowResponseDto Cash flow retrieved successfully
3771
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-type-bucket ordering (local-region platforms first). Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3772
+ * @returns PlatformListItemDto List of platforms with user binding status
3080
3773
  * @throws ApiError
3081
3774
  */
3082
- public static dashboardControllerGetCashFlow(
3083
- data: DashboardControllerGetCashFlowData
3084
- ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3775
+ public static platformControllerGetPlatformList(
3776
+ data: PlatformControllerGetPlatformListData = {}
3777
+ ): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3085
3778
  return __request(OpenAPI, {
3086
3779
  method: 'GET',
3087
- url: '/api/v1/{region}/dashboard/cash-flow',
3088
- path: {
3089
- region: data.region
3090
- },
3780
+ url: '/api/v1/bean/platforms/list',
3091
3781
  query: {
3092
- period: data.period
3093
- },
3094
- errors: {
3095
- 400: 'Invalid period format',
3096
- 401: 'User not authenticated'
3782
+ region: data.region
3097
3783
  }
3098
3784
  });
3099
3785
  }
3100
- }
3101
3786
 
3102
- export class InvestmentService {
3103
3787
  /**
3104
- * Get per-holding unrealized + realized P&L
3105
- * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3788
+ * Match platforms by name or alias
3106
3789
  * @param data The data for the request.
3107
- * @param data.region Region code for tenant context
3108
- * @param data.asOf As-of date (ISO 8601), defaults to today
3109
- * @param data.accountId Scope to a single account
3110
- * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3111
- * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3790
+ * @param data.q Search query — Chinese name, English name, or abbreviation
3791
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-tier ordering (local-region platforms first); also the intended categoryOverrides key. Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3792
+ * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3112
3793
  * @throws ApiError
3113
3794
  */
3114
- public static holdingPnlControllerGetHoldingPnl(
3115
- data: HoldingPnlControllerGetHoldingPnlData
3116
- ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3795
+ public static platformControllerMatchPlatforms(
3796
+ data: PlatformControllerMatchPlatformsData
3797
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3117
3798
  return __request(OpenAPI, {
3118
3799
  method: 'GET',
3119
- url: '/api/v1/{region}/investment/holdings/pnl',
3120
- path: {
3121
- region: data.region
3122
- },
3800
+ url: '/api/v1/bean/platforms/match',
3123
3801
  query: {
3124
- asOf: data.asOf,
3125
- accountId: data.accountId,
3126
- method: data.method
3127
- },
3128
- errors: {
3129
- 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3130
- 401: 'User not authenticated'
3131
- }
3132
- });
3133
- }
3134
- }
3135
-
3136
- export class BeanPricesService {
3137
- /**
3138
- * Create a new price
3139
- * Creates a new price entry for the authenticated user
3140
- * @param data The data for the request.
3141
- * @param data.region Region code for tenant context
3142
- * @param data.requestBody
3143
- * @returns PriceResponseDto Price created successfully
3144
- * @throws ApiError
3145
- */
3146
- public static priceControllerCreate(
3147
- data: PriceControllerCreateData
3148
- ): CancelablePromise<PriceControllerCreateResponse> {
3149
- return __request(OpenAPI, {
3150
- method: 'POST',
3151
- url: '/api/v1/{region}/bean/prices',
3152
- path: {
3802
+ q: data.q,
3153
3803
  region: data.region
3154
- },
3155
- body: data.requestBody,
3156
- mediaType: 'application/json',
3157
- errors: {
3158
- 404: 'Currency or quoteCurrency commodity not found',
3159
- 409: 'Price already exists for this currency pair and date'
3160
3804
  }
3161
3805
  });
3162
3806
  }
3163
3807
 
3164
3808
  /**
3165
- * List user prices
3166
- * Returns all price entries for the authenticated user with optional filtering
3809
+ * Get the region and candidate account standards for a platform
3167
3810
  * @param data The data for the request.
3168
- * @param data.region Region code for tenant context
3169
- * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
3170
- * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
3171
- * @param data.dateFrom Filter prices from this date (ISO 8601 format)
3172
- * @param data.dateTo Filter prices to this date (ISO 8601 format)
3173
- * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
3174
- * @param data.page Page number for pagination (default: 1)
3175
- * @param data.limit Number of items per page (default: 20, max: 100)
3176
- * @returns PriceListResponseDto Prices retrieved successfully
3811
+ * @param data.id Platform ID (from a match result)
3812
+ * @param data.region Region code (ISO 3166-1 alpha-2, case-insensitive). Required for global platforms (countryCode null) — resolved as their template region; ignored when the platform has its own countryCode.
3813
+ * @param data.type Filter templates by account type (path first segment)
3814
+ * @returns PlatformStandardsResponseDto Resolved region plus the merged account-standard catalog of that region (groupable by productCategory client-side)
3177
3815
  * @throws ApiError
3178
3816
  */
3179
- public static priceControllerFindAll(
3180
- data: PriceControllerFindAllData
3181
- ): CancelablePromise<PriceControllerFindAllResponse> {
3817
+ public static platformControllerGetPlatformStandards(
3818
+ data: PlatformControllerGetPlatformStandardsData
3819
+ ): CancelablePromise<PlatformControllerGetPlatformStandardsResponse> {
3182
3820
  return __request(OpenAPI, {
3183
3821
  method: 'GET',
3184
- url: '/api/v1/{region}/bean/prices',
3822
+ url: '/api/v1/bean/platforms/{id}/standards',
3185
3823
  path: {
3186
- region: data.region
3824
+ id: data.id
3187
3825
  },
3188
3826
  query: {
3189
- currency: data.currency,
3190
- quoteCurrency: data.quoteCurrency,
3191
- dateFrom: data.dateFrom,
3192
- dateTo: data.dateTo,
3193
- search: data.search,
3194
- page: data.page,
3195
- limit: data.limit
3827
+ region: data.region,
3828
+ type: data.type
3196
3829
  }
3197
3830
  });
3198
3831
  }
3199
3832
 
3200
3833
  /**
3201
- * Get price by ID
3202
- * Returns a single price entry by its ID
3834
+ * Update a platform
3203
3835
  * @param data The data for the request.
3204
- * @param data.id Price ID
3205
- * @param data.region Region code for tenant context
3206
- * @returns PriceResponseDto Price retrieved successfully
3836
+ * @param data.id Platform ID
3837
+ * @param data.requestBody
3838
+ * @returns unknown Platform updated successfully
3207
3839
  * @throws ApiError
3208
3840
  */
3209
- public static priceControllerFindOne(
3210
- data: PriceControllerFindOneData
3211
- ): CancelablePromise<PriceControllerFindOneResponse> {
3841
+ public static platformControllerUpdate(
3842
+ data: PlatformControllerUpdateData
3843
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3212
3844
  return __request(OpenAPI, {
3213
- method: 'GET',
3214
- url: '/api/v1/{region}/bean/prices/{id}',
3845
+ method: 'PUT',
3846
+ url: '/api/v1/bean/platforms/{id}',
3215
3847
  path: {
3216
- id: data.id,
3217
- region: data.region
3848
+ id: data.id
3218
3849
  },
3850
+ body: data.requestBody,
3851
+ mediaType: 'application/json',
3219
3852
  errors: {
3220
- 404: 'Price not found'
3853
+ 404: 'Platform not found'
3221
3854
  }
3222
3855
  });
3223
3856
  }
3224
3857
 
3225
3858
  /**
3226
- * Update a price
3227
- * Updates an existing price entry
3859
+ * Delete a platform
3228
3860
  * @param data The data for the request.
3229
- * @param data.id Price ID
3230
- * @param data.region Region code for tenant context
3231
- * @param data.requestBody
3232
- * @returns PriceResponseDto Price updated successfully
3861
+ * @param data.id Platform ID
3862
+ * @returns void Platform deleted successfully
3233
3863
  * @throws ApiError
3234
3864
  */
3235
- public static priceControllerUpdate(
3236
- data: PriceControllerUpdateData
3237
- ): CancelablePromise<PriceControllerUpdateResponse> {
3865
+ public static platformControllerDelete(
3866
+ data: PlatformControllerDeleteData
3867
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3238
3868
  return __request(OpenAPI, {
3239
- method: 'PUT',
3240
- url: '/api/v1/{region}/bean/prices/{id}',
3869
+ method: 'DELETE',
3870
+ url: '/api/v1/bean/platforms/{id}',
3241
3871
  path: {
3242
- id: data.id,
3243
- region: data.region
3872
+ id: data.id
3244
3873
  },
3245
- body: data.requestBody,
3246
- mediaType: 'application/json',
3247
3874
  errors: {
3248
- 404: 'Price not found',
3249
- 409: 'Updated price conflicts with existing price'
3875
+ 404: 'Platform not found'
3250
3876
  }
3251
3877
  });
3252
3878
  }
3879
+ }
3253
3880
 
3881
+ export class DashboardService {
3254
3882
  /**
3255
- * Delete a price
3256
- * Deletes a price entry (hard delete)
3883
+ * Get net worth overview
3884
+ * Returns total net worth with breakdown of assets and liabilities
3257
3885
  * @param data The data for the request.
3258
- * @param data.id Price ID
3259
3886
  * @param data.region Region code for tenant context
3260
- * @returns void Price deleted successfully
3887
+ * @param data.date Date for balance calculation (ISO 8601 format)
3888
+ * @returns NetWorthResponseDto Net worth retrieved successfully
3261
3889
  * @throws ApiError
3262
3890
  */
3263
- public static priceControllerDelete(
3264
- data: PriceControllerDeleteData
3265
- ): CancelablePromise<PriceControllerDeleteResponse> {
3891
+ public static dashboardControllerGetNetWorth(
3892
+ data: DashboardControllerGetNetWorthData
3893
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3266
3894
  return __request(OpenAPI, {
3267
- method: 'DELETE',
3268
- url: '/api/v1/{region}/bean/prices/{id}',
3895
+ method: 'GET',
3896
+ url: '/api/v1/{region}/dashboard/net-worth',
3269
3897
  path: {
3270
- id: data.id,
3271
3898
  region: data.region
3272
3899
  },
3900
+ query: {
3901
+ date: data.date
3902
+ },
3273
3903
  errors: {
3274
- 404: 'Price not found'
3904
+ 401: 'User not authenticated'
3275
3905
  }
3276
3906
  });
3277
3907
  }
3278
3908
 
3279
3909
  /**
3280
- * Bulk create prices
3281
- * Creates multiple price entries at once (skips duplicates)
3910
+ * Get accounts grouped by platform
3911
+ * Returns accounts with balances grouped by financial platform
3282
3912
  * @param data The data for the request.
3283
3913
  * @param data.region Region code for tenant context
3284
- * @param data.requestBody
3285
- * @returns PriceResponseDto Prices created successfully
3914
+ * @param data.groupBy Grouping strategy
3915
+ * @param data.date Date for balance calculation (ISO 8601 format)
3916
+ * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3917
+ * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3286
3918
  * @throws ApiError
3287
3919
  */
3288
- public static priceControllerBulkCreate(
3289
- data: PriceControllerBulkCreateData
3290
- ): CancelablePromise<PriceControllerBulkCreateResponse> {
3920
+ public static dashboardControllerGetAccounts(
3921
+ data: DashboardControllerGetAccountsData
3922
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3291
3923
  return __request(OpenAPI, {
3292
- method: 'POST',
3293
- url: '/api/v1/{region}/bean/prices/bulk',
3924
+ method: 'GET',
3925
+ url: '/api/v1/{region}/dashboard/accounts',
3294
3926
  path: {
3295
3927
  region: data.region
3296
3928
  },
3297
- body: data.requestBody,
3298
- mediaType: 'application/json'
3929
+ query: {
3930
+ groupBy: data.groupBy,
3931
+ date: data.date,
3932
+ accountId: data.accountId
3933
+ },
3934
+ errors: {
3935
+ 401: 'User not authenticated'
3936
+ }
3299
3937
  });
3300
3938
  }
3301
- }
3302
3939
 
3303
- export class ReportingService {
3304
3940
  /**
3305
- * Get portfolio value trends
3306
- *
3307
- * Returns time series data of portfolio net worth.
3308
- *
3309
- * **Multi-currency Support:**
3310
- * - `series[].byCurrency` - Currency breakdown for each data point
3311
- * - `byCurrency` - Separate time series grouped by currency
3312
- * - `warnings` - Exchange rate warnings if conversion failed
3313
- *
3314
- * **Parameters:**
3315
- * - `period`: Time period (1m, 3m, 6m, 1y)
3316
- * - `granularity`: Data granularity (day, week, month)
3317
- *
3941
+ * Get cash flow summary
3942
+ * Returns income, expenses, and savings for a monthly period
3318
3943
  * @param data The data for the request.
3944
+ * @param data.period Period in YYYY-MM format
3319
3945
  * @param data.region Region code for tenant context
3320
- * @param data.period Time period
3321
- * @param data.granularity Data granularity
3322
- * @returns PortfolioTrendsResponseDto Trends retrieved successfully
3946
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3323
3947
  * @throws ApiError
3324
3948
  */
3325
- public static reportingControllerGetPortfolioTrends(
3326
- data: ReportingControllerGetPortfolioTrendsData
3327
- ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
3949
+ public static dashboardControllerGetCashFlow(
3950
+ data: DashboardControllerGetCashFlowData
3951
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3328
3952
  return __request(OpenAPI, {
3329
3953
  method: 'GET',
3330
- url: '/api/v1/{region}/reporting/portfolio/trends',
3954
+ url: '/api/v1/{region}/dashboard/cash-flow',
3331
3955
  path: {
3332
3956
  region: data.region
3333
3957
  },
3334
3958
  query: {
3335
- period: data.period,
3336
- granularity: data.granularity
3959
+ period: data.period
3337
3960
  },
3338
3961
  errors: {
3962
+ 400: 'Invalid period format',
3339
3963
  401: 'User not authenticated'
3340
3964
  }
3341
3965
  });
3342
3966
  }
3343
3967
 
3344
3968
  /**
3345
- * Generate portfolio snapshot
3346
- *
3347
- * Manually generate a portfolio snapshot for a specific date.
3348
- *
3349
- * **Multi-currency Support:**
3350
- * - Fetches balances grouped by currency
3351
- * - Uses user's baseCurrency setting for conversion
3352
- * - Stores exchange rates and warnings
3353
- *
3354
- * **Use Cases:**
3355
- * - Testing snapshot generation
3356
- * - Force regeneration after data correction
3357
- * - Initial setup for new users
3358
- *
3969
+ * Get expenses/income grouped by functional category
3970
+ * 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)
3359
3971
  * @param data The data for the request.
3360
3972
  * @param data.region Region code for tenant context
3361
- * @param data.requestBody Optional date (defaults to today)
3362
- * @returns GenerateSnapshotResponse Snapshot generated successfully
3973
+ * @param data.groupBy Grouping strategy
3974
+ * @param data.period Time window (1m = current calendar month)
3975
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
3976
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3363
3977
  * @throws ApiError
3364
3978
  */
3365
- public static reportingControllerGenerateSnapshot(
3366
- data: ReportingControllerGenerateSnapshotData
3367
- ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
3979
+ public static dashboardControllerGetExpenses(
3980
+ data: DashboardControllerGetExpensesData
3981
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3368
3982
  return __request(OpenAPI, {
3369
- method: 'POST',
3370
- url: '/api/v1/{region}/reporting/snapshots/generate',
3983
+ method: 'GET',
3984
+ url: '/api/v1/{region}/dashboard/expenses',
3371
3985
  path: {
3372
3986
  region: data.region
3373
3987
  },
3374
- body: data.requestBody,
3375
- mediaType: 'application/json',
3988
+ query: {
3989
+ groupBy: data.groupBy,
3990
+ period: data.period,
3991
+ flow: data.flow
3992
+ },
3376
3993
  errors: {
3377
- 400: 'Invalid date format',
3994
+ 400: 'Invalid groupBy or period',
3378
3995
  401: 'User not authenticated'
3379
3996
  }
3380
3997
  });
3381
3998
  }
3999
+ }
3382
4000
 
4001
+ export class InvestmentService {
3383
4002
  /**
3384
- * Backfill portfolio snapshots
3385
- *
3386
- * Generate snapshots for a date range (historical data backfill).
3387
- *
3388
- * **Multi-currency Support:**
3389
- * - Each snapshot includes multi-currency data
3390
- * - Uses exchange rates available at generation time
3391
- * - Warnings stored for missing exchange rates
3392
- *
3393
- * **Best Practices:**
3394
- * - Use for initial setup after account configuration
3395
- * - Run during low-traffic periods for large date ranges
3396
- * - Existing snapshots are skipped (not regenerated)
3397
- *
4003
+ * Get per-holding unrealized + realized P&L
4004
+ * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3398
4005
  * @param data The data for the request.
3399
4006
  * @param data.region Region code for tenant context
3400
- * @param data.requestBody
3401
- * @returns BackfillSnapshotsResponse Backfill completed successfully
4007
+ * @param data.asOf As-of date (ISO 8601), defaults to today
4008
+ * @param data.accountId Scope to a single account
4009
+ * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
4010
+ * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3402
4011
  * @throws ApiError
3403
4012
  */
3404
- public static reportingControllerBackfillSnapshots(
3405
- data: ReportingControllerBackfillSnapshotsData
3406
- ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
4013
+ public static holdingPnlControllerGetHoldingPnl(
4014
+ data: HoldingPnlControllerGetHoldingPnlData
4015
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3407
4016
  return __request(OpenAPI, {
3408
- method: 'POST',
3409
- url: '/api/v1/{region}/reporting/snapshots/backfill',
4017
+ method: 'GET',
4018
+ url: '/api/v1/{region}/investment/holdings/pnl',
3410
4019
  path: {
3411
4020
  region: data.region
3412
4021
  },
3413
- body: data.requestBody,
3414
- mediaType: 'application/json',
4022
+ query: {
4023
+ asOf: data.asOf,
4024
+ accountId: data.accountId,
4025
+ method: data.method
4026
+ },
3415
4027
  errors: {
3416
- 400: 'Invalid date format or range',
3417
- 401: 'User not authenticated',
3418
- 409: 'Backfill already in progress for this user'
4028
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
4029
+ 401: 'User not authenticated'
3419
4030
  }
3420
4031
  });
3421
4032
  }
@@ -3444,7 +4055,7 @@ export class AuthService {
3444
4055
  * Anonymous login with access token
3445
4056
  * @param data The data for the request.
3446
4057
  * @param data.requestBody
3447
- * @returns unknown Login successful
4058
+ * @returns AnonymousLoginResponseDto Login successful
3448
4059
  * @throws ApiError
3449
4060
  */
3450
4061
  public static authControllerAccessTokenLogin(
@@ -3462,15 +4073,52 @@ export class AuthService {
3462
4073
  }
3463
4074
  }
3464
4075
 
3465
- export class DefaultService {
4076
+ export class CommunityService {
4077
+ /**
4078
+ * Relay a sanitized parser-contribution payload
4079
+ * A server-side bot re-sanitizes the payload and opens an issue on the target repository; the issue URL is returned. The payload is never persisted or logged (forward-and-drop).
4080
+ * @param data The data for the request.
4081
+ * @param data.region Region code for tenant context (routing only; the institution region rides in the payload meta)
4082
+ * @param data.requestBody
4083
+ * @returns ParserContributionRelayResponseDto Issue created by the bot
4084
+ * @throws ApiError
4085
+ */
4086
+ public static parserContributionControllerCreate(
4087
+ data: ParserContributionControllerCreateData
4088
+ ): CancelablePromise<ParserContributionControllerCreateResponse> {
4089
+ return __request(OpenAPI, {
4090
+ method: 'POST',
4091
+ url: '/api/v1/{region}/community/parser-contributions',
4092
+ path: {
4093
+ region: data.region
4094
+ },
4095
+ body: data.requestBody,
4096
+ mediaType: 'application/json',
4097
+ errors: {
4098
+ 401: 'Unauthorized',
4099
+ 422: 'Validation failed (institution slug, empty samples, row/cell size limits)',
4100
+ 429: 'Rate limited (5 submissions per user per hour)',
4101
+ 501: 'Relay not configured on this deployment — clients fall back to the clipboard flow',
4102
+ 502: 'GitHub bot failure (upstream), safe to retry'
4103
+ }
4104
+ });
4105
+ }
4106
+ }
4107
+
4108
+ export class AdminCacheService {
3466
4109
  /**
3467
- * @returns unknown
4110
+ * Flush entire cache (L1 + L2)
4111
+ * Clears ALL cache entries across ALL namespaces and users. Use only for emergency cache corruption recovery, maintenance-window refresh, or development resets.
4112
+ * @returns unknown Cache flushed successfully
3468
4113
  * @throws ApiError
3469
4114
  */
3470
4115
  public static cacheControllerFlushCache(): CancelablePromise<CacheControllerFlushCacheResponse> {
3471
4116
  return __request(OpenAPI, {
3472
4117
  method: 'POST',
3473
- url: '/api/v1/cache/flush'
4118
+ url: '/api/v1/cache/flush',
4119
+ errors: {
4120
+ 403: 'Admin access required'
4121
+ }
3474
4122
  });
3475
4123
  }
3476
4124
  }
@@ -3631,3 +4279,53 @@ export class InfoService {
3631
4279
  });
3632
4280
  }
3633
4281
  }
4282
+
4283
+ export class MarketDataService {
4284
+ /**
4285
+ * Search market symbols by name or code
4286
+ * Ranked search over the openbb catalog. Empty `q` returns [].
4287
+ * @param data The data for the request.
4288
+ * @param data.q Search term — matched against symbol and instrument name. Empty string returns [].
4289
+ * @param data.limit Maximum number of results (clamped 1..50)
4290
+ * @param data.exchange Filter by exchange code (e.g. US, HK, SS, SZ)
4291
+ * @param data.assetType Filter by OpenBB asset_type (e.g. stock, etf)
4292
+ * @returns SymbolSearchResultDto Ranked search results
4293
+ * @throws ApiError
4294
+ */
4295
+ public static symbolControllerSearch(
4296
+ data: SymbolControllerSearchData
4297
+ ): CancelablePromise<SymbolControllerSearchResponse> {
4298
+ return __request(OpenAPI, {
4299
+ method: 'GET',
4300
+ url: '/api/v1/market/symbols/search',
4301
+ query: {
4302
+ q: data.q,
4303
+ limit: data.limit,
4304
+ exchange: data.exchange,
4305
+ assetType: data.assetType
4306
+ }
4307
+ });
4308
+ }
4309
+
4310
+ /**
4311
+ * Get a market symbol quote
4312
+ * @param data The data for the request.
4313
+ * @param data.symbol
4314
+ * @returns SymbolQuoteDto Symbol quote
4315
+ * @throws ApiError
4316
+ */
4317
+ public static symbolControllerGetQuote(
4318
+ data: SymbolControllerGetQuoteData
4319
+ ): CancelablePromise<SymbolControllerGetQuoteResponse> {
4320
+ return __request(OpenAPI, {
4321
+ method: 'GET',
4322
+ url: '/api/v1/market/symbols/{symbol}/quote',
4323
+ path: {
4324
+ symbol: data.symbol
4325
+ },
4326
+ errors: {
4327
+ 404: 'Symbol not found in the openbb catalog'
4328
+ }
4329
+ });
4330
+ }
4331
+ }