@firela/api-types 0.0.0-canary.f2efa2bf → 0.0.0-canary.f5dd812

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,
@@ -55,6 +57,48 @@ import type {
55
57
  ReviewControllerUndoResponse,
56
58
  ReviewControllerBatchResolveData,
57
59
  ReviewControllerBatchResolveResponse,
60
+ TransactionRuleControllerCreateData,
61
+ TransactionRuleControllerCreateResponse,
62
+ TransactionRuleControllerListData,
63
+ TransactionRuleControllerListResponse,
64
+ TransactionRuleControllerValidateData,
65
+ TransactionRuleControllerValidateResponse,
66
+ TransactionRuleControllerBulkCreateData,
67
+ TransactionRuleControllerBulkCreateResponse,
68
+ TransactionRuleControllerExportData,
69
+ TransactionRuleControllerExportResponse,
70
+ TransactionRuleControllerGetStatisticsData,
71
+ TransactionRuleControllerGetStatisticsResponse,
72
+ TransactionRuleControllerGetDetailData,
73
+ TransactionRuleControllerGetDetailResponse,
74
+ TransactionRuleControllerUpdateData,
75
+ TransactionRuleControllerUpdateResponse,
76
+ TransactionRuleControllerDeleteData,
77
+ TransactionRuleControllerDeleteResponse,
78
+ TransactionRuleControllerTestData,
79
+ TransactionRuleControllerTestResponse,
80
+ UserControllerDeleteOwnUserData,
81
+ UserControllerDeleteOwnUserResponse,
82
+ UserControllerGetUserData,
83
+ UserControllerGetUserResponse,
84
+ UserControllerSignupUserData,
85
+ UserControllerSignupUserResponse,
86
+ UserControllerDeleteUserData,
87
+ UserControllerDeleteUserResponse,
88
+ UserControllerGetUserInfoData,
89
+ UserControllerGetUserInfoResponse,
90
+ UserControllerUpdateUserSettingData,
91
+ UserControllerUpdateUserSettingResponse,
92
+ UserControllerGetAllUserSettingsByPageData,
93
+ UserControllerGetAllUserSettingsByPageResponse,
94
+ UserControllerGetAssetLiabilitySummaryResponse,
95
+ PropertyControllerGetAllResponse,
96
+ PropertyControllerGetByKeyData,
97
+ PropertyControllerGetByKeyResponse,
98
+ PropertyControllerUpdateData,
99
+ PropertyControllerUpdateResponse,
100
+ PropertyControllerDeleteData,
101
+ PropertyControllerDeleteResponse,
58
102
  PayeeControllerCreateData,
59
103
  PayeeControllerCreateResponse,
60
104
  PayeeControllerFindAllData,
@@ -83,6 +127,7 @@ import type {
83
127
  PayeeProfileAdminControllerVerifyResponse,
84
128
  PayeeProfileAdminControllerUnverifyData,
85
129
  PayeeProfileAdminControllerUnverifyResponse,
130
+ PayeeProfileControllerListActiveResponse,
86
131
  CommodityControllerCreateData,
87
132
  CommodityControllerCreateResponse,
88
133
  CommodityControllerFindAllData,
@@ -97,6 +142,26 @@ import type {
97
142
  CommodityControllerGetOrCreateResponse,
98
143
  CommodityControllerBulkCreateData,
99
144
  CommodityControllerBulkCreateResponse,
145
+ ReportingControllerGetPortfolioTrendsData,
146
+ ReportingControllerGetPortfolioTrendsResponse,
147
+ ReportingControllerGetCashFlowTrendsData,
148
+ ReportingControllerGetCashFlowTrendsResponse,
149
+ ReportingControllerGenerateSnapshotData,
150
+ ReportingControllerGenerateSnapshotResponse,
151
+ ReportingControllerBackfillSnapshotsData,
152
+ ReportingControllerBackfillSnapshotsResponse,
153
+ PriceControllerCreateData,
154
+ PriceControllerCreateResponse,
155
+ PriceControllerFindAllData,
156
+ PriceControllerFindAllResponse,
157
+ PriceControllerFindOneData,
158
+ PriceControllerFindOneResponse,
159
+ PriceControllerUpdateData,
160
+ PriceControllerUpdateResponse,
161
+ PriceControllerDeleteData,
162
+ PriceControllerDeleteResponse,
163
+ PriceControllerBulkCreateData,
164
+ PriceControllerBulkCreateResponse,
100
165
  RecurringRuleControllerCreateData,
101
166
  RecurringRuleControllerCreateResponse,
102
167
  RecurringRuleControllerFindAllData,
@@ -129,48 +194,31 @@ import type {
129
194
  ExpectedTransactionControllerEnterNowResponse,
130
195
  ForecastControllerGetForecastData,
131
196
  ForecastControllerGetForecastResponse,
132
- TransactionRuleControllerCreateData,
133
- TransactionRuleControllerCreateResponse,
134
- TransactionRuleControllerListData,
135
- TransactionRuleControllerListResponse,
136
- TransactionRuleControllerValidateData,
137
- TransactionRuleControllerValidateResponse,
138
- TransactionRuleControllerBulkCreateData,
139
- TransactionRuleControllerBulkCreateResponse,
140
- TransactionRuleControllerExportData,
141
- TransactionRuleControllerExportResponse,
142
- TransactionRuleControllerGetStatisticsData,
143
- TransactionRuleControllerGetStatisticsResponse,
144
- TransactionRuleControllerGetDetailData,
145
- TransactionRuleControllerGetDetailResponse,
146
- TransactionRuleControllerUpdateData,
147
- TransactionRuleControllerUpdateResponse,
148
- TransactionRuleControllerDeleteData,
149
- TransactionRuleControllerDeleteResponse,
150
- TransactionRuleControllerTestData,
151
- TransactionRuleControllerTestResponse,
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,
197
+ CategoryCatalogControllerListData,
198
+ CategoryCatalogControllerListResponse,
199
+ EventControllerCreateData,
200
+ EventControllerCreateResponse,
201
+ EventControllerFindAllData,
202
+ EventControllerFindAllResponse,
203
+ EventControllerFindOneData,
204
+ EventControllerFindOneResponse,
205
+ EventControllerUpdateData,
206
+ EventControllerUpdateResponse,
207
+ EventControllerDeleteData,
208
+ EventControllerDeleteResponse,
209
+ EventControllerGetSliceData,
210
+ EventControllerGetSliceResponse,
211
+ OnboardingControllerBootstrapData,
212
+ OnboardingControllerBootstrapResponse,
213
+ ReconciliationControllerComputeData,
214
+ ReconciliationControllerComputeResponse,
215
+ ReconciliationControllerAssertData,
216
+ ReconciliationControllerAssertResponse,
217
+ ReconciliationControllerPadData,
218
+ ReconciliationControllerPadResponse,
219
+ ReconciliationControllerHistoryData,
220
+ ReconciliationControllerHistoryResponse,
221
+ ExportControllerExportBeancountData,
174
222
  ExportControllerExportBeancountResponse,
175
223
  FileImportControllerImportFileData,
176
224
  FileImportControllerImportFileResponse,
@@ -184,22 +232,20 @@ import type {
184
232
  ImporterConfigControllerUpdateConfigResponse,
185
233
  ImporterConfigControllerResetConfigData,
186
234
  ImporterConfigControllerResetConfigResponse,
187
- PlatformControllerFindAllResponse,
188
- PlatformControllerCreateData,
189
- PlatformControllerCreateResponse,
190
- PlatformControllerGetPlatformListResponse,
191
- PlatformControllerMatchPlatformsData,
192
- PlatformControllerMatchPlatformsResponse,
193
- PlatformControllerUpdateData,
194
- PlatformControllerUpdateResponse,
195
- PlatformControllerDeleteData,
196
- PlatformControllerDeleteResponse,
197
235
  ProviderSyncControllerSyncData,
198
236
  ProviderSyncControllerSyncResponse,
199
237
  ProviderSyncControllerGetSupportedProvidersData,
200
238
  ProviderSyncControllerGetSupportedProvidersResponse,
201
239
  ProviderSyncControllerIsProviderSupportedData,
202
240
  ProviderSyncControllerIsProviderSupportedResponse,
241
+ ExternalAccountLinkControllerCreateData,
242
+ ExternalAccountLinkControllerCreateResponse,
243
+ ExternalAccountLinkControllerFindAllData,
244
+ ExternalAccountLinkControllerFindAllResponse,
245
+ ExternalAccountLinkControllerFindOneData,
246
+ ExternalAccountLinkControllerFindOneResponse,
247
+ ExternalAccountLinkControllerRemoveData,
248
+ ExternalAccountLinkControllerRemoveResponse,
203
249
  TelemetryControllerReportTelemetryData,
204
250
  TelemetryControllerReportTelemetryResponse,
205
251
  TelemetryControllerReportCoverageMissData,
@@ -212,35 +258,38 @@ import type {
212
258
  NlpControllerClearSessionResponse,
213
259
  NlpControllerGetSessionData,
214
260
  NlpControllerGetSessionResponse,
261
+ PlatformControllerFindAllResponse,
262
+ PlatformControllerCreateData,
263
+ PlatformControllerCreateResponse,
264
+ PlatformControllerGetPlatformListData,
265
+ PlatformControllerGetPlatformListResponse,
266
+ PlatformControllerMatchPlatformsData,
267
+ PlatformControllerMatchPlatformsResponse,
268
+ PlatformControllerGetPlatformStandardsData,
269
+ PlatformControllerGetPlatformStandardsResponse,
270
+ PlatformControllerUpdateData,
271
+ PlatformControllerUpdateResponse,
272
+ PlatformControllerDeleteData,
273
+ PlatformControllerDeleteResponse,
215
274
  DashboardControllerGetNetWorthData,
216
275
  DashboardControllerGetNetWorthResponse,
217
276
  DashboardControllerGetAccountsData,
218
277
  DashboardControllerGetAccountsResponse,
219
278
  DashboardControllerGetCashFlowData,
220
279
  DashboardControllerGetCashFlowResponse,
280
+ DashboardControllerGetExpensesData,
281
+ DashboardControllerGetExpensesResponse,
282
+ DashboardControllerGetAdvisorContextData,
283
+ DashboardControllerGetAdvisorContextResponse,
221
284
  HoldingPnlControllerGetHoldingPnlData,
222
285
  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
286
  ApiKeysControllerCreateApiKeyResponse,
242
287
  AuthControllerAccessTokenLoginData,
243
288
  AuthControllerAccessTokenLoginResponse,
289
+ AuthControllerAdvisorTokenLoginData,
290
+ AuthControllerAdvisorTokenLoginResponse,
291
+ ParserContributionControllerCreateData,
292
+ ParserContributionControllerCreateResponse,
244
293
  CacheControllerFlushCacheResponse,
245
294
  ExchangeRateControllerGetExchangeRateData,
246
295
  ExchangeRateControllerGetExchangeRateResponse,
@@ -252,15 +301,21 @@ import type {
252
301
  HealthControllerResetCircuitBreakerData,
253
302
  HealthControllerResetCircuitBreakerResponse,
254
303
  HealthControllerGetMetricsResponse,
255
- InfoControllerGetInfoResponse
304
+ InfoControllerGetInfoResponse,
305
+ SymbolControllerSearchData,
306
+ SymbolControllerSearchResponse,
307
+ SymbolControllerGetQuoteData,
308
+ SymbolControllerGetQuoteResponse
256
309
  } from './types.gen';
257
310
 
258
311
  export class BeanAccountsService {
259
312
  /**
313
+ * Create a new account
314
+ * Creates a new account (Beancount Open directive)
260
315
  * @param data The data for the request.
261
316
  * @param data.region Region code for tenant context
262
317
  * @param data.requestBody
263
- * @returns unknown
318
+ * @returns AccountResponseDto Account created successfully
264
319
  * @throws ApiError
265
320
  */
266
321
  public static accountControllerCreate(
@@ -273,7 +328,10 @@ export class BeanAccountsService {
273
328
  region: data.region
274
329
  },
275
330
  body: data.requestBody,
276
- mediaType: 'application/json'
331
+ mediaType: 'application/json',
332
+ errors: {
333
+ 409: 'Account already exists'
334
+ }
277
335
  });
278
336
  }
279
337
 
@@ -285,7 +343,7 @@ export class BeanAccountsService {
285
343
  * @param data.type Filter by account type
286
344
  * @param data.status Filter by status
287
345
  * @param data.isCustom Filter by custom (user-created) accounts only
288
- * @param data.search Search term for path or i18nKey
346
+ * @param data.search Search term matched against account path and user-set display name (case-insensitive)
289
347
  * @param data.limit Maximum number of results
290
348
  * @param data.offset Number of results to skip
291
349
  * @returns AccountListResponseDto Accounts retrieved successfully
@@ -337,11 +395,13 @@ export class BeanAccountsService {
337
395
  }
338
396
 
339
397
  /**
398
+ * Update account
399
+ * Updates account metadata (path cannot be changed)
340
400
  * @param data The data for the request.
341
- * @param data.id
401
+ * @param data.id Account UUID
342
402
  * @param data.region Region code for tenant context
343
403
  * @param data.requestBody
344
- * @returns unknown
404
+ * @returns AccountResponseDto Account updated successfully
345
405
  * @throws ApiError
346
406
  */
347
407
  public static accountControllerUpdate(
@@ -355,15 +415,20 @@ export class BeanAccountsService {
355
415
  region: data.region
356
416
  },
357
417
  body: data.requestBody,
358
- mediaType: 'application/json'
418
+ mediaType: 'application/json',
419
+ errors: {
420
+ 404: 'Account not found'
421
+ }
359
422
  });
360
423
  }
361
424
 
362
425
  /**
426
+ * Delete account
427
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
363
428
  * @param data The data for the request.
364
- * @param data.id
429
+ * @param data.id Account UUID
365
430
  * @param data.region Region code for tenant context
366
- * @returns unknown
431
+ * @returns void Account deleted successfully
367
432
  * @throws ApiError
368
433
  */
369
434
  public static accountControllerDelete(
@@ -375,16 +440,22 @@ export class BeanAccountsService {
375
440
  path: {
376
441
  id: data.id,
377
442
  region: data.region
443
+ },
444
+ errors: {
445
+ 404: 'Account not found',
446
+ 409: 'Account has active transactions and cannot be deleted'
378
447
  }
379
448
  });
380
449
  }
381
450
 
382
451
  /**
452
+ * Close account
453
+ * Closes an account (Beancount Close directive)
383
454
  * @param data The data for the request.
384
- * @param data.id
455
+ * @param data.id Account UUID
385
456
  * @param data.region Region code for tenant context
386
457
  * @param data.requestBody
387
- * @returns unknown
458
+ * @returns AccountResponseDto Account closed successfully
388
459
  * @throws ApiError
389
460
  */
390
461
  public static accountControllerClose(
@@ -398,16 +469,22 @@ export class BeanAccountsService {
398
469
  region: data.region
399
470
  },
400
471
  body: data.requestBody,
401
- mediaType: 'application/json'
472
+ mediaType: 'application/json',
473
+ errors: {
474
+ 400: 'Account is already closed',
475
+ 404: 'Account not found'
476
+ }
402
477
  });
403
478
  }
404
479
 
405
480
  /**
481
+ * Reopen account
482
+ * Reopens a previously closed account
406
483
  * @param data The data for the request.
407
- * @param data.id
484
+ * @param data.id Account UUID
408
485
  * @param data.region Region code for tenant context
409
486
  * @param data.requestBody
410
- * @returns unknown
487
+ * @returns AccountResponseDto Account reopened successfully
411
488
  * @throws ApiError
412
489
  */
413
490
  public static accountControllerReopen(
@@ -421,7 +498,40 @@ export class BeanAccountsService {
421
498
  region: data.region
422
499
  },
423
500
  body: data.requestBody,
424
- mediaType: 'application/json'
501
+ mediaType: 'application/json',
502
+ errors: {
503
+ 400: 'Account is not closed',
504
+ 404: 'Account not found'
505
+ }
506
+ });
507
+ }
508
+
509
+ /**
510
+ * Post an opening-balance transaction
511
+ * 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.
512
+ * @param data The data for the request.
513
+ * @param data.id Account UUID
514
+ * @param data.region Region code for tenant context
515
+ * @param data.requestBody
516
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
517
+ * @throws ApiError
518
+ */
519
+ public static accountControllerAddOpeningBalance(
520
+ data: AccountControllerAddOpeningBalanceData
521
+ ): CancelablePromise<AccountControllerAddOpeningBalanceResponse> {
522
+ return __request(OpenAPI, {
523
+ method: 'POST',
524
+ url: '/api/v1/{region}/bean/accounts/{id}/opening-balance',
525
+ path: {
526
+ id: data.id,
527
+ region: data.region
528
+ },
529
+ body: data.requestBody,
530
+ mediaType: 'application/json',
531
+ errors: {
532
+ 404: 'Account not found',
533
+ 409: 'An opening balance already exists for this account'
534
+ }
425
535
  });
426
536
  }
427
537
  }
