@firela/api-types 0.0.0-canary.1917579c

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