@firela/api-types 0.0.0-canary.da5984a1 → 0.0.0-canary.da8dfd93
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.
- package/dist/index.d.mts +4732 -2532
- package/dist/index.d.ts +4732 -2532
- package/dist/index.js +61 -6
- package/dist/index.mjs +61 -6
- package/package.json +2 -3
- package/src/generated/schemas.gen.ts +2912 -657
- package/src/generated/services.gen.ts +1407 -476
- package/src/generated/types.gen.ts +8069 -2877
|
@@ -6,18 +6,12 @@ export const $CreateAccountDto = {
|
|
|
6
6
|
path: {
|
|
7
7
|
type: 'string',
|
|
8
8
|
description: 'Account path (hierarchical, colon-separated)',
|
|
9
|
-
example: 'Assets:CN:
|
|
10
|
-
},
|
|
11
|
-
displayName: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
description:
|
|
14
|
-
'Display name to distinguish accounts at the same path (default: "")',
|
|
15
|
-
example: '工资卡'
|
|
9
|
+
example: 'Assets:CN:ICBC:Checking'
|
|
16
10
|
},
|
|
17
11
|
openDate: {
|
|
18
12
|
format: 'date-time',
|
|
19
13
|
type: 'string',
|
|
20
|
-
description: 'Account open date',
|
|
14
|
+
description: 'Account open date (server defaults to today)',
|
|
21
15
|
example: '2024-01-01'
|
|
22
16
|
},
|
|
23
17
|
currencies: {
|
|
@@ -45,26 +39,22 @@ export const $CreateAccountDto = {
|
|
|
45
39
|
templatePath: {
|
|
46
40
|
type: 'string',
|
|
47
41
|
description: 'Reference to account-standards template path',
|
|
48
|
-
example: 'Assets:CN:
|
|
42
|
+
example: 'Assets:CN:Checking'
|
|
49
43
|
},
|
|
50
44
|
isCustom: {
|
|
51
45
|
type: 'boolean',
|
|
52
46
|
description: 'Whether this is a custom (user-created) account',
|
|
53
47
|
default: false
|
|
54
48
|
},
|
|
55
|
-
i18nKey: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'i18n key for display name (overrides template)',
|
|
58
|
-
example: 'account.custom.mybank'
|
|
59
|
-
},
|
|
60
49
|
icon: {
|
|
61
50
|
type: 'string',
|
|
62
51
|
description: 'Icon identifier (overrides template)',
|
|
63
52
|
example: 'bank-custom'
|
|
64
53
|
},
|
|
65
|
-
|
|
54
|
+
openDirectiveMeta: {
|
|
66
55
|
type: 'object',
|
|
67
|
-
description:
|
|
56
|
+
description:
|
|
57
|
+
'Open directive metadata (NOT an opening-balance amount — use the opening-balance endpoint)',
|
|
68
58
|
example: {
|
|
69
59
|
branch: 'Downtown',
|
|
70
60
|
accountNumber: '1234'
|
|
@@ -76,7 +66,7 @@ export const $CreateAccountDto = {
|
|
|
76
66
|
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
77
67
|
}
|
|
78
68
|
},
|
|
79
|
-
required: ['path'
|
|
69
|
+
required: ['path']
|
|
80
70
|
} as const;
|
|
81
71
|
|
|
82
72
|
export const $AccountResponseDto = {
|
|
@@ -90,13 +80,7 @@ export const $AccountResponseDto = {
|
|
|
90
80
|
path: {
|
|
91
81
|
type: 'string',
|
|
92
82
|
description: 'Account path (hierarchical, colon-separated)',
|
|
93
|
-
example: 'Assets:CN:
|
|
94
|
-
},
|
|
95
|
-
displayName: {
|
|
96
|
-
type: 'string',
|
|
97
|
-
description:
|
|
98
|
-
'Display name distinguishing multiple accounts at the same path',
|
|
99
|
-
example: '工资卡'
|
|
83
|
+
example: 'Assets:CN:ICBC:Checking'
|
|
100
84
|
},
|
|
101
85
|
type: {
|
|
102
86
|
type: 'string',
|
|
@@ -104,6 +88,49 @@ export const $AccountResponseDto = {
|
|
|
104
88
|
enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
|
|
105
89
|
example: 'Assets'
|
|
106
90
|
},
|
|
91
|
+
assetSubClass: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description:
|
|
94
|
+
'Account-level asset sub-class (product type, e.g. STOCK/DEPOSIT/CREDIT_CARD/PERSONAL_LOAN). Computed from the account path via the asset-classifier (ADR-0077). Null for non-asset accounts (Income/Expenses/Equity) or unmatched paths.',
|
|
95
|
+
enum: [
|
|
96
|
+
'DEPOSIT',
|
|
97
|
+
'CASH',
|
|
98
|
+
'MONEY_MARKET_FUND',
|
|
99
|
+
'STOCK',
|
|
100
|
+
'ETF',
|
|
101
|
+
'MUTUAL_FUND',
|
|
102
|
+
'EQUITY_COMPENSATION',
|
|
103
|
+
'GOVERNMENT_BOND',
|
|
104
|
+
'CORPORATE_BOND',
|
|
105
|
+
'BOND_FUND',
|
|
106
|
+
'PRIMARY_RESIDENCE',
|
|
107
|
+
'INVESTMENT_PROPERTY',
|
|
108
|
+
'REIT',
|
|
109
|
+
'GOLD',
|
|
110
|
+
'SILVER',
|
|
111
|
+
'PRECIOUS_METAL',
|
|
112
|
+
'PRECIOUS_METAL_FUND',
|
|
113
|
+
'COMMODITY',
|
|
114
|
+
'COMMODITY_FUND',
|
|
115
|
+
'CRYPTOCURRENCY',
|
|
116
|
+
'RETIREMENT_ACCOUNT',
|
|
117
|
+
'HEALTH_ACCOUNT',
|
|
118
|
+
'EDUCATION_ACCOUNT',
|
|
119
|
+
'INSURANCE',
|
|
120
|
+
'PRIVATE_EQUITY',
|
|
121
|
+
'HEDGE_FUND',
|
|
122
|
+
'COLLECTIBLES',
|
|
123
|
+
'MORTGAGE',
|
|
124
|
+
'STUDENT_LOAN',
|
|
125
|
+
'CREDIT_CARD',
|
|
126
|
+
'PERSONAL_LOAN',
|
|
127
|
+
'ACCOUNTS_PAYABLE',
|
|
128
|
+
'TAX_PAYABLE',
|
|
129
|
+
'OTHER'
|
|
130
|
+
],
|
|
131
|
+
nullable: true,
|
|
132
|
+
example: 'STOCK'
|
|
133
|
+
},
|
|
107
134
|
status: {
|
|
108
135
|
type: 'string',
|
|
109
136
|
description: 'Account status',
|
|
@@ -145,26 +172,26 @@ export const $AccountResponseDto = {
|
|
|
145
172
|
templatePath: {
|
|
146
173
|
type: 'string',
|
|
147
174
|
description: 'Template path reference',
|
|
148
|
-
example: 'Assets:CN:
|
|
175
|
+
example: 'Assets:CN:Checking'
|
|
149
176
|
},
|
|
150
177
|
isCustom: {
|
|
151
178
|
type: 'boolean',
|
|
152
179
|
description: 'Whether this is a custom (user-created) account',
|
|
153
180
|
example: false
|
|
154
181
|
},
|
|
155
|
-
|
|
182
|
+
displayName: {
|
|
156
183
|
type: 'string',
|
|
157
|
-
description: '
|
|
158
|
-
example: '
|
|
184
|
+
description: 'Localized display name (ADR-0114, read-time projection)',
|
|
185
|
+
example: 'Checking'
|
|
159
186
|
},
|
|
160
187
|
icon: {
|
|
161
188
|
type: 'string',
|
|
162
189
|
description: 'Icon identifier',
|
|
163
190
|
example: 'bank-icbc'
|
|
164
191
|
},
|
|
165
|
-
|
|
192
|
+
openDirectiveMeta: {
|
|
166
193
|
type: 'object',
|
|
167
|
-
description: '
|
|
194
|
+
description: 'Open directive metadata (ADR-0115 Decision 9)',
|
|
168
195
|
example: {
|
|
169
196
|
branch: 'Downtown'
|
|
170
197
|
}
|
|
@@ -192,7 +219,6 @@ export const $AccountResponseDto = {
|
|
|
192
219
|
required: [
|
|
193
220
|
'id',
|
|
194
221
|
'path',
|
|
195
|
-
'displayName',
|
|
196
222
|
'type',
|
|
197
223
|
'status',
|
|
198
224
|
'openDate',
|
|
@@ -225,11 +251,6 @@ export const $AccountListResponseDto = {
|
|
|
225
251
|
export const $UpdateAccountDto = {
|
|
226
252
|
type: 'object',
|
|
227
253
|
properties: {
|
|
228
|
-
displayName: {
|
|
229
|
-
type: 'string',
|
|
230
|
-
description: 'Display name to distinguish accounts at the same path',
|
|
231
|
-
example: '招行工资卡'
|
|
232
|
-
},
|
|
233
254
|
currencies: {
|
|
234
255
|
description: 'Allowed currencies (null = no restriction)',
|
|
235
256
|
example: ['CNY', 'USD'],
|
|
@@ -251,19 +272,15 @@ export const $UpdateAccountDto = {
|
|
|
251
272
|
'NONE'
|
|
252
273
|
]
|
|
253
274
|
},
|
|
254
|
-
i18nKey: {
|
|
255
|
-
type: 'string',
|
|
256
|
-
description: 'i18n key for display name',
|
|
257
|
-
example: 'account.custom.mybank'
|
|
258
|
-
},
|
|
259
275
|
icon: {
|
|
260
276
|
type: 'string',
|
|
261
277
|
description: 'Icon identifier',
|
|
262
278
|
example: 'bank-custom'
|
|
263
279
|
},
|
|
264
|
-
|
|
280
|
+
openDirectiveMeta: {
|
|
265
281
|
type: 'object',
|
|
266
|
-
description:
|
|
282
|
+
description:
|
|
283
|
+
'Open directive metadata (merged with existing; NOT an opening-balance amount)',
|
|
267
284
|
example: {
|
|
268
285
|
branch: 'Uptown'
|
|
269
286
|
}
|
|
@@ -310,13 +327,47 @@ export const $ReopenAccountDto = {
|
|
|
310
327
|
}
|
|
311
328
|
} as const;
|
|
312
329
|
|
|
330
|
+
export const $CreateOpeningBalanceDto = {
|
|
331
|
+
type: 'object',
|
|
332
|
+
properties: {
|
|
333
|
+
amount: {
|
|
334
|
+
type: 'number',
|
|
335
|
+
description: 'Opening balance amount (non-negative)',
|
|
336
|
+
example: 1000
|
|
337
|
+
},
|
|
338
|
+
currency: {
|
|
339
|
+
type: 'string',
|
|
340
|
+
description: 'Currency code',
|
|
341
|
+
example: 'CNY'
|
|
342
|
+
},
|
|
343
|
+
date: {
|
|
344
|
+
format: 'date-time',
|
|
345
|
+
type: 'string',
|
|
346
|
+
description: 'Opening-balance date (defaults to now)',
|
|
347
|
+
example: '2024-01-01'
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
required: ['amount', 'currency']
|
|
351
|
+
} as const;
|
|
352
|
+
|
|
353
|
+
export const $OpeningBalanceResultDto = {
|
|
354
|
+
type: 'object',
|
|
355
|
+
properties: {
|
|
356
|
+
transactionId: {
|
|
357
|
+
type: 'string',
|
|
358
|
+
description: 'Created opening-balance transaction id.'
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
required: ['transactionId']
|
|
362
|
+
} as const;
|
|
363
|
+
|
|
313
364
|
export const $AccountStandardResponseDto = {
|
|
314
365
|
type: 'object',
|
|
315
366
|
properties: {
|
|
316
367
|
path: {
|
|
317
368
|
type: 'string',
|
|
318
369
|
description: 'Account path (hierarchical, colon-separated)',
|
|
319
|
-
example: 'Assets:CN:
|
|
370
|
+
example: 'Assets:CN:Checking'
|
|
320
371
|
},
|
|
321
372
|
type: {
|
|
322
373
|
type: 'string',
|
|
@@ -324,11 +375,6 @@ export const $AccountStandardResponseDto = {
|
|
|
324
375
|
enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
|
|
325
376
|
example: 'Assets'
|
|
326
377
|
},
|
|
327
|
-
i18nKey: {
|
|
328
|
-
type: 'string',
|
|
329
|
-
description: 'i18n key for localized display name',
|
|
330
|
-
example: 'account.assets.cn.bank.icbc.checking'
|
|
331
|
-
},
|
|
332
378
|
name: {
|
|
333
379
|
type: 'string',
|
|
334
380
|
description: 'Short localized display name',
|
|
@@ -351,9 +397,47 @@ export const $AccountStandardResponseDto = {
|
|
|
351
397
|
type: 'string',
|
|
352
398
|
description: 'Icon identifier for UI display',
|
|
353
399
|
example: 'bank-icbc'
|
|
400
|
+
},
|
|
401
|
+
productCategory: {
|
|
402
|
+
type: 'string',
|
|
403
|
+
description:
|
|
404
|
+
'Onboarding product category (coarse grouping derived from assetSubClass)',
|
|
405
|
+
enum: [
|
|
406
|
+
'cash',
|
|
407
|
+
'investment',
|
|
408
|
+
'credit_card',
|
|
409
|
+
'loan',
|
|
410
|
+
'payable_tax',
|
|
411
|
+
'other'
|
|
412
|
+
],
|
|
413
|
+
example: 'investment'
|
|
414
|
+
},
|
|
415
|
+
assetClass: {
|
|
416
|
+
type: 'string',
|
|
417
|
+
description:
|
|
418
|
+
'Asset class (LIQUIDITY/EQUITY/.../LIABILITY), derived at read time from classification rules',
|
|
419
|
+
enum: [
|
|
420
|
+
'LIQUIDITY',
|
|
421
|
+
'EQUITY',
|
|
422
|
+
'FIXED_INCOME',
|
|
423
|
+
'PRECIOUS_METALS',
|
|
424
|
+
'COMMODITY',
|
|
425
|
+
'INSURANCE',
|
|
426
|
+
'ALTERNATIVE_INVESTMENT',
|
|
427
|
+
'PERSONAL_ASSETS',
|
|
428
|
+
'LIABILITY',
|
|
429
|
+
'REAL_ESTATE',
|
|
430
|
+
'INDEX'
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
assetSubClass: {
|
|
434
|
+
type: 'string',
|
|
435
|
+
description:
|
|
436
|
+
'Asset sub-class (product type, derived at read time from classification rules)',
|
|
437
|
+
example: 'STOCK'
|
|
354
438
|
}
|
|
355
439
|
},
|
|
356
|
-
required: ['path', 'type', '
|
|
440
|
+
required: ['path', 'type', 'description', 'tags', 'icon', 'productCategory']
|
|
357
441
|
} as const;
|
|
358
442
|
|
|
359
443
|
export const $AccountStandardListResponseDto = {
|
|
@@ -383,18 +467,13 @@ export const $AccountStandardListResponseDto = {
|
|
|
383
467
|
export const $TemplateMetadataDto = {
|
|
384
468
|
type: 'object',
|
|
385
469
|
properties: {
|
|
386
|
-
extendable: {
|
|
387
|
-
type: 'boolean',
|
|
388
|
-
description: 'Whether this path can be extended',
|
|
389
|
-
example: true
|
|
390
|
-
},
|
|
391
470
|
rootType: {
|
|
392
471
|
type: 'string',
|
|
393
472
|
description: 'Root account type',
|
|
394
473
|
example: 'Assets'
|
|
395
474
|
}
|
|
396
475
|
},
|
|
397
|
-
required: ['
|
|
476
|
+
required: ['rootType']
|
|
398
477
|
} as const;
|
|
399
478
|
|
|
400
479
|
export const $TemplateMetadataResponseDto = {
|
|
@@ -466,6 +545,66 @@ export const $RegionsMetadataResponseDto = {
|
|
|
466
545
|
required: ['regions']
|
|
467
546
|
} as const;
|
|
468
547
|
|
|
548
|
+
export const $CostSpecDto = {
|
|
549
|
+
type: 'object',
|
|
550
|
+
properties: {
|
|
551
|
+
mode: {
|
|
552
|
+
type: 'string',
|
|
553
|
+
enum: ['per-unit', 'total', 'date', 'label', 'auto'],
|
|
554
|
+
description: 'Cost specification mode (mirrors engine CostSpec)'
|
|
555
|
+
},
|
|
556
|
+
numberPerUnit: {
|
|
557
|
+
type: 'string',
|
|
558
|
+
description: 'Per-unit cost (required when mode is "per-unit")',
|
|
559
|
+
example: '240'
|
|
560
|
+
},
|
|
561
|
+
totalNumber: {
|
|
562
|
+
type: 'string',
|
|
563
|
+
description: 'Total cost for all units (required when mode is "total")',
|
|
564
|
+
example: '12000'
|
|
565
|
+
},
|
|
566
|
+
currency: {
|
|
567
|
+
type: 'string',
|
|
568
|
+
description: 'Cost currency (required in all modes)',
|
|
569
|
+
example: 'USD'
|
|
570
|
+
},
|
|
571
|
+
date: {
|
|
572
|
+
type: 'string',
|
|
573
|
+
description:
|
|
574
|
+
'Lot acquisition date, ISO 8601 (required when mode is "date")',
|
|
575
|
+
example: '2024-01-15'
|
|
576
|
+
},
|
|
577
|
+
label: {
|
|
578
|
+
type: 'string',
|
|
579
|
+
description:
|
|
580
|
+
'Lot label (required when mode is "label"; optional tag in buy modes)'
|
|
581
|
+
},
|
|
582
|
+
merge: {
|
|
583
|
+
type: 'boolean',
|
|
584
|
+
description: 'Merge lots for AVERAGE booking (mode: auto)'
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
required: ['mode', 'currency']
|
|
588
|
+
} as const;
|
|
589
|
+
|
|
590
|
+
export const $AmountDto = {
|
|
591
|
+
type: 'object',
|
|
592
|
+
properties: {
|
|
593
|
+
number: {
|
|
594
|
+
type: 'string',
|
|
595
|
+
description:
|
|
596
|
+
'Amount as decimal string (max 15 integer + 15 decimal digits)',
|
|
597
|
+
example: '170.50'
|
|
598
|
+
},
|
|
599
|
+
currency: {
|
|
600
|
+
type: 'string',
|
|
601
|
+
description: 'Currency/commodity code',
|
|
602
|
+
example: 'USD'
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
required: ['number', 'currency']
|
|
606
|
+
} as const;
|
|
607
|
+
|
|
469
608
|
export const $CreatePostingDto = {
|
|
470
609
|
type: 'object',
|
|
471
610
|
properties: {
|
|
@@ -473,7 +612,7 @@ export const $CreatePostingDto = {
|
|
|
473
612
|
type: 'string',
|
|
474
613
|
description:
|
|
475
614
|
'Account name in Beancount format (must start with uppercase, colon-separated)',
|
|
476
|
-
example: 'Assets:
|
|
615
|
+
example: 'Assets:Checking'
|
|
477
616
|
},
|
|
478
617
|
units: {
|
|
479
618
|
type: 'string',
|
|
@@ -495,6 +634,33 @@ export const $CreatePostingDto = {
|
|
|
495
634
|
example: {
|
|
496
635
|
'tax-lot': 'Q1-2024'
|
|
497
636
|
}
|
|
637
|
+
},
|
|
638
|
+
cost: {
|
|
639
|
+
description:
|
|
640
|
+
'Cost basis (Beancount `{...}`). Maps to engine costSpec. Required for commodity holdings so they carry a monetary weight that can balance.',
|
|
641
|
+
example: {
|
|
642
|
+
mode: 'per-unit',
|
|
643
|
+
numberPerUnit: '240',
|
|
644
|
+
currency: 'USD'
|
|
645
|
+
},
|
|
646
|
+
allOf: [
|
|
647
|
+
{
|
|
648
|
+
$ref: '#/components/schemas/CostSpecDto'
|
|
649
|
+
}
|
|
650
|
+
]
|
|
651
|
+
},
|
|
652
|
+
price: {
|
|
653
|
+
description:
|
|
654
|
+
'Price annotation (Beancount `@...`). Maps to engine price. Used for valuation; cost takes priority for balance weight.',
|
|
655
|
+
example: {
|
|
656
|
+
number: '170',
|
|
657
|
+
currency: 'USD'
|
|
658
|
+
},
|
|
659
|
+
allOf: [
|
|
660
|
+
{
|
|
661
|
+
$ref: '#/components/schemas/AmountDto'
|
|
662
|
+
}
|
|
663
|
+
]
|
|
498
664
|
}
|
|
499
665
|
},
|
|
500
666
|
required: ['account']
|
|
@@ -573,13 +739,39 @@ export const $CreateTransactionDto = {
|
|
|
573
739
|
required: ['date', 'narration', 'postings']
|
|
574
740
|
} as const;
|
|
575
741
|
|
|
742
|
+
export const $CostDetailDto = {
|
|
743
|
+
type: 'object',
|
|
744
|
+
properties: {
|
|
745
|
+
number: {
|
|
746
|
+
type: 'string',
|
|
747
|
+
description: 'Per-unit cost basis (mirrors engine Cost.number)',
|
|
748
|
+
example: '240'
|
|
749
|
+
},
|
|
750
|
+
currency: {
|
|
751
|
+
type: 'string',
|
|
752
|
+
description: 'Cost currency',
|
|
753
|
+
example: 'USD'
|
|
754
|
+
},
|
|
755
|
+
date: {
|
|
756
|
+
type: 'string',
|
|
757
|
+
description: 'Lot acquisition date (ISO yyyy-mm-dd)',
|
|
758
|
+
example: '2024-01-15'
|
|
759
|
+
},
|
|
760
|
+
label: {
|
|
761
|
+
type: 'string',
|
|
762
|
+
description: 'Lot label',
|
|
763
|
+
example: 'lot-2024-01'
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
} as const;
|
|
767
|
+
|
|
576
768
|
export const $PostingResponseDto = {
|
|
577
769
|
type: 'object',
|
|
578
770
|
properties: {
|
|
579
771
|
account: {
|
|
580
772
|
type: 'string',
|
|
581
773
|
description: 'Account name',
|
|
582
|
-
example: 'Assets:
|
|
774
|
+
example: 'Assets:Checking'
|
|
583
775
|
},
|
|
584
776
|
units: {
|
|
585
777
|
type: 'string',
|
|
@@ -591,6 +783,15 @@ export const $PostingResponseDto = {
|
|
|
591
783
|
type: 'string',
|
|
592
784
|
description: 'Currency',
|
|
593
785
|
example: 'USD'
|
|
786
|
+
},
|
|
787
|
+
cost: {
|
|
788
|
+
description:
|
|
789
|
+
'Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.',
|
|
790
|
+
allOf: [
|
|
791
|
+
{
|
|
792
|
+
$ref: '#/components/schemas/CostDetailDto'
|
|
793
|
+
}
|
|
794
|
+
]
|
|
594
795
|
}
|
|
595
796
|
},
|
|
596
797
|
required: ['account']
|
|
@@ -841,6 +1042,85 @@ export const $BatchTransactionResponseDto = {
|
|
|
841
1042
|
required: ['succeeded', 'failed']
|
|
842
1043
|
} as const;
|
|
843
1044
|
|
|
1045
|
+
export const $CorrectTransactionDto = {
|
|
1046
|
+
type: 'object',
|
|
1047
|
+
properties: {
|
|
1048
|
+
date: {
|
|
1049
|
+
type: 'string',
|
|
1050
|
+
description: 'Transaction date (ISO 8601 format)',
|
|
1051
|
+
example: '2024-11-28'
|
|
1052
|
+
},
|
|
1053
|
+
flag: {
|
|
1054
|
+
type: 'string',
|
|
1055
|
+
description: 'Transaction flag: * (cleared), ! (pending)',
|
|
1056
|
+
enum: ['*', '!'],
|
|
1057
|
+
example: '*'
|
|
1058
|
+
},
|
|
1059
|
+
payee: {
|
|
1060
|
+
type: 'string',
|
|
1061
|
+
description: 'Payee name',
|
|
1062
|
+
example: 'Whole Foods Market'
|
|
1063
|
+
},
|
|
1064
|
+
narration: {
|
|
1065
|
+
type: 'string',
|
|
1066
|
+
description: 'Transaction narration/description',
|
|
1067
|
+
example: 'Grocery shopping'
|
|
1068
|
+
},
|
|
1069
|
+
tags: {
|
|
1070
|
+
description: 'Transaction tags (without # prefix)',
|
|
1071
|
+
example: ['vacation', 'personal'],
|
|
1072
|
+
type: 'array',
|
|
1073
|
+
items: {
|
|
1074
|
+
type: 'string'
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
links: {
|
|
1078
|
+
description: 'Transaction links (without ^ prefix)',
|
|
1079
|
+
example: ['invoice-123'],
|
|
1080
|
+
type: 'array',
|
|
1081
|
+
items: {
|
|
1082
|
+
type: 'string'
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
postings: {
|
|
1086
|
+
description:
|
|
1087
|
+
'Transaction postings (minimum 1, typically 2 for double-entry)',
|
|
1088
|
+
type: 'array',
|
|
1089
|
+
items: {
|
|
1090
|
+
$ref: '#/components/schemas/CreatePostingDto'
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
1093
|
+
meta: {
|
|
1094
|
+
type: 'object',
|
|
1095
|
+
description: 'Transaction-level metadata',
|
|
1096
|
+
example: {
|
|
1097
|
+
invoice: '12345'
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
idempotencyKey: {
|
|
1101
|
+
type: 'string',
|
|
1102
|
+
description:
|
|
1103
|
+
'Unique key for idempotent transaction creation. If provided, duplicate requests with the same key will return the existing transaction.',
|
|
1104
|
+
example: 'import-2024-01-15-batch-001',
|
|
1105
|
+
maxLength: 128
|
|
1106
|
+
},
|
|
1107
|
+
autoCreateAccounts: {
|
|
1108
|
+
type: 'boolean',
|
|
1109
|
+
description:
|
|
1110
|
+
'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.',
|
|
1111
|
+
default: true,
|
|
1112
|
+
example: true
|
|
1113
|
+
},
|
|
1114
|
+
correctionReason: {
|
|
1115
|
+
type: 'string',
|
|
1116
|
+
description: 'Reason for correcting/superseding the original transaction',
|
|
1117
|
+
example: 'Wrong amount — corrected from receipt',
|
|
1118
|
+
maxLength: 500
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
required: ['date', 'narration', 'postings']
|
|
1122
|
+
} as const;
|
|
1123
|
+
|
|
844
1124
|
export const $PostingDetailDto = {
|
|
845
1125
|
type: 'object',
|
|
846
1126
|
properties: {
|
|
@@ -854,10 +1134,10 @@ export const $PostingDetailDto = {
|
|
|
854
1134
|
description: 'Account ID',
|
|
855
1135
|
example: 'clh1234567890abcdef'
|
|
856
1136
|
},
|
|
857
|
-
|
|
1137
|
+
account: {
|
|
858
1138
|
type: 'string',
|
|
859
|
-
description: '
|
|
860
|
-
example: 'Assets:
|
|
1139
|
+
description: 'Fully-qualified Beancount account path',
|
|
1140
|
+
example: 'Assets:Checking'
|
|
861
1141
|
},
|
|
862
1142
|
units: {
|
|
863
1143
|
type: 'string',
|
|
@@ -885,6 +1165,15 @@ export const $PostingDetailDto = {
|
|
|
885
1165
|
description: 'Cost date',
|
|
886
1166
|
example: '2024-01-15'
|
|
887
1167
|
},
|
|
1168
|
+
cost: {
|
|
1169
|
+
description:
|
|
1170
|
+
'Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.',
|
|
1171
|
+
allOf: [
|
|
1172
|
+
{
|
|
1173
|
+
$ref: '#/components/schemas/CostDetailDto'
|
|
1174
|
+
}
|
|
1175
|
+
]
|
|
1176
|
+
},
|
|
888
1177
|
priceAmount: {
|
|
889
1178
|
type: 'string',
|
|
890
1179
|
description: 'Price amount',
|
|
@@ -905,7 +1194,7 @@ export const $PostingDetailDto = {
|
|
|
905
1194
|
description: 'Posting metadata'
|
|
906
1195
|
}
|
|
907
1196
|
},
|
|
908
|
-
required: ['id', 'accountId', '
|
|
1197
|
+
required: ['id', 'accountId', 'account']
|
|
909
1198
|
} as const;
|
|
910
1199
|
|
|
911
1200
|
export const $TransactionDetailDto = {
|
|
@@ -977,8 +1266,8 @@ export const $TransactionDetailDto = {
|
|
|
977
1266
|
},
|
|
978
1267
|
sourceType: {
|
|
979
1268
|
type: 'string',
|
|
980
|
-
description:
|
|
981
|
-
|
|
1269
|
+
description:
|
|
1270
|
+
'Source type (free-form string from transaction metadata, e.g. import, api)'
|
|
982
1271
|
},
|
|
983
1272
|
sourcePlatform: {
|
|
984
1273
|
type: 'string',
|
|
@@ -1011,6 +1300,18 @@ export const $TransactionDetailDto = {
|
|
|
1011
1300
|
type: 'string',
|
|
1012
1301
|
description: 'Correction reason (if voided or superseded)',
|
|
1013
1302
|
example: 'Duplicate entry'
|
|
1303
|
+
},
|
|
1304
|
+
supersededBy: {
|
|
1305
|
+
type: 'string',
|
|
1306
|
+
description:
|
|
1307
|
+
'ID of the transaction that supersedes this one (set when status=SUPERSEDED)',
|
|
1308
|
+
example: 'clh1234567890abcdef'
|
|
1309
|
+
},
|
|
1310
|
+
originalTxn: {
|
|
1311
|
+
type: 'string',
|
|
1312
|
+
description:
|
|
1313
|
+
'ID of the transaction this one corrected/replaced (back-link on the replacement)',
|
|
1314
|
+
example: 'clh1234567890abcdef'
|
|
1014
1315
|
}
|
|
1015
1316
|
},
|
|
1016
1317
|
required: [
|
|
@@ -1025,6 +1326,77 @@ export const $TransactionDetailDto = {
|
|
|
1025
1326
|
]
|
|
1026
1327
|
} as const;
|
|
1027
1328
|
|
|
1329
|
+
export const $BalanceByCurrencyDto = {
|
|
1330
|
+
type: 'object',
|
|
1331
|
+
properties: {
|
|
1332
|
+
currency: {
|
|
1333
|
+
type: 'string',
|
|
1334
|
+
description: 'ISO 4217 currency code',
|
|
1335
|
+
example: 'CNY'
|
|
1336
|
+
},
|
|
1337
|
+
balance: {
|
|
1338
|
+
type: 'string',
|
|
1339
|
+
description: 'Balance amount',
|
|
1340
|
+
example: '50000.00'
|
|
1341
|
+
}
|
|
1342
|
+
},
|
|
1343
|
+
required: ['currency', 'balance']
|
|
1344
|
+
} as const;
|
|
1345
|
+
|
|
1346
|
+
export const $ExchangeRateWarningDto = {
|
|
1347
|
+
type: 'object',
|
|
1348
|
+
properties: {
|
|
1349
|
+
type: {
|
|
1350
|
+
type: 'string',
|
|
1351
|
+
description: 'Warning type',
|
|
1352
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
1353
|
+
},
|
|
1354
|
+
currency: {
|
|
1355
|
+
type: 'string',
|
|
1356
|
+
description: 'Currency without exchange rate',
|
|
1357
|
+
example: 'EUR'
|
|
1358
|
+
},
|
|
1359
|
+
totalAmount: {
|
|
1360
|
+
type: 'string',
|
|
1361
|
+
description: 'Total amount affected',
|
|
1362
|
+
example: '1000.00'
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
required: ['type', 'currency', 'totalAmount']
|
|
1366
|
+
} as const;
|
|
1367
|
+
|
|
1368
|
+
export const $TransactionListSummaryDto = {
|
|
1369
|
+
type: 'object',
|
|
1370
|
+
properties: {
|
|
1371
|
+
totalAmount: {
|
|
1372
|
+
type: 'string',
|
|
1373
|
+
description:
|
|
1374
|
+
'Partial converted total in base currency (rated currencies only, raw Beancount sign). When warnings is non-empty this excludes currencies missing an FX rate; may be "0.00" if ALL non-base currencies lack a rate. Converted at the dateTo (or current) available rate.',
|
|
1375
|
+
example: '-6000.00'
|
|
1376
|
+
},
|
|
1377
|
+
currency: {
|
|
1378
|
+
type: 'string',
|
|
1379
|
+
description: 'Base currency (ISO 4217)',
|
|
1380
|
+
example: 'CNY'
|
|
1381
|
+
},
|
|
1382
|
+
balanceByCurrency: {
|
|
1383
|
+
description: 'Raw (unconverted) balance per currency',
|
|
1384
|
+
type: 'array',
|
|
1385
|
+
items: {
|
|
1386
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
warnings: {
|
|
1390
|
+
description: 'Currencies missing an FX rate (omitted when empty)',
|
|
1391
|
+
type: 'array',
|
|
1392
|
+
items: {
|
|
1393
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
required: ['totalAmount', 'currency', 'balanceByCurrency']
|
|
1398
|
+
} as const;
|
|
1399
|
+
|
|
1028
1400
|
export const $TransactionListResponseDto = {
|
|
1029
1401
|
type: 'object',
|
|
1030
1402
|
properties: {
|
|
@@ -1049,6 +1421,15 @@ export const $TransactionListResponseDto = {
|
|
|
1049
1421
|
type: 'number',
|
|
1050
1422
|
description: 'Number of items skipped',
|
|
1051
1423
|
example: 0
|
|
1424
|
+
},
|
|
1425
|
+
summary: {
|
|
1426
|
+
description:
|
|
1427
|
+
'Amount summary for the full filtered set (#514). Present only when the request has a single account OR category viewpoint; omitted for search-only / plain-list / dual-perspective requests.',
|
|
1428
|
+
allOf: [
|
|
1429
|
+
{
|
|
1430
|
+
$ref: '#/components/schemas/TransactionListSummaryDto'
|
|
1431
|
+
}
|
|
1432
|
+
]
|
|
1052
1433
|
}
|
|
1053
1434
|
},
|
|
1054
1435
|
required: ['data', 'total', 'limit', 'offset']
|
|
@@ -1148,7 +1529,7 @@ export const $BalanceResponseDto = {
|
|
|
1148
1529
|
account: {
|
|
1149
1530
|
type: 'string',
|
|
1150
1531
|
description: 'Account name',
|
|
1151
|
-
example: 'Assets:
|
|
1532
|
+
example: 'Assets:Checking'
|
|
1152
1533
|
},
|
|
1153
1534
|
balance: {
|
|
1154
1535
|
type: 'string',
|
|
@@ -1175,7 +1556,7 @@ export const $MultiCurrencyBalanceResponseDto = {
|
|
|
1175
1556
|
account: {
|
|
1176
1557
|
type: 'string',
|
|
1177
1558
|
description: 'Account name',
|
|
1178
|
-
example: 'Assets:
|
|
1559
|
+
example: 'Assets:Checking'
|
|
1179
1560
|
},
|
|
1180
1561
|
balances: {
|
|
1181
1562
|
type: 'object',
|
|
@@ -1231,12 +1612,12 @@ export const $TransactionSummaryDto = {
|
|
|
1231
1612
|
accountName: {
|
|
1232
1613
|
type: 'string',
|
|
1233
1614
|
description: 'Source account name (first posting)',
|
|
1234
|
-
example: 'Assets:
|
|
1615
|
+
example: 'Assets:Checking'
|
|
1235
1616
|
},
|
|
1236
1617
|
sourceType: {
|
|
1237
1618
|
type: 'string',
|
|
1238
|
-
description:
|
|
1239
|
-
|
|
1619
|
+
description:
|
|
1620
|
+
'Source type (free-form string from transaction metadata, e.g. import, api)'
|
|
1240
1621
|
},
|
|
1241
1622
|
sourcePlatform: {
|
|
1242
1623
|
type: 'string',
|
|
@@ -1303,7 +1684,8 @@ export const $ReviewSummaryDto = {
|
|
|
1303
1684
|
},
|
|
1304
1685
|
sourceType: {
|
|
1305
1686
|
type: 'string',
|
|
1306
|
-
description:
|
|
1687
|
+
description:
|
|
1688
|
+
'Source type (free-form string from transaction metadata, e.g. import, api)'
|
|
1307
1689
|
},
|
|
1308
1690
|
sourcePlatform: {
|
|
1309
1691
|
type: 'string',
|
|
@@ -1413,7 +1795,20 @@ export const $DecisionOptionDto = {
|
|
|
1413
1795
|
properties: {
|
|
1414
1796
|
value: {
|
|
1415
1797
|
type: 'string',
|
|
1416
|
-
description: 'The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)'
|
|
1798
|
+
description: 'The action value to submit (e.g., UPGRADE_REPLACE, ACCEPT)',
|
|
1799
|
+
enum: [
|
|
1800
|
+
'UPGRADE_REPLACE',
|
|
1801
|
+
'LINK_KEEP_BOTH',
|
|
1802
|
+
'IGNORE_NEW',
|
|
1803
|
+
'CONFIRM_DIFFERENT',
|
|
1804
|
+
'ACCEPT',
|
|
1805
|
+
'REJECT',
|
|
1806
|
+
'ACCEPT_AND_LEARN',
|
|
1807
|
+
'CHOOSE_OTHER',
|
|
1808
|
+
'CANCEL',
|
|
1809
|
+
'FIX',
|
|
1810
|
+
'IGNORE'
|
|
1811
|
+
]
|
|
1417
1812
|
},
|
|
1418
1813
|
labelKey: {
|
|
1419
1814
|
type: 'string',
|
|
@@ -1488,7 +1883,8 @@ export const $ReviewDetailDto = {
|
|
|
1488
1883
|
},
|
|
1489
1884
|
sourceType: {
|
|
1490
1885
|
type: 'string',
|
|
1491
|
-
description:
|
|
1886
|
+
description:
|
|
1887
|
+
'Source type (free-form string from transaction metadata, e.g. import, api)'
|
|
1492
1888
|
},
|
|
1493
1889
|
sourcePlatform: {
|
|
1494
1890
|
type: 'string',
|
|
@@ -1568,7 +1964,20 @@ export const $ResolveReviewDto = {
|
|
|
1568
1964
|
action: {
|
|
1569
1965
|
type: 'string',
|
|
1570
1966
|
description:
|
|
1571
|
-
'Decision action.
|
|
1967
|
+
'Decision action. Valid actions vary by review type — see DecisionOptionDto.value returned by the review detail endpoint.',
|
|
1968
|
+
enum: [
|
|
1969
|
+
'UPGRADE_REPLACE',
|
|
1970
|
+
'LINK_KEEP_BOTH',
|
|
1971
|
+
'IGNORE_NEW',
|
|
1972
|
+
'CONFIRM_DIFFERENT',
|
|
1973
|
+
'ACCEPT',
|
|
1974
|
+
'REJECT',
|
|
1975
|
+
'ACCEPT_AND_LEARN',
|
|
1976
|
+
'CHOOSE_OTHER',
|
|
1977
|
+
'CANCEL',
|
|
1978
|
+
'FIX',
|
|
1979
|
+
'IGNORE'
|
|
1980
|
+
],
|
|
1572
1981
|
example: 'ACCEPT'
|
|
1573
1982
|
},
|
|
1574
1983
|
data: {
|
|
@@ -1605,7 +2014,8 @@ export const $ResolveResultDto = {
|
|
|
1605
2014
|
},
|
|
1606
2015
|
resolutionId: {
|
|
1607
2016
|
type: 'string',
|
|
1608
|
-
description:
|
|
2017
|
+
description:
|
|
2018
|
+
'Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).'
|
|
1609
2019
|
},
|
|
1610
2020
|
canUndo: {
|
|
1611
2021
|
type: 'boolean',
|
|
@@ -1623,7 +2033,7 @@ export const $ResolveResultDto = {
|
|
|
1623
2033
|
example: 'rule_01HXK5V8N2M3P4Q5R6S7T8U9V0'
|
|
1624
2034
|
}
|
|
1625
2035
|
},
|
|
1626
|
-
required: ['success'
|
|
2036
|
+
required: ['success']
|
|
1627
2037
|
} as const;
|
|
1628
2038
|
|
|
1629
2039
|
export const $UndoResultDto = {
|
|
@@ -1659,6 +2069,19 @@ export const $BatchResolveDto = {
|
|
|
1659
2069
|
action: {
|
|
1660
2070
|
type: 'string',
|
|
1661
2071
|
description: 'Decision action to apply to all items',
|
|
2072
|
+
enum: [
|
|
2073
|
+
'UPGRADE_REPLACE',
|
|
2074
|
+
'LINK_KEEP_BOTH',
|
|
2075
|
+
'IGNORE_NEW',
|
|
2076
|
+
'CONFIRM_DIFFERENT',
|
|
2077
|
+
'ACCEPT',
|
|
2078
|
+
'REJECT',
|
|
2079
|
+
'ACCEPT_AND_LEARN',
|
|
2080
|
+
'CHOOSE_OTHER',
|
|
2081
|
+
'CANCEL',
|
|
2082
|
+
'FIX',
|
|
2083
|
+
'IGNORE'
|
|
2084
|
+
],
|
|
1662
2085
|
example: 'ACCEPT'
|
|
1663
2086
|
},
|
|
1664
2087
|
data: {
|
|
@@ -2481,6 +2904,163 @@ export const $UpdateCommodityDto = {
|
|
|
2481
2904
|
}
|
|
2482
2905
|
} as const;
|
|
2483
2906
|
|
|
2907
|
+
export const $CreateBeanPriceDto = {
|
|
2908
|
+
type: 'object',
|
|
2909
|
+
properties: {
|
|
2910
|
+
currency: {
|
|
2911
|
+
type: 'string',
|
|
2912
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
2913
|
+
example: 'USD'
|
|
2914
|
+
},
|
|
2915
|
+
quoteCurrency: {
|
|
2916
|
+
type: 'string',
|
|
2917
|
+
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
2918
|
+
example: 'CNY'
|
|
2919
|
+
},
|
|
2920
|
+
amount: {
|
|
2921
|
+
type: 'number',
|
|
2922
|
+
description:
|
|
2923
|
+
'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
|
|
2924
|
+
example: 175.5,
|
|
2925
|
+
minimum: 0
|
|
2926
|
+
},
|
|
2927
|
+
date: {
|
|
2928
|
+
type: 'string',
|
|
2929
|
+
description: 'Price date (ISO 8601 format)',
|
|
2930
|
+
example: '2024-11-05'
|
|
2931
|
+
},
|
|
2932
|
+
metadata: {
|
|
2933
|
+
type: 'object',
|
|
2934
|
+
description:
|
|
2935
|
+
'Metadata (validated by Zod schema, max field lengths enforced)',
|
|
2936
|
+
example: {
|
|
2937
|
+
source: 'MANUAL',
|
|
2938
|
+
note: 'Bank valuation report',
|
|
2939
|
+
confidence: 0.95
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
},
|
|
2943
|
+
required: ['currency', 'quoteCurrency', 'amount', 'date']
|
|
2944
|
+
} as const;
|
|
2945
|
+
|
|
2946
|
+
export const $PriceResponseDto = {
|
|
2947
|
+
type: 'object',
|
|
2948
|
+
properties: {
|
|
2949
|
+
id: {
|
|
2950
|
+
type: 'string',
|
|
2951
|
+
description: 'Unique identifier',
|
|
2952
|
+
example: 'uuid-123-456'
|
|
2953
|
+
},
|
|
2954
|
+
userId: {
|
|
2955
|
+
type: 'string',
|
|
2956
|
+
description: 'User ID (owner of the price)',
|
|
2957
|
+
example: 'user-123'
|
|
2958
|
+
},
|
|
2959
|
+
currency: {
|
|
2960
|
+
type: 'string',
|
|
2961
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
2962
|
+
example: 'BTC'
|
|
2963
|
+
},
|
|
2964
|
+
quoteCurrency: {
|
|
2965
|
+
type: 'string',
|
|
2966
|
+
description: 'Quote currency (pricing currency, e.g., USD, CNY)',
|
|
2967
|
+
example: 'USD'
|
|
2968
|
+
},
|
|
2969
|
+
amount: {
|
|
2970
|
+
type: 'number',
|
|
2971
|
+
description:
|
|
2972
|
+
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
2973
|
+
example: 50000
|
|
2974
|
+
},
|
|
2975
|
+
date: {
|
|
2976
|
+
type: 'string',
|
|
2977
|
+
description:
|
|
2978
|
+
'Price date (ISO 8601 format). Represents the date this price was valid.',
|
|
2979
|
+
example: '2024-01-01',
|
|
2980
|
+
format: 'date'
|
|
2981
|
+
},
|
|
2982
|
+
meta: {
|
|
2983
|
+
type: 'object',
|
|
2984
|
+
description:
|
|
2985
|
+
'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
|
|
2986
|
+
example: {
|
|
2987
|
+
source: 'MANUAL',
|
|
2988
|
+
note: 'User-defined price',
|
|
2989
|
+
confidence: 1
|
|
2990
|
+
}
|
|
2991
|
+
},
|
|
2992
|
+
createdAt: {
|
|
2993
|
+
format: 'date-time',
|
|
2994
|
+
type: 'string',
|
|
2995
|
+
description: 'Creation timestamp',
|
|
2996
|
+
example: '2024-11-03T10:00:00Z'
|
|
2997
|
+
},
|
|
2998
|
+
updatedAt: {
|
|
2999
|
+
format: 'date-time',
|
|
3000
|
+
type: 'string',
|
|
3001
|
+
description: 'Last update timestamp',
|
|
3002
|
+
example: '2024-11-03T10:00:00Z'
|
|
3003
|
+
}
|
|
3004
|
+
},
|
|
3005
|
+
required: [
|
|
3006
|
+
'id',
|
|
3007
|
+
'userId',
|
|
3008
|
+
'currency',
|
|
3009
|
+
'quoteCurrency',
|
|
3010
|
+
'amount',
|
|
3011
|
+
'date',
|
|
3012
|
+
'meta',
|
|
3013
|
+
'createdAt',
|
|
3014
|
+
'updatedAt'
|
|
3015
|
+
]
|
|
3016
|
+
} as const;
|
|
3017
|
+
|
|
3018
|
+
export const $PriceListResponseDto = {
|
|
3019
|
+
type: 'object',
|
|
3020
|
+
properties: {
|
|
3021
|
+
items: {
|
|
3022
|
+
description: 'List of prices',
|
|
3023
|
+
type: 'array',
|
|
3024
|
+
items: {
|
|
3025
|
+
$ref: '#/components/schemas/PriceResponseDto'
|
|
3026
|
+
}
|
|
3027
|
+
},
|
|
3028
|
+
total: {
|
|
3029
|
+
type: 'number',
|
|
3030
|
+
description: 'Total number of prices',
|
|
3031
|
+
example: 42
|
|
3032
|
+
}
|
|
3033
|
+
},
|
|
3034
|
+
required: ['items', 'total']
|
|
3035
|
+
} as const;
|
|
3036
|
+
|
|
3037
|
+
export const $UpdateBeanPriceDto = {
|
|
3038
|
+
type: 'object',
|
|
3039
|
+
properties: {
|
|
3040
|
+
currency: {
|
|
3041
|
+
type: 'string',
|
|
3042
|
+
description: 'Currency being priced'
|
|
3043
|
+
},
|
|
3044
|
+
quoteCurrency: {
|
|
3045
|
+
type: 'string',
|
|
3046
|
+
description: 'Quote currency (pricing currency)'
|
|
3047
|
+
},
|
|
3048
|
+
amount: {
|
|
3049
|
+
type: 'number',
|
|
3050
|
+
description: 'Price amount (MUST be >= 0 per Beancount spec)',
|
|
3051
|
+
minimum: 0
|
|
3052
|
+
},
|
|
3053
|
+
date: {
|
|
3054
|
+
type: 'string',
|
|
3055
|
+
description: 'Price date (ISO 8601 format)'
|
|
3056
|
+
},
|
|
3057
|
+
metadata: {
|
|
3058
|
+
type: 'object',
|
|
3059
|
+
description: 'Metadata'
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
} as const;
|
|
3063
|
+
|
|
2484
3064
|
export const $CreateRecurringRuleDto = {
|
|
2485
3065
|
type: 'object',
|
|
2486
3066
|
properties: {
|
|
@@ -3252,35 +3832,526 @@ export const $ForecastResponseDto = {
|
|
|
3252
3832
|
]
|
|
3253
3833
|
} as const;
|
|
3254
3834
|
|
|
3255
|
-
export const $
|
|
3835
|
+
export const $CurrencyBalanceDto = {
|
|
3256
3836
|
type: 'object',
|
|
3257
3837
|
properties: {
|
|
3258
|
-
|
|
3838
|
+
currency: {
|
|
3259
3839
|
type: 'string',
|
|
3260
|
-
|
|
3261
|
-
|
|
3840
|
+
description: 'ISO 4217 currency code',
|
|
3841
|
+
example: 'CNY'
|
|
3262
3842
|
},
|
|
3263
|
-
|
|
3843
|
+
balance: {
|
|
3264
3844
|
type: 'string',
|
|
3265
|
-
|
|
3845
|
+
description: 'Balance amount',
|
|
3846
|
+
example: '500000.00'
|
|
3847
|
+
}
|
|
3848
|
+
},
|
|
3849
|
+
required: ['currency', 'balance']
|
|
3850
|
+
} as const;
|
|
3851
|
+
|
|
3852
|
+
export const $TimeSeriesPointDto = {
|
|
3853
|
+
type: 'object',
|
|
3854
|
+
properties: {
|
|
3855
|
+
date: {
|
|
3856
|
+
type: 'string',
|
|
3857
|
+
description: 'Date in YYYY-MM-DD format',
|
|
3858
|
+
example: '2024-06-15'
|
|
3266
3859
|
},
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
maxItems: 50,
|
|
3272
|
-
type: 'array'
|
|
3860
|
+
value: {
|
|
3861
|
+
type: 'string',
|
|
3862
|
+
description: 'Value at this date (in base currency)',
|
|
3863
|
+
example: '500000.00'
|
|
3273
3864
|
},
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
maxItems: 50,
|
|
3279
|
-
type: 'array'
|
|
3865
|
+
change: {
|
|
3866
|
+
type: 'object',
|
|
3867
|
+
description: 'Change from previous point',
|
|
3868
|
+
example: '5000.00'
|
|
3280
3869
|
},
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3870
|
+
assets: {
|
|
3871
|
+
type: 'string',
|
|
3872
|
+
description: 'Total assets at this date (in base currency)',
|
|
3873
|
+
example: '494338.00'
|
|
3874
|
+
},
|
|
3875
|
+
liabilities: {
|
|
3876
|
+
type: 'string',
|
|
3877
|
+
description: 'Total liabilities at this date (in base currency)',
|
|
3878
|
+
example: '310098.00'
|
|
3879
|
+
},
|
|
3880
|
+
byCurrency: {
|
|
3881
|
+
description: 'Multi-currency breakdown for this point',
|
|
3882
|
+
type: 'array',
|
|
3883
|
+
items: {
|
|
3884
|
+
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
},
|
|
3888
|
+
required: ['date', 'value']
|
|
3889
|
+
} as const;
|
|
3890
|
+
|
|
3891
|
+
export const $TrendSummaryDto = {
|
|
3892
|
+
type: 'object',
|
|
3893
|
+
properties: {
|
|
3894
|
+
startValue: {
|
|
3895
|
+
type: 'string',
|
|
3896
|
+
description: 'Value at start of period',
|
|
3897
|
+
example: '450000.00'
|
|
3898
|
+
},
|
|
3899
|
+
endValue: {
|
|
3900
|
+
type: 'string',
|
|
3901
|
+
description: 'Value at end of period',
|
|
3902
|
+
example: '500000.00'
|
|
3903
|
+
},
|
|
3904
|
+
totalChange: {
|
|
3905
|
+
type: 'string',
|
|
3906
|
+
description: 'Total change over period',
|
|
3907
|
+
example: '50000.00'
|
|
3908
|
+
},
|
|
3909
|
+
totalChangePercentage: {
|
|
3910
|
+
type: 'string',
|
|
3911
|
+
description: 'Total change percentage',
|
|
3912
|
+
example: '+11.11%'
|
|
3913
|
+
}
|
|
3914
|
+
},
|
|
3915
|
+
required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
|
|
3916
|
+
} as const;
|
|
3917
|
+
|
|
3918
|
+
export const $MultiCurrencyPointDto = {
|
|
3919
|
+
type: 'object',
|
|
3920
|
+
properties: {
|
|
3921
|
+
date: {
|
|
3922
|
+
type: 'string',
|
|
3923
|
+
description: 'Date in YYYY-MM-DD format',
|
|
3924
|
+
example: '2024-06-15'
|
|
3925
|
+
},
|
|
3926
|
+
byCurrency: {
|
|
3927
|
+
description: 'Balances by currency',
|
|
3928
|
+
type: 'array',
|
|
3929
|
+
items: {
|
|
3930
|
+
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
},
|
|
3934
|
+
required: ['date', 'byCurrency']
|
|
3935
|
+
} as const;
|
|
3936
|
+
|
|
3937
|
+
export const $PortfolioTrendsResponseDto = {
|
|
3938
|
+
type: 'object',
|
|
3939
|
+
properties: {
|
|
3940
|
+
series: {
|
|
3941
|
+
description: 'Time series data points',
|
|
3942
|
+
type: 'array',
|
|
3943
|
+
items: {
|
|
3944
|
+
$ref: '#/components/schemas/TimeSeriesPointDto'
|
|
3945
|
+
}
|
|
3946
|
+
},
|
|
3947
|
+
summary: {
|
|
3948
|
+
description: 'Period summary',
|
|
3949
|
+
allOf: [
|
|
3950
|
+
{
|
|
3951
|
+
$ref: '#/components/schemas/TrendSummaryDto'
|
|
3952
|
+
}
|
|
3953
|
+
]
|
|
3954
|
+
},
|
|
3955
|
+
period: {
|
|
3956
|
+
type: 'string',
|
|
3957
|
+
description: 'Period requested',
|
|
3958
|
+
example: '6m'
|
|
3959
|
+
},
|
|
3960
|
+
granularity: {
|
|
3961
|
+
type: 'string',
|
|
3962
|
+
description: 'Data granularity',
|
|
3963
|
+
example: 'month'
|
|
3964
|
+
},
|
|
3965
|
+
currency: {
|
|
3966
|
+
type: 'string',
|
|
3967
|
+
description: 'Base currency for converted values',
|
|
3968
|
+
example: 'CNY'
|
|
3969
|
+
},
|
|
3970
|
+
byCurrency: {
|
|
3971
|
+
description:
|
|
3972
|
+
'Multi-currency time series (each point has currency breakdown)',
|
|
3973
|
+
type: 'array',
|
|
3974
|
+
items: {
|
|
3975
|
+
$ref: '#/components/schemas/MultiCurrencyPointDto'
|
|
3976
|
+
}
|
|
3977
|
+
},
|
|
3978
|
+
warnings: {
|
|
3979
|
+
description: 'Exchange rate warnings',
|
|
3980
|
+
type: 'array',
|
|
3981
|
+
items: {
|
|
3982
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3985
|
+
},
|
|
3986
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
3987
|
+
} as const;
|
|
3988
|
+
|
|
3989
|
+
export const $CashFlowPointDto = {
|
|
3990
|
+
type: 'object',
|
|
3991
|
+
properties: {
|
|
3992
|
+
month: {
|
|
3993
|
+
type: 'string',
|
|
3994
|
+
description: 'Month key (YYYY-MM)',
|
|
3995
|
+
example: '2024-03'
|
|
3996
|
+
},
|
|
3997
|
+
income: {
|
|
3998
|
+
type: 'string',
|
|
3999
|
+
description: 'Income in base currency (absolute, converted)',
|
|
4000
|
+
example: '10000.00'
|
|
4001
|
+
},
|
|
4002
|
+
expense: {
|
|
4003
|
+
type: 'string',
|
|
4004
|
+
description: 'Expense in base currency (absolute, converted)',
|
|
4005
|
+
example: '5000.00'
|
|
4006
|
+
},
|
|
4007
|
+
netSavings: {
|
|
4008
|
+
type: 'string',
|
|
4009
|
+
description: 'netSavings = income − expense (savings positive)',
|
|
4010
|
+
example: '5000.00'
|
|
4011
|
+
}
|
|
4012
|
+
},
|
|
4013
|
+
required: ['month', 'income', 'expense', 'netSavings']
|
|
4014
|
+
} as const;
|
|
4015
|
+
|
|
4016
|
+
export const $CashFlowTrendSummaryDto = {
|
|
4017
|
+
type: 'object',
|
|
4018
|
+
properties: {
|
|
4019
|
+
totalIncome: {
|
|
4020
|
+
type: 'string',
|
|
4021
|
+
description: 'Total income across the period',
|
|
4022
|
+
example: '60000.00'
|
|
4023
|
+
},
|
|
4024
|
+
totalExpense: {
|
|
4025
|
+
type: 'string',
|
|
4026
|
+
description: 'Total expense across the period',
|
|
4027
|
+
example: '30000.00'
|
|
4028
|
+
},
|
|
4029
|
+
totalNetSavings: {
|
|
4030
|
+
type: 'string',
|
|
4031
|
+
description: 'income − expense across the period',
|
|
4032
|
+
example: '30000.00'
|
|
4033
|
+
},
|
|
4034
|
+
averageMonthlyNetSavings: {
|
|
4035
|
+
type: 'string',
|
|
4036
|
+
description:
|
|
4037
|
+
'totalNetSavings divided by the window length (N months, incl. zero-filled)',
|
|
4038
|
+
example: '5000.00'
|
|
4039
|
+
}
|
|
4040
|
+
},
|
|
4041
|
+
required: [
|
|
4042
|
+
'totalIncome',
|
|
4043
|
+
'totalExpense',
|
|
4044
|
+
'totalNetSavings',
|
|
4045
|
+
'averageMonthlyNetSavings'
|
|
4046
|
+
]
|
|
4047
|
+
} as const;
|
|
4048
|
+
|
|
4049
|
+
export const $CashFlowTrendsResponseDto = {
|
|
4050
|
+
type: 'object',
|
|
4051
|
+
properties: {
|
|
4052
|
+
series: {
|
|
4053
|
+
description:
|
|
4054
|
+
'Monthly cash-flow series (fixed N-month window, zero-filled)',
|
|
4055
|
+
type: 'array',
|
|
4056
|
+
items: {
|
|
4057
|
+
$ref: '#/components/schemas/CashFlowPointDto'
|
|
4058
|
+
}
|
|
4059
|
+
},
|
|
4060
|
+
summary: {
|
|
4061
|
+
description: 'Period totals',
|
|
4062
|
+
allOf: [
|
|
4063
|
+
{
|
|
4064
|
+
$ref: '#/components/schemas/CashFlowTrendSummaryDto'
|
|
4065
|
+
}
|
|
4066
|
+
]
|
|
4067
|
+
},
|
|
4068
|
+
period: {
|
|
4069
|
+
type: 'string',
|
|
4070
|
+
description: 'Period requested',
|
|
4071
|
+
example: '6m'
|
|
4072
|
+
},
|
|
4073
|
+
granularity: {
|
|
4074
|
+
type: 'string',
|
|
4075
|
+
description: 'Data granularity (v1 returns month buckets)',
|
|
4076
|
+
example: 'month'
|
|
4077
|
+
},
|
|
4078
|
+
currency: {
|
|
4079
|
+
type: 'string',
|
|
4080
|
+
description: 'Base currency for converted values',
|
|
4081
|
+
example: 'CNY'
|
|
4082
|
+
},
|
|
4083
|
+
warnings: {
|
|
4084
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
4085
|
+
type: 'array',
|
|
4086
|
+
items: {
|
|
4087
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
4088
|
+
}
|
|
4089
|
+
}
|
|
4090
|
+
},
|
|
4091
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
4092
|
+
} as const;
|
|
4093
|
+
|
|
4094
|
+
export const $GenerateSnapshotBody = {
|
|
4095
|
+
type: 'object',
|
|
4096
|
+
properties: {}
|
|
4097
|
+
} as const;
|
|
4098
|
+
|
|
4099
|
+
export const $GenerateSnapshotResponse = {
|
|
4100
|
+
type: 'object',
|
|
4101
|
+
properties: {}
|
|
4102
|
+
} as const;
|
|
4103
|
+
|
|
4104
|
+
export const $BackfillSnapshotsBody = {
|
|
4105
|
+
type: 'object',
|
|
4106
|
+
properties: {}
|
|
4107
|
+
} as const;
|
|
4108
|
+
|
|
4109
|
+
export const $BackfillSnapshotsResponse = {
|
|
4110
|
+
type: 'object',
|
|
4111
|
+
properties: {}
|
|
4112
|
+
} as const;
|
|
4113
|
+
|
|
4114
|
+
export const $DeleteOwnUserDto = {
|
|
4115
|
+
type: 'object',
|
|
4116
|
+
properties: {
|
|
4117
|
+
accessToken: {
|
|
4118
|
+
type: 'string',
|
|
4119
|
+
description: 'Access token for user verification',
|
|
4120
|
+
example: 'abc123xyz'
|
|
4121
|
+
}
|
|
4122
|
+
},
|
|
4123
|
+
required: ['accessToken']
|
|
4124
|
+
} as const;
|
|
4125
|
+
|
|
4126
|
+
export const $UserSettingsResponseDto = {
|
|
4127
|
+
type: 'object',
|
|
4128
|
+
properties: {
|
|
4129
|
+
baseCurrency: {
|
|
4130
|
+
type: 'string',
|
|
4131
|
+
description:
|
|
4132
|
+
'Base currency (ISO 4217) for net-worth/report aggregation. Independent of region (ADR-0006).',
|
|
4133
|
+
example: 'USD',
|
|
4134
|
+
nullable: true
|
|
4135
|
+
}
|
|
4136
|
+
},
|
|
4137
|
+
required: ['baseCurrency']
|
|
4138
|
+
} as const;
|
|
4139
|
+
|
|
4140
|
+
export const $UserResponseDto = {
|
|
4141
|
+
type: 'object',
|
|
4142
|
+
properties: {
|
|
4143
|
+
id: {
|
|
4144
|
+
type: 'string',
|
|
4145
|
+
description: 'User ID'
|
|
4146
|
+
},
|
|
4147
|
+
role: {
|
|
4148
|
+
type: 'string',
|
|
4149
|
+
description: 'Assigned user role'
|
|
4150
|
+
},
|
|
4151
|
+
permissions: {
|
|
4152
|
+
description: 'Permission strings',
|
|
4153
|
+
type: 'array',
|
|
4154
|
+
items: {
|
|
4155
|
+
type: 'string'
|
|
4156
|
+
}
|
|
4157
|
+
},
|
|
4158
|
+
settings: {
|
|
4159
|
+
description: 'User settings',
|
|
4160
|
+
allOf: [
|
|
4161
|
+
{
|
|
4162
|
+
$ref: '#/components/schemas/UserSettingsResponseDto'
|
|
4163
|
+
}
|
|
4164
|
+
]
|
|
4165
|
+
}
|
|
4166
|
+
},
|
|
4167
|
+
required: ['id', 'role', 'permissions', 'settings']
|
|
4168
|
+
} as const;
|
|
4169
|
+
|
|
4170
|
+
export const $SignupDto = {
|
|
4171
|
+
type: 'object',
|
|
4172
|
+
properties: {
|
|
4173
|
+
turnstileToken: {
|
|
4174
|
+
type: 'string',
|
|
4175
|
+
description:
|
|
4176
|
+
'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
|
|
4177
|
+
example: '0.abc123def456...'
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
} as const;
|
|
4181
|
+
|
|
4182
|
+
export const $SignupResponseDto = {
|
|
4183
|
+
type: 'object',
|
|
4184
|
+
properties: {
|
|
4185
|
+
authToken: {
|
|
4186
|
+
type: 'string',
|
|
4187
|
+
description: 'JWT auth token',
|
|
4188
|
+
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
4189
|
+
},
|
|
4190
|
+
accessToken: {
|
|
4191
|
+
type: 'string',
|
|
4192
|
+
description: 'Auto-generated access token'
|
|
4193
|
+
},
|
|
4194
|
+
role: {
|
|
4195
|
+
type: 'string',
|
|
4196
|
+
description: 'Assigned user role',
|
|
4197
|
+
enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
|
|
4198
|
+
}
|
|
4199
|
+
},
|
|
4200
|
+
required: ['authToken', 'accessToken', 'role']
|
|
4201
|
+
} as const;
|
|
4202
|
+
|
|
4203
|
+
export const $UpdateUserSettingDto = {
|
|
4204
|
+
type: 'object',
|
|
4205
|
+
properties: {
|
|
4206
|
+
secId: {
|
|
4207
|
+
type: 'number',
|
|
4208
|
+
description: 'Security ID'
|
|
4209
|
+
},
|
|
4210
|
+
annualInterestRate: {
|
|
4211
|
+
type: 'number',
|
|
4212
|
+
description: 'Annual interest rate',
|
|
4213
|
+
example: 0.05
|
|
4214
|
+
},
|
|
4215
|
+
currency: {
|
|
4216
|
+
type: 'string',
|
|
4217
|
+
description: 'Currency code',
|
|
4218
|
+
example: 'USD'
|
|
4219
|
+
},
|
|
4220
|
+
baseCurrency: {
|
|
4221
|
+
type: 'string',
|
|
4222
|
+
description: 'Base currency code',
|
|
4223
|
+
example: 'USD'
|
|
4224
|
+
},
|
|
4225
|
+
benchmark: {
|
|
4226
|
+
type: 'string',
|
|
4227
|
+
description: 'Benchmark symbol',
|
|
4228
|
+
example: 'SPY'
|
|
4229
|
+
},
|
|
4230
|
+
colorScheme: {
|
|
4231
|
+
type: 'string',
|
|
4232
|
+
description: 'Color scheme',
|
|
4233
|
+
enum: ['DARK', 'LIGHT']
|
|
4234
|
+
},
|
|
4235
|
+
dateRange: {
|
|
4236
|
+
type: 'string',
|
|
4237
|
+
description: 'Date range filter',
|
|
4238
|
+
example: '1y'
|
|
4239
|
+
},
|
|
4240
|
+
emergencyFund: {
|
|
4241
|
+
type: 'number',
|
|
4242
|
+
description: 'Emergency fund amount',
|
|
4243
|
+
example: 10000
|
|
4244
|
+
},
|
|
4245
|
+
'filters.accounts': {
|
|
4246
|
+
description: 'Account filter IDs',
|
|
4247
|
+
type: 'array',
|
|
4248
|
+
items: {
|
|
4249
|
+
type: 'string'
|
|
4250
|
+
}
|
|
4251
|
+
},
|
|
4252
|
+
'filters.assetClasses': {
|
|
4253
|
+
description: 'Asset class filters',
|
|
4254
|
+
type: 'array',
|
|
4255
|
+
items: {
|
|
4256
|
+
type: 'string'
|
|
4257
|
+
}
|
|
4258
|
+
},
|
|
4259
|
+
'filters.dataSource': {
|
|
4260
|
+
type: 'string',
|
|
4261
|
+
description: 'Data source filter'
|
|
4262
|
+
},
|
|
4263
|
+
'filters.symbol': {
|
|
4264
|
+
type: 'string',
|
|
4265
|
+
description: 'Symbol filter'
|
|
4266
|
+
},
|
|
4267
|
+
'filters.tags': {
|
|
4268
|
+
description: 'Tag filters',
|
|
4269
|
+
type: 'array',
|
|
4270
|
+
items: {
|
|
4271
|
+
type: 'string'
|
|
4272
|
+
}
|
|
4273
|
+
},
|
|
4274
|
+
isExperimentalFeatures: {
|
|
4275
|
+
type: 'boolean',
|
|
4276
|
+
description: 'Enable experimental features'
|
|
4277
|
+
},
|
|
4278
|
+
isRestrictedView: {
|
|
4279
|
+
type: 'boolean',
|
|
4280
|
+
description: 'Enable restricted view mode'
|
|
4281
|
+
},
|
|
4282
|
+
language: {
|
|
4283
|
+
type: 'string',
|
|
4284
|
+
description: 'Language code',
|
|
4285
|
+
example: 'en'
|
|
4286
|
+
},
|
|
4287
|
+
locale: {
|
|
4288
|
+
type: 'string',
|
|
4289
|
+
description: 'Locale code',
|
|
4290
|
+
example: 'en-US'
|
|
4291
|
+
},
|
|
4292
|
+
projectedTotalAmount: {
|
|
4293
|
+
type: 'number',
|
|
4294
|
+
description: 'Projected total amount',
|
|
4295
|
+
example: 1000000
|
|
4296
|
+
},
|
|
4297
|
+
retirementDate: {
|
|
4298
|
+
type: 'string',
|
|
4299
|
+
description: 'Retirement date in ISO 8601 format',
|
|
4300
|
+
example: '2050-01-01'
|
|
4301
|
+
},
|
|
4302
|
+
savingsRate: {
|
|
4303
|
+
type: 'number',
|
|
4304
|
+
description: 'Savings rate percentage',
|
|
4305
|
+
example: 0.2
|
|
4306
|
+
},
|
|
4307
|
+
viewMode: {
|
|
4308
|
+
type: 'string',
|
|
4309
|
+
description: 'View mode',
|
|
4310
|
+
enum: ['DEFAULT', 'ZEN']
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
} as const;
|
|
4314
|
+
|
|
4315
|
+
export const $UpdatePropertyDto = {
|
|
4316
|
+
type: 'object',
|
|
4317
|
+
properties: {
|
|
4318
|
+
value: {
|
|
4319
|
+
type: 'string',
|
|
4320
|
+
description: 'Property value'
|
|
4321
|
+
}
|
|
4322
|
+
},
|
|
4323
|
+
required: ['value']
|
|
4324
|
+
} as const;
|
|
4325
|
+
|
|
4326
|
+
export const $CreateTransactionRuleDto = {
|
|
4327
|
+
type: 'object',
|
|
4328
|
+
properties: {
|
|
4329
|
+
name: {
|
|
4330
|
+
type: 'string',
|
|
4331
|
+
minLength: 1,
|
|
4332
|
+
maxLength: 100
|
|
4333
|
+
},
|
|
4334
|
+
description: {
|
|
4335
|
+
type: 'string',
|
|
4336
|
+
maxLength: 500
|
|
4337
|
+
},
|
|
4338
|
+
narrationKeywords: {
|
|
4339
|
+
items: {
|
|
4340
|
+
type: 'array'
|
|
4341
|
+
},
|
|
4342
|
+
maxItems: 50,
|
|
4343
|
+
type: 'array'
|
|
4344
|
+
},
|
|
4345
|
+
payeeKeywords: {
|
|
4346
|
+
items: {
|
|
4347
|
+
type: 'array'
|
|
4348
|
+
},
|
|
4349
|
+
maxItems: 50,
|
|
4350
|
+
type: 'array'
|
|
4351
|
+
},
|
|
4352
|
+
categoryKeywords: {
|
|
4353
|
+
items: {
|
|
4354
|
+
type: 'array'
|
|
3284
4355
|
},
|
|
3285
4356
|
maxItems: 50,
|
|
3286
4357
|
type: 'array'
|
|
@@ -3901,151 +4972,456 @@ export const $TestRuleResponseDto = {
|
|
|
3901
4972
|
required: ['ruleId', 'matches', 'confidence', 'matchDetails']
|
|
3902
4973
|
} as const;
|
|
3903
4974
|
|
|
3904
|
-
export const $
|
|
4975
|
+
export const $CategoryCatalogEntryDto = {
|
|
3905
4976
|
type: 'object',
|
|
3906
4977
|
properties: {
|
|
3907
|
-
|
|
4978
|
+
slug: {
|
|
3908
4979
|
type: 'string',
|
|
3909
|
-
description: '
|
|
3910
|
-
example: '
|
|
4980
|
+
description: 'Category slug (single source-of-truth)',
|
|
4981
|
+
example: 'food'
|
|
4982
|
+
},
|
|
4983
|
+
scenario: {
|
|
4984
|
+
type: 'string',
|
|
4985
|
+
description: 'Display scenario group (maps to frontend picker _scenario)',
|
|
4986
|
+
enum: [
|
|
4987
|
+
'expense',
|
|
4988
|
+
'income',
|
|
4989
|
+
'investment',
|
|
4990
|
+
'banking',
|
|
4991
|
+
'transfer',
|
|
4992
|
+
'payment'
|
|
4993
|
+
],
|
|
4994
|
+
example: 'expense'
|
|
4995
|
+
},
|
|
4996
|
+
icon: {
|
|
4997
|
+
type: 'string',
|
|
4998
|
+
description: 'Lucide icon name',
|
|
4999
|
+
example: 'utensils'
|
|
5000
|
+
},
|
|
5001
|
+
regions: {
|
|
5002
|
+
description: "Applicable regions ('*' = all, 'cn' = CN-only)",
|
|
5003
|
+
example: ['*'],
|
|
5004
|
+
type: 'array',
|
|
5005
|
+
items: {
|
|
5006
|
+
type: 'string'
|
|
5007
|
+
}
|
|
3911
5008
|
}
|
|
3912
5009
|
},
|
|
3913
|
-
required: ['
|
|
5010
|
+
required: ['slug', 'scenario', 'icon', 'regions']
|
|
3914
5011
|
} as const;
|
|
3915
5012
|
|
|
3916
|
-
export const $
|
|
5013
|
+
export const $CategoryCatalogListResponseDto = {
|
|
3917
5014
|
type: 'object',
|
|
3918
5015
|
properties: {
|
|
3919
|
-
|
|
5016
|
+
items: {
|
|
5017
|
+
description: 'Category entries (region-scoped, query-filtered)',
|
|
5018
|
+
type: 'array',
|
|
5019
|
+
items: {
|
|
5020
|
+
$ref: '#/components/schemas/CategoryCatalogEntryDto'
|
|
5021
|
+
}
|
|
5022
|
+
},
|
|
5023
|
+
total: {
|
|
5024
|
+
type: 'number',
|
|
5025
|
+
description:
|
|
5026
|
+
'Total category entries for the region (before query filtering)',
|
|
5027
|
+
example: 30
|
|
5028
|
+
},
|
|
5029
|
+
region: {
|
|
5030
|
+
type: 'string',
|
|
5031
|
+
description: 'Region code',
|
|
5032
|
+
example: 'cn'
|
|
5033
|
+
}
|
|
5034
|
+
},
|
|
5035
|
+
required: ['items', 'total', 'region']
|
|
5036
|
+
} as const;
|
|
5037
|
+
|
|
5038
|
+
export const $CreateBeanEventDto = {
|
|
5039
|
+
type: 'object',
|
|
5040
|
+
properties: {
|
|
5041
|
+
date: {
|
|
5042
|
+
type: 'string',
|
|
5043
|
+
description: 'Life event date (ISO 8601)',
|
|
5044
|
+
example: '2024-03-15'
|
|
5045
|
+
},
|
|
5046
|
+
type: {
|
|
3920
5047
|
type: 'string',
|
|
3921
5048
|
description:
|
|
3922
|
-
'
|
|
3923
|
-
example: '
|
|
5049
|
+
'Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer',
|
|
5050
|
+
example: 'employer'
|
|
5051
|
+
},
|
|
5052
|
+
description: {
|
|
5053
|
+
type: 'string',
|
|
5054
|
+
description:
|
|
5055
|
+
'Life event description. Empty string is a VALID value (distinct from absence).',
|
|
5056
|
+
example: 'Acme Corp'
|
|
5057
|
+
},
|
|
5058
|
+
meta: {
|
|
5059
|
+
type: 'object',
|
|
5060
|
+
description:
|
|
5061
|
+
'Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)',
|
|
5062
|
+
example: {
|
|
5063
|
+
note: 'Promotion'
|
|
5064
|
+
}
|
|
3924
5065
|
}
|
|
3925
|
-
}
|
|
5066
|
+
},
|
|
5067
|
+
required: ['date', 'type', 'description']
|
|
3926
5068
|
} as const;
|
|
3927
5069
|
|
|
3928
|
-
export const $
|
|
5070
|
+
export const $EventResponseDto = {
|
|
3929
5071
|
type: 'object',
|
|
3930
5072
|
properties: {
|
|
3931
|
-
|
|
3932
|
-
type: '
|
|
3933
|
-
description: '
|
|
5073
|
+
id: {
|
|
5074
|
+
type: 'string',
|
|
5075
|
+
description: 'Unique identifier',
|
|
5076
|
+
example: 'uuid-123-456'
|
|
3934
5077
|
},
|
|
3935
|
-
|
|
5078
|
+
userId: {
|
|
5079
|
+
type: 'string',
|
|
5080
|
+
description: 'User ID (owner of the life event)',
|
|
5081
|
+
example: 'user-123'
|
|
5082
|
+
},
|
|
5083
|
+
date: {
|
|
5084
|
+
type: 'string',
|
|
5085
|
+
description: 'Life event date (ISO 8601 format)',
|
|
5086
|
+
example: '2024-03-15',
|
|
5087
|
+
format: 'date'
|
|
5088
|
+
},
|
|
5089
|
+
type: {
|
|
5090
|
+
type: 'string',
|
|
5091
|
+
description:
|
|
5092
|
+
'Life event type (user-defined, e.g., "employer", "location")',
|
|
5093
|
+
example: 'employer'
|
|
5094
|
+
},
|
|
5095
|
+
description: {
|
|
5096
|
+
type: 'string',
|
|
5097
|
+
description:
|
|
5098
|
+
'Life event description. May be an empty string (a valid value distinct from absence).',
|
|
5099
|
+
example: 'Acme Corp'
|
|
5100
|
+
},
|
|
5101
|
+
meta: {
|
|
5102
|
+
type: 'object',
|
|
5103
|
+
description: 'Product-side metadata (free-form JSON)',
|
|
5104
|
+
example: {
|
|
5105
|
+
note: 'Promotion'
|
|
5106
|
+
}
|
|
5107
|
+
},
|
|
5108
|
+
createdAt: {
|
|
5109
|
+
format: 'date-time',
|
|
5110
|
+
type: 'string',
|
|
5111
|
+
description: 'Creation timestamp',
|
|
5112
|
+
example: '2024-03-15T10:00:00Z'
|
|
5113
|
+
},
|
|
5114
|
+
updatedAt: {
|
|
5115
|
+
format: 'date-time',
|
|
5116
|
+
type: 'string',
|
|
5117
|
+
description:
|
|
5118
|
+
'Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.',
|
|
5119
|
+
example: '2024-03-15T10:00:00Z'
|
|
5120
|
+
}
|
|
5121
|
+
},
|
|
5122
|
+
required: [
|
|
5123
|
+
'id',
|
|
5124
|
+
'userId',
|
|
5125
|
+
'date',
|
|
5126
|
+
'type',
|
|
5127
|
+
'description',
|
|
5128
|
+
'meta',
|
|
5129
|
+
'createdAt',
|
|
5130
|
+
'updatedAt'
|
|
5131
|
+
]
|
|
5132
|
+
} as const;
|
|
5133
|
+
|
|
5134
|
+
export const $EventListResponseDto = {
|
|
5135
|
+
type: 'object',
|
|
5136
|
+
properties: {
|
|
5137
|
+
items: {
|
|
5138
|
+
description: 'List of life events',
|
|
5139
|
+
type: 'array',
|
|
5140
|
+
items: {
|
|
5141
|
+
$ref: '#/components/schemas/EventResponseDto'
|
|
5142
|
+
}
|
|
5143
|
+
},
|
|
5144
|
+
total: {
|
|
3936
5145
|
type: 'number',
|
|
3937
|
-
description: '
|
|
3938
|
-
example:
|
|
5146
|
+
description: 'Total number of life events matching the query',
|
|
5147
|
+
example: 42
|
|
5148
|
+
}
|
|
5149
|
+
},
|
|
5150
|
+
required: ['items', 'total']
|
|
5151
|
+
} as const;
|
|
5152
|
+
|
|
5153
|
+
export const $UpdateBeanEventDto = {
|
|
5154
|
+
type: 'object',
|
|
5155
|
+
properties: {
|
|
5156
|
+
date: {
|
|
5157
|
+
type: 'string',
|
|
5158
|
+
description: 'Life event date (ISO 8601)'
|
|
5159
|
+
},
|
|
5160
|
+
type: {
|
|
5161
|
+
type: 'string',
|
|
5162
|
+
description: 'Life event type (user-defined)'
|
|
5163
|
+
},
|
|
5164
|
+
description: {
|
|
5165
|
+
type: 'string',
|
|
5166
|
+
description:
|
|
5167
|
+
'Life event description. Empty string is a VALID value (distinct from absence).'
|
|
5168
|
+
},
|
|
5169
|
+
meta: {
|
|
5170
|
+
type: 'object',
|
|
5171
|
+
description: 'Product-side metadata (free-form JSON)'
|
|
5172
|
+
}
|
|
5173
|
+
}
|
|
5174
|
+
} as const;
|
|
5175
|
+
|
|
5176
|
+
export const $OnboardingAccountDto = {
|
|
5177
|
+
type: 'object',
|
|
5178
|
+
properties: {
|
|
5179
|
+
path: {
|
|
5180
|
+
type: 'string',
|
|
5181
|
+
description:
|
|
5182
|
+
'Account path (Assets/Liabilities only; format validated by the account service)',
|
|
5183
|
+
example: 'Assets:Checking'
|
|
3939
5184
|
},
|
|
3940
5185
|
currency: {
|
|
3941
5186
|
type: 'string',
|
|
3942
|
-
description: '
|
|
5187
|
+
description: 'ISO 4217 currency code (3 letters)',
|
|
3943
5188
|
example: 'USD'
|
|
3944
5189
|
},
|
|
3945
|
-
|
|
5190
|
+
openingBalance: {
|
|
5191
|
+
type: 'string',
|
|
5192
|
+
description:
|
|
5193
|
+
'Opening balance as a non-negative Decimal string (e.g. "1000.00")',
|
|
5194
|
+
example: '1000.00'
|
|
5195
|
+
},
|
|
5196
|
+
platformId: {
|
|
5197
|
+
type: 'string',
|
|
5198
|
+
description:
|
|
5199
|
+
'Platform ID to bind the account to (references Platform.id); omit for unbound',
|
|
5200
|
+
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
5201
|
+
}
|
|
5202
|
+
},
|
|
5203
|
+
required: ['path', 'currency']
|
|
5204
|
+
} as const;
|
|
5205
|
+
|
|
5206
|
+
export const $OnboardingDto = {
|
|
5207
|
+
type: 'object',
|
|
5208
|
+
properties: {
|
|
5209
|
+
accounts: {
|
|
5210
|
+
description: 'Asset/Liability accounts to register with opening balances',
|
|
5211
|
+
type: 'array',
|
|
5212
|
+
items: {
|
|
5213
|
+
$ref: '#/components/schemas/OnboardingAccountDto'
|
|
5214
|
+
}
|
|
5215
|
+
},
|
|
5216
|
+
skipAssetRegistration: {
|
|
5217
|
+
type: 'boolean',
|
|
5218
|
+
description:
|
|
5219
|
+
'Skip asset registration; only bootstrap the core account set',
|
|
5220
|
+
default: false
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
} as const;
|
|
5224
|
+
|
|
5225
|
+
export const $ActualBalanceDto = {
|
|
5226
|
+
type: 'object',
|
|
5227
|
+
properties: {
|
|
5228
|
+
amount: {
|
|
5229
|
+
type: 'string',
|
|
5230
|
+
description:
|
|
5231
|
+
'Actual balance amount as a decimal string (preserves precision for tolerance inference).',
|
|
5232
|
+
example: '1234.56'
|
|
5233
|
+
},
|
|
5234
|
+
ccy: {
|
|
5235
|
+
type: 'string',
|
|
5236
|
+
description: 'Currency code (ISO 4217 or commodity ticker).',
|
|
5237
|
+
example: 'CNY'
|
|
5238
|
+
}
|
|
5239
|
+
},
|
|
5240
|
+
required: ['amount', 'ccy']
|
|
5241
|
+
} as const;
|
|
5242
|
+
|
|
5243
|
+
export const $ComputeReconciliationDto = {
|
|
5244
|
+
type: 'object',
|
|
5245
|
+
properties: {
|
|
5246
|
+
accountId: {
|
|
5247
|
+
type: 'string',
|
|
5248
|
+
description: 'BeanAccount id to reconcile.'
|
|
5249
|
+
},
|
|
5250
|
+
asOfDate: {
|
|
5251
|
+
type: 'string',
|
|
5252
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
5253
|
+
example: '2026-07-24'
|
|
5254
|
+
},
|
|
5255
|
+
actualBalance: {
|
|
5256
|
+
description: 'Actual balance from the external statement.',
|
|
5257
|
+
allOf: [
|
|
5258
|
+
{
|
|
5259
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
5260
|
+
}
|
|
5261
|
+
]
|
|
5262
|
+
}
|
|
5263
|
+
},
|
|
5264
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
5265
|
+
} as const;
|
|
5266
|
+
|
|
5267
|
+
export const $ReconciliationComputeResultDto = {
|
|
5268
|
+
type: 'object',
|
|
5269
|
+
properties: {
|
|
5270
|
+
accountId: {
|
|
5271
|
+
type: 'string'
|
|
5272
|
+
},
|
|
5273
|
+
asOfDate: {
|
|
5274
|
+
type: 'string'
|
|
5275
|
+
},
|
|
5276
|
+
bookBalance: {
|
|
5277
|
+
type: 'string',
|
|
5278
|
+
description: 'System-computed book balance (decimal string).'
|
|
5279
|
+
},
|
|
5280
|
+
actualBalance: {
|
|
5281
|
+
type: 'string',
|
|
5282
|
+
description: 'User-entered actual balance (decimal string).'
|
|
5283
|
+
},
|
|
5284
|
+
currency: {
|
|
5285
|
+
type: 'string'
|
|
5286
|
+
},
|
|
5287
|
+
diff: {
|
|
5288
|
+
type: 'string',
|
|
5289
|
+
description: 'Diff = book − actual (decimal string).'
|
|
5290
|
+
},
|
|
5291
|
+
tolerance: {
|
|
5292
|
+
type: 'string',
|
|
5293
|
+
description: 'Applied tolerance (decimal string).'
|
|
5294
|
+
},
|
|
5295
|
+
withinTolerance: {
|
|
5296
|
+
type: 'boolean',
|
|
5297
|
+
description: 'true when |diff| ≤ tolerance.'
|
|
5298
|
+
},
|
|
5299
|
+
suggestedAction: {
|
|
5300
|
+
type: 'string',
|
|
5301
|
+
enum: ['assert', 'pad'],
|
|
5302
|
+
description:
|
|
5303
|
+
'Suggested next action: assert when within tolerance, pad otherwise.'
|
|
5304
|
+
}
|
|
5305
|
+
},
|
|
5306
|
+
required: [
|
|
5307
|
+
'accountId',
|
|
5308
|
+
'asOfDate',
|
|
5309
|
+
'bookBalance',
|
|
5310
|
+
'actualBalance',
|
|
5311
|
+
'currency',
|
|
5312
|
+
'diff',
|
|
5313
|
+
'tolerance',
|
|
5314
|
+
'withinTolerance',
|
|
5315
|
+
'suggestedAction'
|
|
5316
|
+
]
|
|
5317
|
+
} as const;
|
|
5318
|
+
|
|
5319
|
+
export const $AssertReconciliationDto = {
|
|
5320
|
+
type: 'object',
|
|
5321
|
+
properties: {
|
|
5322
|
+
accountId: {
|
|
3946
5323
|
type: 'string',
|
|
3947
|
-
description: '
|
|
3948
|
-
example: 'USD'
|
|
5324
|
+
description: 'BeanAccount id to reconcile.'
|
|
3949
5325
|
},
|
|
3950
|
-
|
|
5326
|
+
asOfDate: {
|
|
3951
5327
|
type: 'string',
|
|
3952
|
-
description: '
|
|
3953
|
-
example: '
|
|
5328
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
5329
|
+
example: '2026-07-24'
|
|
3954
5330
|
},
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
5331
|
+
actualBalance: {
|
|
5332
|
+
description: 'Actual balance from the external statement.',
|
|
5333
|
+
allOf: [
|
|
5334
|
+
{
|
|
5335
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
5336
|
+
}
|
|
5337
|
+
]
|
|
3959
5338
|
},
|
|
3960
|
-
|
|
5339
|
+
tolerance: {
|
|
3961
5340
|
type: 'string',
|
|
3962
|
-
description:
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
}
|
|
5341
|
+
description:
|
|
5342
|
+
'Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).',
|
|
5343
|
+
example: '0.01'
|
|
5344
|
+
}
|
|
5345
|
+
},
|
|
5346
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
5347
|
+
} as const;
|
|
5348
|
+
|
|
5349
|
+
export const $ReconciliationRecordDto = {
|
|
5350
|
+
type: 'object',
|
|
5351
|
+
properties: {
|
|
5352
|
+
id: {
|
|
5353
|
+
type: 'string'
|
|
3976
5354
|
},
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
type: 'array',
|
|
3980
|
-
items: {
|
|
3981
|
-
type: 'string'
|
|
3982
|
-
}
|
|
5355
|
+
accountId: {
|
|
5356
|
+
type: 'string'
|
|
3983
5357
|
},
|
|
3984
|
-
|
|
3985
|
-
type: 'string'
|
|
3986
|
-
description: 'Data source filter'
|
|
5358
|
+
date: {
|
|
5359
|
+
type: 'string'
|
|
3987
5360
|
},
|
|
3988
|
-
|
|
5361
|
+
amount: {
|
|
3989
5362
|
type: 'string',
|
|
3990
|
-
description: '
|
|
3991
|
-
},
|
|
3992
|
-
'filters.tags': {
|
|
3993
|
-
description: 'Tag filters',
|
|
3994
|
-
type: 'array',
|
|
3995
|
-
items: {
|
|
3996
|
-
type: 'string'
|
|
3997
|
-
}
|
|
5363
|
+
description: 'Asserted (actual) amount.'
|
|
3998
5364
|
},
|
|
3999
|
-
|
|
4000
|
-
type: '
|
|
4001
|
-
description: 'Enable experimental features'
|
|
5365
|
+
currency: {
|
|
5366
|
+
type: 'string'
|
|
4002
5367
|
},
|
|
4003
|
-
|
|
4004
|
-
type: '
|
|
4005
|
-
description: 'Enable restricted view mode'
|
|
5368
|
+
tolerance: {
|
|
5369
|
+
type: 'string'
|
|
4006
5370
|
},
|
|
4007
|
-
|
|
5371
|
+
diffAmount: {
|
|
4008
5372
|
type: 'string',
|
|
4009
|
-
description: '
|
|
4010
|
-
example: 'en'
|
|
5373
|
+
description: 'book − actual.'
|
|
4011
5374
|
},
|
|
4012
|
-
|
|
4013
|
-
type: 'string'
|
|
4014
|
-
description: 'Locale code',
|
|
4015
|
-
example: 'en-US'
|
|
5375
|
+
diffCurrency: {
|
|
5376
|
+
type: 'string'
|
|
4016
5377
|
},
|
|
4017
|
-
|
|
4018
|
-
type: '
|
|
4019
|
-
|
|
4020
|
-
|
|
5378
|
+
createdAt: {
|
|
5379
|
+
type: 'string'
|
|
5380
|
+
}
|
|
5381
|
+
},
|
|
5382
|
+
required: ['id', 'accountId', 'date', 'amount', 'currency', 'createdAt']
|
|
5383
|
+
} as const;
|
|
5384
|
+
|
|
5385
|
+
export const $PadReconciliationDto = {
|
|
5386
|
+
type: 'object',
|
|
5387
|
+
properties: {
|
|
5388
|
+
accountId: {
|
|
5389
|
+
type: 'string',
|
|
5390
|
+
description: 'BeanAccount id to reconcile.'
|
|
4021
5391
|
},
|
|
4022
|
-
|
|
5392
|
+
asOfDate: {
|
|
4023
5393
|
type: 'string',
|
|
4024
|
-
description: '
|
|
4025
|
-
example: '
|
|
5394
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
5395
|
+
example: '2026-07-24'
|
|
4026
5396
|
},
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
5397
|
+
actualBalance: {
|
|
5398
|
+
description: 'Actual balance from the external statement.',
|
|
5399
|
+
allOf: [
|
|
5400
|
+
{
|
|
5401
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
5402
|
+
}
|
|
5403
|
+
]
|
|
4031
5404
|
},
|
|
4032
|
-
|
|
5405
|
+
sourceAccount: {
|
|
4033
5406
|
type: 'string',
|
|
4034
|
-
description:
|
|
4035
|
-
|
|
5407
|
+
description:
|
|
5408
|
+
'Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).',
|
|
5409
|
+
example: 'Equity:Opening-Balances',
|
|
5410
|
+
default: 'Equity:Opening-Balances'
|
|
4036
5411
|
}
|
|
4037
|
-
}
|
|
5412
|
+
},
|
|
5413
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
4038
5414
|
} as const;
|
|
4039
5415
|
|
|
4040
|
-
export const $
|
|
5416
|
+
export const $PadResultDto = {
|
|
4041
5417
|
type: 'object',
|
|
4042
5418
|
properties: {
|
|
4043
|
-
|
|
5419
|
+
transactionId: {
|
|
4044
5420
|
type: 'string',
|
|
4045
|
-
description: '
|
|
5421
|
+
description: 'Created pad adjusting transaction id.'
|
|
4046
5422
|
}
|
|
4047
5423
|
},
|
|
4048
|
-
required: ['
|
|
5424
|
+
required: ['transactionId']
|
|
4049
5425
|
} as const;
|
|
4050
5426
|
|
|
4051
5427
|
export const $FileImportDto = {
|
|
@@ -4214,7 +5590,7 @@ export const $IdentifyResultDto = {
|
|
|
4214
5590
|
account: {
|
|
4215
5591
|
type: 'string',
|
|
4216
5592
|
description: 'Default account used by this importer',
|
|
4217
|
-
example: 'Assets:Alipay:Balance'
|
|
5593
|
+
example: 'Assets:CN:Alipay:Balance'
|
|
4218
5594
|
},
|
|
4219
5595
|
message: {
|
|
4220
5596
|
type: 'string',
|
|
@@ -4231,7 +5607,7 @@ export const $MapperDefaultsDto = {
|
|
|
4231
5607
|
sourceAccount: {
|
|
4232
5608
|
type: 'string',
|
|
4233
5609
|
description: 'Source account for transactions (Beancount format)',
|
|
4234
|
-
example: 'Assets:Alipay:Balance'
|
|
5610
|
+
example: 'Assets:CN:Alipay:Balance'
|
|
4235
5611
|
},
|
|
4236
5612
|
currency: {
|
|
4237
5613
|
type: 'string',
|
|
@@ -4268,7 +5644,7 @@ export const $MapperDefaultsDto = {
|
|
|
4268
5644
|
description:
|
|
4269
5645
|
'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).',
|
|
4270
5646
|
example: {
|
|
4271
|
-
HuaBei: 'Liabilities:
|
|
5647
|
+
HuaBei: 'Liabilities:CN:CreditLine',
|
|
4272
5648
|
CreditCard: 'Liabilities:CreditCard'
|
|
4273
5649
|
}
|
|
4274
5650
|
}
|
|
@@ -4391,180 +5767,77 @@ export const $ImporterConfigDto = {
|
|
|
4391
5767
|
'config',
|
|
4392
5768
|
'createdAt',
|
|
4393
5769
|
'updatedAt'
|
|
4394
|
-
]
|
|
4395
|
-
} as const;
|
|
4396
|
-
|
|
4397
|
-
export const $UpdateMapperDefaultsDto = {
|
|
4398
|
-
type: 'object',
|
|
4399
|
-
properties: {
|
|
4400
|
-
sourceAccount: {
|
|
4401
|
-
type: 'string',
|
|
4402
|
-
description: 'Source account for transactions (Beancount format)',
|
|
4403
|
-
example: 'Assets:Alipay:Balance',
|
|
4404
|
-
pattern:
|
|
4405
|
-
|
|
4406
|
-
currency: {
|
|
4407
|
-
type: 'string',
|
|
4408
|
-
description: 'Default currency (ISO 4217 code)',
|
|
4409
|
-
example: 'CNY',
|
|
4410
|
-
minLength: 3,
|
|
4411
|
-
maxLength: 3,
|
|
4412
|
-
pattern: '^[A-Z]{3}$'
|
|
4413
|
-
},
|
|
4414
|
-
expenseAccount: {
|
|
4415
|
-
type: 'string',
|
|
4416
|
-
description: 'Default expense account (optional)',
|
|
4417
|
-
example: 'Expenses:Unknown',
|
|
4418
|
-
pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
|
|
4419
|
-
},
|
|
4420
|
-
incomeAccount: {
|
|
4421
|
-
type: 'string',
|
|
4422
|
-
description: 'Default income account (optional)',
|
|
4423
|
-
example: 'Income:Unknown',
|
|
4424
|
-
pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
|
|
4425
|
-
},
|
|
4426
|
-
methodAccountMapping: {
|
|
4427
|
-
type: 'object',
|
|
4428
|
-
description:
|
|
4429
|
-
'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).',
|
|
4430
|
-
example: {
|
|
4431
|
-
HuaBei: 'Liabilities:Alipay:Huabei',
|
|
4432
|
-
CreditCard: 'Liabilities:CreditCard'
|
|
4433
|
-
}
|
|
4434
|
-
}
|
|
4435
|
-
}
|
|
4436
|
-
} as const;
|
|
4437
|
-
|
|
4438
|
-
export const $UpdateConfigDataDto = {
|
|
4439
|
-
type: 'object',
|
|
4440
|
-
properties: {
|
|
4441
|
-
defaults: {
|
|
4442
|
-
description: 'Mapper defaults configuration',
|
|
4443
|
-
allOf: [
|
|
4444
|
-
{
|
|
4445
|
-
$ref: '#/components/schemas/UpdateMapperDefaultsDto'
|
|
4446
|
-
}
|
|
4447
|
-
]
|
|
4448
|
-
}
|
|
4449
|
-
}
|
|
4450
|
-
} as const;
|
|
4451
|
-
|
|
4452
|
-
export const $UpdateImporterConfigDto = {
|
|
4453
|
-
type: 'object',
|
|
4454
|
-
properties: {
|
|
4455
|
-
data: {
|
|
4456
|
-
description: 'Configuration data (v1 schema)',
|
|
4457
|
-
allOf: [
|
|
4458
|
-
{
|
|
4459
|
-
$ref: '#/components/schemas/UpdateConfigDataDto'
|
|
4460
|
-
}
|
|
4461
|
-
]
|
|
4462
|
-
}
|
|
4463
|
-
}
|
|
4464
|
-
} as const;
|
|
4465
|
-
|
|
4466
|
-
export const $CreatePlatformDto = {
|
|
4467
|
-
type: 'object',
|
|
4468
|
-
properties: {
|
|
4469
|
-
name: {
|
|
4470
|
-
type: 'string',
|
|
4471
|
-
description: 'Platform name',
|
|
4472
|
-
example: 'Binance'
|
|
4473
|
-
},
|
|
4474
|
-
canonical: {
|
|
4475
|
-
type: 'string',
|
|
4476
|
-
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
4477
|
-
example: 'binance'
|
|
4478
|
-
},
|
|
4479
|
-
aliases: {
|
|
4480
|
-
description: 'Platform aliases (multi-language names for lookup)',
|
|
4481
|
-
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
4482
|
-
type: 'array',
|
|
4483
|
-
items: {
|
|
4484
|
-
type: 'string'
|
|
4485
|
-
}
|
|
4486
|
-
},
|
|
4487
|
-
url: {
|
|
4488
|
-
type: 'string',
|
|
4489
|
-
description: 'Platform URL',
|
|
4490
|
-
example: 'https://www.binance.com'
|
|
4491
|
-
},
|
|
4492
|
-
type: {
|
|
4493
|
-
type: 'string',
|
|
4494
|
-
description: 'Platform type',
|
|
4495
|
-
enum: [
|
|
4496
|
-
'BANK',
|
|
4497
|
-
'BROKERAGE',
|
|
4498
|
-
'CRYPTO_EXCHANGE',
|
|
4499
|
-
'PAYMENT',
|
|
4500
|
-
'INVESTMENT',
|
|
4501
|
-
'INSURANCE',
|
|
4502
|
-
'OTHER'
|
|
4503
|
-
],
|
|
4504
|
-
example: 'CRYPTO_EXCHANGE'
|
|
4505
|
-
},
|
|
4506
|
-
logoUrl: {
|
|
4507
|
-
type: 'string',
|
|
4508
|
-
description: 'Platform logo URL',
|
|
4509
|
-
example: 'https://example.com/logos/binance.png'
|
|
4510
|
-
},
|
|
4511
|
-
isActive: {
|
|
4512
|
-
type: 'boolean',
|
|
4513
|
-
description: 'Whether the platform is active',
|
|
4514
|
-
default: true
|
|
4515
|
-
}
|
|
4516
|
-
},
|
|
4517
|
-
required: ['name', 'canonical', 'aliases', 'url', 'type']
|
|
4518
|
-
} as const;
|
|
4519
|
-
|
|
4520
|
-
export const $UpdatePlatformDto = {
|
|
4521
|
-
type: 'object',
|
|
4522
|
-
properties: {
|
|
4523
|
-
name: {
|
|
4524
|
-
type: 'string',
|
|
4525
|
-
description: 'Platform name',
|
|
4526
|
-
example: 'Binance'
|
|
4527
|
-
},
|
|
4528
|
-
canonical: {
|
|
4529
|
-
type: 'string',
|
|
4530
|
-
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
4531
|
-
example: 'binance'
|
|
4532
|
-
},
|
|
4533
|
-
aliases: {
|
|
4534
|
-
description: 'Platform aliases (multi-language names for lookup)',
|
|
4535
|
-
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
4536
|
-
type: 'array',
|
|
4537
|
-
items: {
|
|
4538
|
-
type: 'string'
|
|
4539
|
-
}
|
|
5770
|
+
]
|
|
5771
|
+
} as const;
|
|
5772
|
+
|
|
5773
|
+
export const $UpdateMapperDefaultsDto = {
|
|
5774
|
+
type: 'object',
|
|
5775
|
+
properties: {
|
|
5776
|
+
sourceAccount: {
|
|
5777
|
+
type: 'string',
|
|
5778
|
+
description: 'Source account for transactions (Beancount format)',
|
|
5779
|
+
example: 'Assets:CN:Alipay:Balance',
|
|
5780
|
+
pattern:
|
|
5781
|
+
'^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
|
|
4540
5782
|
},
|
|
4541
|
-
|
|
5783
|
+
currency: {
|
|
4542
5784
|
type: 'string',
|
|
4543
|
-
description: '
|
|
4544
|
-
example: '
|
|
5785
|
+
description: 'Default currency (ISO 4217 code)',
|
|
5786
|
+
example: 'CNY',
|
|
5787
|
+
minLength: 3,
|
|
5788
|
+
maxLength: 3,
|
|
5789
|
+
pattern: '^[A-Z]{3}$'
|
|
4545
5790
|
},
|
|
4546
|
-
|
|
5791
|
+
expenseAccount: {
|
|
4547
5792
|
type: 'string',
|
|
4548
|
-
description: '
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
'
|
|
4552
|
-
'CRYPTO_EXCHANGE',
|
|
4553
|
-
'PAYMENT',
|
|
4554
|
-
'INVESTMENT',
|
|
4555
|
-
'INSURANCE',
|
|
4556
|
-
'OTHER'
|
|
4557
|
-
],
|
|
4558
|
-
example: 'CRYPTO_EXCHANGE'
|
|
5793
|
+
description: 'Default expense account (optional)',
|
|
5794
|
+
example: 'Expenses:Unknown',
|
|
5795
|
+
pattern:
|
|
5796
|
+
'^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
|
|
4559
5797
|
},
|
|
4560
|
-
|
|
5798
|
+
incomeAccount: {
|
|
4561
5799
|
type: 'string',
|
|
4562
|
-
description: '
|
|
4563
|
-
example: '
|
|
5800
|
+
description: 'Default income account (optional)',
|
|
5801
|
+
example: 'Income:Unknown',
|
|
5802
|
+
pattern:
|
|
5803
|
+
'^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
|
|
4564
5804
|
},
|
|
4565
|
-
|
|
4566
|
-
type: '
|
|
4567
|
-
description:
|
|
5805
|
+
methodAccountMapping: {
|
|
5806
|
+
type: 'object',
|
|
5807
|
+
description:
|
|
5808
|
+
'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).',
|
|
5809
|
+
example: {
|
|
5810
|
+
HuaBei: 'Liabilities:CN:CreditLine',
|
|
5811
|
+
CreditCard: 'Liabilities:CreditCard'
|
|
5812
|
+
}
|
|
5813
|
+
}
|
|
5814
|
+
}
|
|
5815
|
+
} as const;
|
|
5816
|
+
|
|
5817
|
+
export const $UpdateConfigDataDto = {
|
|
5818
|
+
type: 'object',
|
|
5819
|
+
properties: {
|
|
5820
|
+
defaults: {
|
|
5821
|
+
description: 'Mapper defaults configuration',
|
|
5822
|
+
allOf: [
|
|
5823
|
+
{
|
|
5824
|
+
$ref: '#/components/schemas/UpdateMapperDefaultsDto'
|
|
5825
|
+
}
|
|
5826
|
+
]
|
|
5827
|
+
}
|
|
5828
|
+
}
|
|
5829
|
+
} as const;
|
|
5830
|
+
|
|
5831
|
+
export const $UpdateImporterConfigDto = {
|
|
5832
|
+
type: 'object',
|
|
5833
|
+
properties: {
|
|
5834
|
+
data: {
|
|
5835
|
+
description: 'Configuration data (v1 schema)',
|
|
5836
|
+
allOf: [
|
|
5837
|
+
{
|
|
5838
|
+
$ref: '#/components/schemas/UpdateConfigDataDto'
|
|
5839
|
+
}
|
|
5840
|
+
]
|
|
4568
5841
|
}
|
|
4569
5842
|
}
|
|
4570
5843
|
} as const;
|
|
@@ -4575,7 +5848,7 @@ export const $ProviderSyncConfigDto = {
|
|
|
4575
5848
|
sourceAccount: {
|
|
4576
5849
|
type: 'string',
|
|
4577
5850
|
description: 'Source account for the first posting',
|
|
4578
|
-
example: 'Assets:
|
|
5851
|
+
example: 'Assets:US:Chase:Checking'
|
|
4579
5852
|
},
|
|
4580
5853
|
defaultCurrency: {
|
|
4581
5854
|
type: 'string',
|
|
@@ -4584,26 +5857,29 @@ export const $ProviderSyncConfigDto = {
|
|
|
4584
5857
|
},
|
|
4585
5858
|
defaultExpenseAccount: {
|
|
4586
5859
|
type: 'string',
|
|
4587
|
-
description:
|
|
5860
|
+
description:
|
|
5861
|
+
'Default expense account for the second posting. Omit when no real default exists; the pipeline routes to Review via the Uncategorized sentinel (#618).',
|
|
4588
5862
|
example: 'Expenses:Unknown'
|
|
4589
5863
|
},
|
|
4590
5864
|
defaultIncomeAccount: {
|
|
4591
5865
|
type: 'string',
|
|
4592
|
-
description:
|
|
5866
|
+
description:
|
|
5867
|
+
'Default income account for the second posting. Omit when no real default exists; the pipeline routes to Review via the Uncategorized sentinel (#618).',
|
|
4593
5868
|
example: 'Income:Unknown'
|
|
4594
5869
|
},
|
|
4595
5870
|
filterPending: {
|
|
4596
5871
|
type: 'boolean',
|
|
4597
5872
|
description: 'Filter pending transactions',
|
|
4598
5873
|
default: true
|
|
5874
|
+
},
|
|
5875
|
+
externalAccountId: {
|
|
5876
|
+
type: 'string',
|
|
5877
|
+
description:
|
|
5878
|
+
'External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.',
|
|
5879
|
+
example: 'acc_gocardless_001'
|
|
4599
5880
|
}
|
|
4600
5881
|
},
|
|
4601
|
-
required: [
|
|
4602
|
-
'sourceAccount',
|
|
4603
|
-
'defaultCurrency',
|
|
4604
|
-
'defaultExpenseAccount',
|
|
4605
|
-
'defaultIncomeAccount'
|
|
4606
|
-
]
|
|
5882
|
+
required: ['sourceAccount', 'defaultCurrency']
|
|
4607
5883
|
} as const;
|
|
4608
5884
|
|
|
4609
5885
|
export const $ProviderSyncDto = {
|
|
@@ -4679,45 +5955,221 @@ export const $ProviderSyncResponseDto = {
|
|
|
4679
5955
|
type: 'string'
|
|
4680
5956
|
}
|
|
4681
5957
|
},
|
|
4682
|
-
reviewItemIds: {
|
|
4683
|
-
description: 'IDs of review items created for branched transactions',
|
|
4684
|
-
example: ['review-001', 'review-002'],
|
|
4685
|
-
type: 'array',
|
|
4686
|
-
items: {
|
|
4687
|
-
type: 'string'
|
|
4688
|
-
}
|
|
4689
|
-
}
|
|
4690
|
-
},
|
|
4691
|
-
required: ['imported', 'skipped', 'pendingReview', 'failed']
|
|
4692
|
-
} as const;
|
|
4693
|
-
|
|
4694
|
-
export const $SupportedProvidersResponseDto = {
|
|
4695
|
-
type: 'object',
|
|
4696
|
-
properties: {
|
|
4697
|
-
providers: {
|
|
4698
|
-
description: 'List of supported provider names',
|
|
4699
|
-
example: [
|
|
4700
|
-
'plaid',
|
|
4701
|
-
'teller',
|
|
4702
|
-
'truelayer',
|
|
4703
|
-
'gocardless',
|
|
4704
|
-
'simplefin',
|
|
4705
|
-
'yodlee',
|
|
4706
|
-
'beancount-direct',
|
|
4707
|
-
'parsed-bill'
|
|
4708
|
-
],
|
|
4709
|
-
type: 'array',
|
|
4710
|
-
items: {
|
|
4711
|
-
type: 'string'
|
|
4712
|
-
}
|
|
5958
|
+
reviewItemIds: {
|
|
5959
|
+
description: 'IDs of review items created for branched transactions',
|
|
5960
|
+
example: ['review-001', 'review-002'],
|
|
5961
|
+
type: 'array',
|
|
5962
|
+
items: {
|
|
5963
|
+
type: 'string'
|
|
5964
|
+
}
|
|
5965
|
+
}
|
|
5966
|
+
},
|
|
5967
|
+
required: ['imported', 'skipped', 'pendingReview', 'failed']
|
|
5968
|
+
} as const;
|
|
5969
|
+
|
|
5970
|
+
export const $SupportedProvidersResponseDto = {
|
|
5971
|
+
type: 'object',
|
|
5972
|
+
properties: {
|
|
5973
|
+
providers: {
|
|
5974
|
+
description: 'List of supported provider names',
|
|
5975
|
+
example: [
|
|
5976
|
+
'plaid',
|
|
5977
|
+
'teller',
|
|
5978
|
+
'truelayer',
|
|
5979
|
+
'gocardless',
|
|
5980
|
+
'simplefin',
|
|
5981
|
+
'yodlee',
|
|
5982
|
+
'beancount-direct',
|
|
5983
|
+
'parsed-bill'
|
|
5984
|
+
],
|
|
5985
|
+
type: 'array',
|
|
5986
|
+
items: {
|
|
5987
|
+
type: 'string'
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
},
|
|
5991
|
+
required: ['providers']
|
|
5992
|
+
} as const;
|
|
5993
|
+
|
|
5994
|
+
export const $CreateExternalAccountLinkDto = {
|
|
5995
|
+
type: 'object',
|
|
5996
|
+
properties: {
|
|
5997
|
+
provider: {
|
|
5998
|
+
type: 'string',
|
|
5999
|
+
enum: [
|
|
6000
|
+
'plaid',
|
|
6001
|
+
'teller',
|
|
6002
|
+
'truelayer',
|
|
6003
|
+
'gocardless',
|
|
6004
|
+
'simplefin',
|
|
6005
|
+
'yodlee',
|
|
6006
|
+
'beancount-direct',
|
|
6007
|
+
'parsed-bill'
|
|
6008
|
+
],
|
|
6009
|
+
example: 'plaid',
|
|
6010
|
+
description: 'Open Banking provider (whitelist)'
|
|
6011
|
+
},
|
|
6012
|
+
externalAccountId: {
|
|
6013
|
+
type: 'string',
|
|
6014
|
+
example: 'acc-plaid-001',
|
|
6015
|
+
description: 'External account ID from the provider'
|
|
6016
|
+
},
|
|
6017
|
+
beanAccountId: {
|
|
6018
|
+
type: 'string',
|
|
6019
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
6020
|
+
description: 'Target BeanAccount ID (must belong to the JWT user)'
|
|
6021
|
+
}
|
|
6022
|
+
},
|
|
6023
|
+
required: ['provider', 'externalAccountId', 'beanAccountId']
|
|
6024
|
+
} as const;
|
|
6025
|
+
|
|
6026
|
+
export const $ExternalAccountLinkResponseDto = {
|
|
6027
|
+
type: 'object',
|
|
6028
|
+
properties: {
|
|
6029
|
+
id: {
|
|
6030
|
+
type: 'string'
|
|
6031
|
+
},
|
|
6032
|
+
provider: {
|
|
6033
|
+
type: 'string'
|
|
6034
|
+
},
|
|
6035
|
+
externalAccountId: {
|
|
6036
|
+
type: 'string'
|
|
6037
|
+
},
|
|
6038
|
+
beanAccountId: {
|
|
6039
|
+
type: 'string'
|
|
6040
|
+
},
|
|
6041
|
+
isActive: {
|
|
6042
|
+
type: 'boolean'
|
|
6043
|
+
},
|
|
6044
|
+
createdAt: {
|
|
6045
|
+
type: 'string'
|
|
6046
|
+
},
|
|
6047
|
+
updatedAt: {
|
|
6048
|
+
type: 'string'
|
|
6049
|
+
}
|
|
6050
|
+
},
|
|
6051
|
+
required: [
|
|
6052
|
+
'id',
|
|
6053
|
+
'provider',
|
|
6054
|
+
'externalAccountId',
|
|
6055
|
+
'beanAccountId',
|
|
6056
|
+
'isActive',
|
|
6057
|
+
'createdAt',
|
|
6058
|
+
'updatedAt'
|
|
6059
|
+
]
|
|
6060
|
+
} as const;
|
|
6061
|
+
|
|
6062
|
+
export const $ExternalAccountLinkListResponseDto = {
|
|
6063
|
+
type: 'object',
|
|
6064
|
+
properties: {
|
|
6065
|
+
items: {
|
|
6066
|
+
type: 'array',
|
|
6067
|
+
items: {
|
|
6068
|
+
$ref: '#/components/schemas/ExternalAccountLinkResponseDto'
|
|
6069
|
+
}
|
|
6070
|
+
},
|
|
6071
|
+
total: {
|
|
6072
|
+
type: 'number'
|
|
6073
|
+
},
|
|
6074
|
+
provider: {
|
|
6075
|
+
type: 'string',
|
|
6076
|
+
description: 'Filter by provider (query param)'
|
|
6077
|
+
}
|
|
6078
|
+
},
|
|
6079
|
+
required: ['items', 'total']
|
|
6080
|
+
} as const;
|
|
6081
|
+
|
|
6082
|
+
export const $ParserTelemetryReportDto = {
|
|
6083
|
+
type: 'object',
|
|
6084
|
+
properties: {}
|
|
6085
|
+
} as const;
|
|
6086
|
+
|
|
6087
|
+
export const $UncoveredFormatMissDto = {
|
|
6088
|
+
type: 'object',
|
|
6089
|
+
properties: {}
|
|
6090
|
+
} as const;
|
|
6091
|
+
|
|
6092
|
+
export const $ClientParsedDataDto = {
|
|
6093
|
+
type: 'object',
|
|
6094
|
+
properties: {
|
|
6095
|
+
amount: {
|
|
6096
|
+
type: 'number',
|
|
6097
|
+
description: 'Transaction amount',
|
|
6098
|
+
example: 35
|
|
6099
|
+
},
|
|
6100
|
+
currency: {
|
|
6101
|
+
type: 'string',
|
|
6102
|
+
description: 'Currency code',
|
|
6103
|
+
example: 'CNY'
|
|
6104
|
+
},
|
|
6105
|
+
date: {
|
|
6106
|
+
type: 'string',
|
|
6107
|
+
description: 'Transaction date (ISO 8601)',
|
|
6108
|
+
example: '2026-08-15'
|
|
6109
|
+
},
|
|
6110
|
+
payee: {
|
|
6111
|
+
type: 'string',
|
|
6112
|
+
description: 'Payee/merchant name',
|
|
6113
|
+
example: 'Starbucks'
|
|
6114
|
+
},
|
|
6115
|
+
narration: {
|
|
6116
|
+
type: 'string',
|
|
6117
|
+
description: 'Transaction narration'
|
|
6118
|
+
},
|
|
6119
|
+
category: {
|
|
6120
|
+
type: 'string',
|
|
6121
|
+
description: 'Category slug',
|
|
6122
|
+
example: 'food_restaurant'
|
|
6123
|
+
},
|
|
6124
|
+
incomeType: {
|
|
6125
|
+
type: 'string',
|
|
6126
|
+
description: 'Income type',
|
|
6127
|
+
example: 'Salary'
|
|
6128
|
+
},
|
|
6129
|
+
incomeSource: {
|
|
6130
|
+
type: 'string',
|
|
6131
|
+
description: 'Income source',
|
|
6132
|
+
example: 'Anthropic Inc.'
|
|
6133
|
+
},
|
|
6134
|
+
symbol: {
|
|
6135
|
+
type: 'string',
|
|
6136
|
+
description: 'Security symbol code (e.g., 600519, AAPL)',
|
|
6137
|
+
example: 'AAPL'
|
|
6138
|
+
},
|
|
6139
|
+
quantity: {
|
|
6140
|
+
type: 'number',
|
|
6141
|
+
description: 'Quantity of shares/units',
|
|
6142
|
+
example: 100
|
|
6143
|
+
},
|
|
6144
|
+
price: {
|
|
6145
|
+
type: 'number',
|
|
6146
|
+
description: 'Unit price per share/unit',
|
|
6147
|
+
example: 1900
|
|
6148
|
+
},
|
|
6149
|
+
investmentAction: {
|
|
6150
|
+
type: 'string',
|
|
6151
|
+
description: 'Investment action',
|
|
6152
|
+
enum: ['buy', 'sell'],
|
|
6153
|
+
example: 'buy'
|
|
6154
|
+
},
|
|
6155
|
+
paymentSource: {
|
|
6156
|
+
type: 'string',
|
|
6157
|
+
description: 'Payment source: asset (default) or liability (credit card)',
|
|
6158
|
+
enum: ['asset', 'liability'],
|
|
6159
|
+
example: 'asset'
|
|
6160
|
+
},
|
|
6161
|
+
liabilityHint: {
|
|
6162
|
+
type: 'string',
|
|
6163
|
+
description: 'Liability account hint (CreditCard/Huabei/Baitiao)',
|
|
6164
|
+
example: 'CreditCard'
|
|
6165
|
+
},
|
|
6166
|
+
warning: {
|
|
6167
|
+
type: 'string',
|
|
6168
|
+
description:
|
|
6169
|
+
'Display-only warning from the prior response; accepted but ignored.',
|
|
6170
|
+
example: 'Cross-currency settlement applies.'
|
|
4713
6171
|
}
|
|
4714
|
-
}
|
|
4715
|
-
required: ['providers']
|
|
4716
|
-
} as const;
|
|
4717
|
-
|
|
4718
|
-
export const $ParserTelemetryReportDto = {
|
|
4719
|
-
type: 'object',
|
|
4720
|
-
properties: {}
|
|
6172
|
+
}
|
|
4721
6173
|
} as const;
|
|
4722
6174
|
|
|
4723
6175
|
export const $ProcessNlpDto = {
|
|
@@ -4725,10 +6177,17 @@ export const $ProcessNlpDto = {
|
|
|
4725
6177
|
properties: {
|
|
4726
6178
|
message: {
|
|
4727
6179
|
type: 'string',
|
|
4728
|
-
description:
|
|
4729
|
-
|
|
6180
|
+
description:
|
|
6181
|
+
'Natural language text describing a transaction. Optional when `confirm` is true (structured confirm); otherwise required.',
|
|
6182
|
+
example: 'Starbucks 35',
|
|
4730
6183
|
maxLength: 500
|
|
4731
6184
|
},
|
|
6185
|
+
confirm: {
|
|
6186
|
+
type: 'boolean',
|
|
6187
|
+
description:
|
|
6188
|
+
'Structured confirm signal — bypasses NL confirm-word matching when true. Send parsedData field edits alongside. The NL word-list path is the fallback.',
|
|
6189
|
+
example: true
|
|
6190
|
+
},
|
|
4732
6191
|
sessionId: {
|
|
4733
6192
|
type: 'string',
|
|
4734
6193
|
description:
|
|
@@ -4736,17 +6195,32 @@ export const $ProcessNlpDto = {
|
|
|
4736
6195
|
example: 'session_abc123'
|
|
4737
6196
|
},
|
|
4738
6197
|
parsedData: {
|
|
4739
|
-
type: 'object',
|
|
4740
6198
|
description:
|
|
4741
6199
|
'Parsed data from previous NLP response for session recovery. Send back the parsedData received in confirm_payee/confirm responses.',
|
|
4742
6200
|
example: {
|
|
4743
6201
|
amount: 35,
|
|
4744
6202
|
currency: 'CNY',
|
|
4745
6203
|
payee: 'Starbucks'
|
|
4746
|
-
}
|
|
6204
|
+
},
|
|
6205
|
+
allOf: [
|
|
6206
|
+
{
|
|
6207
|
+
$ref: '#/components/schemas/ClientParsedDataDto'
|
|
6208
|
+
}
|
|
6209
|
+
]
|
|
6210
|
+
},
|
|
6211
|
+
selectedRuleId: {
|
|
6212
|
+
type: 'string',
|
|
6213
|
+
description:
|
|
6214
|
+
'confirm_rule echo-back: rule id selected from the prior confirm_rule response (matchedRule.id or alternatives[i].ruleId). Applied directly when the session is confirming_rule — no NL re-parse.',
|
|
6215
|
+
example: 'rule_abc123'
|
|
6216
|
+
},
|
|
6217
|
+
selectedAccount: {
|
|
6218
|
+
type: 'string',
|
|
6219
|
+
description:
|
|
6220
|
+
'confirm_account echo-back: account path selected from the prior confirm_account response (suggestedAccount, similarAccounts[i], or a typed path). Applied directly when the session is confirming_account — no NL re-parse.',
|
|
6221
|
+
example: 'Expenses:Food:Coffee'
|
|
4747
6222
|
}
|
|
4748
|
-
}
|
|
4749
|
-
required: ['message']
|
|
6223
|
+
}
|
|
4750
6224
|
} as const;
|
|
4751
6225
|
|
|
4752
6226
|
export const $NlpTransactionInfoDto = {
|
|
@@ -5068,7 +6542,8 @@ export const $NlpAccountConfirmationDataDto = {
|
|
|
5068
6542
|
},
|
|
5069
6543
|
suggestedAccount: {
|
|
5070
6544
|
type: 'string',
|
|
5071
|
-
description:
|
|
6545
|
+
description:
|
|
6546
|
+
'Suggested replacement account (omitted when no clear candidate)',
|
|
5072
6547
|
example: 'Expenses:Food:Drinks'
|
|
5073
6548
|
},
|
|
5074
6549
|
similarAccounts: {
|
|
@@ -5090,7 +6565,6 @@ export const $NlpAccountConfirmationDataDto = {
|
|
|
5090
6565
|
},
|
|
5091
6566
|
required: [
|
|
5092
6567
|
'invalidAccount',
|
|
5093
|
-
'suggestedAccount',
|
|
5094
6568
|
'similarAccounts',
|
|
5095
6569
|
'errorMessage',
|
|
5096
6570
|
'transactionContext'
|
|
@@ -5259,11 +6733,12 @@ export const $NlpSuggestedAccountDto = {
|
|
|
5259
6733
|
account: {
|
|
5260
6734
|
type: 'string',
|
|
5261
6735
|
description: 'Suggested account path',
|
|
5262
|
-
example: 'Assets:
|
|
6736
|
+
example: 'Assets:Checking'
|
|
5263
6737
|
},
|
|
5264
6738
|
confidence: {
|
|
5265
6739
|
type: 'number',
|
|
5266
|
-
description:
|
|
6740
|
+
description:
|
|
6741
|
+
'Confidence score for this suggestion (0-1). Present = predicted (confirm/confirm_rule/confirm_account); omitted = actual persisted account (created). (#586)',
|
|
5267
6742
|
example: 0.9
|
|
5268
6743
|
}
|
|
5269
6744
|
},
|
|
@@ -5299,23 +6774,31 @@ export const $NlpDefaultAccountsDto = {
|
|
|
5299
6774
|
properties: {
|
|
5300
6775
|
asset: {
|
|
5301
6776
|
type: 'string',
|
|
5302
|
-
description:
|
|
5303
|
-
|
|
6777
|
+
description:
|
|
6778
|
+
'Default OPEN asset account (MRU when multiple), or null when none/ambiguous',
|
|
6779
|
+
example: 'Assets:Checking',
|
|
6780
|
+
nullable: true
|
|
5304
6781
|
},
|
|
5305
6782
|
expense: {
|
|
5306
6783
|
type: 'string',
|
|
5307
|
-
description:
|
|
5308
|
-
|
|
6784
|
+
description:
|
|
6785
|
+
'Default OPEN expense account (MRU when multiple), or null when none/ambiguous',
|
|
6786
|
+
example: 'Expenses:Food:Coffee',
|
|
6787
|
+
nullable: true
|
|
5309
6788
|
},
|
|
5310
6789
|
income: {
|
|
5311
6790
|
type: 'string',
|
|
5312
|
-
description:
|
|
5313
|
-
|
|
6791
|
+
description:
|
|
6792
|
+
'Default OPEN income account (MRU when multiple), or null when none/ambiguous',
|
|
6793
|
+
example: 'Income:Salary',
|
|
6794
|
+
nullable: true
|
|
5314
6795
|
},
|
|
5315
6796
|
liability: {
|
|
5316
6797
|
type: 'string',
|
|
5317
|
-
description:
|
|
5318
|
-
|
|
6798
|
+
description:
|
|
6799
|
+
'Default OPEN liability account (MRU when multiple), or null when none/ambiguous',
|
|
6800
|
+
example: 'Liabilities:CreditCard',
|
|
6801
|
+
nullable: true
|
|
5319
6802
|
}
|
|
5320
6803
|
},
|
|
5321
6804
|
required: ['asset', 'expense', 'income', 'liability']
|
|
@@ -5340,7 +6823,8 @@ export const $NlpResponseDto = {
|
|
|
5340
6823
|
'confirm_rule',
|
|
5341
6824
|
'confirm_account',
|
|
5342
6825
|
'confirm_payee',
|
|
5343
|
-
'cancel'
|
|
6826
|
+
'cancel',
|
|
6827
|
+
'aborted'
|
|
5344
6828
|
]
|
|
5345
6829
|
},
|
|
5346
6830
|
intent: {
|
|
@@ -5500,43 +6984,304 @@ export const $NlpResponseDto = {
|
|
|
5500
6984
|
}
|
|
5501
6985
|
]
|
|
5502
6986
|
},
|
|
5503
|
-
suggestedAccounts: {
|
|
5504
|
-
description:
|
|
5505
|
-
'Suggested accounts for this transaction.
|
|
5506
|
-
allOf: [
|
|
5507
|
-
{
|
|
5508
|
-
$ref: '#/components/schemas/NlpSuggestedAccountsDto'
|
|
5509
|
-
}
|
|
5510
|
-
]
|
|
6987
|
+
suggestedAccounts: {
|
|
6988
|
+
description:
|
|
6989
|
+
'Suggested accounts for this transaction (#586). confirm/confirm_rule/confirm_account: predicted (source/destination carry confidence); created: actual persisted accounts (confidence omitted). confirm_account destination is the suggested replacement, never the invalid account.',
|
|
6990
|
+
allOf: [
|
|
6991
|
+
{
|
|
6992
|
+
$ref: '#/components/schemas/NlpSuggestedAccountsDto'
|
|
6993
|
+
}
|
|
6994
|
+
]
|
|
6995
|
+
},
|
|
6996
|
+
defaultAccounts: {
|
|
6997
|
+
description:
|
|
6998
|
+
'Default fallback accounts for the user/region (#586). v1 returns universal constants; per-user personalization is planned.',
|
|
6999
|
+
allOf: [
|
|
7000
|
+
{
|
|
7001
|
+
$ref: '#/components/schemas/NlpDefaultAccountsDto'
|
|
7002
|
+
}
|
|
7003
|
+
]
|
|
7004
|
+
}
|
|
7005
|
+
},
|
|
7006
|
+
required: ['status', 'action']
|
|
7007
|
+
} as const;
|
|
7008
|
+
|
|
7009
|
+
export const $PlatformListItemDto = {
|
|
7010
|
+
type: 'object',
|
|
7011
|
+
properties: {
|
|
7012
|
+
id: {
|
|
7013
|
+
type: 'string',
|
|
7014
|
+
description: 'Global platform ID'
|
|
7015
|
+
},
|
|
7016
|
+
name: {
|
|
7017
|
+
type: 'string',
|
|
7018
|
+
description: 'Platform name'
|
|
7019
|
+
},
|
|
7020
|
+
url: {
|
|
7021
|
+
type: 'string',
|
|
7022
|
+
description: 'Platform URL'
|
|
7023
|
+
},
|
|
7024
|
+
type: {
|
|
7025
|
+
type: 'string',
|
|
7026
|
+
description: 'Platform type',
|
|
7027
|
+
enum: [
|
|
7028
|
+
'BANK',
|
|
7029
|
+
'BROKERAGE',
|
|
7030
|
+
'CRYPTO_EXCHANGE',
|
|
7031
|
+
'PAYMENT',
|
|
7032
|
+
'INVESTMENT',
|
|
7033
|
+
'INSURANCE',
|
|
7034
|
+
'OTHER'
|
|
7035
|
+
]
|
|
7036
|
+
},
|
|
7037
|
+
canonical: {
|
|
7038
|
+
type: 'string',
|
|
7039
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
7040
|
+
},
|
|
7041
|
+
suggestedSegment: {
|
|
7042
|
+
type: 'string',
|
|
7043
|
+
description:
|
|
7044
|
+
'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
|
|
7045
|
+
},
|
|
7046
|
+
logoUrl: {
|
|
7047
|
+
type: 'string',
|
|
7048
|
+
description: 'Logo URL',
|
|
7049
|
+
nullable: true
|
|
7050
|
+
},
|
|
7051
|
+
countryCode: {
|
|
7052
|
+
type: 'string',
|
|
7053
|
+
description: 'ISO 3166-1 alpha-2 (UPPERCASE); null = global platform',
|
|
7054
|
+
example: 'CN',
|
|
7055
|
+
nullable: true
|
|
7056
|
+
},
|
|
7057
|
+
category: {
|
|
7058
|
+
type: 'string',
|
|
7059
|
+
description:
|
|
7060
|
+
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
|
|
7061
|
+
nullable: true,
|
|
7062
|
+
example: 'DigitalWallet'
|
|
7063
|
+
},
|
|
7064
|
+
isBound: {
|
|
7065
|
+
type: 'boolean',
|
|
7066
|
+
description: 'Whether user has accounts using this platform'
|
|
7067
|
+
}
|
|
7068
|
+
},
|
|
7069
|
+
required: [
|
|
7070
|
+
'id',
|
|
7071
|
+
'name',
|
|
7072
|
+
'url',
|
|
7073
|
+
'type',
|
|
7074
|
+
'canonical',
|
|
7075
|
+
'suggestedSegment',
|
|
7076
|
+
'logoUrl',
|
|
7077
|
+
'countryCode',
|
|
7078
|
+
'category',
|
|
7079
|
+
'isBound'
|
|
7080
|
+
]
|
|
7081
|
+
} as const;
|
|
7082
|
+
|
|
7083
|
+
export const $PlatformMatchResultDto = {
|
|
7084
|
+
type: 'object',
|
|
7085
|
+
properties: {
|
|
7086
|
+
id: {
|
|
7087
|
+
type: 'string',
|
|
7088
|
+
description: 'Global platform ID'
|
|
7089
|
+
},
|
|
7090
|
+
name: {
|
|
7091
|
+
type: 'string',
|
|
7092
|
+
description: 'Platform name (e.g., "ICBC")'
|
|
7093
|
+
},
|
|
7094
|
+
canonical: {
|
|
7095
|
+
type: 'string',
|
|
7096
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
7097
|
+
},
|
|
7098
|
+
type: {
|
|
7099
|
+
type: 'string',
|
|
7100
|
+
description: 'Platform type',
|
|
7101
|
+
enum: [
|
|
7102
|
+
'BANK',
|
|
7103
|
+
'BROKERAGE',
|
|
7104
|
+
'CRYPTO_EXCHANGE',
|
|
7105
|
+
'PAYMENT',
|
|
7106
|
+
'INVESTMENT',
|
|
7107
|
+
'INSURANCE',
|
|
7108
|
+
'OTHER'
|
|
7109
|
+
]
|
|
7110
|
+
},
|
|
7111
|
+
suggestedSegment: {
|
|
7112
|
+
type: 'string',
|
|
7113
|
+
description:
|
|
7114
|
+
'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
|
|
7115
|
+
},
|
|
7116
|
+
logoUrl: {
|
|
7117
|
+
type: 'string',
|
|
7118
|
+
description: 'Logo URL',
|
|
7119
|
+
nullable: true
|
|
7120
|
+
},
|
|
7121
|
+
countryCode: {
|
|
7122
|
+
type: 'string',
|
|
7123
|
+
description: 'ISO 3166-1 alpha-2 (UPPERCASE); null = global platform',
|
|
7124
|
+
example: 'CN',
|
|
7125
|
+
nullable: true
|
|
7126
|
+
},
|
|
7127
|
+
category: {
|
|
7128
|
+
type: 'string',
|
|
7129
|
+
description:
|
|
7130
|
+
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
|
|
7131
|
+
nullable: true,
|
|
7132
|
+
example: 'DigitalWallet'
|
|
7133
|
+
},
|
|
7134
|
+
matchType: {
|
|
7135
|
+
type: 'string',
|
|
7136
|
+
description: "How this row matched: 'exact' > 'prefix' > 'substring'",
|
|
7137
|
+
enum: ['exact', 'prefix', 'substring']
|
|
7138
|
+
}
|
|
7139
|
+
},
|
|
7140
|
+
required: [
|
|
7141
|
+
'id',
|
|
7142
|
+
'name',
|
|
7143
|
+
'canonical',
|
|
7144
|
+
'type',
|
|
7145
|
+
'suggestedSegment',
|
|
7146
|
+
'logoUrl',
|
|
7147
|
+
'countryCode',
|
|
7148
|
+
'category',
|
|
7149
|
+
'matchType'
|
|
7150
|
+
]
|
|
7151
|
+
} as const;
|
|
7152
|
+
|
|
7153
|
+
export const $PlatformMatchResponseDto = {
|
|
7154
|
+
type: 'object',
|
|
7155
|
+
properties: {
|
|
7156
|
+
platforms: {
|
|
7157
|
+
description: 'Ranked matches, best tier first (at most 10 rows)',
|
|
7158
|
+
type: 'array',
|
|
7159
|
+
items: {
|
|
7160
|
+
$ref: '#/components/schemas/PlatformMatchResultDto'
|
|
7161
|
+
}
|
|
7162
|
+
},
|
|
7163
|
+
matchType: {
|
|
7164
|
+
type: 'string',
|
|
7165
|
+
description:
|
|
7166
|
+
"Overall match quality — top row's tier, or 'none' when no hits",
|
|
7167
|
+
enum: ['none', 'exact', 'prefix', 'substring']
|
|
7168
|
+
},
|
|
7169
|
+
total: {
|
|
7170
|
+
type: 'number',
|
|
7171
|
+
description: 'Total matches before LIMIT (truncation transparency)'
|
|
7172
|
+
},
|
|
7173
|
+
hasMore: {
|
|
7174
|
+
type: 'boolean',
|
|
7175
|
+
description: 'true when total > platforms.length (more matches exist)'
|
|
7176
|
+
}
|
|
7177
|
+
},
|
|
7178
|
+
required: ['platforms', 'matchType', 'total', 'hasMore']
|
|
7179
|
+
} as const;
|
|
7180
|
+
|
|
7181
|
+
export const $CreatePlatformDto = {
|
|
7182
|
+
type: 'object',
|
|
7183
|
+
properties: {
|
|
7184
|
+
name: {
|
|
7185
|
+
type: 'string',
|
|
7186
|
+
description: 'Platform name',
|
|
7187
|
+
example: 'Binance'
|
|
7188
|
+
},
|
|
7189
|
+
canonical: {
|
|
7190
|
+
type: 'string',
|
|
7191
|
+
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
7192
|
+
example: 'binance'
|
|
7193
|
+
},
|
|
7194
|
+
aliases: {
|
|
7195
|
+
description: 'Platform aliases (multi-language names for lookup)',
|
|
7196
|
+
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
7197
|
+
type: 'array',
|
|
7198
|
+
items: {
|
|
7199
|
+
type: 'string'
|
|
7200
|
+
}
|
|
7201
|
+
},
|
|
7202
|
+
url: {
|
|
7203
|
+
type: 'string',
|
|
7204
|
+
description: 'Platform URL',
|
|
7205
|
+
example: 'https://www.binance.com'
|
|
7206
|
+
},
|
|
7207
|
+
type: {
|
|
7208
|
+
type: 'string',
|
|
7209
|
+
description: 'Platform type',
|
|
7210
|
+
enum: [
|
|
7211
|
+
'BANK',
|
|
7212
|
+
'BROKERAGE',
|
|
7213
|
+
'CRYPTO_EXCHANGE',
|
|
7214
|
+
'PAYMENT',
|
|
7215
|
+
'INVESTMENT',
|
|
7216
|
+
'INSURANCE',
|
|
7217
|
+
'OTHER'
|
|
7218
|
+
],
|
|
7219
|
+
example: 'CRYPTO_EXCHANGE'
|
|
7220
|
+
},
|
|
7221
|
+
logoUrl: {
|
|
7222
|
+
type: 'string',
|
|
7223
|
+
description: 'Platform logo URL',
|
|
7224
|
+
example: 'https://example.com/logos/binance.png'
|
|
5511
7225
|
},
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
{
|
|
5517
|
-
$ref: '#/components/schemas/NlpDefaultAccountsDto'
|
|
5518
|
-
}
|
|
5519
|
-
]
|
|
7226
|
+
isActive: {
|
|
7227
|
+
type: 'boolean',
|
|
7228
|
+
description: 'Whether the platform is active',
|
|
7229
|
+
default: true
|
|
5520
7230
|
}
|
|
5521
7231
|
},
|
|
5522
|
-
required: ['
|
|
7232
|
+
required: ['name', 'canonical', 'aliases', 'url', 'type']
|
|
5523
7233
|
} as const;
|
|
5524
7234
|
|
|
5525
|
-
export const $
|
|
7235
|
+
export const $UpdatePlatformDto = {
|
|
5526
7236
|
type: 'object',
|
|
5527
7237
|
properties: {
|
|
5528
|
-
|
|
7238
|
+
name: {
|
|
5529
7239
|
type: 'string',
|
|
5530
|
-
description: '
|
|
5531
|
-
example: '
|
|
7240
|
+
description: 'Platform name',
|
|
7241
|
+
example: 'Binance'
|
|
5532
7242
|
},
|
|
5533
|
-
|
|
7243
|
+
canonical: {
|
|
5534
7244
|
type: 'string',
|
|
5535
|
-
description: '
|
|
5536
|
-
example: '
|
|
7245
|
+
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
7246
|
+
example: 'binance'
|
|
7247
|
+
},
|
|
7248
|
+
aliases: {
|
|
7249
|
+
description: 'Platform aliases (multi-language names for lookup)',
|
|
7250
|
+
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
7251
|
+
type: 'array',
|
|
7252
|
+
items: {
|
|
7253
|
+
type: 'string'
|
|
7254
|
+
}
|
|
7255
|
+
},
|
|
7256
|
+
url: {
|
|
7257
|
+
type: 'string',
|
|
7258
|
+
description: 'Platform URL',
|
|
7259
|
+
example: 'https://www.binance.com'
|
|
7260
|
+
},
|
|
7261
|
+
type: {
|
|
7262
|
+
type: 'string',
|
|
7263
|
+
description: 'Platform type',
|
|
7264
|
+
enum: [
|
|
7265
|
+
'BANK',
|
|
7266
|
+
'BROKERAGE',
|
|
7267
|
+
'CRYPTO_EXCHANGE',
|
|
7268
|
+
'PAYMENT',
|
|
7269
|
+
'INVESTMENT',
|
|
7270
|
+
'INSURANCE',
|
|
7271
|
+
'OTHER'
|
|
7272
|
+
],
|
|
7273
|
+
example: 'CRYPTO_EXCHANGE'
|
|
7274
|
+
},
|
|
7275
|
+
logoUrl: {
|
|
7276
|
+
type: 'string',
|
|
7277
|
+
description: 'Platform logo URL',
|
|
7278
|
+
example: 'https://example.com/logos/binance.png'
|
|
7279
|
+
},
|
|
7280
|
+
isActive: {
|
|
7281
|
+
type: 'boolean',
|
|
7282
|
+
description: 'Whether the platform is active'
|
|
5537
7283
|
}
|
|
5538
|
-
}
|
|
5539
|
-
required: ['currency', 'balance']
|
|
7284
|
+
}
|
|
5540
7285
|
} as const;
|
|
5541
7286
|
|
|
5542
7287
|
export const $NetWorthByCurrencyDto = {
|
|
@@ -5608,28 +7353,6 @@ export const $ConvertedNetWorthDto = {
|
|
|
5608
7353
|
]
|
|
5609
7354
|
} as const;
|
|
5610
7355
|
|
|
5611
|
-
export const $ExchangeRateWarningDto = {
|
|
5612
|
-
type: 'object',
|
|
5613
|
-
properties: {
|
|
5614
|
-
type: {
|
|
5615
|
-
type: 'string',
|
|
5616
|
-
description: 'Warning type',
|
|
5617
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
5618
|
-
},
|
|
5619
|
-
currency: {
|
|
5620
|
-
type: 'string',
|
|
5621
|
-
description: 'Currency without exchange rate',
|
|
5622
|
-
example: 'EUR'
|
|
5623
|
-
},
|
|
5624
|
-
totalAmount: {
|
|
5625
|
-
type: 'string',
|
|
5626
|
-
description: 'Total amount affected',
|
|
5627
|
-
example: '1000.00'
|
|
5628
|
-
}
|
|
5629
|
-
},
|
|
5630
|
-
required: ['type', 'currency', 'totalAmount']
|
|
5631
|
-
} as const;
|
|
5632
|
-
|
|
5633
7356
|
export const $NetWorthResponseDto = {
|
|
5634
7357
|
type: 'object',
|
|
5635
7358
|
properties: {
|
|
@@ -5715,7 +7438,7 @@ export const $AccountItemDto = {
|
|
|
5715
7438
|
name: {
|
|
5716
7439
|
type: 'string',
|
|
5717
7440
|
description: 'Full account name',
|
|
5718
|
-
example: 'Assets:
|
|
7441
|
+
example: 'Assets:CN:CMB:Savings'
|
|
5719
7442
|
},
|
|
5720
7443
|
displayName: {
|
|
5721
7444
|
type: 'string',
|
|
@@ -5731,6 +7454,12 @@ export const $AccountItemDto = {
|
|
|
5731
7454
|
type: 'string',
|
|
5732
7455
|
description: 'Currency code',
|
|
5733
7456
|
example: 'CNY'
|
|
7457
|
+
},
|
|
7458
|
+
convertedBalance: {
|
|
7459
|
+
type: 'string',
|
|
7460
|
+
description:
|
|
7461
|
+
'FX-converted balance in base currency; omitted when not convertible',
|
|
7462
|
+
example: '50000.00'
|
|
5734
7463
|
}
|
|
5735
7464
|
},
|
|
5736
7465
|
required: ['id', 'name', 'displayName', 'balance', 'currency']
|
|
@@ -5757,11 +7486,66 @@ export const $PlatformGroupDto = {
|
|
|
5757
7486
|
},
|
|
5758
7487
|
totalBalance: {
|
|
5759
7488
|
type: 'string',
|
|
5760
|
-
description: '
|
|
7489
|
+
description: 'FX-converted total balance in base currency',
|
|
7490
|
+
example: '100000.00'
|
|
7491
|
+
},
|
|
7492
|
+
balanceByCurrency: {
|
|
7493
|
+
description: 'Raw (unconverted) balances grouped by currency',
|
|
7494
|
+
type: 'array',
|
|
7495
|
+
items: {
|
|
7496
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
7497
|
+
}
|
|
7498
|
+
},
|
|
7499
|
+
convertedBalance: {
|
|
7500
|
+
type: 'string',
|
|
7501
|
+
description:
|
|
7502
|
+
'Converted balance in base currency (omitted when no currency is convertible)',
|
|
5761
7503
|
example: '100000.00'
|
|
7504
|
+
},
|
|
7505
|
+
sharePct: {
|
|
7506
|
+
type: 'number',
|
|
7507
|
+
description:
|
|
7508
|
+
'Share of the grand converted total (0-100); 0 when grand total is 0',
|
|
7509
|
+
example: 42.5
|
|
7510
|
+
}
|
|
7511
|
+
},
|
|
7512
|
+
required: [
|
|
7513
|
+
'platformId',
|
|
7514
|
+
'platformName',
|
|
7515
|
+
'accounts',
|
|
7516
|
+
'totalBalance',
|
|
7517
|
+
'balanceByCurrency',
|
|
7518
|
+
'sharePct'
|
|
7519
|
+
]
|
|
7520
|
+
} as const;
|
|
7521
|
+
|
|
7522
|
+
export const $AccountExchangeRateWarningDto = {
|
|
7523
|
+
type: 'object',
|
|
7524
|
+
properties: {
|
|
7525
|
+
type: {
|
|
7526
|
+
type: 'string',
|
|
7527
|
+
description: 'Warning type',
|
|
7528
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
7529
|
+
},
|
|
7530
|
+
currency: {
|
|
7531
|
+
type: 'string',
|
|
7532
|
+
description: 'Currency without exchange rate',
|
|
7533
|
+
example: 'USD'
|
|
7534
|
+
},
|
|
7535
|
+
accounts: {
|
|
7536
|
+
description: 'Affected account paths',
|
|
7537
|
+
type: 'array',
|
|
7538
|
+
items: {
|
|
7539
|
+
type: 'string'
|
|
7540
|
+
}
|
|
7541
|
+
},
|
|
7542
|
+
totalAmount: {
|
|
7543
|
+
type: 'string',
|
|
7544
|
+
description: 'Total amount in this currency',
|
|
7545
|
+
example: '5000.00'
|
|
5762
7546
|
}
|
|
5763
7547
|
},
|
|
5764
|
-
required: ['
|
|
7548
|
+
required: ['type', 'currency', 'accounts', 'totalAmount']
|
|
5765
7549
|
} as const;
|
|
5766
7550
|
|
|
5767
7551
|
export const $AccountsSummaryDto = {
|
|
@@ -5774,9 +7558,21 @@ export const $AccountsSummaryDto = {
|
|
|
5774
7558
|
totalPlatforms: {
|
|
5775
7559
|
type: 'number',
|
|
5776
7560
|
description: 'Total number of platforms'
|
|
7561
|
+
},
|
|
7562
|
+
baseCurrency: {
|
|
7563
|
+
type: 'string',
|
|
7564
|
+
description: 'Base currency for conversion',
|
|
7565
|
+
example: 'CNY'
|
|
7566
|
+
},
|
|
7567
|
+
warnings: {
|
|
7568
|
+
description: 'Per-account exchange rate warnings',
|
|
7569
|
+
type: 'array',
|
|
7570
|
+
items: {
|
|
7571
|
+
$ref: '#/components/schemas/AccountExchangeRateWarningDto'
|
|
7572
|
+
}
|
|
5777
7573
|
}
|
|
5778
7574
|
},
|
|
5779
|
-
required: ['totalAccounts', 'totalPlatforms']
|
|
7575
|
+
required: ['totalAccounts', 'totalPlatforms', 'baseCurrency']
|
|
5780
7576
|
} as const;
|
|
5781
7577
|
|
|
5782
7578
|
export const $AccountsResponseDto = {
|
|
@@ -5811,7 +7607,7 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
5811
7607
|
name: {
|
|
5812
7608
|
type: 'string',
|
|
5813
7609
|
description: 'Full account name',
|
|
5814
|
-
example: 'Assets:
|
|
7610
|
+
example: 'Assets:CN:CMB:Savings'
|
|
5815
7611
|
},
|
|
5816
7612
|
displayName: {
|
|
5817
7613
|
type: 'string',
|
|
@@ -5828,6 +7624,12 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
5828
7624
|
description: 'Currency code',
|
|
5829
7625
|
example: 'CNY'
|
|
5830
7626
|
},
|
|
7627
|
+
convertedBalance: {
|
|
7628
|
+
type: 'string',
|
|
7629
|
+
description:
|
|
7630
|
+
'FX-converted balance in base currency; omitted when not convertible',
|
|
7631
|
+
example: '50000.00'
|
|
7632
|
+
},
|
|
5831
7633
|
assetClass: {
|
|
5832
7634
|
type: 'string',
|
|
5833
7635
|
description: 'Asset class',
|
|
@@ -5847,6 +7649,12 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
5847
7649
|
type: 'string',
|
|
5848
7650
|
description: 'Risk level',
|
|
5849
7651
|
example: 'LOW'
|
|
7652
|
+
},
|
|
7653
|
+
source: {
|
|
7654
|
+
type: 'string',
|
|
7655
|
+
description:
|
|
7656
|
+
'ADR-0105 classification provenance (holding level always; account level only on FALLBACK)',
|
|
7657
|
+
enum: ['USER_META', 'FIAT_CURRENCY', 'OPENBB_MAPPING', 'FALLBACK']
|
|
5850
7658
|
}
|
|
5851
7659
|
},
|
|
5852
7660
|
required: ['id', 'name', 'displayName', 'balance', 'currency', 'assetClass']
|
|
@@ -5901,82 +7709,154 @@ export const $AssetClassGroupDto = {
|
|
|
5901
7709
|
required: ['assetClass', 'accounts', 'balanceByCurrency']
|
|
5902
7710
|
} as const;
|
|
5903
7711
|
|
|
5904
|
-
export const $
|
|
7712
|
+
export const $AssetClassSummaryDto = {
|
|
5905
7713
|
type: 'object',
|
|
5906
7714
|
properties: {
|
|
5907
|
-
|
|
5908
|
-
type: '
|
|
5909
|
-
description: '
|
|
5910
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
7715
|
+
totalAccounts: {
|
|
7716
|
+
type: 'number',
|
|
7717
|
+
description: 'Total number of accounts'
|
|
5911
7718
|
},
|
|
5912
|
-
|
|
7719
|
+
totalAssetClasses: {
|
|
7720
|
+
type: 'number',
|
|
7721
|
+
description: 'Total number of asset classes'
|
|
7722
|
+
},
|
|
7723
|
+
baseCurrency: {
|
|
5913
7724
|
type: 'string',
|
|
5914
|
-
description: '
|
|
5915
|
-
example: '
|
|
7725
|
+
description: 'Base currency for conversion',
|
|
7726
|
+
example: 'CNY'
|
|
5916
7727
|
},
|
|
5917
|
-
|
|
5918
|
-
description: '
|
|
7728
|
+
warnings: {
|
|
7729
|
+
description: 'Exchange rate warnings',
|
|
5919
7730
|
type: 'array',
|
|
5920
7731
|
items: {
|
|
5921
|
-
|
|
7732
|
+
$ref: '#/components/schemas/AccountExchangeRateWarningDto'
|
|
5922
7733
|
}
|
|
5923
7734
|
},
|
|
5924
|
-
|
|
5925
|
-
type: '
|
|
5926
|
-
description:
|
|
5927
|
-
|
|
7735
|
+
fallback: {
|
|
7736
|
+
type: 'object',
|
|
7737
|
+
description:
|
|
7738
|
+
'ADR-0105 §4 fallback provenance stats (holding level only). valueRatio is the grey-area share of total converted value; count is the number of source=FALLBACK holdings.'
|
|
5928
7739
|
}
|
|
5929
7740
|
},
|
|
5930
|
-
required: ['
|
|
7741
|
+
required: ['totalAccounts', 'totalAssetClasses', 'baseCurrency']
|
|
5931
7742
|
} as const;
|
|
5932
7743
|
|
|
5933
|
-
export const $
|
|
7744
|
+
export const $AssetClassAccountsResponseDto = {
|
|
5934
7745
|
type: 'object',
|
|
5935
7746
|
properties: {
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
7747
|
+
groups: {
|
|
7748
|
+
description: 'Account groups by asset class',
|
|
7749
|
+
type: 'array',
|
|
7750
|
+
items: {
|
|
7751
|
+
$ref: '#/components/schemas/AssetClassGroupDto'
|
|
7752
|
+
}
|
|
7753
|
+
},
|
|
7754
|
+
summary: {
|
|
7755
|
+
description: 'Summary statistics',
|
|
7756
|
+
allOf: [
|
|
7757
|
+
{
|
|
7758
|
+
$ref: '#/components/schemas/AssetClassSummaryDto'
|
|
7759
|
+
}
|
|
7760
|
+
]
|
|
7761
|
+
},
|
|
7762
|
+
uncategorized: {
|
|
7763
|
+
description:
|
|
7764
|
+
'ADR-0105 §6 holding-level grey-area bucket (source=FALLBACK holdings peeled out of groups). Present only for groupBy=holdingAssetClass when FALLBACK holdings exist.',
|
|
7765
|
+
allOf: [
|
|
7766
|
+
{
|
|
7767
|
+
$ref: '#/components/schemas/AssetClassGroupDto'
|
|
7768
|
+
}
|
|
7769
|
+
]
|
|
7770
|
+
}
|
|
7771
|
+
},
|
|
7772
|
+
required: ['groups', 'summary']
|
|
7773
|
+
} as const;
|
|
7774
|
+
|
|
7775
|
+
export const $HoldingAssetClassAccountSliceDto = {
|
|
7776
|
+
type: 'object',
|
|
7777
|
+
properties: {
|
|
7778
|
+
accountId: {
|
|
7779
|
+
type: 'string',
|
|
7780
|
+
description: 'Account ID'
|
|
7781
|
+
},
|
|
7782
|
+
accountPath: {
|
|
7783
|
+
type: 'string',
|
|
7784
|
+
description: 'Full account path',
|
|
7785
|
+
example: 'Assets:US:Fidelity:Brokerage'
|
|
7786
|
+
},
|
|
7787
|
+
accountCurrency: {
|
|
7788
|
+
type: 'string',
|
|
7789
|
+
description:
|
|
7790
|
+
'Currency of the holding with the largest converted base value; undefined when no holding is convertible',
|
|
7791
|
+
example: 'USD'
|
|
7792
|
+
},
|
|
7793
|
+
marketValueBase: {
|
|
7794
|
+
type: 'string',
|
|
7795
|
+
description:
|
|
7796
|
+
"Account's market value in base currency (Σ converted holdings; grey bucket included)",
|
|
7797
|
+
example: '50000.00'
|
|
5939
7798
|
},
|
|
5940
|
-
|
|
7799
|
+
shareOfTotalPct: {
|
|
5941
7800
|
type: 'number',
|
|
5942
|
-
description:
|
|
7801
|
+
description:
|
|
7802
|
+
'Share of the global total (0-100). 0 when globalTotal is zero (no NaN/Infinity).',
|
|
7803
|
+
example: 42.5
|
|
5943
7804
|
},
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
7805
|
+
groups: {
|
|
7806
|
+
description: 'Per-account asset-class breakdown',
|
|
7807
|
+
type: 'array',
|
|
7808
|
+
items: {
|
|
7809
|
+
$ref: '#/components/schemas/AssetClassGroupDto'
|
|
7810
|
+
}
|
|
5948
7811
|
},
|
|
5949
|
-
|
|
5950
|
-
description:
|
|
7812
|
+
uncategorized: {
|
|
7813
|
+
description:
|
|
7814
|
+
'Per-account grey bucket (source=FALLBACK holdings, incl. broker cash)',
|
|
7815
|
+
allOf: [
|
|
7816
|
+
{
|
|
7817
|
+
$ref: '#/components/schemas/AssetClassGroupDto'
|
|
7818
|
+
}
|
|
7819
|
+
]
|
|
7820
|
+
},
|
|
7821
|
+
holdings: {
|
|
7822
|
+
description:
|
|
7823
|
+
'Every holding row for this account (account ID in each row’s `id` field)',
|
|
5951
7824
|
type: 'array',
|
|
5952
7825
|
items: {
|
|
5953
|
-
$ref: '#/components/schemas/
|
|
7826
|
+
$ref: '#/components/schemas/AccountItemWithAssetClassDto'
|
|
5954
7827
|
}
|
|
5955
7828
|
}
|
|
5956
7829
|
},
|
|
5957
|
-
required: [
|
|
7830
|
+
required: [
|
|
7831
|
+
'accountId',
|
|
7832
|
+
'accountPath',
|
|
7833
|
+
'marketValueBase',
|
|
7834
|
+
'shareOfTotalPct',
|
|
7835
|
+
'groups',
|
|
7836
|
+
'holdings'
|
|
7837
|
+
]
|
|
5958
7838
|
} as const;
|
|
5959
7839
|
|
|
5960
|
-
export const $
|
|
7840
|
+
export const $HoldingAssetClassCrossAccountResponseDto = {
|
|
5961
7841
|
type: 'object',
|
|
5962
7842
|
properties: {
|
|
5963
|
-
|
|
5964
|
-
description: '
|
|
5965
|
-
type: 'array',
|
|
5966
|
-
items: {
|
|
5967
|
-
$ref: '#/components/schemas/AssetClassGroupDto'
|
|
5968
|
-
}
|
|
5969
|
-
},
|
|
5970
|
-
summary: {
|
|
5971
|
-
description: 'Summary statistics',
|
|
7843
|
+
global: {
|
|
7844
|
+
description: 'Merged cross-account holding aggregation',
|
|
5972
7845
|
allOf: [
|
|
5973
7846
|
{
|
|
5974
|
-
$ref: '#/components/schemas/
|
|
7847
|
+
$ref: '#/components/schemas/AssetClassAccountsResponseDto'
|
|
5975
7848
|
}
|
|
5976
7849
|
]
|
|
7850
|
+
},
|
|
7851
|
+
byAccount: {
|
|
7852
|
+
description: 'Per-account slices',
|
|
7853
|
+
type: 'array',
|
|
7854
|
+
items: {
|
|
7855
|
+
$ref: '#/components/schemas/HoldingAssetClassAccountSliceDto'
|
|
7856
|
+
}
|
|
5977
7857
|
}
|
|
5978
7858
|
},
|
|
5979
|
-
required: ['
|
|
7859
|
+
required: ['global', 'byAccount']
|
|
5980
7860
|
} as const;
|
|
5981
7861
|
|
|
5982
7862
|
export const $CashFlowByCurrencyDto = {
|
|
@@ -6078,207 +7958,582 @@ export const $CashFlowResponseDto = {
|
|
|
6078
7958
|
description: 'Cash flow grouped by original currency',
|
|
6079
7959
|
allOf: [
|
|
6080
7960
|
{
|
|
6081
|
-
$ref: '#/components/schemas/CashFlowByCurrencyDto'
|
|
7961
|
+
$ref: '#/components/schemas/CashFlowByCurrencyDto'
|
|
7962
|
+
}
|
|
7963
|
+
]
|
|
7964
|
+
},
|
|
7965
|
+
converted: {
|
|
7966
|
+
description: 'Converted values in base currency',
|
|
7967
|
+
allOf: [
|
|
7968
|
+
{
|
|
7969
|
+
$ref: '#/components/schemas/ConvertedCashFlowDto'
|
|
7970
|
+
}
|
|
7971
|
+
]
|
|
7972
|
+
},
|
|
7973
|
+
warnings: {
|
|
7974
|
+
description: 'Exchange rate warnings',
|
|
7975
|
+
type: 'array',
|
|
7976
|
+
items: {
|
|
7977
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
7978
|
+
}
|
|
7979
|
+
}
|
|
7980
|
+
},
|
|
7981
|
+
required: [
|
|
7982
|
+
'period',
|
|
7983
|
+
'income',
|
|
7984
|
+
'expense',
|
|
7985
|
+
'netSavings',
|
|
7986
|
+
'savingsRate',
|
|
7987
|
+
'currency'
|
|
7988
|
+
]
|
|
7989
|
+
} as const;
|
|
7990
|
+
|
|
7991
|
+
export const $CategoryGroupDto = {
|
|
7992
|
+
type: 'object',
|
|
7993
|
+
properties: {
|
|
7994
|
+
category: {
|
|
7995
|
+
type: 'string',
|
|
7996
|
+
description:
|
|
7997
|
+
'Functional category (account-path Group segment); regional and universal account paths merge under it',
|
|
7998
|
+
example: 'Food'
|
|
7999
|
+
},
|
|
8000
|
+
totalExpense: {
|
|
8001
|
+
type: 'string',
|
|
8002
|
+
description:
|
|
8003
|
+
'Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)',
|
|
8004
|
+
example: '1200.00'
|
|
8005
|
+
},
|
|
8006
|
+
sharePct: {
|
|
8007
|
+
type: 'number',
|
|
8008
|
+
description: 'Share of grand total (0-100); 0 when grand total is 0',
|
|
8009
|
+
example: 42.5
|
|
8010
|
+
},
|
|
8011
|
+
balanceByCurrency: {
|
|
8012
|
+
description: 'Raw (unconverted) expense per currency',
|
|
8013
|
+
type: 'array',
|
|
8014
|
+
items: {
|
|
8015
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
8016
|
+
}
|
|
8017
|
+
},
|
|
8018
|
+
convertedBalance: {
|
|
8019
|
+
type: 'string',
|
|
8020
|
+
description:
|
|
8021
|
+
'Converted total in base currency (omitted when FX missing for all currencies in this category)',
|
|
8022
|
+
example: '1200.00'
|
|
8023
|
+
}
|
|
8024
|
+
},
|
|
8025
|
+
required: ['category', 'totalExpense', 'sharePct', 'balanceByCurrency']
|
|
8026
|
+
} as const;
|
|
8027
|
+
|
|
8028
|
+
export const $ExpensesByCategorySummaryDto = {
|
|
8029
|
+
type: 'object',
|
|
8030
|
+
properties: {
|
|
8031
|
+
totalExpense: {
|
|
8032
|
+
type: 'string',
|
|
8033
|
+
description:
|
|
8034
|
+
'Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income',
|
|
8035
|
+
example: '5000.00'
|
|
8036
|
+
},
|
|
8037
|
+
categoryCount: {
|
|
8038
|
+
type: 'number',
|
|
8039
|
+
description: 'Number of categories',
|
|
8040
|
+
example: 8
|
|
8041
|
+
}
|
|
8042
|
+
},
|
|
8043
|
+
required: ['totalExpense', 'categoryCount']
|
|
8044
|
+
} as const;
|
|
8045
|
+
|
|
8046
|
+
export const $ExpensesByCategoryResponseDto = {
|
|
8047
|
+
type: 'object',
|
|
8048
|
+
properties: {
|
|
8049
|
+
period: {
|
|
8050
|
+
type: 'string',
|
|
8051
|
+
description: 'Period requested',
|
|
8052
|
+
example: '1m'
|
|
8053
|
+
},
|
|
8054
|
+
baseCurrency: {
|
|
8055
|
+
type: 'string',
|
|
8056
|
+
description: 'Base currency for converted values',
|
|
8057
|
+
example: 'CNY'
|
|
8058
|
+
},
|
|
8059
|
+
groups: {
|
|
8060
|
+
description:
|
|
8061
|
+
'Expense groups by functional category, sorted by converted total desc',
|
|
8062
|
+
type: 'array',
|
|
8063
|
+
items: {
|
|
8064
|
+
$ref: '#/components/schemas/CategoryGroupDto'
|
|
8065
|
+
}
|
|
8066
|
+
},
|
|
8067
|
+
summary: {
|
|
8068
|
+
description: 'Summary statistics',
|
|
8069
|
+
allOf: [
|
|
8070
|
+
{
|
|
8071
|
+
$ref: '#/components/schemas/ExpensesByCategorySummaryDto'
|
|
8072
|
+
}
|
|
8073
|
+
]
|
|
8074
|
+
},
|
|
8075
|
+
warnings: {
|
|
8076
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
8077
|
+
type: 'array',
|
|
8078
|
+
items: {
|
|
8079
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
8080
|
+
}
|
|
8081
|
+
}
|
|
8082
|
+
},
|
|
8083
|
+
required: ['period', 'baseCurrency', 'groups', 'summary']
|
|
8084
|
+
} as const;
|
|
8085
|
+
|
|
8086
|
+
export const $MonetaryDto = {
|
|
8087
|
+
type: 'object',
|
|
8088
|
+
properties: {
|
|
8089
|
+
amount: {
|
|
8090
|
+
type: 'string',
|
|
8091
|
+
description: 'Amount (Decimal string)',
|
|
8092
|
+
example: '3000'
|
|
8093
|
+
},
|
|
8094
|
+
currency: {
|
|
8095
|
+
type: 'string',
|
|
8096
|
+
description: 'ISO 4217 currency',
|
|
8097
|
+
example: 'USD'
|
|
8098
|
+
},
|
|
8099
|
+
baseCcyEquivalent: {
|
|
8100
|
+
type: 'object',
|
|
8101
|
+
description: 'Converted to user base currency (Decimal string)',
|
|
8102
|
+
example: '21600',
|
|
8103
|
+
nullable: true
|
|
8104
|
+
}
|
|
8105
|
+
},
|
|
8106
|
+
required: ['amount', 'currency']
|
|
8107
|
+
} as const;
|
|
8108
|
+
|
|
8109
|
+
export const $CurrentPriceDto = {
|
|
8110
|
+
type: 'object',
|
|
8111
|
+
properties: {
|
|
8112
|
+
amount: {
|
|
8113
|
+
type: 'string',
|
|
8114
|
+
description: 'Price amount (Decimal string)',
|
|
8115
|
+
example: '250'
|
|
8116
|
+
},
|
|
8117
|
+
currency: {
|
|
8118
|
+
type: 'string',
|
|
8119
|
+
description: 'Price currency (ISO 4217)',
|
|
8120
|
+
example: 'USD'
|
|
8121
|
+
},
|
|
8122
|
+
date: {
|
|
8123
|
+
type: 'string',
|
|
8124
|
+
description: 'Price date (ISO 8601)',
|
|
8125
|
+
example: '2024-06-01'
|
|
8126
|
+
},
|
|
8127
|
+
source: {
|
|
8128
|
+
type: 'string',
|
|
8129
|
+
description: 'Price source',
|
|
8130
|
+
example: 'USER_OVERRIDE',
|
|
8131
|
+
enum: ['USER_OVERRIDE', 'OPENBB_EQUITY', 'OPENBB_CURRENCY']
|
|
8132
|
+
}
|
|
8133
|
+
},
|
|
8134
|
+
required: ['amount', 'currency', 'date', 'source']
|
|
8135
|
+
} as const;
|
|
8136
|
+
|
|
8137
|
+
export const $FxRateDto = {
|
|
8138
|
+
type: 'object',
|
|
8139
|
+
properties: {
|
|
8140
|
+
from: {
|
|
8141
|
+
type: 'string',
|
|
8142
|
+
example: 'USD'
|
|
8143
|
+
},
|
|
8144
|
+
to: {
|
|
8145
|
+
type: 'string',
|
|
8146
|
+
example: 'CNY'
|
|
8147
|
+
},
|
|
8148
|
+
rate: {
|
|
8149
|
+
type: 'string',
|
|
8150
|
+
description: 'FX rate (Decimal string)',
|
|
8151
|
+
example: '7.2'
|
|
8152
|
+
},
|
|
8153
|
+
date: {
|
|
8154
|
+
type: 'string',
|
|
8155
|
+
description: 'Rate date (ISO 8601)',
|
|
8156
|
+
example: '2024-01-15'
|
|
8157
|
+
}
|
|
8158
|
+
},
|
|
8159
|
+
required: ['from', 'to', 'rate', 'date']
|
|
8160
|
+
} as const;
|
|
8161
|
+
|
|
8162
|
+
export const $HoldingPnlRowDto = {
|
|
8163
|
+
type: 'object',
|
|
8164
|
+
properties: {
|
|
8165
|
+
accountId: {
|
|
8166
|
+
type: 'string',
|
|
8167
|
+
description: 'Account UUID',
|
|
8168
|
+
example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
|
|
8169
|
+
},
|
|
8170
|
+
accountPath: {
|
|
8171
|
+
type: 'string',
|
|
8172
|
+
description: 'Full account path',
|
|
8173
|
+
example: 'Assets:US:Broker:AAPL'
|
|
8174
|
+
},
|
|
8175
|
+
accountCcy: {
|
|
8176
|
+
type: 'object',
|
|
8177
|
+
description: 'Account settlement currency (ISO 4217), from cost currency',
|
|
8178
|
+
nullable: true,
|
|
8179
|
+
example: 'USD'
|
|
8180
|
+
},
|
|
8181
|
+
brokerType: {
|
|
8182
|
+
type: 'object',
|
|
8183
|
+
description: 'Broker type derived from Platform.type',
|
|
8184
|
+
nullable: true,
|
|
8185
|
+
example: 'broker'
|
|
8186
|
+
},
|
|
8187
|
+
symbol: {
|
|
8188
|
+
type: 'string',
|
|
8189
|
+
description: 'Commodity symbol',
|
|
8190
|
+
example: 'AAPL'
|
|
8191
|
+
},
|
|
8192
|
+
chartToken: {
|
|
8193
|
+
type: 'string',
|
|
8194
|
+
description: 'Chart segment token (libs/common resolver)',
|
|
8195
|
+
example: 'equity',
|
|
8196
|
+
enum: ['equity', 'fund', 'bond', 'cash', 'other']
|
|
8197
|
+
},
|
|
8198
|
+
assetClass: {
|
|
8199
|
+
type: 'string',
|
|
8200
|
+
example: 'EQUITY'
|
|
8201
|
+
},
|
|
8202
|
+
assetSubClass: {
|
|
8203
|
+
type: 'object',
|
|
8204
|
+
nullable: true,
|
|
8205
|
+
example: 'STOCK'
|
|
8206
|
+
},
|
|
8207
|
+
units: {
|
|
8208
|
+
type: 'string',
|
|
8209
|
+
description: 'Net held units (Decimal string)',
|
|
8210
|
+
example: '12'
|
|
8211
|
+
},
|
|
8212
|
+
averageCostPerUnit: {
|
|
8213
|
+
description:
|
|
8214
|
+
'Average cost per unit; null when cost currency conflicts or no cost',
|
|
8215
|
+
nullable: true,
|
|
8216
|
+
allOf: [
|
|
8217
|
+
{
|
|
8218
|
+
$ref: '#/components/schemas/MonetaryDto'
|
|
8219
|
+
}
|
|
8220
|
+
]
|
|
8221
|
+
},
|
|
8222
|
+
costBasis: {
|
|
8223
|
+
description: 'Cost basis of held units',
|
|
8224
|
+
nullable: true,
|
|
8225
|
+
allOf: [
|
|
8226
|
+
{
|
|
8227
|
+
$ref: '#/components/schemas/MonetaryDto'
|
|
8228
|
+
}
|
|
8229
|
+
]
|
|
8230
|
+
},
|
|
8231
|
+
marketValue: {
|
|
8232
|
+
description: 'Market value at asOf price',
|
|
8233
|
+
nullable: true,
|
|
8234
|
+
allOf: [
|
|
8235
|
+
{
|
|
8236
|
+
$ref: '#/components/schemas/MonetaryDto'
|
|
8237
|
+
}
|
|
8238
|
+
]
|
|
8239
|
+
},
|
|
8240
|
+
currentPrice: {
|
|
8241
|
+
description: 'Price used for market value',
|
|
8242
|
+
nullable: true,
|
|
8243
|
+
allOf: [
|
|
8244
|
+
{
|
|
8245
|
+
$ref: '#/components/schemas/CurrentPriceDto'
|
|
8246
|
+
}
|
|
8247
|
+
]
|
|
8248
|
+
},
|
|
8249
|
+
unrealizedPnlBase: {
|
|
8250
|
+
type: 'object',
|
|
8251
|
+
description:
|
|
8252
|
+
'Unrealized P&L in base currency (Decimal string); null when any FX/price missing',
|
|
8253
|
+
nullable: true,
|
|
8254
|
+
example: '6000'
|
|
8255
|
+
},
|
|
8256
|
+
unrealizedPnlPct: {
|
|
8257
|
+
type: 'object',
|
|
8258
|
+
description: 'Unrealized P&L % (Decimal string)',
|
|
8259
|
+
nullable: true,
|
|
8260
|
+
example: '25'
|
|
8261
|
+
},
|
|
8262
|
+
costFxRate: {
|
|
8263
|
+
description: 'Historical FX rate applied to cost basis',
|
|
8264
|
+
nullable: true,
|
|
8265
|
+
allOf: [
|
|
8266
|
+
{
|
|
8267
|
+
$ref: '#/components/schemas/FxRateDto'
|
|
6082
8268
|
}
|
|
6083
8269
|
]
|
|
6084
8270
|
},
|
|
6085
|
-
|
|
6086
|
-
description: '
|
|
8271
|
+
marketFxRate: {
|
|
8272
|
+
description: 'FX rate applied to market value',
|
|
8273
|
+
nullable: true,
|
|
6087
8274
|
allOf: [
|
|
6088
8275
|
{
|
|
6089
|
-
$ref: '#/components/schemas/
|
|
8276
|
+
$ref: '#/components/schemas/FxRateDto'
|
|
6090
8277
|
}
|
|
6091
8278
|
]
|
|
6092
8279
|
},
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
8280
|
+
pctOfInvestedAssets: {
|
|
8281
|
+
type: 'object',
|
|
8282
|
+
description:
|
|
8283
|
+
'Share of invested assets % (Decimal string); only for invested chartTokens',
|
|
8284
|
+
nullable: true,
|
|
8285
|
+
example: '40'
|
|
8286
|
+
},
|
|
8287
|
+
realizedPnl: {
|
|
8288
|
+
description:
|
|
8289
|
+
'Cumulative realized P&L on sold lots (asOf-date cutoff); null when the method has no applicable sells, a sell lacks a price, or any required FX rate is missing (never-mix). When a sell spans multiple currencies (cross-currency sale), amount and currency reflect the base currency; baseCcyEquivalent is always the authoritative dual-FX figure',
|
|
8290
|
+
nullable: true,
|
|
8291
|
+
allOf: [
|
|
8292
|
+
{
|
|
8293
|
+
$ref: '#/components/schemas/MonetaryDto'
|
|
8294
|
+
}
|
|
8295
|
+
]
|
|
6099
8296
|
}
|
|
6100
8297
|
},
|
|
6101
8298
|
required: [
|
|
6102
|
-
'
|
|
6103
|
-
'
|
|
6104
|
-
'
|
|
6105
|
-
'
|
|
6106
|
-
'
|
|
6107
|
-
'
|
|
8299
|
+
'accountId',
|
|
8300
|
+
'accountPath',
|
|
8301
|
+
'symbol',
|
|
8302
|
+
'chartToken',
|
|
8303
|
+
'assetClass',
|
|
8304
|
+
'units'
|
|
6108
8305
|
]
|
|
6109
8306
|
} as const;
|
|
6110
8307
|
|
|
6111
|
-
export const $
|
|
8308
|
+
export const $HoldingPnlWarningDto = {
|
|
6112
8309
|
type: 'object',
|
|
6113
8310
|
properties: {
|
|
6114
|
-
|
|
8311
|
+
type: {
|
|
6115
8312
|
type: 'string',
|
|
6116
|
-
description: '
|
|
6117
|
-
example: '
|
|
8313
|
+
description: 'Warning type',
|
|
8314
|
+
example: 'MISSING_COST_FX_RATE',
|
|
8315
|
+
enum: [
|
|
8316
|
+
'MISSING_COST_FX_RATE',
|
|
8317
|
+
'MISSING_MARKET_FX_RATE',
|
|
8318
|
+
'MISSING_SALE_PRICE',
|
|
8319
|
+
'MISSING_REALIZED_FX_RATE',
|
|
8320
|
+
'OVERSOLD_LOTS',
|
|
8321
|
+
'NO_PRICE',
|
|
8322
|
+
'MIXED_COST_CURRENCY'
|
|
8323
|
+
]
|
|
6118
8324
|
},
|
|
6119
|
-
|
|
6120
|
-
type: '
|
|
6121
|
-
|
|
6122
|
-
|
|
8325
|
+
symbol: {
|
|
8326
|
+
type: 'object',
|
|
8327
|
+
nullable: true
|
|
8328
|
+
},
|
|
8329
|
+
accountId: {
|
|
8330
|
+
type: 'object',
|
|
8331
|
+
nullable: true
|
|
8332
|
+
},
|
|
8333
|
+
currency: {
|
|
8334
|
+
type: 'object',
|
|
8335
|
+
nullable: true
|
|
6123
8336
|
}
|
|
6124
8337
|
},
|
|
6125
|
-
required: ['
|
|
8338
|
+
required: ['type']
|
|
6126
8339
|
} as const;
|
|
6127
8340
|
|
|
6128
|
-
export const $
|
|
8341
|
+
export const $HoldingPnlResponseDto = {
|
|
6129
8342
|
type: 'object',
|
|
6130
8343
|
properties: {
|
|
6131
|
-
|
|
8344
|
+
asOfDate: {
|
|
6132
8345
|
type: 'string',
|
|
6133
|
-
|
|
6134
|
-
example: '2024-06-15'
|
|
8346
|
+
example: '2026-07-08'
|
|
6135
8347
|
},
|
|
6136
|
-
|
|
8348
|
+
baseCurrency: {
|
|
6137
8349
|
type: 'string',
|
|
6138
|
-
|
|
6139
|
-
example: '500000.00'
|
|
8350
|
+
example: 'CNY'
|
|
6140
8351
|
},
|
|
6141
|
-
|
|
6142
|
-
type: '
|
|
6143
|
-
description:
|
|
6144
|
-
|
|
8352
|
+
method: {
|
|
8353
|
+
type: 'string',
|
|
8354
|
+
description:
|
|
8355
|
+
'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
|
|
8356
|
+
enum: ['average', 'FIFO'],
|
|
8357
|
+
example: 'average'
|
|
6145
8358
|
},
|
|
6146
|
-
|
|
6147
|
-
description: 'Multi-currency breakdown for this point',
|
|
8359
|
+
rows: {
|
|
6148
8360
|
type: 'array',
|
|
6149
8361
|
items: {
|
|
6150
|
-
$ref: '#/components/schemas/
|
|
8362
|
+
$ref: '#/components/schemas/HoldingPnlRowDto'
|
|
8363
|
+
}
|
|
8364
|
+
},
|
|
8365
|
+
warnings: {
|
|
8366
|
+
type: 'array',
|
|
8367
|
+
items: {
|
|
8368
|
+
$ref: '#/components/schemas/HoldingPnlWarningDto'
|
|
6151
8369
|
}
|
|
6152
8370
|
}
|
|
6153
8371
|
},
|
|
6154
|
-
required: ['
|
|
8372
|
+
required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
|
|
6155
8373
|
} as const;
|
|
6156
8374
|
|
|
6157
|
-
export const $
|
|
8375
|
+
export const $AnonymousLoginDto = {
|
|
6158
8376
|
type: 'object',
|
|
6159
8377
|
properties: {
|
|
6160
|
-
|
|
6161
|
-
type: 'string',
|
|
6162
|
-
description: 'Value at start of period',
|
|
6163
|
-
example: '450000.00'
|
|
6164
|
-
},
|
|
6165
|
-
endValue: {
|
|
6166
|
-
type: 'string',
|
|
6167
|
-
description: 'Value at end of period',
|
|
6168
|
-
example: '500000.00'
|
|
6169
|
-
},
|
|
6170
|
-
totalChange: {
|
|
6171
|
-
type: 'string',
|
|
6172
|
-
description: 'Total change over period',
|
|
6173
|
-
example: '50000.00'
|
|
6174
|
-
},
|
|
6175
|
-
totalChangePercentage: {
|
|
8378
|
+
accessToken: {
|
|
6176
8379
|
type: 'string',
|
|
6177
|
-
description: '
|
|
6178
|
-
example: '+11.11%'
|
|
8380
|
+
description: 'Access token for anonymous login'
|
|
6179
8381
|
}
|
|
6180
8382
|
},
|
|
6181
|
-
required: ['
|
|
8383
|
+
required: ['accessToken']
|
|
6182
8384
|
} as const;
|
|
6183
8385
|
|
|
6184
|
-
export const $
|
|
8386
|
+
export const $AnonymousLoginResponseDto = {
|
|
6185
8387
|
type: 'object',
|
|
6186
8388
|
properties: {
|
|
6187
|
-
|
|
8389
|
+
authToken: {
|
|
6188
8390
|
type: 'string',
|
|
6189
|
-
description: '
|
|
6190
|
-
example: '
|
|
6191
|
-
},
|
|
6192
|
-
byCurrency: {
|
|
6193
|
-
description: 'Balances by currency',
|
|
6194
|
-
type: 'array',
|
|
6195
|
-
items: {
|
|
6196
|
-
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
6197
|
-
}
|
|
8391
|
+
description: 'JWT auth token',
|
|
8392
|
+
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
6198
8393
|
}
|
|
6199
8394
|
},
|
|
6200
|
-
required: ['
|
|
8395
|
+
required: ['authToken']
|
|
6201
8396
|
} as const;
|
|
6202
8397
|
|
|
6203
|
-
export const $
|
|
8398
|
+
export const $SymbolSearchResultDto = {
|
|
6204
8399
|
type: 'object',
|
|
6205
8400
|
properties: {
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
items: {
|
|
6210
|
-
$ref: '#/components/schemas/TimeSeriesPointDto'
|
|
6211
|
-
}
|
|
8401
|
+
symbol: {
|
|
8402
|
+
type: 'string',
|
|
8403
|
+
example: 'AAPL'
|
|
6212
8404
|
},
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
$ref: '#/components/schemas/TrendSummaryDto'
|
|
6218
|
-
}
|
|
6219
|
-
]
|
|
8405
|
+
name: {
|
|
8406
|
+
type: 'object',
|
|
8407
|
+
example: 'Apple Inc.',
|
|
8408
|
+
nullable: true
|
|
6220
8409
|
},
|
|
6221
|
-
|
|
6222
|
-
type: '
|
|
6223
|
-
|
|
6224
|
-
|
|
8410
|
+
exchange: {
|
|
8411
|
+
type: 'object',
|
|
8412
|
+
example: 'US',
|
|
8413
|
+
nullable: true
|
|
6225
8414
|
},
|
|
6226
|
-
|
|
6227
|
-
type: '
|
|
6228
|
-
description: '
|
|
6229
|
-
example: '
|
|
8415
|
+
assetType: {
|
|
8416
|
+
type: 'object',
|
|
8417
|
+
description: 'OpenBB asset_type (e.g. stock, etf)',
|
|
8418
|
+
example: 'stock',
|
|
8419
|
+
nullable: true
|
|
6230
8420
|
},
|
|
6231
|
-
|
|
6232
|
-
type: '
|
|
6233
|
-
description: '
|
|
6234
|
-
example: '
|
|
8421
|
+
assetClass: {
|
|
8422
|
+
type: 'object',
|
|
8423
|
+
description: 'IGN asset class (region.types.ts ASSET_CLASSES)',
|
|
8424
|
+
example: 'EQUITY',
|
|
8425
|
+
nullable: true
|
|
6235
8426
|
},
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
$ref: '#/components/schemas/MultiCurrencyPointDto'
|
|
6242
|
-
}
|
|
8427
|
+
assetSubClass: {
|
|
8428
|
+
type: 'object',
|
|
8429
|
+
description: 'IGN asset sub-class (region.types.ts ASSET_SUB_CLASSES)',
|
|
8430
|
+
example: 'STOCK',
|
|
8431
|
+
nullable: true
|
|
6243
8432
|
},
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
}
|
|
8433
|
+
currency: {
|
|
8434
|
+
type: 'object',
|
|
8435
|
+
description: 'Trading currency (extra_data or inferred from exchange)',
|
|
8436
|
+
example: 'USD',
|
|
8437
|
+
nullable: true
|
|
6250
8438
|
}
|
|
6251
8439
|
},
|
|
6252
|
-
required: ['
|
|
6253
|
-
} as const;
|
|
6254
|
-
|
|
6255
|
-
export const $GenerateSnapshotBody = {
|
|
6256
|
-
type: 'object',
|
|
6257
|
-
properties: {}
|
|
6258
|
-
} as const;
|
|
6259
|
-
|
|
6260
|
-
export const $GenerateSnapshotResponse = {
|
|
6261
|
-
type: 'object',
|
|
6262
|
-
properties: {}
|
|
6263
|
-
} as const;
|
|
6264
|
-
|
|
6265
|
-
export const $BackfillSnapshotsBody = {
|
|
6266
|
-
type: 'object',
|
|
6267
|
-
properties: {}
|
|
6268
|
-
} as const;
|
|
6269
|
-
|
|
6270
|
-
export const $BackfillSnapshotsResponse = {
|
|
6271
|
-
type: 'object',
|
|
6272
|
-
properties: {}
|
|
8440
|
+
required: ['symbol']
|
|
6273
8441
|
} as const;
|
|
6274
8442
|
|
|
6275
|
-
export const $
|
|
8443
|
+
export const $SymbolQuoteDto = {
|
|
6276
8444
|
type: 'object',
|
|
6277
8445
|
properties: {
|
|
6278
|
-
|
|
8446
|
+
symbol: {
|
|
6279
8447
|
type: 'string',
|
|
6280
|
-
|
|
8448
|
+
example: 'AAPL'
|
|
8449
|
+
},
|
|
8450
|
+
name: {
|
|
8451
|
+
type: 'object',
|
|
8452
|
+
example: 'Apple Inc.',
|
|
8453
|
+
nullable: true
|
|
8454
|
+
},
|
|
8455
|
+
exchange: {
|
|
8456
|
+
type: 'object',
|
|
8457
|
+
example: 'US',
|
|
8458
|
+
nullable: true
|
|
8459
|
+
},
|
|
8460
|
+
assetType: {
|
|
8461
|
+
type: 'object',
|
|
8462
|
+
description: 'OpenBB asset_type',
|
|
8463
|
+
example: 'stock',
|
|
8464
|
+
nullable: true
|
|
8465
|
+
},
|
|
8466
|
+
assetClass: {
|
|
8467
|
+
type: 'object',
|
|
8468
|
+
description: 'IGN asset class',
|
|
8469
|
+
example: 'EQUITY',
|
|
8470
|
+
nullable: true
|
|
8471
|
+
},
|
|
8472
|
+
assetSubClass: {
|
|
8473
|
+
type: 'object',
|
|
8474
|
+
description: 'IGN asset sub-class',
|
|
8475
|
+
example: 'STOCK',
|
|
8476
|
+
nullable: true
|
|
8477
|
+
},
|
|
8478
|
+
currency: {
|
|
8479
|
+
type: 'object',
|
|
8480
|
+
description: 'Trading currency (extra_data or inferred from exchange)',
|
|
8481
|
+
example: 'USD',
|
|
8482
|
+
nullable: true
|
|
8483
|
+
},
|
|
8484
|
+
price: {
|
|
8485
|
+
type: 'object',
|
|
8486
|
+
description: 'Latest price (Decimal string)',
|
|
8487
|
+
example: '189.84',
|
|
8488
|
+
nullable: true
|
|
8489
|
+
},
|
|
8490
|
+
priceDate: {
|
|
8491
|
+
type: 'object',
|
|
8492
|
+
description: 'Date the price was observed (ISO yyyy-MM-dd)',
|
|
8493
|
+
example: '2026-08-05',
|
|
8494
|
+
nullable: true
|
|
8495
|
+
},
|
|
8496
|
+
changePercent: {
|
|
8497
|
+
type: 'object',
|
|
8498
|
+
description:
|
|
8499
|
+
'Change vs previous close, in percentage points (1.7 == 1.7%). openbb stores change_percent as a normalized decimal; this exposes percentage points for frontend convenience.',
|
|
8500
|
+
example: 1.7,
|
|
8501
|
+
nullable: true
|
|
8502
|
+
},
|
|
8503
|
+
prevClose: {
|
|
8504
|
+
type: 'object',
|
|
8505
|
+
description: 'Previous close (Decimal string)',
|
|
8506
|
+
nullable: true
|
|
8507
|
+
},
|
|
8508
|
+
open: {
|
|
8509
|
+
type: 'object',
|
|
8510
|
+
description: 'Day open (Decimal string)',
|
|
8511
|
+
nullable: true
|
|
8512
|
+
},
|
|
8513
|
+
high: {
|
|
8514
|
+
type: 'object',
|
|
8515
|
+
description: 'Day high (Decimal string)',
|
|
8516
|
+
nullable: true
|
|
8517
|
+
},
|
|
8518
|
+
low: {
|
|
8519
|
+
type: 'object',
|
|
8520
|
+
description: 'Day low (Decimal string)',
|
|
8521
|
+
nullable: true
|
|
8522
|
+
},
|
|
8523
|
+
volume: {
|
|
8524
|
+
type: 'object',
|
|
8525
|
+
description: 'Day volume (Decimal string)',
|
|
8526
|
+
nullable: true
|
|
8527
|
+
},
|
|
8528
|
+
yearHigh: {
|
|
8529
|
+
type: 'object',
|
|
8530
|
+
description: '52-week high (Decimal string)',
|
|
8531
|
+
nullable: true
|
|
8532
|
+
},
|
|
8533
|
+
yearLow: {
|
|
8534
|
+
type: 'object',
|
|
8535
|
+
description: '52-week low (Decimal string)',
|
|
8536
|
+
nullable: true
|
|
6281
8537
|
}
|
|
6282
|
-
}
|
|
6283
|
-
required: ['accessToken']
|
|
8538
|
+
}
|
|
6284
8539
|
} as const;
|