@@ -429,11 +539,11 @@ export class BeanAccountsService {
429
539
  export class BeanAccountStandardsService {
430
540
  /**
431
541
  * Get account templates
432
- * Returns predefined account templates for a region. Supports filtering by account type and search term.
542
+ * 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).
433
543
  * @param data The data for the request.
434
- * @param data.region Region code (cn, us, de)
544
+ * @param data.region Region code (any ISO alpha-2; not-yet-open codes return the universal-only catalog)
435
545
  * @param data.type Filter by account type
436
- * @param data.search Search term for path or description
546
+ * @param data.search Search term for path, description, aliases, or localized display name
437
547
  * @returns AccountStandardListResponseDto Account templates retrieved successfully
438
548
  * @throws ApiError
439
549
  */
@@ -455,9 +565,9 @@ export class BeanAccountStandardsService {
455
565
 
456
566
  /**
457
567
  * Get template metadata for an account path
458
- * Returns extendable status and root type for a template path.
568
+ * Returns root type for a template path.
459
569
  * @param data The data for the request.
460
- * @param data.region Region code for tenant context
570
+ * @param data.region Region code for tenant context. Not-yet-open codes degrade to the universal-only catalog (#759)
461
571
  * @param data.path Account path to check
462
572
  * @returns TemplateMetadataResponseDto Template metadata retrieved successfully
463
573
  * @throws ApiError
@@ -479,9 +589,9 @@ export class BeanAccountStandardsService {
479
589
 
480
590
  /**
481
591
  * Get available regions with hierarchy
482
- * Returns supported regions with inheritance metadata
592
+ * Returns the full region catalog (every ISO 3166-1 entry) with an 'open' flag and inheritance metadata (#759)
483
593
  * @param data The data for the request.
484
- * @param data.region Region code for tenant context
594
+ * @param data.region Region code for tenant context. Not-yet-open codes degrade to the universal-only catalog (#759)
485
595
  * @returns RegionsMetadataResponseDto Regions metadata retrieved successfully
486
596
  * @throws ApiError
487
597
  */
@@ -538,9 +648,11 @@ export class BeanTransactionsService {
538
648
  * @param data.offset Number of items to skip (default: 0)
539
649
  * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
540
650
  * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
541
- * @param data.status Filter by transaction status
651
+ * @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).
542
652
  * @param data.search Search in narration and payee fields (max 200 chars)
543
653
  * @param data.accountId Filter by account ID (transactions with postings to this account)
654
+ * @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).
655
+ * @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.
544
656
  * @returns TransactionListResponseDto Transaction list
545
657
  * @throws ApiError
546
658
  */
@@ -560,7 +672,9 @@ export class BeanTransactionsService {
560
672
  dateTo: data.dateTo,
561
673
  status: data.status,
562
674
  search: data.search,
563
- accountId: data.accountId
675
+ accountId: data.accountId,
676
+ category: data.category,
677
+ flow: data.flow
564
678
  },
565
679
  errors: {
566
680
  400: 'Validation failed',
@@ -748,7 +862,7 @@ export class BeanBalancesService {
748
862
  * Query account balance
749
863
  * Calculate account balance at a specific date for a single currency
750
864
  * @param data The data for the request.
751
- * @param data.account Account name (e.g., "Assets:Bank:Checking")
865
+ * @param data.account Account name (e.g., "Assets:Checking")
752
866
  * @param data.region Region code for tenant context
753
867
  * @param data.date Date to calculate balance at (ISO 8601 format)
754
868
  * @param data.currency Currency to query (e.g., "USD", "CNY")
@@ -941,59 +1055,592 @@ export class BeanReviewsService {
941
1055
  }
942
1056
  }
943
1057
 
944
- export class BeanPayeesService {
1058
+ export class BeanTransactionRulesService {
945
1059
  /**
946
- * Create a new payee
947
- * Creates a new payee mapping for the authenticated user. The payee name must be unique within the user's account.
1060
+ * Create a new transaction rule (or upsert if upsertByPayee=true)
1061
+ * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
948
1062
  * @param data The data for the request.
1063
+ * @param data.region Region code for tenant context
949
1064
  * @param data.requestBody
950
- * @returns PayeeResponseDto Payee created successfully
1065
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
951
1066
  * @throws ApiError
952
1067
  */
953
- public static payeeControllerCreate(
954
- data: PayeeControllerCreateData
955
- ): CancelablePromise<PayeeControllerCreateResponse> {
1068
+ public static transactionRuleControllerCreate(
1069
+ data: TransactionRuleControllerCreateData
1070
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
956
1071
  return __request(OpenAPI, {
957
1072
  method: 'POST',
958
- url: '/api/v1/bean/payees',
1073
+ url: '/api/v1/{region}/bean/transaction-rules',
1074
+ path: {
1075
+ region: data.region
1076
+ },
959
1077
  body: data.requestBody,
960
1078
  mediaType: 'application/json',
961
1079
  errors: {
962
- 400: 'Invalid input data',
963
- 409: 'Payee already exists'
1080
+ 400: 'Validation failed',
1081
+ 401: 'Unauthorized',
1082
+ 409: 'Resource conflict - another process is updating this rule'
964
1083
  }
965
1084
  });
966
1085
  }
967
1086
 
968
1087
  /**
969
- * List user payees
970
- * Returns all payee mappings for the authenticated user with optional filtering
1088
+ * Get all transaction rules for user
971
1089
  * @param data The data for the request.
972
- * @param data.search Search term for payee name (partial match, case-insensitive). Useful for autocomplete.
973
- * @param data.payee Filter by exact payee name match
974
- * @param data.category Filter by custom category
975
- * @param data.tag Filter by custom tag (returns payees that have this tag)
976
- * @param data.isActive Filter by active status. Defaults to true (show only active payees).
977
- * @returns PayeeListResponseDto Payees retrieved successfully
1090
+ * @param data.region Region code for tenant context
1091
+ * @param data.limit Max results per page (default: 20, max: 100)
1092
+ * @param data.offset Pagination offset (default: 0)
1093
+ * @param data.enabled Filter by enabled status
1094
+ * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
1095
+ * @param data.autoApplyEnabled Filter by auto-apply status
1096
+ * @returns TransactionRuleListResponseDto List of rules
978
1097
  * @throws ApiError
979
1098
  */
980
- public static payeeControllerFindAll(
981
- data: PayeeControllerFindAllData = {}
982
- ): CancelablePromise<PayeeControllerFindAllResponse> {
1099
+ public static transactionRuleControllerList(
1100
+ data: TransactionRuleControllerListData
1101
+ ): CancelablePromise<TransactionRuleControllerListResponse> {
983
1102
  return __request(OpenAPI, {
984
1103
  method: 'GET',
985
- url: '/api/v1/bean/payees',
1104
+ url: '/api/v1/{region}/bean/transaction-rules',
1105
+ path: {
1106
+ region: data.region
1107
+ },
986
1108
  query: {
987
- search: data.search,
988
- payee: data.payee,
989
- category: data.category,
990
- tag: data.tag,
991
- isActive: data.isActive
992
- }
993
- });
994
- }
995
-
996
- /**
1109
+ limit: data.limit,
1110
+ offset: data.offset,
1111
+ enabled: data.enabled,
1112
+ learningSource: data.learningSource,
1113
+ autoApplyEnabled: data.autoApplyEnabled
1114
+ },
1115
+ errors: {
1116
+ 401: 'Unauthorized'
1117
+ }
1118
+ });
1119
+ }
1120
+
1121
+ /**
1122
+ * Validate transaction rule configuration
1123
+ * @param data The data for the request.
1124
+ * @param data.region Region code for tenant context
1125
+ * @param data.requestBody
1126
+ * @returns ValidateRuleResponseDto Validation result
1127
+ * @throws ApiError
1128
+ */
1129
+ public static transactionRuleControllerValidate(
1130
+ data: TransactionRuleControllerValidateData
1131
+ ): CancelablePromise<TransactionRuleControllerValidateResponse> {
1132
+ return __request(OpenAPI, {
1133
+ method: 'POST',
1134
+ url: '/api/v1/{region}/bean/transaction-rules/validate',
1135
+ path: {
1136
+ region: data.region
1137
+ },
1138
+ body: data.requestBody,
1139
+ mediaType: 'application/json',
1140
+ errors: {
1141
+ 400: 'Validation failed',
1142
+ 401: 'Unauthorized'
1143
+ }
1144
+ });
1145
+ }
1146
+
1147
+ /**
1148
+ * Bulk create transaction rules
1149
+ * @param data The data for the request.
1150
+ * @param data.region Region code for tenant context
1151
+ * @param data.requestBody
1152
+ * @returns BulkCreateRulesResponseDto Bulk create completed
1153
+ * @throws ApiError
1154
+ */
1155
+ public static transactionRuleControllerBulkCreate(
1156
+ data: TransactionRuleControllerBulkCreateData
1157
+ ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
1158
+ return __request(OpenAPI, {
1159
+ method: 'POST',
1160
+ url: '/api/v1/{region}/bean/transaction-rules/bulk',
1161
+ path: {
1162
+ region: data.region
1163
+ },
1164
+ body: data.requestBody,
1165
+ mediaType: 'application/json',
1166
+ errors: {
1167
+ 400: 'Invalid bulk create data',
1168
+ 401: 'Unauthorized'
1169
+ }
1170
+ });
1171
+ }
1172
+
1173
+ /**
1174
+ * Export transaction rules
1175
+ * @param data The data for the request.
1176
+ * @param data.format Export format (currently only JSON supported)
1177
+ * @param data.region Region code for tenant context
1178
+ * @returns ExportRulesResponseDto Exported rules
1179
+ * @throws ApiError
1180
+ */
1181
+ public static transactionRuleControllerExport(
1182
+ data: TransactionRuleControllerExportData
1183
+ ): CancelablePromise<TransactionRuleControllerExportResponse> {
1184
+ return __request(OpenAPI, {
1185
+ method: 'GET',
1186
+ url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
1187
+ path: {
1188
+ format: data.format,
1189
+ region: data.region
1190
+ },
1191
+ errors: {
1192
+ 400: 'Unsupported format',
1193
+ 401: 'Unauthorized'
1194
+ }
1195
+ });
1196
+ }
1197
+
1198
+ /**
1199
+ * Get transaction rule statistics
1200
+ * @param data The data for the request.
1201
+ * @param data.period Statistics time period
1202
+ * @param data.region Region code for tenant context
1203
+ * @returns RuleStatisticsResponseDto Rule statistics
1204
+ * @throws ApiError
1205
+ */
1206
+ public static transactionRuleControllerGetStatistics(
1207
+ data: TransactionRuleControllerGetStatisticsData
1208
+ ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
1209
+ return __request(OpenAPI, {
1210
+ method: 'GET',
1211
+ url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
1212
+ path: {
1213
+ period: data.period,
1214
+ region: data.region
1215
+ },
1216
+ errors: {
1217
+ 401: 'Unauthorized'
1218
+ }
1219
+ });
1220
+ }
1221
+
1222
+ /**
1223
+ * Get transaction rule detail
1224
+ * @param data The data for the request.
1225
+ * @param data.ruleId Rule ID
1226
+ * @param data.region Region code for tenant context
1227
+ * @returns TransactionRuleResponseDto Rule details
1228
+ * @throws ApiError
1229
+ */
1230
+ public static transactionRuleControllerGetDetail(
1231
+ data: TransactionRuleControllerGetDetailData
1232
+ ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
1233
+ return __request(OpenAPI, {
1234
+ method: 'GET',
1235
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
1236
+ path: {
1237
+ ruleId: data.ruleId,
1238
+ region: data.region
1239
+ },
1240
+ errors: {
1241
+ 401: 'Unauthorized',
1242
+ 403: 'Forbidden - not owner of rule',
1243
+ 404: 'Rule not found'
1244
+ }
1245
+ });
1246
+ }
1247
+
1248
+ /**
1249
+ * Update a transaction rule
1250
+ * @param data The data for the request.
1251
+ * @param data.ruleId Rule ID to update
1252
+ * @param data.region Region code for tenant context
1253
+ * @param data.requestBody
1254
+ * @returns TransactionRuleResponseDto Rule updated successfully
1255
+ * @throws ApiError
1256
+ */
1257
+ public static transactionRuleControllerUpdate(
1258
+ data: TransactionRuleControllerUpdateData
1259
+ ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
1260
+ return __request(OpenAPI, {
1261
+ method: 'PUT',
1262
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
1263
+ path: {
1264
+ ruleId: data.ruleId,
1265
+ region: data.region
1266
+ },
1267
+ body: data.requestBody,
1268
+ mediaType: 'application/json',
1269
+ errors: {
1270
+ 400: 'Validation failed',
1271
+ 401: 'Unauthorized',
1272
+ 403: 'Forbidden - not owner of rule',
1273
+ 404: 'Rule not found',
1274
+ 409: 'Resource conflict - rule is being modified by another process'
1275
+ }
1276
+ });
1277
+ }
1278
+
1279
+ /**
1280
+ * Delete a transaction rule
1281
+ * @param data The data for the request.
1282
+ * @param data.ruleId Rule ID to delete
1283
+ * @param data.region Region code for tenant context
1284
+ * @returns void Rule deleted successfully
1285
+ * @throws ApiError
1286
+ */
1287
+ public static transactionRuleControllerDelete(
1288
+ data: TransactionRuleControllerDeleteData
1289
+ ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
1290
+ return __request(OpenAPI, {
1291
+ method: 'DELETE',
1292
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
1293
+ path: {
1294
+ ruleId: data.ruleId,
1295
+ region: data.region
1296
+ },
1297
+ errors: {
1298
+ 401: 'Unauthorized',
1299
+ 403: 'Forbidden - not owner of rule',
1300
+ 404: 'Rule not found',
1301
+ 409: 'Resource conflict - rule is being modified by another process'
1302
+ }
1303
+ });
1304
+ }
1305
+
1306
+ /**
1307
+ * Test rule matching
1308
+ * @param data The data for the request.
1309
+ * @param data.ruleId Rule ID to test
1310
+ * @param data.region Region code for tenant context
1311
+ * @param data.requestBody
1312
+ * @returns TestRuleResponseDto Test result
1313
+ * @throws ApiError
1314
+ */
1315
+ public static transactionRuleControllerTest(
1316
+ data: TransactionRuleControllerTestData
1317
+ ): CancelablePromise<TransactionRuleControllerTestResponse> {
1318
+ return __request(OpenAPI, {
1319
+ method: 'POST',
1320
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
1321
+ path: {
1322
+ ruleId: data.ruleId,
1323
+ region: data.region
1324
+ },
1325
+ body: data.requestBody,
1326
+ mediaType: 'application/json',
1327
+ errors: {
1328
+ 401: 'Unauthorized',
1329
+ 403: 'Forbidden - not owner of rule',
1330
+ 404: 'Rule not found'
1331
+ }
1332
+ });
1333
+ }
1334
+ }
1335
+
1336
+ export class UsersService {
1337
+ /**
1338
+ * Delete own user account
1339
+ * @param data The data for the request.
1340
+ * @param data.requestBody
1341
+ * @returns void User deleted successfully
1342
+ * @throws ApiError
1343
+ */
1344
+ public static userControllerDeleteOwnUser(
1345
+ data: UserControllerDeleteOwnUserData
1346
+ ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
1347
+ return __request(OpenAPI, {
1348
+ method: 'DELETE',
1349
+ url: '/api/v1/users',
1350
+ body: data.requestBody,
1351
+ mediaType: 'application/json',
1352
+ errors: {
1353
+ 403: 'Invalid access token'
1354
+ }
1355
+ });
1356
+ }
1357
+
1358
+ /**
1359
+ * Get current authenticated user
1360
+ * @param data The data for the request.
1361
+ * @param data.acceptLanguage
1362
+ * @returns UserResponseDto User retrieved successfully
1363
+ * @throws ApiError
1364
+ */
1365
+ public static userControllerGetUser(
1366
+ data: UserControllerGetUserData
1367
+ ): CancelablePromise<UserControllerGetUserResponse> {
1368
+ return __request(OpenAPI, {
1369
+ method: 'GET',
1370
+ url: '/api/v1/users',
1371
+ headers: {
1372
+ 'accept-language': data.acceptLanguage
1373
+ }
1374
+ });
1375
+ }
1376
+
1377
+ /**
1378
+ * Sign up new user
1379
+ * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
1380
+ * @param data The data for the request.
1381
+ * @param data.requestBody
1382
+ * @returns SignupResponseDto User created successfully
1383
+ * @throws ApiError
1384
+ */
1385
+ public static userControllerSignupUser(
1386
+ data: UserControllerSignupUserData
1387
+ ): CancelablePromise<UserControllerSignupUserResponse> {
1388
+ return __request(OpenAPI, {
1389
+ method: 'POST',
1390
+ url: '/api/v1/users',
1391
+ body: data.requestBody,
1392
+ mediaType: 'application/json',
1393
+ errors: {
1394
+ 400: 'Invalid Turnstile token (when Turnstile is enabled)',
1395
+ 403: 'User signup is disabled'
1396
+ }
1397
+ });
1398
+ }
1399
+
1400
+ /**
1401
+ * Delete user by ID (admin only)
1402
+ * @param data The data for the request.
1403
+ * @param data.id User ID to delete
1404
+ * @returns void User deleted successfully
1405
+ * @throws ApiError
1406
+ */
1407
+ public static userControllerDeleteUser(
1408
+ data: UserControllerDeleteUserData
1409
+ ): CancelablePromise<UserControllerDeleteUserResponse> {
1410
+ return __request(OpenAPI, {
1411
+ method: 'DELETE',
1412
+ url: '/api/v1/users/{id}',
1413
+ path: {
1414
+ id: data.id
1415
+ },
1416
+ errors: {
1417
+ 403: 'Cannot delete own account or insufficient permissions'
1418
+ }
1419
+ });
1420
+ }
1421
+
1422
+ /**
1423
+ * Get user info by user ID
1424
+ * @param data The data for the request.
1425
+ * @param data.id User ID
1426
+ * @returns unknown User info retrieved successfully
1427
+ * @throws ApiError
1428
+ */
1429
+ public static userControllerGetUserInfo(
1430
+ data: UserControllerGetUserInfoData
1431
+ ): CancelablePromise<UserControllerGetUserInfoResponse> {
1432
+ return __request(OpenAPI, {
1433
+ method: 'GET',
1434
+ url: '/api/v1/users/{id}/info',
1435
+ path: {
1436
+ id: data.id
1437
+ },
1438
+ errors: {
1439
+ 403: 'Cannot access other user info without admin permission'
1440
+ }
1441
+ });
1442
+ }
1443
+
1444
+ /**
1445
+ * Update user settings
1446
+ * @param data The data for the request.
1447
+ * @param data.requestBody
1448
+ * @returns unknown Settings updated successfully
1449
+ * @throws ApiError
1450
+ */
1451
+ public static userControllerUpdateUserSetting(
1452
+ data: UserControllerUpdateUserSettingData
1453
+ ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
1454
+ return __request(OpenAPI, {
1455
+ method: 'PUT',
1456
+ url: '/api/v1/users/setting',
1457
+ body: data.requestBody,
1458
+ mediaType: 'application/json',
1459
+ errors: {
1460
+ 403: 'Insufficient permissions'
1461
+ }
1462
+ });
1463
+ }
1464
+
1465
+ /**
1466
+ * Get all user settings paginated (admin only)
1467
+ * @param data The data for the request.
1468
+ * @param data.pageNo Page number
1469
+ * @param data.pageSize Page size
1470
+ * @returns unknown Settings list retrieved successfully
1471
+ * @throws ApiError
1472
+ */
1473
+ public static userControllerGetAllUserSettingsByPage(
1474
+ data: UserControllerGetAllUserSettingsByPageData
1475
+ ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
1476
+ return __request(OpenAPI, {
1477
+ method: 'GET',
1478
+ url: '/api/v1/users/settings-by-page',
1479
+ query: {
1480
+ pageNo: data.pageNo,
1481
+ pageSize: data.pageSize
1482
+ }
1483
+ });
1484
+ }
1485
+
1486
+ /**
1487
+ * Get asset and liability summary for current user
1488
+ * @returns unknown Summary retrieved successfully
1489
+ * @throws ApiError
1490
+ */
1491
+ public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
1492
+ return __request(OpenAPI, {
1493
+ method: 'GET',
1494
+ url: '/api/v1/users/asset-liability-summary'
1495
+ });
1496
+ }
1497
+ }
1498
+
1499
+ export class PropertiesService {
1500
+ /**
1501
+ * Get all system properties
1502
+ * @returns unknown Properties retrieved successfully
1503
+ * @throws ApiError
1504
+ */
1505
+ public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
1506
+ return __request(OpenAPI, {
1507
+ method: 'GET',
1508
+ url: '/api/v1/admin/properties',
1509
+ errors: {
1510
+ 401: 'Unauthorized',
1511
+ 403: 'Forbidden - insufficient permissions'
1512
+ }
1513
+ });
1514
+ }
1515
+
1516
+ /**
1517
+ * Get property by key
1518
+ * @param data The data for the request.
1519
+ * @param data.key Property key
1520
+ * @returns unknown Property retrieved successfully
1521
+ * @throws ApiError
1522
+ */
1523
+ public static propertyControllerGetByKey(
1524
+ data: PropertyControllerGetByKeyData
1525
+ ): CancelablePromise<PropertyControllerGetByKeyResponse> {
1526
+ return __request(OpenAPI, {
1527
+ method: 'GET',
1528
+ url: '/api/v1/admin/properties/{key}',
1529
+ path: {
1530
+ key: data.key
1531
+ },
1532
+ errors: {
1533
+ 401: 'Unauthorized',
1534
+ 403: 'Forbidden - insufficient permissions',
1535
+ 404: 'Property not found'
1536
+ }
1537
+ });
1538
+ }
1539
+
1540
+ /**
1541
+ * Update a system property
1542
+ * @param data The data for the request.
1543
+ * @param data.key Property key
1544
+ * @param data.requestBody
1545
+ * @returns unknown Property updated successfully
1546
+ * @throws ApiError
1547
+ */
1548
+ public static propertyControllerUpdate(
1549
+ data: PropertyControllerUpdateData
1550
+ ): CancelablePromise<PropertyControllerUpdateResponse> {
1551
+ return __request(OpenAPI, {
1552
+ method: 'PUT',
1553
+ url: '/api/v1/admin/properties/{key}',
1554
+ path: {
1555
+ key: data.key
1556
+ },
1557
+ body: data.requestBody,
1558
+ mediaType: 'application/json',
1559
+ errors: {
1560
+ 401: 'Unauthorized',
1561
+ 403: 'Forbidden - insufficient permissions'
1562
+ }
1563
+ });
1564
+ }
1565
+
1566
+ /**
1567
+ * Delete a system property
1568
+ * @param data The data for the request.
1569
+ * @param data.key Property key
1570
+ * @returns void Property deleted successfully
1571
+ * @throws ApiError
1572
+ */
1573
+ public static propertyControllerDelete(
1574
+ data: PropertyControllerDeleteData
1575
+ ): CancelablePromise<PropertyControllerDeleteResponse> {
1576
+ return __request(OpenAPI, {
1577
+ method: 'DELETE',
1578
+ url: '/api/v1/admin/properties/{key}',
1579
+ path: {
1580
+ key: data.key
1581
+ },
1582
+ errors: {
1583
+ 401: 'Unauthorized',
1584
+ 403: 'Forbidden - insufficient permissions',
1585
+ 404: 'Property not found'
1586
+ }
1587
+ });
1588
+ }
1589
+ }
1590
+
1591
+ export class BeanPayeesService {
1592
+ /**
1593
+ * Create a new payee
1594
+ * Creates a new payee mapping for the authenticated user. The payee name must be unique within the user's account.
1595
+ * @param data The data for the request.
1596
+ * @param data.requestBody
1597
+ * @returns PayeeResponseDto Payee created successfully
1598
+ * @throws ApiError
1599
+ */
1600
+ public static payeeControllerCreate(
1601
+ data: PayeeControllerCreateData
1602
+ ): CancelablePromise<PayeeControllerCreateResponse> {
1603
+ return __request(OpenAPI, {
1604
+ method: 'POST',
1605
+ url: '/api/v1/bean/payees',
1606
+ body: data.requestBody,
1607
+ mediaType: 'application/json',
1608
+ errors: {
1609
+ 400: 'Invalid input data',
1610
+ 409: 'Payee already exists'
1611
+ }
1612
+ });
1613
+ }
1614
+
1615
+ /**
1616
+ * List user payees
1617
+ * Returns all payee mappings for the authenticated user with optional filtering
1618
+ * @param data The data for the request.
1619
+ * @param data.search Search term for payee name (partial match, case-insensitive). Useful for autocomplete.
1620
+ * @param data.payee Filter by exact payee name match
1621
+ * @param data.category Filter by custom category
1622
+ * @param data.tag Filter by custom tag (returns payees that have this tag)
1623
+ * @param data.isActive Filter by active status. Defaults to true (show only active payees).
1624
+ * @returns PayeeListResponseDto Payees retrieved successfully
1625
+ * @throws ApiError
1626
+ */
1627
+ public static payeeControllerFindAll(
1628
+ data: PayeeControllerFindAllData = {}
1629
+ ): CancelablePromise<PayeeControllerFindAllResponse> {
1630
+ return __request(OpenAPI, {
1631
+ method: 'GET',
1632
+ url: '/api/v1/bean/payees',
1633
+ query: {
1634
+ search: data.search,
1635
+ payee: data.payee,
1636
+ category: data.category,
1637
+ tag: data.tag,
1638
+ isActive: data.isActive
1639
+ }
1640
+ });
1641
+ }
1642
+
1643
+ /**
997
1644
  * Get payee autocomplete suggestions
998
1645
  * Returns active payee names matching the query, sorted by recent usage. Used for transaction input autocomplete.
999
1646
  * @param data The data for the request.
@@ -1273,7 +1920,7 @@ export class AdminPayeeProfilesService {
1273
1920
  * Removes verification status by setting verifiedAt to null.
1274
1921
  * @param data The data for the request.
1275
1922
  * @param data.id Payee profile ID (UUID)
1276
- * @returns PayeeProfileResponseDto Payee profile unverified successfully
1923
+ * @returns void Payee profile unverified successfully
1277
1924
  * @throws ApiError
1278
1925
  */
1279
1926
  public static payeeProfileAdminControllerUnverify(
@@ -1293,6 +1940,24 @@ export class AdminPayeeProfilesService {
1293
1940
  }
1294
1941
  }
1295
1942
 
1943
+ export class PayeeProfilesService {
1944
+ /**
1945
+ * List active payee profiles (directory dump)
1946
+ * Returns the full active PayeeProfile set as a trimmed projection for client-side dictionary caching. Aliases are verbatim as stored; clients normalize on their side.
1947
+ * @returns PayeeProfileDirectoryResponseDto Active payee profiles
1948
+ * @throws ApiError
1949
+ */
1950
+ public static payeeProfileControllerListActive(): CancelablePromise<PayeeProfileControllerListActiveResponse> {
1951
+ return __request(OpenAPI, {
1952
+ method: 'GET',
1953
+ url: '/api/v1/bean/payee-profiles',
1954
+ errors: {
1955
+ 401: 'Missing or invalid token'
1956
+ }
1957
+ });
1958
+ }
1959
+ }
1960
+
1296
1961
  export class BeanCommoditiesService {
1297
1962
  /**
1298
1963
  * Create a new commodity
@@ -1469,964 +2134,1091 @@ export class BeanCommoditiesService {
1469
2134
  }
1470
2135
  }
1471
2136
 
1472
- export class RecurringRulesService {
2137
+ export class ReportingService {
1473
2138
  /**
1474
- * Create a new recurring rule
1475
- * Creates a new recurring transaction rule for the authenticated user
2139
+ * Get portfolio value trends
2140
+ *
2141
+ * Returns time series data of portfolio net worth.
2142
+ *
2143
+ * **Multi-currency Support:**
2144
+ * - `series[].byCurrency` - Currency breakdown for each data point
2145
+ * - `byCurrency` - Separate time series grouped by currency
2146
+ * - `warnings` - Exchange rate warnings if conversion failed
2147
+ *
2148
+ * **Parameters:**
2149
+ * - `period`: Time period (1m, 3m, 6m, 1y)
2150
+ * - `granularity`: Data granularity (day, week, month)
2151
+ *
1476
2152
  * @param data The data for the request.
1477
2153
  * @param data.region Region code for tenant context
1478
- * @param data.requestBody
1479
- * @returns RecurringRuleResponseDto Rule created successfully
2154
+ * @param data.period Time period
2155
+ * @param data.granularity Data granularity
2156
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
1480
2157
  * @throws ApiError
1481
2158
  */
1482
- public static recurringRuleControllerCreate(
1483
- data: RecurringRuleControllerCreateData
1484
- ): CancelablePromise<RecurringRuleControllerCreateResponse> {
2159
+ public static reportingControllerGetPortfolioTrends(
2160
+ data: ReportingControllerGetPortfolioTrendsData
2161
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
1485
2162
  return __request(OpenAPI, {
1486
- method: 'POST',
1487
- url: '/api/v1/{region}/bean/recurring-rules',
2163
+ method: 'GET',
2164
+ url: '/api/v1/{region}/reporting/portfolio/trends',
1488
2165
  path: {
1489
2166
  region: data.region
1490
2167
  },
1491
- body: data.requestBody,
1492
- mediaType: 'application/json',
2168
+ query: {
2169
+ period: data.period,
2170
+ granularity: data.granularity
2171
+ },
1493
2172
  errors: {
1494
- 400: 'Invalid input data (e.g., autoCreate without accounts)',
1495
- 409: 'Rule with same name already exists'
2173
+ 401: 'User not authenticated'
1496
2174
  }
1497
2175
  });
1498
2176
  }
1499
2177
 
1500
2178
  /**
1501
- * List recurring rules
1502
- * Returns all recurring rules for the authenticated user with optional filtering
2179
+ * Get cash-flow trends
2180
+ *
2181
+ * Monthly income / expense / netSavings over a fixed N-month window
2182
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
2183
+ *
2184
+ * **Parameters:**
2185
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
2186
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
2187
+ *
1503
2188
  * @param data The data for the request.
1504
2189
  * @param data.region Region code for tenant context
1505
- * @param data.isActive Filter by active status
1506
- * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1507
- * @param data.hasAutoCreate Filter by autoCreate enabled
1508
- * @returns RecurringRuleResponseDto Rules retrieved successfully
2190
+ * @param data.period Time period
2191
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
2192
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
1509
2193
  * @throws ApiError
1510
2194
  */
1511
- public static recurringRuleControllerFindAll(
1512
- data: RecurringRuleControllerFindAllData
1513
- ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
2195
+ public static reportingControllerGetCashFlowTrends(
2196
+ data: ReportingControllerGetCashFlowTrendsData
2197
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
1514
2198
  return __request(OpenAPI, {
1515
2199
  method: 'GET',
1516
- url: '/api/v1/{region}/bean/recurring-rules',
2200
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
1517
2201
  path: {
1518
2202
  region: data.region
1519
2203
  },
1520
2204
  query: {
1521
- isActive: data.isActive,
1522
- frequency: data.frequency,
1523
- hasAutoCreate: data.hasAutoCreate
2205
+ period: data.period,
2206
+ granularity: data.granularity
2207
+ },
2208
+ errors: {
2209
+ 401: 'User not authenticated'
1524
2210
  }
1525
2211
  });
1526
2212
  }
1527
2213
 
1528
2214
  /**
1529
- * Create recurring rule from transaction
1530
- * Auto-creates a recurring rule using transaction data. User only confirms frequency.
2215
+ * Generate portfolio snapshot
2216
+ *
2217
+ * Manually generate a portfolio snapshot for a specific date.
2218
+ *
2219
+ * **Multi-currency Support:**
2220
+ * - Fetches balances grouped by currency
2221
+ * - Uses user's baseCurrency setting for conversion
2222
+ * - Stores exchange rates and warnings
2223
+ *
2224
+ * **Use Cases:**
2225
+ * - Testing snapshot generation
2226
+ * - Force regeneration after data correction
2227
+ * - Initial setup for new users
2228
+ *
1531
2229
  * @param data The data for the request.
1532
- * @param data.transactionId Source transaction ID
1533
2230
  * @param data.region Region code for tenant context
1534
- * @param data.requestBody
1535
- * @returns RecurringRuleResponseDto Rule created successfully
2231
+ * @param data.requestBody Optional date (defaults to today)
2232
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
1536
2233
  * @throws ApiError
1537
2234
  */
1538
- public static recurringRuleControllerCreateFromTransaction(
1539
- data: RecurringRuleControllerCreateFromTransactionData
1540
- ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
2235
+ public static reportingControllerGenerateSnapshot(
2236
+ data: ReportingControllerGenerateSnapshotData
2237
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
1541
2238
  return __request(OpenAPI, {
1542
2239
  method: 'POST',
1543
- url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
2240
+ url: '/api/v1/{region}/reporting/snapshots/generate',
1544
2241
  path: {
1545
- transactionId: data.transactionId,
1546
2242
  region: data.region
1547
2243
  },
1548
2244
  body: data.requestBody,
1549
2245
  mediaType: 'application/json',
1550
2246
  errors: {
1551
- 404: 'Transaction not found',
1552
- 409: 'Rule with same name already exists or transaction already linked'
1553
- }
1554
- });
1555
- }
1556
-
1557
- /**
1558
- * Get recurring rule by ID
1559
- * Returns a specific recurring rule with its details
1560
- * @param data The data for the request.
1561
- * @param data.id Rule ID
1562
- * @param data.region Region code for tenant context
1563
- * @returns RecurringRuleResponseDto Rule retrieved successfully
1564
- * @throws ApiError
1565
- */
1566
- public static recurringRuleControllerFindOne(
1567
- data: RecurringRuleControllerFindOneData
1568
- ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1569
- return __request(OpenAPI, {
1570
- method: 'GET',
1571
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1572
- path: {
1573
- id: data.id,
1574
- region: data.region
1575
- },
1576
- errors: {
1577
- 404: 'Rule not found'
2247
+ 400: 'Invalid date format',
2248
+ 401: 'User not authenticated'
1578
2249
  }
1579
2250
  });
1580
2251
  }
1581
2252
 
1582
2253
  /**
1583
- * Update recurring rule
1584
- * Updates an existing recurring rule
2254
+ * Backfill portfolio snapshots
2255
+ *
2256
+ * Generate snapshots for a date range (historical data backfill).
2257
+ *
2258
+ * **Multi-currency Support:**
2259
+ * - Each snapshot includes multi-currency data
2260
+ * - Uses exchange rates available at generation time
2261
+ * - Warnings stored for missing exchange rates
2262
+ *
2263
+ * **Best Practices:**
2264
+ * - Use for initial setup after account configuration
2265
+ * - Run during low-traffic periods for large date ranges
2266
+ * - Existing snapshots are skipped (not regenerated)
2267
+ *
1585
2268
  * @param data The data for the request.
1586
- * @param data.id Rule ID
1587
2269
  * @param data.region Region code for tenant context
1588
2270
  * @param data.requestBody
1589
- * @returns RecurringRuleResponseDto Rule updated successfully
2271
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
1590
2272
  * @throws ApiError
1591
2273
  */
1592
- public static recurringRuleControllerUpdate(
1593
- data: RecurringRuleControllerUpdateData
1594
- ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
2274
+ public static reportingControllerBackfillSnapshots(
2275
+ data: ReportingControllerBackfillSnapshotsData
2276
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
1595
2277
  return __request(OpenAPI, {
1596
- method: 'PATCH',
1597
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
2278
+ method: 'POST',
2279
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
1598
2280
  path: {
1599
- id: data.id,
1600
2281
  region: data.region
1601
2282
  },
1602
2283
  body: data.requestBody,
1603
2284
  mediaType: 'application/json',
1604
2285
  errors: {
1605
- 400: 'Invalid input data',
1606
- 404: 'Rule not found'
1607
- }
1608
- });
1609
- }
1610
-
1611
- /**
1612
- * Delete recurring rule
1613
- * Soft deletes a recurring rule (sets isActive to false)
1614
- * @param data The data for the request.
1615
- * @param data.id Rule ID
1616
- * @param data.region Region code for tenant context
1617
- * @returns void Rule deleted successfully
1618
- * @throws ApiError
1619
- */
1620
- public static recurringRuleControllerDelete(
1621
- data: RecurringRuleControllerDeleteData
1622
- ): CancelablePromise<RecurringRuleControllerDeleteResponse> {
1623
- return __request(OpenAPI, {
1624
- method: 'DELETE',
1625
- url: '/api/v1/{region}/bean/recurring-rules/{id}',
1626
- path: {
1627
- id: data.id,
1628
- region: data.region
1629
- },
1630
- errors: {
1631
- 404: 'Rule not found'
2286
+ 400: 'Invalid date format or range',
2287
+ 401: 'User not authenticated',
2288
+ 409: 'Backfill already in progress for this user'
1632
2289
  }
1633
2290
  });
1634
2291
  }
2292
+ }
1635
2293
 
2294
+ export class BeanPricesService {
1636
2295
  /**
1637
- * Get rule with statistics
1638
- * Returns a rule with pending/overdue counts and next expected date
2296
+ * Create a new price
2297
+ * Creates a new price entry for the authenticated user
1639
2298
  * @param data The data for the request.
1640
- * @param data.id Rule ID
1641
2299
  * @param data.region Region code for tenant context
1642
- * @returns RecurringRuleWithStatsResponseDto Rule with stats retrieved successfully
2300
+ * @param data.requestBody
2301
+ * @returns PriceResponseDto Price created successfully
1643
2302
  * @throws ApiError
1644
2303
  */
1645
- public static recurringRuleControllerGetWithStats(
1646
- data: RecurringRuleControllerGetWithStatsData
1647
- ): CancelablePromise<RecurringRuleControllerGetWithStatsResponse> {
2304
+ public static priceControllerCreate(
2305
+ data: PriceControllerCreateData
2306
+ ): CancelablePromise<PriceControllerCreateResponse> {
1648
2307
  return __request(OpenAPI, {
1649
- method: 'GET',
1650
- url: '/api/v1/{region}/bean/recurring-rules/{id}/stats',
2308
+ method: 'POST',
2309
+ url: '/api/v1/{region}/bean/prices',
1651
2310
  path: {
1652
- id: data.id,
1653
2311
  region: data.region
1654
2312
  },
2313
+ body: data.requestBody,
2314
+ mediaType: 'application/json',
1655
2315
  errors: {
1656
- 404: 'Rule not found'
2316
+ 404: 'Currency or quoteCurrency commodity not found',
2317
+ 409: 'Price already exists for this currency pair and date'
1657
2318
  }
1658
2319
  });
1659
2320
  }
1660
- }
1661
2321
 
1662
- export class ExpectedTransactionsService {
1663
2322
  /**
1664
- * List expected transactions
1665
- * Returns expected transactions for the authenticated user with optional filtering
2323
+ * List user prices
2324
+ * Returns all price entries for the authenticated user with optional filtering
1666
2325
  * @param data The data for the request.
1667
2326
  * @param data.region Region code for tenant context
1668
- * @param data.ruleId Filter by recurring rule ID
1669
- * @param data.status Filter by status (PENDING, COMPLETED, SKIPPED)
1670
- * @param data.fromDate Filter by date range start (YYYY-MM-DD)
1671
- * @param data.toDate Filter by date range end (YYYY-MM-DD)
1672
- * @returns ExpectedTransactionListResponseDto Expected transactions retrieved successfully
2327
+ * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
2328
+ * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
2329
+ * @param data.dateFrom Filter prices from this date (ISO 8601 format)
2330
+ * @param data.dateTo Filter prices to this date (ISO 8601 format)
2331
+ * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
2332
+ * @param data.page Page number for pagination (default: 1)
2333
+ * @param data.limit Number of items per page (default: 20, max: 100)
2334
+ * @returns PriceListResponseDto Prices retrieved successfully
1673
2335
  * @throws ApiError
1674
- */
1675
- public static expectedTransactionControllerFindAll(
1676
- data: ExpectedTransactionControllerFindAllData
1677
- ): CancelablePromise<ExpectedTransactionControllerFindAllResponse> {
2336
+ */
2337
+ public static priceControllerFindAll(
2338
+ data: PriceControllerFindAllData
2339
+ ): CancelablePromise<PriceControllerFindAllResponse> {
1678
2340
  return __request(OpenAPI, {
1679
2341
  method: 'GET',
1680
- url: '/api/v1/{region}/bean/expected-transactions',
2342
+ url: '/api/v1/{region}/bean/prices',
1681
2343
  path: {
1682
2344
  region: data.region
1683
2345
  },
1684
2346
  query: {
1685
- ruleId: data.ruleId,
1686
- status: data.status,
1687
- fromDate: data.fromDate,
1688
- toDate: data.toDate
2347
+ currency: data.currency,
2348
+ quoteCurrency: data.quoteCurrency,
2349
+ dateFrom: data.dateFrom,
2350
+ dateTo: data.dateTo,
2351
+ search: data.search,
2352
+ page: data.page,
2353
+ limit: data.limit
1689
2354
  }
1690
2355
  });
1691
2356
  }
1692
2357
 
1693
2358
  /**
1694
- * List overdue expected transactions
1695
- * Returns all overdue expected transactions (PENDING past tolerance)
2359
+ * Get price by ID
2360
+ * Returns a single price entry by its ID
1696
2361
  * @param data The data for the request.
2362
+ * @param data.id Price ID
1697
2363
  * @param data.region Region code for tenant context
1698
- * @returns ExpectedTransactionListResponseDto Overdue transactions retrieved successfully
2364
+ * @returns PriceResponseDto Price retrieved successfully
1699
2365
  * @throws ApiError
1700
2366
  */
1701
- public static expectedTransactionControllerFindOverdue(
1702
- data: ExpectedTransactionControllerFindOverdueData
1703
- ): CancelablePromise<ExpectedTransactionControllerFindOverdueResponse> {
2367
+ public static priceControllerFindOne(
2368
+ data: PriceControllerFindOneData
2369
+ ): CancelablePromise<PriceControllerFindOneResponse> {
1704
2370
  return __request(OpenAPI, {
1705
2371
  method: 'GET',
1706
- url: '/api/v1/{region}/bean/expected-transactions/overdue',
2372
+ url: '/api/v1/{region}/bean/prices/{id}',
1707
2373
  path: {
2374
+ id: data.id,
1708
2375
  region: data.region
2376
+ },
2377
+ errors: {
2378
+ 404: 'Price not found'
1709
2379
  }
1710
2380
  });
1711
2381
  }
1712
2382
 
1713
2383
  /**
1714
- * Get expected transaction by ID
1715
- * Returns a specific expected transaction with rule details
2384
+ * Update a price
2385
+ * Updates an existing price entry
1716
2386
  * @param data The data for the request.
1717
- * @param data.id Expected transaction ID
2387
+ * @param data.id Price ID
1718
2388
  * @param data.region Region code for tenant context
1719
- * @returns ExpectedTransactionResponseDto Expected transaction retrieved successfully
2389
+ * @param data.requestBody
2390
+ * @returns PriceResponseDto Price updated successfully
1720
2391
  * @throws ApiError
1721
2392
  */
1722
- public static expectedTransactionControllerFindOne(
1723
- data: ExpectedTransactionControllerFindOneData
1724
- ): CancelablePromise<ExpectedTransactionControllerFindOneResponse> {
2393
+ public static priceControllerUpdate(
2394
+ data: PriceControllerUpdateData
2395
+ ): CancelablePromise<PriceControllerUpdateResponse> {
1725
2396
  return __request(OpenAPI, {
1726
- method: 'GET',
1727
- url: '/api/v1/{region}/bean/expected-transactions/{id}',
2397
+ method: 'PUT',
2398
+ url: '/api/v1/{region}/bean/prices/{id}',
1728
2399
  path: {
1729
2400
  id: data.id,
1730
2401
  region: data.region
1731
2402
  },
2403
+ body: data.requestBody,
2404
+ mediaType: 'application/json',
1732
2405
  errors: {
1733
- 404: 'Expected transaction not found'
2406
+ 404: 'Price not found',
2407
+ 409: 'Updated price conflicts with existing price'
1734
2408
  }
1735
2409
  });
1736
2410
  }
1737
2411
 
1738
2412
  /**
1739
- * Skip expected transaction
1740
- * Marks an expected transaction as skipped (PENDING -> SKIPPED)
2413
+ * Delete a price
2414
+ * Deletes a price entry (hard delete)
1741
2415
  * @param data The data for the request.
1742
- * @param data.id Expected transaction ID
2416
+ * @param data.id Price ID
1743
2417
  * @param data.region Region code for tenant context
1744
- * @returns ExpectedTransactionResponseDto Expected transaction skipped successfully
2418
+ * @returns void Price deleted successfully
1745
2419
  * @throws ApiError
1746
2420
  */
1747
- public static expectedTransactionControllerSkip(
1748
- data: ExpectedTransactionControllerSkipData
1749
- ): CancelablePromise<ExpectedTransactionControllerSkipResponse> {
2421
+ public static priceControllerDelete(
2422
+ data: PriceControllerDeleteData
2423
+ ): CancelablePromise<PriceControllerDeleteResponse> {
1750
2424
  return __request(OpenAPI, {
1751
- method: 'POST',
1752
- url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2425
+ method: 'DELETE',
2426
+ url: '/api/v1/{region}/bean/prices/{id}',
1753
2427
  path: {
1754
2428
  id: data.id,
1755
2429
  region: data.region
1756
2430
  },
1757
2431
  errors: {
1758
- 400: 'Cannot skip - not in PENDING status',
1759
- 404: 'Expected transaction not found'
2432
+ 404: 'Price not found'
1760
2433
  }
1761
2434
  });
1762
2435
  }
1763
2436
 
1764
2437
  /**
1765
- * Undo skip
1766
- * Reverses a skip operation (SKIPPED -> PENDING)
2438
+ * Bulk create prices
2439
+ * Creates multiple price entries at once (skips duplicates)
1767
2440
  * @param data The data for the request.
1768
- * @param data.id Expected transaction ID
1769
2441
  * @param data.region Region code for tenant context
1770
- * @returns ExpectedTransactionResponseDto Skip undone successfully
2442
+ * @param data.requestBody
2443
+ * @returns PriceResponseDto Prices created successfully
1771
2444
  * @throws ApiError
1772
2445
  */
1773
- public static expectedTransactionControllerUndoSkip(
1774
- data: ExpectedTransactionControllerUndoSkipData
1775
- ): CancelablePromise<ExpectedTransactionControllerUndoSkipResponse> {
2446
+ public static priceControllerBulkCreate(
2447
+ data: PriceControllerBulkCreateData
2448
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
1776
2449
  return __request(OpenAPI, {
1777
- method: 'DELETE',
1778
- url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2450
+ method: 'POST',
2451
+ url: '/api/v1/{region}/bean/prices/bulk',
1779
2452
  path: {
1780
- id: data.id,
1781
2453
  region: data.region
1782
2454
  },
1783
- errors: {
1784
- 400: 'Cannot undo - not in SKIPPED status',
1785
- 404: 'Expected transaction not found'
1786
- }
2455
+ body: data.requestBody,
2456
+ mediaType: 'application/json'
1787
2457
  });
1788
2458
  }
2459
+ }
1789
2460
 
2461
+ export class RecurringRulesService {
1790
2462
  /**
1791
- * Confirm transaction match
1792
- * Manually matches an expected transaction with an actual transaction
2463
+ * Create a new recurring rule
2464
+ * Creates a new recurring transaction rule for the authenticated user
1793
2465
  * @param data The data for the request.
1794
- * @param data.id Expected transaction ID
1795
2466
  * @param data.region Region code for tenant context
1796
2467
  * @param data.requestBody
1797
- * @returns unknown Match confirmed successfully
2468
+ * @returns RecurringRuleResponseDto Rule created successfully
1798
2469
  * @throws ApiError
1799
2470
  */
1800
- public static expectedTransactionControllerConfirmMatch(
1801
- data: ExpectedTransactionControllerConfirmMatchData
1802
- ): CancelablePromise<ExpectedTransactionControllerConfirmMatchResponse> {
2471
+ public static recurringRuleControllerCreate(
2472
+ data: RecurringRuleControllerCreateData
2473
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1803
2474
  return __request(OpenAPI, {
1804
2475
  method: 'POST',
1805
- url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2476
+ url: '/api/v1/{region}/bean/recurring-rules',
1806
2477
  path: {
1807
- id: data.id,
1808
2478
  region: data.region
1809
2479
  },
1810
2480
  body: data.requestBody,
1811
2481
  mediaType: 'application/json',
1812
2482
  errors: {
1813
- 400: 'Cannot match - not in PENDING status',
1814
- 404: 'Expected or actual transaction not found',
1815
- 409: 'Actual transaction already matched to another rule'
2483
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
2484
+ 409: 'Rule with same name already exists'
1816
2485
  }
1817
2486
  });
1818
2487
  }
1819
2488
 
1820
2489
  /**
1821
- * Unmatch transaction
1822
- * Removes the match between expected and actual transaction (COMPLETED -> PENDING)
2490
+ * List recurring rules
2491
+ * Returns all recurring rules for the authenticated user with optional filtering
1823
2492
  * @param data The data for the request.
1824
- * @param data.id Expected transaction ID
1825
2493
  * @param data.region Region code for tenant context
1826
- * @returns unknown Match removed successfully
2494
+ * @param data.isActive Filter by active status
2495
+ * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
2496
+ * @param data.hasAutoCreate Filter by autoCreate enabled
2497
+ * @returns RecurringRuleResponseDto Rules retrieved successfully
1827
2498
  * @throws ApiError
1828
2499
  */
1829
- public static expectedTransactionControllerUnmatch(
1830
- data: ExpectedTransactionControllerUnmatchData
1831
- ): CancelablePromise<ExpectedTransactionControllerUnmatchResponse> {
2500
+ public static recurringRuleControllerFindAll(
2501
+ data: RecurringRuleControllerFindAllData
2502
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1832
2503
  return __request(OpenAPI, {
1833
- method: 'DELETE',
1834
- url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2504
+ method: 'GET',
2505
+ url: '/api/v1/{region}/bean/recurring-rules',
1835
2506
  path: {
1836
- id: data.id,
1837
2507
  region: data.region
1838
2508
  },
1839
- errors: {
1840
- 400: 'Cannot unmatch - not in COMPLETED status',
1841
- 404: 'Expected transaction not found'
2509
+ query: {
2510
+ isActive: data.isActive,
2511
+ frequency: data.frequency,
2512
+ hasAutoCreate: data.hasAutoCreate
1842
2513
  }
1843
2514
  });
1844
2515
  }
1845
2516
 
1846
2517
  /**
1847
- * Enter Now
1848
- * Creates an actual transaction for an expected transaction (YNAB-style Enter Now)
2518
+ * Create recurring rule from transaction
2519
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1849
2520
  * @param data The data for the request.
1850
- * @param data.id Expected transaction ID
2521
+ * @param data.transactionId Source transaction ID
1851
2522
  * @param data.region Region code for tenant context
1852
2523
  * @param data.requestBody
1853
- * @returns unknown Transaction created successfully
2524
+ * @returns RecurringRuleResponseDto Rule created successfully
1854
2525
  * @throws ApiError
1855
2526
  */
1856
- public static expectedTransactionControllerEnterNow(
1857
- data: ExpectedTransactionControllerEnterNowData
1858
- ): CancelablePromise<ExpectedTransactionControllerEnterNowResponse> {
2527
+ public static recurringRuleControllerCreateFromTransaction(
2528
+ data: RecurringRuleControllerCreateFromTransactionData
2529
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1859
2530
  return __request(OpenAPI, {
1860
2531
  method: 'POST',
1861
- url: '/api/v1/{region}/bean/expected-transactions/{id}/enter',
2532
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1862
2533
  path: {
1863
- id: data.id,
2534
+ transactionId: data.transactionId,
1864
2535
  region: data.region
1865
2536
  },
1866
2537
  body: data.requestBody,
1867
2538
  mediaType: 'application/json',
1868
2539
  errors: {
1869
- 400: 'Cannot enter - not in PENDING status or missing accounts',
1870
- 404: 'Expected transaction or accounts not found'
2540
+ 404: 'Transaction not found',
2541
+ 409: 'Rule with same name already exists or transaction already linked'
1871
2542
  }
1872
2543
  });
1873
2544
  }
1874
- }
1875
2545
 
1876
- export class RecurringForecastService {
1877
2546
  /**
1878
- * Get cash flow forecast
1879
- * Returns predicted outflows for the next N months based on active recurring rules
2547
+ * Get recurring rule by ID
2548
+ * Returns a specific recurring rule with its details
1880
2549
  * @param data The data for the request.
2550
+ * @param data.id Rule ID
1881
2551
  * @param data.region Region code for tenant context
1882
- * @param data.months Number of months to forecast (1-12, default 3)
1883
- * @returns ForecastResponseDto Forecast retrieved successfully
2552
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
1884
2553
  * @throws ApiError
1885
2554
  */
1886
- public static forecastControllerGetForecast(
1887
- data: ForecastControllerGetForecastData
1888
- ): CancelablePromise<ForecastControllerGetForecastResponse> {
2555
+ public static recurringRuleControllerFindOne(
2556
+ data: RecurringRuleControllerFindOneData
2557
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1889
2558
  return __request(OpenAPI, {
1890
2559
  method: 'GET',
1891
- url: '/api/v1/{region}/bean/recurring/forecast',
2560
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1892
2561
  path: {
2562
+ id: data.id,
1893
2563
  region: data.region
1894
2564
  },
1895
- query: {
1896
- months: data.months
2565
+ errors: {
2566
+ 404: 'Rule not found'
1897
2567
  }
1898
2568
  });
1899
2569
  }
1900
- }
1901
2570
 
1902
- export class BeanTransactionRulesService {
1903
2571
  /**
1904
- * Create a new transaction rule (or upsert if upsertByPayee=true)
1905
- * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2572
+ * Update recurring rule
2573
+ * Updates an existing recurring rule
1906
2574
  * @param data The data for the request.
2575
+ * @param data.id Rule ID
1907
2576
  * @param data.region Region code for tenant context
1908
2577
  * @param data.requestBody
1909
- * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2578
+ * @returns RecurringRuleResponseDto Rule updated successfully
1910
2579
  * @throws ApiError
1911
2580
  */
1912
- public static transactionRuleControllerCreate(
1913
- data: TransactionRuleControllerCreateData
1914
- ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2581
+ public static recurringRuleControllerUpdate(
2582
+ data: RecurringRuleControllerUpdateData
2583
+ ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1915
2584
  return __request(OpenAPI, {
1916
- method: 'POST',
1917
- url: '/api/v1/{region}/bean/transaction-rules',
2585
+ method: 'PATCH',
2586
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1918
2587
  path: {
2588
+ id: data.id,
1919
2589
  region: data.region
1920
2590
  },
1921
2591
  body: data.requestBody,
1922
2592
  mediaType: 'application/json',
1923
2593
  errors: {
1924
- 400: 'Validation failed',
1925
- 401: 'Unauthorized',
1926
- 409: 'Resource conflict - another process is updating this rule'
2594
+ 400: 'Invalid input data',
2595
+ 404: 'Rule not found'
1927
2596
  }
1928
2597
  });
1929
2598
  }
1930
2599
 
1931
2600
  /**
1932
- * Get all transaction rules for user
2601
+ * Delete recurring rule
2602
+ * Soft deletes a recurring rule (sets isActive to false)
1933
2603
  * @param data The data for the request.
2604
+ * @param data.id Rule ID
1934
2605
  * @param data.region Region code for tenant context
1935
- * @param data.limit Max results per page (default: 20, max: 100)
1936
- * @param data.offset Pagination offset (default: 0)
1937
- * @param data.enabled Filter by enabled status
1938
- * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
1939
- * @param data.autoApplyEnabled Filter by auto-apply status
1940
- * @returns TransactionRuleListResponseDto List of rules
2606
+ * @returns void Rule deleted successfully
2607
+ * @throws ApiError
2608
+ */
2609
+ public static recurringRuleControllerDelete(
2610
+ data: RecurringRuleControllerDeleteData
2611
+ ): CancelablePromise<RecurringRuleControllerDeleteResponse> {
2612
+ return __request(OpenAPI, {
2613
+ method: 'DELETE',
2614
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
2615
+ path: {
2616
+ id: data.id,
2617
+ region: data.region
2618
+ },
2619
+ errors: {
2620
+ 404: 'Rule not found'
2621
+ }
2622
+ });
2623
+ }
2624
+
2625
+ /**
2626
+ * Get rule with statistics
2627
+ * Returns a rule with pending/overdue counts and next expected date
2628
+ * @param data The data for the request.
2629
+ * @param data.id Rule ID
2630
+ * @param data.region Region code for tenant context
2631
+ * @returns RecurringRuleWithStatsResponseDto Rule with stats retrieved successfully
1941
2632
  * @throws ApiError
1942
2633
  */
1943
- public static transactionRuleControllerList(
1944
- data: TransactionRuleControllerListData
1945
- ): CancelablePromise<TransactionRuleControllerListResponse> {
2634
+ public static recurringRuleControllerGetWithStats(
2635
+ data: RecurringRuleControllerGetWithStatsData
2636
+ ): CancelablePromise<RecurringRuleControllerGetWithStatsResponse> {
1946
2637
  return __request(OpenAPI, {
1947
2638
  method: 'GET',
1948
- url: '/api/v1/{region}/bean/transaction-rules',
2639
+ url: '/api/v1/{region}/bean/recurring-rules/{id}/stats',
1949
2640
  path: {
2641
+ id: data.id,
1950
2642
  region: data.region
1951
2643
  },
1952
- query: {
1953
- limit: data.limit,
1954
- offset: data.offset,
1955
- enabled: data.enabled,
1956
- learningSource: data.learningSource,
1957
- autoApplyEnabled: data.autoApplyEnabled
1958
- },
1959
2644
  errors: {
1960
- 401: 'Unauthorized'
2645
+ 404: 'Rule not found'
1961
2646
  }
1962
2647
  });
1963
2648
  }
2649
+ }
1964
2650
 
2651
+ export class ExpectedTransactionsService {
1965
2652
  /**
1966
- * Validate transaction rule configuration
2653
+ * List expected transactions
2654
+ * Returns expected transactions for the authenticated user with optional filtering
1967
2655
  * @param data The data for the request.
1968
2656
  * @param data.region Region code for tenant context
1969
- * @param data.requestBody
1970
- * @returns ValidateRuleResponseDto Validation result
2657
+ * @param data.ruleId Filter by recurring rule ID
2658
+ * @param data.status Filter by status (PENDING, COMPLETED, SKIPPED)
2659
+ * @param data.fromDate Filter by date range start (YYYY-MM-DD)
2660
+ * @param data.toDate Filter by date range end (YYYY-MM-DD)
2661
+ * @returns ExpectedTransactionListResponseDto Expected transactions retrieved successfully
1971
2662
  * @throws ApiError
1972
2663
  */
1973
- public static transactionRuleControllerValidate(
1974
- data: TransactionRuleControllerValidateData
1975
- ): CancelablePromise<TransactionRuleControllerValidateResponse> {
2664
+ public static expectedTransactionControllerFindAll(
2665
+ data: ExpectedTransactionControllerFindAllData
2666
+ ): CancelablePromise<ExpectedTransactionControllerFindAllResponse> {
1976
2667
  return __request(OpenAPI, {
1977
- method: 'POST',
1978
- url: '/api/v1/{region}/bean/transaction-rules/validate',
2668
+ method: 'GET',
2669
+ url: '/api/v1/{region}/bean/expected-transactions',
1979
2670
  path: {
1980
2671
  region: data.region
1981
2672
  },
1982
- body: data.requestBody,
1983
- mediaType: 'application/json',
1984
- errors: {
1985
- 400: 'Validation failed',
1986
- 401: 'Unauthorized'
2673
+ query: {
2674
+ ruleId: data.ruleId,
2675
+ status: data.status,
2676
+ fromDate: data.fromDate,
2677
+ toDate: data.toDate
1987
2678
  }
1988
2679
  });
1989
2680
  }
1990
2681
 
1991
2682
  /**
1992
- * Bulk create transaction rules
2683
+ * List overdue expected transactions
2684
+ * Returns all overdue expected transactions (PENDING past tolerance)
1993
2685
  * @param data The data for the request.
1994
2686
  * @param data.region Region code for tenant context
1995
- * @param data.requestBody
1996
- * @returns BulkCreateRulesResponseDto Bulk create completed
2687
+ * @returns ExpectedTransactionListResponseDto Overdue transactions retrieved successfully
1997
2688
  * @throws ApiError
1998
2689
  */
1999
- public static transactionRuleControllerBulkCreate(
2000
- data: TransactionRuleControllerBulkCreateData
2001
- ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2690
+ public static expectedTransactionControllerFindOverdue(
2691
+ data: ExpectedTransactionControllerFindOverdueData
2692
+ ): CancelablePromise<ExpectedTransactionControllerFindOverdueResponse> {
2002
2693
  return __request(OpenAPI, {
2003
- method: 'POST',
2004
- url: '/api/v1/{region}/bean/transaction-rules/bulk',
2694
+ method: 'GET',
2695
+ url: '/api/v1/{region}/bean/expected-transactions/overdue',
2005
2696
  path: {
2006
2697
  region: data.region
2007
- },
2008
- body: data.requestBody,
2009
- mediaType: 'application/json',
2010
- errors: {
2011
- 400: 'Invalid bulk create data',
2012
- 401: 'Unauthorized'
2013
2698
  }
2014
2699
  });
2015
2700
  }
2016
2701
 
2017
2702
  /**
2018
- * Export transaction rules
2703
+ * Get expected transaction by ID
2704
+ * Returns a specific expected transaction with rule details
2019
2705
  * @param data The data for the request.
2020
- * @param data.format Export format (currently only JSON supported)
2706
+ * @param data.id Expected transaction ID
2021
2707
  * @param data.region Region code for tenant context
2022
- * @returns ExportRulesResponseDto Exported rules
2708
+ * @returns ExpectedTransactionResponseDto Expected transaction retrieved successfully
2023
2709
  * @throws ApiError
2024
2710
  */
2025
- public static transactionRuleControllerExport(
2026
- data: TransactionRuleControllerExportData
2027
- ): CancelablePromise<TransactionRuleControllerExportResponse> {
2711
+ public static expectedTransactionControllerFindOne(
2712
+ data: ExpectedTransactionControllerFindOneData
2713
+ ): CancelablePromise<ExpectedTransactionControllerFindOneResponse> {
2028
2714
  return __request(OpenAPI, {
2029
2715
  method: 'GET',
2030
- url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2716
+ url: '/api/v1/{region}/bean/expected-transactions/{id}',
2031
2717
  path: {
2032
- format: data.format,
2718
+ id: data.id,
2033
2719
  region: data.region
2034
2720
  },
2035
2721
  errors: {
2036
- 400: 'Unsupported format',
2037
- 401: 'Unauthorized'
2722
+ 404: 'Expected transaction not found'
2038
2723
  }
2039
2724
  });
2040
2725
  }
2041
2726
 
2042
2727
  /**
2043
- * Get transaction rule statistics
2728
+ * Skip expected transaction
2729
+ * Marks an expected transaction as skipped (PENDING -> SKIPPED)
2044
2730
  * @param data The data for the request.
2045
- * @param data.period Statistics time period
2731
+ * @param data.id Expected transaction ID
2046
2732
  * @param data.region Region code for tenant context
2047
- * @returns RuleStatisticsResponseDto Rule statistics
2733
+ * @returns ExpectedTransactionResponseDto Expected transaction skipped successfully
2048
2734
  * @throws ApiError
2049
2735
  */
2050
- public static transactionRuleControllerGetStatistics(
2051
- data: TransactionRuleControllerGetStatisticsData
2052
- ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2736
+ public static expectedTransactionControllerSkip(
2737
+ data: ExpectedTransactionControllerSkipData
2738
+ ): CancelablePromise<ExpectedTransactionControllerSkipResponse> {
2053
2739
  return __request(OpenAPI, {
2054
- method: 'GET',
2055
- url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2740
+ method: 'POST',
2741
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2056
2742
  path: {
2057
- period: data.period,
2743
+ id: data.id,
2058
2744
  region: data.region
2059
2745
  },
2060
2746
  errors: {
2061
- 401: 'Unauthorized'
2747
+ 400: 'Cannot skip - not in PENDING status',
2748
+ 404: 'Expected transaction not found'
2062
2749
  }
2063
2750
  });
2064
2751
  }
2065
2752
 
2066
2753
  /**
2067
- * Get transaction rule detail
2754
+ * Undo skip
2755
+ * Reverses a skip operation (SKIPPED -> PENDING)
2068
2756
  * @param data The data for the request.
2069
- * @param data.ruleId Rule ID
2757
+ * @param data.id Expected transaction ID
2070
2758
  * @param data.region Region code for tenant context
2071
- * @returns TransactionRuleResponseDto Rule details
2759
+ * @returns void Skip undone successfully
2072
2760
  * @throws ApiError
2073
2761
  */
2074
- public static transactionRuleControllerGetDetail(
2075
- data: TransactionRuleControllerGetDetailData
2076
- ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2762
+ public static expectedTransactionControllerUndoSkip(
2763
+ data: ExpectedTransactionControllerUndoSkipData
2764
+ ): CancelablePromise<ExpectedTransactionControllerUndoSkipResponse> {
2077
2765
  return __request(OpenAPI, {
2078
- method: 'GET',
2079
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2766
+ method: 'DELETE',
2767
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2080
2768
  path: {
2081
- ruleId: data.ruleId,
2769
+ id: data.id,
2082
2770
  region: data.region
2083
2771
  },
2084
2772
  errors: {
2085
- 401: 'Unauthorized',
2086
- 403: 'Forbidden - not owner of rule',
2087
- 404: 'Rule not found'
2773
+ 400: 'Cannot undo - not in SKIPPED status',
2774
+ 404: 'Expected transaction not found'
2088
2775
  }
2089
2776
  });
2090
2777
  }
2091
2778
 
2092
2779
  /**
2093
- * Update a transaction rule
2780
+ * Confirm transaction match
2781
+ * Manually matches an expected transaction with an actual transaction
2094
2782
  * @param data The data for the request.
2095
- * @param data.ruleId Rule ID to update
2783
+ * @param data.id Expected transaction ID
2096
2784
  * @param data.region Region code for tenant context
2097
2785
  * @param data.requestBody
2098
- * @returns TransactionRuleResponseDto Rule updated successfully
2786
+ * @returns unknown Match confirmed successfully
2099
2787
  * @throws ApiError
2100
2788
  */
2101
- public static transactionRuleControllerUpdate(
2102
- data: TransactionRuleControllerUpdateData
2103
- ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2789
+ public static expectedTransactionControllerConfirmMatch(
2790
+ data: ExpectedTransactionControllerConfirmMatchData
2791
+ ): CancelablePromise<ExpectedTransactionControllerConfirmMatchResponse> {
2104
2792
  return __request(OpenAPI, {
2105
- method: 'PUT',
2106
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2793
+ method: 'POST',
2794
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2107
2795
  path: {
2108
- ruleId: data.ruleId,
2796
+ id: data.id,
2109
2797
  region: data.region
2110
2798
  },
2111
2799
  body: data.requestBody,
2112
2800
  mediaType: 'application/json',
2113
2801
  errors: {
2114
- 400: 'Validation failed',
2115
- 401: 'Unauthorized',
2116
- 403: 'Forbidden - not owner of rule',
2117
- 404: 'Rule not found',
2118
- 409: 'Resource conflict - rule is being modified by another process'
2802
+ 400: 'Cannot match - not in PENDING status',
2803
+ 404: 'Expected or actual transaction not found',
2804
+ 409: 'Actual transaction already matched to another rule'
2119
2805
  }
2120
2806
  });
2121
2807
  }
2122
2808
 
2123
2809
  /**
2124
- * Delete a transaction rule
2810
+ * Unmatch transaction
2811
+ * Removes the match between expected and actual transaction (COMPLETED -> PENDING)
2125
2812
  * @param data The data for the request.
2126
- * @param data.ruleId Rule ID to delete
2813
+ * @param data.id Expected transaction ID
2127
2814
  * @param data.region Region code for tenant context
2128
- * @returns void Rule deleted successfully
2815
+ * @returns void Match removed successfully
2129
2816
  * @throws ApiError
2130
2817
  */
2131
- public static transactionRuleControllerDelete(
2132
- data: TransactionRuleControllerDeleteData
2133
- ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2818
+ public static expectedTransactionControllerUnmatch(
2819
+ data: ExpectedTransactionControllerUnmatchData
2820
+ ): CancelablePromise<ExpectedTransactionControllerUnmatchResponse> {
2134
2821
  return __request(OpenAPI, {
2135
2822
  method: 'DELETE',
2136
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2823
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2137
2824
  path: {
2138
- ruleId: data.ruleId,
2825
+ id: data.id,
2139
2826
  region: data.region
2140
2827
  },
2141
2828
  errors: {
2142
- 401: 'Unauthorized',
2143
- 403: 'Forbidden - not owner of rule',
2144
- 404: 'Rule not found',
2145
- 409: 'Resource conflict - rule is being modified by another process'
2829
+ 400: 'Cannot unmatch - not in COMPLETED status',
2830
+ 404: 'Expected transaction not found'
2146
2831
  }
2147
2832
  });
2148
2833
  }
2149
2834
 
2150
2835
  /**
2151
- * Test rule matching
2836
+ * Enter Now
2837
+ * Creates an actual transaction for an expected transaction (YNAB-style Enter Now)
2152
2838
  * @param data The data for the request.
2153
- * @param data.ruleId Rule ID to test
2839
+ * @param data.id Expected transaction ID
2154
2840
  * @param data.region Region code for tenant context
2155
2841
  * @param data.requestBody
2156
- * @returns TestRuleResponseDto Test result
2842
+ * @returns unknown Transaction created successfully
2157
2843
  * @throws ApiError
2158
2844
  */
2159
- public static transactionRuleControllerTest(
2160
- data: TransactionRuleControllerTestData
2161
- ): CancelablePromise<TransactionRuleControllerTestResponse> {
2845
+ public static expectedTransactionControllerEnterNow(
2846
+ data: ExpectedTransactionControllerEnterNowData
2847
+ ): CancelablePromise<ExpectedTransactionControllerEnterNowResponse> {
2162
2848
  return __request(OpenAPI, {
2163
2849
  method: 'POST',
2164
- url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2850
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/enter',
2165
2851
  path: {
2166
- ruleId: data.ruleId,
2852
+ id: data.id,
2167
2853
  region: data.region
2168
2854
  },
2169
2855
  body: data.requestBody,
2170
2856
  mediaType: 'application/json',
2171
2857
  errors: {
2172
- 401: 'Unauthorized',
2173
- 403: 'Forbidden - not owner of rule',
2174
- 404: 'Rule not found'
2858
+ 400: 'Cannot enter - not in PENDING status or missing accounts',
2859
+ 404: 'Expected transaction or accounts not found'
2175
2860
  }
2176
2861
  });
2177
2862
  }
2178
2863
  }
2179
2864
 
2180
- export class UsersService {
2865
+ export class RecurringForecastService {
2181
2866
  /**
2182
- * Delete own user account
2867
+ * Get cash flow forecast
2868
+ * Returns predicted outflows for the next N months based on active recurring rules
2183
2869
  * @param data The data for the request.
2184
- * @param data.requestBody
2185
- * @returns void User deleted successfully
2870
+ * @param data.region Region code for tenant context
2871
+ * @param data.months Number of months to forecast (1-12, default 3)
2872
+ * @returns ForecastResponseDto Forecast retrieved successfully
2186
2873
  * @throws ApiError
2187
2874
  */
2188
- public static userControllerDeleteOwnUser(
2189
- data: UserControllerDeleteOwnUserData
2190
- ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
2875
+ public static forecastControllerGetForecast(
2876
+ data: ForecastControllerGetForecastData
2877
+ ): CancelablePromise<ForecastControllerGetForecastResponse> {
2191
2878
  return __request(OpenAPI, {
2192
- method: 'DELETE',
2193
- url: '/api/v1/users',
2194
- body: data.requestBody,
2195
- mediaType: 'application/json',
2196
- errors: {
2197
- 403: 'Invalid access token'
2879
+ method: 'GET',
2880
+ url: '/api/v1/{region}/bean/recurring/forecast',
2881
+ path: {
2882
+ region: data.region
2883
+ },
2884
+ query: {
2885
+ months: data.months
2198
2886
  }
2199
2887
  });
2200
2888
  }
2889
+ }
2201
2890
 
2891
+ export class BeanCategoryCatalogService {
2202
2892
  /**
2203
- * Get current authenticated user
2893
+ * List category catalog for a region
2894
+ * 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.
2204
2895
  * @param data The data for the request.
2205
- * @param data.acceptLanguage
2206
- * @returns unknown User retrieved successfully
2896
+ * @param data.region Region code for tenant context
2897
+ * @param data.scenario Filter by scenario
2898
+ * @param data.routeBearing Filter by routeBearing (entity-router route() consumes it)
2899
+ * @returns CategoryCatalogListResponseDto Category catalog retrieved successfully
2207
2900
  * @throws ApiError
2208
2901
  */
2209
- public static userControllerGetUser(
2210
- data: UserControllerGetUserData
2211
- ): CancelablePromise<UserControllerGetUserResponse> {
2902
+ public static categoryCatalogControllerList(
2903
+ data: CategoryCatalogControllerListData
2904
+ ): CancelablePromise<CategoryCatalogControllerListResponse> {
2212
2905
  return __request(OpenAPI, {
2213
2906
  method: 'GET',
2214
- url: '/api/v1/users',
2215
- headers: {
2216
- 'accept-language': data.acceptLanguage
2907
+ url: '/api/v1/{region}/bean/categories',
2908
+ path: {
2909
+ region: data.region
2910
+ },
2911
+ query: {
2912
+ scenario: data.scenario,
2913
+ routeBearing: data.routeBearing
2217
2914
  }
2218
2915
  });
2219
2916
  }
2917
+ }
2220
2918
 
2919
+ export class LifeEventsService {
2221
2920
  /**
2222
- * Sign up new user
2223
- * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2921
+ * Create a new life event
2922
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2224
2923
  * @param data The data for the request.
2924
+ * @param data.region Region code for tenant context (decorative for life events)
2225
2925
  * @param data.requestBody
2226
- * @returns unknown User created successfully
2926
+ * @returns EventResponseDto Life event created successfully
2227
2927
  * @throws ApiError
2228
2928
  */
2229
- public static userControllerSignupUser(
2230
- data: UserControllerSignupUserData
2231
- ): CancelablePromise<UserControllerSignupUserResponse> {
2929
+ public static eventControllerCreate(
2930
+ data: EventControllerCreateData
2931
+ ): CancelablePromise<EventControllerCreateResponse> {
2232
2932
  return __request(OpenAPI, {
2233
2933
  method: 'POST',
2234
- url: '/api/v1/users',
2934
+ url: '/api/v1/{region}/bean/events',
2935
+ path: {
2936
+ region: data.region
2937
+ },
2235
2938
  body: data.requestBody,
2236
2939
  mediaType: 'application/json',
2237
2940
  errors: {
2238
- 400: 'Invalid Turnstile token (when Turnstile is enabled)',
2239
- 403: 'User signup is disabled'
2941
+ 409: 'Life event already exists for this (userId, type, date) combination'
2240
2942
  }
2241
2943
  });
2242
2944
  }
2243
2945
 
2244
2946
  /**
2245
- * Delete user by ID (admin only)
2947
+ * List user life events
2948
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2246
2949
  * @param data The data for the request.
2247
- * @param data.id User ID to delete
2248
- * @returns void User deleted successfully
2950
+ * @param data.region Region code for tenant context (decorative for life events)
2951
+ * @param data.type Filter by life event type (exact match)
2952
+ * @param data.q Search term for description (case-insensitive partial match)
2953
+ * @param data.from Filter life events from this date (ISO 8601 format)
2954
+ * @param data.to Filter life events to this date (ISO 8601 format)
2955
+ * @param data.page Page number for pagination (default: 1)
2956
+ * @param data.limit Number of items per page (default: 20, max: 100)
2957
+ * @returns EventListResponseDto Life events retrieved successfully
2249
2958
  * @throws ApiError
2250
2959
  */
2251
- public static userControllerDeleteUser(
2252
- data: UserControllerDeleteUserData
2253
- ): CancelablePromise<UserControllerDeleteUserResponse> {
2960
+ public static eventControllerFindAll(
2961
+ data: EventControllerFindAllData
2962
+ ): CancelablePromise<EventControllerFindAllResponse> {
2254
2963
  return __request(OpenAPI, {
2255
- method: 'DELETE',
2256
- url: '/api/v1/users/{id}',
2964
+ method: 'GET',
2965
+ url: '/api/v1/{region}/bean/events',
2257
2966
  path: {
2258
- id: data.id
2967
+ region: data.region
2259
2968
  },
2260
- errors: {
2261
- 403: 'Cannot delete own account or insufficient permissions'
2969
+ query: {
2970
+ type: data.type,
2971
+ q: data.q,
2972
+ from: data.from,
2973
+ to: data.to,
2974
+ page: data.page,
2975
+ limit: data.limit
2262
2976
  }
2263
2977
  });
2264
2978
  }
2265
2979
 
2266
2980
  /**
2267
- * Get user info by user ID
2981
+ * Get life event by ID
2982
+ * Returns a single life event by its ID. Returns ETag header.
2268
2983
  * @param data The data for the request.
2269
- * @param data.id User ID
2270
- * @returns unknown User info retrieved successfully
2984
+ * @param data.id Life event ID
2985
+ * @param data.region Region code for tenant context (decorative for life events)
2986
+ * @returns EventResponseDto Life event retrieved successfully
2271
2987
  * @throws ApiError
2272
2988
  */
2273
- public static userControllerGetUserInfo(
2274
- data: UserControllerGetUserInfoData
2275
- ): CancelablePromise<UserControllerGetUserInfoResponse> {
2989
+ public static eventControllerFindOne(
2990
+ data: EventControllerFindOneData
2991
+ ): CancelablePromise<EventControllerFindOneResponse> {
2276
2992
  return __request(OpenAPI, {
2277
2993
  method: 'GET',
2278
- url: '/api/v1/users/{id}/info',
2994
+ url: '/api/v1/{region}/bean/events/{id}',
2279
2995
  path: {
2280
- id: data.id
2996
+ id: data.id,
2997
+ region: data.region
2281
2998
  },
2282
2999
  errors: {
2283
- 403: 'Cannot access other user info without admin permission'
3000
+ 404: 'Life event not found'
2284
3001
  }
2285
3002
  });
2286
3003
  }
2287
3004
 
2288
3005
  /**
2289
- * Update user settings
3006
+ * Update a life event
3007
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2290
3008
  * @param data The data for the request.
3009
+ * @param data.id Life event ID
3010
+ * @param data.region Region code for tenant context (decorative for life events)
2291
3011
  * @param data.requestBody
2292
- * @returns unknown Settings updated successfully
3012
+ * @returns EventResponseDto Life event updated successfully
2293
3013
  * @throws ApiError
2294
3014
  */
2295
- public static userControllerUpdateUserSetting(
2296
- data: UserControllerUpdateUserSettingData
2297
- ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
3015
+ public static eventControllerUpdate(
3016
+ data: EventControllerUpdateData
3017
+ ): CancelablePromise<EventControllerUpdateResponse> {
2298
3018
  return __request(OpenAPI, {
2299
3019
  method: 'PUT',
2300
- url: '/api/v1/users/setting',
3020
+ url: '/api/v1/{region}/bean/events/{id}',
3021
+ path: {
3022
+ id: data.id,
3023
+ region: data.region
3024
+ },
2301
3025
  body: data.requestBody,
2302
3026
  mediaType: 'application/json',
2303
3027
  errors: {
2304
- 403: 'Insufficient permissions'
3028
+ 400: 'If-Match header is not a valid ISO 8601 date',
3029
+ 404: 'Life event not found',
3030
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
3031
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2305
3032
  }
2306
3033
  });
2307
3034
  }
2308
3035
 
2309
3036
  /**
2310
- * Get all user settings paginated (admin only)
3037
+ * Delete a life event
3038
+ * Deletes a life event entry (hard delete). Returns 204.
2311
3039
  * @param data The data for the request.
2312
- * @param data.pageNo Page number
2313
- * @param data.pageSize Page size
2314
- * @returns unknown Settings list retrieved successfully
3040
+ * @param data.id Life event ID
3041
+ * @param data.region Region code for tenant context (decorative for life events)
3042
+ * @returns void Life event deleted successfully
2315
3043
  * @throws ApiError
2316
3044
  */
2317
- public static userControllerGetAllUserSettingsByPage(
2318
- data: UserControllerGetAllUserSettingsByPageData
2319
- ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
3045
+ public static eventControllerDelete(
3046
+ data: EventControllerDeleteData
3047
+ ): CancelablePromise<EventControllerDeleteResponse> {
3048
+ return __request(OpenAPI, {
3049
+ method: 'DELETE',
3050
+ url: '/api/v1/{region}/bean/events/{id}',
3051
+ path: {
3052
+ id: data.id,
3053
+ region: data.region
3054
+ },
3055
+ errors: {
3056
+ 404: 'Life event not found'
3057
+ }
3058
+ });
3059
+ }
3060
+
3061
+ /**
3062
+ * Slice time-series by a life event (Phase 79)
3063
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
3064
+ * @param data The data for the request.
3065
+ * @param data.id Life event ID
3066
+ * @param data.accountPattern
3067
+ * @param data.granularity
3068
+ * @param data.region Region code for tenant context (decorative for life events)
3069
+ * @returns unknown Time-series sliced by the life event range
3070
+ * @throws ApiError
3071
+ */
3072
+ public static eventControllerGetSlice(
3073
+ data: EventControllerGetSliceData
3074
+ ): CancelablePromise<EventControllerGetSliceResponse> {
2320
3075
  return __request(OpenAPI, {
2321
3076
  method: 'GET',
2322
- url: '/api/v1/users/settings-by-page',
3077
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3078
+ path: {
3079
+ id: data.id,
3080
+ region: data.region
3081
+ },
2323
3082
  query: {
2324
- pageNo: data.pageNo,
2325
- pageSize: data.pageSize
3083
+ accountPattern: data.accountPattern,
3084
+ granularity: data.granularity
3085
+ },
3086
+ errors: {
3087
+ 400: 'accountPattern query param is empty',
3088
+ 404: 'Life event not found'
2326
3089
  }
2327
3090
  });
2328
3091
  }
3092
+ }
2329
3093
 
3094
+ export class OnboardingService {
2330
3095
  /**
2331
- * Get asset and liability summary for current user
2332
- * @returns unknown Summary retrieved successfully
3096
+ * Bootstrap core accounts + register asset accounts with opening balances (ADR-0113)
3097
+ * @param data The data for the request.
3098
+ * @param data.region Region code for tenant context. Not-yet-open codes are accepted: the universal catalog backs onboarding regardless of region (#759)
3099
+ * @param data.requestBody
3100
+ * @returns unknown Onboarding bootstrap result.
2333
3101
  * @throws ApiError
2334
3102
  */
2335
- public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
3103
+ public static onboardingControllerBootstrap(
3104
+ data: OnboardingControllerBootstrapData
3105
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
2336
3106
  return __request(OpenAPI, {
2337
- method: 'GET',
2338
- url: '/api/v1/users/asset-liability-summary'
3107
+ method: 'POST',
3108
+ url: '/api/v1/{region}/bean/onboarding',
3109
+ path: {
3110
+ region: data.region
3111
+ },
3112
+ body: data.requestBody,
3113
+ mediaType: 'application/json',
3114
+ errors: {
3115
+ 422: 'Invalid region/account path/duplicate paths.'
3116
+ }
2339
3117
  });
2340
3118
  }
2341
3119
  }
2342
3120
 
2343
- export class PropertiesService {
3121
+ export class BalanceReconciliationService {
2344
3122
  /**
2345
- * Get all system properties
2346
- * @returns unknown Properties retrieved successfully
3123
+ * Preview reconciliation (book vs actual)
3124
+ * Computes book balance, diff, Beancount-inferred tolerance, and suggested action without persisting.
3125
+ * @param data The data for the request.
3126
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3127
+ * @param data.requestBody
3128
+ * @returns ReconciliationComputeResultDto Reconciliation preview
2347
3129
  * @throws ApiError
2348
3130
  */
2349
- public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
3131
+ public static reconciliationControllerCompute(
3132
+ data: ReconciliationControllerComputeData
3133
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
2350
3134
  return __request(OpenAPI, {
2351
- method: 'GET',
2352
- url: '/api/v1/admin/properties',
3135
+ method: 'POST',
3136
+ url: '/api/v1/{region}/bean/reconciliations',
3137
+ path: {
3138
+ region: data.region
3139
+ },
3140
+ body: data.requestBody,
3141
+ mediaType: 'application/json',
2353
3142
  errors: {
2354
- 401: 'Unauthorized',
2355
- 403: 'Forbidden - insufficient permissions'
3143
+ 404: 'Account not found'
2356
3144
  }
2357
3145
  });
2358
3146
  }
2359
3147
 
2360
3148
  /**
2361
- * Get property by key
3149
+ * Record a balance assertion
3150
+ * Persists the reconciliation as a BeanBalance assertion (amount = actual, diffAmount = book − actual). Re-reconciling the same day/currency upserts.
2362
3151
  * @param data The data for the request.
2363
- * @param data.key Property key
2364
- * @returns unknown Property retrieved successfully
3152
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3153
+ * @param data.requestBody
3154
+ * @returns ReconciliationRecordDto Balance assertion recorded
2365
3155
  * @throws ApiError
2366
3156
  */
2367
- public static propertyControllerGetByKey(
2368
- data: PropertyControllerGetByKeyData
2369
- ): CancelablePromise<PropertyControllerGetByKeyResponse> {
3157
+ public static reconciliationControllerAssert(
3158
+ data: ReconciliationControllerAssertData
3159
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
2370
3160
  return __request(OpenAPI, {
2371
- method: 'GET',
2372
- url: '/api/v1/admin/properties/{key}',
3161
+ method: 'POST',
3162
+ url: '/api/v1/{region}/bean/reconciliations/assert',
2373
3163
  path: {
2374
- key: data.key
3164
+ region: data.region
2375
3165
  },
3166
+ body: data.requestBody,
3167
+ mediaType: 'application/json',
2376
3168
  errors: {
2377
- 401: 'Unauthorized',
2378
- 403: 'Forbidden - insufficient permissions',
2379
- 404: 'Property not found'
3169
+ 404: 'Account not found'
2380
3170
  }
2381
3171
  });
2382
3172
  }
2383
3173
 
2384
3174
  /**
2385
- * Update a system property
3175
+ * Generate a pad adjusting entry
3176
+ * 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.
2386
3177
  * @param data The data for the request.
2387
- * @param data.key Property key
3178
+ * @param data.region Region code for tenant context (decorative for reconciliation)
2388
3179
  * @param data.requestBody
2389
- * @returns unknown Property updated successfully
3180
+ * @returns PadResultDto Pad adjusting entry generated
2390
3181
  * @throws ApiError
2391
3182
  */
2392
- public static propertyControllerUpdate(
2393
- data: PropertyControllerUpdateData
2394
- ): CancelablePromise<PropertyControllerUpdateResponse> {
3183
+ public static reconciliationControllerPad(
3184
+ data: ReconciliationControllerPadData
3185
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
2395
3186
  return __request(OpenAPI, {
2396
- method: 'PUT',
2397
- url: '/api/v1/admin/properties/{key}',
3187
+ method: 'POST',
3188
+ url: '/api/v1/{region}/bean/reconciliations/pad',
2398
3189
  path: {
2399
- key: data.key
3190
+ region: data.region
2400
3191
  },
2401
3192
  body: data.requestBody,
2402
3193
  mediaType: 'application/json',
2403
3194
  errors: {
2404
- 401: 'Unauthorized',
2405
- 403: 'Forbidden - insufficient permissions'
3195
+ 400: 'Book already within tolerance — no pad needed',
3196
+ 404: 'Account not found'
2406
3197
  }
2407
3198
  });
2408
3199
  }
2409
3200
 
2410
3201
  /**
2411
- * Delete a system property
3202
+ * List reconciliation history for an account
3203
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
2412
3204
  * @param data The data for the request.
2413
- * @param data.key Property key
2414
- * @returns void Property deleted successfully
3205
+ * @param data.accountId BeanAccount id
3206
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3207
+ * @returns ReconciliationRecordDto Reconciliation history
2415
3208
  * @throws ApiError
2416
3209
  */
2417
- public static propertyControllerDelete(
2418
- data: PropertyControllerDeleteData
2419
- ): CancelablePromise<PropertyControllerDeleteResponse> {
3210
+ public static reconciliationControllerHistory(
3211
+ data: ReconciliationControllerHistoryData
3212
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
2420
3213
  return __request(OpenAPI, {
2421
- method: 'DELETE',
2422
- url: '/api/v1/admin/properties/{key}',
3214
+ method: 'GET',
3215
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
2423
3216
  path: {
2424
- key: data.key
3217
+ accountId: data.accountId,
3218
+ region: data.region
2425
3219
  },
2426
3220
  errors: {
2427
- 401: 'Unauthorized',
2428
- 403: 'Forbidden - insufficient permissions',
2429
- 404: 'Property not found'
3221
+ 404: 'Account not found'
2430
3222
  }
2431
3223
  });
2432
3224
  }
@@ -2436,13 +3228,20 @@ export class BeanExportService {
2436
3228
  /**
2437
3229
  * Export Beancount ledger as ZIP
2438
3230
  * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
2439
- * @returns unknown
3231
+ * @param data The data for the request.
3232
+ * @param data.region Region code for tenant context
3233
+ * @returns binary ZIP archive (application/zip) streamed as an attachment
2440
3234
  * @throws ApiError
2441
3235
  */
2442
- public static exportControllerExportBeancount(): CancelablePromise<ExportControllerExportBeancountResponse> {
3236
+ public static exportControllerExportBeancount(
3237
+ data: ExportControllerExportBeancountData
3238
+ ): CancelablePromise<ExportControllerExportBeancountResponse> {
2443
3239
  return __request(OpenAPI, {
2444
3240
  method: 'GET',
2445
- url: '/api/v1/{region}/bean/export/beancount'
3241
+ url: '/api/v1/{region}/bean/export/beancount',
3242
+ path: {
3243
+ region: data.region
3244
+ }
2446
3245
  });
2447
3246
  }
2448
3247
  }
@@ -2504,9 +3303,12 @@ export class BeanImportService {
2504
3303
  }
2505
3304
 
2506
3305
  /**
3306
+ * Import a Beancount file in community format
3307
+ * Upload a .beancount file to import. The system parses community-format paths, converts to internal format using category metadata, auto-creates accounts, and imports transactions with deduplication. Maximum file size: 50MB. Only 1 import per user at a time.
2507
3308
  * @param data The data for the request.
2508
3309
  * @param data.region Region code for tenant context
2509
- * @returns unknown
3310
+ * @param data.formData Beancount file to import
3311
+ * @returns unknown Beancount file imported successfully
2510
3312
  * @throws ApiError
2511
3313
  */
2512
3314
  public static fileImportControllerImportBeancount(
@@ -2517,6 +3319,11 @@ export class BeanImportService {
2517
3319
  url: '/api/v1/{region}/bean/import/beancount',
2518
3320
  path: {
2519
3321
  region: data.region
3322
+ },
3323
+ formData: data.formData,
3324
+ mediaType: 'multipart/form-data',
3325
+ errors: {
3326
+ 400: 'Bad request - invalid file or no file uploaded'
2520
3327
  }
2521
3328
  });
2522
3329
  }
@@ -2602,189 +3409,196 @@ export class BeanImportService {
2602
3409
  }
2603
3410
  }
2604
3411
 
2605
- export class BeanPlatformsService {
2606
- /**
2607
- * Get all platforms with statistics
2608
- * @returns unknown List of platforms with binding and account counts
2609
- * @throws ApiError
2610
- */
2611
- public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2612
- return __request(OpenAPI, {
2613
- method: 'GET',
2614
- url: '/api/v1/bean/platforms'
2615
- });
2616
- }
2617
-
3412
+ export class ProviderSyncService {
2618
3413
  /**
2619
- * Create a new platform
3414
+ * Sync transactions from financial data provider
3415
+ *
3416
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
3417
+ *
3418
+ * **Supported Providers:**
3419
+ * - **plaid**: Plaid API (US, Canada, Europe)
3420
+ * - **teller**: Teller API (US)
3421
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
3422
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
3423
+ * - **simplefin**: SimpleFIN (Self-hosted)
3424
+ * - **yodlee**: Yodlee (Global)
3425
+ * - **beancount-direct**: Beancount format transactions
3426
+ * - **parsed-bill**: Client-side parsed bill transactions
3427
+ *
3428
+ * **Processing Flow:**
3429
+ * 1. Transform raw data via provider adapter
3430
+ * 2. Validate transaction format
3431
+ * 3. Deduplicate using originalId
3432
+ * 4. Classify using rule engine
3433
+ * 5. Route low-confidence to Review Center
3434
+ * 6. Persist validated transactions
3435
+ *
2620
3436
  * @param data The data for the request.
3437
+ * @param data.providerName Provider name
3438
+ * @param data.region Region code for tenant context
2621
3439
  * @param data.requestBody
2622
- * @returns unknown Platform created successfully
3440
+ * @returns ProviderSyncResponseDto Sync completed successfully
2623
3441
  * @throws ApiError
2624
3442
  */
2625
- public static platformControllerCreate(
2626
- data: PlatformControllerCreateData
2627
- ): CancelablePromise<PlatformControllerCreateResponse> {
3443
+ public static providerSyncControllerSync(
3444
+ data: ProviderSyncControllerSyncData
3445
+ ): CancelablePromise<ProviderSyncControllerSyncResponse> {
2628
3446
  return __request(OpenAPI, {
2629
3447
  method: 'POST',
2630
- url: '/api/v1/bean/platforms',
3448
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3449
+ path: {
3450
+ providerName: data.providerName,
3451
+ region: data.region
3452
+ },
2631
3453
  body: data.requestBody,
2632
3454
  mediaType: 'application/json',
2633
3455
  errors: {
2634
- 409: 'Platform already exists'
3456
+ 400: 'Invalid request data',
3457
+ 401: 'Missing or invalid authentication',
3458
+ 404: 'Provider not supported'
2635
3459
  }
2636
3460
  });
2637
3461
  }
2638
3462
 
2639
3463
  /**
2640
- * Get platform list for current user
2641
- * @returns unknown List of platforms with user binding status
2642
- * @throws ApiError
2643
- */
2644
- public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
2645
- return __request(OpenAPI, {
2646
- method: 'GET',
2647
- url: '/api/v1/bean/platforms/list'
2648
- });
2649
- }
2650
-
2651
- /**
2652
- * Match platforms by name or alias
3464
+ * Get supported providers
3465
+ * Returns a list of all providers supported by the sync endpoint.
2653
3466
  * @param data The data for the request.
2654
- * @param data.q Search query — Chinese name, English name, or abbreviation
2655
- * @param data.region Region code for category override lookup
2656
- * @returns unknown List of matching platforms with suggested segment names
3467
+ * @param data.region Region code for tenant context
3468
+ * @returns SupportedProvidersResponseDto List of supported providers
2657
3469
  * @throws ApiError
2658
3470
  */
2659
- public static platformControllerMatchPlatforms(
2660
- data: PlatformControllerMatchPlatformsData
2661
- ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3471
+ public static providerSyncControllerGetSupportedProviders(
3472
+ data: ProviderSyncControllerGetSupportedProvidersData
3473
+ ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
2662
3474
  return __request(OpenAPI, {
2663
3475
  method: 'GET',
2664
- url: '/api/v1/bean/platforms/match',
2665
- query: {
2666
- q: data.q,
3476
+ url: '/api/v1/{region}/bean/import/provider/supported',
3477
+ path: {
2667
3478
  region: data.region
3479
+ },
3480
+ errors: {
3481
+ 401: 'Missing or invalid authentication'
2668
3482
  }
2669
3483
  });
2670
3484
  }
2671
3485
 
2672
3486
  /**
2673
- * Update a platform
3487
+ * Check if provider is supported
3488
+ * Returns whether a specific provider is supported.
2674
3489
  * @param data The data for the request.
2675
- * @param data.id Platform ID
2676
- * @param data.requestBody
2677
- * @returns unknown Platform updated successfully
3490
+ * @param data.providerName Provider name to check
3491
+ * @param data.region Region code for tenant context
3492
+ * @returns unknown Provider support status
2678
3493
  * @throws ApiError
2679
3494
  */
2680
- public static platformControllerUpdate(
2681
- data: PlatformControllerUpdateData
2682
- ): CancelablePromise<PlatformControllerUpdateResponse> {
3495
+ public static providerSyncControllerIsProviderSupported(
3496
+ data: ProviderSyncControllerIsProviderSupportedData
3497
+ ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
2683
3498
  return __request(OpenAPI, {
2684
- method: 'PUT',
2685
- url: '/api/v1/bean/platforms/{id}',
3499
+ method: 'GET',
3500
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
2686
3501
  path: {
2687
- id: data.id
3502
+ providerName: data.providerName,
3503
+ region: data.region
2688
3504
  },
2689
- body: data.requestBody,
2690
- mediaType: 'application/json',
2691
3505
  errors: {
2692
- 404: 'Platform not found'
3506
+ 401: 'Missing or invalid authentication'
2693
3507
  }
2694
3508
  });
2695
3509
  }
3510
+ }
2696
3511
 
3512
+ export class ExternalAccountLinksService {
2697
3513
  /**
2698
- * Delete a platform
3514
+ * Create an external account → BeanAccount mapping (ADR-0113)
2699
3515
  * @param data The data for the request.
2700
- * @param data.id Platform ID
2701
- * @returns void Platform deleted successfully
3516
+ * @param data.region Region code for tenant context
3517
+ * @param data.requestBody
3518
+ * @returns ExternalAccountLinkResponseDto Link created.
2702
3519
  * @throws ApiError
2703
3520
  */
2704
- public static platformControllerDelete(
2705
- data: PlatformControllerDeleteData
2706
- ): CancelablePromise<PlatformControllerDeleteResponse> {
3521
+ public static externalAccountLinkControllerCreate(
3522
+ data: ExternalAccountLinkControllerCreateData
3523
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
2707
3524
  return __request(OpenAPI, {
2708
- method: 'DELETE',
2709
- url: '/api/v1/bean/platforms/{id}',
3525
+ method: 'POST',
3526
+ url: '/api/v1/{region}/bean/external-account-links',
2710
3527
  path: {
2711
- id: data.id
3528
+ region: data.region
2712
3529
  },
3530
+ body: data.requestBody,
3531
+ mediaType: 'application/json',
2713
3532
  errors: {
2714
- 404: 'Platform not found'
3533
+ 422: 'beanAccountId not owned, or an active link already exists.'
2715
3534
  }
2716
3535
  });
2717
3536
  }
2718
- }
2719
3537
 
2720
- export class ProviderSyncService {
2721
3538
  /**
3539
+ * List the user's active external account links
2722
3540
  * @param data The data for the request.
2723
- * @param data.providerName
3541
+ * @param data.provider
2724
3542
  * @param data.region Region code for tenant context
2725
- * @param data.requestBody
2726
- * @returns unknown
3543
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
2727
3544
  * @throws ApiError
2728
3545
  */
2729
- public static providerSyncControllerSync(
2730
- data: ProviderSyncControllerSyncData
2731
- ): CancelablePromise<ProviderSyncControllerSyncResponse> {
3546
+ public static externalAccountLinkControllerFindAll(
3547
+ data: ExternalAccountLinkControllerFindAllData
3548
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
2732
3549
  return __request(OpenAPI, {
2733
- method: 'POST',
2734
- url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3550
+ method: 'GET',
3551
+ url: '/api/v1/{region}/bean/external-account-links',
2735
3552
  path: {
2736
- providerName: data.providerName,
2737
3553
  region: data.region
2738
3554
  },
2739
- body: data.requestBody,
2740
- mediaType: 'application/json'
3555
+ query: {
3556
+ provider: data.provider
3557
+ }
2741
3558
  });
2742
3559
  }
2743
3560
 
2744
3561
  /**
2745
- * Get supported providers
2746
- * Returns a list of all providers supported by the sync endpoint.
3562
+ * Get a single external account link
2747
3563
  * @param data The data for the request.
3564
+ * @param data.id
2748
3565
  * @param data.region Region code for tenant context
2749
- * @returns SupportedProvidersResponseDto List of supported providers
3566
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
2750
3567
  * @throws ApiError
2751
3568
  */
2752
- public static providerSyncControllerGetSupportedProviders(
2753
- data: ProviderSyncControllerGetSupportedProvidersData
2754
- ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
3569
+ public static externalAccountLinkControllerFindOne(
3570
+ data: ExternalAccountLinkControllerFindOneData
3571
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
2755
3572
  return __request(OpenAPI, {
2756
3573
  method: 'GET',
2757
- url: '/api/v1/{region}/bean/import/provider/supported',
3574
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
2758
3575
  path: {
3576
+ id: data.id,
2759
3577
  region: data.region
2760
3578
  },
2761
3579
  errors: {
2762
- 401: 'Missing or invalid authentication'
3580
+ 422: 'Link not found or not owned by the user.'
2763
3581
  }
2764
3582
  });
2765
3583
  }
2766
3584
 
2767
3585
  /**
2768
- * Check if provider is supported
2769
- * Returns whether a specific provider is supported.
3586
+ * Soft-delete (disconnect) an external account link
2770
3587
  * @param data The data for the request.
2771
- * @param data.providerName Provider name to check
3588
+ * @param data.id
2772
3589
  * @param data.region Region code for tenant context
2773
- * @returns unknown Provider support status
3590
+ * @returns void Link soft-deleted; historical transactions are unaffected.
2774
3591
  * @throws ApiError
2775
3592
  */
2776
- public static providerSyncControllerIsProviderSupported(
2777
- data: ProviderSyncControllerIsProviderSupportedData
2778
- ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
3593
+ public static externalAccountLinkControllerRemove(
3594
+ data: ExternalAccountLinkControllerRemoveData
3595
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
2779
3596
  return __request(OpenAPI, {
2780
- method: 'GET',
2781
- url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3597
+ method: 'DELETE',
3598
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
2782
3599
  path: {
2783
- providerName: data.providerName,
3600
+ id: data.id,
2784
3601
  region: data.region
2785
- },
2786
- errors: {
2787
- 401: 'Missing or invalid authentication'
2788
3602
  }
2789
3603
  });
2790
3604
  }
@@ -2867,10 +3681,12 @@ export class ImportTelemetryService {
2867
3681
 
2868
3682
  export class BeanNlpService {
2869
3683
  /**
3684
+ * Process natural language input
3685
+ * Parse natural language text (Chinese/English) describing a transaction. Supports multi-turn dialogue for collecting missing information. When confidence < 0.75, returns "confirm" action requiring user verification. User can reply with confirmation words (确认/yes/ok) or provide corrections. Examples: "yesterday Starbucks spent 35 yuan", "today lunch 28 yuan", "spent $50 at Walmart"
2870
3686
  * @param data The data for the request.
2871
3687
  * @param data.region Region code for tenant context
2872
- * @param data.requestBody
2873
- * @returns unknown
3688
+ * @param data.requestBody Natural language transaction input with optional session ID
3689
+ * @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
2874
3690
  * @throws ApiError
2875
3691
  */
2876
3692
  public static nlpControllerProcessNaturalLanguage(
@@ -2883,7 +3699,11 @@ export class BeanNlpService {
2883
3699
  region: data.region
2884
3700
  },
2885
3701
  body: data.requestBody,
2886
- mediaType: 'application/json'
3702
+ mediaType: 'application/json',
3703
+ errors: {
3704
+ 400: 'Invalid input',
3705
+ 401: 'Unauthorized'
3706
+ }
2887
3707
  });
2888
3708
  }
2889
3709
 
@@ -2942,411 +3762,330 @@ export class BeanNlpService {
2942
3762
  }
2943
3763
  }
2944
3764
 
2945
- export class DashboardService {
3765
+ export class BeanPlatformsService {
2946
3766
  /**
2947
- * Get net worth overview
2948
- * Returns total net worth with breakdown of assets and liabilities
2949
- * @param data The data for the request.
2950
- * @param data.region Region code for tenant context
2951
- * @param data.date Date for balance calculation (ISO 8601 format)
2952
- * @returns NetWorthResponseDto Net worth retrieved successfully
3767
+ * Get all platforms with statistics
3768
+ * @returns unknown List of platforms with binding and account counts
2953
3769
  * @throws ApiError
2954
3770
  */
2955
- public static dashboardControllerGetNetWorth(
2956
- data: DashboardControllerGetNetWorthData
2957
- ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3771
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2958
3772
  return __request(OpenAPI, {
2959
3773
  method: 'GET',
2960
- url: '/api/v1/{region}/dashboard/net-worth',
2961
- path: {
2962
- region: data.region
2963
- },
2964
- query: {
2965
- date: data.date
2966
- },
2967
- errors: {
2968
- 401: 'User not authenticated'
2969
- }
3774
+ url: '/api/v1/bean/platforms'
2970
3775
  });
2971
3776
  }
2972
3777
 
2973
3778
  /**
2974
- * Get accounts grouped by platform
2975
- * Returns accounts with balances grouped by financial platform
3779
+ * Create a new platform
2976
3780
  * @param data The data for the request.
2977
- * @param data.region Region code for tenant context
2978
- * @param data.groupBy Grouping strategy
2979
- * @param data.date Date for balance calculation (ISO 8601 format)
2980
- * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
2981
- * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3781
+ * @param data.requestBody
3782
+ * @returns unknown Platform created successfully
2982
3783
  * @throws ApiError
2983
3784
  */
2984
- public static dashboardControllerGetAccounts(
2985
- data: DashboardControllerGetAccountsData
2986
- ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3785
+ public static platformControllerCreate(
3786
+ data: PlatformControllerCreateData
3787
+ ): CancelablePromise<PlatformControllerCreateResponse> {
2987
3788
  return __request(OpenAPI, {
2988
- method: 'GET',
2989
- url: '/api/v1/{region}/dashboard/accounts',
2990
- path: {
2991
- region: data.region
2992
- },
2993
- query: {
2994
- groupBy: data.groupBy,
2995
- date: data.date,
2996
- accountId: data.accountId
2997
- },
3789
+ method: 'POST',
3790
+ url: '/api/v1/bean/platforms',
3791
+ body: data.requestBody,
3792
+ mediaType: 'application/json',
2998
3793
  errors: {
2999
- 401: 'User not authenticated'
3794
+ 409: 'Platform already exists'
3000
3795
  }
3001
3796
  });
3002
3797
  }
3003
3798
 
3004
3799
  /**
3005
- * Get cash flow summary
3006
- * Returns income, expenses, and savings for a monthly period
3800
+ * Get platform list for current user
3007
3801
  * @param data The data for the request.
3008
- * @param data.period Period in YYYY-MM format
3009
- * @param data.region Region code for tenant context
3010
- * @returns CashFlowResponseDto Cash flow retrieved successfully
3802
+ * @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").
3803
+ * @returns PlatformListItemDto List of platforms with user binding status
3011
3804
  * @throws ApiError
3012
3805
  */
3013
- public static dashboardControllerGetCashFlow(
3014
- data: DashboardControllerGetCashFlowData
3015
- ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3806
+ public static platformControllerGetPlatformList(
3807
+ data: PlatformControllerGetPlatformListData = {}
3808
+ ): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3016
3809
  return __request(OpenAPI, {
3017
3810
  method: 'GET',
3018
- url: '/api/v1/{region}/dashboard/cash-flow',
3019
- path: {
3020
- region: data.region
3021
- },
3811
+ url: '/api/v1/bean/platforms/list',
3022
3812
  query: {
3023
- period: data.period
3024
- },
3025
- errors: {
3026
- 400: 'Invalid period format',
3027
- 401: 'User not authenticated'
3813
+ region: data.region
3028
3814
  }
3029
3815
  });
3030
3816
  }
3031
- }
3032
3817
 
3033
- export class InvestmentService {
3034
3818
  /**
3035
- * Get per-holding unrealized + realized P&L
3036
- * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3819
+ * Match platforms by name or alias
3037
3820
  * @param data The data for the request.
3038
- * @param data.region Region code for tenant context
3039
- * @param data.asOf As-of date (ISO 8601), defaults to today
3040
- * @param data.accountId Scope to a single account
3041
- * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3042
- * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3821
+ * @param data.q Search query — Chinese name, English name, or abbreviation
3822
+ * @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").
3823
+ * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3043
3824
  * @throws ApiError
3044
3825
  */
3045
- public static holdingPnlControllerGetHoldingPnl(
3046
- data: HoldingPnlControllerGetHoldingPnlData
3047
- ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3826
+ public static platformControllerMatchPlatforms(
3827
+ data: PlatformControllerMatchPlatformsData
3828
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3048
3829
  return __request(OpenAPI, {
3049
3830
  method: 'GET',
3050
- url: '/api/v1/{region}/investment/holdings/pnl',
3051
- path: {
3052
- region: data.region
3053
- },
3831
+ url: '/api/v1/bean/platforms/match',
3054
3832
  query: {
3055
- asOf: data.asOf,
3056
- accountId: data.accountId,
3057
- method: data.method
3058
- },
3059
- errors: {
3060
- 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3061
- 401: 'User not authenticated'
3833
+ q: data.q,
3834
+ region: data.region
3062
3835
  }
3063
3836
  });
3064
3837
  }
3065
- }
3066
3838
 
3067
- export class BeanPricesService {
3068
3839
  /**
3069
- * Create a new price
3070
- * Creates a new price entry for the authenticated user
3840
+ * Get the region and candidate account standards for a platform
3071
3841
  * @param data The data for the request.
3072
- * @param data.region Region code for tenant context
3073
- * @param data.requestBody
3074
- * @returns PriceResponseDto Price created successfully
3842
+ * @param data.id Platform ID (from a match result)
3843
+ * @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.
3844
+ * @param data.type Filter templates by account type (path first segment)
3845
+ * @returns PlatformStandardsResponseDto Resolved region plus the merged account-standard catalog of that region (groupable by productCategory client-side)
3075
3846
  * @throws ApiError
3076
3847
  */
3077
- public static priceControllerCreate(
3078
- data: PriceControllerCreateData
3079
- ): CancelablePromise<PriceControllerCreateResponse> {
3848
+ public static platformControllerGetPlatformStandards(
3849
+ data: PlatformControllerGetPlatformStandardsData
3850
+ ): CancelablePromise<PlatformControllerGetPlatformStandardsResponse> {
3080
3851
  return __request(OpenAPI, {
3081
- method: 'POST',
3082
- url: '/api/v1/{region}/bean/prices',
3852
+ method: 'GET',
3853
+ url: '/api/v1/bean/platforms/{id}/standards',
3083
3854
  path: {
3084
- region: data.region
3855
+ id: data.id
3085
3856
  },
3086
- body: data.requestBody,
3087
- mediaType: 'application/json',
3088
- errors: {
3089
- 404: 'Currency or quoteCurrency commodity not found',
3090
- 409: 'Price already exists for this currency pair and date'
3857
+ query: {
3858
+ region: data.region,
3859
+ type: data.type
3091
3860
  }
3092
3861
  });
3093
3862
  }
3094
3863
 
3095
3864
  /**
3096
- * List user prices
3097
- * Returns all price entries for the authenticated user with optional filtering
3865
+ * Update a platform
3098
3866
  * @param data The data for the request.
3099
- * @param data.region Region code for tenant context
3100
- * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
3101
- * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
3102
- * @param data.dateFrom Filter prices from this date (ISO 8601 format)
3103
- * @param data.dateTo Filter prices to this date (ISO 8601 format)
3104
- * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
3105
- * @param data.page Page number for pagination (default: 1)
3106
- * @param data.limit Number of items per page (default: 20, max: 100)
3107
- * @returns PriceListResponseDto Prices retrieved successfully
3867
+ * @param data.id Platform ID
3868
+ * @param data.requestBody
3869
+ * @returns unknown Platform updated successfully
3108
3870
  * @throws ApiError
3109
3871
  */
3110
- public static priceControllerFindAll(
3111
- data: PriceControllerFindAllData
3112
- ): CancelablePromise<PriceControllerFindAllResponse> {
3872
+ public static platformControllerUpdate(
3873
+ data: PlatformControllerUpdateData
3874
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3113
3875
  return __request(OpenAPI, {
3114
- method: 'GET',
3115
- url: '/api/v1/{region}/bean/prices',
3876
+ method: 'PUT',
3877
+ url: '/api/v1/bean/platforms/{id}',
3116
3878
  path: {
3117
- region: data.region
3879
+ id: data.id
3118
3880
  },
3119
- query: {
3120
- currency: data.currency,
3121
- quoteCurrency: data.quoteCurrency,
3122
- dateFrom: data.dateFrom,
3123
- dateTo: data.dateTo,
3124
- search: data.search,
3125
- page: data.page,
3126
- limit: data.limit
3881
+ body: data.requestBody,
3882
+ mediaType: 'application/json',
3883
+ errors: {
3884
+ 404: 'Platform not found'
3127
3885
  }
3128
3886
  });
3129
3887
  }
3130
3888
 
3131
3889
  /**
3132
- * Get price by ID
3133
- * Returns a single price entry by its ID
3890
+ * Delete a platform
3134
3891
  * @param data The data for the request.
3135
- * @param data.id Price ID
3136
- * @param data.region Region code for tenant context
3137
- * @returns PriceResponseDto Price retrieved successfully
3892
+ * @param data.id Platform ID
3893
+ * @returns void Platform deleted successfully
3138
3894
  * @throws ApiError
3139
3895
  */
3140
- public static priceControllerFindOne(
3141
- data: PriceControllerFindOneData
3142
- ): CancelablePromise<PriceControllerFindOneResponse> {
3896
+ public static platformControllerDelete(
3897
+ data: PlatformControllerDeleteData
3898
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3143
3899
  return __request(OpenAPI, {
3144
- method: 'GET',
3145
- url: '/api/v1/{region}/bean/prices/{id}',
3900
+ method: 'DELETE',
3901
+ url: '/api/v1/bean/platforms/{id}',
3146
3902
  path: {
3147
- id: data.id,
3148
- region: data.region
3903
+ id: data.id
3149
3904
  },
3150
3905
  errors: {
3151
- 404: 'Price not found'
3906
+ 404: 'Platform not found'
3152
3907
  }
3153
3908
  });
3154
3909
  }
3910
+ }
3155
3911
 
3912
+ export class DashboardService {
3156
3913
  /**
3157
- * Update a price
3158
- * Updates an existing price entry
3914
+ * Get net worth overview
3915
+ * Returns total net worth with breakdown of assets and liabilities
3159
3916
  * @param data The data for the request.
3160
- * @param data.id Price ID
3161
3917
  * @param data.region Region code for tenant context
3162
- * @param data.requestBody
3163
- * @returns PriceResponseDto Price updated successfully
3918
+ * @param data.date Date for balance calculation (ISO 8601 format)
3919
+ * @returns NetWorthResponseDto Net worth retrieved successfully
3164
3920
  * @throws ApiError
3165
3921
  */
3166
- public static priceControllerUpdate(
3167
- data: PriceControllerUpdateData
3168
- ): CancelablePromise<PriceControllerUpdateResponse> {
3922
+ public static dashboardControllerGetNetWorth(
3923
+ data: DashboardControllerGetNetWorthData
3924
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3169
3925
  return __request(OpenAPI, {
3170
- method: 'PUT',
3171
- url: '/api/v1/{region}/bean/prices/{id}',
3926
+ method: 'GET',
3927
+ url: '/api/v1/{region}/dashboard/net-worth',
3172
3928
  path: {
3173
- id: data.id,
3174
3929
  region: data.region
3175
3930
  },
3176
- body: data.requestBody,
3177
- mediaType: 'application/json',
3931
+ query: {
3932
+ date: data.date
3933
+ },
3178
3934
  errors: {
3179
- 404: 'Price not found',
3180
- 409: 'Updated price conflicts with existing price'
3935
+ 401: 'User not authenticated'
3181
3936
  }
3182
3937
  });
3183
3938
  }
3184
3939
 
3185
3940
  /**
3186
- * Delete a price
3187
- * Deletes a price entry (hard delete)
3941
+ * Get accounts grouped by platform
3942
+ * Returns accounts with balances grouped by financial platform
3188
3943
  * @param data The data for the request.
3189
- * @param data.id Price ID
3190
3944
  * @param data.region Region code for tenant context
3191
- * @returns void Price deleted successfully
3945
+ * @param data.groupBy Grouping strategy
3946
+ * @param data.date Date for balance calculation (ISO 8601 format)
3947
+ * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3948
+ * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3192
3949
  * @throws ApiError
3193
3950
  */
3194
- public static priceControllerDelete(
3195
- data: PriceControllerDeleteData
3196
- ): CancelablePromise<PriceControllerDeleteResponse> {
3951
+ public static dashboardControllerGetAccounts(
3952
+ data: DashboardControllerGetAccountsData
3953
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3197
3954
  return __request(OpenAPI, {
3198
- method: 'DELETE',
3199
- url: '/api/v1/{region}/bean/prices/{id}',
3955
+ method: 'GET',
3956
+ url: '/api/v1/{region}/dashboard/accounts',
3200
3957
  path: {
3201
- id: data.id,
3202
3958
  region: data.region
3203
3959
  },
3960
+ query: {
3961
+ groupBy: data.groupBy,
3962
+ date: data.date,
3963
+ accountId: data.accountId
3964
+ },
3204
3965
  errors: {
3205
- 404: 'Price not found'
3966
+ 401: 'User not authenticated'
3206
3967
  }
3207
3968
  });
3208
3969
  }
3209
3970
 
3210
3971
  /**
3211
- * Bulk create prices
3212
- * Creates multiple price entries at once (skips duplicates)
3972
+ * Get cash flow summary
3973
+ * Returns income, expenses, and savings for a monthly period
3213
3974
  * @param data The data for the request.
3975
+ * @param data.period Period in YYYY-MM format
3214
3976
  * @param data.region Region code for tenant context
3215
- * @param data.requestBody
3216
- * @returns PriceResponseDto Prices created successfully
3977
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3217
3978
  * @throws ApiError
3218
3979
  */
3219
- public static priceControllerBulkCreate(
3220
- data: PriceControllerBulkCreateData
3221
- ): CancelablePromise<PriceControllerBulkCreateResponse> {
3980
+ public static dashboardControllerGetCashFlow(
3981
+ data: DashboardControllerGetCashFlowData
3982
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3222
3983
  return __request(OpenAPI, {
3223
- method: 'POST',
3224
- url: '/api/v1/{region}/bean/prices/bulk',
3984
+ method: 'GET',
3985
+ url: '/api/v1/{region}/dashboard/cash-flow',
3225
3986
  path: {
3226
3987
  region: data.region
3227
3988
  },
3228
- body: data.requestBody,
3229
- mediaType: 'application/json'
3989
+ query: {
3990
+ period: data.period
3991
+ },
3992
+ errors: {
3993
+ 400: 'Invalid period format',
3994
+ 401: 'User not authenticated'
3995
+ }
3230
3996
  });
3231
3997
  }
3232
- }
3233
3998
 
3234
- export class ReportingService {
3235
3999
  /**
3236
- * Get portfolio value trends
3237
- *
3238
- * Returns time series data of portfolio net worth.
3239
- *
3240
- * **Multi-currency Support:**
3241
- * - `series[].byCurrency` - Currency breakdown for each data point
3242
- * - `byCurrency` - Separate time series grouped by currency
3243
- * - `warnings` - Exchange rate warnings if conversion failed
3244
- *
3245
- * **Parameters:**
3246
- * - `period`: Time period (1m, 3m, 6m, 1y)
3247
- * - `granularity`: Data granularity (day, week, month)
3248
- *
4000
+ * Get expenses/income grouped by functional category
4001
+ * 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)
3249
4002
  * @param data The data for the request.
3250
4003
  * @param data.region Region code for tenant context
3251
- * @param data.period Time period
3252
- * @param data.granularity Data granularity
3253
- * @returns PortfolioTrendsResponseDto Trends retrieved successfully
4004
+ * @param data.groupBy Grouping strategy
4005
+ * @param data.period Time window (1m = current calendar month)
4006
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
4007
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3254
4008
  * @throws ApiError
3255
4009
  */
3256
- public static reportingControllerGetPortfolioTrends(
3257
- data: ReportingControllerGetPortfolioTrendsData
3258
- ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
4010
+ public static dashboardControllerGetExpenses(
4011
+ data: DashboardControllerGetExpensesData
4012
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3259
4013
  return __request(OpenAPI, {
3260
4014
  method: 'GET',
3261
- url: '/api/v1/{region}/reporting/portfolio/trends',
4015
+ url: '/api/v1/{region}/dashboard/expenses',
3262
4016
  path: {
3263
4017
  region: data.region
3264
4018
  },
3265
4019
  query: {
4020
+ groupBy: data.groupBy,
3266
4021
  period: data.period,
3267
- granularity: data.granularity
4022
+ flow: data.flow
3268
4023
  },
3269
4024
  errors: {
4025
+ 400: 'Invalid groupBy or period',
3270
4026
  401: 'User not authenticated'
3271
4027
  }
3272
4028
  });
3273
4029
  }
3274
4030
 
3275
4031
  /**
3276
- * Generate portfolio snapshot
3277
- *
3278
- * Manually generate a portfolio snapshot for a specific date.
3279
- *
3280
- * **Multi-currency Support:**
3281
- * - Fetches balances grouped by currency
3282
- * - Uses user's baseCurrency setting for conversion
3283
- * - Stores exchange rates and warnings
3284
- *
3285
- * **Use Cases:**
3286
- * - Testing snapshot generation
3287
- * - Force regeneration after data correction
3288
- * - Initial setup for new users
3289
- *
4032
+ * Get the composite P8 advisor context
4033
+ * Assembles the P8 data context in one call: net worth (verbatim GET /dashboard/net-worth shape, user base currency semantics per ADR-0070), trailing-12m flow totals over the 12 calendar months including the as-of month, and top-3 expense categories by account-path leaf key — both flow blocks priced in CNY per the P8 contract. The P8 snake_case field spellings (as_of, net_worth, trailing_12m) are mapped by the consumer; the wire keeps the family camelCase
3290
4034
  * @param data The data for the request.
3291
4035
  * @param data.region Region code for tenant context
3292
- * @param data.requestBody Optional date (defaults to today)
3293
- * @returns GenerateSnapshotResponse Snapshot generated successfully
4036
+ * @param data.date As-of date for the snapshot and the trailing-12m window anchor (ISO 8601 format)
4037
+ * @returns AdvisorContextResponseDto Advisor context retrieved successfully
3294
4038
  * @throws ApiError
3295
4039
  */
3296
- public static reportingControllerGenerateSnapshot(
3297
- data: ReportingControllerGenerateSnapshotData
3298
- ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
4040
+ public static dashboardControllerGetAdvisorContext(
4041
+ data: DashboardControllerGetAdvisorContextData
4042
+ ): CancelablePromise<DashboardControllerGetAdvisorContextResponse> {
3299
4043
  return __request(OpenAPI, {
3300
- method: 'POST',
3301
- url: '/api/v1/{region}/reporting/snapshots/generate',
4044
+ method: 'GET',
4045
+ url: '/api/v1/{region}/dashboard/advisor-context',
3302
4046
  path: {
3303
4047
  region: data.region
3304
4048
  },
3305
- body: data.requestBody,
3306
- mediaType: 'application/json',
4049
+ query: {
4050
+ date: data.date
4051
+ },
3307
4052
  errors: {
3308
4053
  400: 'Invalid date format',
3309
- 401: 'User not authenticated'
4054
+ 401: 'User not authenticated, or the token is not advisor-scoped (exchange via POST /auth/sessions/advisor, #1512)'
3310
4055
  }
3311
4056
  });
3312
4057
  }
4058
+ }
3313
4059
 
4060
+ export class InvestmentService {
3314
4061
  /**
3315
- * Backfill portfolio snapshots
3316
- *
3317
- * Generate snapshots for a date range (historical data backfill).
3318
- *
3319
- * **Multi-currency Support:**
3320
- * - Each snapshot includes multi-currency data
3321
- * - Uses exchange rates available at generation time
3322
- * - Warnings stored for missing exchange rates
3323
- *
3324
- * **Best Practices:**
3325
- * - Use for initial setup after account configuration
3326
- * - Run during low-traffic periods for large date ranges
3327
- * - Existing snapshots are skipped (not regenerated)
3328
- *
4062
+ * Get per-holding unrealized + realized P&L
4063
+ * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3329
4064
  * @param data The data for the request.
3330
4065
  * @param data.region Region code for tenant context
3331
- * @param data.requestBody
3332
- * @returns BackfillSnapshotsResponse Backfill completed successfully
4066
+ * @param data.asOf As-of date (ISO 8601), defaults to today
4067
+ * @param data.accountId Scope to a single account
4068
+ * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
4069
+ * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3333
4070
  * @throws ApiError
3334
4071
  */
3335
- public static reportingControllerBackfillSnapshots(
3336
- data: ReportingControllerBackfillSnapshotsData
3337
- ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
4072
+ public static holdingPnlControllerGetHoldingPnl(
4073
+ data: HoldingPnlControllerGetHoldingPnlData
4074
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3338
4075
  return __request(OpenAPI, {
3339
- method: 'POST',
3340
- url: '/api/v1/{region}/reporting/snapshots/backfill',
4076
+ method: 'GET',
4077
+ url: '/api/v1/{region}/investment/holdings/pnl',
3341
4078
  path: {
3342
4079
  region: data.region
3343
4080
  },
3344
- body: data.requestBody,
3345
- mediaType: 'application/json',
4081
+ query: {
4082
+ asOf: data.asOf,
4083
+ accountId: data.accountId,
4084
+ method: data.method
4085
+ },
3346
4086
  errors: {
3347
- 400: 'Invalid date format or range',
3348
- 401: 'User not authenticated',
3349
- 409: 'Backfill already in progress for this user'
4087
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
4088
+ 401: 'User not authenticated'
3350
4089
  }
3351
4090
  });
3352
4091
  }
@@ -3375,7 +4114,7 @@ export class AuthService {
3375
4114
  * Anonymous login with access token
3376
4115
  * @param data The data for the request.
3377
4116
  * @param data.requestBody
3378
- * @returns unknown Login successful
4117
+ * @returns AnonymousLoginResponseDto Login successful
3379
4118
  * @throws ApiError
3380
4119
  */
3381
4120
  public static authControllerAccessTokenLogin(
@@ -3391,17 +4130,75 @@ export class AuthService {
3391
4130
  }
3392
4131
  });
3393
4132
  }
4133
+
4134
+ /**
4135
+ * Exchange an access token for an advisor-scoped, short-TTL JWT (#1512)
4136
+ * @param data The data for the request.
4137
+ * @param data.requestBody
4138
+ * @returns AdvisorLoginResponseDto Advisor-scope login successful — the token is valid only on advisor tool-face endpoints (e.g. GET /:region/dashboard/advisor-context)
4139
+ * @throws ApiError
4140
+ */
4141
+ public static authControllerAdvisorTokenLogin(
4142
+ data: AuthControllerAdvisorTokenLoginData
4143
+ ): CancelablePromise<AuthControllerAdvisorTokenLoginResponse> {
4144
+ return __request(OpenAPI, {
4145
+ method: 'POST',
4146
+ url: '/api/v1/auth/sessions/advisor',
4147
+ body: data.requestBody,
4148
+ mediaType: 'application/json',
4149
+ errors: {
4150
+ 401: 'Invalid access token'
4151
+ }
4152
+ });
4153
+ }
4154
+ }
4155
+
4156
+ export class CommunityService {
4157
+ /**
4158
+ * Relay a sanitized parser-contribution payload
4159
+ * 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).
4160
+ * @param data The data for the request.
4161
+ * @param data.region Region code for tenant context (routing only; the institution region rides in the payload meta)
4162
+ * @param data.requestBody
4163
+ * @returns ParserContributionRelayResponseDto Issue created by the bot
4164
+ * @throws ApiError
4165
+ */
4166
+ public static parserContributionControllerCreate(
4167
+ data: ParserContributionControllerCreateData
4168
+ ): CancelablePromise<ParserContributionControllerCreateResponse> {
4169
+ return __request(OpenAPI, {
4170
+ method: 'POST',
4171
+ url: '/api/v1/{region}/community/parser-contributions',
4172
+ path: {
4173
+ region: data.region
4174
+ },
4175
+ body: data.requestBody,
4176
+ mediaType: 'application/json',
4177
+ errors: {
4178
+ 401: 'Unauthorized',
4179
+ 422: 'Validation failed (institution slug, empty samples, row/cell size limits)',
4180
+ 429: 'Rate limited (5 submissions per user per hour)',
4181
+ 501: 'Relay not configured on this deployment — clients fall back to the clipboard flow',
4182
+ 502: 'GitHub bot failure (upstream), safe to retry'
4183
+ }
4184
+ });
4185
+ }
3394
4186
  }
3395
4187
 
3396
- export class DefaultService {
4188
+ export class AdminCacheService {
3397
4189
  /**
3398
- * @returns unknown
4190
+ * Flush entire cache (L1 + L2)
4191
+ * Clears ALL cache entries across ALL namespaces and users. Use only for emergency cache corruption recovery, maintenance-window refresh, or development resets.
4192
+ * @returns unknown Cache flushed successfully
3399
4193
  * @throws ApiError
3400
4194
  */
3401
4195
  public static cacheControllerFlushCache(): CancelablePromise<CacheControllerFlushCacheResponse> {
3402
4196
  return __request(OpenAPI, {
3403
4197
  method: 'POST',
3404
- url: '/api/v1/cache/flush'
4198
+ url: '/api/v1/cache/flush',
4199
+ errors: {
4200
+ 403: 'Admin access required'
4201
+ }
3405
4202
  });
3406
4203
  }
3407
4204
  }
@@ -3562,3 +4359,53 @@ export class InfoService {
3562
4359
  });
3563
4360
  }
3564
4361
  }
4362
+
4363
+ export class MarketDataService {
4364
+ /**
4365
+ * Search market symbols by name or code
4366
+ * Ranked search over the openbb catalog. Empty `q` returns [].
4367
+ * @param data The data for the request.
4368
+ * @param data.q Search term — matched against symbol and instrument name. Empty string returns [].
4369
+ * @param data.limit Maximum number of results (clamped 1..50)
4370
+ * @param data.exchange Filter by exchange code (e.g. US, HK, SS, SZ). A-share codes also match symbol notations and venue-code aliases (exchange=SS matches SH/SHH column values and bare 6-digit Shanghai symbols; SZ likewise)
4371
+ * @param data.assetType Filter by OpenBB asset_type (e.g. stock, etf)
4372
+ * @returns SymbolSearchResultDto Ranked search results
4373
+ * @throws ApiError
4374
+ */
4375
+ public static symbolControllerSearch(
4376
+ data: SymbolControllerSearchData
4377
+ ): CancelablePromise<SymbolControllerSearchResponse> {
4378
+ return __request(OpenAPI, {
4379
+ method: 'GET',
4380
+ url: '/api/v1/market/symbols/search',
4381
+ query: {
4382
+ q: data.q,
4383
+ limit: data.limit,
4384
+ exchange: data.exchange,
4385
+ assetType: data.assetType
4386
+ }
4387
+ });
4388
+ }
4389
+
4390
+ /**
4391
+ * Get a market symbol quote
4392
+ * @param data The data for the request.
4393
+ * @param data.symbol
4394
+ * @returns SymbolQuoteDto Symbol quote
4395
+ * @throws ApiError
4396
+ */
4397
+ public static symbolControllerGetQuote(
4398
+ data: SymbolControllerGetQuoteData
4399
+ ): CancelablePromise<SymbolControllerGetQuoteResponse> {
4400
+ return __request(OpenAPI, {
4401
+ method: 'GET',
4402
+ url: '/api/v1/market/symbols/{symbol}/quote',
4403
+ path: {
4404
+ symbol: data.symbol
4405
+ },
4406
+ errors: {
4407
+ 404: 'Symbol not found in the openbb catalog'
4408
+ }
4409
+ });
4410
+ }
4411
+ }