@firela/api-types 0.0.0-canary.a7bda42 → 0.0.0-canary.a90bdd3

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.
Files changed (47) hide show
  1. package/dist/index.d.mts +10166 -0
  2. package/dist/index.d.ts +10166 -2
  3. package/dist/index.js +1298 -3
  4. package/dist/index.mjs +1265 -0
  5. package/package.json +25 -12
  6. package/src/generated/core/ApiError.ts +25 -0
  7. package/src/generated/core/ApiRequestOptions.ts +20 -0
  8. package/src/generated/core/ApiResult.ts +7 -0
  9. package/src/generated/core/CancelablePromise.ts +126 -0
  10. package/src/generated/core/OpenAPI.ts +56 -0
  11. package/src/generated/core/request.ts +391 -0
  12. package/{dist/generated/index.d.ts → src/generated/index.ts} +1 -1
  13. package/src/generated/schemas.gen.ts +9423 -0
  14. package/src/generated/services.gen.ts +4411 -0
  15. package/src/generated/types.gen.ts +31791 -0
  16. package/src/index.ts +12 -0
  17. package/README.md +0 -40
  18. package/dist/generated/core/ApiError.d.ts +0 -11
  19. package/dist/generated/core/ApiError.d.ts.map +0 -1
  20. package/dist/generated/core/ApiError.js +0 -11
  21. package/dist/generated/core/ApiRequestOptions.d.ts +0 -14
  22. package/dist/generated/core/ApiRequestOptions.d.ts.map +0 -1
  23. package/dist/generated/core/ApiRequestOptions.js +0 -1
  24. package/dist/generated/core/ApiResult.d.ts +0 -8
  25. package/dist/generated/core/ApiResult.d.ts.map +0 -1
  26. package/dist/generated/core/ApiResult.js +0 -1
  27. package/dist/generated/core/CancelablePromise.d.ts +0 -27
  28. package/dist/generated/core/CancelablePromise.d.ts.map +0 -1
  29. package/dist/generated/core/CancelablePromise.js +0 -88
  30. package/dist/generated/core/OpenAPI.d.ts +0 -28
  31. package/dist/generated/core/OpenAPI.d.ts.map +0 -1
  32. package/dist/generated/core/OpenAPI.js +0 -29
  33. package/dist/generated/core/request.d.ts +0 -30
  34. package/dist/generated/core/request.d.ts.map +0 -1
  35. package/dist/generated/core/request.js +0 -297
  36. package/dist/generated/index.d.ts.map +0 -1
  37. package/dist/generated/index.js +0 -7
  38. package/dist/generated/schemas.gen.d.ts +0 -771
  39. package/dist/generated/schemas.gen.d.ts.map +0 -1
  40. package/dist/generated/schemas.gen.js +0 -771
  41. package/dist/generated/services.gen.d.ts +0 -313
  42. package/dist/generated/services.gen.d.ts.map +0 -1
  43. package/dist/generated/services.gen.js +0 -705
  44. package/dist/generated/types.gen.d.ts +0 -1159
  45. package/dist/generated/types.gen.d.ts.map +0 -1
  46. package/dist/generated/types.gen.js +0 -2
  47. package/dist/index.d.ts.map +0 -1
