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

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 +7585 -0
  2. package/dist/index.d.ts +7585 -2
  3. package/dist/index.js +1268 -3
  4. package/dist/index.mjs +1235 -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 +6416 -0
  14. package/src/generated/services.gen.ts +3364 -0
  15. package/src/generated/types.gen.ts +7982 -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,3364 @@
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
+ AccountStandardsControllerGetTemplatesData,
21
+ AccountStandardsControllerGetTemplatesResponse,
22
+ AccountStandardsControllerGetTemplateMetadataData,
23
+ AccountStandardsControllerGetTemplateMetadataResponse,
24
+ AccountStandardsControllerGetRegionsData,
25
+ AccountStandardsControllerGetRegionsResponse,
26
+ TransactionControllerCreateData,
27
+ TransactionControllerCreateResponse,
28
+ TransactionControllerListData,
29
+ TransactionControllerListResponse,
30
+ TransactionControllerCreateBatchData,
31
+ TransactionControllerCreateBatchResponse,
32
+ TransactionControllerCorrectData,
33
+ TransactionControllerCorrectResponse,
34
+ TransactionControllerSuggestTagsData,
35
+ TransactionControllerSuggestTagsResponse,
36
+ TransactionControllerGetDetailData,
37
+ TransactionControllerGetDetailResponse,
38
+ TransactionControllerUpdateData,
39
+ TransactionControllerUpdateResponse,
40
+ TransactionControllerDeleteData,
41
+ TransactionControllerDeleteResponse,
42
+ BalanceControllerGetBalanceData,
43
+ BalanceControllerGetBalanceResponse,
44
+ BalanceControllerGetMultiCurrencyBalanceData,
45
+ BalanceControllerGetMultiCurrencyBalanceResponse,
46
+ ReviewControllerFindAllData,
47
+ ReviewControllerFindAllResponse,
48
+ ReviewControllerGetStatsData,
49
+ ReviewControllerGetStatsResponse,
50
+ ReviewControllerFindOneData,
51
+ ReviewControllerFindOneResponse,
52
+ ReviewControllerResolveData,
53
+ ReviewControllerResolveResponse,
54
+ ReviewControllerUndoData,
55
+ ReviewControllerUndoResponse,
56
+ ReviewControllerBatchResolveData,
57
+ ReviewControllerBatchResolveResponse,
58
+ PayeeControllerCreateData,
59
+ PayeeControllerCreateResponse,
60
+ PayeeControllerFindAllData,
61
+ PayeeControllerFindAllResponse,
62
+ PayeeControllerAutocompleteData,
63
+ PayeeControllerAutocompleteResponse,
64
+ PayeeControllerGetTopPayeesData,
65
+ PayeeControllerGetTopPayeesResponse,
66
+ PayeeControllerFindOneData,
67
+ PayeeControllerFindOneResponse,
68
+ PayeeControllerUpdateData,
69
+ PayeeControllerUpdateResponse,
70
+ PayeeControllerDeleteData,
71
+ PayeeControllerDeleteResponse,
72
+ PayeeProfileAdminControllerCreateData,
73
+ PayeeProfileAdminControllerCreateResponse,
74
+ PayeeProfileAdminControllerFindAllData,
75
+ PayeeProfileAdminControllerFindAllResponse,
76
+ PayeeProfileAdminControllerFindOneData,
77
+ PayeeProfileAdminControllerFindOneResponse,
78
+ PayeeProfileAdminControllerUpdateData,
79
+ PayeeProfileAdminControllerUpdateResponse,
80
+ PayeeProfileAdminControllerDeleteData,
81
+ PayeeProfileAdminControllerDeleteResponse,
82
+ PayeeProfileAdminControllerVerifyData,
83
+ PayeeProfileAdminControllerVerifyResponse,
84
+ PayeeProfileAdminControllerUnverifyData,
85
+ PayeeProfileAdminControllerUnverifyResponse,
86
+ CommodityControllerCreateData,
87
+ CommodityControllerCreateResponse,
88
+ CommodityControllerFindAllData,
89
+ CommodityControllerFindAllResponse,
90
+ CommodityControllerFindOneData,
91
+ CommodityControllerFindOneResponse,
92
+ CommodityControllerUpdateData,
93
+ CommodityControllerUpdateResponse,
94
+ CommodityControllerDeleteData,
95
+ CommodityControllerDeleteResponse,
96
+ CommodityControllerGetOrCreateData,
97
+ CommodityControllerGetOrCreateResponse,
98
+ CommodityControllerBulkCreateData,
99
+ CommodityControllerBulkCreateResponse,
100
+ RecurringRuleControllerCreateData,
101
+ RecurringRuleControllerCreateResponse,
102
+ RecurringRuleControllerFindAllData,
103
+ RecurringRuleControllerFindAllResponse,
104
+ RecurringRuleControllerCreateFromTransactionData,
105
+ RecurringRuleControllerCreateFromTransactionResponse,
106
+ RecurringRuleControllerFindOneData,
107
+ RecurringRuleControllerFindOneResponse,
108
+ RecurringRuleControllerUpdateData,
109
+ RecurringRuleControllerUpdateResponse,
110
+ RecurringRuleControllerDeleteData,
111
+ RecurringRuleControllerDeleteResponse,
112
+ RecurringRuleControllerGetWithStatsData,
113
+ RecurringRuleControllerGetWithStatsResponse,
114
+ ExpectedTransactionControllerFindAllData,
115
+ ExpectedTransactionControllerFindAllResponse,
116
+ ExpectedTransactionControllerFindOverdueData,
117
+ ExpectedTransactionControllerFindOverdueResponse,
118
+ ExpectedTransactionControllerFindOneData,
119
+ ExpectedTransactionControllerFindOneResponse,
120
+ ExpectedTransactionControllerSkipData,
121
+ ExpectedTransactionControllerSkipResponse,
122
+ ExpectedTransactionControllerUndoSkipData,
123
+ ExpectedTransactionControllerUndoSkipResponse,
124
+ ExpectedTransactionControllerConfirmMatchData,
125
+ ExpectedTransactionControllerConfirmMatchResponse,
126
+ ExpectedTransactionControllerUnmatchData,
127
+ ExpectedTransactionControllerUnmatchResponse,
128
+ ExpectedTransactionControllerEnterNowData,
129
+ ExpectedTransactionControllerEnterNowResponse,
130
+ ForecastControllerGetForecastData,
131
+ ForecastControllerGetForecastResponse,
132
+ TransactionRuleControllerCreateData,
133
+ TransactionRuleControllerCreateResponse,
134
+ TransactionRuleControllerListData,
135
+ TransactionRuleControllerListResponse,
136
+ TransactionRuleControllerValidateData,
137
+ TransactionRuleControllerValidateResponse,
138
+ TransactionRuleControllerBulkCreateData,
139
+ TransactionRuleControllerBulkCreateResponse,
140
+ TransactionRuleControllerExportData,
141
+ TransactionRuleControllerExportResponse,
142
+ TransactionRuleControllerGetStatisticsData,
143
+ TransactionRuleControllerGetStatisticsResponse,
144
+ TransactionRuleControllerGetDetailData,
145
+ TransactionRuleControllerGetDetailResponse,
146
+ TransactionRuleControllerUpdateData,
147
+ TransactionRuleControllerUpdateResponse,
148
+ TransactionRuleControllerDeleteData,
149
+ TransactionRuleControllerDeleteResponse,
150
+ TransactionRuleControllerTestData,
151
+ TransactionRuleControllerTestResponse,
152
+ UserControllerDeleteOwnUserData,
153
+ UserControllerDeleteOwnUserResponse,
154
+ UserControllerGetUserData,
155
+ UserControllerGetUserResponse,
156
+ UserControllerSignupUserData,
157
+ UserControllerSignupUserResponse,
158
+ UserControllerDeleteUserData,
159
+ UserControllerDeleteUserResponse,
160
+ UserControllerGetUserInfoData,
161
+ UserControllerGetUserInfoResponse,
162
+ UserControllerUpdateUserSettingData,
163
+ UserControllerUpdateUserSettingResponse,
164
+ UserControllerGetAllUserSettingsByPageData,
165
+ UserControllerGetAllUserSettingsByPageResponse,
166
+ UserControllerGetAssetLiabilitySummaryResponse,
167
+ PropertyControllerGetAllResponse,
168
+ PropertyControllerGetByKeyData,
169
+ PropertyControllerGetByKeyResponse,
170
+ PropertyControllerUpdateData,
171
+ PropertyControllerUpdateResponse,
172
+ PropertyControllerDeleteData,
173
+ PropertyControllerDeleteResponse,
174
+ ExportControllerExportBeancountResponse,
175
+ FileImportControllerImportFileData,
176
+ FileImportControllerImportFileResponse,
177
+ FileImportControllerIdentifyFileData,
178
+ FileImportControllerIdentifyFileResponse,
179
+ FileImportControllerImportBeancountData,
180
+ FileImportControllerImportBeancountResponse,
181
+ ImporterConfigControllerGetConfigData,
182
+ ImporterConfigControllerGetConfigResponse,
183
+ ImporterConfigControllerUpdateConfigData,
184
+ ImporterConfigControllerUpdateConfigResponse,
185
+ ImporterConfigControllerResetConfigData,
186
+ ImporterConfigControllerResetConfigResponse,
187
+ PlatformControllerFindAllResponse,
188
+ PlatformControllerCreateData,
189
+ PlatformControllerCreateResponse,
190
+ PlatformControllerGetPlatformListResponse,
191
+ PlatformControllerMatchPlatformsData,
192
+ PlatformControllerMatchPlatformsResponse,
193
+ PlatformControllerUpdateData,
194
+ PlatformControllerUpdateResponse,
195
+ PlatformControllerDeleteData,
196
+ PlatformControllerDeleteResponse,
197
+ ProviderSyncControllerSyncData,
198
+ ProviderSyncControllerSyncResponse,
199
+ ProviderSyncControllerGetSupportedProvidersData,
200
+ ProviderSyncControllerGetSupportedProvidersResponse,
201
+ ProviderSyncControllerIsProviderSupportedData,
202
+ ProviderSyncControllerIsProviderSupportedResponse,
203
+ TelemetryControllerReportTelemetryData,
204
+ TelemetryControllerReportTelemetryResponse,
205
+ NlpControllerProcessNaturalLanguageData,
206
+ NlpControllerProcessNaturalLanguageResponse,
207
+ NlpControllerClearSessionData,
208
+ NlpControllerClearSessionResponse,
209
+ NlpControllerGetSessionData,
210
+ NlpControllerGetSessionResponse,
211
+ DashboardControllerGetNetWorthData,
212
+ DashboardControllerGetNetWorthResponse,
213
+ DashboardControllerGetAccountsData,
214
+ DashboardControllerGetAccountsResponse,
215
+ DashboardControllerGetCashFlowData,
216
+ DashboardControllerGetCashFlowResponse,
217
+ ReportingControllerGetPortfolioTrendsData,
218
+ ReportingControllerGetPortfolioTrendsResponse,
219
+ ReportingControllerGenerateSnapshotData,
220
+ ReportingControllerGenerateSnapshotResponse,
221
+ ReportingControllerBackfillSnapshotsData,
222
+ ReportingControllerBackfillSnapshotsResponse,
223
+ ApiKeysControllerCreateApiKeyResponse,
224
+ AuthControllerAccessTokenLoginData,
225
+ AuthControllerAccessTokenLoginResponse,
226
+ CacheControllerFlushCacheResponse,
227
+ ExchangeRateControllerGetExchangeRateData,
228
+ ExchangeRateControllerGetExchangeRateResponse,
229
+ HealthControllerGetHealthResponse,
230
+ HealthControllerCheckDatabaseResponse,
231
+ HealthControllerCheckOpenBbResponse,
232
+ HealthControllerCheckRedisResponse,
233
+ HealthControllerGetCircuitBreakersHealthResponse,
234
+ HealthControllerResetCircuitBreakerData,
235
+ HealthControllerResetCircuitBreakerResponse,
236
+ HealthControllerGetMetricsResponse,
237
+ InfoControllerGetInfoResponse
238
+ } from './types.gen';
239
+
240
+ export class BeanAccountsService {
241
+ /**
242
+ * Create a new account
243
+ * Creates a new account (Beancount Open directive)
244
+ * @param data The data for the request.
245
+ * @param data.region Region code for tenant context
246
+ * @param data.requestBody
247
+ * @returns AccountResponseDto Account created successfully
248
+ * @throws ApiError
249
+ */
250
+ public static accountControllerCreate(
251
+ data: AccountControllerCreateData
252
+ ): CancelablePromise<AccountControllerCreateResponse> {
253
+ return __request(OpenAPI, {
254
+ method: 'POST',
255
+ url: '/api/v1/{region}/bean/accounts',
256
+ path: {
257
+ region: data.region
258
+ },
259
+ body: data.requestBody,
260
+ mediaType: 'application/json',
261
+ errors: {
262
+ 409: 'Account already exists'
263
+ }
264
+ });
265
+ }
266
+
267
+ /**
268
+ * List accounts
269
+ * Returns all accounts with optional filtering
270
+ * @param data The data for the request.
271
+ * @param data.region Region code for tenant context
272
+ * @param data.type Filter by account type
273
+ * @param data.status Filter by status
274
+ * @param data.isCustom Filter by custom (user-created) accounts only
275
+ * @param data.search Search term for path or i18nKey
276
+ * @param data.limit Maximum number of results
277
+ * @param data.offset Number of results to skip
278
+ * @returns AccountListResponseDto Accounts retrieved successfully
279
+ * @throws ApiError
280
+ */
281
+ public static accountControllerFindAll(
282
+ data: AccountControllerFindAllData
283
+ ): CancelablePromise<AccountControllerFindAllResponse> {
284
+ return __request(OpenAPI, {
285
+ method: 'GET',
286
+ url: '/api/v1/{region}/bean/accounts',
287
+ path: {
288
+ region: data.region
289
+ },
290
+ query: {
291
+ type: data.type,
292
+ status: data.status,
293
+ isCustom: data.isCustom,
294
+ search: data.search,
295
+ limit: data.limit,
296
+ offset: data.offset
297
+ }
298
+ });
299
+ }
300
+
301
+ /**
302
+ * Get account by ID
303
+ * Returns a specific account
304
+ * @param data The data for the request.
305
+ * @param data.id Account UUID
306
+ * @param data.region Region code for tenant context
307
+ * @returns AccountResponseDto Account retrieved successfully
308
+ * @throws ApiError
309
+ */
310
+ public static accountControllerFindOne(
311
+ data: AccountControllerFindOneData
312
+ ): CancelablePromise<AccountControllerFindOneResponse> {
313
+ return __request(OpenAPI, {
314
+ method: 'GET',
315
+ url: '/api/v1/{region}/bean/accounts/{id}',
316
+ path: {
317
+ id: data.id,
318
+ region: data.region
319
+ },
320
+ errors: {
321
+ 404: 'Account not found'
322
+ }
323
+ });
324
+ }
325
+
326
+ /**
327
+ * Update account
328
+ * Updates account metadata (path cannot be changed)
329
+ * @param data The data for the request.
330
+ * @param data.id Account UUID
331
+ * @param data.region Region code for tenant context
332
+ * @param data.requestBody
333
+ * @returns AccountResponseDto Account updated successfully
334
+ * @throws ApiError
335
+ */
336
+ public static accountControllerUpdate(
337
+ data: AccountControllerUpdateData
338
+ ): CancelablePromise<AccountControllerUpdateResponse> {
339
+ return __request(OpenAPI, {
340
+ method: 'PUT',
341
+ url: '/api/v1/{region}/bean/accounts/{id}',
342
+ path: {
343
+ id: data.id,
344
+ region: data.region
345
+ },
346
+ body: data.requestBody,
347
+ mediaType: 'application/json',
348
+ errors: {
349
+ 404: 'Account not found'
350
+ }
351
+ });
352
+ }
353
+
354
+ /**
355
+ * Delete account
356
+ * Deletes an account (only if no transactions)
357
+ * @param data The data for the request.
358
+ * @param data.id Account UUID
359
+ * @param data.region Region code for tenant context
360
+ * @returns void Account deleted successfully
361
+ * @throws ApiError
362
+ */
363
+ public static accountControllerDelete(
364
+ data: AccountControllerDeleteData
365
+ ): CancelablePromise<AccountControllerDeleteResponse> {
366
+ return __request(OpenAPI, {
367
+ method: 'DELETE',
368
+ url: '/api/v1/{region}/bean/accounts/{id}',
369
+ path: {
370
+ id: data.id,
371
+ region: data.region
372
+ },
373
+ errors: {
374
+ 404: 'Account not found',
375
+ 409: 'Account has transactions and cannot be deleted'
376
+ }
377
+ });
378
+ }
379
+
380
+ /**
381
+ * Close account
382
+ * Closes an account (Beancount Close directive)
383
+ * @param data The data for the request.
384
+ * @param data.id Account UUID
385
+ * @param data.region Region code for tenant context
386
+ * @param data.requestBody
387
+ * @returns AccountResponseDto Account closed successfully
388
+ * @throws ApiError
389
+ */
390
+ public static accountControllerClose(
391
+ data: AccountControllerCloseData
392
+ ): CancelablePromise<AccountControllerCloseResponse> {
393
+ return __request(OpenAPI, {
394
+ method: 'POST',
395
+ url: '/api/v1/{region}/bean/accounts/{id}/close',
396
+ path: {
397
+ id: data.id,
398
+ region: data.region
399
+ },
400
+ body: data.requestBody,
401
+ mediaType: 'application/json',
402
+ errors: {
403
+ 400: 'Account is already closed',
404
+ 404: 'Account not found'
405
+ }
406
+ });
407
+ }
408
+
409
+ /**
410
+ * Reopen account
411
+ * Reopens a previously closed account
412
+ * @param data The data for the request.
413
+ * @param data.id Account UUID
414
+ * @param data.region Region code for tenant context
415
+ * @param data.requestBody
416
+ * @returns AccountResponseDto Account reopened successfully
417
+ * @throws ApiError
418
+ */
419
+ public static accountControllerReopen(
420
+ data: AccountControllerReopenData
421
+ ): CancelablePromise<AccountControllerReopenResponse> {
422
+ return __request(OpenAPI, {
423
+ method: 'POST',
424
+ url: '/api/v1/{region}/bean/accounts/{id}/reopen',
425
+ path: {
426
+ id: data.id,
427
+ region: data.region
428
+ },
429
+ body: data.requestBody,
430
+ mediaType: 'application/json',
431
+ errors: {
432
+ 400: 'Account is not closed',
433
+ 404: 'Account not found'
434
+ }
435
+ });
436
+ }
437
+ }
438
+
439
+ export class BeanAccountStandardsService {
440
+ /**
441
+ * Get account templates
442
+ * Returns predefined account templates for a region. Supports filtering by account type and search term.
443
+ * @param data The data for the request.
444
+ * @param data.region Region code (cn, us, de)
445
+ * @param data.type Filter by account type
446
+ * @param data.search Search term for path or description
447
+ * @returns AccountStandardListResponseDto Account templates retrieved successfully
448
+ * @throws ApiError
449
+ */
450
+ public static accountStandardsControllerGetTemplates(
451
+ data: AccountStandardsControllerGetTemplatesData
452
+ ): CancelablePromise<AccountStandardsControllerGetTemplatesResponse> {
453
+ return __request(OpenAPI, {
454
+ method: 'GET',
455
+ url: '/api/v1/{region}/bean/account-standards',
456
+ path: {
457
+ region: data.region
458
+ },
459
+ query: {
460
+ type: data.type,
461
+ search: data.search
462
+ }
463
+ });
464
+ }
465
+
466
+ /**
467
+ * Get template metadata for an account path
468
+ * Returns extendable status and root type for a template path.
469
+ * @param data The data for the request.
470
+ * @param data.region Region code for tenant context
471
+ * @param data.path Account path to check
472
+ * @returns TemplateMetadataResponseDto Template metadata retrieved successfully
473
+ * @throws ApiError
474
+ */
475
+ public static accountStandardsControllerGetTemplateMetadata(
476
+ data: AccountStandardsControllerGetTemplateMetadataData
477
+ ): CancelablePromise<AccountStandardsControllerGetTemplateMetadataResponse> {
478
+ return __request(OpenAPI, {
479
+ method: 'GET',
480
+ url: '/api/v1/{region}/bean/account-standards/template-metadata',
481
+ path: {
482
+ region: data.region
483
+ },
484
+ query: {
485
+ path: data.path
486
+ }
487
+ });
488
+ }
489
+
490
+ /**
491
+ * Get available regions with hierarchy
492
+ * Returns supported regions with inheritance metadata
493
+ * @param data The data for the request.
494
+ * @param data.region Region code for tenant context
495
+ * @returns RegionsMetadataResponseDto Regions metadata retrieved successfully
496
+ * @throws ApiError
497
+ */
498
+ public static accountStandardsControllerGetRegions(
499
+ data: AccountStandardsControllerGetRegionsData
500
+ ): CancelablePromise<AccountStandardsControllerGetRegionsResponse> {
501
+ return __request(OpenAPI, {
502
+ method: 'GET',
503
+ url: '/api/v1/{region}/bean/account-standards/regions',
504
+ path: {
505
+ region: data.region
506
+ }
507
+ });
508
+ }
509
+ }
510
+
511
+ export class BeanTransactionsService {
512
+ /**
513
+ * @deprecated
514
+ * Create transaction (DEPRECATED)
515
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
516
+ * @param data The data for the request.
517
+ * @param data.region Region code for tenant context
518
+ * @param data.requestBody Transaction data with postings
519
+ * @returns TransactionResponseDto Transaction created successfully
520
+ * @throws ApiError
521
+ */
522
+ public static transactionControllerCreate(
523
+ data: TransactionControllerCreateData
524
+ ): CancelablePromise<TransactionControllerCreateResponse> {
525
+ return __request(OpenAPI, {
526
+ method: 'POST',
527
+ url: '/api/v1/{region}/bean/transactions',
528
+ path: {
529
+ region: data.region
530
+ },
531
+ body: data.requestBody,
532
+ mediaType: 'application/json',
533
+ errors: {
534
+ 400: 'Validation failed',
535
+ 401: 'Authentication required',
536
+ 422: 'Semantic validation failed (transaction does not balance, invalid accounts)',
537
+ 500: 'Unexpected server error'
538
+ }
539
+ });
540
+ }
541
+
542
+ /**
543
+ * List transactions
544
+ * Returns a paginated list of transactions with optional filters
545
+ * @param data The data for the request.
546
+ * @param data.region Region code for tenant context
547
+ * @param data.limit Number of items per page (1-100, default: 20)
548
+ * @param data.offset Number of items to skip (default: 0)
549
+ * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
550
+ * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
551
+ * @param data.status Filter by transaction status
552
+ * @param data.search Search in narration and payee fields (max 200 chars)
553
+ * @param data.accountId Filter by account ID (transactions with postings to this account)
554
+ * @returns TransactionListResponseDto Transaction list
555
+ * @throws ApiError
556
+ */
557
+ public static transactionControllerList(
558
+ data: TransactionControllerListData
559
+ ): CancelablePromise<TransactionControllerListResponse> {
560
+ return __request(OpenAPI, {
561
+ method: 'GET',
562
+ url: '/api/v1/{region}/bean/transactions',
563
+ path: {
564
+ region: data.region
565
+ },
566
+ query: {
567
+ limit: data.limit,
568
+ offset: data.offset,
569
+ dateFrom: data.dateFrom,
570
+ dateTo: data.dateTo,
571
+ status: data.status,
572
+ search: data.search,
573
+ accountId: data.accountId
574
+ },
575
+ errors: {
576
+ 400: 'Validation failed',
577
+ 401: 'Authentication required'
578
+ }
579
+ });
580
+ }
581
+
582
+ /**
583
+ * @deprecated
584
+ * Batch create transactions (DEPRECATED)
585
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
586
+ * @param data The data for the request.
587
+ * @param data.region Region code for tenant context
588
+ * @param data.requestBody
589
+ * @returns BatchTransactionResponseDto Transactions processed
590
+ * @throws ApiError
591
+ */
592
+ public static transactionControllerCreateBatch(
593
+ data: TransactionControllerCreateBatchData
594
+ ): CancelablePromise<TransactionControllerCreateBatchResponse> {
595
+ return __request(OpenAPI, {
596
+ method: 'POST',
597
+ url: '/api/v1/{region}/bean/transactions/batch',
598
+ path: {
599
+ region: data.region
600
+ },
601
+ body: data.requestBody,
602
+ mediaType: 'application/json',
603
+ errors: {
604
+ 400: 'Invalid input',
605
+ 401: 'Authentication required'
606
+ }
607
+ });
608
+ }
609
+
610
+ /**
611
+ * Correct (supersede) a transaction
612
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
613
+ * @param data The data for the request.
614
+ * @param data.id Original transaction ID to correct
615
+ * @param data.region Region code for tenant context
616
+ * @param data.requestBody
617
+ * @returns TransactionDetailDto Corrected transaction created
618
+ * @throws ApiError
619
+ */
620
+ public static transactionControllerCorrect(
621
+ data: TransactionControllerCorrectData
622
+ ): CancelablePromise<TransactionControllerCorrectResponse> {
623
+ return __request(OpenAPI, {
624
+ method: 'POST',
625
+ url: '/api/v1/{region}/bean/transactions/{id}/correct',
626
+ path: {
627
+ id: data.id,
628
+ region: data.region
629
+ },
630
+ body: data.requestBody,
631
+ mediaType: 'application/json',
632
+ errors: {
633
+ 404: 'Original transaction not found',
634
+ 409: 'Original no longer ACTIVE (concurrent modification)',
635
+ 422: 'Pipeline validation failed (does not balance, invalid accounts)'
636
+ }
637
+ });
638
+ }
639
+
640
+ /**
641
+ * Suggest transaction tags
642
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
643
+ * @param data The data for the request.
644
+ * @param data.region Region code for tenant context
645
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
646
+ * @param data.sort usage (default) or name
647
+ * @param data.limit Max suggestions (1-100, default 10)
648
+ * @returns TagSuggestionsResponseDto Tag suggestions
649
+ * @throws ApiError
650
+ */
651
+ public static transactionControllerSuggestTags(
652
+ data: TransactionControllerSuggestTagsData
653
+ ): CancelablePromise<TransactionControllerSuggestTagsResponse> {
654
+ return __request(OpenAPI, {
655
+ method: 'GET',
656
+ url: '/api/v1/{region}/bean/transactions/tags',
657
+ path: {
658
+ region: data.region
659
+ },
660
+ query: {
661
+ q: data.q,
662
+ sort: data.sort,
663
+ limit: data.limit
664
+ },
665
+ errors: {
666
+ 400: 'Validation failed',
667
+ 401: 'Authentication required'
668
+ }
669
+ });
670
+ }
671
+
672
+ /**
673
+ * Get transaction detail
674
+ * Returns transaction details including all postings
675
+ * @param data The data for the request.
676
+ * @param data.id Transaction ID
677
+ * @param data.region Region code for tenant context
678
+ * @returns TransactionDetailDto Transaction detail
679
+ * @throws ApiError
680
+ */
681
+ public static transactionControllerGetDetail(
682
+ data: TransactionControllerGetDetailData
683
+ ): CancelablePromise<TransactionControllerGetDetailResponse> {
684
+ return __request(OpenAPI, {
685
+ method: 'GET',
686
+ url: '/api/v1/{region}/bean/transactions/{id}',
687
+ path: {
688
+ id: data.id,
689
+ region: data.region
690
+ },
691
+ errors: {
692
+ 401: 'Authentication required',
693
+ 404: 'Transaction not found'
694
+ }
695
+ });
696
+ }
697
+
698
+ /**
699
+ * Update transaction metadata
700
+ * Updates transaction metadata (flag, payee, narration, tags, links, meta). Postings cannot be modified.
701
+ * @param data The data for the request.
702
+ * @param data.id Transaction ID
703
+ * @param data.region Region code for tenant context
704
+ * @param data.requestBody Fields to update (all optional)
705
+ * @returns TransactionDetailDto Transaction updated successfully
706
+ * @throws ApiError
707
+ */
708
+ public static transactionControllerUpdate(
709
+ data: TransactionControllerUpdateData
710
+ ): CancelablePromise<TransactionControllerUpdateResponse> {
711
+ return __request(OpenAPI, {
712
+ method: 'PATCH',
713
+ url: '/api/v1/{region}/bean/transactions/{id}',
714
+ path: {
715
+ id: data.id,
716
+ region: data.region
717
+ },
718
+ body: data.requestBody,
719
+ mediaType: 'application/json',
720
+ errors: {
721
+ 400: 'Cannot update voided transaction',
722
+ 401: 'Authentication required',
723
+ 404: 'Transaction not found'
724
+ }
725
+ });
726
+ }
727
+
728
+ /**
729
+ * Void transaction
730
+ * Soft-deletes a transaction by marking it as VOIDED
731
+ * @param data The data for the request.
732
+ * @param data.id Transaction ID
733
+ * @param data.region Region code for tenant context
734
+ * @returns void Transaction voided successfully
735
+ * @throws ApiError
736
+ */
737
+ public static transactionControllerDelete(
738
+ data: TransactionControllerDeleteData
739
+ ): CancelablePromise<TransactionControllerDeleteResponse> {
740
+ return __request(OpenAPI, {
741
+ method: 'DELETE',
742
+ url: '/api/v1/{region}/bean/transactions/{id}',
743
+ path: {
744
+ id: data.id,
745
+ region: data.region
746
+ },
747
+ errors: {
748
+ 400: 'Transaction already voided',
749
+ 401: 'Authentication required',
750
+ 404: 'Transaction not found'
751
+ }
752
+ });
753
+ }
754
+ }
755
+
756
+ export class BeanBalancesService {
757
+ /**
758
+ * Query account balance
759
+ * Calculate account balance at a specific date for a single currency
760
+ * @param data The data for the request.
761
+ * @param data.account Account name (e.g., "Assets:Bank:Checking")
762
+ * @param data.region Region code for tenant context
763
+ * @param data.date Date to calculate balance at (ISO 8601 format)
764
+ * @param data.currency Currency to query (e.g., "USD", "CNY")
765
+ * @returns BalanceResponseDto Balance calculated successfully
766
+ * @throws ApiError
767
+ */
768
+ public static balanceControllerGetBalance(
769
+ data: BalanceControllerGetBalanceData
770
+ ): CancelablePromise<BalanceControllerGetBalanceResponse> {
771
+ return __request(OpenAPI, {
772
+ method: 'GET',
773
+ url: '/api/v1/{region}/bean/balances',
774
+ path: {
775
+ region: data.region
776
+ },
777
+ query: {
778
+ account: data.account,
779
+ date: data.date,
780
+ currency: data.currency
781
+ },
782
+ errors: {
783
+ 400: 'Invalid query parameters',
784
+ 401: 'User not authenticated'
785
+ }
786
+ });
787
+ }
788
+
789
+ /**
790
+ * Query multi-currency account balance
791
+ * Calculate account balances for all currencies at a specific date
792
+ * @param data The data for the request.
793
+ * @param data.region Region code for tenant context
794
+ * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
795
+ * @throws ApiError
796
+ */
797
+ public static balanceControllerGetMultiCurrencyBalance(
798
+ data: BalanceControllerGetMultiCurrencyBalanceData
799
+ ): CancelablePromise<BalanceControllerGetMultiCurrencyBalanceResponse> {
800
+ return __request(OpenAPI, {
801
+ method: 'GET',
802
+ url: '/api/v1/{region}/bean/balances/multi-currency',
803
+ path: {
804
+ region: data.region
805
+ },
806
+ errors: {
807
+ 400: 'Invalid query parameters',
808
+ 401: 'User not authenticated'
809
+ }
810
+ });
811
+ }
812
+ }
813
+
814
+ export class BeanReviewsService {
815
+ /**
816
+ * List pending reviews
817
+ * @param data The data for the request.
818
+ * @param data.region Region code for tenant context
819
+ * @param data.type Filter by review type
820
+ * @param data.confidenceLevel Filter by confidence level
821
+ * @param data.sortBy Sort order
822
+ * @param data.page Page number (default: 1)
823
+ * @param data.limit Items per page (1-100, default: 20)
824
+ * @returns ReviewListResponseDto
825
+ * @throws ApiError
826
+ */
827
+ public static reviewControllerFindAll(
828
+ data: ReviewControllerFindAllData
829
+ ): CancelablePromise<ReviewControllerFindAllResponse> {
830
+ return __request(OpenAPI, {
831
+ method: 'GET',
832
+ url: '/api/v1/{region}/bean/reviews',
833
+ path: {
834
+ region: data.region
835
+ },
836
+ query: {
837
+ type: data.type,
838
+ confidenceLevel: data.confidenceLevel,
839
+ sortBy: data.sortBy,
840
+ page: data.page,
841
+ limit: data.limit
842
+ }
843
+ });
844
+ }
845
+
846
+ /**
847
+ * Get review statistics
848
+ * @param data The data for the request.
849
+ * @param data.region Region code for tenant context
850
+ * @returns ReviewStatsDto
851
+ * @throws ApiError
852
+ */
853
+ public static reviewControllerGetStats(
854
+ data: ReviewControllerGetStatsData
855
+ ): CancelablePromise<ReviewControllerGetStatsResponse> {
856
+ return __request(OpenAPI, {
857
+ method: 'GET',
858
+ url: '/api/v1/{region}/bean/reviews/stats',
859
+ path: {
860
+ region: data.region
861
+ }
862
+ });
863
+ }
864
+
865
+ /**
866
+ * Get review by ID
867
+ * @param data The data for the request.
868
+ * @param data.id Review ID
869
+ * @param data.region Region code for tenant context
870
+ * @returns ReviewDetailDto
871
+ * @throws ApiError
872
+ */
873
+ public static reviewControllerFindOne(
874
+ data: ReviewControllerFindOneData
875
+ ): CancelablePromise<ReviewControllerFindOneResponse> {
876
+ return __request(OpenAPI, {
877
+ method: 'GET',
878
+ url: '/api/v1/{region}/bean/reviews/{id}',
879
+ path: {
880
+ id: data.id,
881
+ region: data.region
882
+ }
883
+ });
884
+ }
885
+
886
+ /**
887
+ * Resolve a review item
888
+ * @param data The data for the request.
889
+ * @param data.id Review ID
890
+ * @param data.region Region code for tenant context
891
+ * @param data.requestBody
892
+ * @returns ResolveResultDto
893
+ * @throws ApiError
894
+ */
895
+ public static reviewControllerResolve(
896
+ data: ReviewControllerResolveData
897
+ ): CancelablePromise<ReviewControllerResolveResponse> {
898
+ return __request(OpenAPI, {
899
+ method: 'POST',
900
+ url: '/api/v1/{region}/bean/reviews/{id}/resolve',
901
+ path: {
902
+ id: data.id,
903
+ region: data.region
904
+ },
905
+ body: data.requestBody,
906
+ mediaType: 'application/json'
907
+ });
908
+ }
909
+
910
+ /**
911
+ * Undo a resolution (within 24h)
912
+ * @param data The data for the request.
913
+ * @param data.id Review ID
914
+ * @param data.region Region code for tenant context
915
+ * @returns UndoResultDto
916
+ * @throws ApiError
917
+ */
918
+ public static reviewControllerUndo(
919
+ data: ReviewControllerUndoData
920
+ ): CancelablePromise<ReviewControllerUndoResponse> {
921
+ return __request(OpenAPI, {
922
+ method: 'POST',
923
+ url: '/api/v1/{region}/bean/reviews/{id}/undo',
924
+ path: {
925
+ id: data.id,
926
+ region: data.region
927
+ }
928
+ });
929
+ }
930
+
931
+ /**
932
+ * Batch resolve multiple reviews
933
+ * @param data The data for the request.
934
+ * @param data.region Region code for tenant context
935
+ * @param data.requestBody Batch resolution request containing review IDs and action
936
+ * @returns BatchResolveResultDto
937
+ * @throws ApiError
938
+ */
939
+ public static reviewControllerBatchResolve(
940
+ data: ReviewControllerBatchResolveData
941
+ ): CancelablePromise<ReviewControllerBatchResolveResponse> {
942
+ return __request(OpenAPI, {
943
+ method: 'POST',
944
+ url: '/api/v1/{region}/bean/reviews/batch-resolve',
945
+ path: {
946
+ region: data.region
947
+ },
948
+ body: data.requestBody,
949
+ mediaType: 'application/json'
950
+ });
951
+ }
952
+ }
953
+
954
+ export class BeanPayeesService {
955
+ /**
956
+ * Create a new payee
957
+ * Creates a new payee mapping for the authenticated user. The payee name must be unique within the user's account.
958
+ * @param data The data for the request.
959
+ * @param data.requestBody
960
+ * @returns PayeeResponseDto Payee created successfully
961
+ * @throws ApiError
962
+ */
963
+ public static payeeControllerCreate(
964
+ data: PayeeControllerCreateData
965
+ ): CancelablePromise<PayeeControllerCreateResponse> {
966
+ return __request(OpenAPI, {
967
+ method: 'POST',
968
+ url: '/api/v1/bean/payees',
969
+ body: data.requestBody,
970
+ mediaType: 'application/json',
971
+ errors: {
972
+ 400: 'Invalid input data',
973
+ 409: 'Payee already exists'
974
+ }
975
+ });
976
+ }
977
+
978
+ /**
979
+ * List user payees
980
+ * Returns all payee mappings for the authenticated user with optional filtering
981
+ * @param data The data for the request.
982
+ * @param data.search Search term for payee name (partial match, case-insensitive). Useful for autocomplete.
983
+ * @param data.payee Filter by exact payee name match
984
+ * @param data.category Filter by custom category
985
+ * @param data.tag Filter by custom tag (returns payees that have this tag)
986
+ * @param data.isActive Filter by active status. Defaults to true (show only active payees).
987
+ * @returns PayeeListResponseDto Payees retrieved successfully
988
+ * @throws ApiError
989
+ */
990
+ public static payeeControllerFindAll(
991
+ data: PayeeControllerFindAllData = {}
992
+ ): CancelablePromise<PayeeControllerFindAllResponse> {
993
+ return __request(OpenAPI, {
994
+ method: 'GET',
995
+ url: '/api/v1/bean/payees',
996
+ query: {
997
+ search: data.search,
998
+ payee: data.payee,
999
+ category: data.category,
1000
+ tag: data.tag,
1001
+ isActive: data.isActive
1002
+ }
1003
+ });
1004
+ }
1005
+
1006
+ /**
1007
+ * Get payee autocomplete suggestions
1008
+ * Returns active payee names matching the query, sorted by recent usage. Used for transaction input autocomplete.
1009
+ * @param data The data for the request.
1010
+ * @param data.q Search query for payee name (partial match, case-insensitive)
1011
+ * @param data.limit Maximum number of suggestions
1012
+ * @returns PayeeAutocompleteResponseDto Autocomplete suggestions retrieved successfully
1013
+ * @throws ApiError
1014
+ */
1015
+ public static payeeControllerAutocomplete(
1016
+ data: PayeeControllerAutocompleteData
1017
+ ): CancelablePromise<PayeeControllerAutocompleteResponse> {
1018
+ return __request(OpenAPI, {
1019
+ method: 'GET',
1020
+ url: '/api/v1/bean/payees/autocomplete',
1021
+ query: {
1022
+ q: data.q,
1023
+ limit: data.limit
1024
+ }
1025
+ });
1026
+ }
1027
+
1028
+ /**
1029
+ * Get top payees by usage
1030
+ * Returns the most frequently used payees, sorted by use count. Used for statistics and analytics.
1031
+ * @param data The data for the request.
1032
+ * @param data.limit Maximum number of results
1033
+ * @returns PayeeStatsResponseDto Top payees retrieved successfully
1034
+ * @throws ApiError
1035
+ */
1036
+ public static payeeControllerGetTopPayees(
1037
+ data: PayeeControllerGetTopPayeesData = {}
1038
+ ): CancelablePromise<PayeeControllerGetTopPayeesResponse> {
1039
+ return __request(OpenAPI, {
1040
+ method: 'GET',
1041
+ url: '/api/v1/bean/payees/top',
1042
+ query: {
1043
+ limit: data.limit
1044
+ }
1045
+ });
1046
+ }
1047
+
1048
+ /**
1049
+ * Get payee by ID
1050
+ * Returns a specific payee mapping by its UUID
1051
+ * @param data The data for the request.
1052
+ * @param data.id Payee UUID
1053
+ * @returns PayeeResponseDto Payee retrieved successfully
1054
+ * @throws ApiError
1055
+ */
1056
+ public static payeeControllerFindOne(
1057
+ data: PayeeControllerFindOneData
1058
+ ): CancelablePromise<PayeeControllerFindOneResponse> {
1059
+ return __request(OpenAPI, {
1060
+ method: 'GET',
1061
+ url: '/api/v1/bean/payees/{id}',
1062
+ path: {
1063
+ id: data.id
1064
+ },
1065
+ errors: {
1066
+ 403: 'Payee belongs to another user',
1067
+ 404: 'Payee not found'
1068
+ }
1069
+ });
1070
+ }
1071
+
1072
+ /**
1073
+ * Update payee
1074
+ * Updates a payee mapping. The payee name cannot be changed after creation.
1075
+ * @param data The data for the request.
1076
+ * @param data.id Payee UUID
1077
+ * @param data.requestBody
1078
+ * @returns PayeeResponseDto Payee updated successfully
1079
+ * @throws ApiError
1080
+ */
1081
+ public static payeeControllerUpdate(
1082
+ data: PayeeControllerUpdateData
1083
+ ): CancelablePromise<PayeeControllerUpdateResponse> {
1084
+ return __request(OpenAPI, {
1085
+ method: 'PUT',
1086
+ url: '/api/v1/bean/payees/{id}',
1087
+ path: {
1088
+ id: data.id
1089
+ },
1090
+ body: data.requestBody,
1091
+ mediaType: 'application/json',
1092
+ errors: {
1093
+ 400: 'Invalid input data',
1094
+ 404: 'Payee not found'
1095
+ }
1096
+ });
1097
+ }
1098
+
1099
+ /**
1100
+ * Delete payee
1101
+ * Soft deletes a payee by marking it as inactive. Inactive payees will not appear in autocomplete suggestions.
1102
+ * @param data The data for the request.
1103
+ * @param data.id Payee UUID
1104
+ * @returns void Payee deleted successfully
1105
+ * @throws ApiError
1106
+ */
1107
+ public static payeeControllerDelete(
1108
+ data: PayeeControllerDeleteData
1109
+ ): CancelablePromise<PayeeControllerDeleteResponse> {
1110
+ return __request(OpenAPI, {
1111
+ method: 'DELETE',
1112
+ url: '/api/v1/bean/payees/{id}',
1113
+ path: {
1114
+ id: data.id
1115
+ },
1116
+ errors: {
1117
+ 404: 'Payee not found'
1118
+ }
1119
+ });
1120
+ }
1121
+ }
1122
+
1123
+ export class AdminPayeeProfilesService {
1124
+ /**
1125
+ * Create payee profile (Admin only)
1126
+ * Creates a new global payee profile. The canonical name must be unique (case-insensitive).
1127
+ * @param data The data for the request.
1128
+ * @param data.requestBody
1129
+ * @returns PayeeProfileResponseDto Payee profile created successfully
1130
+ * @throws ApiError
1131
+ */
1132
+ public static payeeProfileAdminControllerCreate(
1133
+ data: PayeeProfileAdminControllerCreateData
1134
+ ): CancelablePromise<PayeeProfileAdminControllerCreateResponse> {
1135
+ return __request(OpenAPI, {
1136
+ method: 'POST',
1137
+ url: '/api/v1/admin/payee-profiles',
1138
+ body: data.requestBody,
1139
+ mediaType: 'application/json',
1140
+ errors: {
1141
+ 400: 'Validation failed',
1142
+ 403: 'Admin access required',
1143
+ 409: 'Payee profile already exists'
1144
+ }
1145
+ });
1146
+ }
1147
+
1148
+ /**
1149
+ * List payee profiles (Admin only)
1150
+ * Returns all payee profiles with optional filtering by category, country, verification status, etc.
1151
+ * @param data The data for the request.
1152
+ * @param data.search Search term for canonical name and aliases (case-insensitive)
1153
+ * @param data.category Filter by category
1154
+ * @param data.country Filter by country (ISO 3166-1 alpha-2)
1155
+ * @param data.isActive Filter by active status (default: true - show only active)
1156
+ * @param data.verified Filter by verification status. true = verified only, false = unverified only
1157
+ * @param data.dataSource Filter by data source
1158
+ * @returns PayeeProfileListResponseDto Payee profiles retrieved successfully
1159
+ * @throws ApiError
1160
+ */
1161
+ public static payeeProfileAdminControllerFindAll(
1162
+ data: PayeeProfileAdminControllerFindAllData = {}
1163
+ ): CancelablePromise<PayeeProfileAdminControllerFindAllResponse> {
1164
+ return __request(OpenAPI, {
1165
+ method: 'GET',
1166
+ url: '/api/v1/admin/payee-profiles',
1167
+ query: {
1168
+ search: data.search,
1169
+ category: data.category,
1170
+ country: data.country,
1171
+ isActive: data.isActive,
1172
+ verified: data.verified,
1173
+ dataSource: data.dataSource
1174
+ },
1175
+ errors: {
1176
+ 403: 'Admin access required'
1177
+ }
1178
+ });
1179
+ }
1180
+
1181
+ /**
1182
+ * Get payee profile by ID (Admin only)
1183
+ * Returns a single payee profile by its ID.
1184
+ * @param data The data for the request.
1185
+ * @param data.id Payee profile ID (UUID)
1186
+ * @returns PayeeProfileResponseDto Payee profile retrieved successfully
1187
+ * @throws ApiError
1188
+ */
1189
+ public static payeeProfileAdminControllerFindOne(
1190
+ data: PayeeProfileAdminControllerFindOneData
1191
+ ): CancelablePromise<PayeeProfileAdminControllerFindOneResponse> {
1192
+ return __request(OpenAPI, {
1193
+ method: 'GET',
1194
+ url: '/api/v1/admin/payee-profiles/{id}',
1195
+ path: {
1196
+ id: data.id
1197
+ },
1198
+ errors: {
1199
+ 403: 'Admin access required',
1200
+ 404: 'Payee profile not found'
1201
+ }
1202
+ });
1203
+ }
1204
+
1205
+ /**
1206
+ * Update payee profile (Admin only)
1207
+ * Updates an existing payee profile. The canonical name cannot be changed.
1208
+ * @param data The data for the request.
1209
+ * @param data.id Payee profile ID (UUID)
1210
+ * @param data.requestBody
1211
+ * @returns PayeeProfileResponseDto Payee profile updated successfully
1212
+ * @throws ApiError
1213
+ */
1214
+ public static payeeProfileAdminControllerUpdate(
1215
+ data: PayeeProfileAdminControllerUpdateData
1216
+ ): CancelablePromise<PayeeProfileAdminControllerUpdateResponse> {
1217
+ return __request(OpenAPI, {
1218
+ method: 'PUT',
1219
+ url: '/api/v1/admin/payee-profiles/{id}',
1220
+ path: {
1221
+ id: data.id
1222
+ },
1223
+ body: data.requestBody,
1224
+ mediaType: 'application/json',
1225
+ errors: {
1226
+ 403: 'Admin access required',
1227
+ 404: 'Payee profile not found'
1228
+ }
1229
+ });
1230
+ }
1231
+
1232
+ /**
1233
+ * Soft delete payee profile (Admin only)
1234
+ * Marks a payee profile as inactive (soft delete). The profile cannot be deleted if it is referenced by user payees.
1235
+ * @param data The data for the request.
1236
+ * @param data.id Payee profile ID (UUID)
1237
+ * @returns void Payee profile deleted successfully
1238
+ * @throws ApiError
1239
+ */
1240
+ public static payeeProfileAdminControllerDelete(
1241
+ data: PayeeProfileAdminControllerDeleteData
1242
+ ): CancelablePromise<PayeeProfileAdminControllerDeleteResponse> {
1243
+ return __request(OpenAPI, {
1244
+ method: 'DELETE',
1245
+ url: '/api/v1/admin/payee-profiles/{id}',
1246
+ path: {
1247
+ id: data.id
1248
+ },
1249
+ errors: {
1250
+ 403: 'Admin access required',
1251
+ 404: 'Payee profile not found',
1252
+ 409: 'Payee profile is in use and cannot be deleted'
1253
+ }
1254
+ });
1255
+ }
1256
+
1257
+ /**
1258
+ * Verify payee profile (Admin only)
1259
+ * Marks a payee profile as verified by setting verifiedAt to current timestamp.
1260
+ * @param data The data for the request.
1261
+ * @param data.id Payee profile ID (UUID)
1262
+ * @returns PayeeProfileResponseDto Payee profile verified successfully
1263
+ * @throws ApiError
1264
+ */
1265
+ public static payeeProfileAdminControllerVerify(
1266
+ data: PayeeProfileAdminControllerVerifyData
1267
+ ): CancelablePromise<PayeeProfileAdminControllerVerifyResponse> {
1268
+ return __request(OpenAPI, {
1269
+ method: 'POST',
1270
+ url: '/api/v1/admin/payee-profiles/{id}/verify',
1271
+ path: {
1272
+ id: data.id
1273
+ },
1274
+ errors: {
1275
+ 403: 'Admin access required',
1276
+ 404: 'Payee profile not found'
1277
+ }
1278
+ });
1279
+ }
1280
+
1281
+ /**
1282
+ * Unverify payee profile (Admin only)
1283
+ * Removes verification status by setting verifiedAt to null.
1284
+ * @param data The data for the request.
1285
+ * @param data.id Payee profile ID (UUID)
1286
+ * @returns PayeeProfileResponseDto Payee profile unverified successfully
1287
+ * @throws ApiError
1288
+ */
1289
+ public static payeeProfileAdminControllerUnverify(
1290
+ data: PayeeProfileAdminControllerUnverifyData
1291
+ ): CancelablePromise<PayeeProfileAdminControllerUnverifyResponse> {
1292
+ return __request(OpenAPI, {
1293
+ method: 'DELETE',
1294
+ url: '/api/v1/admin/payee-profiles/{id}/verify',
1295
+ path: {
1296
+ id: data.id
1297
+ },
1298
+ errors: {
1299
+ 403: 'Admin access required',
1300
+ 404: 'Payee profile not found'
1301
+ }
1302
+ });
1303
+ }
1304
+ }
1305
+
1306
+ export class BeanCommoditiesService {
1307
+ /**
1308
+ * Create a new commodity
1309
+ * Creates a new commodity definition for the authenticated user
1310
+ * @param data The data for the request.
1311
+ * @param data.region Region code for tenant context
1312
+ * @param data.requestBody
1313
+ * @returns CommodityResponseDto Commodity created successfully
1314
+ * @throws ApiError
1315
+ */
1316
+ public static commodityControllerCreate(
1317
+ data: CommodityControllerCreateData
1318
+ ): CancelablePromise<CommodityControllerCreateResponse> {
1319
+ return __request(OpenAPI, {
1320
+ method: 'POST',
1321
+ url: '/api/v1/{region}/bean/commodities',
1322
+ path: {
1323
+ region: data.region
1324
+ },
1325
+ body: data.requestBody,
1326
+ mediaType: 'application/json',
1327
+ errors: {
1328
+ 400: 'Invalid input data',
1329
+ 409: 'Commodity already exists'
1330
+ }
1331
+ });
1332
+ }
1333
+
1334
+ /**
1335
+ * List user commodities
1336
+ * Returns all commodity definitions for the authenticated user with optional filtering
1337
+ * @param data The data for the request.
1338
+ * @param data.region Region code for tenant context
1339
+ * @param data.search Search term for symbol or metadata fields (partial match). Searches symbol and metadata.name.
1340
+ * @param data.symbol Filter by exact symbol match
1341
+ * @returns CommodityListResponseDto Commodities retrieved successfully
1342
+ * @throws ApiError
1343
+ */
1344
+ public static commodityControllerFindAll(
1345
+ data: CommodityControllerFindAllData
1346
+ ): CancelablePromise<CommodityControllerFindAllResponse> {
1347
+ return __request(OpenAPI, {
1348
+ method: 'GET',
1349
+ url: '/api/v1/{region}/bean/commodities',
1350
+ path: {
1351
+ region: data.region
1352
+ },
1353
+ query: {
1354
+ search: data.search,
1355
+ symbol: data.symbol
1356
+ }
1357
+ });
1358
+ }
1359
+
1360
+ /**
1361
+ * Get commodity by symbol
1362
+ * Returns a specific commodity definition by its symbol
1363
+ * @param data The data for the request.
1364
+ * @param data.symbol Commodity symbol
1365
+ * @param data.region Region code for tenant context
1366
+ * @returns CommodityResponseDto Commodity retrieved successfully
1367
+ * @throws ApiError
1368
+ */
1369
+ public static commodityControllerFindOne(
1370
+ data: CommodityControllerFindOneData
1371
+ ): CancelablePromise<CommodityControllerFindOneResponse> {
1372
+ return __request(OpenAPI, {
1373
+ method: 'GET',
1374
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
1375
+ path: {
1376
+ symbol: data.symbol,
1377
+ region: data.region
1378
+ },
1379
+ errors: {
1380
+ 404: 'Commodity not found'
1381
+ }
1382
+ });
1383
+ }
1384
+
1385
+ /**
1386
+ * Update commodity
1387
+ * Updates an existing commodity definition. Symbol cannot be changed.
1388
+ * @param data The data for the request.
1389
+ * @param data.symbol Commodity symbol
1390
+ * @param data.region Region code for tenant context
1391
+ * @param data.requestBody
1392
+ * @returns CommodityResponseDto Commodity updated successfully
1393
+ * @throws ApiError
1394
+ */
1395
+ public static commodityControllerUpdate(
1396
+ data: CommodityControllerUpdateData
1397
+ ): CancelablePromise<CommodityControllerUpdateResponse> {
1398
+ return __request(OpenAPI, {
1399
+ method: 'PUT',
1400
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
1401
+ path: {
1402
+ symbol: data.symbol,
1403
+ region: data.region
1404
+ },
1405
+ body: data.requestBody,
1406
+ mediaType: 'application/json',
1407
+ errors: {
1408
+ 400: 'Invalid input data',
1409
+ 404: 'Commodity not found'
1410
+ }
1411
+ });
1412
+ }
1413
+
1414
+ /**
1415
+ * Delete commodity
1416
+ * Deletes a commodity definition
1417
+ * @param data The data for the request.
1418
+ * @param data.symbol Commodity symbol
1419
+ * @param data.region Region code for tenant context
1420
+ * @returns void Commodity deleted successfully
1421
+ * @throws ApiError
1422
+ */
1423
+ public static commodityControllerDelete(
1424
+ data: CommodityControllerDeleteData
1425
+ ): CancelablePromise<CommodityControllerDeleteResponse> {
1426
+ return __request(OpenAPI, {
1427
+ method: 'DELETE',
1428
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
1429
+ path: {
1430
+ symbol: data.symbol,
1431
+ region: data.region
1432
+ },
1433
+ errors: {
1434
+ 404: 'Commodity not found'
1435
+ }
1436
+ });
1437
+ }
1438
+
1439
+ /**
1440
+ * Ensure commodity exists
1441
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
1442
+ * @param data The data for the request.
1443
+ * @param data.symbol Commodity symbol
1444
+ * @param data.region Region code for tenant context
1445
+ * @returns CommodityResponseDto Commodity retrieved or created
1446
+ * @throws ApiError
1447
+ */
1448
+ public static commodityControllerGetOrCreate(
1449
+ data: CommodityControllerGetOrCreateData
1450
+ ): CancelablePromise<CommodityControllerGetOrCreateResponse> {
1451
+ return __request(OpenAPI, {
1452
+ method: 'POST',
1453
+ url: '/api/v1/{region}/bean/commodities/{symbol}/ensure',
1454
+ path: {
1455
+ symbol: data.symbol,
1456
+ region: data.region
1457
+ }
1458
+ });
1459
+ }
1460
+
1461
+ /**
1462
+ * Bulk create commodities
1463
+ * Creates multiple commodities from a list of symbols, useful for initialization
1464
+ * @param data The data for the request.
1465
+ * @param data.region Region code for tenant context
1466
+ * @returns CommodityResponseDto Commodities created successfully
1467
+ * @throws ApiError
1468
+ */
1469
+ public static commodityControllerBulkCreate(
1470
+ data: CommodityControllerBulkCreateData
1471
+ ): CancelablePromise<CommodityControllerBulkCreateResponse> {
1472
+ return __request(OpenAPI, {
1473
+ method: 'POST',
1474
+ url: '/api/v1/{region}/bean/commodities/bulk',
1475
+ path: {
1476
+ region: data.region
1477
+ }
1478
+ });
1479
+ }
1480
+ }
1481
+
1482
+ export class RecurringRulesService {
1483
+ /**
1484
+ * Create a new recurring rule
1485
+ * Creates a new recurring transaction rule for the authenticated user
1486
+ * @param data The data for the request.
1487
+ * @param data.region Region code for tenant context
1488
+ * @param data.requestBody
1489
+ * @returns RecurringRuleResponseDto Rule created successfully
1490
+ * @throws ApiError
1491
+ */
1492
+ public static recurringRuleControllerCreate(
1493
+ data: RecurringRuleControllerCreateData
1494
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1495
+ return __request(OpenAPI, {
1496
+ method: 'POST',
1497
+ url: '/api/v1/{region}/bean/recurring-rules',
1498
+ path: {
1499
+ region: data.region
1500
+ },
1501
+ body: data.requestBody,
1502
+ mediaType: 'application/json',
1503
+ errors: {
1504
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
1505
+ 409: 'Rule with same name already exists'
1506
+ }
1507
+ });
1508
+ }
1509
+
1510
+ /**
1511
+ * List recurring rules
1512
+ * Returns all recurring rules for the authenticated user with optional filtering
1513
+ * @param data The data for the request.
1514
+ * @param data.region Region code for tenant context
1515
+ * @param data.isActive Filter by active status
1516
+ * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1517
+ * @param data.hasAutoCreate Filter by autoCreate enabled
1518
+ * @returns RecurringRuleResponseDto Rules retrieved successfully
1519
+ * @throws ApiError
1520
+ */
1521
+ public static recurringRuleControllerFindAll(
1522
+ data: RecurringRuleControllerFindAllData
1523
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1524
+ return __request(OpenAPI, {
1525
+ method: 'GET',
1526
+ url: '/api/v1/{region}/bean/recurring-rules',
1527
+ path: {
1528
+ region: data.region
1529
+ },
1530
+ query: {
1531
+ isActive: data.isActive,
1532
+ frequency: data.frequency,
1533
+ hasAutoCreate: data.hasAutoCreate
1534
+ }
1535
+ });
1536
+ }
1537
+
1538
+ /**
1539
+ * Create recurring rule from transaction
1540
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1541
+ * @param data The data for the request.
1542
+ * @param data.transactionId Source transaction ID
1543
+ * @param data.region Region code for tenant context
1544
+ * @param data.requestBody
1545
+ * @returns RecurringRuleResponseDto Rule created successfully
1546
+ * @throws ApiError
1547
+ */
1548
+ public static recurringRuleControllerCreateFromTransaction(
1549
+ data: RecurringRuleControllerCreateFromTransactionData
1550
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1551
+ return __request(OpenAPI, {
1552
+ method: 'POST',
1553
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1554
+ path: {
1555
+ transactionId: data.transactionId,
1556
+ region: data.region
1557
+ },
1558
+ body: data.requestBody,
1559
+ mediaType: 'application/json',
1560
+ errors: {
1561
+ 404: 'Transaction not found',
1562
+ 409: 'Rule with same name already exists or transaction already linked'
1563
+ }
1564
+ });
1565
+ }
1566
+
1567
+ /**
1568
+ * Get recurring rule by ID
1569
+ * Returns a specific recurring rule with its details
1570
+ * @param data The data for the request.
1571
+ * @param data.id Rule ID
1572
+ * @param data.region Region code for tenant context
1573
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
1574
+ * @throws ApiError
1575
+ */
1576
+ public static recurringRuleControllerFindOne(
1577
+ data: RecurringRuleControllerFindOneData
1578
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1579
+ return __request(OpenAPI, {
1580
+ method: 'GET',
1581
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1582
+ path: {
1583
+ id: data.id,
1584
+ region: data.region
1585
+ },
1586
+ errors: {
1587
+ 404: 'Rule not found'
1588
+ }
1589
+ });
1590
+ }
1591
+
1592
+ /**
1593
+ * Update recurring rule
1594
+ * Updates an existing recurring rule
1595
+ * @param data The data for the request.
1596
+ * @param data.id Rule ID
1597
+ * @param data.region Region code for tenant context
1598
+ * @param data.requestBody
1599
+ * @returns RecurringRuleResponseDto Rule updated successfully
1600
+ * @throws ApiError
1601
+ */
1602
+ public static recurringRuleControllerUpdate(
1603
+ data: RecurringRuleControllerUpdateData
1604
+ ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1605
+ return __request(OpenAPI, {
1606
+ method: 'PATCH',
1607
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1608
+ path: {
1609
+ id: data.id,
1610
+ region: data.region
1611
+ },
1612
+ body: data.requestBody,
1613
+ mediaType: 'application/json',
1614
+ errors: {
1615
+ 400: 'Invalid input data',
1616
+ 404: 'Rule not found'
1617
+ }
1618
+ });
1619
+ }
1620
+
1621
+ /**
1622
+ * Delete recurring rule
1623
+ * Soft deletes a recurring rule (sets isActive to false)
1624
+ * @param data The data for the request.
1625
+ * @param data.id Rule ID
1626
+ * @param data.region Region code for tenant context
1627
+ * @returns void Rule deleted successfully
1628
+ * @throws ApiError
1629
+ */
1630
+ public static recurringRuleControllerDelete(
1631
+ data: RecurringRuleControllerDeleteData
1632
+ ): CancelablePromise<RecurringRuleControllerDeleteResponse> {
1633
+ return __request(OpenAPI, {
1634
+ method: 'DELETE',
1635
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1636
+ path: {
1637
+ id: data.id,
1638
+ region: data.region
1639
+ },
1640
+ errors: {
1641
+ 404: 'Rule not found'
1642
+ }
1643
+ });
1644
+ }
1645
+
1646
+ /**
1647
+ * Get rule with statistics
1648
+ * Returns a rule with pending/overdue counts and next expected date
1649
+ * @param data The data for the request.
1650
+ * @param data.id Rule ID
1651
+ * @param data.region Region code for tenant context
1652
+ * @returns RecurringRuleWithStatsResponseDto Rule with stats retrieved successfully
1653
+ * @throws ApiError
1654
+ */
1655
+ public static recurringRuleControllerGetWithStats(
1656
+ data: RecurringRuleControllerGetWithStatsData
1657
+ ): CancelablePromise<RecurringRuleControllerGetWithStatsResponse> {
1658
+ return __request(OpenAPI, {
1659
+ method: 'GET',
1660
+ url: '/api/v1/{region}/bean/recurring-rules/{id}/stats',
1661
+ path: {
1662
+ id: data.id,
1663
+ region: data.region
1664
+ },
1665
+ errors: {
1666
+ 404: 'Rule not found'
1667
+ }
1668
+ });
1669
+ }
1670
+ }
1671
+
1672
+ export class ExpectedTransactionsService {
1673
+ /**
1674
+ * List expected transactions
1675
+ * Returns expected transactions for the authenticated user with optional filtering
1676
+ * @param data The data for the request.
1677
+ * @param data.region Region code for tenant context
1678
+ * @param data.ruleId Filter by recurring rule ID
1679
+ * @param data.status Filter by status (PENDING, COMPLETED, SKIPPED)
1680
+ * @param data.fromDate Filter by date range start (YYYY-MM-DD)
1681
+ * @param data.toDate Filter by date range end (YYYY-MM-DD)
1682
+ * @returns ExpectedTransactionListResponseDto Expected transactions retrieved successfully
1683
+ * @throws ApiError
1684
+ */
1685
+ public static expectedTransactionControllerFindAll(
1686
+ data: ExpectedTransactionControllerFindAllData
1687
+ ): CancelablePromise<ExpectedTransactionControllerFindAllResponse> {
1688
+ return __request(OpenAPI, {
1689
+ method: 'GET',
1690
+ url: '/api/v1/{region}/bean/expected-transactions',
1691
+ path: {
1692
+ region: data.region
1693
+ },
1694
+ query: {
1695
+ ruleId: data.ruleId,
1696
+ status: data.status,
1697
+ fromDate: data.fromDate,
1698
+ toDate: data.toDate
1699
+ }
1700
+ });
1701
+ }
1702
+
1703
+ /**
1704
+ * List overdue expected transactions
1705
+ * Returns all overdue expected transactions (PENDING past tolerance)
1706
+ * @param data The data for the request.
1707
+ * @param data.region Region code for tenant context
1708
+ * @returns ExpectedTransactionListResponseDto Overdue transactions retrieved successfully
1709
+ * @throws ApiError
1710
+ */
1711
+ public static expectedTransactionControllerFindOverdue(
1712
+ data: ExpectedTransactionControllerFindOverdueData
1713
+ ): CancelablePromise<ExpectedTransactionControllerFindOverdueResponse> {
1714
+ return __request(OpenAPI, {
1715
+ method: 'GET',
1716
+ url: '/api/v1/{region}/bean/expected-transactions/overdue',
1717
+ path: {
1718
+ region: data.region
1719
+ }
1720
+ });
1721
+ }
1722
+
1723
+ /**
1724
+ * Get expected transaction by ID
1725
+ * Returns a specific expected transaction with rule details
1726
+ * @param data The data for the request.
1727
+ * @param data.id Expected transaction ID
1728
+ * @param data.region Region code for tenant context
1729
+ * @returns ExpectedTransactionResponseDto Expected transaction retrieved successfully
1730
+ * @throws ApiError
1731
+ */
1732
+ public static expectedTransactionControllerFindOne(
1733
+ data: ExpectedTransactionControllerFindOneData
1734
+ ): CancelablePromise<ExpectedTransactionControllerFindOneResponse> {
1735
+ return __request(OpenAPI, {
1736
+ method: 'GET',
1737
+ url: '/api/v1/{region}/bean/expected-transactions/{id}',
1738
+ path: {
1739
+ id: data.id,
1740
+ region: data.region
1741
+ },
1742
+ errors: {
1743
+ 404: 'Expected transaction not found'
1744
+ }
1745
+ });
1746
+ }
1747
+
1748
+ /**
1749
+ * Skip expected transaction
1750
+ * Marks an expected transaction as skipped (PENDING -> SKIPPED)
1751
+ * @param data The data for the request.
1752
+ * @param data.id Expected transaction ID
1753
+ * @param data.region Region code for tenant context
1754
+ * @returns ExpectedTransactionResponseDto Expected transaction skipped successfully
1755
+ * @throws ApiError
1756
+ */
1757
+ public static expectedTransactionControllerSkip(
1758
+ data: ExpectedTransactionControllerSkipData
1759
+ ): CancelablePromise<ExpectedTransactionControllerSkipResponse> {
1760
+ return __request(OpenAPI, {
1761
+ method: 'POST',
1762
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
1763
+ path: {
1764
+ id: data.id,
1765
+ region: data.region
1766
+ },
1767
+ errors: {
1768
+ 400: 'Cannot skip - not in PENDING status',
1769
+ 404: 'Expected transaction not found'
1770
+ }
1771
+ });
1772
+ }
1773
+
1774
+ /**
1775
+ * Undo skip
1776
+ * Reverses a skip operation (SKIPPED -> PENDING)
1777
+ * @param data The data for the request.
1778
+ * @param data.id Expected transaction ID
1779
+ * @param data.region Region code for tenant context
1780
+ * @returns ExpectedTransactionResponseDto Skip undone successfully
1781
+ * @throws ApiError
1782
+ */
1783
+ public static expectedTransactionControllerUndoSkip(
1784
+ data: ExpectedTransactionControllerUndoSkipData
1785
+ ): CancelablePromise<ExpectedTransactionControllerUndoSkipResponse> {
1786
+ return __request(OpenAPI, {
1787
+ method: 'DELETE',
1788
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
1789
+ path: {
1790
+ id: data.id,
1791
+ region: data.region
1792
+ },
1793
+ errors: {
1794
+ 400: 'Cannot undo - not in SKIPPED status',
1795
+ 404: 'Expected transaction not found'
1796
+ }
1797
+ });
1798
+ }
1799
+
1800
+ /**
1801
+ * Confirm transaction match
1802
+ * Manually matches an expected transaction with an actual transaction
1803
+ * @param data The data for the request.
1804
+ * @param data.id Expected transaction ID
1805
+ * @param data.region Region code for tenant context
1806
+ * @param data.requestBody
1807
+ * @returns unknown Match confirmed successfully
1808
+ * @throws ApiError
1809
+ */
1810
+ public static expectedTransactionControllerConfirmMatch(
1811
+ data: ExpectedTransactionControllerConfirmMatchData
1812
+ ): CancelablePromise<ExpectedTransactionControllerConfirmMatchResponse> {
1813
+ return __request(OpenAPI, {
1814
+ method: 'POST',
1815
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
1816
+ path: {
1817
+ id: data.id,
1818
+ region: data.region
1819
+ },
1820
+ body: data.requestBody,
1821
+ mediaType: 'application/json',
1822
+ errors: {
1823
+ 400: 'Cannot match - not in PENDING status',
1824
+ 404: 'Expected or actual transaction not found',
1825
+ 409: 'Actual transaction already matched to another rule'
1826
+ }
1827
+ });
1828
+ }
1829
+
1830
+ /**
1831
+ * Unmatch transaction
1832
+ * Removes the match between expected and actual transaction (COMPLETED -> PENDING)
1833
+ * @param data The data for the request.
1834
+ * @param data.id Expected transaction ID
1835
+ * @param data.region Region code for tenant context
1836
+ * @returns unknown Match removed successfully
1837
+ * @throws ApiError
1838
+ */
1839
+ public static expectedTransactionControllerUnmatch(
1840
+ data: ExpectedTransactionControllerUnmatchData
1841
+ ): CancelablePromise<ExpectedTransactionControllerUnmatchResponse> {
1842
+ return __request(OpenAPI, {
1843
+ method: 'DELETE',
1844
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
1845
+ path: {
1846
+ id: data.id,
1847
+ region: data.region
1848
+ },
1849
+ errors: {
1850
+ 400: 'Cannot unmatch - not in COMPLETED status',
1851
+ 404: 'Expected transaction not found'
1852
+ }
1853
+ });
1854
+ }
1855
+
1856
+ /**
1857
+ * Enter Now
1858
+ * Creates an actual transaction for an expected transaction (YNAB-style Enter Now)
1859
+ * @param data The data for the request.
1860
+ * @param data.id Expected transaction ID
1861
+ * @param data.region Region code for tenant context
1862
+ * @param data.requestBody
1863
+ * @returns unknown Transaction created successfully
1864
+ * @throws ApiError
1865
+ */
1866
+ public static expectedTransactionControllerEnterNow(
1867
+ data: ExpectedTransactionControllerEnterNowData
1868
+ ): CancelablePromise<ExpectedTransactionControllerEnterNowResponse> {
1869
+ return __request(OpenAPI, {
1870
+ method: 'POST',
1871
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/enter',
1872
+ path: {
1873
+ id: data.id,
1874
+ region: data.region
1875
+ },
1876
+ body: data.requestBody,
1877
+ mediaType: 'application/json',
1878
+ errors: {
1879
+ 400: 'Cannot enter - not in PENDING status or missing accounts',
1880
+ 404: 'Expected transaction or accounts not found'
1881
+ }
1882
+ });
1883
+ }
1884
+ }
1885
+
1886
+ export class RecurringForecastService {
1887
+ /**
1888
+ * Get cash flow forecast
1889
+ * Returns predicted outflows for the next N months based on active recurring rules
1890
+ * @param data The data for the request.
1891
+ * @param data.region Region code for tenant context
1892
+ * @param data.months Number of months to forecast (1-12, default 3)
1893
+ * @returns ForecastResponseDto Forecast retrieved successfully
1894
+ * @throws ApiError
1895
+ */
1896
+ public static forecastControllerGetForecast(
1897
+ data: ForecastControllerGetForecastData
1898
+ ): CancelablePromise<ForecastControllerGetForecastResponse> {
1899
+ return __request(OpenAPI, {
1900
+ method: 'GET',
1901
+ url: '/api/v1/{region}/bean/recurring/forecast',
1902
+ path: {
1903
+ region: data.region
1904
+ },
1905
+ query: {
1906
+ months: data.months
1907
+ }
1908
+ });
1909
+ }
1910
+ }
1911
+
1912
+ export class BeanTransactionRulesService {
1913
+ /**
1914
+ * Create a new transaction rule (or upsert if upsertByPayee=true)
1915
+ * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
1916
+ * @param data The data for the request.
1917
+ * @param data.region Region code for tenant context
1918
+ * @param data.requestBody
1919
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
1920
+ * @throws ApiError
1921
+ */
1922
+ public static transactionRuleControllerCreate(
1923
+ data: TransactionRuleControllerCreateData
1924
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
1925
+ return __request(OpenAPI, {
1926
+ method: 'POST',
1927
+ url: '/api/v1/{region}/bean/transaction-rules',
1928
+ path: {
1929
+ region: data.region
1930
+ },
1931
+ body: data.requestBody,
1932
+ mediaType: 'application/json',
1933
+ errors: {
1934
+ 400: 'Validation failed',
1935
+ 401: 'Unauthorized',
1936
+ 409: 'Resource conflict - another process is updating this rule'
1937
+ }
1938
+ });
1939
+ }
1940
+
1941
+ /**
1942
+ * Get all transaction rules for user
1943
+ * @param data The data for the request.
1944
+ * @param data.region Region code for tenant context
1945
+ * @param data.limit Max results per page (default: 20, max: 100)
1946
+ * @param data.offset Pagination offset (default: 0)
1947
+ * @param data.enabled Filter by enabled status
1948
+ * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
1949
+ * @param data.autoApplyEnabled Filter by auto-apply status
1950
+ * @returns TransactionRuleListResponseDto List of rules
1951
+ * @throws ApiError
1952
+ */
1953
+ public static transactionRuleControllerList(
1954
+ data: TransactionRuleControllerListData
1955
+ ): CancelablePromise<TransactionRuleControllerListResponse> {
1956
+ return __request(OpenAPI, {
1957
+ method: 'GET',
1958
+ url: '/api/v1/{region}/bean/transaction-rules',
1959
+ path: {
1960
+ region: data.region
1961
+ },
1962
+ query: {
1963
+ limit: data.limit,
1964
+ offset: data.offset,
1965
+ enabled: data.enabled,
1966
+ learningSource: data.learningSource,
1967
+ autoApplyEnabled: data.autoApplyEnabled
1968
+ },
1969
+ errors: {
1970
+ 401: 'Unauthorized'
1971
+ }
1972
+ });
1973
+ }
1974
+
1975
+ /**
1976
+ * Validate transaction rule configuration
1977
+ * @param data The data for the request.
1978
+ * @param data.region Region code for tenant context
1979
+ * @param data.requestBody
1980
+ * @returns ValidateRuleResponseDto Validation result
1981
+ * @throws ApiError
1982
+ */
1983
+ public static transactionRuleControllerValidate(
1984
+ data: TransactionRuleControllerValidateData
1985
+ ): CancelablePromise<TransactionRuleControllerValidateResponse> {
1986
+ return __request(OpenAPI, {
1987
+ method: 'POST',
1988
+ url: '/api/v1/{region}/bean/transaction-rules/validate',
1989
+ path: {
1990
+ region: data.region
1991
+ },
1992
+ body: data.requestBody,
1993
+ mediaType: 'application/json',
1994
+ errors: {
1995
+ 400: 'Validation failed',
1996
+ 401: 'Unauthorized'
1997
+ }
1998
+ });
1999
+ }
2000
+
2001
+ /**
2002
+ * Bulk create transaction rules
2003
+ * @param data The data for the request.
2004
+ * @param data.region Region code for tenant context
2005
+ * @param data.requestBody
2006
+ * @returns BulkCreateRulesResponseDto Bulk create completed
2007
+ * @throws ApiError
2008
+ */
2009
+ public static transactionRuleControllerBulkCreate(
2010
+ data: TransactionRuleControllerBulkCreateData
2011
+ ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2012
+ return __request(OpenAPI, {
2013
+ method: 'POST',
2014
+ url: '/api/v1/{region}/bean/transaction-rules/bulk',
2015
+ path: {
2016
+ region: data.region
2017
+ },
2018
+ body: data.requestBody,
2019
+ mediaType: 'application/json',
2020
+ errors: {
2021
+ 400: 'Invalid bulk create data',
2022
+ 401: 'Unauthorized'
2023
+ }
2024
+ });
2025
+ }
2026
+
2027
+ /**
2028
+ * Export transaction rules
2029
+ * @param data The data for the request.
2030
+ * @param data.format Export format (currently only JSON supported)
2031
+ * @param data.region Region code for tenant context
2032
+ * @returns ExportRulesResponseDto Exported rules
2033
+ * @throws ApiError
2034
+ */
2035
+ public static transactionRuleControllerExport(
2036
+ data: TransactionRuleControllerExportData
2037
+ ): CancelablePromise<TransactionRuleControllerExportResponse> {
2038
+ return __request(OpenAPI, {
2039
+ method: 'GET',
2040
+ url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2041
+ path: {
2042
+ format: data.format,
2043
+ region: data.region
2044
+ },
2045
+ errors: {
2046
+ 400: 'Unsupported format',
2047
+ 401: 'Unauthorized'
2048
+ }
2049
+ });
2050
+ }
2051
+
2052
+ /**
2053
+ * Get transaction rule statistics
2054
+ * @param data The data for the request.
2055
+ * @param data.period Statistics time period
2056
+ * @param data.region Region code for tenant context
2057
+ * @returns RuleStatisticsResponseDto Rule statistics
2058
+ * @throws ApiError
2059
+ */
2060
+ public static transactionRuleControllerGetStatistics(
2061
+ data: TransactionRuleControllerGetStatisticsData
2062
+ ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2063
+ return __request(OpenAPI, {
2064
+ method: 'GET',
2065
+ url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2066
+ path: {
2067
+ period: data.period,
2068
+ region: data.region
2069
+ },
2070
+ errors: {
2071
+ 401: 'Unauthorized'
2072
+ }
2073
+ });
2074
+ }
2075
+
2076
+ /**
2077
+ * Get transaction rule detail
2078
+ * @param data The data for the request.
2079
+ * @param data.ruleId Rule ID
2080
+ * @param data.region Region code for tenant context
2081
+ * @returns TransactionRuleResponseDto Rule details
2082
+ * @throws ApiError
2083
+ */
2084
+ public static transactionRuleControllerGetDetail(
2085
+ data: TransactionRuleControllerGetDetailData
2086
+ ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2087
+ return __request(OpenAPI, {
2088
+ method: 'GET',
2089
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2090
+ path: {
2091
+ ruleId: data.ruleId,
2092
+ region: data.region
2093
+ },
2094
+ errors: {
2095
+ 401: 'Unauthorized',
2096
+ 403: 'Forbidden - not owner of rule',
2097
+ 404: 'Rule not found'
2098
+ }
2099
+ });
2100
+ }
2101
+
2102
+ /**
2103
+ * Update a transaction rule
2104
+ * @param data The data for the request.
2105
+ * @param data.ruleId Rule ID to update
2106
+ * @param data.region Region code for tenant context
2107
+ * @param data.requestBody
2108
+ * @returns TransactionRuleResponseDto Rule updated successfully
2109
+ * @throws ApiError
2110
+ */
2111
+ public static transactionRuleControllerUpdate(
2112
+ data: TransactionRuleControllerUpdateData
2113
+ ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2114
+ return __request(OpenAPI, {
2115
+ method: 'PUT',
2116
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2117
+ path: {
2118
+ ruleId: data.ruleId,
2119
+ region: data.region
2120
+ },
2121
+ body: data.requestBody,
2122
+ mediaType: 'application/json',
2123
+ errors: {
2124
+ 400: 'Validation failed',
2125
+ 401: 'Unauthorized',
2126
+ 403: 'Forbidden - not owner of rule',
2127
+ 404: 'Rule not found',
2128
+ 409: 'Resource conflict - rule is being modified by another process'
2129
+ }
2130
+ });
2131
+ }
2132
+
2133
+ /**
2134
+ * Delete a transaction rule
2135
+ * @param data The data for the request.
2136
+ * @param data.ruleId Rule ID to delete
2137
+ * @param data.region Region code for tenant context
2138
+ * @returns void Rule deleted successfully
2139
+ * @throws ApiError
2140
+ */
2141
+ public static transactionRuleControllerDelete(
2142
+ data: TransactionRuleControllerDeleteData
2143
+ ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2144
+ return __request(OpenAPI, {
2145
+ method: 'DELETE',
2146
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2147
+ path: {
2148
+ ruleId: data.ruleId,
2149
+ region: data.region
2150
+ },
2151
+ errors: {
2152
+ 401: 'Unauthorized',
2153
+ 403: 'Forbidden - not owner of rule',
2154
+ 404: 'Rule not found',
2155
+ 409: 'Resource conflict - rule is being modified by another process'
2156
+ }
2157
+ });
2158
+ }
2159
+
2160
+ /**
2161
+ * Test rule matching
2162
+ * @param data The data for the request.
2163
+ * @param data.ruleId Rule ID to test
2164
+ * @param data.region Region code for tenant context
2165
+ * @param data.requestBody
2166
+ * @returns TestRuleResponseDto Test result
2167
+ * @throws ApiError
2168
+ */
2169
+ public static transactionRuleControllerTest(
2170
+ data: TransactionRuleControllerTestData
2171
+ ): CancelablePromise<TransactionRuleControllerTestResponse> {
2172
+ return __request(OpenAPI, {
2173
+ method: 'POST',
2174
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2175
+ path: {
2176
+ ruleId: data.ruleId,
2177
+ region: data.region
2178
+ },
2179
+ body: data.requestBody,
2180
+ mediaType: 'application/json',
2181
+ errors: {
2182
+ 401: 'Unauthorized',
2183
+ 403: 'Forbidden - not owner of rule',
2184
+ 404: 'Rule not found'
2185
+ }
2186
+ });
2187
+ }
2188
+ }
2189
+
2190
+ export class UsersService {
2191
+ /**
2192
+ * Delete own user account
2193
+ * @param data The data for the request.
2194
+ * @param data.requestBody
2195
+ * @returns void User deleted successfully
2196
+ * @throws ApiError
2197
+ */
2198
+ public static userControllerDeleteOwnUser(
2199
+ data: UserControllerDeleteOwnUserData
2200
+ ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
2201
+ return __request(OpenAPI, {
2202
+ method: 'DELETE',
2203
+ url: '/api/v1/users',
2204
+ body: data.requestBody,
2205
+ mediaType: 'application/json',
2206
+ errors: {
2207
+ 403: 'Invalid access token'
2208
+ }
2209
+ });
2210
+ }
2211
+
2212
+ /**
2213
+ * Get current authenticated user
2214
+ * @param data The data for the request.
2215
+ * @param data.acceptLanguage
2216
+ * @returns unknown User retrieved successfully
2217
+ * @throws ApiError
2218
+ */
2219
+ public static userControllerGetUser(
2220
+ data: UserControllerGetUserData
2221
+ ): CancelablePromise<UserControllerGetUserResponse> {
2222
+ return __request(OpenAPI, {
2223
+ method: 'GET',
2224
+ url: '/api/v1/users',
2225
+ headers: {
2226
+ 'accept-language': data.acceptLanguage
2227
+ }
2228
+ });
2229
+ }
2230
+
2231
+ /**
2232
+ * Sign up new user
2233
+ * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2234
+ * @param data The data for the request.
2235
+ * @param data.requestBody
2236
+ * @returns unknown User created successfully
2237
+ * @throws ApiError
2238
+ */
2239
+ public static userControllerSignupUser(
2240
+ data: UserControllerSignupUserData
2241
+ ): CancelablePromise<UserControllerSignupUserResponse> {
2242
+ return __request(OpenAPI, {
2243
+ method: 'POST',
2244
+ url: '/api/v1/users',
2245
+ body: data.requestBody,
2246
+ mediaType: 'application/json',
2247
+ errors: {
2248
+ 400: 'Invalid Turnstile token (when Turnstile is enabled)',
2249
+ 403: 'User signup is disabled'
2250
+ }
2251
+ });
2252
+ }
2253
+
2254
+ /**
2255
+ * Delete user by ID (admin only)
2256
+ * @param data The data for the request.
2257
+ * @param data.id User ID to delete
2258
+ * @returns void User deleted successfully
2259
+ * @throws ApiError
2260
+ */
2261
+ public static userControllerDeleteUser(
2262
+ data: UserControllerDeleteUserData
2263
+ ): CancelablePromise<UserControllerDeleteUserResponse> {
2264
+ return __request(OpenAPI, {
2265
+ method: 'DELETE',
2266
+ url: '/api/v1/users/{id}',
2267
+ path: {
2268
+ id: data.id
2269
+ },
2270
+ errors: {
2271
+ 403: 'Cannot delete own account or insufficient permissions'
2272
+ }
2273
+ });
2274
+ }
2275
+
2276
+ /**
2277
+ * Get user info by user ID
2278
+ * @param data The data for the request.
2279
+ * @param data.id User ID
2280
+ * @returns unknown User info retrieved successfully
2281
+ * @throws ApiError
2282
+ */
2283
+ public static userControllerGetUserInfo(
2284
+ data: UserControllerGetUserInfoData
2285
+ ): CancelablePromise<UserControllerGetUserInfoResponse> {
2286
+ return __request(OpenAPI, {
2287
+ method: 'GET',
2288
+ url: '/api/v1/users/{id}/info',
2289
+ path: {
2290
+ id: data.id
2291
+ },
2292
+ errors: {
2293
+ 403: 'Cannot access other user info without admin permission'
2294
+ }
2295
+ });
2296
+ }
2297
+
2298
+ /**
2299
+ * Update user settings
2300
+ * @param data The data for the request.
2301
+ * @param data.requestBody
2302
+ * @returns unknown Settings updated successfully
2303
+ * @throws ApiError
2304
+ */
2305
+ public static userControllerUpdateUserSetting(
2306
+ data: UserControllerUpdateUserSettingData
2307
+ ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
2308
+ return __request(OpenAPI, {
2309
+ method: 'PUT',
2310
+ url: '/api/v1/users/setting',
2311
+ body: data.requestBody,
2312
+ mediaType: 'application/json',
2313
+ errors: {
2314
+ 403: 'Insufficient permissions'
2315
+ }
2316
+ });
2317
+ }
2318
+
2319
+ /**
2320
+ * Get all user settings paginated (admin only)
2321
+ * @param data The data for the request.
2322
+ * @param data.pageNo Page number
2323
+ * @param data.pageSize Page size
2324
+ * @returns unknown Settings list retrieved successfully
2325
+ * @throws ApiError
2326
+ */
2327
+ public static userControllerGetAllUserSettingsByPage(
2328
+ data: UserControllerGetAllUserSettingsByPageData
2329
+ ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
2330
+ return __request(OpenAPI, {
2331
+ method: 'GET',
2332
+ url: '/api/v1/users/settings-by-page',
2333
+ query: {
2334
+ pageNo: data.pageNo,
2335
+ pageSize: data.pageSize
2336
+ }
2337
+ });
2338
+ }
2339
+
2340
+ /**
2341
+ * Get asset and liability summary for current user
2342
+ * @returns unknown Summary retrieved successfully
2343
+ * @throws ApiError
2344
+ */
2345
+ public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
2346
+ return __request(OpenAPI, {
2347
+ method: 'GET',
2348
+ url: '/api/v1/users/asset-liability-summary'
2349
+ });
2350
+ }
2351
+ }
2352
+
2353
+ export class PropertiesService {
2354
+ /**
2355
+ * Get all system properties
2356
+ * @returns unknown Properties retrieved successfully
2357
+ * @throws ApiError
2358
+ */
2359
+ public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
2360
+ return __request(OpenAPI, {
2361
+ method: 'GET',
2362
+ url: '/api/v1/admin/properties',
2363
+ errors: {
2364
+ 401: 'Unauthorized',
2365
+ 403: 'Forbidden - insufficient permissions'
2366
+ }
2367
+ });
2368
+ }
2369
+
2370
+ /**
2371
+ * Get property by key
2372
+ * @param data The data for the request.
2373
+ * @param data.key Property key
2374
+ * @returns unknown Property retrieved successfully
2375
+ * @throws ApiError
2376
+ */
2377
+ public static propertyControllerGetByKey(
2378
+ data: PropertyControllerGetByKeyData
2379
+ ): CancelablePromise<PropertyControllerGetByKeyResponse> {
2380
+ return __request(OpenAPI, {
2381
+ method: 'GET',
2382
+ url: '/api/v1/admin/properties/{key}',
2383
+ path: {
2384
+ key: data.key
2385
+ },
2386
+ errors: {
2387
+ 401: 'Unauthorized',
2388
+ 403: 'Forbidden - insufficient permissions',
2389
+ 404: 'Property not found'
2390
+ }
2391
+ });
2392
+ }
2393
+
2394
+ /**
2395
+ * Update a system property
2396
+ * @param data The data for the request.
2397
+ * @param data.key Property key
2398
+ * @param data.requestBody
2399
+ * @returns unknown Property updated successfully
2400
+ * @throws ApiError
2401
+ */
2402
+ public static propertyControllerUpdate(
2403
+ data: PropertyControllerUpdateData
2404
+ ): CancelablePromise<PropertyControllerUpdateResponse> {
2405
+ return __request(OpenAPI, {
2406
+ method: 'PUT',
2407
+ url: '/api/v1/admin/properties/{key}',
2408
+ path: {
2409
+ key: data.key
2410
+ },
2411
+ body: data.requestBody,
2412
+ mediaType: 'application/json',
2413
+ errors: {
2414
+ 401: 'Unauthorized',
2415
+ 403: 'Forbidden - insufficient permissions'
2416
+ }
2417
+ });
2418
+ }
2419
+
2420
+ /**
2421
+ * Delete a system property
2422
+ * @param data The data for the request.
2423
+ * @param data.key Property key
2424
+ * @returns void Property deleted successfully
2425
+ * @throws ApiError
2426
+ */
2427
+ public static propertyControllerDelete(
2428
+ data: PropertyControllerDeleteData
2429
+ ): CancelablePromise<PropertyControllerDeleteResponse> {
2430
+ return __request(OpenAPI, {
2431
+ method: 'DELETE',
2432
+ url: '/api/v1/admin/properties/{key}',
2433
+ path: {
2434
+ key: data.key
2435
+ },
2436
+ errors: {
2437
+ 401: 'Unauthorized',
2438
+ 403: 'Forbidden - insufficient permissions',
2439
+ 404: 'Property not found'
2440
+ }
2441
+ });
2442
+ }
2443
+ }
2444
+
2445
+ export class BeanExportService {
2446
+ /**
2447
+ * Export Beancount ledger as ZIP
2448
+ * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
2449
+ * @returns unknown
2450
+ * @throws ApiError
2451
+ */
2452
+ public static exportControllerExportBeancount(): CancelablePromise<ExportControllerExportBeancountResponse> {
2453
+ return __request(OpenAPI, {
2454
+ method: 'GET',
2455
+ url: '/api/v1/{region}/bean/export/beancount'
2456
+ });
2457
+ }
2458
+ }
2459
+
2460
+ export class BeanImportService {
2461
+ /**
2462
+ * Import a bill file
2463
+ * 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).
2464
+ * @param data The data for the request.
2465
+ * @param data.region Region code for tenant context
2466
+ * @param data.formData Bill file to import
2467
+ * @returns ImportResultDto File imported successfully
2468
+ * @throws ApiError
2469
+ */
2470
+ public static fileImportControllerImportFile(
2471
+ data: FileImportControllerImportFileData
2472
+ ): CancelablePromise<FileImportControllerImportFileResponse> {
2473
+ return __request(OpenAPI, {
2474
+ method: 'POST',
2475
+ url: '/api/v1/{region}/bean/import/file',
2476
+ path: {
2477
+ region: data.region
2478
+ },
2479
+ formData: data.formData,
2480
+ mediaType: 'multipart/form-data',
2481
+ errors: {
2482
+ 400: 'Bad request - file-format-unsupported or file-import-failed',
2483
+ 413: 'Payload too large - file exceeds 50MB limit',
2484
+ 429: 'Too many requests - user already has import in progress',
2485
+ 500: 'Internal server error - DATABASE_ERROR'
2486
+ }
2487
+ });
2488
+ }
2489
+
2490
+ /**
2491
+ * Identify file type
2492
+ * 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.
2493
+ * @param data The data for the request.
2494
+ * @param data.region Region code for tenant context
2495
+ * @param data.formData File to identify
2496
+ * @returns IdentifyResultDto File identification result
2497
+ * @throws ApiError
2498
+ */
2499
+ public static fileImportControllerIdentifyFile(
2500
+ data: FileImportControllerIdentifyFileData
2501
+ ): CancelablePromise<FileImportControllerIdentifyFileResponse> {
2502
+ return __request(OpenAPI, {
2503
+ method: 'POST',
2504
+ url: '/api/v1/{region}/bean/import/identify',
2505
+ path: {
2506
+ region: data.region
2507
+ },
2508
+ formData: data.formData,
2509
+ mediaType: 'multipart/form-data',
2510
+ errors: {
2511
+ 400: 'Bad request - No file uploaded'
2512
+ }
2513
+ });
2514
+ }
2515
+
2516
+ /**
2517
+ * Import a Beancount file in community format
2518
+ * 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.
2519
+ * @param data The data for the request.
2520
+ * @param data.region Region code for tenant context
2521
+ * @param data.formData Beancount file to import
2522
+ * @returns unknown Beancount file imported successfully
2523
+ * @throws ApiError
2524
+ */
2525
+ public static fileImportControllerImportBeancount(
2526
+ data: FileImportControllerImportBeancountData
2527
+ ): CancelablePromise<FileImportControllerImportBeancountResponse> {
2528
+ return __request(OpenAPI, {
2529
+ method: 'POST',
2530
+ url: '/api/v1/{region}/bean/import/beancount',
2531
+ path: {
2532
+ region: data.region
2533
+ },
2534
+ formData: data.formData,
2535
+ mediaType: 'multipart/form-data',
2536
+ errors: {
2537
+ 400: 'Bad request - invalid file or no file uploaded'
2538
+ }
2539
+ });
2540
+ }
2541
+
2542
+ /**
2543
+ * Get importer configuration
2544
+ * Returns the current configuration for the specified importer. Creates default configuration if none exists.
2545
+ * @param data The data for the request.
2546
+ * @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
2547
+ * @param data.region Region code for tenant context
2548
+ * @returns ImporterConfigDto Configuration retrieved successfully
2549
+ * @throws ApiError
2550
+ */
2551
+ public static importerConfigControllerGetConfig(
2552
+ data: ImporterConfigControllerGetConfigData
2553
+ ): CancelablePromise<ImporterConfigControllerGetConfigResponse> {
2554
+ return __request(OpenAPI, {
2555
+ method: 'GET',
2556
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
2557
+ path: {
2558
+ importerId: data.importerId,
2559
+ region: data.region
2560
+ },
2561
+ errors: {
2562
+ 400: 'Invalid input - Unsupported importer',
2563
+ 401: 'Unauthorized - Authentication required'
2564
+ }
2565
+ });
2566
+ }
2567
+
2568
+ /**
2569
+ * Update importer configuration
2570
+ * Updates the configuration for the specified importer. Partial updates are supported.
2571
+ * @param data The data for the request.
2572
+ * @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
2573
+ * @param data.region Region code for tenant context
2574
+ * @param data.requestBody Partial configuration update. Only provided fields will be updated.
2575
+ * @returns ImporterConfigDto Configuration updated successfully
2576
+ * @throws ApiError
2577
+ */
2578
+ public static importerConfigControllerUpdateConfig(
2579
+ data: ImporterConfigControllerUpdateConfigData
2580
+ ): CancelablePromise<ImporterConfigControllerUpdateConfigResponse> {
2581
+ return __request(OpenAPI, {
2582
+ method: 'PUT',
2583
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
2584
+ path: {
2585
+ importerId: data.importerId,
2586
+ region: data.region
2587
+ },
2588
+ body: data.requestBody,
2589
+ mediaType: 'application/json',
2590
+ errors: {
2591
+ 400: 'Invalid input - Validation failed',
2592
+ 404: 'Configuration not found'
2593
+ }
2594
+ });
2595
+ }
2596
+
2597
+ /**
2598
+ * Reset configuration to default
2599
+ * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
2600
+ * @param data The data for the request.
2601
+ * @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
2602
+ * @param data.region Region code for tenant context
2603
+ * @returns ImporterConfigDto Configuration reset successfully
2604
+ * @throws ApiError
2605
+ */
2606
+ public static importerConfigControllerResetConfig(
2607
+ data: ImporterConfigControllerResetConfigData
2608
+ ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
2609
+ return __request(OpenAPI, {
2610
+ method: 'POST',
2611
+ url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
2612
+ path: {
2613
+ importerId: data.importerId,
2614
+ region: data.region
2615
+ },
2616
+ errors: {
2617
+ 400: 'Invalid input - Unsupported importer'
2618
+ }
2619
+ });
2620
+ }
2621
+ }
2622
+
2623
+ export class BeanPlatformsService {
2624
+ /**
2625
+ * Get all platforms with statistics
2626
+ * @returns unknown List of platforms with binding and account counts
2627
+ * @throws ApiError
2628
+ */
2629
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
2630
+ return __request(OpenAPI, {
2631
+ method: 'GET',
2632
+ url: '/api/v1/bean/platforms'
2633
+ });
2634
+ }
2635
+
2636
+ /**
2637
+ * Create a new platform
2638
+ * @param data The data for the request.
2639
+ * @param data.requestBody
2640
+ * @returns unknown Platform created successfully
2641
+ * @throws ApiError
2642
+ */
2643
+ public static platformControllerCreate(
2644
+ data: PlatformControllerCreateData
2645
+ ): CancelablePromise<PlatformControllerCreateResponse> {
2646
+ return __request(OpenAPI, {
2647
+ method: 'POST',
2648
+ url: '/api/v1/bean/platforms',
2649
+ body: data.requestBody,
2650
+ mediaType: 'application/json',
2651
+ errors: {
2652
+ 409: 'Platform already exists'
2653
+ }
2654
+ });
2655
+ }
2656
+
2657
+ /**
2658
+ * Get platform list for current user
2659
+ * @returns unknown List of platforms with user binding status
2660
+ * @throws ApiError
2661
+ */
2662
+ public static platformControllerGetPlatformList(): CancelablePromise<PlatformControllerGetPlatformListResponse> {
2663
+ return __request(OpenAPI, {
2664
+ method: 'GET',
2665
+ url: '/api/v1/bean/platforms/list'
2666
+ });
2667
+ }
2668
+
2669
+ /**
2670
+ * Match platforms by name or alias
2671
+ * @param data The data for the request.
2672
+ * @param data.q Search query — Chinese name, English name, or abbreviation
2673
+ * @param data.region Region code for category override lookup
2674
+ * @returns unknown List of matching platforms with suggested segment names
2675
+ * @throws ApiError
2676
+ */
2677
+ public static platformControllerMatchPlatforms(
2678
+ data: PlatformControllerMatchPlatformsData
2679
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
2680
+ return __request(OpenAPI, {
2681
+ method: 'GET',
2682
+ url: '/api/v1/bean/platforms/match',
2683
+ query: {
2684
+ q: data.q,
2685
+ region: data.region
2686
+ }
2687
+ });
2688
+ }
2689
+
2690
+ /**
2691
+ * Update a platform
2692
+ * @param data The data for the request.
2693
+ * @param data.id Platform ID
2694
+ * @param data.requestBody
2695
+ * @returns unknown Platform updated successfully
2696
+ * @throws ApiError
2697
+ */
2698
+ public static platformControllerUpdate(
2699
+ data: PlatformControllerUpdateData
2700
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
2701
+ return __request(OpenAPI, {
2702
+ method: 'PUT',
2703
+ url: '/api/v1/bean/platforms/{id}',
2704
+ path: {
2705
+ id: data.id
2706
+ },
2707
+ body: data.requestBody,
2708
+ mediaType: 'application/json',
2709
+ errors: {
2710
+ 404: 'Platform not found'
2711
+ }
2712
+ });
2713
+ }
2714
+
2715
+ /**
2716
+ * Delete a platform
2717
+ * @param data The data for the request.
2718
+ * @param data.id Platform ID
2719
+ * @returns void Platform deleted successfully
2720
+ * @throws ApiError
2721
+ */
2722
+ public static platformControllerDelete(
2723
+ data: PlatformControllerDeleteData
2724
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
2725
+ return __request(OpenAPI, {
2726
+ method: 'DELETE',
2727
+ url: '/api/v1/bean/platforms/{id}',
2728
+ path: {
2729
+ id: data.id
2730
+ },
2731
+ errors: {
2732
+ 404: 'Platform not found'
2733
+ }
2734
+ });
2735
+ }
2736
+ }
2737
+
2738
+ export class ProviderSyncService {
2739
+ /**
2740
+ * Sync transactions from financial data provider
2741
+ *
2742
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
2743
+ *
2744
+ * **Supported Providers:**
2745
+ * - **plaid**: Plaid API (US, Canada, Europe)
2746
+ * - **teller**: Teller API (US)
2747
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
2748
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
2749
+ * - **simplefin**: SimpleFIN (Self-hosted)
2750
+ * - **yodlee**: Yodlee (Global)
2751
+ * - **beancount-direct**: Beancount format transactions
2752
+ * - **parsed-bill**: Client-side parsed bill transactions
2753
+ *
2754
+ * **Processing Flow:**
2755
+ * 1. Transform raw data via provider adapter
2756
+ * 2. Validate transaction format
2757
+ * 3. Deduplicate using originalId
2758
+ * 4. Classify using rule engine
2759
+ * 5. Route low-confidence to Review Center
2760
+ * 6. Persist validated transactions
2761
+ *
2762
+ * @param data The data for the request.
2763
+ * @param data.providerName Provider name
2764
+ * @param data.region Region code
2765
+ * @param data.requestBody
2766
+ * @returns ProviderSyncResponseDto Sync completed successfully
2767
+ * @throws ApiError
2768
+ */
2769
+ public static providerSyncControllerSync(
2770
+ data: ProviderSyncControllerSyncData
2771
+ ): CancelablePromise<ProviderSyncControllerSyncResponse> {
2772
+ return __request(OpenAPI, {
2773
+ method: 'POST',
2774
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
2775
+ path: {
2776
+ providerName: data.providerName,
2777
+ region: data.region
2778
+ },
2779
+ body: data.requestBody,
2780
+ mediaType: 'application/json',
2781
+ errors: {
2782
+ 400: 'Invalid request data',
2783
+ 401: 'Missing or invalid authentication',
2784
+ 404: 'Provider not supported'
2785
+ }
2786
+ });
2787
+ }
2788
+
2789
+ /**
2790
+ * Get supported providers
2791
+ * Returns a list of all providers supported by the sync endpoint.
2792
+ * @param data The data for the request.
2793
+ * @param data.region Region code for tenant context
2794
+ * @returns SupportedProvidersResponseDto List of supported providers
2795
+ * @throws ApiError
2796
+ */
2797
+ public static providerSyncControllerGetSupportedProviders(
2798
+ data: ProviderSyncControllerGetSupportedProvidersData
2799
+ ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
2800
+ return __request(OpenAPI, {
2801
+ method: 'GET',
2802
+ url: '/api/v1/{region}/bean/import/provider/supported',
2803
+ path: {
2804
+ region: data.region
2805
+ },
2806
+ errors: {
2807
+ 401: 'Missing or invalid authentication'
2808
+ }
2809
+ });
2810
+ }
2811
+
2812
+ /**
2813
+ * Check if provider is supported
2814
+ * Returns whether a specific provider is supported.
2815
+ * @param data The data for the request.
2816
+ * @param data.providerName Provider name to check
2817
+ * @param data.region Region code for tenant context
2818
+ * @returns unknown Provider support status
2819
+ * @throws ApiError
2820
+ */
2821
+ public static providerSyncControllerIsProviderSupported(
2822
+ data: ProviderSyncControllerIsProviderSupportedData
2823
+ ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
2824
+ return __request(OpenAPI, {
2825
+ method: 'GET',
2826
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
2827
+ path: {
2828
+ providerName: data.providerName,
2829
+ region: data.region
2830
+ },
2831
+ errors: {
2832
+ 401: 'Missing or invalid authentication'
2833
+ }
2834
+ });
2835
+ }
2836
+ }
2837
+
2838
+ export class ImportTelemetryService {
2839
+ /**
2840
+ * Receive anonymous parser failure telemetry
2841
+ * @param data The data for the request.
2842
+ * @param data.region Region code for tenant context
2843
+ * @param data.requestBody
2844
+ * @returns unknown Telemetry report received
2845
+ * @throws ApiError
2846
+ */
2847
+ public static telemetryControllerReportTelemetry(
2848
+ data: TelemetryControllerReportTelemetryData
2849
+ ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
2850
+ return __request(OpenAPI, {
2851
+ method: 'POST',
2852
+ url: '/api/v1/{region}/bean/import/parser-telemetry',
2853
+ path: {
2854
+ region: data.region
2855
+ },
2856
+ body: data.requestBody,
2857
+ mediaType: 'application/json',
2858
+ errors: {
2859
+ 401: 'Unauthorized'
2860
+ }
2861
+ });
2862
+ }
2863
+ }
2864
+
2865
+ export class BeanNlpService {
2866
+ /**
2867
+ * Process natural language input
2868
+ * 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"
2869
+ * @param data The data for the request.
2870
+ * @param data.region Region code for tenant context
2871
+ * @param data.requestBody Natural language transaction input with optional session ID
2872
+ * @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
2873
+ * @throws ApiError
2874
+ */
2875
+ public static nlpControllerProcessNaturalLanguage(
2876
+ data: NlpControllerProcessNaturalLanguageData
2877
+ ): CancelablePromise<NlpControllerProcessNaturalLanguageResponse> {
2878
+ return __request(OpenAPI, {
2879
+ method: 'POST',
2880
+ url: '/api/v1/{region}/bean/nlp/process',
2881
+ path: {
2882
+ region: data.region
2883
+ },
2884
+ body: data.requestBody,
2885
+ mediaType: 'application/json',
2886
+ errors: {
2887
+ 400: 'Invalid input',
2888
+ 401: 'Unauthorized'
2889
+ }
2890
+ });
2891
+ }
2892
+
2893
+ /**
2894
+ * Clear dialogue session
2895
+ * Clear the current NLP dialogue session. Use this to cancel an ongoing multi-turn dialogue.
2896
+ * @param data The data for the request.
2897
+ * @param data.region Region code for tenant context
2898
+ * @param data.sessionId Specific session ID to clear (defaults to user session)
2899
+ * @returns void Session cleared successfully
2900
+ * @throws ApiError
2901
+ */
2902
+ public static nlpControllerClearSession(
2903
+ data: NlpControllerClearSessionData
2904
+ ): CancelablePromise<NlpControllerClearSessionResponse> {
2905
+ return __request(OpenAPI, {
2906
+ method: 'DELETE',
2907
+ url: '/api/v1/{region}/bean/nlp/session',
2908
+ path: {
2909
+ region: data.region
2910
+ },
2911
+ query: {
2912
+ sessionId: data.sessionId
2913
+ },
2914
+ errors: {
2915
+ 401: 'Unauthorized'
2916
+ }
2917
+ });
2918
+ }
2919
+
2920
+ /**
2921
+ * Get current session state
2922
+ * Get the current NLP dialogue session state. Useful for debugging and displaying session context in UI.
2923
+ * @param data The data for the request.
2924
+ * @param data.region Region code for tenant context
2925
+ * @param data.sessionId Specific session ID to get (defaults to user session)
2926
+ * @returns unknown Current session state (or null if no active session)
2927
+ * @throws ApiError
2928
+ */
2929
+ public static nlpControllerGetSession(
2930
+ data: NlpControllerGetSessionData
2931
+ ): CancelablePromise<NlpControllerGetSessionResponse> {
2932
+ return __request(OpenAPI, {
2933
+ method: 'GET',
2934
+ url: '/api/v1/{region}/bean/nlp/session',
2935
+ path: {
2936
+ region: data.region
2937
+ },
2938
+ query: {
2939
+ sessionId: data.sessionId
2940
+ },
2941
+ errors: {
2942
+ 401: 'Unauthorized'
2943
+ }
2944
+ });
2945
+ }
2946
+ }
2947
+
2948
+ export class DashboardService {
2949
+ /**
2950
+ * Get net worth overview
2951
+ * Returns total net worth with breakdown of assets and liabilities
2952
+ * @param data The data for the request.
2953
+ * @param data.region Region code for tenant context
2954
+ * @param data.date Date for balance calculation (ISO 8601 format)
2955
+ * @returns NetWorthResponseDto Net worth retrieved successfully
2956
+ * @throws ApiError
2957
+ */
2958
+ public static dashboardControllerGetNetWorth(
2959
+ data: DashboardControllerGetNetWorthData
2960
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
2961
+ return __request(OpenAPI, {
2962
+ method: 'GET',
2963
+ url: '/api/v1/{region}/dashboard/net-worth',
2964
+ path: {
2965
+ region: data.region
2966
+ },
2967
+ query: {
2968
+ date: data.date
2969
+ },
2970
+ errors: {
2971
+ 401: 'User not authenticated'
2972
+ }
2973
+ });
2974
+ }
2975
+
2976
+ /**
2977
+ * Get accounts grouped by platform
2978
+ * Returns accounts with balances grouped by financial platform
2979
+ * @param data The data for the request.
2980
+ * @param data.region Region code for tenant context
2981
+ * @param data.groupBy Grouping strategy
2982
+ * @param data.date Date for balance calculation (ISO 8601 format)
2983
+ * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
2984
+ * @throws ApiError
2985
+ */
2986
+ public static dashboardControllerGetAccounts(
2987
+ data: DashboardControllerGetAccountsData
2988
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
2989
+ return __request(OpenAPI, {
2990
+ method: 'GET',
2991
+ url: '/api/v1/{region}/dashboard/accounts',
2992
+ path: {
2993
+ region: data.region
2994
+ },
2995
+ query: {
2996
+ groupBy: data.groupBy,
2997
+ date: data.date
2998
+ },
2999
+ errors: {
3000
+ 401: 'User not authenticated'
3001
+ }
3002
+ });
3003
+ }
3004
+
3005
+ /**
3006
+ * Get cash flow summary
3007
+ * Returns income, expenses, and savings for a monthly period
3008
+ * @param data The data for the request.
3009
+ * @param data.period Period in YYYY-MM format
3010
+ * @param data.region Region code for tenant context
3011
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3012
+ * @throws ApiError
3013
+ */
3014
+ public static dashboardControllerGetCashFlow(
3015
+ data: DashboardControllerGetCashFlowData
3016
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3017
+ return __request(OpenAPI, {
3018
+ method: 'GET',
3019
+ url: '/api/v1/{region}/dashboard/cash-flow',
3020
+ path: {
3021
+ region: data.region
3022
+ },
3023
+ query: {
3024
+ period: data.period
3025
+ },
3026
+ errors: {
3027
+ 400: 'Invalid period format',
3028
+ 401: 'User not authenticated'
3029
+ }
3030
+ });
3031
+ }
3032
+ }
3033
+
3034
+ export class ReportingService {
3035
+ /**
3036
+ * Get portfolio value trends
3037
+ *
3038
+ * Returns time series data of portfolio net worth.
3039
+ *
3040
+ * **Multi-currency Support:**
3041
+ * - `series[].byCurrency` - Currency breakdown for each data point
3042
+ * - `byCurrency` - Separate time series grouped by currency
3043
+ * - `warnings` - Exchange rate warnings if conversion failed
3044
+ *
3045
+ * **Parameters:**
3046
+ * - `period`: Time period (1m, 3m, 6m, 1y)
3047
+ * - `granularity`: Data granularity (day, week, month)
3048
+ *
3049
+ * @param data The data for the request.
3050
+ * @param data.region Region code for tenant context
3051
+ * @param data.period Time period
3052
+ * @param data.granularity Data granularity
3053
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
3054
+ * @throws ApiError
3055
+ */
3056
+ public static reportingControllerGetPortfolioTrends(
3057
+ data: ReportingControllerGetPortfolioTrendsData
3058
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
3059
+ return __request(OpenAPI, {
3060
+ method: 'GET',
3061
+ url: '/api/v1/{region}/reporting/portfolio/trends',
3062
+ path: {
3063
+ region: data.region
3064
+ },
3065
+ query: {
3066
+ period: data.period,
3067
+ granularity: data.granularity
3068
+ },
3069
+ errors: {
3070
+ 401: 'User not authenticated'
3071
+ }
3072
+ });
3073
+ }
3074
+
3075
+ /**
3076
+ * Generate portfolio snapshot
3077
+ *
3078
+ * Manually generate a portfolio snapshot for a specific date.
3079
+ *
3080
+ * **Multi-currency Support:**
3081
+ * - Fetches balances grouped by currency
3082
+ * - Uses user's baseCurrency setting for conversion
3083
+ * - Stores exchange rates and warnings
3084
+ *
3085
+ * **Use Cases:**
3086
+ * - Testing snapshot generation
3087
+ * - Force regeneration after data correction
3088
+ * - Initial setup for new users
3089
+ *
3090
+ * @param data The data for the request.
3091
+ * @param data.region Region code for tenant context
3092
+ * @param data.requestBody Optional date (defaults to today)
3093
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
3094
+ * @throws ApiError
3095
+ */
3096
+ public static reportingControllerGenerateSnapshot(
3097
+ data: ReportingControllerGenerateSnapshotData
3098
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
3099
+ return __request(OpenAPI, {
3100
+ method: 'POST',
3101
+ url: '/api/v1/{region}/reporting/snapshots/generate',
3102
+ path: {
3103
+ region: data.region
3104
+ },
3105
+ body: data.requestBody,
3106
+ mediaType: 'application/json',
3107
+ errors: {
3108
+ 400: 'Invalid date format',
3109
+ 401: 'User not authenticated'
3110
+ }
3111
+ });
3112
+ }
3113
+
3114
+ /**
3115
+ * Backfill portfolio snapshots
3116
+ *
3117
+ * Generate snapshots for a date range (historical data backfill).
3118
+ *
3119
+ * **Multi-currency Support:**
3120
+ * - Each snapshot includes multi-currency data
3121
+ * - Uses exchange rates available at generation time
3122
+ * - Warnings stored for missing exchange rates
3123
+ *
3124
+ * **Best Practices:**
3125
+ * - Use for initial setup after account configuration
3126
+ * - Run during low-traffic periods for large date ranges
3127
+ * - Existing snapshots are skipped (not regenerated)
3128
+ *
3129
+ * @param data The data for the request.
3130
+ * @param data.region Region code for tenant context
3131
+ * @param data.requestBody
3132
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
3133
+ * @throws ApiError
3134
+ */
3135
+ public static reportingControllerBackfillSnapshots(
3136
+ data: ReportingControllerBackfillSnapshotsData
3137
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
3138
+ return __request(OpenAPI, {
3139
+ method: 'POST',
3140
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
3141
+ path: {
3142
+ region: data.region
3143
+ },
3144
+ body: data.requestBody,
3145
+ mediaType: 'application/json',
3146
+ errors: {
3147
+ 400: 'Invalid date format or range',
3148
+ 401: 'User not authenticated',
3149
+ 409: 'Backfill already in progress for this user'
3150
+ }
3151
+ });
3152
+ }
3153
+ }
3154
+
3155
+ export class ApiKeysService {
3156
+ /**
3157
+ * Create API key
3158
+ * Generates a new API key for the authenticated user
3159
+ * @returns unknown API key created successfully
3160
+ * @throws ApiError
3161
+ */
3162
+ public static apiKeysControllerCreateApiKey(): CancelablePromise<ApiKeysControllerCreateApiKeyResponse> {
3163
+ return __request(OpenAPI, {
3164
+ method: 'POST',
3165
+ url: '/api/v1/auth/api-keys',
3166
+ errors: {
3167
+ 403: 'Insufficient permissions to create API key'
3168
+ }
3169
+ });
3170
+ }
3171
+ }
3172
+
3173
+ export class AuthService {
3174
+ /**
3175
+ * Anonymous login with access token
3176
+ * @param data The data for the request.
3177
+ * @param data.requestBody
3178
+ * @returns unknown Login successful
3179
+ * @throws ApiError
3180
+ */
3181
+ public static authControllerAccessTokenLogin(
3182
+ data: AuthControllerAccessTokenLoginData
3183
+ ): CancelablePromise<AuthControllerAccessTokenLoginResponse> {
3184
+ return __request(OpenAPI, {
3185
+ method: 'POST',
3186
+ url: '/api/v1/auth/sessions/anonymous',
3187
+ body: data.requestBody,
3188
+ mediaType: 'application/json',
3189
+ errors: {
3190
+ 401: 'Invalid access token'
3191
+ }
3192
+ });
3193
+ }
3194
+ }
3195
+
3196
+ export class DefaultService {
3197
+ /**
3198
+ * @returns unknown
3199
+ * @throws ApiError
3200
+ */
3201
+ public static cacheControllerFlushCache(): CancelablePromise<CacheControllerFlushCacheResponse> {
3202
+ return __request(OpenAPI, {
3203
+ method: 'POST',
3204
+ url: '/api/v1/cache/flush'
3205
+ });
3206
+ }
3207
+ }
3208
+
3209
+ export class ExchangeRateService {
3210
+ /**
3211
+ * Get exchange rate for currency pair
3212
+ * Retrieves historical exchange rate for a specific date and currency pair
3213
+ * @param data The data for the request.
3214
+ * @param data.symbol Currency pair symbol (e.g., USDCNY, EURUSD)
3215
+ * @param data.dateString Date in ISO format (YYYY-MM-DD)
3216
+ * @returns unknown Exchange rate retrieved successfully
3217
+ * @throws ApiError
3218
+ */
3219
+ public static exchangeRateControllerGetExchangeRate(
3220
+ data: ExchangeRateControllerGetExchangeRateData
3221
+ ): CancelablePromise<ExchangeRateControllerGetExchangeRateResponse> {
3222
+ return __request(OpenAPI, {
3223
+ method: 'GET',
3224
+ url: '/api/v1/market/exchange-rates/{symbol}/{dateString}',
3225
+ path: {
3226
+ symbol: data.symbol,
3227
+ dateString: data.dateString
3228
+ },
3229
+ errors: {
3230
+ 404: 'Exchange rate not found for the specified currency pair and date'
3231
+ }
3232
+ });
3233
+ }
3234
+ }
3235
+
3236
+ export class HealthService {
3237
+ /**
3238
+ * Basic health check for K8s/load balancer probes
3239
+ * @returns unknown Service is healthy
3240
+ * @throws ApiError
3241
+ */
3242
+ public static healthControllerGetHealth(): CancelablePromise<HealthControllerGetHealthResponse> {
3243
+ return __request(OpenAPI, {
3244
+ method: 'GET',
3245
+ url: '/api/v1/health',
3246
+ errors: {
3247
+ 503: 'Service unavailable'
3248
+ }
3249
+ });
3250
+ }
3251
+
3252
+ /**
3253
+ * Check database connection health
3254
+ * @returns unknown Database is healthy
3255
+ * @throws ApiError
3256
+ */
3257
+ public static healthControllerCheckDatabase(): CancelablePromise<HealthControllerCheckDatabaseResponse> {
3258
+ return __request(OpenAPI, {
3259
+ method: 'GET',
3260
+ url: '/api/v1/health/database',
3261
+ errors: {
3262
+ 503: 'Database unavailable'
3263
+ }
3264
+ });
3265
+ }
3266
+
3267
+ /**
3268
+ * Check OpenBB schema status
3269
+ * @returns unknown OpenBB status
3270
+ * @throws ApiError
3271
+ */
3272
+ public static healthControllerCheckOpenBb(): CancelablePromise<HealthControllerCheckOpenBbResponse> {
3273
+ return __request(OpenAPI, {
3274
+ method: 'GET',
3275
+ url: '/api/v1/health/openbb',
3276
+ errors: {
3277
+ 503: 'OpenBB unavailable'
3278
+ }
3279
+ });
3280
+ }
3281
+
3282
+ /**
3283
+ * Check Redis connection health
3284
+ * @returns unknown Redis is healthy
3285
+ * @throws ApiError
3286
+ */
3287
+ public static healthControllerCheckRedis(): CancelablePromise<HealthControllerCheckRedisResponse> {
3288
+ return __request(OpenAPI, {
3289
+ method: 'GET',
3290
+ url: '/api/v1/health/redis',
3291
+ errors: {
3292
+ 503: 'Redis unavailable'
3293
+ }
3294
+ });
3295
+ }
3296
+
3297
+ /**
3298
+ * Get status of all circuit breakers
3299
+ * @returns unknown Circuit breaker status
3300
+ * @throws ApiError
3301
+ */
3302
+ public static healthControllerGetCircuitBreakersHealth(): CancelablePromise<HealthControllerGetCircuitBreakersHealthResponse> {
3303
+ return __request(OpenAPI, {
3304
+ method: 'GET',
3305
+ url: '/api/v1/health/circuit-breakers',
3306
+ errors: {
3307
+ 401: 'Unauthorized',
3308
+ 500: 'Internal error'
3309
+ }
3310
+ });
3311
+ }
3312
+
3313
+ /**
3314
+ * Reset a circuit breaker to CLOSED state
3315
+ * @param data The data for the request.
3316
+ * @param data.name Circuit breaker name to reset
3317
+ * @returns unknown Circuit breaker reset successfully
3318
+ * @throws ApiError
3319
+ */
3320
+ public static healthControllerResetCircuitBreaker(
3321
+ data: HealthControllerResetCircuitBreakerData
3322
+ ): CancelablePromise<HealthControllerResetCircuitBreakerResponse> {
3323
+ return __request(OpenAPI, {
3324
+ method: 'POST',
3325
+ url: '/api/v1/health/circuit-breakers/{name}/reset',
3326
+ path: {
3327
+ name: data.name
3328
+ },
3329
+ errors: {
3330
+ 401: 'Unauthorized',
3331
+ 404: 'Circuit breaker not found'
3332
+ }
3333
+ });
3334
+ }
3335
+
3336
+ /**
3337
+ * Get health check metrics and statistics
3338
+ * @returns unknown Health metrics
3339
+ * @throws ApiError
3340
+ */
3341
+ public static healthControllerGetMetrics(): CancelablePromise<HealthControllerGetMetricsResponse> {
3342
+ return __request(OpenAPI, {
3343
+ method: 'GET',
3344
+ url: '/api/v1/health/metrics',
3345
+ errors: {
3346
+ 401: 'Unauthorized'
3347
+ }
3348
+ });
3349
+ }
3350
+ }
3351
+
3352
+ export class InfoService {
3353
+ /**
3354
+ * Get system information
3355
+ * @returns unknown System information retrieved successfully
3356
+ * @throws ApiError
3357
+ */
3358
+ public static infoControllerGetInfo(): CancelablePromise<InfoControllerGetInfoResponse> {
3359
+ return __request(OpenAPI, {
3360
+ method: 'GET',
3361
+ url: '/api/v1/system/info'
3362
+ });
3363
+ }
3364
+ }