@firela/api-types 0.0.0-canary.1917579c → 0.0.0-canary.19fa1e7e

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.
@@ -249,7 +249,7 @@ export type AccountStandardResponseDto = {
249
249
  /**
250
250
  * i18n key for localized display name
251
251
  */
252
- i18nKey?: string;
252
+ i18nKey: string;
253
253
  /**
254
254
  * Short localized display name
255
255
  */
@@ -261,11 +261,11 @@ export type AccountStandardResponseDto = {
261
261
  /**
262
262
  * Account tags for categorization
263
263
  */
264
- tags?: Array<string>;
264
+ tags: Array<string>;
265
265
  /**
266
266
  * Icon identifier for UI display
267
267
  */
268
- icon?: string;
268
+ icon: string;
269
269
  };
270
270
 
271
271
  export type AccountStandardListResponseDto = {
@@ -316,6 +316,53 @@ export type RegionsMetadataResponseDto = {
316
316
  regions: Array<RegionInfoDto>;
317
317
  };
318
318
 
319
+ export type CostSpecDto = {
320
+ /**
321
+ * Cost specification mode (mirrors engine CostSpec)
322
+ */
323
+ mode: 'per-unit' | 'total' | 'date' | 'label' | 'auto';
324
+ /**
325
+ * Per-unit cost (required when mode is "per-unit")
326
+ */
327
+ numberPerUnit?: string;
328
+ /**
329
+ * Total cost for all units (required when mode is "total")
330
+ */
331
+ totalNumber?: string;
332
+ /**
333
+ * Cost currency (required in all modes)
334
+ */
335
+ currency: string;
336
+ /**
337
+ * Lot acquisition date, ISO 8601 (required when mode is "date")
338
+ */
339
+ date?: string;
340
+ /**
341
+ * Lot label (required when mode is "label"; optional tag in buy modes)
342
+ */
343
+ label?: string;
344
+ /**
345
+ * Merge lots for AVERAGE booking (mode: auto)
346
+ */
347
+ merge?: boolean;
348
+ };
349
+
350
+ /**
351
+ * Cost specification mode (mirrors engine CostSpec)
352
+ */
353
+ export type mode = 'per-unit' | 'total' | 'date' | 'label' | 'auto';
354
+
355
+ export type AmountDto = {
356
+ /**
357
+ * Amount as decimal string (max 15 integer + 15 decimal digits)
358
+ */
359
+ number: string;
360
+ /**
361
+ * Currency/commodity code
362
+ */
363
+ currency: string;
364
+ };
365
+
319
366
  export type CreatePostingDto = {
320
367
  /**
321
368
  * Account name in Beancount format (must start with uppercase, colon-separated)
@@ -335,6 +382,14 @@ export type CreatePostingDto = {
335
382
  meta?: {
336
383
  [key: string]: unknown;
337
384
  };
385
+ /**
386
+ * Cost basis (Beancount `{...}`). Maps to engine costSpec. Required for commodity holdings so they carry a monetary weight that can balance.
387
+ */
388
+ cost?: CostSpecDto;
389
+ /**
390
+ * Price annotation (Beancount `@...`). Maps to engine price. Used for valuation; cost takes priority for balance weight.
391
+ */
392
+ price?: AmountDto;
338
393
  };
339
394
 
340
395
  export type CreateTransactionDto = {
@@ -387,19 +442,42 @@ export type CreateTransactionDto = {
387
442
  */
388
443
  export type flag = '*' | '!';
389
444
 
445
+ export type CostDetailDto = {
446
+ /**
447
+ * Per-unit cost basis (mirrors engine Cost.number)
448
+ */
449
+ number?: string;
450
+ /**
451
+ * Cost currency
452
+ */
453
+ currency?: string;
454
+ /**
455
+ * Lot acquisition date (ISO yyyy-mm-dd)
456
+ */
457
+ date?: string;
458
+ /**
459
+ * Lot label
460
+ */
461
+ label?: string;
462
+ };
463
+
390
464
  export type PostingResponseDto = {
391
465
  /**
392
466
  * Account name
393
467
  */
394
468
  account: string;
395
469
  /**
396
- * Amount (may be null if interpolated)
470
+ * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.
397
471
  */
398
472
  units?: string;
399
473
  /**
400
474
  * Currency
401
475
  */
402
476
  currency?: string;
477
+ /**
478
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
479
+ */
480
+ cost?: CostDetailDto;
403
481
  };
404
482
 
405
483
  export type RecurringSuggestionDto = {
@@ -561,6 +639,55 @@ export type BatchTransactionResponseDto = {
561
639
  failed: Array<BatchTransactionErrorDto>;
562
640
  };
563
641
 
642
+ export type CorrectTransactionDto = {
643
+ /**
644
+ * Transaction date (ISO 8601 format)
645
+ */
646
+ date: string;
647
+ /**
648
+ * Transaction flag: * (cleared), ! (pending)
649
+ */
650
+ flag?: '*' | '!';
651
+ /**
652
+ * Payee name
653
+ */
654
+ payee?: string;
655
+ /**
656
+ * Transaction narration/description
657
+ */
658
+ narration: string;
659
+ /**
660
+ * Transaction tags (without # prefix)
661
+ */
662
+ tags?: Array<string>;
663
+ /**
664
+ * Transaction links (without ^ prefix)
665
+ */
666
+ links?: Array<string>;
667
+ /**
668
+ * Transaction postings (minimum 1, typically 2 for double-entry)
669
+ */
670
+ postings: Array<CreatePostingDto>;
671
+ /**
672
+ * Transaction-level metadata
673
+ */
674
+ meta?: {
675
+ [key: string]: unknown;
676
+ };
677
+ /**
678
+ * Unique key for idempotent transaction creation. If provided, duplicate requests with the same key will return the existing transaction.
679
+ */
680
+ idempotencyKey?: string;
681
+ /**
682
+ * Auto-create accounts if not found. When true, missing accounts will be automatically created. When false (default for API), missing accounts will cause a validation error. Set to true for quick entry scenarios where you want to create accounts on-the-fly.
683
+ */
684
+ autoCreateAccounts?: boolean;
685
+ /**
686
+ * Reason for correcting/superseding the original transaction
687
+ */
688
+ correctionReason?: string;
689
+ };
690
+
564
691
  export type PostingDetailDto = {
565
692
  /**
566
693
  * Posting ID
@@ -571,11 +698,11 @@ export type PostingDetailDto = {
571
698
  */
572
699
  accountId: string;
573
700
  /**
574
- * Account name
701
+ * Fully-qualified Beancount account path
575
702
  */
576
- accountName: string;
703
+ account: string;
577
704
  /**
578
- * Amount (may be null if interpolated)
705
+ * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.
579
706
  */
580
707
  units?: string;
581
708
  /**
@@ -594,6 +721,10 @@ export type PostingDetailDto = {
594
721
  * Cost date
595
722
  */
596
723
  costDate?: string;
724
+ /**
725
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
726
+ */
727
+ cost?: CostDetailDto;
597
728
  /**
598
729
  * Price amount
599
730
  */
@@ -664,9 +795,9 @@ export type TransactionDetailDto = {
664
795
  */
665
796
  status: 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
666
797
  /**
667
- * Source type (how the transaction was created)
798
+ * Source type (free-form string from transaction metadata, e.g. import, api)
668
799
  */
669
- sourceType?: 'NLP' | 'CSV' | 'OCR' | 'API';
800
+ sourceType?: string;
670
801
  /**
671
802
  * Source platform (e.g., alipay, wechat)
672
803
  */
@@ -691,6 +822,14 @@ export type TransactionDetailDto = {
691
822
  * Correction reason (if voided or superseded)
692
823
  */
693
824
  correctionReason?: string;
825
+ /**
826
+ * ID of the transaction that supersedes this one (set when status=SUPERSEDED)
827
+ */
828
+ supersededBy?: string;
829
+ /**
830
+ * ID of the transaction this one corrected/replaced (back-link on the replacement)
831
+ */
832
+ originalTxn?: string;
694
833
  };
695
834
 
696
835
  /**
@@ -709,11 +848,6 @@ export type flag2 =
709
848
  */
710
849
  export type status2 = 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
711
850
 
712
- /**
713
- * Source type (how the transaction was created)
714
- */
715
- export type sourceType = 'NLP' | 'CSV' | 'OCR' | 'API';
716
-
717
851
  export type TransactionListResponseDto = {
718
852
  /**
719
853
  * List of transactions
@@ -733,6 +867,24 @@ export type TransactionListResponseDto = {
733
867
  offset: number;
734
868
  };
735
869
 
870
+ export type TagSuggestionDto = {
871
+ /**
872
+ * Tag name
873
+ */
874
+ tag: string;
875
+ /**
876
+ * Usage count across ACTIVE transactions
877
+ */
878
+ count: number;
879
+ };
880
+
881
+ export type TagSuggestionsResponseDto = {
882
+ /**
883
+ * Tag suggestions sorted as requested
884
+ */
885
+ data: Array<TagSuggestionDto>;
886
+ };
887
+
736
888
  export type UpdateTransactionDto = {
737
889
  /**
738
890
  * Transaction flag (CLEARED, PENDING, etc.)
@@ -834,9 +986,9 @@ export type TransactionSummaryDto = {
834
986
  */
835
987
  accountName?: string;
836
988
  /**
837
- * Source type (NLP, CSV, OCR, API)
989
+ * Source type (free-form string from transaction metadata, e.g. import, api)
838
990
  */
839
- sourceType?: 'NLP' | 'CSV' | 'OCR' | 'API';
991
+ sourceType?: string;
840
992
  /**
841
993
  * Source platform (e.g., alipay, wechat)
842
994
  */
@@ -866,9 +1018,9 @@ export type ReviewSummaryDto = {
866
1018
  */
867
1019
  confidence: number;
868
1020
  /**
869
- * Confidence level derived from score
1021
+ * Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.
870
1022
  */
871
- confidenceLevel: 'HIGH' | 'MEDIUM' | 'LOW';
1023
+ confidenceLevel: 'HIGH' | 'MEDIUM' | 'LOW' | null;
872
1024
  /**
873
1025
  * i18n message key for summary (e.g., review.summary.duplicate). Translate on frontend with summaryParams.
874
1026
  */
@@ -884,7 +1036,7 @@ export type ReviewSummaryDto = {
884
1036
  */
885
1037
  matchReasons: Array<string>;
886
1038
  /**
887
- * Source type (NLP, CSV, OCR, API)
1039
+ * Source type (free-form string from transaction metadata, e.g. import, api)
888
1040
  */
889
1041
  sourceType: string;
890
1042
  /**
@@ -937,7 +1089,7 @@ export type type2 =
937
1089
  export type status3 = 'PENDING' | 'RESOLVED' | 'EXPIRED' | 'CANCELLED';
938
1090
 
939
1091
  /**
940
- * Confidence level derived from score
1092
+ * Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.
941
1093
  */
942
1094
  export type confidenceLevel = 'HIGH' | 'MEDIUM' | 'LOW';
943
1095
 
@@ -982,7 +1134,18 @@ export type DecisionOptionDto = {
982
1134
  /**
983
1135
  * The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)
984
1136
  */
985
- value: string;
1137
+ value:
1138
+ | 'UPGRADE_REPLACE'
1139
+ | 'LINK_KEEP_BOTH'
1140
+ | 'IGNORE_NEW'
1141
+ | 'CONFIRM_DIFFERENT'
1142
+ | 'ACCEPT'
1143
+ | 'REJECT'
1144
+ | 'ACCEPT_AND_LEARN'
1145
+ | 'CHOOSE_OTHER'
1146
+ | 'CANCEL'
1147
+ | 'FIX'
1148
+ | 'IGNORE';
986
1149
  /**
987
1150
  * i18n message key for display label (e.g., review.payee.accept.label)
988
1151
  */
@@ -997,6 +1160,22 @@ export type DecisionOptionDto = {
997
1160
  recommended?: boolean;
998
1161
  };
999
1162
 
1163
+ /**
1164
+ * The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)
1165
+ */
1166
+ export type value =
1167
+ | 'UPGRADE_REPLACE'
1168
+ | 'LINK_KEEP_BOTH'
1169
+ | 'IGNORE_NEW'
1170
+ | 'CONFIRM_DIFFERENT'
1171
+ | 'ACCEPT'
1172
+ | 'REJECT'
1173
+ | 'ACCEPT_AND_LEARN'
1174
+ | 'CHOOSE_OTHER'
1175
+ | 'CANCEL'
1176
+ | 'FIX'
1177
+ | 'IGNORE';
1178
+
1000
1179
  export type ReviewDetailDto = {
1001
1180
  /**
1002
1181
  * Review item ID
@@ -1020,9 +1199,9 @@ export type ReviewDetailDto = {
1020
1199
  */
1021
1200
  confidence: number;
1022
1201
  /**
1023
- * Confidence level derived from score
1202
+ * Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.
1024
1203
  */
1025
- confidenceLevel: 'HIGH' | 'MEDIUM' | 'LOW';
1204
+ confidenceLevel: 'HIGH' | 'MEDIUM' | 'LOW' | null;
1026
1205
  /**
1027
1206
  * i18n message key for summary (e.g., review.summary.duplicate). Translate on frontend with summaryParams.
1028
1207
  */
@@ -1038,7 +1217,7 @@ export type ReviewDetailDto = {
1038
1217
  */
1039
1218
  matchReasons: Array<string>;
1040
1219
  /**
1041
- * Source type (NLP, CSV, OCR, API)
1220
+ * Source type (free-form string from transaction metadata, e.g. import, api)
1042
1221
  */
1043
1222
  sourceType: string;
1044
1223
  /**
@@ -1091,9 +1270,20 @@ export type ReviewDetailDto = {
1091
1270
 
1092
1271
  export type ResolveReviewDto = {
1093
1272
  /**
1094
- * Decision action. Available actions vary by review type: DUPLICATE: UPGRADE_REPLACE, KEEP_EXISTING, KEEP_BOTH | PAYEE_MATCH: ACCEPT, REJECT, ACCEPT_AND_LEARN | ACCOUNT_VALIDATION: FIX, REJECT | RULE_MATCH: ACCEPT, REJECT, ACCEPT_AND_LEARN
1273
+ * Decision action. Valid actions vary by review type — see DecisionOptionDto.value returned by the review detail endpoint.
1095
1274
  */
1096
- action: string;
1275
+ action:
1276
+ | 'UPGRADE_REPLACE'
1277
+ | 'LINK_KEEP_BOTH'
1278
+ | 'IGNORE_NEW'
1279
+ | 'CONFIRM_DIFFERENT'
1280
+ | 'ACCEPT'
1281
+ | 'REJECT'
1282
+ | 'ACCEPT_AND_LEARN'
1283
+ | 'CHOOSE_OTHER'
1284
+ | 'CANCEL'
1285
+ | 'FIX'
1286
+ | 'IGNORE';
1097
1287
  /**
1098
1288
  * Additional data for the decision (e.g., selected account ID)
1099
1289
  */
@@ -1102,6 +1292,22 @@ export type ResolveReviewDto = {
1102
1292
  };
1103
1293
  };
1104
1294
 
1295
+ /**
1296
+ * Decision action. Valid actions vary by review type — see DecisionOptionDto.value returned by the review detail endpoint.
1297
+ */
1298
+ export type action =
1299
+ | 'UPGRADE_REPLACE'
1300
+ | 'LINK_KEEP_BOTH'
1301
+ | 'IGNORE_NEW'
1302
+ | 'CONFIRM_DIFFERENT'
1303
+ | 'ACCEPT'
1304
+ | 'REJECT'
1305
+ | 'ACCEPT_AND_LEARN'
1306
+ | 'CHOOSE_OTHER'
1307
+ | 'CANCEL'
1308
+ | 'FIX'
1309
+ | 'IGNORE';
1310
+
1105
1311
  export type ResolveResultDto = {
1106
1312
  /**
1107
1313
  * Whether resolution was successful
@@ -1118,17 +1324,17 @@ export type ResolveResultDto = {
1118
1324
  [key: string]: string;
1119
1325
  };
1120
1326
  /**
1121
- * Resolution ID for undo
1327
+ * Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).
1122
1328
  */
1123
- resolutionId: string;
1329
+ resolutionId?: string;
1124
1330
  /**
1125
1331
  * Whether this decision can be undone
1126
1332
  */
1127
- canUndo: boolean;
1333
+ canUndo?: boolean;
1128
1334
  /**
1129
1335
  * Deadline for undo (24h from resolution)
1130
1336
  */
1131
- undoDeadline: string;
1337
+ undoDeadline?: string;
1132
1338
  /**
1133
1339
  * Rule ID if learning was triggered (ACCEPT_AND_LEARN actions). Use this to deep-link to the rule management page.
1134
1340
  */
@@ -1158,7 +1364,18 @@ export type BatchResolveDto = {
1158
1364
  /**
1159
1365
  * Decision action to apply to all items
1160
1366
  */
1161
- action: string;
1367
+ action:
1368
+ | 'UPGRADE_REPLACE'
1369
+ | 'LINK_KEEP_BOTH'
1370
+ | 'IGNORE_NEW'
1371
+ | 'CONFIRM_DIFFERENT'
1372
+ | 'ACCEPT'
1373
+ | 'REJECT'
1374
+ | 'ACCEPT_AND_LEARN'
1375
+ | 'CHOOSE_OTHER'
1376
+ | 'CANCEL'
1377
+ | 'FIX'
1378
+ | 'IGNORE';
1162
1379
  /**
1163
1380
  * Additional data for the decision
1164
1381
  */
@@ -2812,6 +3029,96 @@ export type UpdatePropertyDto = {
2812
3029
  value: string;
2813
3030
  };
2814
3031
 
3032
+ export type CreateBeanEventDto = {
3033
+ /**
3034
+ * Life event date (ISO 8601)
3035
+ */
3036
+ date: string;
3037
+ /**
3038
+ * Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer
3039
+ */
3040
+ type: string;
3041
+ /**
3042
+ * Life event description. Empty string is a VALID value (distinct from absence).
3043
+ */
3044
+ description: string;
3045
+ /**
3046
+ * Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)
3047
+ */
3048
+ meta?: {
3049
+ [key: string]: unknown;
3050
+ };
3051
+ };
3052
+
3053
+ export type EventResponseDto = {
3054
+ /**
3055
+ * Unique identifier
3056
+ */
3057
+ id: string;
3058
+ /**
3059
+ * User ID (owner of the life event)
3060
+ */
3061
+ userId: string;
3062
+ /**
3063
+ * Life event date (ISO 8601 format)
3064
+ */
3065
+ date: string;
3066
+ /**
3067
+ * Life event type (user-defined, e.g., "employer", "location")
3068
+ */
3069
+ type: string;
3070
+ /**
3071
+ * Life event description. May be an empty string (a valid value distinct from absence).
3072
+ */
3073
+ description: string;
3074
+ /**
3075
+ * Product-side metadata (free-form JSON)
3076
+ */
3077
+ meta: {
3078
+ [key: string]: unknown;
3079
+ };
3080
+ /**
3081
+ * Creation timestamp
3082
+ */
3083
+ createdAt: string;
3084
+ /**
3085
+ * Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.
3086
+ */
3087
+ updatedAt: string;
3088
+ };
3089
+
3090
+ export type EventListResponseDto = {
3091
+ /**
3092
+ * List of life events
3093
+ */
3094
+ items: Array<EventResponseDto>;
3095
+ /**
3096
+ * Total number of life events matching the query
3097
+ */
3098
+ total: number;
3099
+ };
3100
+
3101
+ export type UpdateBeanEventDto = {
3102
+ /**
3103
+ * Life event date (ISO 8601)
3104
+ */
3105
+ date?: string;
3106
+ /**
3107
+ * Life event type (user-defined)
3108
+ */
3109
+ type?: string;
3110
+ /**
3111
+ * Life event description. Empty string is a VALID value (distinct from absence).
3112
+ */
3113
+ description?: string;
3114
+ /**
3115
+ * Product-side metadata (free-form JSON)
3116
+ */
3117
+ meta?: {
3118
+ [key: string]: unknown;
3119
+ };
3120
+ };
3121
+
2815
3122
  export type FileImportDto = {
2816
3123
  /**
2817
3124
  * Bill file to import (CSV, PDF, OFX, etc.)
@@ -3276,6 +3583,8 @@ export type SupportedProvidersResponseDto = {
3276
3583
 
3277
3584
  export type ParserTelemetryReportDto = unknown;
3278
3585
 
3586
+ export type UncoveredFormatMissDto = unknown;
3587
+
3279
3588
  export type ProcessNlpDto = {
3280
3589
  /**
3281
3590
  * Natural language text describing a transaction (Chinese)
@@ -3821,7 +4130,7 @@ export type status4 = 'success' | 'pending' | 'error';
3821
4130
  /**
3822
4131
  * Action taken or requested
3823
4132
  */
3824
- export type action =
4133
+ export type action2 =
3825
4134
  | 'created'
3826
4135
  | 'ask'
3827
4136
  | 'confirm'
@@ -4061,8 +4370,21 @@ export type AccountItemWithAssetClassDto = {
4061
4370
  * Risk level
4062
4371
  */
4063
4372
  riskLevel?: string;
4373
+ /**
4374
+ * ADR-0105 classification provenance (holding level always; account level only on FALLBACK)
4375
+ */
4376
+ source?: 'USER_META' | 'FIAT_CURRENCY' | 'OPENBB_MAPPING' | 'FALLBACK';
4064
4377
  };
4065
4378
 
4379
+ /**
4380
+ * ADR-0105 classification provenance (holding level always; account level only on FALLBACK)
4381
+ */
4382
+ export type source2 =
4383
+ | 'USER_META'
4384
+ | 'FIAT_CURRENCY'
4385
+ | 'OPENBB_MAPPING'
4386
+ | 'FALLBACK';
4387
+
4066
4388
  export type AssetClassGroupDto = {
4067
4389
  /**
4068
4390
  * Asset class name
@@ -4149,6 +4471,12 @@ export type AssetClassSummaryDto = {
4149
4471
  * Exchange rate warnings
4150
4472
  */
4151
4473
  warnings?: Array<AccountExchangeRateWarningDto>;
4474
+ /**
4475
+ * ADR-0105 §4 fallback provenance stats (holding level only). valueRatio is the grey-area share of total converted value; count is the number of source=FALLBACK holdings.
4476
+ */
4477
+ fallback?: {
4478
+ [key: string]: unknown;
4479
+ };
4152
4480
  };
4153
4481
 
4154
4482
  export type AssetClassAccountsResponseDto = {
@@ -4160,6 +4488,56 @@ export type AssetClassAccountsResponseDto = {
4160
4488
  * Summary statistics
4161
4489
  */
4162
4490
  summary: AssetClassSummaryDto;
4491
+ /**
4492
+ * ADR-0105 §6 holding-level grey-area bucket (source=FALLBACK holdings peeled out of groups). Present only for groupBy=holdingAssetClass when FALLBACK holdings exist.
4493
+ */
4494
+ uncategorized?: AssetClassGroupDto;
4495
+ };
4496
+
4497
+ export type HoldingAssetClassAccountSliceDto = {
4498
+ /**
4499
+ * Account ID
4500
+ */
4501
+ accountId: string;
4502
+ /**
4503
+ * Full account path
4504
+ */
4505
+ accountPath: string;
4506
+ /**
4507
+ * Currency of the holding with the largest converted base value; undefined when no holding is convertible
4508
+ */
4509
+ accountCurrency?: string;
4510
+ /**
4511
+ * Account's market value in base currency (Σ converted holdings; grey bucket included)
4512
+ */
4513
+ marketValueBase: string;
4514
+ /**
4515
+ * Share of the global total (0-100). 0 when globalTotal is zero (no NaN/Infinity).
4516
+ */
4517
+ shareOfTotalPct: number;
4518
+ /**
4519
+ * Per-account asset-class breakdown
4520
+ */
4521
+ groups: Array<AssetClassGroupDto>;
4522
+ /**
4523
+ * Per-account grey bucket (source=FALLBACK holdings, incl. broker cash)
4524
+ */
4525
+ uncategorized?: AssetClassGroupDto;
4526
+ /**
4527
+ * Every holding row for this account (account ID in each row’s `id` field)
4528
+ */
4529
+ holdings: Array<AccountItemWithAssetClassDto>;
4530
+ };
4531
+
4532
+ export type HoldingAssetClassCrossAccountResponseDto = {
4533
+ /**
4534
+ * Merged cross-account holding aggregation
4535
+ */
4536
+ global: AssetClassAccountsResponseDto;
4537
+ /**
4538
+ * Per-account slices
4539
+ */
4540
+ byAccount: Array<HoldingAssetClassAccountSliceDto>;
4163
4541
  };
4164
4542
 
4165
4543
  export type CashFlowByCurrencyDto = {
@@ -4241,34 +4619,396 @@ export type CashFlowResponseDto = {
4241
4619
  warnings?: Array<ExchangeRateWarningDto>;
4242
4620
  };
4243
4621
 
4244
- export type CurrencyBalanceDto = {
4622
+ export type CategoryGroupDto = {
4245
4623
  /**
4246
- * ISO 4217 currency code
4624
+ * Functional category (account-path Group segment); regional and universal account paths merge under it
4247
4625
  */
4248
- currency: string;
4626
+ category: string;
4249
4627
  /**
4250
- * Balance amount
4628
+ * Converted total expense in base currency
4251
4629
  */
4252
- balance: string;
4253
- };
4254
-
4255
- export type TimeSeriesPointDto = {
4630
+ totalExpense: string;
4256
4631
  /**
4257
- * Date in YYYY-MM-DD format
4632
+ * Share of grand total (0-100); 0 when grand total is 0
4258
4633
  */
4259
- date: string;
4634
+ sharePct: number;
4260
4635
  /**
4261
- * Value at this date (in base currency)
4636
+ * Raw (unconverted) expense per currency
4262
4637
  */
4263
- value: string;
4638
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
4264
4639
  /**
4265
- * Change from previous point
4640
+ * Converted total in base currency (omitted when FX missing for all currencies in this category)
4266
4641
  */
4267
- change?: {
4268
- [key: string]: unknown;
4269
- };
4270
- /**
4271
- * Multi-currency breakdown for this point
4642
+ convertedBalance?: string;
4643
+ };
4644
+
4645
+ export type ExpensesByCategorySummaryDto = {
4646
+ /**
4647
+ * Total expense across all categories (converted; convertible categories only)
4648
+ */
4649
+ totalExpense: string;
4650
+ /**
4651
+ * Number of categories
4652
+ */
4653
+ categoryCount: number;
4654
+ };
4655
+
4656
+ export type ExpensesByCategoryResponseDto = {
4657
+ /**
4658
+ * Period requested
4659
+ */
4660
+ period: string;
4661
+ /**
4662
+ * Base currency for converted values
4663
+ */
4664
+ baseCurrency: string;
4665
+ /**
4666
+ * Expense groups by functional category, sorted by converted total desc
4667
+ */
4668
+ groups: Array<CategoryGroupDto>;
4669
+ /**
4670
+ * Summary statistics
4671
+ */
4672
+ summary: ExpensesByCategorySummaryDto;
4673
+ /**
4674
+ * Exchange rate warnings (e.g. missing rate for a currency)
4675
+ */
4676
+ warnings?: Array<ExchangeRateWarningDto>;
4677
+ };
4678
+
4679
+ export type MonetaryDto = {
4680
+ /**
4681
+ * Amount (Decimal string)
4682
+ */
4683
+ amount: string;
4684
+ /**
4685
+ * ISO 4217 currency
4686
+ */
4687
+ currency: string;
4688
+ /**
4689
+ * Converted to user base currency (Decimal string)
4690
+ */
4691
+ baseCcyEquivalent?: {
4692
+ [key: string]: unknown;
4693
+ } | null;
4694
+ };
4695
+
4696
+ export type CurrentPriceDto = {
4697
+ /**
4698
+ * Price amount (Decimal string)
4699
+ */
4700
+ amount: string;
4701
+ /**
4702
+ * Price currency (ISO 4217)
4703
+ */
4704
+ currency: string;
4705
+ /**
4706
+ * Price date (ISO 8601)
4707
+ */
4708
+ date: string;
4709
+ /**
4710
+ * Price source
4711
+ */
4712
+ source: 'USER_OVERRIDE' | 'OPENBB_EQUITY' | 'OPENBB_CURRENCY';
4713
+ };
4714
+
4715
+ /**
4716
+ * Price source
4717
+ */
4718
+ export type source3 = 'USER_OVERRIDE' | 'OPENBB_EQUITY' | 'OPENBB_CURRENCY';
4719
+
4720
+ export type FxRateDto = {
4721
+ from: string;
4722
+ to: string;
4723
+ /**
4724
+ * FX rate (Decimal string)
4725
+ */
4726
+ rate: string;
4727
+ /**
4728
+ * Rate date (ISO 8601)
4729
+ */
4730
+ date: string;
4731
+ };
4732
+
4733
+ export type HoldingPnlRowDto = {
4734
+ /**
4735
+ * Account UUID
4736
+ */
4737
+ accountId: string;
4738
+ /**
4739
+ * Full account path
4740
+ */
4741
+ accountPath: string;
4742
+ /**
4743
+ * Account settlement currency (ISO 4217), from cost currency
4744
+ */
4745
+ accountCcy?: {
4746
+ [key: string]: unknown;
4747
+ } | null;
4748
+ /**
4749
+ * Broker type derived from Platform.type
4750
+ */
4751
+ brokerType?: {
4752
+ [key: string]: unknown;
4753
+ } | null;
4754
+ /**
4755
+ * Commodity symbol
4756
+ */
4757
+ symbol: string;
4758
+ /**
4759
+ * Chart segment token (libs/common resolver)
4760
+ */
4761
+ chartToken: 'equity' | 'fund' | 'bond' | 'cash' | 'other';
4762
+ assetClass: string;
4763
+ assetSubClass?: {
4764
+ [key: string]: unknown;
4765
+ } | null;
4766
+ /**
4767
+ * Net held units (Decimal string)
4768
+ */
4769
+ units: string;
4770
+ /**
4771
+ * Average cost per unit; null when cost currency conflicts or no cost
4772
+ */
4773
+ averageCostPerUnit?: MonetaryDto | null;
4774
+ /**
4775
+ * Cost basis of held units
4776
+ */
4777
+ costBasis?: MonetaryDto | null;
4778
+ /**
4779
+ * Market value at asOf price
4780
+ */
4781
+ marketValue?: MonetaryDto | null;
4782
+ /**
4783
+ * Price used for market value
4784
+ */
4785
+ currentPrice?: CurrentPriceDto | null;
4786
+ /**
4787
+ * Unrealized P&L in base currency (Decimal string); null when any FX/price missing
4788
+ */
4789
+ unrealizedPnlBase?: {
4790
+ [key: string]: unknown;
4791
+ } | null;
4792
+ /**
4793
+ * Unrealized P&L % (Decimal string)
4794
+ */
4795
+ unrealizedPnlPct?: {
4796
+ [key: string]: unknown;
4797
+ } | null;
4798
+ /**
4799
+ * Historical FX rate applied to cost basis
4800
+ */
4801
+ costFxRate?: FxRateDto | null;
4802
+ /**
4803
+ * FX rate applied to market value
4804
+ */
4805
+ marketFxRate?: FxRateDto | null;
4806
+ /**
4807
+ * Share of invested assets % (Decimal string); only for invested chartTokens
4808
+ */
4809
+ pctOfInvestedAssets?: {
4810
+ [key: string]: unknown;
4811
+ } | null;
4812
+ /**
4813
+ * Cumulative realized P&L on sold lots (asOf-date cutoff); null when the method has no applicable sells, a sell lacks a price, or any required FX rate is missing (never-mix). When a sell spans multiple currencies (cross-currency sale), amount and currency reflect the base currency; baseCcyEquivalent is always the authoritative dual-FX figure
4814
+ */
4815
+ realizedPnl?: MonetaryDto | null;
4816
+ };
4817
+
4818
+ /**
4819
+ * Chart segment token (libs/common resolver)
4820
+ */
4821
+ export type chartToken = 'equity' | 'fund' | 'bond' | 'cash' | 'other';
4822
+
4823
+ export type HoldingPnlWarningDto = {
4824
+ /**
4825
+ * Warning type
4826
+ */
4827
+ type:
4828
+ | 'MISSING_COST_FX_RATE'
4829
+ | 'MISSING_MARKET_FX_RATE'
4830
+ | 'MISSING_SALE_PRICE'
4831
+ | 'MISSING_REALIZED_FX_RATE'
4832
+ | 'OVERSOLD_LOTS'
4833
+ | 'NO_PRICE'
4834
+ | 'MIXED_COST_CURRENCY';
4835
+ symbol?: {
4836
+ [key: string]: unknown;
4837
+ } | null;
4838
+ accountId?: {
4839
+ [key: string]: unknown;
4840
+ } | null;
4841
+ currency?: {
4842
+ [key: string]: unknown;
4843
+ } | null;
4844
+ };
4845
+
4846
+ /**
4847
+ * Warning type
4848
+ */
4849
+ export type type4 =
4850
+ | 'MISSING_COST_FX_RATE'
4851
+ | 'MISSING_MARKET_FX_RATE'
4852
+ | 'MISSING_SALE_PRICE'
4853
+ | 'MISSING_REALIZED_FX_RATE'
4854
+ | 'OVERSOLD_LOTS'
4855
+ | 'NO_PRICE'
4856
+ | 'MIXED_COST_CURRENCY';
4857
+
4858
+ export type HoldingPnlResponseDto = {
4859
+ asOfDate: string;
4860
+ baseCurrency: string;
4861
+ /**
4862
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
4863
+ */
4864
+ method: 'average' | 'FIFO';
4865
+ rows: Array<HoldingPnlRowDto>;
4866
+ warnings: Array<HoldingPnlWarningDto>;
4867
+ };
4868
+
4869
+ /**
4870
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
4871
+ */
4872
+ export type method = 'average' | 'FIFO';
4873
+
4874
+ export type CreateBeanPriceDto = {
4875
+ /**
4876
+ * Currency being priced (e.g., USD, AAPL, BTC)
4877
+ */
4878
+ currency: string;
4879
+ /**
4880
+ * Quote currency (pricing currency, e.g., CNY, EUR)
4881
+ */
4882
+ quoteCurrency: string;
4883
+ /**
4884
+ * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
4885
+ */
4886
+ amount: number;
4887
+ /**
4888
+ * Price date (ISO 8601 format)
4889
+ */
4890
+ date: string;
4891
+ /**
4892
+ * Metadata (validated by Zod schema, max field lengths enforced)
4893
+ */
4894
+ metadata?: {
4895
+ [key: string]: unknown;
4896
+ };
4897
+ };
4898
+
4899
+ export type PriceResponseDto = {
4900
+ /**
4901
+ * Unique identifier
4902
+ */
4903
+ id: string;
4904
+ /**
4905
+ * User ID (owner of the price)
4906
+ */
4907
+ userId: string;
4908
+ /**
4909
+ * Currency being priced (e.g., USD, AAPL, BTC)
4910
+ */
4911
+ currency: string;
4912
+ /**
4913
+ * Quote currency (pricing currency, e.g., USD, CNY)
4914
+ */
4915
+ quoteCurrency: string;
4916
+ /**
4917
+ * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
4918
+ */
4919
+ amount: number;
4920
+ /**
4921
+ * Price date (ISO 8601 format). Represents the date this price was valid.
4922
+ */
4923
+ date: string;
4924
+ /**
4925
+ * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
4926
+ */
4927
+ meta: {
4928
+ [key: string]: unknown;
4929
+ };
4930
+ /**
4931
+ * Creation timestamp
4932
+ */
4933
+ createdAt: string;
4934
+ /**
4935
+ * Last update timestamp
4936
+ */
4937
+ updatedAt: string;
4938
+ };
4939
+
4940
+ export type PriceListResponseDto = {
4941
+ /**
4942
+ * List of prices
4943
+ */
4944
+ items: Array<PriceResponseDto>;
4945
+ /**
4946
+ * Total number of prices
4947
+ */
4948
+ total: number;
4949
+ };
4950
+
4951
+ export type UpdateBeanPriceDto = {
4952
+ /**
4953
+ * Currency being priced
4954
+ */
4955
+ currency?: string;
4956
+ /**
4957
+ * Quote currency (pricing currency)
4958
+ */
4959
+ quoteCurrency?: string;
4960
+ /**
4961
+ * Price amount (MUST be >= 0 per Beancount spec)
4962
+ */
4963
+ amount?: number;
4964
+ /**
4965
+ * Price date (ISO 8601 format)
4966
+ */
4967
+ date?: string;
4968
+ /**
4969
+ * Metadata
4970
+ */
4971
+ metadata?: {
4972
+ [key: string]: unknown;
4973
+ };
4974
+ };
4975
+
4976
+ export type CurrencyBalanceDto = {
4977
+ /**
4978
+ * ISO 4217 currency code
4979
+ */
4980
+ currency: string;
4981
+ /**
4982
+ * Balance amount
4983
+ */
4984
+ balance: string;
4985
+ };
4986
+
4987
+ export type TimeSeriesPointDto = {
4988
+ /**
4989
+ * Date in YYYY-MM-DD format
4990
+ */
4991
+ date: string;
4992
+ /**
4993
+ * Value at this date (in base currency)
4994
+ */
4995
+ value: string;
4996
+ /**
4997
+ * Change from previous point
4998
+ */
4999
+ change?: {
5000
+ [key: string]: unknown;
5001
+ };
5002
+ /**
5003
+ * Total assets at this date (in base currency)
5004
+ */
5005
+ assets?: string;
5006
+ /**
5007
+ * Total liabilities at this date (in base currency)
5008
+ */
5009
+ liabilities?: string;
5010
+ /**
5011
+ * Multi-currency breakdown for this point
4272
5012
  */
4273
5013
  byCurrency?: Array<CurrencyBalanceDto>;
4274
5014
  };
@@ -4334,6 +5074,71 @@ export type PortfolioTrendsResponseDto = {
4334
5074
  warnings?: Array<ExchangeRateWarningDto>;
4335
5075
  };
4336
5076
 
5077
+ export type CashFlowPointDto = {
5078
+ /**
5079
+ * Month key (YYYY-MM)
5080
+ */
5081
+ month: string;
5082
+ /**
5083
+ * Income in base currency (absolute, converted)
5084
+ */
5085
+ income: string;
5086
+ /**
5087
+ * Expense in base currency (absolute, converted)
5088
+ */
5089
+ expense: string;
5090
+ /**
5091
+ * netSavings = income − expense (savings positive)
5092
+ */
5093
+ netSavings: string;
5094
+ };
5095
+
5096
+ export type CashFlowTrendSummaryDto = {
5097
+ /**
5098
+ * Total income across the period
5099
+ */
5100
+ totalIncome: string;
5101
+ /**
5102
+ * Total expense across the period
5103
+ */
5104
+ totalExpense: string;
5105
+ /**
5106
+ * income − expense across the period
5107
+ */
5108
+ totalNetSavings: string;
5109
+ /**
5110
+ * totalNetSavings divided by the window length (N months, incl. zero-filled)
5111
+ */
5112
+ averageMonthlyNetSavings: string;
5113
+ };
5114
+
5115
+ export type CashFlowTrendsResponseDto = {
5116
+ /**
5117
+ * Monthly cash-flow series (fixed N-month window, zero-filled)
5118
+ */
5119
+ series: Array<CashFlowPointDto>;
5120
+ /**
5121
+ * Period totals
5122
+ */
5123
+ summary: CashFlowTrendSummaryDto;
5124
+ /**
5125
+ * Period requested
5126
+ */
5127
+ period: string;
5128
+ /**
5129
+ * Data granularity (v1 returns month buckets)
5130
+ */
5131
+ granularity: string;
5132
+ /**
5133
+ * Base currency for converted values
5134
+ */
5135
+ currency: string;
5136
+ /**
5137
+ * Exchange rate warnings (e.g. missing rate for a currency)
5138
+ */
5139
+ warnings?: Array<ExchangeRateWarningDto>;
5140
+ };
5141
+
4337
5142
  export type GenerateSnapshotBody = unknown;
4338
5143
 
4339
5144
  export type GenerateSnapshotResponse = unknown;
@@ -4520,6 +5325,10 @@ export type TransactionControllerListData = {
4520
5325
  * Filter by account ID (transactions with postings to this account)
4521
5326
  */
4522
5327
  accountId?: string;
5328
+ /**
5329
+ * Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
5330
+ */
5331
+ category?: string;
4523
5332
  /**
4524
5333
  * Filter by start date (inclusive), format: YYYY-MM-DD
4525
5334
  */
@@ -4563,6 +5372,42 @@ export type TransactionControllerCreateBatchData = {
4563
5372
  export type TransactionControllerCreateBatchResponse =
4564
5373
  BatchTransactionResponseDto;
4565
5374
 
5375
+ export type TransactionControllerCorrectData = {
5376
+ /**
5377
+ * Original transaction ID to correct
5378
+ */
5379
+ id: string;
5380
+ /**
5381
+ * Region code for tenant context
5382
+ */
5383
+ region: 'cn' | 'us' | 'de' | 'gb';
5384
+ requestBody: CorrectTransactionDto;
5385
+ };
5386
+
5387
+ export type TransactionControllerCorrectResponse = TransactionDetailDto;
5388
+
5389
+ export type TransactionControllerSuggestTagsData = {
5390
+ /**
5391
+ * Max suggestions (1-100, default 10)
5392
+ */
5393
+ limit?: number;
5394
+ /**
5395
+ * Prefix match, case-insensitive (max 50 chars)
5396
+ */
5397
+ q?: string;
5398
+ /**
5399
+ * Region code for tenant context
5400
+ */
5401
+ region: 'cn' | 'us' | 'de' | 'gb';
5402
+ /**
5403
+ * usage (default) or name
5404
+ */
5405
+ sort?: 'usage' | 'name';
5406
+ };
5407
+
5408
+ export type TransactionControllerSuggestTagsResponse =
5409
+ TagSuggestionsResponseDto;
5410
+
4566
5411
  export type TransactionControllerGetDetailData = {
4567
5412
  /**
4568
5413
  * Transaction ID
@@ -5475,6 +6320,104 @@ export type PropertyControllerDeleteData = {
5475
6320
 
5476
6321
  export type PropertyControllerDeleteResponse = void;
5477
6322
 
6323
+ export type EventControllerCreateData = {
6324
+ /**
6325
+ * Region code for tenant context (decorative for life events)
6326
+ */
6327
+ region: 'cn' | 'us' | 'de' | 'gb';
6328
+ requestBody: CreateBeanEventDto;
6329
+ };
6330
+
6331
+ export type EventControllerCreateResponse = EventResponseDto;
6332
+
6333
+ export type EventControllerFindAllData = {
6334
+ /**
6335
+ * Filter life events from this date (ISO 8601 format)
6336
+ */
6337
+ from?: string;
6338
+ /**
6339
+ * Number of items per page (default: 20, max: 100)
6340
+ */
6341
+ limit?: number;
6342
+ /**
6343
+ * Page number for pagination (default: 1)
6344
+ */
6345
+ page?: number;
6346
+ /**
6347
+ * Search term for description (case-insensitive partial match)
6348
+ */
6349
+ q?: string;
6350
+ /**
6351
+ * Region code for tenant context (decorative for life events)
6352
+ */
6353
+ region: 'cn' | 'us' | 'de' | 'gb';
6354
+ /**
6355
+ * Filter life events to this date (ISO 8601 format)
6356
+ */
6357
+ to?: string;
6358
+ /**
6359
+ * Filter by life event type (exact match)
6360
+ */
6361
+ type?: string;
6362
+ };
6363
+
6364
+ export type EventControllerFindAllResponse = EventListResponseDto;
6365
+
6366
+ export type EventControllerFindOneData = {
6367
+ /**
6368
+ * Life event ID
6369
+ */
6370
+ id: string;
6371
+ /**
6372
+ * Region code for tenant context (decorative for life events)
6373
+ */
6374
+ region: 'cn' | 'us' | 'de' | 'gb';
6375
+ };
6376
+
6377
+ export type EventControllerFindOneResponse = EventResponseDto;
6378
+
6379
+ export type EventControllerUpdateData = {
6380
+ /**
6381
+ * Life event ID
6382
+ */
6383
+ id: string;
6384
+ /**
6385
+ * Region code for tenant context (decorative for life events)
6386
+ */
6387
+ region: 'cn' | 'us' | 'de' | 'gb';
6388
+ requestBody: UpdateBeanEventDto;
6389
+ };
6390
+
6391
+ export type EventControllerUpdateResponse = EventResponseDto;
6392
+
6393
+ export type EventControllerDeleteData = {
6394
+ /**
6395
+ * Life event ID
6396
+ */
6397
+ id: string;
6398
+ /**
6399
+ * Region code for tenant context (decorative for life events)
6400
+ */
6401
+ region: 'cn' | 'us' | 'de' | 'gb';
6402
+ };
6403
+
6404
+ export type EventControllerDeleteResponse = void;
6405
+
6406
+ export type EventControllerGetSliceData = {
6407
+ accountPattern: string;
6408
+ granularity: string;
6409
+ /**
6410
+ * Life event ID
6411
+ */
6412
+ id: string;
6413
+ /**
6414
+ * Region code for tenant context (decorative for life events)
6415
+ */
6416
+ region: 'cn' | 'us' | 'de' | 'gb';
6417
+ };
6418
+
6419
+ export type EventControllerGetSliceResponse = unknown;
6420
+
5478
6421
  export type ExportControllerExportBeancountResponse = unknown;
5479
6422
 
5480
6423
  export type FileImportControllerImportFileData = {
@@ -5623,9 +6566,9 @@ export type ProviderSyncControllerSyncData = {
5623
6566
  | 'beancount-direct'
5624
6567
  | 'parsed-bill';
5625
6568
  /**
5626
- * Region code
6569
+ * Region code for tenant context
5627
6570
  */
5628
- region: unknown;
6571
+ region: 'cn' | 'us' | 'de' | 'gb';
5629
6572
  requestBody: ProviderSyncDto;
5630
6573
  };
5631
6574
 
@@ -5664,6 +6607,29 @@ export type TelemetryControllerReportTelemetryData = {
5664
6607
 
5665
6608
  export type TelemetryControllerReportTelemetryResponse = unknown;
5666
6609
 
6610
+ export type TelemetryControllerReportCoverageMissData = {
6611
+ /**
6612
+ * Region code for tenant context
6613
+ */
6614
+ region: 'cn' | 'us' | 'de' | 'gb';
6615
+ requestBody: UncoveredFormatMissDto;
6616
+ };
6617
+
6618
+ export type TelemetryControllerReportCoverageMissResponse = unknown;
6619
+
6620
+ export type TelemetryControllerGetCoverageMetricsData = {
6621
+ /**
6622
+ * Region code for tenant context
6623
+ */
6624
+ region: 'cn' | 'us' | 'de' | 'gb';
6625
+ /**
6626
+ * Top-N uncovered formats (default 10)
6627
+ */
6628
+ topN?: unknown;
6629
+ };
6630
+
6631
+ export type TelemetryControllerGetCoverageMetricsResponse = unknown;
6632
+
5667
6633
  export type NlpControllerProcessNaturalLanguageData = {
5668
6634
  /**
5669
6635
  * Region code for tenant context
@@ -5695,58 +6661,203 @@ export type NlpControllerGetSessionData = {
5695
6661
  * Region code for tenant context
5696
6662
  */
5697
6663
  region: 'cn' | 'us' | 'de' | 'gb';
5698
- /**
5699
- * Specific session ID to get (defaults to user session)
5700
- */
5701
- sessionId?: string;
6664
+ /**
6665
+ * Specific session ID to get (defaults to user session)
6666
+ */
6667
+ sessionId?: string;
6668
+ };
6669
+
6670
+ export type NlpControllerGetSessionResponse = unknown;
6671
+
6672
+ export type DashboardControllerGetNetWorthData = {
6673
+ /**
6674
+ * Date for balance calculation (ISO 8601 format)
6675
+ */
6676
+ date?: string;
6677
+ /**
6678
+ * Region code for tenant context
6679
+ */
6680
+ region: 'cn' | 'us' | 'de' | 'gb';
6681
+ };
6682
+
6683
+ export type DashboardControllerGetNetWorthResponse = NetWorthResponseDto;
6684
+
6685
+ export type DashboardControllerGetAccountsData = {
6686
+ /**
6687
+ * Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
6688
+ */
6689
+ accountId?: string;
6690
+ /**
6691
+ * Date for balance calculation (ISO 8601 format)
6692
+ */
6693
+ date?: string;
6694
+ /**
6695
+ * Grouping strategy
6696
+ */
6697
+ groupBy?:
6698
+ | 'platform'
6699
+ | 'assetClass'
6700
+ | 'holdingAssetClass'
6701
+ | 'holdingAssetClassByAccount';
6702
+ /**
6703
+ * Region code for tenant context
6704
+ */
6705
+ region: 'cn' | 'us' | 'de' | 'gb';
6706
+ };
6707
+
6708
+ export type DashboardControllerGetAccountsResponse =
6709
+ | AccountsResponseDto
6710
+ | AssetClassAccountsResponseDto
6711
+ | HoldingAssetClassCrossAccountResponseDto;
6712
+
6713
+ export type DashboardControllerGetCashFlowData = {
6714
+ /**
6715
+ * Period in YYYY-MM format
6716
+ */
6717
+ period: string;
6718
+ /**
6719
+ * Region code for tenant context
6720
+ */
6721
+ region: 'cn' | 'us' | 'de' | 'gb';
6722
+ };
6723
+
6724
+ export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6725
+
6726
+ export type DashboardControllerGetExpensesData = {
6727
+ /**
6728
+ * Grouping strategy
6729
+ */
6730
+ groupBy?: 'category';
6731
+ /**
6732
+ * Time window (1m = current calendar month)
6733
+ */
6734
+ period?: '1m' | '3m' | '6m' | '1y';
6735
+ /**
6736
+ * Region code for tenant context
6737
+ */
6738
+ region: 'cn' | 'us' | 'de' | 'gb';
6739
+ };
6740
+
6741
+ export type DashboardControllerGetExpensesResponse =
6742
+ ExpensesByCategoryResponseDto;
6743
+
6744
+ export type HoldingPnlControllerGetHoldingPnlData = {
6745
+ /**
6746
+ * Scope to a single account
6747
+ */
6748
+ accountId?: string;
6749
+ /**
6750
+ * As-of date (ISO 8601), defaults to today
6751
+ */
6752
+ asOf?: string;
6753
+ /**
6754
+ * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
6755
+ */
6756
+ method?: 'FIFO' | 'average';
6757
+ /**
6758
+ * Region code for tenant context
6759
+ */
6760
+ region: 'cn' | 'us' | 'de' | 'gb';
6761
+ };
6762
+
6763
+ export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6764
+
6765
+ export type PriceControllerCreateData = {
6766
+ /**
6767
+ * Region code for tenant context
6768
+ */
6769
+ region: 'cn' | 'us' | 'de' | 'gb';
6770
+ requestBody: CreateBeanPriceDto;
6771
+ };
6772
+
6773
+ export type PriceControllerCreateResponse = PriceResponseDto;
6774
+
6775
+ export type PriceControllerFindAllData = {
6776
+ /**
6777
+ * Filter by currency (e.g., BTC, AAPL, USD)
6778
+ */
6779
+ currency?: string;
6780
+ /**
6781
+ * Filter prices from this date (ISO 8601 format)
6782
+ */
6783
+ dateFrom?: string;
6784
+ /**
6785
+ * Filter prices to this date (ISO 8601 format)
6786
+ */
6787
+ dateTo?: string;
6788
+ /**
6789
+ * Number of items per page (default: 20, max: 100)
6790
+ */
6791
+ limit?: number;
6792
+ /**
6793
+ * Page number for pagination (default: 1)
6794
+ */
6795
+ page?: number;
6796
+ /**
6797
+ * Filter by quote currency (pricing currency, e.g., USD, CNY)
6798
+ */
6799
+ quoteCurrency?: string;
6800
+ /**
6801
+ * Region code for tenant context
6802
+ */
6803
+ region: 'cn' | 'us' | 'de' | 'gb';
6804
+ /**
6805
+ * Search term for currency or quoteCurrency (case-insensitive partial match)
6806
+ */
6807
+ search?: string;
6808
+ };
6809
+
6810
+ export type PriceControllerFindAllResponse = PriceListResponseDto;
6811
+
6812
+ export type PriceControllerFindOneData = {
6813
+ /**
6814
+ * Price ID
6815
+ */
6816
+ id: string;
6817
+ /**
6818
+ * Region code for tenant context
6819
+ */
6820
+ region: 'cn' | 'us' | 'de' | 'gb';
5702
6821
  };
5703
6822
 
5704
- export type NlpControllerGetSessionResponse = unknown;
6823
+ export type PriceControllerFindOneResponse = PriceResponseDto;
5705
6824
 
5706
- export type DashboardControllerGetNetWorthData = {
6825
+ export type PriceControllerUpdateData = {
5707
6826
  /**
5708
- * Date for balance calculation (ISO 8601 format)
6827
+ * Price ID
5709
6828
  */
5710
- date?: string;
6829
+ id: string;
5711
6830
  /**
5712
6831
  * Region code for tenant context
5713
6832
  */
5714
6833
  region: 'cn' | 'us' | 'de' | 'gb';
6834
+ requestBody: UpdateBeanPriceDto;
5715
6835
  };
5716
6836
 
5717
- export type DashboardControllerGetNetWorthResponse = NetWorthResponseDto;
6837
+ export type PriceControllerUpdateResponse = PriceResponseDto;
5718
6838
 
5719
- export type DashboardControllerGetAccountsData = {
5720
- /**
5721
- * Date for balance calculation (ISO 8601 format)
5722
- */
5723
- date?: string;
6839
+ export type PriceControllerDeleteData = {
5724
6840
  /**
5725
- * Grouping strategy
6841
+ * Price ID
5726
6842
  */
5727
- groupBy?: 'platform' | 'assetClass';
6843
+ id: string;
5728
6844
  /**
5729
6845
  * Region code for tenant context
5730
6846
  */
5731
6847
  region: 'cn' | 'us' | 'de' | 'gb';
5732
6848
  };
5733
6849
 
5734
- export type DashboardControllerGetAccountsResponse =
5735
- | AccountsResponseDto
5736
- | AssetClassAccountsResponseDto;
6850
+ export type PriceControllerDeleteResponse = void;
5737
6851
 
5738
- export type DashboardControllerGetCashFlowData = {
5739
- /**
5740
- * Period in YYYY-MM format
5741
- */
5742
- period: string;
6852
+ export type PriceControllerBulkCreateData = {
5743
6853
  /**
5744
6854
  * Region code for tenant context
5745
6855
  */
5746
6856
  region: 'cn' | 'us' | 'de' | 'gb';
6857
+ requestBody: Array<string>;
5747
6858
  };
5748
6859
 
5749
- export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6860
+ export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
5750
6861
 
5751
6862
  export type ReportingControllerGetPortfolioTrendsData = {
5752
6863
  /**
@@ -5766,6 +6877,24 @@ export type ReportingControllerGetPortfolioTrendsData = {
5766
6877
  export type ReportingControllerGetPortfolioTrendsResponse =
5767
6878
  PortfolioTrendsResponseDto;
5768
6879
 
6880
+ export type ReportingControllerGetCashFlowTrendsData = {
6881
+ /**
6882
+ * Data granularity (accepted for API symmetry; v1 returns month buckets)
6883
+ */
6884
+ granularity?: 'day' | 'week' | 'month';
6885
+ /**
6886
+ * Time period
6887
+ */
6888
+ period?: '1m' | '3m' | '6m' | '1y';
6889
+ /**
6890
+ * Region code for tenant context
6891
+ */
6892
+ region: 'cn' | 'us' | 'de' | 'gb';
6893
+ };
6894
+
6895
+ export type ReportingControllerGetCashFlowTrendsResponse =
6896
+ CashFlowTrendsResponseDto;
6897
+
5769
6898
  export type ReportingControllerGenerateSnapshotData = {
5770
6899
  /**
5771
6900
  * Region code for tenant context
@@ -6041,6 +7170,48 @@ export type $OpenApiTs = {
6041
7170
  };
6042
7171
  };
6043
7172
  };
7173
+ '/api/v1/{region}/bean/transactions/{id}/correct': {
7174
+ post: {
7175
+ req: TransactionControllerCorrectData;
7176
+ res: {
7177
+ /**
7178
+ * Corrected transaction created
7179
+ */
7180
+ 201: TransactionDetailDto;
7181
+ /**
7182
+ * Original transaction not found
7183
+ */
7184
+ 404: ApiProblemResponseDto;
7185
+ /**
7186
+ * Original no longer ACTIVE (concurrent modification)
7187
+ */
7188
+ 409: ApiProblemResponseDto;
7189
+ /**
7190
+ * Pipeline validation failed (does not balance, invalid accounts)
7191
+ */
7192
+ 422: ApiProblemResponseDto;
7193
+ };
7194
+ };
7195
+ };
7196
+ '/api/v1/{region}/bean/transactions/tags': {
7197
+ get: {
7198
+ req: TransactionControllerSuggestTagsData;
7199
+ res: {
7200
+ /**
7201
+ * Tag suggestions
7202
+ */
7203
+ 200: TagSuggestionsResponseDto;
7204
+ /**
7205
+ * Validation failed
7206
+ */
7207
+ 400: ApiProblemResponseDto;
7208
+ /**
7209
+ * Authentication required
7210
+ */
7211
+ 401: ApiProblemResponseDto;
7212
+ };
7213
+ };
7214
+ };
6044
7215
  '/api/v1/{region}/bean/transactions/{id}': {
6045
7216
  get: {
6046
7217
  req: TransactionControllerGetDetailData;
@@ -7155,6 +8326,102 @@ export type $OpenApiTs = {
7155
8326
  };
7156
8327
  };
7157
8328
  };
8329
+ '/api/v1/{region}/bean/events': {
8330
+ post: {
8331
+ req: EventControllerCreateData;
8332
+ res: {
8333
+ /**
8334
+ * Life event created successfully
8335
+ */
8336
+ 201: EventResponseDto;
8337
+ /**
8338
+ * Life event already exists for this (userId, type, date) combination
8339
+ */
8340
+ 409: unknown;
8341
+ };
8342
+ };
8343
+ get: {
8344
+ req: EventControllerFindAllData;
8345
+ res: {
8346
+ /**
8347
+ * Life events retrieved successfully
8348
+ */
8349
+ 200: EventListResponseDto;
8350
+ };
8351
+ };
8352
+ };
8353
+ '/api/v1/{region}/bean/events/{id}': {
8354
+ get: {
8355
+ req: EventControllerFindOneData;
8356
+ res: {
8357
+ /**
8358
+ * Life event retrieved successfully
8359
+ */
8360
+ 200: EventResponseDto;
8361
+ /**
8362
+ * Life event not found
8363
+ */
8364
+ 404: unknown;
8365
+ };
8366
+ };
8367
+ put: {
8368
+ req: EventControllerUpdateData;
8369
+ res: {
8370
+ /**
8371
+ * Life event updated successfully
8372
+ */
8373
+ 200: EventResponseDto;
8374
+ /**
8375
+ * If-Match header is not a valid ISO 8601 date
8376
+ */
8377
+ 400: unknown;
8378
+ /**
8379
+ * Life event not found
8380
+ */
8381
+ 404: unknown;
8382
+ /**
8383
+ * Updated event conflicts with an existing (userId, type, date) combination
8384
+ */
8385
+ 409: unknown;
8386
+ /**
8387
+ * If-Match precondition failed (updatedAt mismatch)
8388
+ */
8389
+ 412: unknown;
8390
+ };
8391
+ };
8392
+ delete: {
8393
+ req: EventControllerDeleteData;
8394
+ res: {
8395
+ /**
8396
+ * Life event deleted successfully
8397
+ */
8398
+ 204: void;
8399
+ /**
8400
+ * Life event not found
8401
+ */
8402
+ 404: unknown;
8403
+ };
8404
+ };
8405
+ };
8406
+ '/api/v1/{region}/bean/events/{id}/slice': {
8407
+ get: {
8408
+ req: EventControllerGetSliceData;
8409
+ res: {
8410
+ /**
8411
+ * Time-series sliced by the life event range
8412
+ */
8413
+ 200: unknown;
8414
+ /**
8415
+ * accountPattern query param is empty
8416
+ */
8417
+ 400: unknown;
8418
+ /**
8419
+ * Life event not found
8420
+ */
8421
+ 404: unknown;
8422
+ };
8423
+ };
8424
+ };
7158
8425
  '/api/v1/{region}/bean/export/beancount': {
7159
8426
  get: {
7160
8427
  res: {
@@ -7445,6 +8712,32 @@ export type $OpenApiTs = {
7445
8712
  };
7446
8713
  };
7447
8714
  };
8715
+ '/api/v1/{region}/bean/import/parser-coverage-miss': {
8716
+ post: {
8717
+ req: TelemetryControllerReportCoverageMissData;
8718
+ res: {
8719
+ /**
8720
+ * Coverage miss report received
8721
+ */
8722
+ 200: unknown;
8723
+ /**
8724
+ * Unauthorized
8725
+ */
8726
+ 401: unknown;
8727
+ };
8728
+ };
8729
+ };
8730
+ '/api/v1/{region}/bean/import/parser-coverage-metrics': {
8731
+ get: {
8732
+ req: TelemetryControllerGetCoverageMetricsData;
8733
+ res: {
8734
+ /**
8735
+ * Coverage metrics
8736
+ */
8737
+ 200: unknown;
8738
+ };
8739
+ };
8740
+ };
7448
8741
  '/api/v1/{region}/bean/nlp/process': {
7449
8742
  post: {
7450
8743
  req: NlpControllerProcessNaturalLanguageData;
@@ -7514,7 +8807,10 @@ export type $OpenApiTs = {
7514
8807
  /**
7515
8808
  * Accounts retrieved successfully. Response type depends on groupBy parameter.
7516
8809
  */
7517
- 200: AccountsResponseDto | AssetClassAccountsResponseDto;
8810
+ 200:
8811
+ | AccountsResponseDto
8812
+ | AssetClassAccountsResponseDto
8813
+ | HoldingAssetClassCrossAccountResponseDto;
7518
8814
  /**
7519
8815
  * User not authenticated
7520
8816
  */
@@ -7541,6 +8837,128 @@ export type $OpenApiTs = {
7541
8837
  };
7542
8838
  };
7543
8839
  };
8840
+ '/api/v1/{region}/dashboard/expenses': {
8841
+ get: {
8842
+ req: DashboardControllerGetExpensesData;
8843
+ res: {
8844
+ /**
8845
+ * Expenses retrieved successfully
8846
+ */
8847
+ 200: ExpensesByCategoryResponseDto;
8848
+ /**
8849
+ * Invalid groupBy or period
8850
+ */
8851
+ 400: unknown;
8852
+ /**
8853
+ * User not authenticated
8854
+ */
8855
+ 401: unknown;
8856
+ };
8857
+ };
8858
+ };
8859
+ '/api/v1/{region}/investment/holdings/pnl': {
8860
+ get: {
8861
+ req: HoldingPnlControllerGetHoldingPnlData;
8862
+ res: {
8863
+ /**
8864
+ * Holding P&L retrieved successfully
8865
+ */
8866
+ 200: HoldingPnlResponseDto;
8867
+ /**
8868
+ * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
8869
+ */
8870
+ 400: unknown;
8871
+ /**
8872
+ * User not authenticated
8873
+ */
8874
+ 401: unknown;
8875
+ };
8876
+ };
8877
+ };
8878
+ '/api/v1/{region}/bean/prices': {
8879
+ post: {
8880
+ req: PriceControllerCreateData;
8881
+ res: {
8882
+ /**
8883
+ * Price created successfully
8884
+ */
8885
+ 201: PriceResponseDto;
8886
+ /**
8887
+ * Currency or quoteCurrency commodity not found
8888
+ */
8889
+ 404: unknown;
8890
+ /**
8891
+ * Price already exists for this currency pair and date
8892
+ */
8893
+ 409: unknown;
8894
+ };
8895
+ };
8896
+ get: {
8897
+ req: PriceControllerFindAllData;
8898
+ res: {
8899
+ /**
8900
+ * Prices retrieved successfully
8901
+ */
8902
+ 200: PriceListResponseDto;
8903
+ };
8904
+ };
8905
+ };
8906
+ '/api/v1/{region}/bean/prices/{id}': {
8907
+ get: {
8908
+ req: PriceControllerFindOneData;
8909
+ res: {
8910
+ /**
8911
+ * Price retrieved successfully
8912
+ */
8913
+ 200: PriceResponseDto;
8914
+ /**
8915
+ * Price not found
8916
+ */
8917
+ 404: unknown;
8918
+ };
8919
+ };
8920
+ put: {
8921
+ req: PriceControllerUpdateData;
8922
+ res: {
8923
+ /**
8924
+ * Price updated successfully
8925
+ */
8926
+ 200: PriceResponseDto;
8927
+ /**
8928
+ * Price not found
8929
+ */
8930
+ 404: unknown;
8931
+ /**
8932
+ * Updated price conflicts with existing price
8933
+ */
8934
+ 409: unknown;
8935
+ };
8936
+ };
8937
+ delete: {
8938
+ req: PriceControllerDeleteData;
8939
+ res: {
8940
+ /**
8941
+ * Price deleted successfully
8942
+ */
8943
+ 204: void;
8944
+ /**
8945
+ * Price not found
8946
+ */
8947
+ 404: unknown;
8948
+ };
8949
+ };
8950
+ };
8951
+ '/api/v1/{region}/bean/prices/bulk': {
8952
+ post: {
8953
+ req: PriceControllerBulkCreateData;
8954
+ res: {
8955
+ /**
8956
+ * Prices created successfully
8957
+ */
8958
+ 201: Array<PriceResponseDto>;
8959
+ };
8960
+ };
8961
+ };
7544
8962
  '/api/v1/{region}/reporting/portfolio/trends': {
7545
8963
  get: {
7546
8964
  req: ReportingControllerGetPortfolioTrendsData;
@@ -7556,6 +8974,21 @@ export type $OpenApiTs = {
7556
8974
  };
7557
8975
  };
7558
8976
  };
8977
+ '/api/v1/{region}/reporting/cash-flow/trends': {
8978
+ get: {
8979
+ req: ReportingControllerGetCashFlowTrendsData;
8980
+ res: {
8981
+ /**
8982
+ * Cash-flow trends retrieved successfully
8983
+ */
8984
+ 200: CashFlowTrendsResponseDto;
8985
+ /**
8986
+ * User not authenticated
8987
+ */
8988
+ 401: unknown;
8989
+ };
8990
+ };
8991
+ };
7559
8992
  '/api/v1/{region}/reporting/snapshots/generate': {
7560
8993
  post: {
7561
8994
  req: ReportingControllerGenerateSnapshotData;