@@ -0,0 +1,4411 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import type { CancelablePromise } from './core/CancelablePromise';
3
+ import { OpenAPI } from './core/OpenAPI';
4
+ import { request as __request } from './core/request';
5
+ import type {
6
+ AccountControllerCreateData,
7
+ AccountControllerCreateResponse,
8
+ AccountControllerFindAllData,
9
+ AccountControllerFindAllResponse,
10
+ AccountControllerFindOneData,
11
+ AccountControllerFindOneResponse,
12
+ AccountControllerUpdateData,
13
+ AccountControllerUpdateResponse,
14
+ AccountControllerDeleteData,
15
+ AccountControllerDeleteResponse,
16
+ AccountControllerCloseData,
17
+ AccountControllerCloseResponse,
18
+ AccountControllerReopenData,
19
+ AccountControllerReopenResponse,
20
+ AccountControllerAddOpeningBalanceData,
21
+ AccountControllerAddOpeningBalanceResponse,
22
+ AccountStandardsControllerGetTemplatesData,
23
+ AccountStandardsControllerGetTemplatesResponse,
24
+ AccountStandardsControllerGetTemplateMetadataData,
25
+ AccountStandardsControllerGetTemplateMetadataResponse,
26
+ AccountStandardsControllerGetRegionsData,
27
+ AccountStandardsControllerGetRegionsResponse,
28
+ TransactionControllerCreateData,
29
+ TransactionControllerCreateResponse,
30
+ TransactionControllerListData,
31
+ TransactionControllerListResponse,
32
+ TransactionControllerCreateBatchData,
33
+ TransactionControllerCreateBatchResponse,
34
+ TransactionControllerCorrectData,
35
+ TransactionControllerCorrectResponse,
36
+ TransactionControllerSuggestTagsData,
37
+ TransactionControllerSuggestTagsResponse,
38
+ TransactionControllerGetDetailData,
39
+ TransactionControllerGetDetailResponse,
40
+ TransactionControllerUpdateData,
41
+ TransactionControllerUpdateResponse,
42
+ TransactionControllerDeleteData,
43
+ TransactionControllerDeleteResponse,
44
+ BalanceControllerGetBalanceData,
45
+ BalanceControllerGetBalanceResponse,
46
+ BalanceControllerGetMultiCurrencyBalanceData,
47
+ BalanceControllerGetMultiCurrencyBalanceResponse,
48
+ ReviewControllerFindAllData,
49
+ ReviewControllerFindAllResponse,
50
+ ReviewControllerGetStatsData,
51
+ ReviewControllerGetStatsResponse,
52
+ ReviewControllerFindOneData,
53
+ ReviewControllerFindOneResponse,
54
+ ReviewControllerResolveData,
55
+ ReviewControllerResolveResponse,
56
+ ReviewControllerUndoData,
57
+ ReviewControllerUndoResponse,
58
+ ReviewControllerBatchResolveData,
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,
102
+ PayeeControllerCreateData,
103
+ PayeeControllerCreateResponse,
104
+ PayeeControllerFindAllData,
105
+ PayeeControllerFindAllResponse,
106
+ PayeeControllerAutocompleteData,
107
+ PayeeControllerAutocompleteResponse,
108
+ PayeeControllerGetTopPayeesData,
109
+ PayeeControllerGetTopPayeesResponse,
110
+ PayeeControllerFindOneData,
111
+ PayeeControllerFindOneResponse,
112
+ PayeeControllerUpdateData,
113
+ PayeeControllerUpdateResponse,
114
+ PayeeControllerDeleteData,
115
+ PayeeControllerDeleteResponse,
116
+ PayeeProfileAdminControllerCreateData,
117
+ PayeeProfileAdminControllerCreateResponse,
118
+ PayeeProfileAdminControllerFindAllData,
119
+ PayeeProfileAdminControllerFindAllResponse,
120
+ PayeeProfileAdminControllerFindOneData,
121
+ PayeeProfileAdminControllerFindOneResponse,
122
+ PayeeProfileAdminControllerUpdateData,
123
+ PayeeProfileAdminControllerUpdateResponse,
124
+ PayeeProfileAdminControllerDeleteData,
125
+ PayeeProfileAdminControllerDeleteResponse,
126
+ PayeeProfileAdminControllerVerifyData,
127
+ PayeeProfileAdminControllerVerifyResponse,
128
+ PayeeProfileAdminControllerUnverifyData,
129
+ PayeeProfileAdminControllerUnverifyResponse,
130
+ PayeeProfileControllerListActiveResponse,
131
+ CommodityControllerCreateData,
132
+ CommodityControllerCreateResponse,
133
+ CommodityControllerFindAllData,
134
+ CommodityControllerFindAllResponse,
135
+ CommodityControllerFindOneData,
136
+ CommodityControllerFindOneResponse,
137
+ CommodityControllerUpdateData,
138
+ CommodityControllerUpdateResponse,
139
+ CommodityControllerDeleteData,
140
+ CommodityControllerDeleteResponse,
141
+ CommodityControllerGetOrCreateData,
142
+ CommodityControllerGetOrCreateResponse,
143
+ CommodityControllerBulkCreateData,
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,
165
+ RecurringRuleControllerCreateData,
166
+ RecurringRuleControllerCreateResponse,
167
+ RecurringRuleControllerFindAllData,
168
+ RecurringRuleControllerFindAllResponse,
169
+ RecurringRuleControllerCreateFromTransactionData,
170
+ RecurringRuleControllerCreateFromTransactionResponse,
171
+ RecurringRuleControllerFindOneData,
172
+ RecurringRuleControllerFindOneResponse,
173
+ RecurringRuleControllerUpdateData,
174
+ RecurringRuleControllerUpdateResponse,
175
+ RecurringRuleControllerDeleteData,
176
+ RecurringRuleControllerDeleteResponse,
177
+ RecurringRuleControllerGetWithStatsData,
178
+ RecurringRuleControllerGetWithStatsResponse,
179
+ ExpectedTransactionControllerFindAllData,
180
+ ExpectedTransactionControllerFindAllResponse,
181
+ ExpectedTransactionControllerFindOverdueData,
182
+ ExpectedTransactionControllerFindOverdueResponse,
183
+ ExpectedTransactionControllerFindOneData,
184
+ ExpectedTransactionControllerFindOneResponse,
185
+ ExpectedTransactionControllerSkipData,
186
+ ExpectedTransactionControllerSkipResponse,
187
+ ExpectedTransactionControllerUndoSkipData,
188
+ ExpectedTransactionControllerUndoSkipResponse,
189
+ ExpectedTransactionControllerConfirmMatchData,
190
+ ExpectedTransactionControllerConfirmMatchResponse,
191
+ ExpectedTransactionControllerUnmatchData,
192
+ ExpectedTransactionControllerUnmatchResponse,
193
+ ExpectedTransactionControllerEnterNowData,
194
+ ExpectedTransactionControllerEnterNowResponse,
195
+ ForecastControllerGetForecastData,
196
+ ForecastControllerGetForecastResponse,
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,
222
+ ExportControllerExportBeancountResponse,
223
+ FileImportControllerImportFileData,
224
+ FileImportControllerImportFileResponse,
225
+ FileImportControllerIdentifyFileData,
226
+ FileImportControllerIdentifyFileResponse,
227
+ FileImportControllerImportBeancountData,
228
+ FileImportControllerImportBeancountResponse,
229
+ ImporterConfigControllerGetConfigData,
230
+ ImporterConfigControllerGetConfigResponse,
231
+ ImporterConfigControllerUpdateConfigData,
232
+ ImporterConfigControllerUpdateConfigResponse,
233
+ ImporterConfigControllerResetConfigData,
234
+ ImporterConfigControllerResetConfigResponse,
235
+ ProviderSyncControllerSyncData,
236
+ ProviderSyncControllerSyncResponse,
237
+ ProviderSyncControllerGetSupportedProvidersData,
238
+ ProviderSyncControllerGetSupportedProvidersResponse,
239
+ ProviderSyncControllerIsProviderSupportedData,
240
+ ProviderSyncControllerIsProviderSupportedResponse,
241
+ ExternalAccountLinkControllerCreateData,
242
+ ExternalAccountLinkControllerCreateResponse,
243
+ ExternalAccountLinkControllerFindAllData,
244
+ ExternalAccountLinkControllerFindAllResponse,
245
+ ExternalAccountLinkControllerFindOneData,
246
+ ExternalAccountLinkControllerFindOneResponse,
247
+ ExternalAccountLinkControllerRemoveData,
248
+ ExternalAccountLinkControllerRemoveResponse,
249
+ TelemetryControllerReportTelemetryData,
250
+ TelemetryControllerReportTelemetryResponse,
251
+ TelemetryControllerReportCoverageMissData,
252
+ TelemetryControllerReportCoverageMissResponse,
253
+ TelemetryControllerGetCoverageMetricsData,
254
+ TelemetryControllerGetCoverageMetricsResponse,
255
+ NlpControllerProcessNaturalLanguageData,
256
+ NlpControllerProcessNaturalLanguageResponse,
257
+ NlpControllerClearSessionData,
258
+ NlpControllerClearSessionResponse,
259
+ NlpControllerGetSessionData,
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,
274
+ DashboardControllerGetNetWorthData,
275
+ DashboardControllerGetNetWorthResponse,
276
+ DashboardControllerGetAccountsData,
277
+ DashboardControllerGetAccountsResponse,
278
+ DashboardControllerGetCashFlowData,
279
+ DashboardControllerGetCashFlowResponse,
280
+ DashboardControllerGetExpensesData,
281
+ DashboardControllerGetExpensesResponse,
282
+ DashboardControllerGetAdvisorContextData,
283
+ DashboardControllerGetAdvisorContextResponse,
284
+ HoldingPnlControllerGetHoldingPnlData,
285
+ HoldingPnlControllerGetHoldingPnlResponse,
286
+ ApiKeysControllerCreateApiKeyResponse,
287
+ AuthControllerAccessTokenLoginData,
288
+ AuthControllerAccessTokenLoginResponse,
289
+ AuthControllerAdvisorTokenLoginData,
290
+ AuthControllerAdvisorTokenLoginResponse,
291
+ ParserContributionControllerCreateData,
292
+ ParserContributionControllerCreateResponse,
293
+ CacheControllerFlushCacheResponse,
294
+ ExchangeRateControllerGetExchangeRateData,
295
+ ExchangeRateControllerGetExchangeRateResponse,
296
+ HealthControllerGetHealthResponse,
297
+ HealthControllerCheckDatabaseResponse,
298
+ HealthControllerCheckOpenBbResponse,
299
+ HealthControllerCheckRedisResponse,
300
+ HealthControllerGetCircuitBreakersHealthResponse,
301
+ HealthControllerResetCircuitBreakerData,
302
+ HealthControllerResetCircuitBreakerResponse,
303
+ HealthControllerGetMetricsResponse,
304
+ InfoControllerGetInfoResponse,
305
+ SymbolControllerSearchData,
306
+ SymbolControllerSearchResponse,
307
+ SymbolControllerGetQuoteData,
308
+ SymbolControllerGetQuoteResponse
309
+ } from './types.gen';
310
+
311
+ export class BeanAccountsService {
312
+ /**
313
+ * Create a new account
314
+ * Creates a new account (Beancount Open directive)
315
+ * @param data The data for the request.
316
+ * @param data.region Region code for tenant context
317
+ * @param data.requestBody
318
+ * @returns AccountResponseDto Account created successfully
319
+ * @throws ApiError
320
+ */
321
+ public static accountControllerCreate(
322
+ data: AccountControllerCreateData
323
+ ): CancelablePromise<AccountControllerCreateResponse> {
324
+ return __request(OpenAPI, {
325
+ method: 'POST',
326
+ url: '/api/v1/{region}/bean/accounts',
327
+ path: {
328
+ region: data.region
329
+ },
330
+ body: data.requestBody,
331
+ mediaType: 'application/json',
332
+ errors: {
333
+ 409: 'Account already exists'
334
+ }
335
+ });
336
+ }
337
+
338
+ /**
339
+ * List accounts
340
+ * Returns all accounts with optional filtering
341
+ * @param data The data for the request.
342
+ * @param data.region Region code for tenant context
343
+ * @param data.type Filter by account type
344
+ * @param data.status Filter by status
345
+ * @param data.isCustom Filter by custom (user-created) accounts only
346
+ * @param data.search Search term matched against account path and user-set display name (case-insensitive)
347
+ * @param data.limit Maximum number of results
348
+ * @param data.offset Number of results to skip
349
+ * @returns AccountListResponseDto Accounts retrieved successfully
350
+ * @throws ApiError
351
+ */
352
+ public static accountControllerFindAll(
353
+ data: AccountControllerFindAllData
354
+ ): CancelablePromise<AccountControllerFindAllResponse> {
355
+ return __request(OpenAPI, {
356
+ method: 'GET',
357
+ url: '/api/v1/{region}/bean/accounts',
358
+ path: {
359
+ region: data.region
360
+ },
361
+ query: {
362
+ type: data.type,
363
+ status: data.status,
364
+ isCustom: data.isCustom,
365
+ search: data.search,
366
+ limit: data.limit,
367
+ offset: data.offset
368
+ }
369
+ });
370
+ }
371
+
372
+ /**
373
+ * Get account by ID
374
+ * Returns a specific account
375
+ * @param data The data for the request.
376
+ * @param data.id Account UUID
377
+ * @param data.region Region code for tenant context
378
+ * @returns AccountResponseDto Account retrieved successfully
379
+ * @throws ApiError
380
+ */
381
+ public static accountControllerFindOne(
382
+ data: AccountControllerFindOneData
383
+ ): CancelablePromise<AccountControllerFindOneResponse> {
384
+ return __request(OpenAPI, {
385
+ method: 'GET',
386
+ url: '/api/v1/{region}/bean/accounts/{id}',
387
+ path: {
388
+ id: data.id,
389
+ region: data.region
390
+ },
391
+ errors: {
392
+ 404: 'Account not found'
393
+ }
394
+ });
395
+ }
396
+
397
+ /**
398
+ * Update account
399
+ * Updates account metadata (path cannot be changed)
400
+ * @param data The data for the request.
401
+ * @param data.id Account UUID
402
+ * @param data.region Region code for tenant context
403
+ * @param data.requestBody
404
+ * @returns AccountResponseDto Account updated successfully
405
+ * @throws ApiError
406
+ */
407
+ public static accountControllerUpdate(
408
+ data: AccountControllerUpdateData
409
+ ): CancelablePromise<AccountControllerUpdateResponse> {
410
+ return __request(OpenAPI, {
411
+ method: 'PUT',
412
+ url: '/api/v1/{region}/bean/accounts/{id}',
413
+ path: {
414
+ id: data.id,
415
+ region: data.region
416
+ },
417
+ body: data.requestBody,
418
+ mediaType: 'application/json',
419
+ errors: {
420
+ 404: 'Account not found'
421
+ }
422
+ });
423
+ }
424
+
425
+ /**
426
+ * Delete account
427
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
428
+ * @param data The data for the request.
429
+ * @param data.id Account UUID
430
+ * @param data.region Region code for tenant context
431
+ * @returns void Account deleted successfully
432
+ * @throws ApiError
433
+ */
434
+ public static accountControllerDelete(
435
+ data: AccountControllerDeleteData
436
+ ): CancelablePromise<AccountControllerDeleteResponse> {
437
+ return __request(OpenAPI, {
438
+ method: 'DELETE',
439
+ url: '/api/v1/{region}/bean/accounts/{id}',
440
+ path: {
441
+ id: data.id,
442
+ region: data.region
443
+ },
444
+ errors: {
445
+ 404: 'Account not found',
446
+ 409: 'Account has active transactions and cannot be deleted'
447
+ }
448
+ });
449
+ }
450
+
451
+ /**
452
+ * Close account
453
+ * Closes an account (Beancount Close directive)
454
+ * @param data The data for the request.
455
+ * @param data.id Account UUID
456
+ * @param data.region Region code for tenant context
457
+ * @param data.requestBody
458
+ * @returns AccountResponseDto Account closed successfully
459
+ * @throws ApiError
460
+ */
461
+ public static accountControllerClose(
462
+ data: AccountControllerCloseData
463
+ ): CancelablePromise<AccountControllerCloseResponse> {
464
+ return __request(OpenAPI, {
465
+ method: 'POST',
466
+ url: '/api/v1/{region}/bean/accounts/{id}/close',
467
+ path: {
468
+ id: data.id,
469
+ region: data.region
470
+ },
471
+ body: data.requestBody,
472
+ mediaType: 'application/json',
473
+ errors: {
474
+ 400: 'Account is already closed',
475
+ 404: 'Account not found'
476
+ }
477
+ });
478
+ }
479
+
480
+ /**
481
+ * Reopen account
482
+ * Reopens a previously closed account
483
+ * @param data The data for the request.
484
+ * @param data.id Account UUID
485
+ * @param data.region Region code for tenant context
486
+ * @param data.requestBody
487
+ * @returns AccountResponseDto Account reopened successfully
488
+ * @throws ApiError
489
+ */
490
+ public static accountControllerReopen(
491
+ data: AccountControllerReopenData
492
+ ): CancelablePromise<AccountControllerReopenResponse> {
493
+ return __request(OpenAPI, {
494
+ method: 'POST',
495
+ url: '/api/v1/{region}/bean/accounts/{id}/reopen',
496
+ path: {
497
+ id: data.id,
498
+ region: data.region
499
+ },
500
+ body: data.requestBody,
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
+ }
535
+ });
536
+ }
537
+ }
538
+
539
+ export class BeanAccountStandardsService {
540
+ /**
541
+ * Get account templates
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).
543
+ * @param data The data for the request.
544
+ * @param data.region Region code (any ISO alpha-2; not-yet-open codes return the universal-only catalog)
545
+ * @param data.type Filter by account type
546
+ * @param data.search Search term for path, description, aliases, or localized display name
547
+ * @returns AccountStandardListResponseDto Account templates retrieved successfully
548
+ * @throws ApiError
549
+ */
550
+ public static accountStandardsControllerGetTemplates(
551
+ data: AccountStandardsControllerGetTemplatesData
552
+ ): CancelablePromise<AccountStandardsControllerGetTemplatesResponse> {
553
+ return __request(OpenAPI, {
554
+ method: 'GET',
555
+ url: '/api/v1/{region}/bean/account-standards',
556
+ path: {
557
+ region: data.region
558
+ },
559
+ query: {
560
+ type: data.type,
561
+ search: data.search
562
+ }
563
+ });
564
+ }
565
+
566
+ /**
567
+ * Get template metadata for an account path
568
+ * Returns root type for a template path.
569
+ * @param data The data for the request.
570
+ * @param data.region Region code for tenant context. Not-yet-open codes degrade to the universal-only catalog (#759)
571
+ * @param data.path Account path to check
572
+ * @returns TemplateMetadataResponseDto Template metadata retrieved successfully
573
+ * @throws ApiError
574
+ */
575
+ public static accountStandardsControllerGetTemplateMetadata(
576
+ data: AccountStandardsControllerGetTemplateMetadataData
577
+ ): CancelablePromise<AccountStandardsControllerGetTemplateMetadataResponse> {
578
+ return __request(OpenAPI, {
579
+ method: 'GET',
580
+ url: '/api/v1/{region}/bean/account-standards/template-metadata',
581
+ path: {
582
+ region: data.region
583
+ },
584
+ query: {
585
+ path: data.path
586
+ }
587
+ });
588
+ }
589
+
590
+ /**
591
+ * Get available regions with hierarchy
592
+ * Returns the full region catalog (every ISO 3166-1 entry) with an 'open' flag and inheritance metadata (#759)
593
+ * @param data The data for the request.
594
+ * @param data.region Region code for tenant context. Not-yet-open codes degrade to the universal-only catalog (#759)
595
+ * @returns RegionsMetadataResponseDto Regions metadata retrieved successfully
596
+ * @throws ApiError
597
+ */
598
+ public static accountStandardsControllerGetRegions(
599
+ data: AccountStandardsControllerGetRegionsData
600
+ ): CancelablePromise<AccountStandardsControllerGetRegionsResponse> {
601
+ return __request(OpenAPI, {
602
+ method: 'GET',
603
+ url: '/api/v1/{region}/bean/account-standards/regions',
604
+ path: {
605
+ region: data.region
606
+ }
607
+ });
608
+ }
609
+ }
610
+
611
+ export class BeanTransactionsService {
612
+ /**
613
+ * @deprecated
614
+ * Create transaction (DEPRECATED)
615
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
616
+ * @param data The data for the request.
617
+ * @param data.region Region code for tenant context
618
+ * @param data.requestBody Transaction data with postings
619
+ * @returns TransactionResponseDto Transaction created successfully
620
+ * @throws ApiError
621
+ */
622
+ public static transactionControllerCreate(
623
+ data: TransactionControllerCreateData
624
+ ): CancelablePromise<TransactionControllerCreateResponse> {
625
+ return __request(OpenAPI, {
626
+ method: 'POST',
627
+ url: '/api/v1/{region}/bean/transactions',
628
+ path: {
629
+ region: data.region
630
+ },
631
+ body: data.requestBody,
632
+ mediaType: 'application/json',
633
+ errors: {
634
+ 400: 'Validation failed',
635
+ 401: 'Authentication required',
636
+ 422: 'Semantic validation failed (transaction does not balance, invalid accounts)',
637
+ 500: 'Unexpected server error'
638
+ }
639
+ });
640
+ }
641
+
642
+ /**
643
+ * List transactions
644
+ * Returns a paginated list of transactions with optional filters
645
+ * @param data The data for the request.
646
+ * @param data.region Region code for tenant context
647
+ * @param data.limit Number of items per page (1-100, default: 20)
648
+ * @param data.offset Number of items to skip (default: 0)
649
+ * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
650
+ * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
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).
652
+ * @param data.search Search in narration and payee fields (max 200 chars)
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.
656
+ * @returns TransactionListResponseDto Transaction list
657
+ * @throws ApiError
658
+ */
659
+ public static transactionControllerList(
660
+ data: TransactionControllerListData
661
+ ): CancelablePromise<TransactionControllerListResponse> {
662
+ return __request(OpenAPI, {
663
+ method: 'GET',
664
+ url: '/api/v1/{region}/bean/transactions',
665
+ path: {
666
+ region: data.region
667
+ },
668
+ query: {
669
+ limit: data.limit,
670
+ offset: data.offset,
671
+ dateFrom: data.dateFrom,
672
+ dateTo: data.dateTo,
673
+ status: data.status,
674
+ search: data.search,
675
+ accountId: data.accountId,
676
+ category: data.category,
677
+ flow: data.flow
678
+ },
679
+ errors: {
680
+ 400: 'Validation failed',
681
+ 401: 'Authentication required'
682
+ }
683
+ });
684
+ }
685
+
686
+ /**
687
+ * @deprecated
688
+ * Batch create transactions (DEPRECATED)
689
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
690
+ * @param data The data for the request.
691
+ * @param data.region Region code for tenant context
692
+ * @param data.requestBody
693
+ * @returns BatchTransactionResponseDto Transactions processed
694
+ * @throws ApiError
695
+ */
696
+ public static transactionControllerCreateBatch(
697
+ data: TransactionControllerCreateBatchData
698
+ ): CancelablePromise<TransactionControllerCreateBatchResponse> {
699
+ return __request(OpenAPI, {
700
+ method: 'POST',
701
+ url: '/api/v1/{region}/bean/transactions/batch',
702
+ path: {
703
+ region: data.region
704
+ },
705
+ body: data.requestBody,
706
+ mediaType: 'application/json',
707
+ errors: {
708
+ 400: 'Invalid input',
709
+ 401: 'Authentication required'
710
+ }
711
+ });
712
+ }
713
+
714
+ /**
715
+ * Correct (supersede) a transaction
716
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
717
+ * @param data The data for the request.
718
+ * @param data.id Original transaction ID to correct
719
+ * @param data.region Region code for tenant context
720
+ * @param data.requestBody
721
+ * @returns TransactionDetailDto Corrected transaction created
722
+ * @throws ApiError
723
+ */
724
+ public static transactionControllerCorrect(
725
+ data: TransactionControllerCorrectData
726
+ ): CancelablePromise<TransactionControllerCorrectResponse> {
727
+ return __request(OpenAPI, {
728
+ method: 'POST',
729
+ url: '/api/v1/{region}/bean/transactions/{id}/correct',
730
+ path: {
731
+ id: data.id,
732
+ region: data.region
733
+ },
734
+ body: data.requestBody,
735
+ mediaType: 'application/json',
736
+ errors: {
737
+ 404: 'Original transaction not found',
738
+ 409: 'Original no longer ACTIVE (concurrent modification)',
739
+ 422: 'Pipeline validation failed (does not balance, invalid accounts)'
740
+ }
741
+ });
742
+ }
743
+
744
+ /**
745
+ * Suggest transaction tags
746
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
747
+ * @param data The data for the request.
748
+ * @param data.region Region code for tenant context
749
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
750
+ * @param data.sort usage (default) or name
751
+ * @param data.limit Max suggestions (1-100, default 10)
752
+ * @returns TagSuggestionsResponseDto Tag suggestions
753
+ * @throws ApiError
754
+ */
755
+ public static transactionControllerSuggestTags(
756
+ data: TransactionControllerSuggestTagsData
757
+ ): CancelablePromise<TransactionControllerSuggestTagsResponse> {
758
+ return __request(OpenAPI, {
759
+ method: 'GET',
760
+ url: '/api/v1/{region}/bean/transactions/tags',
761
+ path: {
762
+ region: data.region
763
+ },
764
+ query: {
765
+ q: data.q,
766
+ sort: data.sort,
767
+ limit: data.limit
768
+ },
769
+ errors: {
770
+ 400: 'Validation failed',
771
+ 401: 'Authentication required'
772
+ }
773
+ });
774
+ }
775
+
776
+ /**
777
+ * Get transaction detail
778
+ * Returns transaction details including all postings
779
+ * @param data The data for the request.
780
+ * @param data.id Transaction ID
781
+ * @param data.region Region code for tenant context
782
+ * @returns TransactionDetailDto Transaction detail
783
+ * @throws ApiError
784
+ */
785
+ public static transactionControllerGetDetail(
786
+ data: TransactionControllerGetDetailData
787
+ ): CancelablePromise<TransactionControllerGetDetailResponse> {
788
+ return __request(OpenAPI, {
789
+ method: 'GET',
790
+ url: '/api/v1/{region}/bean/transactions/{id}',
791
+ path: {
792
+ id: data.id,
793
+ region: data.region
794
+ },
795
+ errors: {
796
+ 401: 'Authentication required',
797
+ 404: 'Transaction not found'
798
+ }
799
+ });
800
+ }
801
+
802
+ /**
803
+ * Update transaction metadata
804
+ * Updates transaction metadata (flag, payee, narration, tags, links, meta). Postings cannot be modified.
805
+ * @param data The data for the request.
806
+ * @param data.id Transaction ID
807
+ * @param data.region Region code for tenant context
808
+ * @param data.requestBody Fields to update (all optional)
809
+ * @returns TransactionDetailDto Transaction updated successfully
810
+ * @throws ApiError
811
+ */
812
+ public static transactionControllerUpdate(
813
+ data: TransactionControllerUpdateData
814
+ ): CancelablePromise<TransactionControllerUpdateResponse> {
815
+ return __request(OpenAPI, {
816
+ method: 'PATCH',
817
+ url: '/api/v1/{region}/bean/transactions/{id}',
818
+ path: {
819
+ id: data.id,
820
+ region: data.region
821
+ },
822
+ body: data.requestBody,
823
+ mediaType: 'application/json',
824
+ errors: {
825
+ 400: 'Cannot update voided transaction',
826
+ 401: 'Authentication required',
827
+ 404: 'Transaction not found'
828
+ }
829
+ });
830
+ }
831
+
832
+ /**
833
+ * Void transaction
834
+ * Soft-deletes a transaction by marking it as VOIDED
835
+ * @param data The data for the request.
836
+ * @param data.id Transaction ID
837
+ * @param data.region Region code for tenant context
838
+ * @returns void Transaction voided successfully
839
+ * @throws ApiError
840
+ */
841
+ public static transactionControllerDelete(
842
+ data: TransactionControllerDeleteData
843
+ ): CancelablePromise<TransactionControllerDeleteResponse> {
844
+ return __request(OpenAPI, {
845
+ method: 'DELETE',
846
+ url: '/api/v1/{region}/bean/transactions/{id}',
847
+ path: {
848
+ id: data.id,
849
+ region: data.region
850
+ },
851
+ errors: {
852
+ 400: 'Transaction already voided',
853
+ 401: 'Authentication required',
854
+ 404: 'Transaction not found'
855
+ }
856
+ });
857
+ }
858
+ }
859
+
860
+ export class BeanBalancesService {
861
+ /**
862
+ * Query account balance
863
+ * Calculate account balance at a specific date for a single currency
864
+ * @param data The data for the request.
865
+ * @param data.account Account name (e.g., "Assets:Checking")
866
+ * @param data.region Region code for tenant context
867
+ * @param data.date Date to calculate balance at (ISO 8601 format)
868
+ * @param data.currency Currency to query (e.g., "USD", "CNY")
869
+ * @returns BalanceResponseDto Balance calculated successfully
870
+ * @throws ApiError
871
+ */
872
+ public static balanceControllerGetBalance(
873
+ data: BalanceControllerGetBalanceData
874
+ ): CancelablePromise<BalanceControllerGetBalanceResponse> {
875
+ return __request(OpenAPI, {
876
+ method: 'GET',
877
+ url: '/api/v1/{region}/bean/balances',
878
+ path: {
879
+ region: data.region
880
+ },
881
+ query: {
882
+ account: data.account,
883
+ date: data.date,
884
+ currency: data.currency
885
+ },
886
+ errors: {
887
+ 400: 'Invalid query parameters',
888
+ 401: 'User not authenticated'
889
+ }
890
+ });
891
+ }
892
+
893
+ /**
894
+ * Query multi-currency account balance
895
+ * Calculate account balances for all currencies at a specific date
896
+ * @param data The data for the request.
897
+ * @param data.region Region code for tenant context
898
+ * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
899
+ * @throws ApiError
900
+ */
901
+ public static balanceControllerGetMultiCurrencyBalance(
902
+ data: BalanceControllerGetMultiCurrencyBalanceData
903
+ ): CancelablePromise<BalanceControllerGetMultiCurrencyBalanceResponse> {
904
+ return __request(OpenAPI, {
905
+ method: 'GET',
906
+ url: '/api/v1/{region}/bean/balances/multi-currency',
907
+ path: {
908
+ region: data.region
909
+ },
910
+ errors: {
911
+ 400: 'Invalid query parameters',
912
+ 401: 'User not authenticated'
913
+ }
914
+ });
915
+ }
916
+ }
917
+
918
+ export class BeanReviewsService {
919
+ /**
920
+ * List pending reviews
921
+ * @param data The data for the request.
922
+ * @param data.region Region code for tenant context
923
+ * @param data.type Filter by review type
924
+ * @param data.confidenceLevel Filter by confidence level
925
+ * @param data.sortBy Sort order
926
+ * @param data.page Page number (default: 1)
927
+ * @param data.limit Items per page (1-100, default: 20)
928
+ * @returns ReviewListResponseDto
929
+ * @throws ApiError
930
+ */
931
+ public static reviewControllerFindAll(
932
+ data: ReviewControllerFindAllData
933
+ ): CancelablePromise<ReviewControllerFindAllResponse> {
934
+ return __request(OpenAPI, {
935
+ method: 'GET',
936
+ url: '/api/v1/{region}/bean/reviews',
937
+ path: {
938
+ region: data.region
939
+ },
940
+ query: {
941
+ type: data.type,
942
+ confidenceLevel: data.confidenceLevel,
943
+ sortBy: data.sortBy,
944
+ page: data.page,
945
+ limit: data.limit
946
+ }
947
+ });
948
+ }
949
+
950
+ /**
951
+ * Get review statistics
952
+ * @param data The data for the request.
953
+ * @param data.region Region code for tenant context
954
+ * @returns ReviewStatsDto
955
+ * @throws ApiError
956
+ */
957
+ public static reviewControllerGetStats(
958
+ data: ReviewControllerGetStatsData
959
+ ): CancelablePromise<ReviewControllerGetStatsResponse> {
960
+ return __request(OpenAPI, {
961
+ method: 'GET',
962
+ url: '/api/v1/{region}/bean/reviews/stats',
963
+ path: {
964
+ region: data.region
965
+ }
966
+ });
967
+ }
968
+
969
+ /**
970
+ * Get review by ID
971
+ * @param data The data for the request.
972
+ * @param data.id Review ID
973
+ * @param data.region Region code for tenant context
974
+ * @returns ReviewDetailDto
975
+ * @throws ApiError
976
+ */
977
+ public static reviewControllerFindOne(
978
+ data: ReviewControllerFindOneData
979
+ ): CancelablePromise<ReviewControllerFindOneResponse> {
980
+ return __request(OpenAPI, {
981
+ method: 'GET',
982
+ url: '/api/v1/{region}/bean/reviews/{id}',
983
+ path: {
984
+ id: data.id,
985
+ region: data.region
986
+ }
987
+ });
988
+ }
989
+
990
+ /**
991
+ * Resolve a review item
992
+ * @param data The data for the request.
993
+ * @param data.id Review ID
994
+ * @param data.region Region code for tenant context
995
+ * @param data.requestBody
996
+ * @returns ResolveResultDto
997
+ * @throws ApiError
998
+ */
999
+ public static reviewControllerResolve(
1000
+ data: ReviewControllerResolveData
1001
+ ): CancelablePromise<ReviewControllerResolveResponse> {
1002
+ return __request(OpenAPI, {
1003
+ method: 'POST',
1004
+ url: '/api/v1/{region}/bean/reviews/{id}/resolve',
1005
+ path: {
1006
+ id: data.id,
1007
+ region: data.region
1008
+ },
1009
+ body: data.requestBody,
1010
+ mediaType: 'application/json'
1011
+ });
1012
+ }
1013
+
1014
+ /**
1015
+ * Undo a resolution (within 24h)
1016
+ * @param data The data for the request.
1017
+ * @param data.id Review ID
1018
+ * @param data.region Region code for tenant context
1019
+ * @returns UndoResultDto
1020
+ * @throws ApiError
1021
+ */
1022
+ public static reviewControllerUndo(
1023
+ data: ReviewControllerUndoData
1024
+ ): CancelablePromise<ReviewControllerUndoResponse> {
1025
+ return __request(OpenAPI, {
1026
+ method: 'POST',
1027
+ url: '/api/v1/{region}/bean/reviews/{id}/undo',
1028
+ path: {
1029
+ id: data.id,
1030
+ region: data.region
1031
+ }
1032
+ });
1033
+ }
1034
+
1035
+ /**
1036
+ * Batch resolve multiple reviews
1037
+ * @param data The data for the request.
1038
+ * @param data.region Region code for tenant context
1039
+ * @param data.requestBody Batch resolution request containing review IDs and action
1040
+ * @returns BatchResolveResultDto
1041
+ * @throws ApiError
1042
+ */
1043
+ public static reviewControllerBatchResolve(
1044
+ data: ReviewControllerBatchResolveData
1045
+ ): CancelablePromise<ReviewControllerBatchResolveResponse> {
1046
+ return __request(OpenAPI, {
1047
+ method: 'POST',
1048
+ url: '/api/v1/{region}/bean/reviews/batch-resolve',
1049
+ path: {
1050
+ region: data.region
1051
+ },
1052
+ body: data.requestBody,
1053
+ mediaType: 'application/json'
1054
+ });
1055
+ }
1056
+ }
1057
+
1058
+ export class BeanTransactionRulesService {
1059
+ /**
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.
1062
+ * @param data The data for the request.
1063
+ * @param data.region Region code for tenant context
1064
+ * @param data.requestBody
1065
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
1066
+ * @throws ApiError
1067
+ */
1068
+ public static transactionRuleControllerCreate(
1069
+ data: TransactionRuleControllerCreateData
1070
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
1071
+ return __request(OpenAPI, {
1072
+ method: 'POST',
1073
+ url: '/api/v1/{region}/bean/transaction-rules',
1074
+ path: {
1075
+ region: data.region
1076
+ },
1077
+ body: data.requestBody,
1078
+ mediaType: 'application/json',
1079
+ errors: {
1080
+ 400: 'Validation failed',
1081
+ 401: 'Unauthorized',
1082
+ 409: 'Resource conflict - another process is updating this rule'
1083
+ }
1084
+ });
1085
+ }
1086
+
1087
+ /**
1088
+ * Get all transaction rules for user
1089
+ * @param data The data for the request.
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
1097
+ * @throws ApiError
1098
+ */
1099
+ public static transactionRuleControllerList(
1100
+ data: TransactionRuleControllerListData
1101
+ ): CancelablePromise<TransactionRuleControllerListResponse> {
1102
+ return __request(OpenAPI, {
1103
+ method: 'GET',
1104
+ url: '/api/v1/{region}/bean/transaction-rules',
1105
+ path: {
1106
+ region: data.region
1107
+ },
1108
+ query: {
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
+ /**
1644
+ * Get payee autocomplete suggestions
1645
+ * Returns active payee names matching the query, sorted by recent usage. Used for transaction input autocomplete.
1646
+ * @param data The data for the request.
1647
+ * @param data.q Search query for payee name (partial match, case-insensitive)
1648
+ * @param data.limit Maximum number of suggestions
1649
+ * @returns PayeeAutocompleteResponseDto Autocomplete suggestions retrieved successfully
1650
+ * @throws ApiError
1651
+ */
1652
+ public static payeeControllerAutocomplete(
1653
+ data: PayeeControllerAutocompleteData
1654
+ ): CancelablePromise<PayeeControllerAutocompleteResponse> {
1655
+ return __request(OpenAPI, {
1656
+ method: 'GET',
1657
+ url: '/api/v1/bean/payees/autocomplete',
1658
+ query: {
1659
+ q: data.q,
1660
+ limit: data.limit
1661
+ }
1662
+ });
1663
+ }
1664
+
1665
+ /**
1666
+ * Get top payees by usage
1667
+ * Returns the most frequently used payees, sorted by use count. Used for statistics and analytics.
1668
+ * @param data The data for the request.
1669
+ * @param data.limit Maximum number of results
1670
+ * @returns PayeeStatsResponseDto Top payees retrieved successfully
1671
+ * @throws ApiError
1672
+ */
1673
+ public static payeeControllerGetTopPayees(
1674
+ data: PayeeControllerGetTopPayeesData = {}
1675
+ ): CancelablePromise<PayeeControllerGetTopPayeesResponse> {
1676
+ return __request(OpenAPI, {
1677
+ method: 'GET',
1678
+ url: '/api/v1/bean/payees/top',
1679
+ query: {
1680
+ limit: data.limit
1681
+ }
1682
+ });
1683
+ }
1684
+
1685
+ /**
1686
+ * Get payee by ID
1687
+ * Returns a specific payee mapping by its UUID
1688
+ * @param data The data for the request.
1689
+ * @param data.id Payee UUID
1690
+ * @returns PayeeResponseDto Payee retrieved successfully
1691
+ * @throws ApiError
1692
+ */
1693
+ public static payeeControllerFindOne(
1694
+ data: PayeeControllerFindOneData
1695
+ ): CancelablePromise<PayeeControllerFindOneResponse> {
1696
+ return __request(OpenAPI, {
1697
+ method: 'GET',
1698
+ url: '/api/v1/bean/payees/{id}',
1699
+ path: {
1700
+ id: data.id
1701
+ },
1702
+ errors: {
1703
+ 403: 'Payee belongs to another user',
1704
+ 404: 'Payee not found'
1705
+ }
1706
+ });
1707
+ }
1708
+
1709
+ /**
1710
+ * Update payee
1711
+ * Updates a payee mapping. The payee name cannot be changed after creation.
1712
+ * @param data The data for the request.
1713
+ * @param data.id Payee UUID
1714
+ * @param data.requestBody
1715
+ * @returns PayeeResponseDto Payee updated successfully
1716
+ * @throws ApiError
1717
+ */
1718
+ public static payeeControllerUpdate(
1719
+ data: PayeeControllerUpdateData
1720
+ ): CancelablePromise<PayeeControllerUpdateResponse> {
1721
+ return __request(OpenAPI, {
1722
+ method: 'PUT',
1723
+ url: '/api/v1/bean/payees/{id}',
1724
+ path: {
1725
+ id: data.id
1726
+ },
1727
+ body: data.requestBody,
1728
+ mediaType: 'application/json',
1729
+ errors: {
1730
+ 400: 'Invalid input data',
1731
+ 404: 'Payee not found'
1732
+ }
1733
+ });
1734
+ }
1735
+
1736
+ /**
1737
+ * Delete payee
1738
+ * Soft deletes a payee by marking it as inactive. Inactive payees will not appear in autocomplete suggestions.
1739
+ * @param data The data for the request.
1740
+ * @param data.id Payee UUID
1741
+ * @returns void Payee deleted successfully
1742
+ * @throws ApiError
1743
+ */
1744
+ public static payeeControllerDelete(
1745
+ data: PayeeControllerDeleteData
1746
+ ): CancelablePromise<PayeeControllerDeleteResponse> {
1747
+ return __request(OpenAPI, {
1748
+ method: 'DELETE',
1749
+ url: '/api/v1/bean/payees/{id}',
1750
+ path: {
1751
+ id: data.id
1752
+ },
1753
+ errors: {
1754
+ 404: 'Payee not found'
1755
+ }
1756
+ });
1757
+ }
1758
+ }
1759
+
1760
+ export class AdminPayeeProfilesService {
1761
+ /**
1762
+ * Create payee profile (Admin only)
1763
+ * Creates a new global payee profile. The canonical name must be unique (case-insensitive).
1764
+ * @param data The data for the request.
1765
+ * @param data.requestBody
1766
+ * @returns PayeeProfileResponseDto Payee profile created successfully
1767
+ * @throws ApiError
1768
+ */
1769
+ public static payeeProfileAdminControllerCreate(
1770
+ data: PayeeProfileAdminControllerCreateData
1771
+ ): CancelablePromise<PayeeProfileAdminControllerCreateResponse> {
1772
+ return __request(OpenAPI, {
1773
+ method: 'POST',
1774
+ url: '/api/v1/admin/payee-profiles',
1775
+ body: data.requestBody,
1776
+ mediaType: 'application/json',
1777
+ errors: {
1778
+ 400: 'Validation failed',
1779
+ 403: 'Admin access required',
1780
+ 409: 'Payee profile already exists'
1781
+ }
1782
+ });
1783
+ }
1784
+
1785
+ /**
1786
+ * List payee profiles (Admin only)
1787
+ * Returns all payee profiles with optional filtering by category, country, verification status, etc.
1788
+ * @param data The data for the request.
1789
+ * @param data.search Search term for canonical name and aliases (case-insensitive)
1790
+ * @param data.category Filter by category
1791
+ * @param data.country Filter by country (ISO 3166-1 alpha-2)
1792
+ * @param data.isActive Filter by active status (default: true - show only active)
1793
+ * @param data.verified Filter by verification status. true = verified only, false = unverified only
1794
+ * @param data.dataSource Filter by data source
1795
+ * @returns PayeeProfileListResponseDto Payee profiles retrieved successfully
1796
+ * @throws ApiError
1797
+ */
1798
+ public static payeeProfileAdminControllerFindAll(
1799
+ data: PayeeProfileAdminControllerFindAllData = {}
1800
+ ): CancelablePromise<PayeeProfileAdminControllerFindAllResponse> {
1801
+ return __request(OpenAPI, {
1802
+ method: 'GET',
1803
+ url: '/api/v1/admin/payee-profiles',
1804
+ query: {
1805
+ search: data.search,
1806
+ category: data.category,
1807
+ country: data.country,
1808
+ isActive: data.isActive,
1809
+ verified: data.verified,
1810
+ dataSource: data.dataSource
1811
+ },
1812
+ errors: {
1813
+ 403: 'Admin access required'
1814
+ }
1815
+ });
1816
+ }
1817
+
1818
+ /**
1819
+ * Get payee profile by ID (Admin only)
1820
+ * Returns a single payee profile by its ID.
1821
+ * @param data The data for the request.
1822
+ * @param data.id Payee profile ID (UUID)
1823
+ * @returns PayeeProfileResponseDto Payee profile retrieved successfully
1824
+ * @throws ApiError
1825
+ */
1826
+ public static payeeProfileAdminControllerFindOne(
1827
+ data: PayeeProfileAdminControllerFindOneData
1828
+ ): CancelablePromise<PayeeProfileAdminControllerFindOneResponse> {
1829
+ return __request(OpenAPI, {
1830
+ method: 'GET',
1831
+ url: '/api/v1/admin/payee-profiles/{id}',
1832
+ path: {
1833
+ id: data.id
1834
+ },
1835
+ errors: {
1836
+ 403: 'Admin access required',
1837
+ 404: 'Payee profile not found'
1838
+ }
1839
+ });
1840
+ }
1841
+
1842
+ /**
1843
+ * Update payee profile (Admin only)
1844
+ * Updates an existing payee profile. The canonical name cannot be changed.
1845
+ * @param data The data for the request.
1846
+ * @param data.id Payee profile ID (UUID)
1847
+ * @param data.requestBody
1848
+ * @returns PayeeProfileResponseDto Payee profile updated successfully
1849
+ * @throws ApiError
1850
+ */
1851
+ public static payeeProfileAdminControllerUpdate(
1852
+ data: PayeeProfileAdminControllerUpdateData
1853
+ ): CancelablePromise<PayeeProfileAdminControllerUpdateResponse> {
1854
+ return __request(OpenAPI, {
1855
+ method: 'PUT',
1856
+ url: '/api/v1/admin/payee-profiles/{id}',
1857
+ path: {
1858
+ id: data.id
1859
+ },
1860
+ body: data.requestBody,
1861
+ mediaType: 'application/json',
1862
+ errors: {
1863
+ 403: 'Admin access required',
1864
+ 404: 'Payee profile not found'
1865
+ }
1866
+ });
1867
+ }
1868
+
1869
+ /**
1870
+ * Soft delete payee profile (Admin only)
1871
+ * Marks a payee profile as inactive (soft delete). The profile cannot be deleted if it is referenced by user payees.
1872
+ * @param data The data for the request.
1873
+ * @param data.id Payee profile ID (UUID)
1874
+ * @returns void Payee profile deleted successfully
1875
+ * @throws ApiError
1876
+ */
1877
+ public static payeeProfileAdminControllerDelete(
1878
+ data: PayeeProfileAdminControllerDeleteData
1879
+ ): CancelablePromise<PayeeProfileAdminControllerDeleteResponse> {
1880
+ return __request(OpenAPI, {
1881
+ method: 'DELETE',
1882
+ url: '/api/v1/admin/payee-profiles/{id}',
1883
+ path: {
1884
+ id: data.id
1885
+ },
1886
+ errors: {
1887
+ 403: 'Admin access required',
1888
+ 404: 'Payee profile not found',
1889
+ 409: 'Payee profile is in use and cannot be deleted'
1890
+ }
1891
+ });
1892
+ }
1893
+
1894
+ /**
1895
+ * Verify payee profile (Admin only)
1896
+ * Marks a payee profile as verified by setting verifiedAt to current timestamp.
1897
+ * @param data The data for the request.
1898
+ * @param data.id Payee profile ID (UUID)
1899
+ * @returns PayeeProfileResponseDto Payee profile verified successfully
1900
+ * @throws ApiError
1901
+ */
1902
+ public static payeeProfileAdminControllerVerify(
1903
+ data: PayeeProfileAdminControllerVerifyData
1904
+ ): CancelablePromise<PayeeProfileAdminControllerVerifyResponse> {
1905
+ return __request(OpenAPI, {
1906
+ method: 'POST',
1907
+ url: '/api/v1/admin/payee-profiles/{id}/verify',
1908
+ path: {
1909
+ id: data.id
1910
+ },
1911
+ errors: {
1912
+ 403: 'Admin access required',
1913
+ 404: 'Payee profile not found'
1914
+ }
1915
+ });
1916
+ }
1917
+
1918
+ /**
1919
+ * Unverify payee profile (Admin only)
1920
+ * Removes verification status by setting verifiedAt to null.
1921
+ * @param data The data for the request.
1922
+ * @param data.id Payee profile ID (UUID)
1923
+ * @returns void Payee profile unverified successfully
1924
+ * @throws ApiError
1925
+ */
1926
+ public static payeeProfileAdminControllerUnverify(
1927
+ data: PayeeProfileAdminControllerUnverifyData
1928
+ ): CancelablePromise<PayeeProfileAdminControllerUnverifyResponse> {
1929
+ return __request(OpenAPI, {
1930
+ method: 'DELETE',
1931
+ url: '/api/v1/admin/payee-profiles/{id}/verify',
1932
+ path: {
1933
+ id: data.id
1934
+ },
1935
+ errors: {
1936
+ 403: 'Admin access required',
1937
+ 404: 'Payee profile not found'
1938
+ }
1939
+ });
1940
+ }
1941
+ }
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
+
1961
+ export class BeanCommoditiesService {
1962
+ /**
1963
+ * Create a new commodity
1964
+ * Creates a new commodity definition for the authenticated user
1965
+ * @param data The data for the request.
1966
+ * @param data.region Region code for tenant context
1967
+ * @param data.requestBody
1968
+ * @returns CommodityResponseDto Commodity created successfully
1969
+ * @throws ApiError
1970
+ */
1971
+ public static commodityControllerCreate(
1972
+ data: CommodityControllerCreateData
1973
+ ): CancelablePromise<CommodityControllerCreateResponse> {
1974
+ return __request(OpenAPI, {
1975
+ method: 'POST',
1976
+ url: '/api/v1/{region}/bean/commodities',
1977
+ path: {
1978
+ region: data.region
1979
+ },
1980
+ body: data.requestBody,
1981
+ mediaType: 'application/json',
1982
+ errors: {
1983
+ 400: 'Invalid input data',
1984
+ 409: 'Commodity already exists'
1985
+ }
1986
+ });
1987
+ }
1988
+
1989
+ /**
1990
+ * List user commodities
1991
+ * Returns all commodity definitions for the authenticated user with optional filtering
1992
+ * @param data The data for the request.
1993
+ * @param data.region Region code for tenant context
1994
+ * @param data.search Search term for symbol or metadata fields (partial match). Searches symbol and metadata.name.
1995
+ * @param data.symbol Filter by exact symbol match
1996
+ * @returns CommodityListResponseDto Commodities retrieved successfully
1997
+ * @throws ApiError
1998
+ */
1999
+ public static commodityControllerFindAll(
2000
+ data: CommodityControllerFindAllData
2001
+ ): CancelablePromise<CommodityControllerFindAllResponse> {
2002
+ return __request(OpenAPI, {
2003
+ method: 'GET',
2004
+ url: '/api/v1/{region}/bean/commodities',
2005
+ path: {
2006
+ region: data.region
2007
+ },
2008
+ query: {
2009
+ search: data.search,
2010
+ symbol: data.symbol
2011
+ }
2012
+ });
2013
+ }
2014
+
2015
+ /**
2016
+ * Get commodity by symbol
2017
+ * Returns a specific commodity definition by its symbol
2018
+ * @param data The data for the request.
2019
+ * @param data.symbol Commodity symbol
2020
+ * @param data.region Region code for tenant context
2021
+ * @returns CommodityResponseDto Commodity retrieved successfully
2022
+ * @throws ApiError
2023
+ */
2024
+ public static commodityControllerFindOne(
2025
+ data: CommodityControllerFindOneData
2026
+ ): CancelablePromise<CommodityControllerFindOneResponse> {
2027
+ return __request(OpenAPI, {
2028
+ method: 'GET',
2029
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
2030
+ path: {
2031
+ symbol: data.symbol,
2032
+ region: data.region
2033
+ },
2034
+ errors: {
2035
+ 404: 'Commodity not found'
2036
+ }
2037
+ });
2038
+ }
2039
+
2040
+ /**
2041
+ * Update commodity
2042
+ * Updates an existing commodity definition. Symbol cannot be changed.
2043
+ * @param data The data for the request.
2044
+ * @param data.symbol Commodity symbol
2045
+ * @param data.region Region code for tenant context
2046
+ * @param data.requestBody
2047
+ * @returns CommodityResponseDto Commodity updated successfully
2048
+ * @throws ApiError
2049
+ */
2050
+ public static commodityControllerUpdate(
2051
+ data: CommodityControllerUpdateData
2052
+ ): CancelablePromise<CommodityControllerUpdateResponse> {
2053
+ return __request(OpenAPI, {
2054
+ method: 'PUT',
2055
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
2056
+ path: {
2057
+ symbol: data.symbol,
2058
+ region: data.region
2059
+ },
2060
+ body: data.requestBody,
2061
+ mediaType: 'application/json',
2062
+ errors: {
2063
+ 400: 'Invalid input data',
2064
+ 404: 'Commodity not found'
2065
+ }
2066
+ });
2067
+ }
2068
+
2069
+ /**
2070
+ * Delete commodity
2071
+ * Deletes a commodity definition
2072
+ * @param data The data for the request.
2073
+ * @param data.symbol Commodity symbol
2074
+ * @param data.region Region code for tenant context
2075
+ * @returns void Commodity deleted successfully
2076
+ * @throws ApiError
2077
+ */
2078
+ public static commodityControllerDelete(
2079
+ data: CommodityControllerDeleteData
2080
+ ): CancelablePromise<CommodityControllerDeleteResponse> {
2081
+ return __request(OpenAPI, {
2082
+ method: 'DELETE',
2083
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
2084
+ path: {
2085
+ symbol: data.symbol,
2086
+ region: data.region
2087
+ },
2088
+ errors: {
2089
+ 404: 'Commodity not found'
2090
+ }
2091
+ });
2092
+ }
2093
+
2094
+ /**
2095
+ * Ensure commodity exists
2096
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
2097
+ * @param data The data for the request.
2098
+ * @param data.symbol Commodity symbol
2099
+ * @param data.region Region code for tenant context
2100
+ * @returns CommodityResponseDto Commodity retrieved or created
2101
+ * @throws ApiError
2102
+ */
2103
+ public static commodityControllerGetOrCreate(
2104
+ data: CommodityControllerGetOrCreateData
2105
+ ): CancelablePromise<CommodityControllerGetOrCreateResponse> {
2106
+ return __request(OpenAPI, {
2107
+ method: 'POST',
2108
+ url: '/api/v1/{region}/bean/commodities/{symbol}/ensure',
2109
+ path: {
2110
+ symbol: data.symbol,
2111
+ region: data.region
2112
+ }
2113
+ });
2114
+ }
2115
+
2116
+ /**
2117
+ * Bulk create commodities
2118
+ * Creates multiple commodities from a list of symbols, useful for initialization
2119
+ * @param data The data for the request.
2120
+ * @param data.region Region code for tenant context
2121
+ * @returns CommodityResponseDto Commodities created successfully
2122
+ * @throws ApiError
2123
+ */
2124
+ public static commodityControllerBulkCreate(
2125
+ data: CommodityControllerBulkCreateData
2126
+ ): CancelablePromise<CommodityControllerBulkCreateResponse> {
2127
+ return __request(OpenAPI, {
2128
+ method: 'POST',
2129
+ url: '/api/v1/{region}/bean/commodities/bulk',
2130
+ path: {
2131
+ region: data.region
2132
+ }
2133
+ });
2134
+ }
2135
+ }
2136
+
2137
+ export class ReportingService {
2138
+ /**
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
+ *
2152
+ * @param data The data for the request.
2153
+ * @param data.region Region code for tenant context
2154
+ * @param data.period Time period
2155
+ * @param data.granularity Data granularity
2156
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
2157
+ * @throws ApiError
2158
+ */
2159
+ public static reportingControllerGetPortfolioTrends(
2160
+ data: ReportingControllerGetPortfolioTrendsData
2161
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
2162
+ return __request(OpenAPI, {
2163
+ method: 'GET',
2164
+ url: '/api/v1/{region}/reporting/portfolio/trends',
2165
+ path: {
2166
+ region: data.region
2167
+ },
2168
+ query: {
2169
+ period: data.period,
2170
+ granularity: data.granularity
2171
+ },
2172
+ errors: {
2173
+ 401: 'User not authenticated'
2174
+ }
2175
+ });
2176
+ }
2177
+
2178
+ /**
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
+ *
2188
+ * @param data The data for the request.
2189
+ * @param data.region Region code for tenant context
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
2193
+ * @throws ApiError
2194
+ */
2195
+ public static reportingControllerGetCashFlowTrends(
2196
+ data: ReportingControllerGetCashFlowTrendsData
2197
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
2198
+ return __request(OpenAPI, {
2199
+ method: 'GET',
2200
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
2201
+ path: {
2202
+ region: data.region
2203
+ },
2204
+ query: {
2205
+ period: data.period,
2206
+ granularity: data.granularity
2207
+ },
2208
+ errors: {
2209
+ 401: 'User not authenticated'
2210
+ }
2211
+ });
2212
+ }
2213
+
2214
+ /**
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
+ *
2229
+ * @param data The data for the request.
2230
+ * @param data.region Region code for tenant context
2231
+ * @param data.requestBody Optional date (defaults to today)
2232
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
2233
+ * @throws ApiError
2234
+ */
2235
+ public static reportingControllerGenerateSnapshot(
2236
+ data: ReportingControllerGenerateSnapshotData
2237
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
2238
+ return __request(OpenAPI, {
2239
+ method: 'POST',
2240
+ url: '/api/v1/{region}/reporting/snapshots/generate',
2241
+ path: {
2242
+ region: data.region
2243
+ },
2244
+ body: data.requestBody,
2245
+ mediaType: 'application/json',
2246
+ errors: {
2247
+ 400: 'Invalid date format',
2248
+ 401: 'User not authenticated'
2249
+ }
2250
+ });
2251
+ }
2252
+
2253
+ /**
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
+ *
2268
+ * @param data The data for the request.
2269
+ * @param data.region Region code for tenant context
2270
+ * @param data.requestBody
2271
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
2272
+ * @throws ApiError
2273
+ */
2274
+ public static reportingControllerBackfillSnapshots(
2275
+ data: ReportingControllerBackfillSnapshotsData
2276
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
2277
+ return __request(OpenAPI, {
2278
+ method: 'POST',
2279
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
2280
+ path: {
2281
+ region: data.region
2282
+ },
2283
+ body: data.requestBody,
2284
+ mediaType: 'application/json',
2285
+ errors: {
2286
+ 400: 'Invalid date format or range',
2287
+ 401: 'User not authenticated',
2288
+ 409: 'Backfill already in progress for this user'
2289
+ }
2290
+ });
2291
+ }
2292
+ }
2293
+
2294
+ export class BeanPricesService {
2295
+ /**
2296
+ * Create a new price
2297
+ * Creates a new price entry for the authenticated user
2298
+ * @param data The data for the request.
2299
+ * @param data.region Region code for tenant context
2300
+ * @param data.requestBody
2301
+ * @returns PriceResponseDto Price created successfully
2302
+ * @throws ApiError
2303
+ */
2304
+ public static priceControllerCreate(
2305
+ data: PriceControllerCreateData
2306
+ ): CancelablePromise<PriceControllerCreateResponse> {
2307
+ return __request(OpenAPI, {
2308
+ method: 'POST',
2309
+ url: '/api/v1/{region}/bean/prices',
2310
+ path: {
2311
+ region: data.region
2312
+ },
2313
+ body: data.requestBody,
2314
+ mediaType: 'application/json',
2315
+ errors: {
2316
+ 404: 'Currency or quoteCurrency commodity not found',
2317
+ 409: 'Price already exists for this currency pair and date'
2318
+ }
2319
+ });
2320
+ }
2321
+
2322
+ /**
2323
+ * List user prices
2324
+ * Returns all price entries for the authenticated user with optional filtering
2325
+ * @param data The data for the request.
2326
+ * @param data.region Region code for tenant context
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
2335
+ * @throws ApiError
2336
+ */
2337
+ public static priceControllerFindAll(
2338
+ data: PriceControllerFindAllData
2339
+ ): CancelablePromise<PriceControllerFindAllResponse> {
2340
+ return __request(OpenAPI, {
2341
+ method: 'GET',
2342
+ url: '/api/v1/{region}/bean/prices',
2343
+ path: {
2344
+ region: data.region
2345
+ },
2346
+ query: {
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
2354
+ }
2355
+ });
2356
+ }
2357
+
2358
+ /**
2359
+ * Get price by ID
2360
+ * Returns a single price entry by its ID
2361
+ * @param data The data for the request.
2362
+ * @param data.id Price ID
2363
+ * @param data.region Region code for tenant context
2364
+ * @returns PriceResponseDto Price retrieved successfully
2365
+ * @throws ApiError
2366
+ */
2367
+ public static priceControllerFindOne(
2368
+ data: PriceControllerFindOneData
2369
+ ): CancelablePromise<PriceControllerFindOneResponse> {
2370
+ return __request(OpenAPI, {
2371
+ method: 'GET',
2372
+ url: '/api/v1/{region}/bean/prices/{id}',
2373
+ path: {
2374
+ id: data.id,
2375
+ region: data.region
2376
+ },
2377
+ errors: {
2378
+ 404: 'Price not found'
2379
+ }
2380
+ });
2381
+ }
2382
+
2383
+ /**
2384
+ * Update a price
2385
+ * Updates an existing price entry
2386
+ * @param data The data for the request.
2387
+ * @param data.id Price ID
2388
+ * @param data.region Region code for tenant context
2389
+ * @param data.requestBody
2390
+ * @returns PriceResponseDto Price updated successfully
2391
+ * @throws ApiError
2392
+ */
2393
+ public static priceControllerUpdate(
2394
+ data: PriceControllerUpdateData
2395
+ ): CancelablePromise<PriceControllerUpdateResponse> {
2396
+ return __request(OpenAPI, {
2397
+ method: 'PUT',
2398
+ url: '/api/v1/{region}/bean/prices/{id}',
2399
+ path: {
2400
+ id: data.id,
2401
+ region: data.region
2402
+ },
2403
+ body: data.requestBody,
2404
+ mediaType: 'application/json',
2405
+ errors: {
2406
+ 404: 'Price not found',
2407
+ 409: 'Updated price conflicts with existing price'
2408
+ }
2409
+ });
2410
+ }
2411
+
2412
+ /**
2413
+ * Delete a price
2414
+ * Deletes a price entry (hard delete)
2415
+ * @param data The data for the request.
2416
+ * @param data.id Price ID
2417
+ * @param data.region Region code for tenant context
2418
+ * @returns void Price deleted successfully
2419
+ * @throws ApiError
2420
+ */
2421
+ public static priceControllerDelete(
2422
+ data: PriceControllerDeleteData
2423
+ ): CancelablePromise<PriceControllerDeleteResponse> {
2424
+ return __request(OpenAPI, {
2425
+ method: 'DELETE',
2426
+ url: '/api/v1/{region}/bean/prices/{id}',
2427
+ path: {
2428
+ id: data.id,
2429
+ region: data.region
2430
+ },
2431
+ errors: {
2432
+ 404: 'Price not found'
2433
+ }
2434
+ });
2435
+ }
2436
+
2437
+ /**
2438
+ * Bulk create prices
2439
+ * Creates multiple price entries at once (skips duplicates)
2440
+ * @param data The data for the request.
2441
+ * @param data.region Region code for tenant context
2442
+ * @param data.requestBody
2443
+ * @returns PriceResponseDto Prices created successfully
2444
+ * @throws ApiError
2445
+ */
2446
+ public static priceControllerBulkCreate(
2447
+ data: PriceControllerBulkCreateData
2448
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
2449
+ return __request(OpenAPI, {
2450
+ method: 'POST',
2451
+ url: '/api/v1/{region}/bean/prices/bulk',
2452
+ path: {
2453
+ region: data.region
2454
+ },
2455
+ body: data.requestBody,
2456
+ mediaType: 'application/json'
2457
+ });
2458
+ }
2459
+ }
2460
+
2461
+ export class RecurringRulesService {
2462
+ /**
2463
+ * Create a new recurring rule
2464
+ * Creates a new recurring transaction rule for the authenticated user
2465
+ * @param data The data for the request.
2466
+ * @param data.region Region code for tenant context
2467
+ * @param data.requestBody
2468
+ * @returns RecurringRuleResponseDto Rule created successfully
2469
+ * @throws ApiError
2470
+ */
2471
+ public static recurringRuleControllerCreate(
2472
+ data: RecurringRuleControllerCreateData
2473
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
2474
+ return __request(OpenAPI, {
2475
+ method: 'POST',
2476
+ url: '/api/v1/{region}/bean/recurring-rules',
2477
+ path: {
2478
+ region: data.region
2479
+ },
2480
+ body: data.requestBody,
2481
+ mediaType: 'application/json',
2482
+ errors: {
2483
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
2484
+ 409: 'Rule with same name already exists'
2485
+ }
2486
+ });
2487
+ }
2488
+
2489
+ /**
2490
+ * List recurring rules
2491
+ * Returns all recurring rules for the authenticated user with optional filtering
2492
+ * @param data The data for the request.
2493
+ * @param data.region Region code for tenant context
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
2498
+ * @throws ApiError
2499
+ */
2500
+ public static recurringRuleControllerFindAll(
2501
+ data: RecurringRuleControllerFindAllData
2502
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
2503
+ return __request(OpenAPI, {
2504
+ method: 'GET',
2505
+ url: '/api/v1/{region}/bean/recurring-rules',
2506
+ path: {
2507
+ region: data.region
2508
+ },
2509
+ query: {
2510
+ isActive: data.isActive,
2511
+ frequency: data.frequency,
2512
+ hasAutoCreate: data.hasAutoCreate
2513
+ }
2514
+ });
2515
+ }
2516
+
2517
+ /**
2518
+ * Create recurring rule from transaction
2519
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
2520
+ * @param data The data for the request.
2521
+ * @param data.transactionId Source transaction ID
2522
+ * @param data.region Region code for tenant context
2523
+ * @param data.requestBody
2524
+ * @returns RecurringRuleResponseDto Rule created successfully
2525
+ * @throws ApiError
2526
+ */
2527
+ public static recurringRuleControllerCreateFromTransaction(
2528
+ data: RecurringRuleControllerCreateFromTransactionData
2529
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
2530
+ return __request(OpenAPI, {
2531
+ method: 'POST',
2532
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
2533
+ path: {
2534
+ transactionId: data.transactionId,
2535
+ region: data.region
2536
+ },
2537
+ body: data.requestBody,
2538
+ mediaType: 'application/json',
2539
+ errors: {
2540
+ 404: 'Transaction not found',
2541
+ 409: 'Rule with same name already exists or transaction already linked'
2542
+ }
2543
+ });
2544
+ }
2545
+
2546
+ /**
2547
+ * Get recurring rule by ID
2548
+ * Returns a specific recurring rule with its details
2549
+ * @param data The data for the request.
2550
+ * @param data.id Rule ID
2551
+ * @param data.region Region code for tenant context
2552
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
2553
+ * @throws ApiError
2554
+ */
2555
+ public static recurringRuleControllerFindOne(
2556
+ data: RecurringRuleControllerFindOneData
2557
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
2558
+ return __request(OpenAPI, {
2559
+ method: 'GET',
2560
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
2561
+ path: {
2562
+ id: data.id,
2563
+ region: data.region
2564
+ },
2565
+ errors: {
2566
+ 404: 'Rule not found'
2567
+ }
2568
+ });
2569
+ }
2570
+
2571
+ /**
2572
+ * Update recurring rule
2573
+ * Updates an existing recurring rule
2574
+ * @param data The data for the request.
2575
+ * @param data.id Rule ID
2576
+ * @param data.region Region code for tenant context
2577
+ * @param data.requestBody
2578
+ * @returns RecurringRuleResponseDto Rule updated successfully
2579
+ * @throws ApiError
2580
+ */
2581
+ public static recurringRuleControllerUpdate(
2582
+ data: RecurringRuleControllerUpdateData
2583
+ ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
2584
+ return __request(OpenAPI, {
2585
+ method: 'PATCH',
2586
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
2587
+ path: {
2588
+ id: data.id,
2589
+ region: data.region
2590
+ },
2591
+ body: data.requestBody,
2592
+ mediaType: 'application/json',
2593
+ errors: {
2594
+ 400: 'Invalid input data',
2595
+ 404: 'Rule not found'
2596
+ }
2597
+ });
2598
+ }
2599
+
2600
+ /**
2601
+ * Delete recurring rule
2602
+ * Soft deletes a recurring rule (sets isActive to false)
2603
+ * @param data The data for the request.
2604
+ * @param data.id Rule ID
2605
+ * @param data.region Region code for tenant context
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
2632
+ * @throws ApiError
2633
+ */
2634
+ public static recurringRuleControllerGetWithStats(
2635
+ data: RecurringRuleControllerGetWithStatsData
2636
+ ): CancelablePromise<RecurringRuleControllerGetWithStatsResponse> {
2637
+ return __request(OpenAPI, {
2638
+ method: 'GET',
2639
+ url: '/api/v1/{region}/bean/recurring-rules/{id}/stats',
2640
+ path: {
2641
+ id: data.id,
2642
+ region: data.region
2643
+ },
2644
+ errors: {
2645
+ 404: 'Rule not found'
2646
+ }
2647
+ });
2648
+ }
2649
+ }
2650
+
2651
+ export class ExpectedTransactionsService {
2652
+ /**
2653
+ * List expected transactions
2654
+ * Returns expected transactions for the authenticated user with optional filtering
2655
+ * @param data The data for the request.
2656
+ * @param data.region Region code for tenant context
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
2662
+ * @throws ApiError
2663
+ */
2664
+ public static expectedTransactionControllerFindAll(
2665
+ data: ExpectedTransactionControllerFindAllData
2666
+ ): CancelablePromise<ExpectedTransactionControllerFindAllResponse> {
2667
+ return __request(OpenAPI, {
2668
+ method: 'GET',
2669
+ url: '/api/v1/{region}/bean/expected-transactions',
2670
+ path: {
2671
+ region: data.region
2672
+ },
2673
+ query: {
2674
+ ruleId: data.ruleId,
2675
+ status: data.status,
2676
+ fromDate: data.fromDate,
2677
+ toDate: data.toDate
2678
+ }
2679
+ });
2680
+ }
2681
+
2682
+ /**
2683
+ * List overdue expected transactions
2684
+ * Returns all overdue expected transactions (PENDING past tolerance)
2685
+ * @param data The data for the request.
2686
+ * @param data.region Region code for tenant context
2687
+ * @returns ExpectedTransactionListResponseDto Overdue transactions retrieved successfully
2688
+ * @throws ApiError
2689
+ */
2690
+ public static expectedTransactionControllerFindOverdue(
2691
+ data: ExpectedTransactionControllerFindOverdueData
2692
+ ): CancelablePromise<ExpectedTransactionControllerFindOverdueResponse> {
2693
+ return __request(OpenAPI, {
2694
+ method: 'GET',
2695
+ url: '/api/v1/{region}/bean/expected-transactions/overdue',
2696
+ path: {
2697
+ region: data.region
2698
+ }
2699
+ });
2700
+ }
2701
+
2702
+ /**
2703
+ * Get expected transaction by ID
2704
+ * Returns a specific expected transaction with rule details
2705
+ * @param data The data for the request.
2706
+ * @param data.id Expected transaction ID
2707
+ * @param data.region Region code for tenant context
2708
+ * @returns ExpectedTransactionResponseDto Expected transaction retrieved successfully
2709
+ * @throws ApiError
2710
+ */
2711
+ public static expectedTransactionControllerFindOne(
2712
+ data: ExpectedTransactionControllerFindOneData
2713
+ ): CancelablePromise<ExpectedTransactionControllerFindOneResponse> {
2714
+ return __request(OpenAPI, {
2715
+ method: 'GET',
2716
+ url: '/api/v1/{region}/bean/expected-transactions/{id}',
2717
+ path: {
2718
+ id: data.id,
2719
+ region: data.region
2720
+ },
2721
+ errors: {
2722
+ 404: 'Expected transaction not found'
2723
+ }
2724
+ });
2725
+ }
2726
+
2727
+ /**
2728
+ * Skip expected transaction
2729
+ * Marks an expected transaction as skipped (PENDING -> SKIPPED)
2730
+ * @param data The data for the request.
2731
+ * @param data.id Expected transaction ID
2732
+ * @param data.region Region code for tenant context
2733
+ * @returns ExpectedTransactionResponseDto Expected transaction skipped successfully
2734
+ * @throws ApiError
2735
+ */
2736
+ public static expectedTransactionControllerSkip(
2737
+ data: ExpectedTransactionControllerSkipData
2738
+ ): CancelablePromise<ExpectedTransactionControllerSkipResponse> {
2739
+ return __request(OpenAPI, {
2740
+ method: 'POST',
2741
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2742
+ path: {
2743
+ id: data.id,
2744
+ region: data.region
2745
+ },
2746
+ errors: {
2747
+ 400: 'Cannot skip - not in PENDING status',
2748
+ 404: 'Expected transaction not found'
2749
+ }
2750
+ });
2751
+ }
2752
+
2753
+ /**
2754
+ * Undo skip
2755
+ * Reverses a skip operation (SKIPPED -> PENDING)
2756
+ * @param data The data for the request.
2757
+ * @param data.id Expected transaction ID
2758
+ * @param data.region Region code for tenant context
2759
+ * @returns void Skip undone successfully
2760
+ * @throws ApiError
2761
+ */
2762
+ public static expectedTransactionControllerUndoSkip(
2763
+ data: ExpectedTransactionControllerUndoSkipData
2764
+ ): CancelablePromise<ExpectedTransactionControllerUndoSkipResponse> {
2765
+ return __request(OpenAPI, {
2766
+ method: 'DELETE',
2767
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2768
+ path: {
2769
+ id: data.id,
2770
+ region: data.region
2771
+ },
2772
+ errors: {
2773
+ 400: 'Cannot undo - not in SKIPPED status',
2774
+ 404: 'Expected transaction not found'
2775
+ }
2776
+ });
2777
+ }
2778
+
2779
+ /**
2780
+ * Confirm transaction match
2781
+ * Manually matches an expected transaction with an actual transaction
2782
+ * @param data The data for the request.
2783
+ * @param data.id Expected transaction ID
2784
+ * @param data.region Region code for tenant context
2785
+ * @param data.requestBody
2786
+ * @returns unknown Match confirmed successfully
2787
+ * @throws ApiError
2788
+ */
2789
+ public static expectedTransactionControllerConfirmMatch(
2790
+ data: ExpectedTransactionControllerConfirmMatchData
2791
+ ): CancelablePromise<ExpectedTransactionControllerConfirmMatchResponse> {
2792
+ return __request(OpenAPI, {
2793
+ method: 'POST',
2794
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2795
+ path: {
2796
+ id: data.id,
2797
+ region: data.region
2798
+ },
2799
+ body: data.requestBody,
2800
+ mediaType: 'application/json',
2801
+ errors: {
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'
2805
+ }
2806
+ });
2807
+ }
2808
+
2809
+ /**
2810
+ * Unmatch transaction
2811
+ * Removes the match between expected and actual transaction (COMPLETED -> PENDING)
2812
+ * @param data The data for the request.
2813
+ * @param data.id Expected transaction ID
2814
+ * @param data.region Region code for tenant context
2815
+ * @returns void Match removed successfully
2816
+ * @throws ApiError
2817
+ */
2818
+ public static expectedTransactionControllerUnmatch(
2819
+ data: ExpectedTransactionControllerUnmatchData
2820
+ ): CancelablePromise<ExpectedTransactionControllerUnmatchResponse> {
2821
+ return __request(OpenAPI, {
2822
+ method: 'DELETE',
2823
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2824
+ path: {
2825
+ id: data.id,
2826
+ region: data.region
2827
+ },
2828
+ errors: {
2829
+ 400: 'Cannot unmatch - not in COMPLETED status',
2830
+ 404: 'Expected transaction not found'
2831
+ }
2832
+ });
2833
+ }
2834
+
2835
+ /**
2836
+ * Enter Now
2837
+ * Creates an actual transaction for an expected transaction (YNAB-style Enter Now)
2838
+ * @param data The data for the request.
2839
+ * @param data.id Expected transaction ID
2840
+ * @param data.region Region code for tenant context
2841
+ * @param data.requestBody
2842
+ * @returns unknown Transaction created successfully
2843
+ * @throws ApiError
2844
+ */
2845
+ public static expectedTransactionControllerEnterNow(
2846
+ data: ExpectedTransactionControllerEnterNowData
2847
+ ): CancelablePromise<ExpectedTransactionControllerEnterNowResponse> {
2848
+ return __request(OpenAPI, {
2849
+ method: 'POST',
2850
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/enter',
2851
+ path: {
2852
+ id: data.id,
2853
+ region: data.region
2854
+ },
2855
+ body: data.requestBody,
2856
+ mediaType: 'application/json',
2857
+ errors: {
2858
+ 400: 'Cannot enter - not in PENDING status or missing accounts',
2859
+ 404: 'Expected transaction or accounts not found'
2860
+ }
2861
+ });
2862
+ }
2863
+ }
2864
+
2865
+ export class RecurringForecastService {
2866
+ /**
2867
+ * Get cash flow forecast
2868
+ * Returns predicted outflows for the next N months based on active recurring rules
2869
+ * @param data The data for the request.
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
2873
+ * @throws ApiError
2874
+ */
2875
+ public static forecastControllerGetForecast(
2876
+ data: ForecastControllerGetForecastData
2877
+ ): CancelablePromise<ForecastControllerGetForecastResponse> {
2878
+ return __request(OpenAPI, {
2879
+ method: 'GET',
2880
+ url: '/api/v1/{region}/bean/recurring/forecast',
2881
+ path: {
2882
+ region: data.region
2883
+ },
2884
+ query: {
2885
+ months: data.months
2886
+ }
2887
+ });
2888
+ }
2889
+ }
2890
+
2891
+ export class BeanCategoryCatalogService {
2892
+ /**
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.
2895
+ * @param data The data for the request.
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
2900
+ * @throws ApiError
2901
+ */
2902
+ public static categoryCatalogControllerList(
2903
+ data: CategoryCatalogControllerListData
2904
+ ): CancelablePromise<CategoryCatalogControllerListResponse> {
2905
+ return __request(OpenAPI, {
2906
+ method: 'GET',
2907
+ url: '/api/v1/{region}/bean/categories',
2908
+ path: {
2909
+ region: data.region
2910
+ },
2911
+ query: {
2912
+ scenario: data.scenario,
2913
+ routeBearing: data.routeBearing
2914
+ }
2915
+ });
2916
+ }
2917
+ }
2918
+
2919
+ export class LifeEventsService {
2920
+ /**
2921
+ * Create a new life event
2922
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2923
+ * @param data The data for the request.
2924
+ * @param data.region Region code for tenant context (decorative for life events)
2925
+ * @param data.requestBody
2926
+ * @returns EventResponseDto Life event created successfully
2927
+ * @throws ApiError
2928
+ */
2929
+ public static eventControllerCreate(
2930
+ data: EventControllerCreateData
2931
+ ): CancelablePromise<EventControllerCreateResponse> {
2932
+ return __request(OpenAPI, {
2933
+ method: 'POST',
2934
+ url: '/api/v1/{region}/bean/events',
2935
+ path: {
2936
+ region: data.region
2937
+ },
2938
+ body: data.requestBody,
2939
+ mediaType: 'application/json',
2940
+ errors: {
2941
+ 409: 'Life event already exists for this (userId, type, date) combination'
2942
+ }
2943
+ });
2944
+ }
2945
+
2946
+ /**
2947
+ * List user life events
2948
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2949
+ * @param data The data for the request.
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
2958
+ * @throws ApiError
2959
+ */
2960
+ public static eventControllerFindAll(
2961
+ data: EventControllerFindAllData
2962
+ ): CancelablePromise<EventControllerFindAllResponse> {
2963
+ return __request(OpenAPI, {
2964
+ method: 'GET',
2965
+ url: '/api/v1/{region}/bean/events',
2966
+ path: {
2967
+ region: data.region
2968
+ },
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
2976
+ }
2977
+ });
2978
+ }
2979
+
2980
+ /**
2981
+ * Get life event by ID
2982
+ * Returns a single life event by its ID. Returns ETag header.
2983
+ * @param data The data for the request.
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
2987
+ * @throws ApiError
2988
+ */
2989
+ public static eventControllerFindOne(
2990
+ data: EventControllerFindOneData
2991
+ ): CancelablePromise<EventControllerFindOneResponse> {
2992
+ return __request(OpenAPI, {
2993
+ method: 'GET',
2994
+ url: '/api/v1/{region}/bean/events/{id}',
2995
+ path: {
2996
+ id: data.id,
2997
+ region: data.region
2998
+ },
2999
+ errors: {
3000
+ 404: 'Life event not found'
3001
+ }
3002
+ });
3003
+ }
3004
+
3005
+ /**
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.
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)
3011
+ * @param data.requestBody
3012
+ * @returns EventResponseDto Life event updated successfully
3013
+ * @throws ApiError
3014
+ */
3015
+ public static eventControllerUpdate(
3016
+ data: EventControllerUpdateData
3017
+ ): CancelablePromise<EventControllerUpdateResponse> {
3018
+ return __request(OpenAPI, {
3019
+ method: 'PUT',
3020
+ url: '/api/v1/{region}/bean/events/{id}',
3021
+ path: {
3022
+ id: data.id,
3023
+ region: data.region
3024
+ },
3025
+ body: data.requestBody,
3026
+ mediaType: 'application/json',
3027
+ errors: {
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)'
3032
+ }
3033
+ });
3034
+ }
3035
+
3036
+ /**
3037
+ * Delete a life event
3038
+ * Deletes a life event entry (hard delete). Returns 204.
3039
+ * @param data The data for the request.
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
3043
+ * @throws ApiError
3044
+ */
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> {
3075
+ return __request(OpenAPI, {
3076
+ method: 'GET',
3077
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3078
+ path: {
3079
+ id: data.id,
3080
+ region: data.region
3081
+ },
3082
+ query: {
3083
+ accountPattern: data.accountPattern,
3084
+ granularity: data.granularity
3085
+ },
3086
+ errors: {
3087
+ 400: 'accountPattern query param is empty',
3088
+ 404: 'Life event not found'
3089
+ }
3090
+ });
3091
+ }
3092
+ }
3093
+
3094
+ export class OnboardingService {
3095
+ /**
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.
3101
+ * @throws ApiError
3102
+ */
3103
+ public static onboardingControllerBootstrap(
3104
+ data: OnboardingControllerBootstrapData
3105
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
3106
+ return __request(OpenAPI, {
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
+ }
3117
+ });
3118
+ }
3119
+ }
3120
+
3121
+ export class BalanceReconciliationService {
3122
+ /**
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
3129
+ * @throws ApiError
3130
+ */
3131
+ public static reconciliationControllerCompute(
3132
+ data: ReconciliationControllerComputeData
3133
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
3134
+ return __request(OpenAPI, {
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',
3142
+ errors: {
3143
+ 404: 'Account not found'
3144
+ }
3145
+ });
3146
+ }
3147
+
3148
+ /**
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.
3151
+ * @param data The data for the request.
3152
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3153
+ * @param data.requestBody
3154
+ * @returns ReconciliationRecordDto Balance assertion recorded
3155
+ * @throws ApiError
3156
+ */
3157
+ public static reconciliationControllerAssert(
3158
+ data: ReconciliationControllerAssertData
3159
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
3160
+ return __request(OpenAPI, {
3161
+ method: 'POST',
3162
+ url: '/api/v1/{region}/bean/reconciliations/assert',
3163
+ path: {
3164
+ region: data.region
3165
+ },
3166
+ body: data.requestBody,
3167
+ mediaType: 'application/json',
3168
+ errors: {
3169
+ 404: 'Account not found'
3170
+ }
3171
+ });
3172
+ }
3173
+
3174
+ /**
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.
3177
+ * @param data The data for the request.
3178
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3179
+ * @param data.requestBody
3180
+ * @returns PadResultDto Pad adjusting entry generated
3181
+ * @throws ApiError
3182
+ */
3183
+ public static reconciliationControllerPad(
3184
+ data: ReconciliationControllerPadData
3185
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
3186
+ return __request(OpenAPI, {
3187
+ method: 'POST',
3188
+ url: '/api/v1/{region}/bean/reconciliations/pad',
3189
+ path: {
3190
+ region: data.region
3191
+ },
3192
+ body: data.requestBody,
3193
+ mediaType: 'application/json',
3194
+ errors: {
3195
+ 400: 'Book already within tolerance — no pad needed',
3196
+ 404: 'Account not found'
3197
+ }
3198
+ });
3199
+ }
3200
+
3201
+ /**
3202
+ * List reconciliation history for an account
3203
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
3204
+ * @param data The data for the request.
3205
+ * @param data.accountId BeanAccount id
3206
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3207
+ * @returns ReconciliationRecordDto Reconciliation history
3208
+ * @throws ApiError
3209
+ */
3210
+ public static reconciliationControllerHistory(
3211
+ data: ReconciliationControllerHistoryData
3212
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
3213
+ return __request(OpenAPI, {
3214
+ method: 'GET',
3215
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
3216
+ path: {
3217
+ accountId: data.accountId,
3218
+ region: data.region
3219
+ },
3220
+ errors: {
3221
+ 404: 'Account not found'
3222
+ }
3223
+ });
3224
+ }
3225
+ }
3226
+
3227
+ export class BeanExportService {
3228
+ /**
3229
+ * Export Beancount ledger as ZIP
3230
+ * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
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
3234
+ * @throws ApiError
3235
+ */
3236
+ public static exportControllerExportBeancount(
3237
+ data: ExportControllerExportBeancountData
3238
+ ): CancelablePromise<ExportControllerExportBeancountResponse> {
3239
+ return __request(OpenAPI, {
3240
+ method: 'GET',
3241
+ url: '/api/v1/{region}/bean/export/beancount',
3242
+ path: {
3243
+ region: data.region
3244
+ }
3245
+ });
3246
+ }
3247
+ }
3248
+
3249
+ export class BeanImportService {
3250
+ /**
3251
+ * Import a bill file
3252
+ * Upload and process a bill file (CSV, PDF, OFX, etc.). The system automatically identifies the file type, extracts transactions, validates them, and stores only validated transactions to the database. Maximum file size: 50MB. Only 1 import per user at a time (concurrent imports rejected with 429).
3253
+ * @param data The data for the request.
3254
+ * @param data.region Region code for tenant context
3255
+ * @param data.formData Bill file to import
3256
+ * @returns ImportResultDto File imported successfully
3257
+ * @throws ApiError
3258
+ */
3259
+ public static fileImportControllerImportFile(
3260
+ data: FileImportControllerImportFileData
3261
+ ): CancelablePromise<FileImportControllerImportFileResponse> {
3262
+ return __request(OpenAPI, {
3263
+ method: 'POST',
3264
+ url: '/api/v1/{region}/bean/import/file',
3265
+ path: {
3266
+ region: data.region
3267
+ },
3268
+ formData: data.formData,
3269
+ mediaType: 'multipart/form-data',
3270
+ errors: {
3271
+ 400: 'Bad request - file-format-unsupported or file-import-failed',
3272
+ 413: 'Payload too large - file exceeds 50MB limit',
3273
+ 429: 'Too many requests - user already has import in progress',
3274
+ 500: 'Internal server error - DATABASE_ERROR'
3275
+ }
3276
+ });
3277
+ }
3278
+
3279
+ /**
3280
+ * Identify file type
3281
+ * Upload a file to check if it can be processed by any registered importer. Does not perform actual import - useful for pre-validation. Uses user-specific importer configuration.
3282
+ * @param data The data for the request.
3283
+ * @param data.region Region code for tenant context
3284
+ * @param data.formData File to identify
3285
+ * @returns IdentifyResultDto File identification result
3286
+ * @throws ApiError
3287
+ */
3288
+ public static fileImportControllerIdentifyFile(
3289
+ data: FileImportControllerIdentifyFileData
3290
+ ): CancelablePromise<FileImportControllerIdentifyFileResponse> {
3291
+ return __request(OpenAPI, {
3292
+ method: 'POST',
3293
+ url: '/api/v1/{region}/bean/import/identify',
3294
+ path: {
3295
+ region: data.region
3296
+ },
3297
+ formData: data.formData,
3298
+ mediaType: 'multipart/form-data',
3299
+ errors: {
3300
+ 400: 'Bad request - No file uploaded'
3301
+ }
3302
+ });
3303
+ }
3304
+
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.
3308
+ * @param data The data for the request.
3309
+ * @param data.region Region code for tenant context
3310
+ * @param data.formData Beancount file to import
3311
+ * @returns unknown Beancount file imported successfully
3312
+ * @throws ApiError
3313
+ */
3314
+ public static fileImportControllerImportBeancount(
3315
+ data: FileImportControllerImportBeancountData
3316
+ ): CancelablePromise<FileImportControllerImportBeancountResponse> {
3317
+ return __request(OpenAPI, {
3318
+ method: 'POST',
3319
+ url: '/api/v1/{region}/bean/import/beancount',
3320
+ path: {
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'
3327
+ }
3328
+ });
3329
+ }
3330
+
3331
+ /**
3332
+ * Get importer configuration
3333
+ * Returns the current configuration for the specified importer. Creates default configuration if none exists.
3334
+ * @param data The data for the request.
3335
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3336
+ * @param data.region Region code for tenant context
3337
+ * @returns ImporterConfigDto Configuration retrieved successfully
3338
+ * @throws ApiError
3339
+ */
3340
+ public static importerConfigControllerGetConfig(
3341
+ data: ImporterConfigControllerGetConfigData
3342
+ ): CancelablePromise<ImporterConfigControllerGetConfigResponse> {
3343
+ return __request(OpenAPI, {
3344
+ method: 'GET',
3345
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
3346
+ path: {
3347
+ importerId: data.importerId,
3348
+ region: data.region
3349
+ },
3350
+ errors: {
3351
+ 400: 'Invalid input - Unsupported importer',
3352
+ 401: 'Unauthorized - Authentication required'
3353
+ }
3354
+ });
3355
+ }
3356
+
3357
+ /**
3358
+ * Update importer configuration
3359
+ * Updates the configuration for the specified importer. Partial updates are supported.
3360
+ * @param data The data for the request.
3361
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3362
+ * @param data.region Region code for tenant context
3363
+ * @param data.requestBody Partial configuration update. Only provided fields will be updated.
3364
+ * @returns ImporterConfigDto Configuration updated successfully
3365
+ * @throws ApiError
3366
+ */
3367
+ public static importerConfigControllerUpdateConfig(
3368
+ data: ImporterConfigControllerUpdateConfigData
3369
+ ): CancelablePromise<ImporterConfigControllerUpdateConfigResponse> {
3370
+ return __request(OpenAPI, {
3371
+ method: 'PUT',
3372
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
3373
+ path: {
3374
+ importerId: data.importerId,
3375
+ region: data.region
3376
+ },
3377
+ body: data.requestBody,
3378
+ mediaType: 'application/json',
3379
+ errors: {
3380
+ 400: 'Invalid input - Validation failed',
3381
+ 404: 'Configuration not found'
3382
+ }
3383
+ });
3384
+ }
3385
+
3386
+ /**
3387
+ * Reset configuration to default
3388
+ * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
3389
+ * @param data The data for the request.
3390
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3391
+ * @param data.region Region code for tenant context
3392
+ * @returns ImporterConfigDto Configuration reset successfully
3393
+ * @throws ApiError
3394
+ */
3395
+ public static importerConfigControllerResetConfig(
3396
+ data: ImporterConfigControllerResetConfigData
3397
+ ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
3398
+ return __request(OpenAPI, {
3399
+ method: 'POST',
3400
+ url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
3401
+ path: {
3402
+ importerId: data.importerId,
3403
+ region: data.region
3404
+ },
3405
+ errors: {
3406
+ 400: 'Invalid input - Unsupported importer'
3407
+ }
3408
+ });
3409
+ }
3410
+ }
3411
+
3412
+ export class ProviderSyncService {
3413
+ /**
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
+ *
3436
+ * @param data The data for the request.
3437
+ * @param data.providerName Provider name
3438
+ * @param data.region Region code for tenant context
3439
+ * @param data.requestBody
3440
+ * @returns ProviderSyncResponseDto Sync completed successfully
3441
+ * @throws ApiError
3442
+ */
3443
+ public static providerSyncControllerSync(
3444
+ data: ProviderSyncControllerSyncData
3445
+ ): CancelablePromise<ProviderSyncControllerSyncResponse> {
3446
+ return __request(OpenAPI, {
3447
+ method: 'POST',
3448
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3449
+ path: {
3450
+ providerName: data.providerName,
3451
+ region: data.region
3452
+ },
3453
+ body: data.requestBody,
3454
+ mediaType: 'application/json',
3455
+ errors: {
3456
+ 400: 'Invalid request data',
3457
+ 401: 'Missing or invalid authentication',
3458
+ 404: 'Provider not supported'
3459
+ }
3460
+ });
3461
+ }
3462
+
3463
+ /**
3464
+ * Get supported providers
3465
+ * Returns a list of all providers supported by the sync endpoint.
3466
+ * @param data The data for the request.
3467
+ * @param data.region Region code for tenant context
3468
+ * @returns SupportedProvidersResponseDto List of supported providers
3469
+ * @throws ApiError
3470
+ */
3471
+ public static providerSyncControllerGetSupportedProviders(
3472
+ data: ProviderSyncControllerGetSupportedProvidersData
3473
+ ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
3474
+ return __request(OpenAPI, {
3475
+ method: 'GET',
3476
+ url: '/api/v1/{region}/bean/import/provider/supported',
3477
+ path: {
3478
+ region: data.region
3479
+ },
3480
+ errors: {
3481
+ 401: 'Missing or invalid authentication'
3482
+ }
3483
+ });
3484
+ }
3485
+
3486
+ /**
3487
+ * Check if provider is supported
3488
+ * Returns whether a specific provider is supported.
3489
+ * @param data The data for the request.
3490
+ * @param data.providerName Provider name to check
3491
+ * @param data.region Region code for tenant context
3492
+ * @returns unknown Provider support status
3493
+ * @throws ApiError
3494
+ */
3495
+ public static providerSyncControllerIsProviderSupported(
3496
+ data: ProviderSyncControllerIsProviderSupportedData
3497
+ ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
3498
+ return __request(OpenAPI, {
3499
+ method: 'GET',
3500
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3501
+ path: {
3502
+ providerName: data.providerName,
3503
+ region: data.region
3504
+ },
3505
+ errors: {
3506
+ 401: 'Missing or invalid authentication'
3507
+ }
3508
+ });
3509
+ }
3510
+ }
3511
+
3512
+ export class ExternalAccountLinksService {
3513
+ /**
3514
+ * Create an external account → BeanAccount mapping (ADR-0113)
3515
+ * @param data The data for the request.
3516
+ * @param data.region Region code for tenant context
3517
+ * @param data.requestBody
3518
+ * @returns ExternalAccountLinkResponseDto Link created.
3519
+ * @throws ApiError
3520
+ */
3521
+ public static externalAccountLinkControllerCreate(
3522
+ data: ExternalAccountLinkControllerCreateData
3523
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
3524
+ return __request(OpenAPI, {
3525
+ method: 'POST',
3526
+ url: '/api/v1/{region}/bean/external-account-links',
3527
+ path: {
3528
+ region: data.region
3529
+ },
3530
+ body: data.requestBody,
3531
+ mediaType: 'application/json',
3532
+ errors: {
3533
+ 422: 'beanAccountId not owned, or an active link already exists.'
3534
+ }
3535
+ });
3536
+ }
3537
+
3538
+ /**
3539
+ * List the user's active external account links
3540
+ * @param data The data for the request.
3541
+ * @param data.provider
3542
+ * @param data.region Region code for tenant context
3543
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
3544
+ * @throws ApiError
3545
+ */
3546
+ public static externalAccountLinkControllerFindAll(
3547
+ data: ExternalAccountLinkControllerFindAllData
3548
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
3549
+ return __request(OpenAPI, {
3550
+ method: 'GET',
3551
+ url: '/api/v1/{region}/bean/external-account-links',
3552
+ path: {
3553
+ region: data.region
3554
+ },
3555
+ query: {
3556
+ provider: data.provider
3557
+ }
3558
+ });
3559
+ }
3560
+
3561
+ /**
3562
+ * Get a single external account link
3563
+ * @param data The data for the request.
3564
+ * @param data.id
3565
+ * @param data.region Region code for tenant context
3566
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
3567
+ * @throws ApiError
3568
+ */
3569
+ public static externalAccountLinkControllerFindOne(
3570
+ data: ExternalAccountLinkControllerFindOneData
3571
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
3572
+ return __request(OpenAPI, {
3573
+ method: 'GET',
3574
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3575
+ path: {
3576
+ id: data.id,
3577
+ region: data.region
3578
+ },
3579
+ errors: {
3580
+ 422: 'Link not found or not owned by the user.'
3581
+ }
3582
+ });
3583
+ }
3584
+
3585
+ /**
3586
+ * Soft-delete (disconnect) an external account link
3587
+ * @param data The data for the request.
3588
+ * @param data.id
3589
+ * @param data.region Region code for tenant context
3590
+ * @returns void Link soft-deleted; historical transactions are unaffected.
3591
+ * @throws ApiError
3592
+ */
3593
+ public static externalAccountLinkControllerRemove(
3594
+ data: ExternalAccountLinkControllerRemoveData
3595
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
3596
+ return __request(OpenAPI, {
3597
+ method: 'DELETE',
3598
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3599
+ path: {
3600
+ id: data.id,
3601
+ region: data.region
3602
+ }
3603
+ });
3604
+ }
3605
+ }
3606
+
3607
+ export class ImportTelemetryService {
3608
+ /**
3609
+ * Receive anonymous parser failure telemetry
3610
+ * @param data The data for the request.
3611
+ * @param data.region Region code for tenant context
3612
+ * @param data.requestBody
3613
+ * @returns unknown Telemetry report received
3614
+ * @throws ApiError
3615
+ */
3616
+ public static telemetryControllerReportTelemetry(
3617
+ data: TelemetryControllerReportTelemetryData
3618
+ ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
3619
+ return __request(OpenAPI, {
3620
+ method: 'POST',
3621
+ url: '/api/v1/{region}/bean/import/parser-telemetry',
3622
+ path: {
3623
+ region: data.region
3624
+ },
3625
+ body: data.requestBody,
3626
+ mediaType: 'application/json',
3627
+ errors: {
3628
+ 401: 'Unauthorized'
3629
+ }
3630
+ });
3631
+ }
3632
+
3633
+ /**
3634
+ * Receive anonymous zero-hit coverage miss report
3635
+ * @param data The data for the request.
3636
+ * @param data.region Region code for tenant context
3637
+ * @param data.requestBody
3638
+ * @returns unknown Coverage miss report received
3639
+ * @throws ApiError
3640
+ */
3641
+ public static telemetryControllerReportCoverageMiss(
3642
+ data: TelemetryControllerReportCoverageMissData
3643
+ ): CancelablePromise<TelemetryControllerReportCoverageMissResponse> {
3644
+ return __request(OpenAPI, {
3645
+ method: 'POST',
3646
+ url: '/api/v1/{region}/bean/import/parser-coverage-miss',
3647
+ path: {
3648
+ region: data.region
3649
+ },
3650
+ body: data.requestBody,
3651
+ mediaType: 'application/json',
3652
+ errors: {
3653
+ 401: 'Unauthorized'
3654
+ }
3655
+ });
3656
+ }
3657
+
3658
+ /**
3659
+ * Coverage metrics (uncovered format aggregation)
3660
+ * @param data The data for the request.
3661
+ * @param data.region Region code for tenant context
3662
+ * @param data.topN Top-N uncovered formats (default 10)
3663
+ * @returns unknown Coverage metrics
3664
+ * @throws ApiError
3665
+ */
3666
+ public static telemetryControllerGetCoverageMetrics(
3667
+ data: TelemetryControllerGetCoverageMetricsData
3668
+ ): CancelablePromise<TelemetryControllerGetCoverageMetricsResponse> {
3669
+ return __request(OpenAPI, {
3670
+ method: 'GET',
3671
+ url: '/api/v1/{region}/bean/import/parser-coverage-metrics',
3672
+ path: {
3673
+ region: data.region
3674
+ },
3675
+ query: {
3676
+ topN: data.topN
3677
+ }
3678
+ });
3679
+ }
3680
+ }
3681
+
3682
+ export class BeanNlpService {
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"
3686
+ * @param data The data for the request.
3687
+ * @param data.region Region code for tenant context
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
3690
+ * @throws ApiError
3691
+ */
3692
+ public static nlpControllerProcessNaturalLanguage(
3693
+ data: NlpControllerProcessNaturalLanguageData
3694
+ ): CancelablePromise<NlpControllerProcessNaturalLanguageResponse> {
3695
+ return __request(OpenAPI, {
3696
+ method: 'POST',
3697
+ url: '/api/v1/{region}/bean/nlp/process',
3698
+ path: {
3699
+ region: data.region
3700
+ },
3701
+ body: data.requestBody,
3702
+ mediaType: 'application/json',
3703
+ errors: {
3704
+ 400: 'Invalid input',
3705
+ 401: 'Unauthorized'
3706
+ }
3707
+ });
3708
+ }
3709
+
3710
+ /**
3711
+ * Clear dialogue session
3712
+ * Clear the current NLP dialogue session. Use this to cancel an ongoing multi-turn dialogue.
3713
+ * @param data The data for the request.
3714
+ * @param data.region Region code for tenant context
3715
+ * @param data.sessionId Specific session ID to clear (defaults to user session)
3716
+ * @returns void Session cleared successfully
3717
+ * @throws ApiError
3718
+ */
3719
+ public static nlpControllerClearSession(
3720
+ data: NlpControllerClearSessionData
3721
+ ): CancelablePromise<NlpControllerClearSessionResponse> {
3722
+ return __request(OpenAPI, {
3723
+ method: 'DELETE',
3724
+ url: '/api/v1/{region}/bean/nlp/session',
3725
+ path: {
3726
+ region: data.region
3727
+ },
3728
+ query: {
3729
+ sessionId: data.sessionId
3730
+ },
3731
+ errors: {
3732
+ 401: 'Unauthorized'
3733
+ }
3734
+ });
3735
+ }
3736
+
3737
+ /**
3738
+ * Get current session state
3739
+ * Get the current NLP dialogue session state. Useful for debugging and displaying session context in UI.
3740
+ * @param data The data for the request.
3741
+ * @param data.region Region code for tenant context
3742
+ * @param data.sessionId Specific session ID to get (defaults to user session)
3743
+ * @returns unknown Current session state (or null if no active session)
3744
+ * @throws ApiError
3745
+ */
3746
+ public static nlpControllerGetSession(
3747
+ data: NlpControllerGetSessionData
3748
+ ): CancelablePromise<NlpControllerGetSessionResponse> {
3749
+ return __request(OpenAPI, {
3750
+ method: 'GET',
3751
+ url: '/api/v1/{region}/bean/nlp/session',
3752
+ path: {
3753
+ region: data.region
3754
+ },
3755
+ query: {
3756
+ sessionId: data.sessionId
3757
+ },
3758
+ errors: {
3759
+ 401: 'Unauthorized'
3760
+ }
3761
+ });
3762
+ }
3763
+ }
3764
+
3765
+ export class BeanPlatformsService {
3766
+ /**
3767
+ * Get all platforms with statistics
3768
+ * @returns unknown List of platforms with binding and account counts
3769
+ * @throws ApiError
3770
+ */
3771
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
3772
+ return __request(OpenAPI, {
3773
+ method: 'GET',
3774
+ url: '/api/v1/bean/platforms'
3775
+ });
3776
+ }
3777
+
3778
+ /**
3779
+ * Create a new platform
3780
+ * @param data The data for the request.
3781
+ * @param data.requestBody
3782
+ * @returns unknown Platform created successfully
3783
+ * @throws ApiError
3784
+ */
3785
+ public static platformControllerCreate(
3786
+ data: PlatformControllerCreateData
3787
+ ): CancelablePromise<PlatformControllerCreateResponse> {
3788
+ return __request(OpenAPI, {
3789
+ method: 'POST',
3790
+ url: '/api/v1/bean/platforms',
3791
+ body: data.requestBody,
3792
+ mediaType: 'application/json',
3793
+ errors: {
3794
+ 409: 'Platform already exists'
3795
+ }
3796
+ });
3797
+ }
3798
+
3799
+ /**
3800
+ * Get platform list for current user
3801
+ * @param data The data for the request.
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
3804
+ * @throws ApiError
3805
+ */
3806
+ public static platformControllerGetPlatformList(
3807
+ data: PlatformControllerGetPlatformListData = {}
3808
+ ): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3809
+ return __request(OpenAPI, {
3810
+ method: 'GET',
3811
+ url: '/api/v1/bean/platforms/list',
3812
+ query: {
3813
+ region: data.region
3814
+ }
3815
+ });
3816
+ }
3817
+
3818
+ /**
3819
+ * Match platforms by name or alias
3820
+ * @param data The data for the request.
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
3824
+ * @throws ApiError
3825
+ */
3826
+ public static platformControllerMatchPlatforms(
3827
+ data: PlatformControllerMatchPlatformsData
3828
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3829
+ return __request(OpenAPI, {
3830
+ method: 'GET',
3831
+ url: '/api/v1/bean/platforms/match',
3832
+ query: {
3833
+ q: data.q,
3834
+ region: data.region
3835
+ }
3836
+ });
3837
+ }
3838
+
3839
+ /**
3840
+ * Get the region and candidate account standards for a platform
3841
+ * @param data The data for the request.
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)
3846
+ * @throws ApiError
3847
+ */
3848
+ public static platformControllerGetPlatformStandards(
3849
+ data: PlatformControllerGetPlatformStandardsData
3850
+ ): CancelablePromise<PlatformControllerGetPlatformStandardsResponse> {
3851
+ return __request(OpenAPI, {
3852
+ method: 'GET',
3853
+ url: '/api/v1/bean/platforms/{id}/standards',
3854
+ path: {
3855
+ id: data.id
3856
+ },
3857
+ query: {
3858
+ region: data.region,
3859
+ type: data.type
3860
+ }
3861
+ });
3862
+ }
3863
+
3864
+ /**
3865
+ * Update a platform
3866
+ * @param data The data for the request.
3867
+ * @param data.id Platform ID
3868
+ * @param data.requestBody
3869
+ * @returns unknown Platform updated successfully
3870
+ * @throws ApiError
3871
+ */
3872
+ public static platformControllerUpdate(
3873
+ data: PlatformControllerUpdateData
3874
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3875
+ return __request(OpenAPI, {
3876
+ method: 'PUT',
3877
+ url: '/api/v1/bean/platforms/{id}',
3878
+ path: {
3879
+ id: data.id
3880
+ },
3881
+ body: data.requestBody,
3882
+ mediaType: 'application/json',
3883
+ errors: {
3884
+ 404: 'Platform not found'
3885
+ }
3886
+ });
3887
+ }
3888
+
3889
+ /**
3890
+ * Delete a platform
3891
+ * @param data The data for the request.
3892
+ * @param data.id Platform ID
3893
+ * @returns void Platform deleted successfully
3894
+ * @throws ApiError
3895
+ */
3896
+ public static platformControllerDelete(
3897
+ data: PlatformControllerDeleteData
3898
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3899
+ return __request(OpenAPI, {
3900
+ method: 'DELETE',
3901
+ url: '/api/v1/bean/platforms/{id}',
3902
+ path: {
3903
+ id: data.id
3904
+ },
3905
+ errors: {
3906
+ 404: 'Platform not found'
3907
+ }
3908
+ });
3909
+ }
3910
+ }
3911
+
3912
+ export class DashboardService {
3913
+ /**
3914
+ * Get net worth overview
3915
+ * Returns total net worth with breakdown of assets and liabilities
3916
+ * @param data The data for the request.
3917
+ * @param data.region Region code for tenant context
3918
+ * @param data.date Date for balance calculation (ISO 8601 format)
3919
+ * @returns NetWorthResponseDto Net worth retrieved successfully
3920
+ * @throws ApiError
3921
+ */
3922
+ public static dashboardControllerGetNetWorth(
3923
+ data: DashboardControllerGetNetWorthData
3924
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3925
+ return __request(OpenAPI, {
3926
+ method: 'GET',
3927
+ url: '/api/v1/{region}/dashboard/net-worth',
3928
+ path: {
3929
+ region: data.region
3930
+ },
3931
+ query: {
3932
+ date: data.date
3933
+ },
3934
+ errors: {
3935
+ 401: 'User not authenticated'
3936
+ }
3937
+ });
3938
+ }
3939
+
3940
+ /**
3941
+ * Get accounts grouped by platform
3942
+ * Returns accounts with balances grouped by financial platform
3943
+ * @param data The data for the request.
3944
+ * @param data.region Region code for tenant context
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.
3949
+ * @throws ApiError
3950
+ */
3951
+ public static dashboardControllerGetAccounts(
3952
+ data: DashboardControllerGetAccountsData
3953
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3954
+ return __request(OpenAPI, {
3955
+ method: 'GET',
3956
+ url: '/api/v1/{region}/dashboard/accounts',
3957
+ path: {
3958
+ region: data.region
3959
+ },
3960
+ query: {
3961
+ groupBy: data.groupBy,
3962
+ date: data.date,
3963
+ accountId: data.accountId
3964
+ },
3965
+ errors: {
3966
+ 401: 'User not authenticated'
3967
+ }
3968
+ });
3969
+ }
3970
+
3971
+ /**
3972
+ * Get cash flow summary
3973
+ * Returns income, expenses, and savings for a monthly period
3974
+ * @param data The data for the request.
3975
+ * @param data.period Period in YYYY-MM format
3976
+ * @param data.region Region code for tenant context
3977
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3978
+ * @throws ApiError
3979
+ */
3980
+ public static dashboardControllerGetCashFlow(
3981
+ data: DashboardControllerGetCashFlowData
3982
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3983
+ return __request(OpenAPI, {
3984
+ method: 'GET',
3985
+ url: '/api/v1/{region}/dashboard/cash-flow',
3986
+ path: {
3987
+ region: data.region
3988
+ },
3989
+ query: {
3990
+ period: data.period
3991
+ },
3992
+ errors: {
3993
+ 400: 'Invalid period format',
3994
+ 401: 'User not authenticated'
3995
+ }
3996
+ });
3997
+ }
3998
+
3999
+ /**
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)
4002
+ * @param data The data for the request.
4003
+ * @param data.region Region code for tenant context
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
4008
+ * @throws ApiError
4009
+ */
4010
+ public static dashboardControllerGetExpenses(
4011
+ data: DashboardControllerGetExpensesData
4012
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
4013
+ return __request(OpenAPI, {
4014
+ method: 'GET',
4015
+ url: '/api/v1/{region}/dashboard/expenses',
4016
+ path: {
4017
+ region: data.region
4018
+ },
4019
+ query: {
4020
+ groupBy: data.groupBy,
4021
+ period: data.period,
4022
+ flow: data.flow
4023
+ },
4024
+ errors: {
4025
+ 400: 'Invalid groupBy or period',
4026
+ 401: 'User not authenticated'
4027
+ }
4028
+ });
4029
+ }
4030
+
4031
+ /**
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
4034
+ * @param data The data for the request.
4035
+ * @param data.region Region code for tenant context
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
4038
+ * @throws ApiError
4039
+ */
4040
+ public static dashboardControllerGetAdvisorContext(
4041
+ data: DashboardControllerGetAdvisorContextData
4042
+ ): CancelablePromise<DashboardControllerGetAdvisorContextResponse> {
4043
+ return __request(OpenAPI, {
4044
+ method: 'GET',
4045
+ url: '/api/v1/{region}/dashboard/advisor-context',
4046
+ path: {
4047
+ region: data.region
4048
+ },
4049
+ query: {
4050
+ date: data.date
4051
+ },
4052
+ errors: {
4053
+ 400: 'Invalid date format',
4054
+ 401: 'User not authenticated, or the token is not advisor-scoped (exchange via POST /auth/sessions/advisor, #1512)'
4055
+ }
4056
+ });
4057
+ }
4058
+ }
4059
+
4060
+ export class InvestmentService {
4061
+ /**
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).
4064
+ * @param data The data for the request.
4065
+ * @param data.region Region code for tenant context
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
4070
+ * @throws ApiError
4071
+ */
4072
+ public static holdingPnlControllerGetHoldingPnl(
4073
+ data: HoldingPnlControllerGetHoldingPnlData
4074
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
4075
+ return __request(OpenAPI, {
4076
+ method: 'GET',
4077
+ url: '/api/v1/{region}/investment/holdings/pnl',
4078
+ path: {
4079
+ region: data.region
4080
+ },
4081
+ query: {
4082
+ asOf: data.asOf,
4083
+ accountId: data.accountId,
4084
+ method: data.method
4085
+ },
4086
+ errors: {
4087
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
4088
+ 401: 'User not authenticated'
4089
+ }
4090
+ });
4091
+ }
4092
+ }
4093
+
4094
+ export class ApiKeysService {
4095
+ /**
4096
+ * Create API key
4097
+ * Generates a new API key for the authenticated user
4098
+ * @returns unknown API key created successfully
4099
+ * @throws ApiError
4100
+ */
4101
+ public static apiKeysControllerCreateApiKey(): CancelablePromise<ApiKeysControllerCreateApiKeyResponse> {
4102
+ return __request(OpenAPI, {
4103
+ method: 'POST',
4104
+ url: '/api/v1/auth/api-keys',
4105
+ errors: {
4106
+ 403: 'Insufficient permissions to create API key'
4107
+ }
4108
+ });
4109
+ }
4110
+ }
4111
+
4112
+ export class AuthService {
4113
+ /**
4114
+ * Anonymous login with access token
4115
+ * @param data The data for the request.
4116
+ * @param data.requestBody
4117
+ * @returns AnonymousLoginResponseDto Login successful
4118
+ * @throws ApiError
4119
+ */
4120
+ public static authControllerAccessTokenLogin(
4121
+ data: AuthControllerAccessTokenLoginData
4122
+ ): CancelablePromise<AuthControllerAccessTokenLoginResponse> {
4123
+ return __request(OpenAPI, {
4124
+ method: 'POST',
4125
+ url: '/api/v1/auth/sessions/anonymous',
4126
+ body: data.requestBody,
4127
+ mediaType: 'application/json',
4128
+ errors: {
4129
+ 401: 'Invalid access token'
4130
+ }
4131
+ });
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
+ }
4186
+ }
4187
+
4188
+ export class AdminCacheService {
4189
+ /**
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
4193
+ * @throws ApiError
4194
+ */
4195
+ public static cacheControllerFlushCache(): CancelablePromise<CacheControllerFlushCacheResponse> {
4196
+ return __request(OpenAPI, {
4197
+ method: 'POST',
4198
+ url: '/api/v1/cache/flush',
4199
+ errors: {
4200
+ 403: 'Admin access required'
4201
+ }
4202
+ });
4203
+ }
4204
+ }
4205
+
4206
+ export class ExchangeRateService {
4207
+ /**
4208
+ * Get exchange rate for currency pair
4209
+ * Retrieves historical exchange rate for a specific date and currency pair
4210
+ * @param data The data for the request.
4211
+ * @param data.symbol Currency pair symbol (e.g., USDCNY, EURUSD)
4212
+ * @param data.dateString Date in ISO format (YYYY-MM-DD)
4213
+ * @returns unknown Exchange rate retrieved successfully
4214
+ * @throws ApiError
4215
+ */
4216
+ public static exchangeRateControllerGetExchangeRate(
4217
+ data: ExchangeRateControllerGetExchangeRateData
4218
+ ): CancelablePromise<ExchangeRateControllerGetExchangeRateResponse> {
4219
+ return __request(OpenAPI, {
4220
+ method: 'GET',
4221
+ url: '/api/v1/market/exchange-rates/{symbol}/{dateString}',
4222
+ path: {
4223
+ symbol: data.symbol,
4224
+ dateString: data.dateString
4225
+ },
4226
+ errors: {
4227
+ 404: 'Exchange rate not found for the specified currency pair and date'
4228
+ }
4229
+ });
4230
+ }
4231
+ }
4232
+
4233
+ export class HealthService {
4234
+ /**
4235
+ * Basic health check for K8s/load balancer probes
4236
+ * @returns unknown Service is healthy
4237
+ * @throws ApiError
4238
+ */
4239
+ public static healthControllerGetHealth(): CancelablePromise<HealthControllerGetHealthResponse> {
4240
+ return __request(OpenAPI, {
4241
+ method: 'GET',
4242
+ url: '/api/v1/health',
4243
+ errors: {
4244
+ 503: 'Service unavailable'
4245
+ }
4246
+ });
4247
+ }
4248
+
4249
+ /**
4250
+ * Check database connection health
4251
+ * @returns unknown Database is healthy
4252
+ * @throws ApiError
4253
+ */
4254
+ public static healthControllerCheckDatabase(): CancelablePromise<HealthControllerCheckDatabaseResponse> {
4255
+ return __request(OpenAPI, {
4256
+ method: 'GET',
4257
+ url: '/api/v1/health/database',
4258
+ errors: {
4259
+ 503: 'Database unavailable'
4260
+ }
4261
+ });
4262
+ }
4263
+
4264
+ /**
4265
+ * Check OpenBB schema status
4266
+ * @returns unknown OpenBB status
4267
+ * @throws ApiError
4268
+ */
4269
+ public static healthControllerCheckOpenBb(): CancelablePromise<HealthControllerCheckOpenBbResponse> {
4270
+ return __request(OpenAPI, {
4271
+ method: 'GET',
4272
+ url: '/api/v1/health/openbb',
4273
+ errors: {
4274
+ 503: 'OpenBB unavailable'
4275
+ }
4276
+ });
4277
+ }
4278
+
4279
+ /**
4280
+ * Check Redis connection health
4281
+ * @returns unknown Redis is healthy
4282
+ * @throws ApiError
4283
+ */
4284
+ public static healthControllerCheckRedis(): CancelablePromise<HealthControllerCheckRedisResponse> {
4285
+ return __request(OpenAPI, {
4286
+ method: 'GET',
4287
+ url: '/api/v1/health/redis',
4288
+ errors: {
4289
+ 503: 'Redis unavailable'
4290
+ }
4291
+ });
4292
+ }
4293
+
4294
+ /**
4295
+ * Get status of all circuit breakers
4296
+ * @returns unknown Circuit breaker status
4297
+ * @throws ApiError
4298
+ */
4299
+ public static healthControllerGetCircuitBreakersHealth(): CancelablePromise<HealthControllerGetCircuitBreakersHealthResponse> {
4300
+ return __request(OpenAPI, {
4301
+ method: 'GET',
4302
+ url: '/api/v1/health/circuit-breakers',
4303
+ errors: {
4304
+ 401: 'Unauthorized',
4305
+ 500: 'Internal error'
4306
+ }
4307
+ });
4308
+ }
4309
+
4310
+ /**
4311
+ * Reset a circuit breaker to CLOSED state
4312
+ * @param data The data for the request.
4313
+ * @param data.name Circuit breaker name to reset
4314
+ * @returns unknown Circuit breaker reset successfully
4315
+ * @throws ApiError
4316
+ */
4317
+ public static healthControllerResetCircuitBreaker(
4318
+ data: HealthControllerResetCircuitBreakerData
4319
+ ): CancelablePromise<HealthControllerResetCircuitBreakerResponse> {
4320
+ return __request(OpenAPI, {
4321
+ method: 'POST',
4322
+ url: '/api/v1/health/circuit-breakers/{name}/reset',
4323
+ path: {
4324
+ name: data.name
4325
+ },
4326
+ errors: {
4327
+ 401: 'Unauthorized',
4328
+ 404: 'Circuit breaker not found'
4329
+ }
4330
+ });
4331
+ }
4332
+
4333
+ /**
4334
+ * Get health check metrics and statistics
4335
+ * @returns unknown Health metrics
4336
+ * @throws ApiError
4337
+ */
4338
+ public static healthControllerGetMetrics(): CancelablePromise<HealthControllerGetMetricsResponse> {
4339
+ return __request(OpenAPI, {
4340
+ method: 'GET',
4341
+ url: '/api/v1/health/metrics',
4342
+ errors: {
4343
+ 401: 'Unauthorized'
4344
+ }
4345
+ });
4346
+ }
4347
+ }
4348
+
4349
+ export class InfoService {
4350
+ /**
4351
+ * Get system information
4352
+ * @returns unknown System information retrieved successfully
4353
+ * @throws ApiError
4354
+ */
4355
+ public static infoControllerGetInfo(): CancelablePromise<InfoControllerGetInfoResponse> {
4356
+ return __request(OpenAPI, {
4357
+ method: 'GET',
4358
+ url: '/api/v1/system/info'
4359
+ });
4360
+ }
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
+ }