@firela/api-types 0.0.0-canary.209966 → 0.0.0-canary.32edff08

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.
@@ -8,6 +8,12 @@ export const $CreateAccountDto = {
8
8
  description: 'Account path (hierarchical, colon-separated)',
9
9
  example: 'Assets:CN:Bank:ICBC:Checking'
10
10
  },
11
+ displayName: {
12
+ type: 'string',
13
+ description:
14
+ 'Display name to distinguish accounts at the same path (default: "")',
15
+ example: '工资卡'
16
+ },
11
17
  openDate: {
12
18
  format: 'date-time',
13
19
  type: 'string',
@@ -86,6 +92,12 @@ export const $AccountResponseDto = {
86
92
  description: 'Account path (hierarchical, colon-separated)',
87
93
  example: 'Assets:CN:Bank:ICBC:Checking'
88
94
  },
95
+ displayName: {
96
+ type: 'string',
97
+ description:
98
+ 'Display name distinguishing multiple accounts at the same path',
99
+ example: '工资卡'
100
+ },
89
101
  type: {
90
102
  type: 'string',
91
103
  description: 'Account type (root segment)',
@@ -180,6 +192,7 @@ export const $AccountResponseDto = {
180
192
  required: [
181
193
  'id',
182
194
  'path',
195
+ 'displayName',
183
196
  'type',
184
197
  'status',
185
198
  'openDate',
@@ -212,6 +225,11 @@ export const $AccountListResponseDto = {
212
225
  export const $UpdateAccountDto = {
213
226
  type: 'object',
214
227
  properties: {
228
+ displayName: {
229
+ type: 'string',
230
+ description: 'Display name to distinguish accounts at the same path',
231
+ example: '招行工资卡'
232
+ },
215
233
  currencies: {
216
234
  description: 'Allowed currencies (null = no restriction)',
217
235
  example: ['CNY', 'USD'],
@@ -251,7 +269,7 @@ export const $UpdateAccountDto = {
251
269
  }
252
270
  },
253
271
  platformId: {
254
- type: 'object',
272
+ type: 'string',
255
273
  description:
256
274
  'Platform ID (references Platform.id), null to clear association',
257
275
  example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2',
@@ -292,6 +310,162 @@ export const $ReopenAccountDto = {
292
310
  }
293
311
  } as const;
294
312
 
313
+ export const $AccountStandardResponseDto = {
314
+ type: 'object',
315
+ properties: {
316
+ path: {
317
+ type: 'string',
318
+ description: 'Account path (hierarchical, colon-separated)',
319
+ example: 'Assets:CN:Bank:ICBC:Checking'
320
+ },
321
+ type: {
322
+ type: 'string',
323
+ description: 'Account type in Beancount hierarchy',
324
+ enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
325
+ example: 'Assets'
326
+ },
327
+ i18nKey: {
328
+ type: 'string',
329
+ description: 'i18n key for localized display name',
330
+ example: 'account.assets.cn.bank.icbc.checking'
331
+ },
332
+ name: {
333
+ type: 'string',
334
+ description: 'Short localized display name',
335
+ example: 'Housing Fund'
336
+ },
337
+ description: {
338
+ type: 'string',
339
+ description: 'Account description (stable semantics only)',
340
+ example: 'ICBC checking account for daily transactions'
341
+ },
342
+ tags: {
343
+ description: 'Account tags for categorization',
344
+ example: ['bank', 'checking', 'primary'],
345
+ type: 'array',
346
+ items: {
347
+ type: 'string'
348
+ }
349
+ },
350
+ icon: {
351
+ type: 'string',
352
+ description: 'Icon identifier for UI display',
353
+ example: 'bank-icbc'
354
+ }
355
+ },
356
+ required: ['path', 'type', 'i18nKey', 'description', 'tags', 'icon']
357
+ } as const;
358
+
359
+ export const $AccountStandardListResponseDto = {
360
+ type: 'object',
361
+ properties: {
362
+ items: {
363
+ description: 'Array of account templates',
364
+ type: 'array',
365
+ items: {
366
+ $ref: '#/components/schemas/AccountStandardResponseDto'
367
+ }
368
+ },
369
+ total: {
370
+ type: 'number',
371
+ description: 'Total number of account templates',
372
+ example: 150
373
+ },
374
+ region: {
375
+ type: 'string',
376
+ description: 'Region code',
377
+ example: 'CN'
378
+ }
379
+ },
380
+ required: ['items', 'total', 'region']
381
+ } as const;
382
+
383
+ export const $TemplateMetadataDto = {
384
+ type: 'object',
385
+ properties: {
386
+ extendable: {
387
+ type: 'boolean',
388
+ description: 'Whether this path can be extended',
389
+ example: true
390
+ },
391
+ rootType: {
392
+ type: 'string',
393
+ description: 'Root account type',
394
+ example: 'Assets'
395
+ }
396
+ },
397
+ required: ['extendable', 'rootType']
398
+ } as const;
399
+
400
+ export const $TemplateMetadataResponseDto = {
401
+ type: 'object',
402
+ properties: {
403
+ metadata: {
404
+ $ref: '#/components/schemas/TemplateMetadataDto'
405
+ }
406
+ }
407
+ } as const;
408
+
409
+ export const $RegionConfigDto = {
410
+ type: 'object',
411
+ properties: {
412
+ currency: {
413
+ type: 'string',
414
+ example: 'EUR'
415
+ },
416
+ dateFormat: {
417
+ type: 'string',
418
+ example: 'DD.MM.YYYY'
419
+ },
420
+ locale: {
421
+ type: 'string',
422
+ example: 'de-DE'
423
+ }
424
+ },
425
+ required: ['currency', 'dateFormat', 'locale']
426
+ } as const;
427
+
428
+ export const $RegionInfoDto = {
429
+ type: 'object',
430
+ properties: {
431
+ code: {
432
+ type: 'string',
433
+ example: 'de'
434
+ },
435
+ displayName: {
436
+ type: 'string',
437
+ example: 'Germany'
438
+ },
439
+ parent: {
440
+ type: 'string'
441
+ },
442
+ chain: {
443
+ example: ['de'],
444
+ type: 'array',
445
+ items: {
446
+ type: 'string'
447
+ }
448
+ },
449
+ config: {
450
+ $ref: '#/components/schemas/RegionConfigDto'
451
+ }
452
+ },
453
+ required: ['code', 'displayName', 'chain', 'config']
454
+ } as const;
455
+
456
+ export const $RegionsMetadataResponseDto = {
457
+ type: 'object',
458
+ properties: {
459
+ regions: {
460
+ type: 'array',
461
+ items: {
462
+ $ref: '#/components/schemas/RegionInfoDto'
463
+ }
464
+ }
465
+ },
466
+ required: ['regions']
467
+ } as const;
468
+
295
469
  export const $CreatePostingDto = {
296
470
  type: 'object',
297
471
  properties: {
@@ -409,7 +583,8 @@ export const $PostingResponseDto = {
409
583
  },
410
584
  units: {
411
585
  type: 'string',
412
- description: 'Amount (may be null if interpolated)',
586
+ description:
587
+ 'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
413
588
  example: '100.50'
414
589
  },
415
590
  currency: {
@@ -607,6 +782,65 @@ export const $ApiProblemResponseDto = {
607
782
  required: ['type', 'title', 'status', 'detail']
608
783
  } as const;
609
784
 
785
+ export const $BatchCreateTransactionDto = {
786
+ type: 'object',
787
+ properties: {
788
+ transactions: {
789
+ description: 'Array of transactions to create',
790
+ minItems: 1,
791
+ maxItems: 100,
792
+ type: 'array',
793
+ items: {
794
+ $ref: '#/components/schemas/CreateTransactionDto'
795
+ }
796
+ }
797
+ },
798
+ required: ['transactions']
799
+ } as const;
800
+
801
+ export const $BatchTransactionErrorDto = {
802
+ type: 'object',
803
+ properties: {
804
+ index: {
805
+ type: 'number',
806
+ description: 'Index of failed transaction in the input array',
807
+ example: 0
808
+ },
809
+ error: {
810
+ type: 'string',
811
+ description: 'Error message describing the failure',
812
+ example: 'Transaction does not balance'
813
+ },
814
+ errorCode: {
815
+ type: 'string',
816
+ description: 'Structured error code for programmatic handling',
817
+ example: 'INSUFFICIENT_QUANTITY'
818
+ }
819
+ },
820
+ required: ['index', 'error']
821
+ } as const;
822
+
823
+ export const $BatchTransactionResponseDto = {
824
+ type: 'object',
825
+ properties: {
826
+ succeeded: {
827
+ description: 'Successfully created transactions',
828
+ type: 'array',
829
+ items: {
830
+ $ref: '#/components/schemas/TransactionResponseDto'
831
+ }
832
+ },
833
+ failed: {
834
+ description: 'Failed transactions with error details',
835
+ type: 'array',
836
+ items: {
837
+ $ref: '#/components/schemas/BatchTransactionErrorDto'
838
+ }
839
+ }
840
+ },
841
+ required: ['succeeded', 'failed']
842
+ } as const;
843
+
610
844
  export const $PostingDetailDto = {
611
845
  type: 'object',
612
846
  properties: {
@@ -627,7 +861,8 @@ export const $PostingDetailDto = {
627
861
  },
628
862
  units: {
629
863
  type: 'string',
630
- description: 'Amount (may be null if interpolated)',
864
+ description:
865
+ 'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
631
866
  example: '100.50'
632
867
  },
633
868
  currency: {
@@ -742,8 +977,8 @@ export const $TransactionDetailDto = {
742
977
  },
743
978
  sourceType: {
744
979
  type: 'string',
745
- description: 'Source type (how the transaction was created)',
746
- enum: ['NLP', 'CSV', 'OCR', 'API']
980
+ description:
981
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
747
982
  },
748
983
  sourcePlatform: {
749
984
  type: 'string',
@@ -819,6 +1054,37 @@ export const $TransactionListResponseDto = {
819
1054
  required: ['data', 'total', 'limit', 'offset']
820
1055
  } as const;
821
1056
 
1057
+ export const $TagSuggestionDto = {
1058
+ type: 'object',
1059
+ properties: {
1060
+ tag: {
1061
+ type: 'string',
1062
+ description: 'Tag name',
1063
+ example: 'Monthly'
1064
+ },
1065
+ count: {
1066
+ type: 'number',
1067
+ description: 'Usage count across ACTIVE transactions',
1068
+ example: 12
1069
+ }
1070
+ },
1071
+ required: ['tag', 'count']
1072
+ } as const;
1073
+
1074
+ export const $TagSuggestionsResponseDto = {
1075
+ type: 'object',
1076
+ properties: {
1077
+ data: {
1078
+ description: 'Tag suggestions sorted as requested',
1079
+ type: 'array',
1080
+ items: {
1081
+ $ref: '#/components/schemas/TagSuggestionDto'
1082
+ }
1083
+ }
1084
+ },
1085
+ required: ['data']
1086
+ } as const;
1087
+
822
1088
  export const $UpdateTransactionDto = {
823
1089
  type: 'object',
824
1090
  properties: {
@@ -876,121 +1142,56 @@ export const $UpdateTransactionDto = {
876
1142
  }
877
1143
  } as const;
878
1144
 
879
- export const $AccountStandardResponseDto = {
1145
+ export const $BalanceResponseDto = {
880
1146
  type: 'object',
881
1147
  properties: {
882
- path: {
1148
+ account: {
883
1149
  type: 'string',
884
- description: 'Account path (hierarchical, colon-separated)',
885
- example: 'Assets:CN:Bank:ICBC:Checking'
1150
+ description: 'Account name',
1151
+ example: 'Assets:Bank:Checking'
886
1152
  },
887
- type: {
1153
+ balance: {
888
1154
  type: 'string',
889
- description: 'Account type in Beancount hierarchy',
890
- enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
891
- example: 'Assets'
1155
+ description: 'Balance amount (decimal string for precision)',
1156
+ example: '12345.67'
892
1157
  },
893
- i18nKey: {
1158
+ currency: {
894
1159
  type: 'string',
895
- description: 'i18n key for localized display name',
896
- example: 'account.assets.cn.bank.icbc.checking'
1160
+ description: 'Currency code',
1161
+ example: 'USD'
897
1162
  },
898
- description: {
1163
+ date: {
899
1164
  type: 'string',
900
- description: 'Account description',
901
- example: 'ICBC checking account for daily transactions'
1165
+ description: 'Date of the balance calculation (ISO 8601)',
1166
+ example: '2024-12-31T00:00:00.000Z'
1167
+ }
1168
+ },
1169
+ required: ['account', 'balance', 'currency', 'date']
1170
+ } as const;
1171
+
1172
+ export const $MultiCurrencyBalanceResponseDto = {
1173
+ type: 'object',
1174
+ properties: {
1175
+ account: {
1176
+ type: 'string',
1177
+ description: 'Account name',
1178
+ example: 'Assets:Bank:Checking'
902
1179
  },
903
- tags: {
904
- description: 'Account tags for categorization',
905
- example: ['bank', 'checking', 'primary'],
906
- type: 'array',
907
- items: {
908
- type: 'string'
1180
+ balances: {
1181
+ type: 'object',
1182
+ description: 'Balances by currency',
1183
+ example: {
1184
+ USD: '12345.67',
1185
+ CNY: '100000.00'
909
1186
  }
910
1187
  },
911
- icon: {
1188
+ date: {
912
1189
  type: 'string',
913
- description: 'Icon identifier for UI display',
914
- example: 'bank-icbc'
1190
+ description: 'Date of the balance calculation (ISO 8601)',
1191
+ example: '2024-12-31T00:00:00.000Z'
915
1192
  }
916
1193
  },
917
- required: ['path', 'type']
918
- } as const;
919
-
920
- export const $AccountStandardListResponseDto = {
921
- type: 'object',
922
- properties: {
923
- items: {
924
- description: 'Array of account templates',
925
- type: 'array',
926
- items: {
927
- $ref: '#/components/schemas/AccountStandardResponseDto'
928
- }
929
- },
930
- total: {
931
- type: 'number',
932
- description: 'Total number of account templates',
933
- example: 150
934
- },
935
- region: {
936
- type: 'string',
937
- description: 'Region code',
938
- example: 'CN'
939
- }
940
- },
941
- required: ['items', 'total', 'region']
942
- } as const;
943
-
944
- export const $BalanceResponseDto = {
945
- type: 'object',
946
- properties: {
947
- account: {
948
- type: 'string',
949
- description: 'Account name',
950
- example: 'Assets:Bank:Checking'
951
- },
952
- balance: {
953
- type: 'string',
954
- description: 'Balance amount (decimal string for precision)',
955
- example: '12345.67'
956
- },
957
- currency: {
958
- type: 'string',
959
- description: 'Currency code',
960
- example: 'USD'
961
- },
962
- date: {
963
- type: 'string',
964
- description: 'Date of the balance calculation (ISO 8601)',
965
- example: '2024-12-31T00:00:00.000Z'
966
- }
967
- },
968
- required: ['account', 'balance', 'currency', 'date']
969
- } as const;
970
-
971
- export const $MultiCurrencyBalanceResponseDto = {
972
- type: 'object',
973
- properties: {
974
- account: {
975
- type: 'string',
976
- description: 'Account name',
977
- example: 'Assets:Bank:Checking'
978
- },
979
- balances: {
980
- type: 'object',
981
- description: 'Balances by currency',
982
- example: {
983
- USD: '12345.67',
984
- CNY: '100000.00'
985
- }
986
- },
987
- date: {
988
- type: 'string',
989
- description: 'Date of the balance calculation (ISO 8601)',
990
- example: '2024-12-31T00:00:00.000Z'
991
- }
992
- },
993
- required: ['account', 'balances', 'date']
1194
+ required: ['account', 'balances', 'date']
994
1195
  } as const;
995
1196
 
996
1197
  export const $TransactionSummaryDto = {
@@ -1034,8 +1235,8 @@ export const $TransactionSummaryDto = {
1034
1235
  },
1035
1236
  sourceType: {
1036
1237
  type: 'string',
1037
- description: 'Source type (NLP, CSV, OCR, API)',
1038
- enum: ['NLP', 'CSV', 'OCR', 'API']
1238
+ description:
1239
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1039
1240
  },
1040
1241
  sourcePlatform: {
1041
1242
  type: 'string',
@@ -1075,12 +1276,23 @@ export const $ReviewSummaryDto = {
1075
1276
  },
1076
1277
  confidenceLevel: {
1077
1278
  type: 'string',
1078
- description: 'Confidence level derived from score',
1079
- enum: ['HIGH', 'MEDIUM', 'LOW']
1279
+ description:
1280
+ 'Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.',
1281
+ enum: ['HIGH', 'MEDIUM', 'LOW'],
1282
+ nullable: true
1080
1283
  },
1081
- summary: {
1284
+ summaryKey: {
1082
1285
  type: 'string',
1083
- description: 'Human-readable summary of the review item'
1286
+ description:
1287
+ 'i18n message key for summary (e.g., review.summary.duplicate). Translate on frontend with summaryParams.'
1288
+ },
1289
+ summaryParams: {
1290
+ type: 'object',
1291
+ description:
1292
+ 'Parameters for summary message interpolation (e.g., { date: "2024-01-15", amount: "50" })',
1293
+ additionalProperties: {
1294
+ type: 'string'
1295
+ }
1084
1296
  },
1085
1297
  matchReasons: {
1086
1298
  description: 'Human-readable reasons for branching',
@@ -1091,7 +1303,8 @@ export const $ReviewSummaryDto = {
1091
1303
  },
1092
1304
  sourceType: {
1093
1305
  type: 'string',
1094
- description: 'Source type (NLP, CSV, OCR, API)'
1306
+ description:
1307
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1095
1308
  },
1096
1309
  sourcePlatform: {
1097
1310
  type: 'string',
@@ -1140,7 +1353,7 @@ export const $ReviewSummaryDto = {
1140
1353
  'status',
1141
1354
  'confidence',
1142
1355
  'confidenceLevel',
1143
- 'summary',
1356
+ 'summaryKey',
1144
1357
  'matchReasons',
1145
1358
  'sourceType',
1146
1359
  'createdAt'
@@ -1201,7 +1414,20 @@ export const $DecisionOptionDto = {
1201
1414
  properties: {
1202
1415
  value: {
1203
1416
  type: 'string',
1204
- description: 'The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)'
1417
+ description: 'The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)',
1418
+ enum: [
1419
+ 'UPGRADE_REPLACE',
1420
+ 'LINK_KEEP_BOTH',
1421
+ 'IGNORE_NEW',
1422
+ 'CONFIRM_DIFFERENT',
1423
+ 'ACCEPT',
1424
+ 'REJECT',
1425
+ 'ACCEPT_AND_LEARN',
1426
+ 'CHOOSE_OTHER',
1427
+ 'CANCEL',
1428
+ 'FIX',
1429
+ 'IGNORE'
1430
+ ]
1205
1431
  },
1206
1432
  labelKey: {
1207
1433
  type: 'string',
@@ -1249,12 +1475,23 @@ export const $ReviewDetailDto = {
1249
1475
  },
1250
1476
  confidenceLevel: {
1251
1477
  type: 'string',
1252
- description: 'Confidence level derived from score',
1253
- enum: ['HIGH', 'MEDIUM', 'LOW']
1478
+ description:
1479
+ 'Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.',
1480
+ enum: ['HIGH', 'MEDIUM', 'LOW'],
1481
+ nullable: true
1254
1482
  },
1255
- summary: {
1483
+ summaryKey: {
1256
1484
  type: 'string',
1257
- description: 'Human-readable summary of the review item'
1485
+ description:
1486
+ 'i18n message key for summary (e.g., review.summary.duplicate). Translate on frontend with summaryParams.'
1487
+ },
1488
+ summaryParams: {
1489
+ type: 'object',
1490
+ description:
1491
+ 'Parameters for summary message interpolation (e.g., { date: "2024-01-15", amount: "50" })',
1492
+ additionalProperties: {
1493
+ type: 'string'
1494
+ }
1258
1495
  },
1259
1496
  matchReasons: {
1260
1497
  description: 'Human-readable reasons for branching',
@@ -1265,7 +1502,8 @@ export const $ReviewDetailDto = {
1265
1502
  },
1266
1503
  sourceType: {
1267
1504
  type: 'string',
1268
- description: 'Source type (NLP, CSV, OCR, API)'
1505
+ description:
1506
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1269
1507
  },
1270
1508
  sourcePlatform: {
1271
1509
  type: 'string',
@@ -1330,7 +1568,7 @@ export const $ReviewDetailDto = {
1330
1568
  'status',
1331
1569
  'confidence',
1332
1570
  'confidenceLevel',
1333
- 'summary',
1571
+ 'summaryKey',
1334
1572
  'matchReasons',
1335
1573
  'sourceType',
1336
1574
  'createdAt',
@@ -1339,6 +1577,208 @@ export const $ReviewDetailDto = {
1339
1577
  ]
1340
1578
  } as const;
1341
1579
 
1580
+ export const $ResolveReviewDto = {
1581
+ type: 'object',
1582
+ properties: {
1583
+ action: {
1584
+ type: 'string',
1585
+ description:
1586
+ 'Decision action. Valid actions vary by review type — see DecisionOptionDto.value returned by the review detail endpoint.',
1587
+ enum: [
1588
+ 'UPGRADE_REPLACE',
1589
+ 'LINK_KEEP_BOTH',
1590
+ 'IGNORE_NEW',
1591
+ 'CONFIRM_DIFFERENT',
1592
+ 'ACCEPT',
1593
+ 'REJECT',
1594
+ 'ACCEPT_AND_LEARN',
1595
+ 'CHOOSE_OTHER',
1596
+ 'CANCEL',
1597
+ 'FIX',
1598
+ 'IGNORE'
1599
+ ],
1600
+ example: 'ACCEPT'
1601
+ },
1602
+ data: {
1603
+ type: 'object',
1604
+ description:
1605
+ 'Additional data for the decision (e.g., selected account ID)',
1606
+ example: {
1607
+ accountId: 'acc-123'
1608
+ }
1609
+ }
1610
+ },
1611
+ required: ['action']
1612
+ } as const;
1613
+
1614
+ export const $ResolveResultDto = {
1615
+ type: 'object',
1616
+ properties: {
1617
+ success: {
1618
+ type: 'boolean',
1619
+ description: 'Whether resolution was successful'
1620
+ },
1621
+ messageKey: {
1622
+ type: 'string',
1623
+ description:
1624
+ 'i18n message key for result message (e.g., review.payee.result.mapped)'
1625
+ },
1626
+ messageParams: {
1627
+ type: 'object',
1628
+ description:
1629
+ 'Parameters for message interpolation (e.g., { name: "PayeeName" })',
1630
+ additionalProperties: {
1631
+ type: 'string'
1632
+ }
1633
+ },
1634
+ resolutionId: {
1635
+ type: 'string',
1636
+ description: 'Resolution ID for undo'
1637
+ },
1638
+ canUndo: {
1639
+ type: 'boolean',
1640
+ description: 'Whether this decision can be undone'
1641
+ },
1642
+ undoDeadline: {
1643
+ format: 'date-time',
1644
+ type: 'string',
1645
+ description: 'Deadline for undo (24h from resolution)'
1646
+ },
1647
+ learnedRuleId: {
1648
+ type: 'string',
1649
+ description:
1650
+ 'Rule ID if learning was triggered (ACCEPT_AND_LEARN actions). Use this to deep-link to the rule management page.',
1651
+ example: 'rule_01HXK5V8N2M3P4Q5R6S7T8U9V0'
1652
+ }
1653
+ },
1654
+ required: ['success', 'resolutionId', 'canUndo', 'undoDeadline']
1655
+ } as const;
1656
+
1657
+ export const $UndoResultDto = {
1658
+ type: 'object',
1659
+ properties: {
1660
+ success: {
1661
+ type: 'boolean',
1662
+ description: 'Whether undo was successful'
1663
+ },
1664
+ message: {
1665
+ type: 'string',
1666
+ description: 'Message'
1667
+ },
1668
+ reviewId: {
1669
+ type: 'string',
1670
+ description: 'Review item ID that was restored'
1671
+ }
1672
+ },
1673
+ required: ['success', 'reviewId']
1674
+ } as const;
1675
+
1676
+ export const $BatchResolveDto = {
1677
+ type: 'object',
1678
+ properties: {
1679
+ reviewIds: {
1680
+ description: 'Review item IDs to resolve',
1681
+ example: ['review-1', 'review-2', 'review-3'],
1682
+ type: 'array',
1683
+ items: {
1684
+ type: 'string'
1685
+ }
1686
+ },
1687
+ action: {
1688
+ type: 'string',
1689
+ description: 'Decision action to apply to all items',
1690
+ enum: [
1691
+ 'UPGRADE_REPLACE',
1692
+ 'LINK_KEEP_BOTH',
1693
+ 'IGNORE_NEW',
1694
+ 'CONFIRM_DIFFERENT',
1695
+ 'ACCEPT',
1696
+ 'REJECT',
1697
+ 'ACCEPT_AND_LEARN',
1698
+ 'CHOOSE_OTHER',
1699
+ 'CANCEL',
1700
+ 'FIX',
1701
+ 'IGNORE'
1702
+ ],
1703
+ example: 'ACCEPT'
1704
+ },
1705
+ data: {
1706
+ type: 'object',
1707
+ description: 'Additional data for the decision'
1708
+ }
1709
+ },
1710
+ required: ['reviewIds', 'action']
1711
+ } as const;
1712
+
1713
+ export const $BatchResolveResultDto = {
1714
+ type: 'object',
1715
+ properties: {
1716
+ successCount: {
1717
+ type: 'number',
1718
+ description: 'Number of successfully resolved items'
1719
+ },
1720
+ failedCount: {
1721
+ type: 'number',
1722
+ description: 'Number of failed items'
1723
+ },
1724
+ results: {
1725
+ description: 'Details for each item',
1726
+ type: 'array',
1727
+ items: {
1728
+ type: 'string'
1729
+ }
1730
+ }
1731
+ },
1732
+ required: ['successCount', 'failedCount', 'results']
1733
+ } as const;
1734
+
1735
+ export const $CreatePayeeDto = {
1736
+ type: 'object',
1737
+ properties: {
1738
+ payee: {
1739
+ type: 'string',
1740
+ description:
1741
+ "User's original payee name (e.g., 'Starbucks', 'McDonald'). This is the raw payee string as entered by the user.",
1742
+ example: 'Starbucks',
1743
+ maxLength: 200
1744
+ },
1745
+ payeeProfileId: {
1746
+ type: 'string',
1747
+ description:
1748
+ 'Optional reference to global PayeeProfile for standardized data (merchant info, i18n keys, categories)',
1749
+ example: 'uuid-123',
1750
+ format: 'uuid'
1751
+ },
1752
+ customCategory: {
1753
+ type: 'string',
1754
+ description:
1755
+ "User's custom category for this payee (overrides PayeeProfile category)",
1756
+ example: 'Dining:Coffee',
1757
+ maxLength: 100
1758
+ },
1759
+ customTags: {
1760
+ description:
1761
+ "User's custom tags for this payee (e.g., ['favorite', 'work_meal'])",
1762
+ example: ['favorite', 'work_meal'],
1763
+ type: 'array',
1764
+ items: {
1765
+ type: 'string'
1766
+ }
1767
+ },
1768
+ meta: {
1769
+ type: 'object',
1770
+ description:
1771
+ 'Metadata for extended information (location, notes, contact info, etc.)',
1772
+ example: {
1773
+ location: 'Zhongguancun',
1774
+ note: 'Near subway station',
1775
+ favorite: true
1776
+ }
1777
+ }
1778
+ },
1779
+ required: ['payee']
1780
+ } as const;
1781
+
1342
1782
  export const $PayeeResponseDto = {
1343
1783
  type: 'object',
1344
1784
  properties: {
@@ -1358,14 +1798,14 @@ export const $PayeeResponseDto = {
1358
1798
  example: 'Starbucks'
1359
1799
  },
1360
1800
  payeeProfileId: {
1361
- type: 'object',
1801
+ type: 'string',
1362
1802
  description:
1363
1803
  'Reference to global PayeeProfile (merchant info, i18n keys, categories)',
1364
1804
  example: 'uuid-789',
1365
1805
  nullable: true
1366
1806
  },
1367
1807
  customCategory: {
1368
- type: 'object',
1808
+ type: 'string',
1369
1809
  description:
1370
1810
  "User's custom category (overrides PayeeProfile category if set)",
1371
1811
  example: 'Dining:Coffee',
@@ -1489,36 +1929,80 @@ export const $PayeeStatsResponseDto = {
1489
1929
  required: ['payee', 'transactionCount', 'lastUsedAt']
1490
1930
  } as const;
1491
1931
 
1492
- export const $PayeeProfileResponseDto = {
1932
+ export const $UpdatePayeeDto = {
1493
1933
  type: 'object',
1494
1934
  properties: {
1495
- id: {
1935
+ payeeProfileId: {
1496
1936
  type: 'string',
1497
- description: 'Unique identifier (UUID)',
1498
- example: '550e8400-e29b-41d4-a716-446655440000'
1937
+ description:
1938
+ 'Optional reference to global PayeeProfile for standardized data (merchant info, i18n keys, categories)',
1939
+ example: 'uuid-123',
1940
+ format: 'uuid'
1499
1941
  },
1500
- canonical: {
1942
+ customCategory: {
1501
1943
  type: 'string',
1502
- description: 'Canonical payee name (unique, case-insensitive)',
1503
- example: 'Starbucks'
1944
+ description:
1945
+ "User's custom category for this payee (overrides PayeeProfile category)",
1946
+ example: 'Dining:Coffee',
1947
+ maxLength: 100
1504
1948
  },
1505
- aliases: {
1506
- description: 'Multi-language aliases',
1507
- example: ['Starbucks Coffee', 'SBUX'],
1949
+ customTags: {
1950
+ description:
1951
+ "User's custom tags for this payee (e.g., ['favorite', 'work_meal'])",
1952
+ example: ['favorite', 'work_meal'],
1508
1953
  type: 'array',
1509
1954
  items: {
1510
1955
  type: 'string'
1511
1956
  }
1512
1957
  },
1513
- i18nKey: {
1958
+ meta: {
1514
1959
  type: 'object',
1515
- description: 'Translation key for i18n',
1516
- example: 'payee.starbucks',
1517
- nullable: true
1518
- },
1519
- category: {
1520
- type: 'string',
1521
- description: 'Payee category',
1960
+ description:
1961
+ 'Metadata for extended information (location, notes, contact info, etc.). Will merge with existing metadata.',
1962
+ example: {
1963
+ location: 'Zhongguancun',
1964
+ note: 'Updated note',
1965
+ favorite: true
1966
+ }
1967
+ },
1968
+ isActive: {
1969
+ type: 'boolean',
1970
+ description:
1971
+ 'Enable or disable this payee. Disabled payees will not appear in autocomplete suggestions.',
1972
+ example: true
1973
+ }
1974
+ }
1975
+ } as const;
1976
+
1977
+ export const $CreatePayeeProfileDto = {
1978
+ type: 'object',
1979
+ properties: {
1980
+ canonical: {
1981
+ type: 'string',
1982
+ description:
1983
+ 'Canonical payee name (unique, case-insensitive). This is the primary identifier for the payee.',
1984
+ example: 'Starbucks',
1985
+ maxLength: 200
1986
+ },
1987
+ aliases: {
1988
+ description:
1989
+ 'Multi-language aliases for the payee. Used for matching user input in different languages.',
1990
+ example: ['Starbucks Coffee', 'SBUX'],
1991
+ type: 'array',
1992
+ items: {
1993
+ type: 'string'
1994
+ }
1995
+ },
1996
+ i18nKey: {
1997
+ type: 'string',
1998
+ description:
1999
+ 'Translation key for i18n integration (XLIFF translation system)',
2000
+ example: 'payee.starbucks',
2001
+ maxLength: 100
2002
+ },
2003
+ category: {
2004
+ type: 'string',
2005
+ description: 'Payee category classification',
1522
2006
  enum: [
1523
2007
  'RESTAURANT',
1524
2008
  'CAFE',
@@ -1547,7 +2031,128 @@ export const $PayeeProfileResponseDto = {
1547
2031
  example: 'CAFE'
1548
2032
  },
1549
2033
  subCategory: {
2034
+ type: 'string',
2035
+ description: 'Sub-category for more specific classification',
2036
+ example: 'coffee_chain',
2037
+ maxLength: 100
2038
+ },
2039
+ countries: {
2040
+ description:
2041
+ 'Country/region codes where the payee operates (ISO 3166-1 alpha-2)',
2042
+ example: ['CN', 'US', 'JP'],
2043
+ type: 'array',
2044
+ items: {
2045
+ type: 'string'
2046
+ }
2047
+ },
2048
+ primaryCountry: {
2049
+ type: 'string',
2050
+ description: 'Primary operating country (ISO 3166-1 alpha-2)',
2051
+ example: 'US',
2052
+ maxLength: 2
2053
+ },
2054
+ keywords: {
2055
+ description: 'Search keywords for fuzzy matching',
2056
+ example: ['coffee', 'cafe', 'drinks'],
2057
+ type: 'array',
2058
+ items: {
2059
+ type: 'string'
2060
+ }
2061
+ },
2062
+ logoUrl: {
2063
+ type: 'string',
2064
+ description: 'Payee logo URL',
2065
+ example: 'https://example.com/logo.png'
2066
+ },
2067
+ website: {
2068
+ type: 'string',
2069
+ description: 'Official website URL',
2070
+ example: 'https://www.starbucks.com'
2071
+ },
2072
+ description: {
2073
+ type: 'string',
2074
+ description: 'Payee description',
2075
+ example: 'Global coffeehouse chain headquartered in Seattle',
2076
+ maxLength: 1000
2077
+ },
2078
+ meta: {
1550
2079
  type: 'object',
2080
+ description:
2081
+ 'Extended metadata (business hours, contact info, additional details)',
2082
+ example: {
2083
+ businessHours: '07:00-22:00',
2084
+ phone: '+1-800-782-7282'
2085
+ }
2086
+ },
2087
+ dataSource: {
2088
+ type: 'string',
2089
+ description: 'Data source for this profile',
2090
+ enum: ['MANUAL', 'IMPORT', 'API', 'CROWDSOURCED'],
2091
+ default: 'MANUAL'
2092
+ }
2093
+ },
2094
+ required: ['canonical', 'category']
2095
+ } as const;
2096
+
2097
+ export const $PayeeProfileResponseDto = {
2098
+ type: 'object',
2099
+ properties: {
2100
+ id: {
2101
+ type: 'string',
2102
+ description: 'Unique identifier (UUID)',
2103
+ example: '550e8400-e29b-41d4-a716-446655440000'
2104
+ },
2105
+ canonical: {
2106
+ type: 'string',
2107
+ description: 'Canonical payee name (unique, case-insensitive)',
2108
+ example: 'Starbucks'
2109
+ },
2110
+ aliases: {
2111
+ description: 'Multi-language aliases',
2112
+ example: ['Starbucks Coffee', 'SBUX'],
2113
+ type: 'array',
2114
+ items: {
2115
+ type: 'string'
2116
+ }
2117
+ },
2118
+ i18nKey: {
2119
+ type: 'string',
2120
+ description: 'Translation key for i18n',
2121
+ example: 'payee.starbucks',
2122
+ nullable: true
2123
+ },
2124
+ category: {
2125
+ type: 'string',
2126
+ description: 'Payee category',
2127
+ enum: [
2128
+ 'RESTAURANT',
2129
+ 'CAFE',
2130
+ 'FAST_FOOD',
2131
+ 'BAR',
2132
+ 'SUPERMARKET',
2133
+ 'CONVENIENCE_STORE',
2134
+ 'SHOPPING_MALL',
2135
+ 'ONLINE_SHOPPING',
2136
+ 'TAXI',
2137
+ 'RIDE_SHARING',
2138
+ 'PUBLIC_TRANSPORT',
2139
+ 'PARKING',
2140
+ 'GAS_STATION',
2141
+ 'UTILITIES',
2142
+ 'TELECOM',
2143
+ 'STREAMING',
2144
+ 'HEALTHCARE',
2145
+ 'EDUCATION',
2146
+ 'ENTERTAINMENT',
2147
+ 'SPORTS',
2148
+ 'TRAVEL',
2149
+ 'HOTEL',
2150
+ 'OTHER'
2151
+ ],
2152
+ example: 'CAFE'
2153
+ },
2154
+ subCategory: {
2155
+ type: 'string',
1551
2156
  description: 'Sub-category',
1552
2157
  example: 'coffee_chain',
1553
2158
  nullable: true
@@ -1561,7 +2166,7 @@ export const $PayeeProfileResponseDto = {
1561
2166
  }
1562
2167
  },
1563
2168
  primaryCountry: {
1564
- type: 'object',
2169
+ type: 'string',
1565
2170
  description: 'Primary operating country',
1566
2171
  example: 'US',
1567
2172
  nullable: true
@@ -1575,19 +2180,19 @@ export const $PayeeProfileResponseDto = {
1575
2180
  }
1576
2181
  },
1577
2182
  logoUrl: {
1578
- type: 'object',
2183
+ type: 'string',
1579
2184
  description: 'Logo URL',
1580
2185
  example: 'https://example.com/logo.png',
1581
2186
  nullable: true
1582
2187
  },
1583
2188
  website: {
1584
- type: 'object',
2189
+ type: 'string',
1585
2190
  description: 'Official website',
1586
2191
  example: 'https://www.starbucks.com',
1587
2192
  nullable: true
1588
2193
  },
1589
2194
  description: {
1590
- type: 'object',
2195
+ type: 'string',
1591
2196
  description: 'Description',
1592
2197
  example: 'Global coffeehouse chain',
1593
2198
  nullable: true
@@ -1603,9 +2208,10 @@ export const $PayeeProfileResponseDto = {
1603
2208
  example: 'MANUAL'
1604
2209
  },
1605
2210
  verifiedAt: {
1606
- type: 'object',
2211
+ type: 'string',
1607
2212
  description: 'Verification timestamp (null if not verified)',
1608
2213
  example: '2025-01-01T00:00:00.000Z',
2214
+ format: 'date-time',
1609
2215
  nullable: true
1610
2216
  },
1611
2217
  isActive: {
@@ -1660,6 +2266,164 @@ export const $PayeeProfileListResponseDto = {
1660
2266
  required: ['items', 'total']
1661
2267
  } as const;
1662
2268
 
2269
+ export const $UpdatePayeeProfileDto = {
2270
+ type: 'object',
2271
+ properties: {
2272
+ aliases: {
2273
+ description:
2274
+ 'Multi-language aliases for the payee. Used for matching user input in different languages.',
2275
+ example: ['Starbucks Coffee', 'SBUX'],
2276
+ type: 'array',
2277
+ items: {
2278
+ type: 'string'
2279
+ }
2280
+ },
2281
+ i18nKey: {
2282
+ type: 'string',
2283
+ description:
2284
+ 'Translation key for i18n integration (XLIFF translation system)',
2285
+ example: 'payee.starbucks',
2286
+ maxLength: 100
2287
+ },
2288
+ category: {
2289
+ type: 'string',
2290
+ description: 'Payee category classification',
2291
+ enum: [
2292
+ 'RESTAURANT',
2293
+ 'CAFE',
2294
+ 'FAST_FOOD',
2295
+ 'BAR',
2296
+ 'SUPERMARKET',
2297
+ 'CONVENIENCE_STORE',
2298
+ 'SHOPPING_MALL',
2299
+ 'ONLINE_SHOPPING',
2300
+ 'TAXI',
2301
+ 'RIDE_SHARING',
2302
+ 'PUBLIC_TRANSPORT',
2303
+ 'PARKING',
2304
+ 'GAS_STATION',
2305
+ 'UTILITIES',
2306
+ 'TELECOM',
2307
+ 'STREAMING',
2308
+ 'HEALTHCARE',
2309
+ 'EDUCATION',
2310
+ 'ENTERTAINMENT',
2311
+ 'SPORTS',
2312
+ 'TRAVEL',
2313
+ 'HOTEL',
2314
+ 'OTHER'
2315
+ ],
2316
+ example: 'CAFE'
2317
+ },
2318
+ subCategory: {
2319
+ type: 'string',
2320
+ description: 'Sub-category for more specific classification',
2321
+ example: 'coffee_chain',
2322
+ maxLength: 100
2323
+ },
2324
+ countries: {
2325
+ description:
2326
+ 'Country/region codes where the payee operates (ISO 3166-1 alpha-2)',
2327
+ example: ['CN', 'US', 'JP'],
2328
+ type: 'array',
2329
+ items: {
2330
+ type: 'string'
2331
+ }
2332
+ },
2333
+ primaryCountry: {
2334
+ type: 'string',
2335
+ description: 'Primary operating country (ISO 3166-1 alpha-2)',
2336
+ example: 'US',
2337
+ maxLength: 2
2338
+ },
2339
+ keywords: {
2340
+ description: 'Search keywords for fuzzy matching',
2341
+ example: ['coffee', 'cafe', 'drinks'],
2342
+ type: 'array',
2343
+ items: {
2344
+ type: 'string'
2345
+ }
2346
+ },
2347
+ logoUrl: {
2348
+ type: 'string',
2349
+ description: 'Payee logo URL',
2350
+ example: 'https://example.com/logo.png'
2351
+ },
2352
+ website: {
2353
+ type: 'string',
2354
+ description: 'Official website URL',
2355
+ example: 'https://www.starbucks.com'
2356
+ },
2357
+ description: {
2358
+ type: 'string',
2359
+ description: 'Payee description',
2360
+ example: 'Global coffeehouse chain headquartered in Seattle',
2361
+ maxLength: 1000
2362
+ },
2363
+ meta: {
2364
+ type: 'object',
2365
+ description:
2366
+ 'Extended metadata (business hours, contact info, additional details)',
2367
+ example: {
2368
+ businessHours: '07:00-22:00',
2369
+ phone: '+1-800-782-7282'
2370
+ }
2371
+ },
2372
+ dataSource: {
2373
+ type: 'string',
2374
+ description: 'Data source for this profile',
2375
+ enum: ['MANUAL', 'IMPORT', 'API', 'CROWDSOURCED'],
2376
+ default: 'MANUAL'
2377
+ },
2378
+ isActive: {
2379
+ type: 'boolean',
2380
+ description: 'Whether the payee profile is active (soft delete)',
2381
+ example: true
2382
+ },
2383
+ verifiedAt: {
2384
+ type: 'string',
2385
+ description:
2386
+ 'Verification timestamp. Set to current time to verify, or null to unverify.',
2387
+ example: '2025-01-01T00:00:00.000Z',
2388
+ format: 'date-time',
2389
+ nullable: true
2390
+ }
2391
+ }
2392
+ } as const;
2393
+
2394
+ export const $CreateCommodityDto = {
2395
+ type: 'object',
2396
+ properties: {
2397
+ symbol: {
2398
+ type: 'string',
2399
+ description:
2400
+ 'Commodity symbol (e.g., AAPL, USD, BTC) - corresponds to Beancount currency field',
2401
+ example: 'AAPL',
2402
+ maxLength: 50
2403
+ },
2404
+ date: {
2405
+ type: 'string',
2406
+ description:
2407
+ 'Commodity definition date (ISO 8601, required per Beancount spec). Represents when this commodity was first defined in the accounting system.',
2408
+ example: '2024-01-01',
2409
+ format: 'date'
2410
+ },
2411
+ metadata: {
2412
+ type: 'object',
2413
+ description:
2414
+ 'Metadata (corresponds to Beancount meta field). Can contain name, assetClass, precision, note, tags, etc.',
2415
+ example: {
2416
+ name: 'Apple Inc.',
2417
+ assetClass: 'stock',
2418
+ precision: 2,
2419
+ note: 'Long-term investment',
2420
+ tags: ['tech', 'dividend']
2421
+ }
2422
+ }
2423
+ },
2424
+ required: ['symbol', 'date']
2425
+ } as const;
2426
+
1663
2427
  export const $CommodityResponseDto = {
1664
2428
  type: 'object',
1665
2429
  properties: {
@@ -1669,7 +2433,7 @@ export const $CommodityResponseDto = {
1669
2433
  example: 'uuid-123-456'
1670
2434
  },
1671
2435
  userId: {
1672
- type: 'object',
2436
+ type: 'string',
1673
2437
  description: 'User ID (owner of the commodity)',
1674
2438
  example: 'user-123',
1675
2439
  nullable: true
@@ -1698,13 +2462,6 @@ export const $CommodityResponseDto = {
1698
2462
  source: 'AUTO_CREATED'
1699
2463
  }
1700
2464
  },
1701
- symbolProfileId: {
1702
- type: 'object',
1703
- description:
1704
- 'Reference to SymbolProfile (market data integration, SaaS feature)',
1705
- example: 'uuid-789',
1706
- nullable: true
1707
- },
1708
2465
  createdAt: {
1709
2466
  format: 'date-time',
1710
2467
  type: 'string',
@@ -1731,13 +2488,137 @@ export const $CommodityListResponseDto = {
1731
2488
  $ref: '#/components/schemas/CommodityResponseDto'
1732
2489
  }
1733
2490
  },
1734
- total: {
1735
- type: 'number',
1736
- description: 'Total number of commodities',
1737
- example: 42
2491
+ total: {
2492
+ type: 'number',
2493
+ description: 'Total number of commodities',
2494
+ example: 42
2495
+ }
2496
+ },
2497
+ required: ['items', 'total']
2498
+ } as const;
2499
+
2500
+ export const $UpdateCommodityDto = {
2501
+ type: 'object',
2502
+ properties: {
2503
+ date: {
2504
+ type: 'string',
2505
+ description:
2506
+ 'Commodity definition date (ISO 8601). Represents when this commodity was first defined in the accounting system.',
2507
+ example: '2024-01-01',
2508
+ format: 'date'
2509
+ },
2510
+ metadata: {
2511
+ type: 'object',
2512
+ description:
2513
+ 'Metadata (corresponds to Beancount meta field). Will merge with existing metadata. Can contain name, assetClass, precision, note, tags, etc.',
2514
+ example: {
2515
+ name: 'Updated Apple Inc.',
2516
+ assetClass: 'equity',
2517
+ precision: 4,
2518
+ note: 'Updated investment strategy',
2519
+ lastReviewed: '2024-11-03'
2520
+ }
2521
+ }
2522
+ }
2523
+ } as const;
2524
+
2525
+ export const $CreateRecurringRuleDto = {
2526
+ type: 'object',
2527
+ properties: {
2528
+ name: {
2529
+ type: 'string',
2530
+ description: 'Rule name (unique per user)',
2531
+ maxLength: 100
2532
+ },
2533
+ icon: {
2534
+ type: 'string',
2535
+ description: 'Icon emoji',
2536
+ maxLength: 10
2537
+ },
2538
+ frequency: {
2539
+ type: 'string',
2540
+ description: 'Recurring frequency',
2541
+ enum: [
2542
+ 'WEEKLY',
2543
+ 'BIWEEKLY',
2544
+ 'MONTHLY',
2545
+ 'BIMONTHLY',
2546
+ 'QUARTERLY',
2547
+ 'YEARLY',
2548
+ 'CUSTOM'
2549
+ ]
2550
+ },
2551
+ expectedAmount: {
2552
+ type: 'number',
2553
+ description: 'Expected amount (positive number)',
2554
+ minimum: 0
2555
+ },
2556
+ expectedDay: {
2557
+ type: 'number',
2558
+ description: 'Expected day of month (1-31)',
2559
+ minimum: 1,
2560
+ maximum: 31
2561
+ },
2562
+ customIntervalDays: {
2563
+ type: 'number',
2564
+ description: 'Custom interval in days (required for CUSTOM frequency)',
2565
+ minimum: 1
2566
+ },
2567
+ currency: {
2568
+ type: 'string',
2569
+ description: 'Currency code',
2570
+ default: 'CNY',
2571
+ maxLength: 10
2572
+ },
2573
+ matchPayeePattern: {
2574
+ type: 'string',
2575
+ description: 'Payee matching pattern (supports wildcards)',
2576
+ maxLength: 200
2577
+ },
2578
+ matchAmountTolerance: {
2579
+ type: 'number',
2580
+ description: 'Amount tolerance percentage (0-1)',
2581
+ default: 0.075,
2582
+ minimum: 0,
2583
+ maximum: 1
2584
+ },
2585
+ defaultExpenseAccount: {
2586
+ type: 'string',
2587
+ description: 'Default expense account for auto-create',
2588
+ maxLength: 200
2589
+ },
2590
+ defaultPaymentAccount: {
2591
+ type: 'string',
2592
+ description: 'Default payment account for auto-create',
2593
+ maxLength: 200
2594
+ },
2595
+ defaultPayee: {
2596
+ type: 'string',
2597
+ description: 'Default payee for auto-create',
2598
+ maxLength: 200
2599
+ },
2600
+ autoCreate: {
2601
+ type: 'boolean',
2602
+ description: 'Auto-create transaction when expected date arrives',
2603
+ default: false
2604
+ },
2605
+ startDate: {
2606
+ type: 'string',
2607
+ description: 'Rule start date (ISO format)'
2608
+ },
2609
+ endDate: {
2610
+ type: 'string',
2611
+ description: 'Rule end date (ISO format)'
1738
2612
  }
1739
2613
  },
1740
- required: ['items', 'total']
2614
+ required: [
2615
+ 'name',
2616
+ 'frequency',
2617
+ 'expectedAmount',
2618
+ 'currency',
2619
+ 'matchAmountTolerance',
2620
+ 'autoCreate'
2621
+ ]
1741
2622
  } as const;
1742
2623
 
1743
2624
  export const $RecurringRuleResponseDto = {
@@ -1851,6 +2732,37 @@ export const $RecurringRuleResponseDto = {
1851
2732
  ]
1852
2733
  } as const;
1853
2734
 
2735
+ export const $CreateRuleFromTransactionDto = {
2736
+ type: 'object',
2737
+ properties: {
2738
+ frequency: {
2739
+ type: 'string',
2740
+ description: 'Recurring frequency',
2741
+ enum: [
2742
+ 'WEEKLY',
2743
+ 'BIWEEKLY',
2744
+ 'MONTHLY',
2745
+ 'BIMONTHLY',
2746
+ 'QUARTERLY',
2747
+ 'YEARLY',
2748
+ 'CUSTOM'
2749
+ ],
2750
+ example: 'MONTHLY'
2751
+ },
2752
+ name: {
2753
+ type: 'string',
2754
+ description: 'Optional name override (default: transaction payee)',
2755
+ maxLength: 100
2756
+ },
2757
+ icon: {
2758
+ type: 'string',
2759
+ description: 'Optional icon emoji',
2760
+ maxLength: 10
2761
+ }
2762
+ },
2763
+ required: ['frequency']
2764
+ } as const;
2765
+
1854
2766
  export const $RecurringRuleWithStatsResponseDto = {
1855
2767
  type: 'object',
1856
2768
  properties: {
@@ -2009,6 +2921,94 @@ export const $RecurringRuleWithStatsResponseDto = {
2009
2921
  ]
2010
2922
  } as const;
2011
2923
 
2924
+ export const $UpdateRecurringRuleDto = {
2925
+ type: 'object',
2926
+ properties: {
2927
+ name: {
2928
+ type: 'string',
2929
+ description: 'Rule name',
2930
+ maxLength: 100
2931
+ },
2932
+ icon: {
2933
+ type: 'string',
2934
+ description: 'Icon emoji',
2935
+ maxLength: 10
2936
+ },
2937
+ frequency: {
2938
+ type: 'string',
2939
+ description: 'Recurring frequency',
2940
+ enum: [
2941
+ 'WEEKLY',
2942
+ 'BIWEEKLY',
2943
+ 'MONTHLY',
2944
+ 'BIMONTHLY',
2945
+ 'QUARTERLY',
2946
+ 'YEARLY',
2947
+ 'CUSTOM'
2948
+ ]
2949
+ },
2950
+ expectedAmount: {
2951
+ type: 'number',
2952
+ description: 'Expected amount',
2953
+ minimum: 0
2954
+ },
2955
+ expectedDay: {
2956
+ type: 'number',
2957
+ description: 'Expected day of month (1-31)',
2958
+ minimum: 1,
2959
+ maximum: 31
2960
+ },
2961
+ customIntervalDays: {
2962
+ type: 'number',
2963
+ description: 'Custom interval in days',
2964
+ minimum: 1
2965
+ },
2966
+ currency: {
2967
+ type: 'string',
2968
+ description: 'Currency code',
2969
+ maxLength: 10
2970
+ },
2971
+ matchPayeePattern: {
2972
+ type: 'string',
2973
+ description: 'Payee matching pattern',
2974
+ maxLength: 200
2975
+ },
2976
+ matchAmountTolerance: {
2977
+ type: 'number',
2978
+ description: 'Amount tolerance percentage (0-1)',
2979
+ minimum: 0,
2980
+ maximum: 1
2981
+ },
2982
+ defaultExpenseAccount: {
2983
+ type: 'string',
2984
+ description: 'Default expense account',
2985
+ maxLength: 200
2986
+ },
2987
+ defaultPaymentAccount: {
2988
+ type: 'string',
2989
+ description: 'Default payment account',
2990
+ maxLength: 200
2991
+ },
2992
+ defaultPayee: {
2993
+ type: 'string',
2994
+ description: 'Default payee',
2995
+ maxLength: 200
2996
+ },
2997
+ autoCreate: {
2998
+ type: 'boolean',
2999
+ description: 'Auto-create transaction'
3000
+ },
3001
+ isActive: {
3002
+ type: 'boolean',
3003
+ description: 'Rule active status'
3004
+ },
3005
+ endDate: {
3006
+ type: 'string',
3007
+ description: 'Rule end date (ISO format)'
3008
+ }
3009
+ }
3010
+ } as const;
3011
+
2012
3012
  export const $ExpectedTransactionRuleDto = {
2013
3013
  type: 'object',
2014
3014
  properties: {
@@ -2125,6 +3125,50 @@ export const $ExpectedTransactionListResponseDto = {
2125
3125
  required: ['items', 'total']
2126
3126
  } as const;
2127
3127
 
3128
+ export const $ConfirmMatchDto = {
3129
+ type: 'object',
3130
+ properties: {
3131
+ transactionId: {
3132
+ type: 'string',
3133
+ description: 'Transaction ID to match with'
3134
+ }
3135
+ },
3136
+ required: ['transactionId']
3137
+ } as const;
3138
+
3139
+ export const $EnterNowDto = {
3140
+ type: 'object',
3141
+ properties: {
3142
+ expenseAccount: {
3143
+ type: 'string',
3144
+ description:
3145
+ 'Override expense account (uses rule default if not provided)',
3146
+ maxLength: 200
3147
+ },
3148
+ paymentAccount: {
3149
+ type: 'string',
3150
+ description:
3151
+ 'Override payment account (uses rule default if not provided)',
3152
+ maxLength: 200
3153
+ },
3154
+ amount: {
3155
+ type: 'number',
3156
+ description: 'Override amount (uses expected amount if not provided)',
3157
+ minimum: 0
3158
+ },
3159
+ payee: {
3160
+ type: 'string',
3161
+ description: 'Override payee (uses rule default if not provided)',
3162
+ maxLength: 200
3163
+ },
3164
+ narration: {
3165
+ type: 'string',
3166
+ description: 'Optional narration',
3167
+ maxLength: 500
3168
+ }
3169
+ }
3170
+ } as const;
3171
+
2128
3172
  export const $ForecastItemDto = {
2129
3173
  type: 'object',
2130
3174
  properties: {
@@ -2149,7 +3193,7 @@ export const $ForecastItemDto = {
2149
3193
  example: '2024-04-01'
2150
3194
  },
2151
3195
  icon: {
2152
- type: 'object',
3196
+ type: 'string',
2153
3197
  description: 'Rule icon emoji',
2154
3198
  example: '🏠',
2155
3199
  nullable: true
@@ -2249,6 +3293,107 @@ export const $ForecastResponseDto = {
2249
3293
  ]
2250
3294
  } as const;
2251
3295
 
3296
+ export const $CreateTransactionRuleDto = {
3297
+ type: 'object',
3298
+ properties: {
3299
+ name: {
3300
+ type: 'string',
3301
+ minLength: 1,
3302
+ maxLength: 100
3303
+ },
3304
+ description: {
3305
+ type: 'string',
3306
+ maxLength: 500
3307
+ },
3308
+ narrationKeywords: {
3309
+ items: {
3310
+ type: 'array'
3311
+ },
3312
+ maxItems: 50,
3313
+ type: 'array'
3314
+ },
3315
+ payeeKeywords: {
3316
+ items: {
3317
+ type: 'array'
3318
+ },
3319
+ maxItems: 50,
3320
+ type: 'array'
3321
+ },
3322
+ categoryKeywords: {
3323
+ items: {
3324
+ type: 'array'
3325
+ },
3326
+ maxItems: 50,
3327
+ type: 'array'
3328
+ },
3329
+ methodKeywords: {
3330
+ items: {
3331
+ type: 'array'
3332
+ },
3333
+ maxItems: 50,
3334
+ description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
3335
+ type: 'array'
3336
+ },
3337
+ categoryAccount: {
3338
+ type: 'string',
3339
+ maxLength: 200,
3340
+ description:
3341
+ 'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
3342
+ },
3343
+ matchLogic: {
3344
+ type: 'string',
3345
+ enum: ['OR', 'AND'],
3346
+ default: 'OR'
3347
+ },
3348
+ amountMin: {
3349
+ type: 'number',
3350
+ minimum: 0,
3351
+ description: 'Minimum transaction amount (inclusive)'
3352
+ },
3353
+ amountMax: {
3354
+ type: 'number',
3355
+ minimum: 0,
3356
+ description: 'Maximum transaction amount (inclusive)'
3357
+ },
3358
+ priority: {
3359
+ type: 'number',
3360
+ default: 50,
3361
+ minimum: 0,
3362
+ maximum: 1000
3363
+ },
3364
+ additionalTags: {
3365
+ items: {
3366
+ type: 'array'
3367
+ },
3368
+ maxItems: 20,
3369
+ type: 'array'
3370
+ },
3371
+ additionalMetadata: {
3372
+ type: 'object'
3373
+ },
3374
+ upsertByPayee: {
3375
+ type: 'boolean',
3376
+ description:
3377
+ 'If true, update existing rule with matching payeeKeywords[0] instead of creating new rule'
3378
+ }
3379
+ },
3380
+ required: ['name', 'matchLogic', 'priority']
3381
+ } as const;
3382
+
3383
+ export const $AmountRangeDto = {
3384
+ type: 'object',
3385
+ properties: {
3386
+ min: {
3387
+ type: 'number',
3388
+ description: 'Minimum amount'
3389
+ },
3390
+ max: {
3391
+ type: 'number',
3392
+ description: 'Maximum amount'
3393
+ }
3394
+ }
3395
+ } as const;
3396
+
2252
3397
  export const $TransactionRuleResponseDto = {
2253
3398
  type: 'object',
2254
3399
  properties: {
@@ -2303,12 +3448,12 @@ export const $TransactionRuleResponseDto = {
2303
3448
  example: 'OR'
2304
3449
  },
2305
3450
  amountRange: {
2306
- type: 'object',
2307
3451
  description: 'Amount range for matching',
2308
- example: {
2309
- min: 0,
2310
- max: 100
2311
- }
3452
+ allOf: [
3453
+ {
3454
+ $ref: '#/components/schemas/AmountRangeDto'
3455
+ }
3456
+ ]
2312
3457
  },
2313
3458
  priority: {
2314
3459
  type: 'number',
@@ -2323,6 +3468,7 @@ export const $TransactionRuleResponseDto = {
2323
3468
  type: 'string',
2324
3469
  description: 'Learning source: NLP, REVIEW_CENTER, or null for manual',
2325
3470
  enum: ['NLP', 'REVIEW_CENTER'],
3471
+ nullable: true,
2326
3472
  example: 'REVIEW_CENTER'
2327
3473
  },
2328
3474
  autoApplyEnabled: {
@@ -2344,7 +3490,9 @@ export const $TransactionRuleResponseDto = {
2344
3490
  additionalMetadata: {
2345
3491
  type: 'object',
2346
3492
  description: 'Additional metadata',
2347
- example: {}
3493
+ additionalProperties: {
3494
+ type: 'string'
3495
+ }
2348
3496
  },
2349
3497
  createdAt: {
2350
3498
  format: 'date-time',
@@ -2517,6 +3665,64 @@ export const $ValidateRuleResponseDto = {
2517
3665
  required: ['valid', 'errors', 'warnings']
2518
3666
  } as const;
2519
3667
 
3668
+ export const $BulkCreateRulesDto = {
3669
+ type: 'object',
3670
+ properties: {
3671
+ rules: {
3672
+ items: {
3673
+ type: 'array'
3674
+ },
3675
+ description: 'Array of rules to import',
3676
+ type: 'array'
3677
+ },
3678
+ conflictStrategy: {
3679
+ type: 'string',
3680
+ enum: ['replace', 'skip'],
3681
+ default: 'skip',
3682
+ description:
3683
+ 'Conflict handling strategy: skip (default) ignores duplicates, replace soft-deletes existing rule'
3684
+ }
3685
+ },
3686
+ required: ['rules', 'conflictStrategy']
3687
+ } as const;
3688
+
3689
+ export const $BulkCreateRulesResponseDto = {
3690
+ type: 'object',
3691
+ properties: {
3692
+ successCount: {
3693
+ type: 'number',
3694
+ description: 'Number of successfully created rules'
3695
+ },
3696
+ failureCount: {
3697
+ type: 'number',
3698
+ description: 'Number of failed rules'
3699
+ },
3700
+ errors: {
3701
+ type: 'array',
3702
+ description: 'Error details for failed rules',
3703
+ items: {
3704
+ type: 'object',
3705
+ properties: {
3706
+ index: {
3707
+ type: 'number'
3708
+ },
3709
+ message: {
3710
+ type: 'string'
3711
+ }
3712
+ }
3713
+ }
3714
+ },
3715
+ createdRuleIds: {
3716
+ description: 'IDs of successfully created rules',
3717
+ type: 'array',
3718
+ items: {
3719
+ type: 'string'
3720
+ }
3721
+ }
3722
+ },
3723
+ required: ['successCount', 'failureCount', 'errors', 'createdRuleIds']
3724
+ } as const;
3725
+
2520
3726
  export const $ExportRulesResponseDto = {
2521
3727
  type: 'object',
2522
3728
  properties: {
@@ -2597,6 +3803,89 @@ export const $RuleStatisticsResponseDto = {
2597
3803
  ]
2598
3804
  } as const;
2599
3805
 
3806
+ export const $UpdateTransactionRuleDto = {
3807
+ type: 'object',
3808
+ properties: {
3809
+ name: {
3810
+ type: 'string',
3811
+ minLength: 1,
3812
+ maxLength: 100
3813
+ },
3814
+ description: {
3815
+ type: 'string',
3816
+ maxLength: 500
3817
+ },
3818
+ narrationKeywords: {
3819
+ items: {
3820
+ type: 'array'
3821
+ },
3822
+ maxItems: 50,
3823
+ type: 'array'
3824
+ },
3825
+ payeeKeywords: {
3826
+ items: {
3827
+ type: 'array'
3828
+ },
3829
+ maxItems: 50,
3830
+ type: 'array'
3831
+ },
3832
+ categoryKeywords: {
3833
+ items: {
3834
+ type: 'array'
3835
+ },
3836
+ maxItems: 50,
3837
+ type: 'array'
3838
+ },
3839
+ methodKeywords: {
3840
+ items: {
3841
+ type: 'array'
3842
+ },
3843
+ maxItems: 50,
3844
+ description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
3845
+ type: 'array'
3846
+ },
3847
+ categoryAccount: {
3848
+ type: 'string',
3849
+ maxLength: 200,
3850
+ description:
3851
+ 'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
3852
+ },
3853
+ matchLogic: {
3854
+ type: 'string',
3855
+ enum: ['OR', 'AND']
3856
+ },
3857
+ amountMin: {
3858
+ type: 'number',
3859
+ minimum: 0,
3860
+ description: 'Minimum transaction amount (inclusive)'
3861
+ },
3862
+ amountMax: {
3863
+ type: 'number',
3864
+ minimum: 0,
3865
+ description: 'Maximum transaction amount (inclusive)'
3866
+ },
3867
+ priority: {
3868
+ type: 'number',
3869
+ minimum: 0,
3870
+ maximum: 1000
3871
+ },
3872
+ enabled: {
3873
+ type: 'boolean',
3874
+ description: 'Enable or disable the rule'
3875
+ },
3876
+ additionalTags: {
3877
+ items: {
3878
+ type: 'array'
3879
+ },
3880
+ maxItems: 20,
3881
+ type: 'array'
3882
+ },
3883
+ additionalMetadata: {
3884
+ type: 'object'
3885
+ }
3886
+ }
3887
+ } as const;
3888
+
2600
3889
  export const $TestRuleDto = {
2601
3890
  type: 'object',
2602
3891
  properties: {
@@ -2789,6 +4078,17 @@ export const $UpdateUserSettingDto = {
2789
4078
  }
2790
4079
  } as const;
2791
4080
 
4081
+ export const $UpdatePropertyDto = {
4082
+ type: 'object',
4083
+ properties: {
4084
+ value: {
4085
+ type: 'string',
4086
+ description: 'Property value'
4087
+ }
4088
+ },
4089
+ required: ['value']
4090
+ } as const;
4091
+
2792
4092
  export const $FileImportDto = {
2793
4093
  type: 'object',
2794
4094
  properties: {
@@ -3088,7 +4388,8 @@ export const $ImporterConfigDto = {
3088
4388
  'cmbc-credit',
3089
4389
  'icbc',
3090
4390
  'icbc-credit',
3091
- 'hsbc-hk'
4391
+ 'hsbc-hk-credit',
4392
+ 'hsbc-hk-debit'
3092
4393
  ]
3093
4394
  },
3094
4395
  version: {
@@ -3134,6 +4435,181 @@ export const $ImporterConfigDto = {
3134
4435
  ]
3135
4436
  } as const;
3136
4437
 
4438
+ export const $UpdateMapperDefaultsDto = {
4439
+ type: 'object',
4440
+ properties: {
4441
+ sourceAccount: {
4442
+ type: 'string',
4443
+ description: 'Source account for transactions (Beancount format)',
4444
+ example: 'Assets:Alipay:Balance',
4445
+ pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4446
+ },
4447
+ currency: {
4448
+ type: 'string',
4449
+ description: 'Default currency (ISO 4217 code)',
4450
+ example: 'CNY',
4451
+ minLength: 3,
4452
+ maxLength: 3,
4453
+ pattern: '^[A-Z]{3}$'
4454
+ },
4455
+ expenseAccount: {
4456
+ type: 'string',
4457
+ description: 'Default expense account (optional)',
4458
+ example: 'Expenses:Unknown',
4459
+ pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4460
+ },
4461
+ incomeAccount: {
4462
+ type: 'string',
4463
+ description: 'Default income account (optional)',
4464
+ example: 'Income:Unknown',
4465
+ pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4466
+ },
4467
+ methodAccountMapping: {
4468
+ type: 'object',
4469
+ description:
4470
+ 'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
4471
+ example: {
4472
+ HuaBei: 'Liabilities:Alipay:Huabei',
4473
+ CreditCard: 'Liabilities:CreditCard'
4474
+ }
4475
+ }
4476
+ }
4477
+ } as const;
4478
+
4479
+ export const $UpdateConfigDataDto = {
4480
+ type: 'object',
4481
+ properties: {
4482
+ defaults: {
4483
+ description: 'Mapper defaults configuration',
4484
+ allOf: [
4485
+ {
4486
+ $ref: '#/components/schemas/UpdateMapperDefaultsDto'
4487
+ }
4488
+ ]
4489
+ }
4490
+ }
4491
+ } as const;
4492
+
4493
+ export const $UpdateImporterConfigDto = {
4494
+ type: 'object',
4495
+ properties: {
4496
+ data: {
4497
+ description: 'Configuration data (v1 schema)',
4498
+ allOf: [
4499
+ {
4500
+ $ref: '#/components/schemas/UpdateConfigDataDto'
4501
+ }
4502
+ ]
4503
+ }
4504
+ }
4505
+ } as const;
4506
+
4507
+ export const $CreatePlatformDto = {
4508
+ type: 'object',
4509
+ properties: {
4510
+ name: {
4511
+ type: 'string',
4512
+ description: 'Platform name',
4513
+ example: 'Binance'
4514
+ },
4515
+ canonical: {
4516
+ type: 'string',
4517
+ description: 'Platform canonical identifier (lowercase, kebab-case)',
4518
+ example: 'binance'
4519
+ },
4520
+ aliases: {
4521
+ description: 'Platform aliases (multi-language names for lookup)',
4522
+ example: ['Binance', 'Binance Exchange', 'BNB'],
4523
+ type: 'array',
4524
+ items: {
4525
+ type: 'string'
4526
+ }
4527
+ },
4528
+ url: {
4529
+ type: 'string',
4530
+ description: 'Platform URL',
4531
+ example: 'https://www.binance.com'
4532
+ },
4533
+ type: {
4534
+ type: 'string',
4535
+ description: 'Platform type',
4536
+ enum: [
4537
+ 'BANK',
4538
+ 'BROKERAGE',
4539
+ 'CRYPTO_EXCHANGE',
4540
+ 'PAYMENT',
4541
+ 'INVESTMENT',
4542
+ 'INSURANCE',
4543
+ 'OTHER'
4544
+ ],
4545
+ example: 'CRYPTO_EXCHANGE'
4546
+ },
4547
+ logoUrl: {
4548
+ type: 'string',
4549
+ description: 'Platform logo URL',
4550
+ example: 'https://example.com/logos/binance.png'
4551
+ },
4552
+ isActive: {
4553
+ type: 'boolean',
4554
+ description: 'Whether the platform is active',
4555
+ default: true
4556
+ }
4557
+ },
4558
+ required: ['name', 'canonical', 'aliases', 'url', 'type']
4559
+ } as const;
4560
+
4561
+ export const $UpdatePlatformDto = {
4562
+ type: 'object',
4563
+ properties: {
4564
+ name: {
4565
+ type: 'string',
4566
+ description: 'Platform name',
4567
+ example: 'Binance'
4568
+ },
4569
+ canonical: {
4570
+ type: 'string',
4571
+ description: 'Platform canonical identifier (lowercase, kebab-case)',
4572
+ example: 'binance'
4573
+ },
4574
+ aliases: {
4575
+ description: 'Platform aliases (multi-language names for lookup)',
4576
+ example: ['Binance', 'Binance Exchange', 'BNB'],
4577
+ type: 'array',
4578
+ items: {
4579
+ type: 'string'
4580
+ }
4581
+ },
4582
+ url: {
4583
+ type: 'string',
4584
+ description: 'Platform URL',
4585
+ example: 'https://www.binance.com'
4586
+ },
4587
+ type: {
4588
+ type: 'string',
4589
+ description: 'Platform type',
4590
+ enum: [
4591
+ 'BANK',
4592
+ 'BROKERAGE',
4593
+ 'CRYPTO_EXCHANGE',
4594
+ 'PAYMENT',
4595
+ 'INVESTMENT',
4596
+ 'INSURANCE',
4597
+ 'OTHER'
4598
+ ],
4599
+ example: 'CRYPTO_EXCHANGE'
4600
+ },
4601
+ logoUrl: {
4602
+ type: 'string',
4603
+ description: 'Platform logo URL',
4604
+ example: 'https://example.com/logos/binance.png'
4605
+ },
4606
+ isActive: {
4607
+ type: 'boolean',
4608
+ description: 'Whether the platform is active'
4609
+ }
4610
+ }
4611
+ } as const;
4612
+
3137
4613
  export const $ProviderSyncConfigDto = {
3138
4614
  type: 'object',
3139
4615
  properties: {
@@ -3268,7 +4744,8 @@ export const $SupportedProvidersResponseDto = {
3268
4744
  'gocardless',
3269
4745
  'simplefin',
3270
4746
  'yodlee',
3271
- 'beancount-direct'
4747
+ 'beancount-direct',
4748
+ 'parsed-bill'
3272
4749
  ],
3273
4750
  type: 'array',
3274
4751
  items: {
@@ -3279,6 +4756,11 @@ export const $SupportedProvidersResponseDto = {
3279
4756
  required: ['providers']
3280
4757
  } as const;
3281
4758
 
4759
+ export const $ParserTelemetryReportDto = {
4760
+ type: 'object',
4761
+ properties: {}
4762
+ } as const;
4763
+
3282
4764
  export const $ProcessNlpDto = {
3283
4765
  type: 'object',
3284
4766
  properties: {
@@ -3293,6 +4775,16 @@ export const $ProcessNlpDto = {
3293
4775
  description:
3294
4776
  'Session ID for multi-turn conversation (auto-generated if not provided)',
3295
4777
  example: 'session_abc123'
4778
+ },
4779
+ parsedData: {
4780
+ type: 'object',
4781
+ description:
4782
+ 'Parsed data from previous NLP response for session recovery. Send back the parsedData received in confirm_payee/confirm responses.',
4783
+ example: {
4784
+ amount: 35,
4785
+ currency: 'CNY',
4786
+ payee: 'Starbucks'
4787
+ }
3296
4788
  }
3297
4789
  },
3298
4790
  required: ['message']