@firela/api-types 0.0.0-canary.0327ab9e

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