@firela/api-types 0.0.0-canary.5639ea2d → 0.0.0-canary.614ff760

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,97 +782,236 @@ export const $ApiProblemResponseDto = {
607
782
  required: ['type', 'title', 'status', 'detail']
608
783
  } as const;
609
784
 
610
- export const $PostingDetailDto = {
785
+ export const $BatchCreateTransactionDto = {
611
786
  type: 'object',
612
787
  properties: {
613
- id: {
614
- type: 'string',
615
- description: 'Posting ID',
616
- example: 'clh1234567890abcdef'
617
- },
618
- accountId: {
619
- type: 'string',
620
- description: 'Account ID',
621
- example: 'clh1234567890abcdef'
622
- },
623
- accountName: {
624
- type: 'string',
625
- description: 'Account name',
626
- example: 'Assets:Bank:Checking'
627
- },
628
- units: {
629
- type: 'string',
630
- description: 'Amount (may be null if interpolated)',
631
- example: '100.50'
632
- },
633
- currency: {
634
- type: 'string',
635
- description: 'Currency',
636
- example: 'USD'
637
- },
638
- costAmount: {
639
- type: 'string',
640
- description: 'Cost amount',
641
- example: '98.00'
642
- },
643
- costCurrency: {
644
- type: 'string',
645
- description: 'Cost currency',
646
- example: 'USD'
647
- },
648
- costDate: {
649
- type: 'string',
650
- description: 'Cost date',
651
- example: '2024-01-15'
652
- },
653
- priceAmount: {
654
- type: 'string',
655
- description: 'Price amount',
656
- example: '1.02'
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
657
808
  },
658
- priceCurrency: {
809
+ error: {
659
810
  type: 'string',
660
- description: 'Price currency',
661
- example: 'EUR'
811
+ description: 'Error message describing the failure',
812
+ example: 'Transaction does not balance'
662
813
  },
663
- flag: {
814
+ errorCode: {
664
815
  type: 'string',
665
- description: 'Posting flag',
666
- example: '*'
667
- },
668
- meta: {
669
- type: 'object',
670
- description: 'Posting metadata'
816
+ description: 'Structured error code for programmatic handling',
817
+ example: 'INSUFFICIENT_QUANTITY'
671
818
  }
672
819
  },
673
- required: ['id', 'accountId', 'accountName']
820
+ required: ['index', 'error']
674
821
  } as const;
675
822
 
676
- export const $TransactionDetailDto = {
823
+ export const $BatchTransactionResponseDto = {
677
824
  type: 'object',
678
825
  properties: {
679
- id: {
680
- type: 'string',
681
- description: 'Transaction ID',
682
- example: 'clh1234567890abcdef'
826
+ succeeded: {
827
+ description: 'Successfully created transactions',
828
+ type: 'array',
829
+ items: {
830
+ $ref: '#/components/schemas/TransactionResponseDto'
831
+ }
683
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
+
844
+ export const $CorrectTransactionDto = {
845
+ type: 'object',
846
+ properties: {
684
847
  date: {
685
848
  type: 'string',
686
- description: 'Transaction date',
849
+ description: 'Transaction date (ISO 8601 format)',
687
850
  example: '2024-11-28'
688
851
  },
689
852
  flag: {
690
853
  type: 'string',
691
- description: 'Transaction flag',
692
- enum: [
693
- 'CLEARED',
694
- 'PENDING',
695
- 'PADDING',
696
- 'SUMMARIZE',
697
- 'TRANSFER',
698
- 'CONVERSIONS'
699
- ],
700
- example: 'CLEARED'
854
+ description: 'Transaction flag: * (cleared), ! (pending)',
855
+ enum: ['*', '!'],
856
+ example: '*'
857
+ },
858
+ payee: {
859
+ type: 'string',
860
+ description: 'Payee name',
861
+ example: 'Whole Foods Market'
862
+ },
863
+ narration: {
864
+ type: 'string',
865
+ description: 'Transaction narration/description',
866
+ example: 'Grocery shopping'
867
+ },
868
+ tags: {
869
+ description: 'Transaction tags (without # prefix)',
870
+ example: ['vacation', 'personal'],
871
+ type: 'array',
872
+ items: {
873
+ type: 'string'
874
+ }
875
+ },
876
+ links: {
877
+ description: 'Transaction links (without ^ prefix)',
878
+ example: ['invoice-123'],
879
+ type: 'array',
880
+ items: {
881
+ type: 'string'
882
+ }
883
+ },
884
+ postings: {
885
+ description:
886
+ 'Transaction postings (minimum 1, typically 2 for double-entry)',
887
+ type: 'array',
888
+ items: {
889
+ $ref: '#/components/schemas/CreatePostingDto'
890
+ }
891
+ },
892
+ meta: {
893
+ type: 'object',
894
+ description: 'Transaction-level metadata',
895
+ example: {
896
+ invoice: '12345'
897
+ }
898
+ },
899
+ idempotencyKey: {
900
+ type: 'string',
901
+ description:
902
+ 'Unique key for idempotent transaction creation. If provided, duplicate requests with the same key will return the existing transaction.',
903
+ example: 'import-2024-01-15-batch-001',
904
+ maxLength: 128
905
+ },
906
+ autoCreateAccounts: {
907
+ type: 'boolean',
908
+ description:
909
+ '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.',
910
+ default: true,
911
+ example: true
912
+ },
913
+ correctionReason: {
914
+ type: 'string',
915
+ description: 'Reason for correcting/superseding the original transaction',
916
+ example: 'Wrong amount — corrected from receipt',
917
+ maxLength: 500
918
+ }
919
+ },
920
+ required: ['date', 'narration', 'postings']
921
+ } as const;
922
+
923
+ export const $PostingDetailDto = {
924
+ type: 'object',
925
+ properties: {
926
+ id: {
927
+ type: 'string',
928
+ description: 'Posting ID',
929
+ example: 'clh1234567890abcdef'
930
+ },
931
+ accountId: {
932
+ type: 'string',
933
+ description: 'Account ID',
934
+ example: 'clh1234567890abcdef'
935
+ },
936
+ accountName: {
937
+ type: 'string',
938
+ description: 'Account name',
939
+ example: 'Assets:Bank:Checking'
940
+ },
941
+ units: {
942
+ type: 'string',
943
+ description:
944
+ 'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
945
+ example: '100.50'
946
+ },
947
+ currency: {
948
+ type: 'string',
949
+ description: 'Currency',
950
+ example: 'USD'
951
+ },
952
+ costAmount: {
953
+ type: 'string',
954
+ description: 'Cost amount',
955
+ example: '98.00'
956
+ },
957
+ costCurrency: {
958
+ type: 'string',
959
+ description: 'Cost currency',
960
+ example: 'USD'
961
+ },
962
+ costDate: {
963
+ type: 'string',
964
+ description: 'Cost date',
965
+ example: '2024-01-15'
966
+ },
967
+ priceAmount: {
968
+ type: 'string',
969
+ description: 'Price amount',
970
+ example: '1.02'
971
+ },
972
+ priceCurrency: {
973
+ type: 'string',
974
+ description: 'Price currency',
975
+ example: 'EUR'
976
+ },
977
+ flag: {
978
+ type: 'string',
979
+ description: 'Posting flag',
980
+ example: '*'
981
+ },
982
+ meta: {
983
+ type: 'object',
984
+ description: 'Posting metadata'
985
+ }
986
+ },
987
+ required: ['id', 'accountId', 'accountName']
988
+ } as const;
989
+
990
+ export const $TransactionDetailDto = {
991
+ type: 'object',
992
+ properties: {
993
+ id: {
994
+ type: 'string',
995
+ description: 'Transaction ID',
996
+ example: 'clh1234567890abcdef'
997
+ },
998
+ date: {
999
+ type: 'string',
1000
+ description: 'Transaction date',
1001
+ example: '2024-11-28'
1002
+ },
1003
+ flag: {
1004
+ type: 'string',
1005
+ description: 'Transaction flag',
1006
+ enum: [
1007
+ 'CLEARED',
1008
+ 'PENDING',
1009
+ 'PADDING',
1010
+ 'SUMMARIZE',
1011
+ 'TRANSFER',
1012
+ 'CONVERSIONS'
1013
+ ],
1014
+ example: 'CLEARED'
701
1015
  },
702
1016
  customFlag: {
703
1017
  type: 'string',
@@ -742,8 +1056,8 @@ export const $TransactionDetailDto = {
742
1056
  },
743
1057
  sourceType: {
744
1058
  type: 'string',
745
- description: 'Source type (how the transaction was created)',
746
- enum: ['NLP', 'CSV', 'OCR', 'API']
1059
+ description:
1060
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
747
1061
  },
748
1062
  sourcePlatform: {
749
1063
  type: 'string',
@@ -776,6 +1090,18 @@ export const $TransactionDetailDto = {
776
1090
  type: 'string',
777
1091
  description: 'Correction reason (if voided or superseded)',
778
1092
  example: 'Duplicate entry'
1093
+ },
1094
+ supersededBy: {
1095
+ type: 'string',
1096
+ description:
1097
+ 'ID of the transaction that supersedes this one (set when status=SUPERSEDED)',
1098
+ example: 'clh1234567890abcdef'
1099
+ },
1100
+ originalTxn: {
1101
+ type: 'string',
1102
+ description:
1103
+ 'ID of the transaction this one corrected/replaced (back-link on the replacement)',
1104
+ example: 'clh1234567890abcdef'
779
1105
  }
780
1106
  },
781
1107
  required: [
@@ -819,6 +1145,37 @@ export const $TransactionListResponseDto = {
819
1145
  required: ['data', 'total', 'limit', 'offset']
820
1146
  } as const;
821
1147
 
1148
+ export const $TagSuggestionDto = {
1149
+ type: 'object',
1150
+ properties: {
1151
+ tag: {
1152
+ type: 'string',
1153
+ description: 'Tag name',
1154
+ example: 'Monthly'
1155
+ },
1156
+ count: {
1157
+ type: 'number',
1158
+ description: 'Usage count across ACTIVE transactions',
1159
+ example: 12
1160
+ }
1161
+ },
1162
+ required: ['tag', 'count']
1163
+ } as const;
1164
+
1165
+ export const $TagSuggestionsResponseDto = {
1166
+ type: 'object',
1167
+ properties: {
1168
+ data: {
1169
+ description: 'Tag suggestions sorted as requested',
1170
+ type: 'array',
1171
+ items: {
1172
+ $ref: '#/components/schemas/TagSuggestionDto'
1173
+ }
1174
+ }
1175
+ },
1176
+ required: ['data']
1177
+ } as const;
1178
+
822
1179
  export const $UpdateTransactionDto = {
823
1180
  type: 'object',
824
1181
  properties: {
@@ -876,132 +1233,6 @@ export const $UpdateTransactionDto = {
876
1233
  }
877
1234
  } as const;
878
1235
 
879
- export const $AccountStandardResponseDto = {
880
- type: 'object',
881
- properties: {
882
- path: {
883
- type: 'string',
884
- description: 'Account path (hierarchical, colon-separated)',
885
- example: 'Assets:CN:Bank:ICBC:Checking'
886
- },
887
- type: {
888
- type: 'string',
889
- description: 'Account type in Beancount hierarchy',
890
- enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
891
- example: 'Assets'
892
- },
893
- i18nKey: {
894
- type: 'string',
895
- description: 'i18n key for localized display name',
896
- example: 'account.assets.cn.bank.icbc.checking'
897
- },
898
- description: {
899
- type: 'string',
900
- description: 'Account description',
901
- example: 'ICBC checking account for daily transactions'
902
- },
903
- tags: {
904
- description: 'Account tags for categorization',
905
- example: ['bank', 'checking', 'primary'],
906
- type: 'array',
907
- items: {
908
- type: 'string'
909
- }
910
- },
911
- icon: {
912
- type: 'string',
913
- description: 'Icon identifier for UI display',
914
- example: 'bank-icbc'
915
- }
916
- },
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 $RegionConfigDto = {
945
- type: 'object',
946
- properties: {
947
- currency: {
948
- type: 'string',
949
- example: 'EUR'
950
- },
951
- dateFormat: {
952
- type: 'string',
953
- example: 'DD.MM.YYYY'
954
- },
955
- locale: {
956
- type: 'string',
957
- example: 'de-DE'
958
- }
959
- },
960
- required: ['currency', 'dateFormat', 'locale']
961
- } as const;
962
-
963
- export const $RegionInfoDto = {
964
- type: 'object',
965
- properties: {
966
- code: {
967
- type: 'string',
968
- example: 'de'
969
- },
970
- displayName: {
971
- type: 'string',
972
- example: 'Germany'
973
- },
974
- parent: {
975
- type: 'string',
976
- example: 'eu-core'
977
- },
978
- chain: {
979
- example: ['eu-core', 'de'],
980
- type: 'array',
981
- items: {
982
- type: 'string'
983
- }
984
- },
985
- config: {
986
- $ref: '#/components/schemas/RegionConfigDto'
987
- }
988
- },
989
- required: ['code', 'displayName', 'chain', 'config']
990
- } as const;
991
-
992
- export const $RegionsMetadataResponseDto = {
993
- type: 'object',
994
- properties: {
995
- regions: {
996
- type: 'array',
997
- items: {
998
- $ref: '#/components/schemas/RegionInfoDto'
999
- }
1000
- }
1001
- },
1002
- required: ['regions']
1003
- } as const;
1004
-
1005
1236
  export const $BalanceResponseDto = {
1006
1237
  type: 'object',
1007
1238
  properties: {
@@ -1095,8 +1326,8 @@ export const $TransactionSummaryDto = {
1095
1326
  },
1096
1327
  sourceType: {
1097
1328
  type: 'string',
1098
- description: 'Source type (NLP, CSV, OCR, API)',
1099
- enum: ['NLP', 'CSV', 'OCR', 'API']
1329
+ description:
1330
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1100
1331
  },
1101
1332
  sourcePlatform: {
1102
1333
  type: 'string',
@@ -1136,8 +1367,10 @@ export const $ReviewSummaryDto = {
1136
1367
  },
1137
1368
  confidenceLevel: {
1138
1369
  type: 'string',
1139
- description: 'Confidence level derived from score',
1140
- enum: ['HIGH', 'MEDIUM', 'LOW']
1370
+ description:
1371
+ 'Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.',
1372
+ enum: ['HIGH', 'MEDIUM', 'LOW'],
1373
+ nullable: true
1141
1374
  },
1142
1375
  summaryKey: {
1143
1376
  type: 'string',
@@ -1161,7 +1394,8 @@ export const $ReviewSummaryDto = {
1161
1394
  },
1162
1395
  sourceType: {
1163
1396
  type: 'string',
1164
- description: 'Source type (NLP, CSV, OCR, API)'
1397
+ description:
1398
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1165
1399
  },
1166
1400
  sourcePlatform: {
1167
1401
  type: 'string',
@@ -1271,7 +1505,20 @@ export const $DecisionOptionDto = {
1271
1505
  properties: {
1272
1506
  value: {
1273
1507
  type: 'string',
1274
- description: 'The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)'
1508
+ description: 'The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)',
1509
+ enum: [
1510
+ 'UPGRADE_REPLACE',
1511
+ 'LINK_KEEP_BOTH',
1512
+ 'IGNORE_NEW',
1513
+ 'CONFIRM_DIFFERENT',
1514
+ 'ACCEPT',
1515
+ 'REJECT',
1516
+ 'ACCEPT_AND_LEARN',
1517
+ 'CHOOSE_OTHER',
1518
+ 'CANCEL',
1519
+ 'FIX',
1520
+ 'IGNORE'
1521
+ ]
1275
1522
  },
1276
1523
  labelKey: {
1277
1524
  type: 'string',
@@ -1319,8 +1566,10 @@ export const $ReviewDetailDto = {
1319
1566
  },
1320
1567
  confidenceLevel: {
1321
1568
  type: 'string',
1322
- description: 'Confidence level derived from score',
1323
- enum: ['HIGH', 'MEDIUM', 'LOW']
1569
+ description:
1570
+ 'Confidence level derived from score. Null for error-type reviews (ACCOUNT_VALIDATION/PIPELINE_ERROR) which carry no confidence.',
1571
+ enum: ['HIGH', 'MEDIUM', 'LOW'],
1572
+ nullable: true
1324
1573
  },
1325
1574
  summaryKey: {
1326
1575
  type: 'string',
@@ -1344,7 +1593,8 @@ export const $ReviewDetailDto = {
1344
1593
  },
1345
1594
  sourceType: {
1346
1595
  type: 'string',
1347
- description: 'Source type (NLP, CSV, OCR, API)'
1596
+ description:
1597
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1348
1598
  },
1349
1599
  sourcePlatform: {
1350
1600
  type: 'string',
@@ -1418,6 +1668,208 @@ export const $ReviewDetailDto = {
1418
1668
  ]
1419
1669
  } as const;
1420
1670
 
1671
+ export const $ResolveReviewDto = {
1672
+ type: 'object',
1673
+ properties: {
1674
+ action: {
1675
+ type: 'string',
1676
+ description:
1677
+ 'Decision action. Valid actions vary by review type — see DecisionOptionDto.value returned by the review detail endpoint.',
1678
+ enum: [
1679
+ 'UPGRADE_REPLACE',
1680
+ 'LINK_KEEP_BOTH',
1681
+ 'IGNORE_NEW',
1682
+ 'CONFIRM_DIFFERENT',
1683
+ 'ACCEPT',
1684
+ 'REJECT',
1685
+ 'ACCEPT_AND_LEARN',
1686
+ 'CHOOSE_OTHER',
1687
+ 'CANCEL',
1688
+ 'FIX',
1689
+ 'IGNORE'
1690
+ ],
1691
+ example: 'ACCEPT'
1692
+ },
1693
+ data: {
1694
+ type: 'object',
1695
+ description:
1696
+ 'Additional data for the decision (e.g., selected account ID)',
1697
+ example: {
1698
+ accountId: 'acc-123'
1699
+ }
1700
+ }
1701
+ },
1702
+ required: ['action']
1703
+ } as const;
1704
+
1705
+ export const $ResolveResultDto = {
1706
+ type: 'object',
1707
+ properties: {
1708
+ success: {
1709
+ type: 'boolean',
1710
+ description: 'Whether resolution was successful'
1711
+ },
1712
+ messageKey: {
1713
+ type: 'string',
1714
+ description:
1715
+ 'i18n message key for result message (e.g., review.payee.result.mapped)'
1716
+ },
1717
+ messageParams: {
1718
+ type: 'object',
1719
+ description:
1720
+ 'Parameters for message interpolation (e.g., { name: "PayeeName" })',
1721
+ additionalProperties: {
1722
+ type: 'string'
1723
+ }
1724
+ },
1725
+ resolutionId: {
1726
+ type: 'string',
1727
+ description: 'Resolution ID for undo'
1728
+ },
1729
+ canUndo: {
1730
+ type: 'boolean',
1731
+ description: 'Whether this decision can be undone'
1732
+ },
1733
+ undoDeadline: {
1734
+ format: 'date-time',
1735
+ type: 'string',
1736
+ description: 'Deadline for undo (24h from resolution)'
1737
+ },
1738
+ learnedRuleId: {
1739
+ type: 'string',
1740
+ description:
1741
+ 'Rule ID if learning was triggered (ACCEPT_AND_LEARN actions). Use this to deep-link to the rule management page.',
1742
+ example: 'rule_01HXK5V8N2M3P4Q5R6S7T8U9V0'
1743
+ }
1744
+ },
1745
+ required: ['success', 'resolutionId', 'canUndo', 'undoDeadline']
1746
+ } as const;
1747
+
1748
+ export const $UndoResultDto = {
1749
+ type: 'object',
1750
+ properties: {
1751
+ success: {
1752
+ type: 'boolean',
1753
+ description: 'Whether undo was successful'
1754
+ },
1755
+ message: {
1756
+ type: 'string',
1757
+ description: 'Message'
1758
+ },
1759
+ reviewId: {
1760
+ type: 'string',
1761
+ description: 'Review item ID that was restored'
1762
+ }
1763
+ },
1764
+ required: ['success', 'reviewId']
1765
+ } as const;
1766
+
1767
+ export const $BatchResolveDto = {
1768
+ type: 'object',
1769
+ properties: {
1770
+ reviewIds: {
1771
+ description: 'Review item IDs to resolve',
1772
+ example: ['review-1', 'review-2', 'review-3'],
1773
+ type: 'array',
1774
+ items: {
1775
+ type: 'string'
1776
+ }
1777
+ },
1778
+ action: {
1779
+ type: 'string',
1780
+ description: 'Decision action to apply to all items',
1781
+ enum: [
1782
+ 'UPGRADE_REPLACE',
1783
+ 'LINK_KEEP_BOTH',
1784
+ 'IGNORE_NEW',
1785
+ 'CONFIRM_DIFFERENT',
1786
+ 'ACCEPT',
1787
+ 'REJECT',
1788
+ 'ACCEPT_AND_LEARN',
1789
+ 'CHOOSE_OTHER',
1790
+ 'CANCEL',
1791
+ 'FIX',
1792
+ 'IGNORE'
1793
+ ],
1794
+ example: 'ACCEPT'
1795
+ },
1796
+ data: {
1797
+ type: 'object',
1798
+ description: 'Additional data for the decision'
1799
+ }
1800
+ },
1801
+ required: ['reviewIds', 'action']
1802
+ } as const;
1803
+
1804
+ export const $BatchResolveResultDto = {
1805
+ type: 'object',
1806
+ properties: {
1807
+ successCount: {
1808
+ type: 'number',
1809
+ description: 'Number of successfully resolved items'
1810
+ },
1811
+ failedCount: {
1812
+ type: 'number',
1813
+ description: 'Number of failed items'
1814
+ },
1815
+ results: {
1816
+ description: 'Details for each item',
1817
+ type: 'array',
1818
+ items: {
1819
+ type: 'string'
1820
+ }
1821
+ }
1822
+ },
1823
+ required: ['successCount', 'failedCount', 'results']
1824
+ } as const;
1825
+
1826
+ export const $CreatePayeeDto = {
1827
+ type: 'object',
1828
+ properties: {
1829
+ payee: {
1830
+ type: 'string',
1831
+ description:
1832
+ "User's original payee name (e.g., 'Starbucks', 'McDonald'). This is the raw payee string as entered by the user.",
1833
+ example: 'Starbucks',
1834
+ maxLength: 200
1835
+ },
1836
+ payeeProfileId: {
1837
+ type: 'string',
1838
+ description:
1839
+ 'Optional reference to global PayeeProfile for standardized data (merchant info, i18n keys, categories)',
1840
+ example: 'uuid-123',
1841
+ format: 'uuid'
1842
+ },
1843
+ customCategory: {
1844
+ type: 'string',
1845
+ description:
1846
+ "User's custom category for this payee (overrides PayeeProfile category)",
1847
+ example: 'Dining:Coffee',
1848
+ maxLength: 100
1849
+ },
1850
+ customTags: {
1851
+ description:
1852
+ "User's custom tags for this payee (e.g., ['favorite', 'work_meal'])",
1853
+ example: ['favorite', 'work_meal'],
1854
+ type: 'array',
1855
+ items: {
1856
+ type: 'string'
1857
+ }
1858
+ },
1859
+ meta: {
1860
+ type: 'object',
1861
+ description:
1862
+ 'Metadata for extended information (location, notes, contact info, etc.)',
1863
+ example: {
1864
+ location: 'Zhongguancun',
1865
+ note: 'Near subway station',
1866
+ favorite: true
1867
+ }
1868
+ }
1869
+ },
1870
+ required: ['payee']
1871
+ } as const;
1872
+
1421
1873
  export const $PayeeResponseDto = {
1422
1874
  type: 'object',
1423
1875
  properties: {
@@ -1437,14 +1889,14 @@ export const $PayeeResponseDto = {
1437
1889
  example: 'Starbucks'
1438
1890
  },
1439
1891
  payeeProfileId: {
1440
- type: 'object',
1892
+ type: 'string',
1441
1893
  description:
1442
1894
  'Reference to global PayeeProfile (merchant info, i18n keys, categories)',
1443
1895
  example: 'uuid-789',
1444
1896
  nullable: true
1445
1897
  },
1446
1898
  customCategory: {
1447
- type: 'object',
1899
+ type: 'string',
1448
1900
  description:
1449
1901
  "User's custom category (overrides PayeeProfile category if set)",
1450
1902
  example: 'Dining:Coffee',
@@ -1550,22 +2002,187 @@ export const $PayeeStatsResponseDto = {
1550
2002
  properties: {
1551
2003
  payee: {
1552
2004
  type: 'string',
1553
- description: 'Payee name',
1554
- example: 'Starbucks'
2005
+ description: 'Payee name',
2006
+ example: 'Starbucks'
2007
+ },
2008
+ transactionCount: {
2009
+ type: 'number',
2010
+ description: 'Total transaction count',
2011
+ example: 42
2012
+ },
2013
+ lastUsedAt: {
2014
+ format: 'date-time',
2015
+ type: 'string',
2016
+ description: 'Last used timestamp',
2017
+ example: '2024-11-20T10:00:00Z'
2018
+ }
2019
+ },
2020
+ required: ['payee', 'transactionCount', 'lastUsedAt']
2021
+ } as const;
2022
+
2023
+ export const $UpdatePayeeDto = {
2024
+ type: 'object',
2025
+ properties: {
2026
+ payeeProfileId: {
2027
+ type: 'string',
2028
+ description:
2029
+ 'Optional reference to global PayeeProfile for standardized data (merchant info, i18n keys, categories)',
2030
+ example: 'uuid-123',
2031
+ format: 'uuid'
2032
+ },
2033
+ customCategory: {
2034
+ type: 'string',
2035
+ description:
2036
+ "User's custom category for this payee (overrides PayeeProfile category)",
2037
+ example: 'Dining:Coffee',
2038
+ maxLength: 100
2039
+ },
2040
+ customTags: {
2041
+ description:
2042
+ "User's custom tags for this payee (e.g., ['favorite', 'work_meal'])",
2043
+ example: ['favorite', 'work_meal'],
2044
+ type: 'array',
2045
+ items: {
2046
+ type: 'string'
2047
+ }
2048
+ },
2049
+ meta: {
2050
+ type: 'object',
2051
+ description:
2052
+ 'Metadata for extended information (location, notes, contact info, etc.). Will merge with existing metadata.',
2053
+ example: {
2054
+ location: 'Zhongguancun',
2055
+ note: 'Updated note',
2056
+ favorite: true
2057
+ }
2058
+ },
2059
+ isActive: {
2060
+ type: 'boolean',
2061
+ description:
2062
+ 'Enable or disable this payee. Disabled payees will not appear in autocomplete suggestions.',
2063
+ example: true
2064
+ }
2065
+ }
2066
+ } as const;
2067
+
2068
+ export const $CreatePayeeProfileDto = {
2069
+ type: 'object',
2070
+ properties: {
2071
+ canonical: {
2072
+ type: 'string',
2073
+ description:
2074
+ 'Canonical payee name (unique, case-insensitive). This is the primary identifier for the payee.',
2075
+ example: 'Starbucks',
2076
+ maxLength: 200
2077
+ },
2078
+ aliases: {
2079
+ description:
2080
+ 'Multi-language aliases for the payee. Used for matching user input in different languages.',
2081
+ example: ['Starbucks Coffee', 'SBUX'],
2082
+ type: 'array',
2083
+ items: {
2084
+ type: 'string'
2085
+ }
2086
+ },
2087
+ i18nKey: {
2088
+ type: 'string',
2089
+ description:
2090
+ 'Translation key for i18n integration (XLIFF translation system)',
2091
+ example: 'payee.starbucks',
2092
+ maxLength: 100
2093
+ },
2094
+ category: {
2095
+ type: 'string',
2096
+ description: 'Payee category classification',
2097
+ enum: [
2098
+ 'RESTAURANT',
2099
+ 'CAFE',
2100
+ 'FAST_FOOD',
2101
+ 'BAR',
2102
+ 'SUPERMARKET',
2103
+ 'CONVENIENCE_STORE',
2104
+ 'SHOPPING_MALL',
2105
+ 'ONLINE_SHOPPING',
2106
+ 'TAXI',
2107
+ 'RIDE_SHARING',
2108
+ 'PUBLIC_TRANSPORT',
2109
+ 'PARKING',
2110
+ 'GAS_STATION',
2111
+ 'UTILITIES',
2112
+ 'TELECOM',
2113
+ 'STREAMING',
2114
+ 'HEALTHCARE',
2115
+ 'EDUCATION',
2116
+ 'ENTERTAINMENT',
2117
+ 'SPORTS',
2118
+ 'TRAVEL',
2119
+ 'HOTEL',
2120
+ 'OTHER'
2121
+ ],
2122
+ example: 'CAFE'
2123
+ },
2124
+ subCategory: {
2125
+ type: 'string',
2126
+ description: 'Sub-category for more specific classification',
2127
+ example: 'coffee_chain',
2128
+ maxLength: 100
2129
+ },
2130
+ countries: {
2131
+ description:
2132
+ 'Country/region codes where the payee operates (ISO 3166-1 alpha-2)',
2133
+ example: ['CN', 'US', 'JP'],
2134
+ type: 'array',
2135
+ items: {
2136
+ type: 'string'
2137
+ }
2138
+ },
2139
+ primaryCountry: {
2140
+ type: 'string',
2141
+ description: 'Primary operating country (ISO 3166-1 alpha-2)',
2142
+ example: 'US',
2143
+ maxLength: 2
2144
+ },
2145
+ keywords: {
2146
+ description: 'Search keywords for fuzzy matching',
2147
+ example: ['coffee', 'cafe', 'drinks'],
2148
+ type: 'array',
2149
+ items: {
2150
+ type: 'string'
2151
+ }
2152
+ },
2153
+ logoUrl: {
2154
+ type: 'string',
2155
+ description: 'Payee logo URL',
2156
+ example: 'https://example.com/logo.png'
1555
2157
  },
1556
- transactionCount: {
1557
- type: 'number',
1558
- description: 'Total transaction count',
1559
- example: 42
2158
+ website: {
2159
+ type: 'string',
2160
+ description: 'Official website URL',
2161
+ example: 'https://www.starbucks.com'
1560
2162
  },
1561
- lastUsedAt: {
1562
- format: 'date-time',
2163
+ description: {
1563
2164
  type: 'string',
1564
- description: 'Last used timestamp',
1565
- example: '2024-11-20T10:00:00Z'
2165
+ description: 'Payee description',
2166
+ example: 'Global coffeehouse chain headquartered in Seattle',
2167
+ maxLength: 1000
2168
+ },
2169
+ meta: {
2170
+ type: 'object',
2171
+ description:
2172
+ 'Extended metadata (business hours, contact info, additional details)',
2173
+ example: {
2174
+ businessHours: '07:00-22:00',
2175
+ phone: '+1-800-782-7282'
2176
+ }
2177
+ },
2178
+ dataSource: {
2179
+ type: 'string',
2180
+ description: 'Data source for this profile',
2181
+ enum: ['MANUAL', 'IMPORT', 'API', 'CROWDSOURCED'],
2182
+ default: 'MANUAL'
1566
2183
  }
1567
2184
  },
1568
- required: ['payee', 'transactionCount', 'lastUsedAt']
2185
+ required: ['canonical', 'category']
1569
2186
  } as const;
1570
2187
 
1571
2188
  export const $PayeeProfileResponseDto = {
@@ -1590,7 +2207,7 @@ export const $PayeeProfileResponseDto = {
1590
2207
  }
1591
2208
  },
1592
2209
  i18nKey: {
1593
- type: 'object',
2210
+ type: 'string',
1594
2211
  description: 'Translation key for i18n',
1595
2212
  example: 'payee.starbucks',
1596
2213
  nullable: true
@@ -1626,7 +2243,7 @@ export const $PayeeProfileResponseDto = {
1626
2243
  example: 'CAFE'
1627
2244
  },
1628
2245
  subCategory: {
1629
- type: 'object',
2246
+ type: 'string',
1630
2247
  description: 'Sub-category',
1631
2248
  example: 'coffee_chain',
1632
2249
  nullable: true
@@ -1640,7 +2257,7 @@ export const $PayeeProfileResponseDto = {
1640
2257
  }
1641
2258
  },
1642
2259
  primaryCountry: {
1643
- type: 'object',
2260
+ type: 'string',
1644
2261
  description: 'Primary operating country',
1645
2262
  example: 'US',
1646
2263
  nullable: true
@@ -1654,19 +2271,19 @@ export const $PayeeProfileResponseDto = {
1654
2271
  }
1655
2272
  },
1656
2273
  logoUrl: {
1657
- type: 'object',
2274
+ type: 'string',
1658
2275
  description: 'Logo URL',
1659
2276
  example: 'https://example.com/logo.png',
1660
2277
  nullable: true
1661
2278
  },
1662
2279
  website: {
1663
- type: 'object',
2280
+ type: 'string',
1664
2281
  description: 'Official website',
1665
2282
  example: 'https://www.starbucks.com',
1666
2283
  nullable: true
1667
2284
  },
1668
2285
  description: {
1669
- type: 'object',
2286
+ type: 'string',
1670
2287
  description: 'Description',
1671
2288
  example: 'Global coffeehouse chain',
1672
2289
  nullable: true
@@ -1682,9 +2299,10 @@ export const $PayeeProfileResponseDto = {
1682
2299
  example: 'MANUAL'
1683
2300
  },
1684
2301
  verifiedAt: {
1685
- type: 'object',
2302
+ type: 'string',
1686
2303
  description: 'Verification timestamp (null if not verified)',
1687
2304
  example: '2025-01-01T00:00:00.000Z',
2305
+ format: 'date-time',
1688
2306
  nullable: true
1689
2307
  },
1690
2308
  isActive: {
@@ -1739,6 +2357,164 @@ export const $PayeeProfileListResponseDto = {
1739
2357
  required: ['items', 'total']
1740
2358
  } as const;
1741
2359
 
2360
+ export const $UpdatePayeeProfileDto = {
2361
+ type: 'object',
2362
+ properties: {
2363
+ aliases: {
2364
+ description:
2365
+ 'Multi-language aliases for the payee. Used for matching user input in different languages.',
2366
+ example: ['Starbucks Coffee', 'SBUX'],
2367
+ type: 'array',
2368
+ items: {
2369
+ type: 'string'
2370
+ }
2371
+ },
2372
+ i18nKey: {
2373
+ type: 'string',
2374
+ description:
2375
+ 'Translation key for i18n integration (XLIFF translation system)',
2376
+ example: 'payee.starbucks',
2377
+ maxLength: 100
2378
+ },
2379
+ category: {
2380
+ type: 'string',
2381
+ description: 'Payee category classification',
2382
+ enum: [
2383
+ 'RESTAURANT',
2384
+ 'CAFE',
2385
+ 'FAST_FOOD',
2386
+ 'BAR',
2387
+ 'SUPERMARKET',
2388
+ 'CONVENIENCE_STORE',
2389
+ 'SHOPPING_MALL',
2390
+ 'ONLINE_SHOPPING',
2391
+ 'TAXI',
2392
+ 'RIDE_SHARING',
2393
+ 'PUBLIC_TRANSPORT',
2394
+ 'PARKING',
2395
+ 'GAS_STATION',
2396
+ 'UTILITIES',
2397
+ 'TELECOM',
2398
+ 'STREAMING',
2399
+ 'HEALTHCARE',
2400
+ 'EDUCATION',
2401
+ 'ENTERTAINMENT',
2402
+ 'SPORTS',
2403
+ 'TRAVEL',
2404
+ 'HOTEL',
2405
+ 'OTHER'
2406
+ ],
2407
+ example: 'CAFE'
2408
+ },
2409
+ subCategory: {
2410
+ type: 'string',
2411
+ description: 'Sub-category for more specific classification',
2412
+ example: 'coffee_chain',
2413
+ maxLength: 100
2414
+ },
2415
+ countries: {
2416
+ description:
2417
+ 'Country/region codes where the payee operates (ISO 3166-1 alpha-2)',
2418
+ example: ['CN', 'US', 'JP'],
2419
+ type: 'array',
2420
+ items: {
2421
+ type: 'string'
2422
+ }
2423
+ },
2424
+ primaryCountry: {
2425
+ type: 'string',
2426
+ description: 'Primary operating country (ISO 3166-1 alpha-2)',
2427
+ example: 'US',
2428
+ maxLength: 2
2429
+ },
2430
+ keywords: {
2431
+ description: 'Search keywords for fuzzy matching',
2432
+ example: ['coffee', 'cafe', 'drinks'],
2433
+ type: 'array',
2434
+ items: {
2435
+ type: 'string'
2436
+ }
2437
+ },
2438
+ logoUrl: {
2439
+ type: 'string',
2440
+ description: 'Payee logo URL',
2441
+ example: 'https://example.com/logo.png'
2442
+ },
2443
+ website: {
2444
+ type: 'string',
2445
+ description: 'Official website URL',
2446
+ example: 'https://www.starbucks.com'
2447
+ },
2448
+ description: {
2449
+ type: 'string',
2450
+ description: 'Payee description',
2451
+ example: 'Global coffeehouse chain headquartered in Seattle',
2452
+ maxLength: 1000
2453
+ },
2454
+ meta: {
2455
+ type: 'object',
2456
+ description:
2457
+ 'Extended metadata (business hours, contact info, additional details)',
2458
+ example: {
2459
+ businessHours: '07:00-22:00',
2460
+ phone: '+1-800-782-7282'
2461
+ }
2462
+ },
2463
+ dataSource: {
2464
+ type: 'string',
2465
+ description: 'Data source for this profile',
2466
+ enum: ['MANUAL', 'IMPORT', 'API', 'CROWDSOURCED'],
2467
+ default: 'MANUAL'
2468
+ },
2469
+ isActive: {
2470
+ type: 'boolean',
2471
+ description: 'Whether the payee profile is active (soft delete)',
2472
+ example: true
2473
+ },
2474
+ verifiedAt: {
2475
+ type: 'string',
2476
+ description:
2477
+ 'Verification timestamp. Set to current time to verify, or null to unverify.',
2478
+ example: '2025-01-01T00:00:00.000Z',
2479
+ format: 'date-time',
2480
+ nullable: true
2481
+ }
2482
+ }
2483
+ } as const;
2484
+
2485
+ export const $CreateCommodityDto = {
2486
+ type: 'object',
2487
+ properties: {
2488
+ symbol: {
2489
+ type: 'string',
2490
+ description:
2491
+ 'Commodity symbol (e.g., AAPL, USD, BTC) - corresponds to Beancount currency field',
2492
+ example: 'AAPL',
2493
+ maxLength: 50
2494
+ },
2495
+ date: {
2496
+ type: 'string',
2497
+ description:
2498
+ 'Commodity definition date (ISO 8601, required per Beancount spec). Represents when this commodity was first defined in the accounting system.',
2499
+ example: '2024-01-01',
2500
+ format: 'date'
2501
+ },
2502
+ metadata: {
2503
+ type: 'object',
2504
+ description:
2505
+ 'Metadata (corresponds to Beancount meta field). Can contain name, assetClass, precision, note, tags, etc.',
2506
+ example: {
2507
+ name: 'Apple Inc.',
2508
+ assetClass: 'stock',
2509
+ precision: 2,
2510
+ note: 'Long-term investment',
2511
+ tags: ['tech', 'dividend']
2512
+ }
2513
+ }
2514
+ },
2515
+ required: ['symbol', 'date']
2516
+ } as const;
2517
+
1742
2518
  export const $CommodityResponseDto = {
1743
2519
  type: 'object',
1744
2520
  properties: {
@@ -1748,7 +2524,7 @@ export const $CommodityResponseDto = {
1748
2524
  example: 'uuid-123-456'
1749
2525
  },
1750
2526
  userId: {
1751
- type: 'object',
2527
+ type: 'string',
1752
2528
  description: 'User ID (owner of the commodity)',
1753
2529
  example: 'user-123',
1754
2530
  nullable: true
@@ -1777,13 +2553,6 @@ export const $CommodityResponseDto = {
1777
2553
  source: 'AUTO_CREATED'
1778
2554
  }
1779
2555
  },
1780
- symbolProfileId: {
1781
- type: 'object',
1782
- description:
1783
- 'Reference to SymbolProfile (market data integration, SaaS feature)',
1784
- example: 'uuid-789',
1785
- nullable: true
1786
- },
1787
2556
  createdAt: {
1788
2557
  format: 'date-time',
1789
2558
  type: 'string',
@@ -1810,13 +2579,137 @@ export const $CommodityListResponseDto = {
1810
2579
  $ref: '#/components/schemas/CommodityResponseDto'
1811
2580
  }
1812
2581
  },
1813
- total: {
1814
- type: 'number',
1815
- description: 'Total number of commodities',
1816
- example: 42
2582
+ total: {
2583
+ type: 'number',
2584
+ description: 'Total number of commodities',
2585
+ example: 42
2586
+ }
2587
+ },
2588
+ required: ['items', 'total']
2589
+ } as const;
2590
+
2591
+ export const $UpdateCommodityDto = {
2592
+ type: 'object',
2593
+ properties: {
2594
+ date: {
2595
+ type: 'string',
2596
+ description:
2597
+ 'Commodity definition date (ISO 8601). Represents when this commodity was first defined in the accounting system.',
2598
+ example: '2024-01-01',
2599
+ format: 'date'
2600
+ },
2601
+ metadata: {
2602
+ type: 'object',
2603
+ description:
2604
+ 'Metadata (corresponds to Beancount meta field). Will merge with existing metadata. Can contain name, assetClass, precision, note, tags, etc.',
2605
+ example: {
2606
+ name: 'Updated Apple Inc.',
2607
+ assetClass: 'equity',
2608
+ precision: 4,
2609
+ note: 'Updated investment strategy',
2610
+ lastReviewed: '2024-11-03'
2611
+ }
2612
+ }
2613
+ }
2614
+ } as const;
2615
+
2616
+ export const $CreateRecurringRuleDto = {
2617
+ type: 'object',
2618
+ properties: {
2619
+ name: {
2620
+ type: 'string',
2621
+ description: 'Rule name (unique per user)',
2622
+ maxLength: 100
2623
+ },
2624
+ icon: {
2625
+ type: 'string',
2626
+ description: 'Icon emoji',
2627
+ maxLength: 10
2628
+ },
2629
+ frequency: {
2630
+ type: 'string',
2631
+ description: 'Recurring frequency',
2632
+ enum: [
2633
+ 'WEEKLY',
2634
+ 'BIWEEKLY',
2635
+ 'MONTHLY',
2636
+ 'BIMONTHLY',
2637
+ 'QUARTERLY',
2638
+ 'YEARLY',
2639
+ 'CUSTOM'
2640
+ ]
2641
+ },
2642
+ expectedAmount: {
2643
+ type: 'number',
2644
+ description: 'Expected amount (positive number)',
2645
+ minimum: 0
2646
+ },
2647
+ expectedDay: {
2648
+ type: 'number',
2649
+ description: 'Expected day of month (1-31)',
2650
+ minimum: 1,
2651
+ maximum: 31
2652
+ },
2653
+ customIntervalDays: {
2654
+ type: 'number',
2655
+ description: 'Custom interval in days (required for CUSTOM frequency)',
2656
+ minimum: 1
2657
+ },
2658
+ currency: {
2659
+ type: 'string',
2660
+ description: 'Currency code',
2661
+ default: 'CNY',
2662
+ maxLength: 10
2663
+ },
2664
+ matchPayeePattern: {
2665
+ type: 'string',
2666
+ description: 'Payee matching pattern (supports wildcards)',
2667
+ maxLength: 200
2668
+ },
2669
+ matchAmountTolerance: {
2670
+ type: 'number',
2671
+ description: 'Amount tolerance percentage (0-1)',
2672
+ default: 0.075,
2673
+ minimum: 0,
2674
+ maximum: 1
2675
+ },
2676
+ defaultExpenseAccount: {
2677
+ type: 'string',
2678
+ description: 'Default expense account for auto-create',
2679
+ maxLength: 200
2680
+ },
2681
+ defaultPaymentAccount: {
2682
+ type: 'string',
2683
+ description: 'Default payment account for auto-create',
2684
+ maxLength: 200
2685
+ },
2686
+ defaultPayee: {
2687
+ type: 'string',
2688
+ description: 'Default payee for auto-create',
2689
+ maxLength: 200
2690
+ },
2691
+ autoCreate: {
2692
+ type: 'boolean',
2693
+ description: 'Auto-create transaction when expected date arrives',
2694
+ default: false
2695
+ },
2696
+ startDate: {
2697
+ type: 'string',
2698
+ description: 'Rule start date (ISO format)'
2699
+ },
2700
+ endDate: {
2701
+ type: 'string',
2702
+ description: 'Rule end date (ISO format)'
1817
2703
  }
1818
2704
  },
1819
- required: ['items', 'total']
2705
+ required: [
2706
+ 'name',
2707
+ 'frequency',
2708
+ 'expectedAmount',
2709
+ 'currency',
2710
+ 'matchAmountTolerance',
2711
+ 'autoCreate'
2712
+ ]
1820
2713
  } as const;
1821
2714
 
1822
2715
  export const $RecurringRuleResponseDto = {
@@ -1930,6 +2823,37 @@ export const $RecurringRuleResponseDto = {
1930
2823
  ]
1931
2824
  } as const;
1932
2825
 
2826
+ export const $CreateRuleFromTransactionDto = {
2827
+ type: 'object',
2828
+ properties: {
2829
+ frequency: {
2830
+ type: 'string',
2831
+ description: 'Recurring frequency',
2832
+ enum: [
2833
+ 'WEEKLY',
2834
+ 'BIWEEKLY',
2835
+ 'MONTHLY',
2836
+ 'BIMONTHLY',
2837
+ 'QUARTERLY',
2838
+ 'YEARLY',
2839
+ 'CUSTOM'
2840
+ ],
2841
+ example: 'MONTHLY'
2842
+ },
2843
+ name: {
2844
+ type: 'string',
2845
+ description: 'Optional name override (default: transaction payee)',
2846
+ maxLength: 100
2847
+ },
2848
+ icon: {
2849
+ type: 'string',
2850
+ description: 'Optional icon emoji',
2851
+ maxLength: 10
2852
+ }
2853
+ },
2854
+ required: ['frequency']
2855
+ } as const;
2856
+
1933
2857
  export const $RecurringRuleWithStatsResponseDto = {
1934
2858
  type: 'object',
1935
2859
  properties: {
@@ -2088,6 +3012,94 @@ export const $RecurringRuleWithStatsResponseDto = {
2088
3012
  ]
2089
3013
  } as const;
2090
3014
 
3015
+ export const $UpdateRecurringRuleDto = {
3016
+ type: 'object',
3017
+ properties: {
3018
+ name: {
3019
+ type: 'string',
3020
+ description: 'Rule name',
3021
+ maxLength: 100
3022
+ },
3023
+ icon: {
3024
+ type: 'string',
3025
+ description: 'Icon emoji',
3026
+ maxLength: 10
3027
+ },
3028
+ frequency: {
3029
+ type: 'string',
3030
+ description: 'Recurring frequency',
3031
+ enum: [
3032
+ 'WEEKLY',
3033
+ 'BIWEEKLY',
3034
+ 'MONTHLY',
3035
+ 'BIMONTHLY',
3036
+ 'QUARTERLY',
3037
+ 'YEARLY',
3038
+ 'CUSTOM'
3039
+ ]
3040
+ },
3041
+ expectedAmount: {
3042
+ type: 'number',
3043
+ description: 'Expected amount',
3044
+ minimum: 0
3045
+ },
3046
+ expectedDay: {
3047
+ type: 'number',
3048
+ description: 'Expected day of month (1-31)',
3049
+ minimum: 1,
3050
+ maximum: 31
3051
+ },
3052
+ customIntervalDays: {
3053
+ type: 'number',
3054
+ description: 'Custom interval in days',
3055
+ minimum: 1
3056
+ },
3057
+ currency: {
3058
+ type: 'string',
3059
+ description: 'Currency code',
3060
+ maxLength: 10
3061
+ },
3062
+ matchPayeePattern: {
3063
+ type: 'string',
3064
+ description: 'Payee matching pattern',
3065
+ maxLength: 200
3066
+ },
3067
+ matchAmountTolerance: {
3068
+ type: 'number',
3069
+ description: 'Amount tolerance percentage (0-1)',
3070
+ minimum: 0,
3071
+ maximum: 1
3072
+ },
3073
+ defaultExpenseAccount: {
3074
+ type: 'string',
3075
+ description: 'Default expense account',
3076
+ maxLength: 200
3077
+ },
3078
+ defaultPaymentAccount: {
3079
+ type: 'string',
3080
+ description: 'Default payment account',
3081
+ maxLength: 200
3082
+ },
3083
+ defaultPayee: {
3084
+ type: 'string',
3085
+ description: 'Default payee',
3086
+ maxLength: 200
3087
+ },
3088
+ autoCreate: {
3089
+ type: 'boolean',
3090
+ description: 'Auto-create transaction'
3091
+ },
3092
+ isActive: {
3093
+ type: 'boolean',
3094
+ description: 'Rule active status'
3095
+ },
3096
+ endDate: {
3097
+ type: 'string',
3098
+ description: 'Rule end date (ISO format)'
3099
+ }
3100
+ }
3101
+ } as const;
3102
+
2091
3103
  export const $ExpectedTransactionRuleDto = {
2092
3104
  type: 'object',
2093
3105
  properties: {
@@ -2204,6 +3216,50 @@ export const $ExpectedTransactionListResponseDto = {
2204
3216
  required: ['items', 'total']
2205
3217
  } as const;
2206
3218
 
3219
+ export const $ConfirmMatchDto = {
3220
+ type: 'object',
3221
+ properties: {
3222
+ transactionId: {
3223
+ type: 'string',
3224
+ description: 'Transaction ID to match with'
3225
+ }
3226
+ },
3227
+ required: ['transactionId']
3228
+ } as const;
3229
+
3230
+ export const $EnterNowDto = {
3231
+ type: 'object',
3232
+ properties: {
3233
+ expenseAccount: {
3234
+ type: 'string',
3235
+ description:
3236
+ 'Override expense account (uses rule default if not provided)',
3237
+ maxLength: 200
3238
+ },
3239
+ paymentAccount: {
3240
+ type: 'string',
3241
+ description:
3242
+ 'Override payment account (uses rule default if not provided)',
3243
+ maxLength: 200
3244
+ },
3245
+ amount: {
3246
+ type: 'number',
3247
+ description: 'Override amount (uses expected amount if not provided)',
3248
+ minimum: 0
3249
+ },
3250
+ payee: {
3251
+ type: 'string',
3252
+ description: 'Override payee (uses rule default if not provided)',
3253
+ maxLength: 200
3254
+ },
3255
+ narration: {
3256
+ type: 'string',
3257
+ description: 'Optional narration',
3258
+ maxLength: 500
3259
+ }
3260
+ }
3261
+ } as const;
3262
+
2207
3263
  export const $ForecastItemDto = {
2208
3264
  type: 'object',
2209
3265
  properties: {
@@ -2228,7 +3284,7 @@ export const $ForecastItemDto = {
2228
3284
  example: '2024-04-01'
2229
3285
  },
2230
3286
  icon: {
2231
- type: 'object',
3287
+ type: 'string',
2232
3288
  description: 'Rule icon emoji',
2233
3289
  example: '🏠',
2234
3290
  nullable: true
@@ -2328,6 +3384,107 @@ export const $ForecastResponseDto = {
2328
3384
  ]
2329
3385
  } as const;
2330
3386
 
3387
+ export const $CreateTransactionRuleDto = {
3388
+ type: 'object',
3389
+ properties: {
3390
+ name: {
3391
+ type: 'string',
3392
+ minLength: 1,
3393
+ maxLength: 100
3394
+ },
3395
+ description: {
3396
+ type: 'string',
3397
+ maxLength: 500
3398
+ },
3399
+ narrationKeywords: {
3400
+ items: {
3401
+ type: 'array'
3402
+ },
3403
+ maxItems: 50,
3404
+ type: 'array'
3405
+ },
3406
+ payeeKeywords: {
3407
+ items: {
3408
+ type: 'array'
3409
+ },
3410
+ maxItems: 50,
3411
+ type: 'array'
3412
+ },
3413
+ categoryKeywords: {
3414
+ items: {
3415
+ type: 'array'
3416
+ },
3417
+ maxItems: 50,
3418
+ type: 'array'
3419
+ },
3420
+ methodKeywords: {
3421
+ items: {
3422
+ type: 'array'
3423
+ },
3424
+ maxItems: 50,
3425
+ description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
3426
+ type: 'array'
3427
+ },
3428
+ categoryAccount: {
3429
+ type: 'string',
3430
+ maxLength: 200,
3431
+ description:
3432
+ 'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
3433
+ },
3434
+ matchLogic: {
3435
+ type: 'string',
3436
+ enum: ['OR', 'AND'],
3437
+ default: 'OR'
3438
+ },
3439
+ amountMin: {
3440
+ type: 'number',
3441
+ minimum: 0,
3442
+ description: 'Minimum transaction amount (inclusive)'
3443
+ },
3444
+ amountMax: {
3445
+ type: 'number',
3446
+ minimum: 0,
3447
+ description: 'Maximum transaction amount (inclusive)'
3448
+ },
3449
+ priority: {
3450
+ type: 'number',
3451
+ default: 50,
3452
+ minimum: 0,
3453
+ maximum: 1000
3454
+ },
3455
+ additionalTags: {
3456
+ items: {
3457
+ type: 'array'
3458
+ },
3459
+ maxItems: 20,
3460
+ type: 'array'
3461
+ },
3462
+ additionalMetadata: {
3463
+ type: 'object'
3464
+ },
3465
+ upsertByPayee: {
3466
+ type: 'boolean',
3467
+ description:
3468
+ 'If true, update existing rule with matching payeeKeywords[0] instead of creating new rule'
3469
+ }
3470
+ },
3471
+ required: ['name', 'matchLogic', 'priority']
3472
+ } as const;
3473
+
3474
+ export const $AmountRangeDto = {
3475
+ type: 'object',
3476
+ properties: {
3477
+ min: {
3478
+ type: 'number',
3479
+ description: 'Minimum amount'
3480
+ },
3481
+ max: {
3482
+ type: 'number',
3483
+ description: 'Maximum amount'
3484
+ }
3485
+ }
3486
+ } as const;
3487
+
2331
3488
  export const $TransactionRuleResponseDto = {
2332
3489
  type: 'object',
2333
3490
  properties: {
@@ -2382,12 +3539,12 @@ export const $TransactionRuleResponseDto = {
2382
3539
  example: 'OR'
2383
3540
  },
2384
3541
  amountRange: {
2385
- type: 'object',
2386
3542
  description: 'Amount range for matching',
2387
- example: {
2388
- min: 0,
2389
- max: 100
2390
- }
3543
+ allOf: [
3544
+ {
3545
+ $ref: '#/components/schemas/AmountRangeDto'
3546
+ }
3547
+ ]
2391
3548
  },
2392
3549
  priority: {
2393
3550
  type: 'number',
@@ -2402,6 +3559,7 @@ export const $TransactionRuleResponseDto = {
2402
3559
  type: 'string',
2403
3560
  description: 'Learning source: NLP, REVIEW_CENTER, or null for manual',
2404
3561
  enum: ['NLP', 'REVIEW_CENTER'],
3562
+ nullable: true,
2405
3563
  example: 'REVIEW_CENTER'
2406
3564
  },
2407
3565
  autoApplyEnabled: {
@@ -2423,7 +3581,9 @@ export const $TransactionRuleResponseDto = {
2423
3581
  additionalMetadata: {
2424
3582
  type: 'object',
2425
3583
  description: 'Additional metadata',
2426
- example: {}
3584
+ additionalProperties: {
3585
+ type: 'string'
3586
+ }
2427
3587
  },
2428
3588
  createdAt: {
2429
3589
  format: 'date-time',
@@ -2596,6 +3756,64 @@ export const $ValidateRuleResponseDto = {
2596
3756
  required: ['valid', 'errors', 'warnings']
2597
3757
  } as const;
2598
3758
 
3759
+ export const $BulkCreateRulesDto = {
3760
+ type: 'object',
3761
+ properties: {
3762
+ rules: {
3763
+ items: {
3764
+ type: 'array'
3765
+ },
3766
+ description: 'Array of rules to import',
3767
+ type: 'array'
3768
+ },
3769
+ conflictStrategy: {
3770
+ type: 'string',
3771
+ enum: ['replace', 'skip'],
3772
+ default: 'skip',
3773
+ description:
3774
+ 'Conflict handling strategy: skip (default) ignores duplicates, replace soft-deletes existing rule'
3775
+ }
3776
+ },
3777
+ required: ['rules', 'conflictStrategy']
3778
+ } as const;
3779
+
3780
+ export const $BulkCreateRulesResponseDto = {
3781
+ type: 'object',
3782
+ properties: {
3783
+ successCount: {
3784
+ type: 'number',
3785
+ description: 'Number of successfully created rules'
3786
+ },
3787
+ failureCount: {
3788
+ type: 'number',
3789
+ description: 'Number of failed rules'
3790
+ },
3791
+ errors: {
3792
+ type: 'array',
3793
+ description: 'Error details for failed rules',
3794
+ items: {
3795
+ type: 'object',
3796
+ properties: {
3797
+ index: {
3798
+ type: 'number'
3799
+ },
3800
+ message: {
3801
+ type: 'string'
3802
+ }
3803
+ }
3804
+ }
3805
+ },
3806
+ createdRuleIds: {
3807
+ description: 'IDs of successfully created rules',
3808
+ type: 'array',
3809
+ items: {
3810
+ type: 'string'
3811
+ }
3812
+ }
3813
+ },
3814
+ required: ['successCount', 'failureCount', 'errors', 'createdRuleIds']
3815
+ } as const;
3816
+
2599
3817
  export const $ExportRulesResponseDto = {
2600
3818
  type: 'object',
2601
3819
  properties: {
@@ -2676,6 +3894,89 @@ export const $RuleStatisticsResponseDto = {
2676
3894
  ]
2677
3895
  } as const;
2678
3896
 
3897
+ export const $UpdateTransactionRuleDto = {
3898
+ type: 'object',
3899
+ properties: {
3900
+ name: {
3901
+ type: 'string',
3902
+ minLength: 1,
3903
+ maxLength: 100
3904
+ },
3905
+ description: {
3906
+ type: 'string',
3907
+ maxLength: 500
3908
+ },
3909
+ narrationKeywords: {
3910
+ items: {
3911
+ type: 'array'
3912
+ },
3913
+ maxItems: 50,
3914
+ type: 'array'
3915
+ },
3916
+ payeeKeywords: {
3917
+ items: {
3918
+ type: 'array'
3919
+ },
3920
+ maxItems: 50,
3921
+ type: 'array'
3922
+ },
3923
+ categoryKeywords: {
3924
+ items: {
3925
+ type: 'array'
3926
+ },
3927
+ maxItems: 50,
3928
+ type: 'array'
3929
+ },
3930
+ methodKeywords: {
3931
+ items: {
3932
+ type: 'array'
3933
+ },
3934
+ maxItems: 50,
3935
+ description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
3936
+ type: 'array'
3937
+ },
3938
+ categoryAccount: {
3939
+ type: 'string',
3940
+ maxLength: 200,
3941
+ description:
3942
+ 'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
3943
+ },
3944
+ matchLogic: {
3945
+ type: 'string',
3946
+ enum: ['OR', 'AND']
3947
+ },
3948
+ amountMin: {
3949
+ type: 'number',
3950
+ minimum: 0,
3951
+ description: 'Minimum transaction amount (inclusive)'
3952
+ },
3953
+ amountMax: {
3954
+ type: 'number',
3955
+ minimum: 0,
3956
+ description: 'Maximum transaction amount (inclusive)'
3957
+ },
3958
+ priority: {
3959
+ type: 'number',
3960
+ minimum: 0,
3961
+ maximum: 1000
3962
+ },
3963
+ enabled: {
3964
+ type: 'boolean',
3965
+ description: 'Enable or disable the rule'
3966
+ },
3967
+ additionalTags: {
3968
+ items: {
3969
+ type: 'array'
3970
+ },
3971
+ maxItems: 20,
3972
+ type: 'array'
3973
+ },
3974
+ additionalMetadata: {
3975
+ type: 'object'
3976
+ }
3977
+ }
3978
+ } as const;
3979
+
2679
3980
  export const $TestRuleDto = {
2680
3981
  type: 'object',
2681
3982
  properties: {
@@ -2868,6 +4169,17 @@ export const $UpdateUserSettingDto = {
2868
4169
  }
2869
4170
  } as const;
2870
4171
 
4172
+ export const $UpdatePropertyDto = {
4173
+ type: 'object',
4174
+ properties: {
4175
+ value: {
4176
+ type: 'string',
4177
+ description: 'Property value'
4178
+ }
4179
+ },
4180
+ required: ['value']
4181
+ } as const;
4182
+
2871
4183
  export const $FileImportDto = {
2872
4184
  type: 'object',
2873
4185
  properties: {
@@ -3214,6 +4526,181 @@ export const $ImporterConfigDto = {
3214
4526
  ]
3215
4527
  } as const;
3216
4528
 
4529
+ export const $UpdateMapperDefaultsDto = {
4530
+ type: 'object',
4531
+ properties: {
4532
+ sourceAccount: {
4533
+ type: 'string',
4534
+ description: 'Source account for transactions (Beancount format)',
4535
+ example: 'Assets:Alipay:Balance',
4536
+ pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4537
+ },
4538
+ currency: {
4539
+ type: 'string',
4540
+ description: 'Default currency (ISO 4217 code)',
4541
+ example: 'CNY',
4542
+ minLength: 3,
4543
+ maxLength: 3,
4544
+ pattern: '^[A-Z]{3}$'
4545
+ },
4546
+ expenseAccount: {
4547
+ type: 'string',
4548
+ description: 'Default expense account (optional)',
4549
+ example: 'Expenses:Unknown',
4550
+ pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4551
+ },
4552
+ incomeAccount: {
4553
+ type: 'string',
4554
+ description: 'Default income account (optional)',
4555
+ example: 'Income:Unknown',
4556
+ pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4557
+ },
4558
+ methodAccountMapping: {
4559
+ type: 'object',
4560
+ description:
4561
+ '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).',
4562
+ example: {
4563
+ HuaBei: 'Liabilities:Alipay:Huabei',
4564
+ CreditCard: 'Liabilities:CreditCard'
4565
+ }
4566
+ }
4567
+ }
4568
+ } as const;
4569
+
4570
+ export const $UpdateConfigDataDto = {
4571
+ type: 'object',
4572
+ properties: {
4573
+ defaults: {
4574
+ description: 'Mapper defaults configuration',
4575
+ allOf: [
4576
+ {
4577
+ $ref: '#/components/schemas/UpdateMapperDefaultsDto'
4578
+ }
4579
+ ]
4580
+ }
4581
+ }
4582
+ } as const;
4583
+
4584
+ export const $UpdateImporterConfigDto = {
4585
+ type: 'object',
4586
+ properties: {
4587
+ data: {
4588
+ description: 'Configuration data (v1 schema)',
4589
+ allOf: [
4590
+ {
4591
+ $ref: '#/components/schemas/UpdateConfigDataDto'
4592
+ }
4593
+ ]
4594
+ }
4595
+ }
4596
+ } as const;
4597
+
4598
+ export const $CreatePlatformDto = {
4599
+ type: 'object',
4600
+ properties: {
4601
+ name: {
4602
+ type: 'string',
4603
+ description: 'Platform name',
4604
+ example: 'Binance'
4605
+ },
4606
+ canonical: {
4607
+ type: 'string',
4608
+ description: 'Platform canonical identifier (lowercase, kebab-case)',
4609
+ example: 'binance'
4610
+ },
4611
+ aliases: {
4612
+ description: 'Platform aliases (multi-language names for lookup)',
4613
+ example: ['Binance', 'Binance Exchange', 'BNB'],
4614
+ type: 'array',
4615
+ items: {
4616
+ type: 'string'
4617
+ }
4618
+ },
4619
+ url: {
4620
+ type: 'string',
4621
+ description: 'Platform URL',
4622
+ example: 'https://www.binance.com'
4623
+ },
4624
+ type: {
4625
+ type: 'string',
4626
+ description: 'Platform type',
4627
+ enum: [
4628
+ 'BANK',
4629
+ 'BROKERAGE',
4630
+ 'CRYPTO_EXCHANGE',
4631
+ 'PAYMENT',
4632
+ 'INVESTMENT',
4633
+ 'INSURANCE',
4634
+ 'OTHER'
4635
+ ],
4636
+ example: 'CRYPTO_EXCHANGE'
4637
+ },
4638
+ logoUrl: {
4639
+ type: 'string',
4640
+ description: 'Platform logo URL',
4641
+ example: 'https://example.com/logos/binance.png'
4642
+ },
4643
+ isActive: {
4644
+ type: 'boolean',
4645
+ description: 'Whether the platform is active',
4646
+ default: true
4647
+ }
4648
+ },
4649
+ required: ['name', 'canonical', 'aliases', 'url', 'type']
4650
+ } as const;
4651
+
4652
+ export const $UpdatePlatformDto = {
4653
+ type: 'object',
4654
+ properties: {
4655
+ name: {
4656
+ type: 'string',
4657
+ description: 'Platform name',
4658
+ example: 'Binance'
4659
+ },
4660
+ canonical: {
4661
+ type: 'string',
4662
+ description: 'Platform canonical identifier (lowercase, kebab-case)',
4663
+ example: 'binance'
4664
+ },
4665
+ aliases: {
4666
+ description: 'Platform aliases (multi-language names for lookup)',
4667
+ example: ['Binance', 'Binance Exchange', 'BNB'],
4668
+ type: 'array',
4669
+ items: {
4670
+ type: 'string'
4671
+ }
4672
+ },
4673
+ url: {
4674
+ type: 'string',
4675
+ description: 'Platform URL',
4676
+ example: 'https://www.binance.com'
4677
+ },
4678
+ type: {
4679
+ type: 'string',
4680
+ description: 'Platform type',
4681
+ enum: [
4682
+ 'BANK',
4683
+ 'BROKERAGE',
4684
+ 'CRYPTO_EXCHANGE',
4685
+ 'PAYMENT',
4686
+ 'INVESTMENT',
4687
+ 'INSURANCE',
4688
+ 'OTHER'
4689
+ ],
4690
+ example: 'CRYPTO_EXCHANGE'
4691
+ },
4692
+ logoUrl: {
4693
+ type: 'string',
4694
+ description: 'Platform logo URL',
4695
+ example: 'https://example.com/logos/binance.png'
4696
+ },
4697
+ isActive: {
4698
+ type: 'boolean',
4699
+ description: 'Whether the platform is active'
4700
+ }
4701
+ }
4702
+ } as const;
4703
+
3217
4704
  export const $ProviderSyncConfigDto = {
3218
4705
  type: 'object',
3219
4706
  properties: {
@@ -3379,6 +4866,16 @@ export const $ProcessNlpDto = {
3379
4866
  description:
3380
4867
  'Session ID for multi-turn conversation (auto-generated if not provided)',
3381
4868
  example: 'session_abc123'
4869
+ },
4870
+ parsedData: {
4871
+ type: 'object',
4872
+ description:
4873
+ 'Parsed data from previous NLP response for session recovery. Send back the parsedData received in confirm_payee/confirm responses.',
4874
+ example: {
4875
+ amount: 35,
4876
+ currency: 'CNY',
4877
+ payee: 'Starbucks'
4878
+ }
3382
4879
  }
3383
4880
  },
3384
4881
  required: ['message']