@firela/api-types 0.0.0-canary.2fbeefe9 → 0.0.0-canary.3550df41

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.
@@ -11,7 +11,7 @@ export const $CreateAccountDto = {
11
11
  openDate: {
12
12
  format: 'date-time',
13
13
  type: 'string',
14
- description: 'Account open date',
14
+ description: 'Account open date (server defaults to today)',
15
15
  example: '2024-01-01'
16
16
  },
17
17
  currencies: {
@@ -51,9 +51,10 @@ export const $CreateAccountDto = {
51
51
  description: 'Icon identifier (overrides template)',
52
52
  example: 'bank-custom'
53
53
  },
54
- openMeta: {
54
+ openDirectiveMeta: {
55
55
  type: 'object',
56
- description: 'Additional metadata',
56
+ description:
57
+ 'Open directive metadata (NOT an opening-balance amount — use the opening-balance endpoint)',
57
58
  example: {
58
59
  branch: 'Downtown',
59
60
  accountNumber: '1234'
@@ -65,7 +66,7 @@ export const $CreateAccountDto = {
65
66
  example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
66
67
  }
67
68
  },
68
- required: ['path', 'openDate']
69
+ required: ['path']
69
70
  } as const;
70
71
 
71
72
  export const $AccountResponseDto = {
@@ -87,6 +88,47 @@ export const $AccountResponseDto = {
87
88
  enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
88
89
  example: 'Assets'
89
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
+ 'OTHER'
128
+ ],
129
+ nullable: true,
130
+ example: 'STOCK'
131
+ },
90
132
  status: {
91
133
  type: 'string',
92
134
  description: 'Account status',
@@ -145,9 +187,9 @@ export const $AccountResponseDto = {
145
187
  description: 'Icon identifier',
146
188
  example: 'bank-icbc'
147
189
  },
148
- openMeta: {
190
+ openDirectiveMeta: {
149
191
  type: 'object',
150
- description: 'Account metadata',
192
+ description: 'Open directive metadata (ADR-0115 Decision 9)',
151
193
  example: {
152
194
  branch: 'Downtown'
153
195
  }
@@ -233,9 +275,10 @@ export const $UpdateAccountDto = {
233
275
  description: 'Icon identifier',
234
276
  example: 'bank-custom'
235
277
  },
236
- openMeta: {
278
+ openDirectiveMeta: {
237
279
  type: 'object',
238
- description: 'Additional metadata (merged with existing)',
280
+ description:
281
+ 'Open directive metadata (merged with existing; NOT an opening-balance amount)',
239
282
  example: {
240
283
  branch: 'Uptown'
241
284
  }
@@ -282,6 +325,40 @@ export const $ReopenAccountDto = {
282
325
  }
283
326
  } as const;
284
327
 
328
+ export const $CreateOpeningBalanceDto = {
329
+ type: 'object',
330
+ properties: {
331
+ amount: {
332
+ type: 'number',
333
+ description: 'Opening balance amount (non-negative)',
334
+ example: 1000
335
+ },
336
+ currency: {
337
+ type: 'string',
338
+ description: 'Currency code',
339
+ example: 'CNY'
340
+ },
341
+ date: {
342
+ format: 'date-time',
343
+ type: 'string',
344
+ description: 'Opening-balance date (defaults to now)',
345
+ example: '2024-01-01'
346
+ }
347
+ },
348
+ required: ['amount', 'currency']
349
+ } as const;
350
+
351
+ export const $OpeningBalanceResultDto = {
352
+ type: 'object',
353
+ properties: {
354
+ transactionId: {
355
+ type: 'string',
356
+ description: 'Created opening-balance transaction id.'
357
+ }
358
+ },
359
+ required: ['transactionId']
360
+ } as const;
361
+
285
362
  export const $AccountStandardResponseDto = {
286
363
  type: 'object',
287
364
  properties: {
@@ -3715,152 +3792,599 @@ export const $ForecastResponseDto = {
3715
3792
  ]
3716
3793
  } as const;
3717
3794
 
3718
- export const $CreateTransactionRuleDto = {
3795
+ export const $CurrencyBalanceDto = {
3719
3796
  type: 'object',
3720
3797
  properties: {
3721
- name: {
3798
+ currency: {
3722
3799
  type: 'string',
3723
- minLength: 1,
3724
- maxLength: 100
3800
+ description: 'ISO 4217 currency code',
3801
+ example: 'CNY'
3725
3802
  },
3726
- description: {
3803
+ balance: {
3727
3804
  type: 'string',
3728
- maxLength: 500
3729
- },
3730
- narrationKeywords: {
3731
- items: {
3732
- type: 'array'
3733
- },
3734
- maxItems: 50,
3735
- type: 'array'
3736
- },
3737
- payeeKeywords: {
3738
- items: {
3739
- type: 'array'
3740
- },
3741
- maxItems: 50,
3742
- type: 'array'
3743
- },
3744
- categoryKeywords: {
3745
- items: {
3746
- type: 'array'
3747
- },
3748
- maxItems: 50,
3749
- type: 'array'
3750
- },
3751
- methodKeywords: {
3752
- items: {
3753
- type: 'array'
3754
- },
3755
- maxItems: 50,
3756
- description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
3757
- type: 'array'
3758
- },
3759
- categoryAccount: {
3805
+ description: 'Balance amount',
3806
+ example: '500000.00'
3807
+ }
3808
+ },
3809
+ required: ['currency', 'balance']
3810
+ } as const;
3811
+
3812
+ export const $TimeSeriesPointDto = {
3813
+ type: 'object',
3814
+ properties: {
3815
+ date: {
3760
3816
  type: 'string',
3761
- maxLength: 200,
3762
- description:
3763
- 'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
3817
+ description: 'Date in YYYY-MM-DD format',
3818
+ example: '2024-06-15'
3764
3819
  },
3765
- matchLogic: {
3820
+ value: {
3766
3821
  type: 'string',
3767
- enum: ['OR', 'AND'],
3768
- default: 'OR'
3822
+ description: 'Value at this date (in base currency)',
3823
+ example: '500000.00'
3769
3824
  },
3770
- amountMin: {
3771
- type: 'number',
3772
- minimum: 0,
3773
- description: 'Minimum transaction amount (inclusive)'
3825
+ change: {
3826
+ type: 'object',
3827
+ description: 'Change from previous point',
3828
+ example: '5000.00'
3774
3829
  },
3775
- amountMax: {
3776
- type: 'number',
3777
- minimum: 0,
3778
- description: 'Maximum transaction amount (inclusive)'
3830
+ assets: {
3831
+ type: 'string',
3832
+ description: 'Total assets at this date (in base currency)',
3833
+ example: '494338.00'
3779
3834
  },
3780
- priority: {
3781
- type: 'number',
3782
- default: 50,
3783
- minimum: 0,
3784
- maximum: 1000
3835
+ liabilities: {
3836
+ type: 'string',
3837
+ description: 'Total liabilities at this date (in base currency)',
3838
+ example: '310098.00'
3785
3839
  },
3786
- additionalTags: {
3840
+ byCurrency: {
3841
+ description: 'Multi-currency breakdown for this point',
3842
+ type: 'array',
3787
3843
  items: {
3788
- type: 'array'
3789
- },
3790
- maxItems: 20,
3791
- type: 'array'
3792
- },
3793
- additionalMetadata: {
3794
- type: 'object'
3795
- },
3796
- upsertByPayee: {
3797
- type: 'boolean',
3798
- description:
3799
- 'If true, update existing rule with matching payeeKeywords[0] instead of creating new rule'
3844
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3845
+ }
3800
3846
  }
3801
3847
  },
3802
- required: ['name', 'matchLogic', 'priority']
3848
+ required: ['date', 'value']
3803
3849
  } as const;
3804
3850
 
3805
- export const $AmountRangeDto = {
3851
+ export const $TrendSummaryDto = {
3806
3852
  type: 'object',
3807
3853
  properties: {
3808
- min: {
3809
- type: 'number',
3810
- description: 'Minimum amount'
3854
+ startValue: {
3855
+ type: 'string',
3856
+ description: 'Value at start of period',
3857
+ example: '450000.00'
3811
3858
  },
3812
- max: {
3813
- type: 'number',
3814
- description: 'Maximum amount'
3859
+ endValue: {
3860
+ type: 'string',
3861
+ description: 'Value at end of period',
3862
+ example: '500000.00'
3863
+ },
3864
+ totalChange: {
3865
+ type: 'string',
3866
+ description: 'Total change over period',
3867
+ example: '50000.00'
3868
+ },
3869
+ totalChangePercentage: {
3870
+ type: 'string',
3871
+ description: 'Total change percentage',
3872
+ example: '+11.11%'
3815
3873
  }
3816
- }
3874
+ },
3875
+ required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
3817
3876
  } as const;
3818
3877
 
3819
- export const $TransactionRuleResponseDto = {
3878
+ export const $MultiCurrencyPointDto = {
3820
3879
  type: 'object',
3821
3880
  properties: {
3822
- id: {
3823
- type: 'string',
3824
- description: 'Rule ID'
3825
- },
3826
- name: {
3827
- type: 'string',
3828
- description: 'Rule name'
3829
- },
3830
- description: {
3881
+ date: {
3831
3882
  type: 'string',
3832
- description: 'Rule description'
3883
+ description: 'Date in YYYY-MM-DD format',
3884
+ example: '2024-06-15'
3833
3885
  },
3834
- narrationKeywords: {
3835
- description: 'Keywords to match in transaction narration',
3886
+ byCurrency: {
3887
+ description: 'Balances by currency',
3836
3888
  type: 'array',
3837
3889
  items: {
3838
- type: 'string'
3890
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3839
3891
  }
3840
- },
3841
- payeeKeywords: {
3842
- description: 'Keywords to match in payee name',
3892
+ }
3893
+ },
3894
+ required: ['date', 'byCurrency']
3895
+ } as const;
3896
+
3897
+ export const $PortfolioTrendsResponseDto = {
3898
+ type: 'object',
3899
+ properties: {
3900
+ series: {
3901
+ description: 'Time series data points',
3843
3902
  type: 'array',
3844
3903
  items: {
3845
- type: 'string'
3904
+ $ref: '#/components/schemas/TimeSeriesPointDto'
3846
3905
  }
3847
3906
  },
3848
- categoryKeywords: {
3849
- description: 'Keywords to match in category',
3907
+ summary: {
3908
+ description: 'Period summary',
3909
+ allOf: [
3910
+ {
3911
+ $ref: '#/components/schemas/TrendSummaryDto'
3912
+ }
3913
+ ]
3914
+ },
3915
+ period: {
3916
+ type: 'string',
3917
+ description: 'Period requested',
3918
+ example: '6m'
3919
+ },
3920
+ granularity: {
3921
+ type: 'string',
3922
+ description: 'Data granularity',
3923
+ example: 'month'
3924
+ },
3925
+ currency: {
3926
+ type: 'string',
3927
+ description: 'Base currency for converted values',
3928
+ example: 'CNY'
3929
+ },
3930
+ byCurrency: {
3931
+ description:
3932
+ 'Multi-currency time series (each point has currency breakdown)',
3850
3933
  type: 'array',
3851
3934
  items: {
3852
- type: 'string'
3935
+ $ref: '#/components/schemas/MultiCurrencyPointDto'
3853
3936
  }
3854
3937
  },
3855
- methodKeywords: {
3856
- description: 'Keywords to match in payment method',
3938
+ warnings: {
3939
+ description: 'Exchange rate warnings',
3857
3940
  type: 'array',
3858
3941
  items: {
3859
- type: 'string'
3942
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
3860
3943
  }
3861
- },
3862
- categoryAccount: {
3863
- type: 'string',
3944
+ }
3945
+ },
3946
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
3947
+ } as const;
3948
+
3949
+ export const $CashFlowPointDto = {
3950
+ type: 'object',
3951
+ properties: {
3952
+ month: {
3953
+ type: 'string',
3954
+ description: 'Month key (YYYY-MM)',
3955
+ example: '2024-03'
3956
+ },
3957
+ income: {
3958
+ type: 'string',
3959
+ description: 'Income in base currency (absolute, converted)',
3960
+ example: '10000.00'
3961
+ },
3962
+ expense: {
3963
+ type: 'string',
3964
+ description: 'Expense in base currency (absolute, converted)',
3965
+ example: '5000.00'
3966
+ },
3967
+ netSavings: {
3968
+ type: 'string',
3969
+ description: 'netSavings = income − expense (savings positive)',
3970
+ example: '5000.00'
3971
+ }
3972
+ },
3973
+ required: ['month', 'income', 'expense', 'netSavings']
3974
+ } as const;
3975
+
3976
+ export const $CashFlowTrendSummaryDto = {
3977
+ type: 'object',
3978
+ properties: {
3979
+ totalIncome: {
3980
+ type: 'string',
3981
+ description: 'Total income across the period',
3982
+ example: '60000.00'
3983
+ },
3984
+ totalExpense: {
3985
+ type: 'string',
3986
+ description: 'Total expense across the period',
3987
+ example: '30000.00'
3988
+ },
3989
+ totalNetSavings: {
3990
+ type: 'string',
3991
+ description: 'income − expense across the period',
3992
+ example: '30000.00'
3993
+ },
3994
+ averageMonthlyNetSavings: {
3995
+ type: 'string',
3996
+ description:
3997
+ 'totalNetSavings divided by the window length (N months, incl. zero-filled)',
3998
+ example: '5000.00'
3999
+ }
4000
+ },
4001
+ required: [
4002
+ 'totalIncome',
4003
+ 'totalExpense',
4004
+ 'totalNetSavings',
4005
+ 'averageMonthlyNetSavings'
4006
+ ]
4007
+ } as const;
4008
+
4009
+ export const $CashFlowTrendsResponseDto = {
4010
+ type: 'object',
4011
+ properties: {
4012
+ series: {
4013
+ description:
4014
+ 'Monthly cash-flow series (fixed N-month window, zero-filled)',
4015
+ type: 'array',
4016
+ items: {
4017
+ $ref: '#/components/schemas/CashFlowPointDto'
4018
+ }
4019
+ },
4020
+ summary: {
4021
+ description: 'Period totals',
4022
+ allOf: [
4023
+ {
4024
+ $ref: '#/components/schemas/CashFlowTrendSummaryDto'
4025
+ }
4026
+ ]
4027
+ },
4028
+ period: {
4029
+ type: 'string',
4030
+ description: 'Period requested',
4031
+ example: '6m'
4032
+ },
4033
+ granularity: {
4034
+ type: 'string',
4035
+ description: 'Data granularity (v1 returns month buckets)',
4036
+ example: 'month'
4037
+ },
4038
+ currency: {
4039
+ type: 'string',
4040
+ description: 'Base currency for converted values',
4041
+ example: 'CNY'
4042
+ },
4043
+ warnings: {
4044
+ description: 'Exchange rate warnings (e.g. missing rate for a currency)',
4045
+ type: 'array',
4046
+ items: {
4047
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
4048
+ }
4049
+ }
4050
+ },
4051
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
4052
+ } as const;
4053
+
4054
+ export const $GenerateSnapshotBody = {
4055
+ type: 'object',
4056
+ properties: {}
4057
+ } as const;
4058
+
4059
+ export const $GenerateSnapshotResponse = {
4060
+ type: 'object',
4061
+ properties: {}
4062
+ } as const;
4063
+
4064
+ export const $BackfillSnapshotsBody = {
4065
+ type: 'object',
4066
+ properties: {}
4067
+ } as const;
4068
+
4069
+ export const $BackfillSnapshotsResponse = {
4070
+ type: 'object',
4071
+ properties: {}
4072
+ } as const;
4073
+
4074
+ export const $DeleteOwnUserDto = {
4075
+ type: 'object',
4076
+ properties: {
4077
+ accessToken: {
4078
+ type: 'string',
4079
+ description: 'Access token for user verification',
4080
+ example: 'abc123xyz'
4081
+ }
4082
+ },
4083
+ required: ['accessToken']
4084
+ } as const;
4085
+
4086
+ export const $SignupDto = {
4087
+ type: 'object',
4088
+ properties: {
4089
+ turnstileToken: {
4090
+ type: 'string',
4091
+ description:
4092
+ 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
4093
+ example: '0.abc123def456...'
4094
+ }
4095
+ }
4096
+ } as const;
4097
+
4098
+ export const $SignupResponseDto = {
4099
+ type: 'object',
4100
+ properties: {
4101
+ authToken: {
4102
+ type: 'string',
4103
+ description: 'JWT auth token',
4104
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
4105
+ },
4106
+ accessToken: {
4107
+ type: 'string',
4108
+ description: 'Auto-generated access token'
4109
+ },
4110
+ role: {
4111
+ type: 'string',
4112
+ description: 'Assigned user role',
4113
+ enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
4114
+ }
4115
+ },
4116
+ required: ['authToken', 'accessToken', 'role']
4117
+ } as const;
4118
+
4119
+ export const $UpdateUserSettingDto = {
4120
+ type: 'object',
4121
+ properties: {
4122
+ secId: {
4123
+ type: 'number',
4124
+ description: 'Security ID'
4125
+ },
4126
+ annualInterestRate: {
4127
+ type: 'number',
4128
+ description: 'Annual interest rate',
4129
+ example: 0.05
4130
+ },
4131
+ currency: {
4132
+ type: 'string',
4133
+ description: 'Currency code',
4134
+ example: 'USD'
4135
+ },
4136
+ baseCurrency: {
4137
+ type: 'string',
4138
+ description: 'Base currency code',
4139
+ example: 'USD'
4140
+ },
4141
+ benchmark: {
4142
+ type: 'string',
4143
+ description: 'Benchmark symbol',
4144
+ example: 'SPY'
4145
+ },
4146
+ colorScheme: {
4147
+ type: 'string',
4148
+ description: 'Color scheme',
4149
+ enum: ['DARK', 'LIGHT']
4150
+ },
4151
+ dateRange: {
4152
+ type: 'string',
4153
+ description: 'Date range filter',
4154
+ example: '1y'
4155
+ },
4156
+ emergencyFund: {
4157
+ type: 'number',
4158
+ description: 'Emergency fund amount',
4159
+ example: 10000
4160
+ },
4161
+ 'filters.accounts': {
4162
+ description: 'Account filter IDs',
4163
+ type: 'array',
4164
+ items: {
4165
+ type: 'string'
4166
+ }
4167
+ },
4168
+ 'filters.assetClasses': {
4169
+ description: 'Asset class filters',
4170
+ type: 'array',
4171
+ items: {
4172
+ type: 'string'
4173
+ }
4174
+ },
4175
+ 'filters.dataSource': {
4176
+ type: 'string',
4177
+ description: 'Data source filter'
4178
+ },
4179
+ 'filters.symbol': {
4180
+ type: 'string',
4181
+ description: 'Symbol filter'
4182
+ },
4183
+ 'filters.tags': {
4184
+ description: 'Tag filters',
4185
+ type: 'array',
4186
+ items: {
4187
+ type: 'string'
4188
+ }
4189
+ },
4190
+ isExperimentalFeatures: {
4191
+ type: 'boolean',
4192
+ description: 'Enable experimental features'
4193
+ },
4194
+ isRestrictedView: {
4195
+ type: 'boolean',
4196
+ description: 'Enable restricted view mode'
4197
+ },
4198
+ language: {
4199
+ type: 'string',
4200
+ description: 'Language code',
4201
+ example: 'en'
4202
+ },
4203
+ locale: {
4204
+ type: 'string',
4205
+ description: 'Locale code',
4206
+ example: 'en-US'
4207
+ },
4208
+ projectedTotalAmount: {
4209
+ type: 'number',
4210
+ description: 'Projected total amount',
4211
+ example: 1000000
4212
+ },
4213
+ retirementDate: {
4214
+ type: 'string',
4215
+ description: 'Retirement date in ISO 8601 format',
4216
+ example: '2050-01-01'
4217
+ },
4218
+ savingsRate: {
4219
+ type: 'number',
4220
+ description: 'Savings rate percentage',
4221
+ example: 0.2
4222
+ },
4223
+ viewMode: {
4224
+ type: 'string',
4225
+ description: 'View mode',
4226
+ enum: ['DEFAULT', 'ZEN']
4227
+ }
4228
+ }
4229
+ } as const;
4230
+
4231
+ export const $UpdatePropertyDto = {
4232
+ type: 'object',
4233
+ properties: {
4234
+ value: {
4235
+ type: 'string',
4236
+ description: 'Property value'
4237
+ }
4238
+ },
4239
+ required: ['value']
4240
+ } as const;
4241
+
4242
+ export const $CreateTransactionRuleDto = {
4243
+ type: 'object',
4244
+ properties: {
4245
+ name: {
4246
+ type: 'string',
4247
+ minLength: 1,
4248
+ maxLength: 100
4249
+ },
4250
+ description: {
4251
+ type: 'string',
4252
+ maxLength: 500
4253
+ },
4254
+ narrationKeywords: {
4255
+ items: {
4256
+ type: 'array'
4257
+ },
4258
+ maxItems: 50,
4259
+ type: 'array'
4260
+ },
4261
+ payeeKeywords: {
4262
+ items: {
4263
+ type: 'array'
4264
+ },
4265
+ maxItems: 50,
4266
+ type: 'array'
4267
+ },
4268
+ categoryKeywords: {
4269
+ items: {
4270
+ type: 'array'
4271
+ },
4272
+ maxItems: 50,
4273
+ type: 'array'
4274
+ },
4275
+ methodKeywords: {
4276
+ items: {
4277
+ type: 'array'
4278
+ },
4279
+ maxItems: 50,
4280
+ description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
4281
+ type: 'array'
4282
+ },
4283
+ categoryAccount: {
4284
+ type: 'string',
4285
+ maxLength: 200,
4286
+ description:
4287
+ 'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
4288
+ },
4289
+ matchLogic: {
4290
+ type: 'string',
4291
+ enum: ['OR', 'AND'],
4292
+ default: 'OR'
4293
+ },
4294
+ amountMin: {
4295
+ type: 'number',
4296
+ minimum: 0,
4297
+ description: 'Minimum transaction amount (inclusive)'
4298
+ },
4299
+ amountMax: {
4300
+ type: 'number',
4301
+ minimum: 0,
4302
+ description: 'Maximum transaction amount (inclusive)'
4303
+ },
4304
+ priority: {
4305
+ type: 'number',
4306
+ default: 50,
4307
+ minimum: 0,
4308
+ maximum: 1000
4309
+ },
4310
+ additionalTags: {
4311
+ items: {
4312
+ type: 'array'
4313
+ },
4314
+ maxItems: 20,
4315
+ type: 'array'
4316
+ },
4317
+ additionalMetadata: {
4318
+ type: 'object'
4319
+ },
4320
+ upsertByPayee: {
4321
+ type: 'boolean',
4322
+ description:
4323
+ 'If true, update existing rule with matching payeeKeywords[0] instead of creating new rule'
4324
+ }
4325
+ },
4326
+ required: ['name', 'matchLogic', 'priority']
4327
+ } as const;
4328
+
4329
+ export const $AmountRangeDto = {
4330
+ type: 'object',
4331
+ properties: {
4332
+ min: {
4333
+ type: 'number',
4334
+ description: 'Minimum amount'
4335
+ },
4336
+ max: {
4337
+ type: 'number',
4338
+ description: 'Maximum amount'
4339
+ }
4340
+ }
4341
+ } as const;
4342
+
4343
+ export const $TransactionRuleResponseDto = {
4344
+ type: 'object',
4345
+ properties: {
4346
+ id: {
4347
+ type: 'string',
4348
+ description: 'Rule ID'
4349
+ },
4350
+ name: {
4351
+ type: 'string',
4352
+ description: 'Rule name'
4353
+ },
4354
+ description: {
4355
+ type: 'string',
4356
+ description: 'Rule description'
4357
+ },
4358
+ narrationKeywords: {
4359
+ description: 'Keywords to match in transaction narration',
4360
+ type: 'array',
4361
+ items: {
4362
+ type: 'string'
4363
+ }
4364
+ },
4365
+ payeeKeywords: {
4366
+ description: 'Keywords to match in payee name',
4367
+ type: 'array',
4368
+ items: {
4369
+ type: 'string'
4370
+ }
4371
+ },
4372
+ categoryKeywords: {
4373
+ description: 'Keywords to match in category',
4374
+ type: 'array',
4375
+ items: {
4376
+ type: 'string'
4377
+ }
4378
+ },
4379
+ methodKeywords: {
4380
+ description: 'Keywords to match in payment method',
4381
+ type: 'array',
4382
+ items: {
4383
+ type: 'string'
4384
+ }
4385
+ },
4386
+ categoryAccount: {
4387
+ type: 'string',
3864
4388
  description: 'Destination account for categorization'
3865
4389
  },
3866
4390
  matchLogic: {
@@ -4364,153 +4888,6 @@ export const $TestRuleResponseDto = {
4364
4888
  required: ['ruleId', 'matches', 'confidence', 'matchDetails']
4365
4889
  } as const;
4366
4890
 
4367
- export const $DeleteOwnUserDto = {
4368
- type: 'object',
4369
- properties: {
4370
- accessToken: {
4371
- type: 'string',
4372
- description: 'Access token for user verification',
4373
- example: 'abc123xyz'
4374
- }
4375
- },
4376
- required: ['accessToken']
4377
- } as const;
4378
-
4379
- export const $SignupDto = {
4380
- type: 'object',
4381
- properties: {
4382
- turnstileToken: {
4383
- type: 'string',
4384
- description:
4385
- 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
4386
- example: '0.abc123def456...'
4387
- }
4388
- }
4389
- } as const;
4390
-
4391
- export const $UpdateUserSettingDto = {
4392
- type: 'object',
4393
- properties: {
4394
- secId: {
4395
- type: 'number',
4396
- description: 'Security ID'
4397
- },
4398
- annualInterestRate: {
4399
- type: 'number',
4400
- description: 'Annual interest rate',
4401
- example: 0.05
4402
- },
4403
- currency: {
4404
- type: 'string',
4405
- description: 'Currency code',
4406
- example: 'USD'
4407
- },
4408
- baseCurrency: {
4409
- type: 'string',
4410
- description: 'Base currency code',
4411
- example: 'USD'
4412
- },
4413
- benchmark: {
4414
- type: 'string',
4415
- description: 'Benchmark symbol',
4416
- example: 'SPY'
4417
- },
4418
- colorScheme: {
4419
- type: 'string',
4420
- description: 'Color scheme',
4421
- enum: ['DARK', 'LIGHT']
4422
- },
4423
- dateRange: {
4424
- type: 'string',
4425
- description: 'Date range filter',
4426
- example: '1y'
4427
- },
4428
- emergencyFund: {
4429
- type: 'number',
4430
- description: 'Emergency fund amount',
4431
- example: 10000
4432
- },
4433
- 'filters.accounts': {
4434
- description: 'Account filter IDs',
4435
- type: 'array',
4436
- items: {
4437
- type: 'string'
4438
- }
4439
- },
4440
- 'filters.assetClasses': {
4441
- description: 'Asset class filters',
4442
- type: 'array',
4443
- items: {
4444
- type: 'string'
4445
- }
4446
- },
4447
- 'filters.dataSource': {
4448
- type: 'string',
4449
- description: 'Data source filter'
4450
- },
4451
- 'filters.symbol': {
4452
- type: 'string',
4453
- description: 'Symbol filter'
4454
- },
4455
- 'filters.tags': {
4456
- description: 'Tag filters',
4457
- type: 'array',
4458
- items: {
4459
- type: 'string'
4460
- }
4461
- },
4462
- isExperimentalFeatures: {
4463
- type: 'boolean',
4464
- description: 'Enable experimental features'
4465
- },
4466
- isRestrictedView: {
4467
- type: 'boolean',
4468
- description: 'Enable restricted view mode'
4469
- },
4470
- language: {
4471
- type: 'string',
4472
- description: 'Language code',
4473
- example: 'en'
4474
- },
4475
- locale: {
4476
- type: 'string',
4477
- description: 'Locale code',
4478
- example: 'en-US'
4479
- },
4480
- projectedTotalAmount: {
4481
- type: 'number',
4482
- description: 'Projected total amount',
4483
- example: 1000000
4484
- },
4485
- retirementDate: {
4486
- type: 'string',
4487
- description: 'Retirement date in ISO 8601 format',
4488
- example: '2050-01-01'
4489
- },
4490
- savingsRate: {
4491
- type: 'number',
4492
- description: 'Savings rate percentage',
4493
- example: 0.2
4494
- },
4495
- viewMode: {
4496
- type: 'string',
4497
- description: 'View mode',
4498
- enum: ['DEFAULT', 'ZEN']
4499
- }
4500
- }
4501
- } as const;
4502
-
4503
- export const $UpdatePropertyDto = {
4504
- type: 'object',
4505
- properties: {
4506
- value: {
4507
- type: 'string',
4508
- description: 'Property value'
4509
- }
4510
- },
4511
- required: ['value']
4512
- } as const;
4513
-
4514
4891
  export const $CreateBeanEventDto = {
4515
4892
  type: 'object',
4516
4893
  properties: {
@@ -5589,6 +5966,18 @@ export const $ProcessNlpDto = {
5589
5966
  currency: 'CNY',
5590
5967
  payee: 'Starbucks'
5591
5968
  }
5969
+ },
5970
+ selectedRuleId: {
5971
+ type: 'string',
5972
+ description:
5973
+ '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.',
5974
+ example: 'rule_abc123'
5975
+ },
5976
+ selectedAccount: {
5977
+ type: 'string',
5978
+ description:
5979
+ '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.',
5980
+ example: 'Expenses:Food:Coffee'
5592
5981
  }
5593
5982
  },
5594
5983
  required: ['message']
@@ -5913,7 +6302,8 @@ export const $NlpAccountConfirmationDataDto = {
5913
6302
  },
5914
6303
  suggestedAccount: {
5915
6304
  type: 'string',
5916
- description: 'Suggested replacement account',
6305
+ description:
6306
+ 'Suggested replacement account (omitted when no clear candidate)',
5917
6307
  example: 'Expenses:Food:Drinks'
5918
6308
  },
5919
6309
  similarAccounts: {
@@ -5935,7 +6325,6 @@ export const $NlpAccountConfirmationDataDto = {
5935
6325
  },
5936
6326
  required: [
5937
6327
  'invalidAccount',
5938
- 'suggestedAccount',
5939
6328
  'similarAccounts',
5940
6329
  'errorMessage',
5941
6330
  'transactionContext'
@@ -6108,7 +6497,8 @@ export const $NlpSuggestedAccountDto = {
6108
6497
  },
6109
6498
  confidence: {
6110
6499
  type: 'number',
6111
- description: 'Confidence score for this suggestion (0-1)',
6500
+ description:
6501
+ 'Confidence score for this suggestion (0-1). Present = predicted (confirm/confirm_rule/confirm_account); omitted = actual persisted account (created). (#586)',
6112
6502
  example: 0.9
6113
6503
  }
6114
6504
  },
@@ -6144,23 +6534,31 @@ export const $NlpDefaultAccountsDto = {
6144
6534
  properties: {
6145
6535
  asset: {
6146
6536
  type: 'string',
6147
- description: 'Default asset account',
6148
- example: 'Assets:Checking'
6537
+ description:
6538
+ 'Default OPEN asset account (MRU when multiple), or null when none/ambiguous',
6539
+ example: 'Assets:Checking',
6540
+ nullable: true
6149
6541
  },
6150
6542
  expense: {
6151
6543
  type: 'string',
6152
- description: 'Default expense account',
6153
- example: 'Expenses:Uncategorized'
6544
+ description:
6545
+ 'Default OPEN expense account (MRU when multiple), or null when none/ambiguous',
6546
+ example: 'Expenses:Food:Coffee',
6547
+ nullable: true
6154
6548
  },
6155
6549
  income: {
6156
6550
  type: 'string',
6157
- description: 'Default income account',
6158
- example: 'Income:Uncategorized'
6551
+ description:
6552
+ 'Default OPEN income account (MRU when multiple), or null when none/ambiguous',
6553
+ example: 'Income:Salary',
6554
+ nullable: true
6159
6555
  },
6160
6556
  liability: {
6161
6557
  type: 'string',
6162
- description: 'Default liability account',
6163
- example: 'Liabilities:CreditCard'
6558
+ description:
6559
+ 'Default OPEN liability account (MRU when multiple), or null when none/ambiguous',
6560
+ example: 'Liabilities:CreditCard',
6561
+ nullable: true
6164
6562
  }
6165
6563
  },
6166
6564
  required: ['asset', 'expense', 'income', 'liability']
@@ -6185,7 +6583,8 @@ export const $NlpResponseDto = {
6185
6583
  'confirm_rule',
6186
6584
  'confirm_account',
6187
6585
  'confirm_payee',
6188
- 'cancel'
6586
+ 'cancel',
6587
+ 'aborted'
6189
6588
  ]
6190
6589
  },
6191
6590
  intent: {
@@ -6347,7 +6746,7 @@ export const $NlpResponseDto = {
6347
6746
  },
6348
6747
  suggestedAccounts: {
6349
6748
  description:
6350
- 'Suggested accounts for this transaction. Contains recommended source and destination accounts based on the detected intent and rules.',
6749
+ '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.',
6351
6750
  allOf: [
6352
6751
  {
6353
6752
  $ref: '#/components/schemas/NlpSuggestedAccountsDto'
@@ -6356,7 +6755,7 @@ export const $NlpResponseDto = {
6356
6755
  },
6357
6756
  defaultAccounts: {
6358
6757
  description:
6359
- 'Default accounts for the user/region. These are fallback accounts used when no specific suggestion is available.',
6758
+ 'Default fallback accounts for the user/region (#586). v1 returns universal constants; per-user personalization is planned.',
6360
6759
  allOf: [
6361
6760
  {
6362
6761
  $ref: '#/components/schemas/NlpDefaultAccountsDto'
@@ -6367,6 +6766,148 @@ export const $NlpResponseDto = {
6367
6766
  required: ['status', 'action']
6368
6767
  } as const;
6369
6768
 
6769
+ export const $PlatformListItemDto = {
6770
+ type: 'object',
6771
+ properties: {
6772
+ id: {
6773
+ type: 'string',
6774
+ description: 'Global platform ID'
6775
+ },
6776
+ name: {
6777
+ type: 'string',
6778
+ description: 'Platform name'
6779
+ },
6780
+ url: {
6781
+ type: 'string',
6782
+ description: 'Platform URL'
6783
+ },
6784
+ type: {
6785
+ type: 'string',
6786
+ description: 'Platform type',
6787
+ enum: [
6788
+ 'BANK',
6789
+ 'BROKERAGE',
6790
+ 'CRYPTO_EXCHANGE',
6791
+ 'PAYMENT',
6792
+ 'INVESTMENT',
6793
+ 'INSURANCE',
6794
+ 'OTHER'
6795
+ ]
6796
+ },
6797
+ canonical: {
6798
+ type: 'string',
6799
+ description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
6800
+ },
6801
+ suggestedSegment: {
6802
+ type: 'string',
6803
+ description:
6804
+ 'Suggested path segment — canonical with first char uppercased (ACC_COMP_NAME_RE)'
6805
+ },
6806
+ logoUrl: {
6807
+ type: 'string',
6808
+ description: 'Logo URL',
6809
+ nullable: true
6810
+ },
6811
+ isBound: {
6812
+ type: 'boolean',
6813
+ description: 'Whether user has accounts using this platform'
6814
+ }
6815
+ },
6816
+ required: [
6817
+ 'id',
6818
+ 'name',
6819
+ 'url',
6820
+ 'type',
6821
+ 'canonical',
6822
+ 'suggestedSegment',
6823
+ 'logoUrl',
6824
+ 'isBound'
6825
+ ]
6826
+ } as const;
6827
+
6828
+ export const $PlatformMatchResultDto = {
6829
+ type: 'object',
6830
+ properties: {
6831
+ id: {
6832
+ type: 'string',
6833
+ description: 'Global platform ID'
6834
+ },
6835
+ name: {
6836
+ type: 'string',
6837
+ description: 'Platform name (e.g., "ICBC")'
6838
+ },
6839
+ canonical: {
6840
+ type: 'string',
6841
+ description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
6842
+ },
6843
+ type: {
6844
+ type: 'string',
6845
+ description: 'Platform type',
6846
+ enum: [
6847
+ 'BANK',
6848
+ 'BROKERAGE',
6849
+ 'CRYPTO_EXCHANGE',
6850
+ 'PAYMENT',
6851
+ 'INVESTMENT',
6852
+ 'INSURANCE',
6853
+ 'OTHER'
6854
+ ]
6855
+ },
6856
+ suggestedSegment: {
6857
+ type: 'string',
6858
+ description:
6859
+ 'Suggested path segment — canonical, already in ACCOUNT_RE format'
6860
+ },
6861
+ logoUrl: {
6862
+ type: 'string',
6863
+ description: 'Logo URL',
6864
+ nullable: true
6865
+ },
6866
+ matchType: {
6867
+ type: 'string',
6868
+ description: "How this row matched: 'exact' > 'prefix' > 'substring'",
6869
+ enum: ['exact', 'prefix', 'substring']
6870
+ }
6871
+ },
6872
+ required: [
6873
+ 'id',
6874
+ 'name',
6875
+ 'canonical',
6876
+ 'type',
6877
+ 'suggestedSegment',
6878
+ 'logoUrl',
6879
+ 'matchType'
6880
+ ]
6881
+ } as const;
6882
+
6883
+ export const $PlatformMatchResponseDto = {
6884
+ type: 'object',
6885
+ properties: {
6886
+ platforms: {
6887
+ description: 'Ranked matches, best tier first (at most 10 rows)',
6888
+ type: 'array',
6889
+ items: {
6890
+ $ref: '#/components/schemas/PlatformMatchResultDto'
6891
+ }
6892
+ },
6893
+ matchType: {
6894
+ type: 'string',
6895
+ description:
6896
+ "Overall match quality — top row's tier, or 'none' when no hits",
6897
+ enum: ['none', 'exact', 'prefix', 'substring']
6898
+ },
6899
+ total: {
6900
+ type: 'number',
6901
+ description: 'Total matches before LIMIT (truncation transparency)'
6902
+ },
6903
+ hasMore: {
6904
+ type: 'boolean',
6905
+ description: 'true when total > platforms.length (more matches exist)'
6906
+ }
6907
+ },
6908
+ required: ['platforms', 'matchType', 'total', 'hasMore']
6909
+ } as const;
6910
+
6370
6911
  export const $CreatePlatformDto = {
6371
6912
  type: 'object',
6372
6913
  properties: {
@@ -7509,344 +8050,220 @@ export const $HoldingPnlWarningDto = {
7509
8050
  'OVERSOLD_LOTS',
7510
8051
  'NO_PRICE',
7511
8052
  'MIXED_COST_CURRENCY'
7512
- ]
7513
- },
7514
- symbol: {
7515
- type: 'object',
7516
- nullable: true
7517
- },
7518
- accountId: {
7519
- type: 'object',
7520
- nullable: true
7521
- },
7522
- currency: {
7523
- type: 'object',
7524
- nullable: true
7525
- }
7526
- },
7527
- required: ['type']
7528
- } as const;
7529
-
7530
- export const $HoldingPnlResponseDto = {
7531
- type: 'object',
7532
- properties: {
7533
- asOfDate: {
7534
- type: 'string',
7535
- example: '2026-07-08'
7536
- },
7537
- baseCurrency: {
7538
- type: 'string',
7539
- example: 'CNY'
7540
- },
7541
- method: {
7542
- type: 'string',
7543
- description:
7544
- 'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
7545
- enum: ['average', 'FIFO'],
7546
- example: 'average'
7547
- },
7548
- rows: {
7549
- type: 'array',
7550
- items: {
7551
- $ref: '#/components/schemas/HoldingPnlRowDto'
7552
- }
7553
- },
7554
- warnings: {
7555
- type: 'array',
7556
- items: {
7557
- $ref: '#/components/schemas/HoldingPnlWarningDto'
7558
- }
7559
- }
7560
- },
7561
- required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
7562
- } as const;
7563
-
7564
- export const $CurrencyBalanceDto = {
7565
- type: 'object',
7566
- properties: {
7567
- currency: {
7568
- type: 'string',
7569
- description: 'ISO 4217 currency code',
7570
- example: 'CNY'
7571
- },
7572
- balance: {
7573
- type: 'string',
7574
- description: 'Balance amount',
7575
- example: '500000.00'
7576
- }
7577
- },
7578
- required: ['currency', 'balance']
7579
- } as const;
7580
-
7581
- export const $TimeSeriesPointDto = {
7582
- type: 'object',
7583
- properties: {
7584
- date: {
7585
- type: 'string',
7586
- description: 'Date in YYYY-MM-DD format',
7587
- example: '2024-06-15'
7588
- },
7589
- value: {
7590
- type: 'string',
7591
- description: 'Value at this date (in base currency)',
7592
- example: '500000.00'
7593
- },
7594
- change: {
7595
- type: 'object',
7596
- description: 'Change from previous point',
7597
- example: '5000.00'
7598
- },
7599
- assets: {
7600
- type: 'string',
7601
- description: 'Total assets at this date (in base currency)',
7602
- example: '494338.00'
7603
- },
7604
- liabilities: {
7605
- type: 'string',
7606
- description: 'Total liabilities at this date (in base currency)',
7607
- example: '310098.00'
7608
- },
7609
- byCurrency: {
7610
- description: 'Multi-currency breakdown for this point',
7611
- type: 'array',
7612
- items: {
7613
- $ref: '#/components/schemas/CurrencyBalanceDto'
7614
- }
7615
- }
7616
- },
7617
- required: ['date', 'value']
7618
- } as const;
7619
-
7620
- export const $TrendSummaryDto = {
7621
- type: 'object',
7622
- properties: {
7623
- startValue: {
7624
- type: 'string',
7625
- description: 'Value at start of period',
7626
- example: '450000.00'
7627
- },
7628
- endValue: {
7629
- type: 'string',
7630
- description: 'Value at end of period',
7631
- example: '500000.00'
7632
- },
7633
- totalChange: {
7634
- type: 'string',
7635
- description: 'Total change over period',
7636
- example: '50000.00'
7637
- },
7638
- totalChangePercentage: {
7639
- type: 'string',
7640
- description: 'Total change percentage',
7641
- example: '+11.11%'
7642
- }
7643
- },
7644
- required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
7645
- } as const;
7646
-
7647
- export const $MultiCurrencyPointDto = {
7648
- type: 'object',
7649
- properties: {
7650
- date: {
7651
- type: 'string',
7652
- description: 'Date in YYYY-MM-DD format',
7653
- example: '2024-06-15'
8053
+ ]
7654
8054
  },
7655
- byCurrency: {
7656
- description: 'Balances by currency',
7657
- type: 'array',
7658
- items: {
7659
- $ref: '#/components/schemas/CurrencyBalanceDto'
7660
- }
8055
+ symbol: {
8056
+ type: 'object',
8057
+ nullable: true
8058
+ },
8059
+ accountId: {
8060
+ type: 'object',
8061
+ nullable: true
8062
+ },
8063
+ currency: {
8064
+ type: 'object',
8065
+ nullable: true
7661
8066
  }
7662
8067
  },
7663
- required: ['date', 'byCurrency']
8068
+ required: ['type']
7664
8069
  } as const;
7665
8070
 
7666
- export const $PortfolioTrendsResponseDto = {
8071
+ export const $HoldingPnlResponseDto = {
7667
8072
  type: 'object',
7668
8073
  properties: {
7669
- series: {
7670
- description: 'Time series data points',
7671
- type: 'array',
7672
- items: {
7673
- $ref: '#/components/schemas/TimeSeriesPointDto'
7674
- }
7675
- },
7676
- summary: {
7677
- description: 'Period summary',
7678
- allOf: [
7679
- {
7680
- $ref: '#/components/schemas/TrendSummaryDto'
7681
- }
7682
- ]
7683
- },
7684
- period: {
7685
- type: 'string',
7686
- description: 'Period requested',
7687
- example: '6m'
7688
- },
7689
- granularity: {
8074
+ asOfDate: {
7690
8075
  type: 'string',
7691
- description: 'Data granularity',
7692
- example: 'month'
8076
+ example: '2026-07-08'
7693
8077
  },
7694
- currency: {
8078
+ baseCurrency: {
7695
8079
  type: 'string',
7696
- description: 'Base currency for converted values',
7697
8080
  example: 'CNY'
7698
8081
  },
7699
- byCurrency: {
8082
+ method: {
8083
+ type: 'string',
7700
8084
  description:
7701
- 'Multi-currency time series (each point has currency breakdown)',
8085
+ 'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
8086
+ enum: ['average', 'FIFO'],
8087
+ example: 'average'
8088
+ },
8089
+ rows: {
7702
8090
  type: 'array',
7703
8091
  items: {
7704
- $ref: '#/components/schemas/MultiCurrencyPointDto'
8092
+ $ref: '#/components/schemas/HoldingPnlRowDto'
7705
8093
  }
7706
8094
  },
7707
8095
  warnings: {
7708
- description: 'Exchange rate warnings',
7709
8096
  type: 'array',
7710
8097
  items: {
7711
- $ref: '#/components/schemas/ExchangeRateWarningDto'
8098
+ $ref: '#/components/schemas/HoldingPnlWarningDto'
7712
8099
  }
7713
8100
  }
7714
8101
  },
7715
- required: ['series', 'summary', 'period', 'granularity', 'currency']
8102
+ required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
7716
8103
  } as const;
7717
8104
 
7718
- export const $CashFlowPointDto = {
8105
+ export const $AnonymousLoginDto = {
7719
8106
  type: 'object',
7720
8107
  properties: {
7721
- month: {
7722
- type: 'string',
7723
- description: 'Month key (YYYY-MM)',
7724
- example: '2024-03'
7725
- },
7726
- income: {
7727
- type: 'string',
7728
- description: 'Income in base currency (absolute, converted)',
7729
- example: '10000.00'
7730
- },
7731
- expense: {
7732
- type: 'string',
7733
- description: 'Expense in base currency (absolute, converted)',
7734
- example: '5000.00'
7735
- },
7736
- netSavings: {
8108
+ accessToken: {
7737
8109
  type: 'string',
7738
- description: 'netSavings = income expense (savings positive)',
7739
- example: '5000.00'
8110
+ description: 'Access token for anonymous login'
7740
8111
  }
7741
8112
  },
7742
- required: ['month', 'income', 'expense', 'netSavings']
8113
+ required: ['accessToken']
7743
8114
  } as const;
7744
8115
 
7745
- export const $CashFlowTrendSummaryDto = {
8116
+ export const $AnonymousLoginResponseDto = {
7746
8117
  type: 'object',
7747
8118
  properties: {
7748
- totalIncome: {
7749
- type: 'string',
7750
- description: 'Total income across the period',
7751
- example: '60000.00'
7752
- },
7753
- totalExpense: {
7754
- type: 'string',
7755
- description: 'Total expense across the period',
7756
- example: '30000.00'
7757
- },
7758
- totalNetSavings: {
7759
- type: 'string',
7760
- description: 'income − expense across the period',
7761
- example: '30000.00'
7762
- },
7763
- averageMonthlyNetSavings: {
8119
+ authToken: {
7764
8120
  type: 'string',
7765
- description:
7766
- 'totalNetSavings divided by the window length (N months, incl. zero-filled)',
7767
- example: '5000.00'
8121
+ description: 'JWT auth token',
8122
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
7768
8123
  }
7769
8124
  },
7770
- required: [
7771
- 'totalIncome',
7772
- 'totalExpense',
7773
- 'totalNetSavings',
7774
- 'averageMonthlyNetSavings'
7775
- ]
8125
+ required: ['authToken']
7776
8126
  } as const;
7777
8127
 
7778
- export const $CashFlowTrendsResponseDto = {
8128
+ export const $SymbolSearchResultDto = {
7779
8129
  type: 'object',
7780
8130
  properties: {
7781
- series: {
7782
- description:
7783
- 'Monthly cash-flow series (fixed N-month window, zero-filled)',
7784
- type: 'array',
7785
- items: {
7786
- $ref: '#/components/schemas/CashFlowPointDto'
7787
- }
8131
+ symbol: {
8132
+ type: 'string',
8133
+ example: 'AAPL'
7788
8134
  },
7789
- summary: {
7790
- description: 'Period totals',
7791
- allOf: [
7792
- {
7793
- $ref: '#/components/schemas/CashFlowTrendSummaryDto'
7794
- }
7795
- ]
8135
+ name: {
8136
+ type: 'object',
8137
+ example: 'Apple Inc.',
8138
+ nullable: true
7796
8139
  },
7797
- period: {
7798
- type: 'string',
7799
- description: 'Period requested',
7800
- example: '6m'
8140
+ exchange: {
8141
+ type: 'object',
8142
+ example: 'US',
8143
+ nullable: true
7801
8144
  },
7802
- granularity: {
7803
- type: 'string',
7804
- description: 'Data granularity (v1 returns month buckets)',
7805
- example: 'month'
8145
+ assetType: {
8146
+ type: 'object',
8147
+ description: 'OpenBB asset_type (e.g. stock, etf)',
8148
+ example: 'stock',
8149
+ nullable: true
7806
8150
  },
7807
- currency: {
7808
- type: 'string',
7809
- description: 'Base currency for converted values',
7810
- example: 'CNY'
8151
+ assetClass: {
8152
+ type: 'object',
8153
+ description: 'IGN asset class (region.types.ts ASSET_CLASSES)',
8154
+ example: 'EQUITY',
8155
+ nullable: true
7811
8156
  },
7812
- warnings: {
7813
- description: 'Exchange rate warnings (e.g. missing rate for a currency)',
7814
- type: 'array',
7815
- items: {
7816
- $ref: '#/components/schemas/ExchangeRateWarningDto'
7817
- }
8157
+ assetSubClass: {
8158
+ type: 'object',
8159
+ description: 'IGN asset sub-class (region.types.ts ASSET_SUB_CLASSES)',
8160
+ example: 'STOCK',
8161
+ nullable: true
8162
+ },
8163
+ currency: {
8164
+ type: 'object',
8165
+ description: 'Trading currency (extra_data or inferred from exchange)',
8166
+ example: 'USD',
8167
+ nullable: true
7818
8168
  }
7819
8169
  },
7820
- required: ['series', 'summary', 'period', 'granularity', 'currency']
7821
- } as const;
7822
-
7823
- export const $GenerateSnapshotBody = {
7824
- type: 'object',
7825
- properties: {}
7826
- } as const;
7827
-
7828
- export const $GenerateSnapshotResponse = {
7829
- type: 'object',
7830
- properties: {}
7831
- } as const;
7832
-
7833
- export const $BackfillSnapshotsBody = {
7834
- type: 'object',
7835
- properties: {}
7836
- } as const;
7837
-
7838
- export const $BackfillSnapshotsResponse = {
7839
- type: 'object',
7840
- properties: {}
8170
+ required: ['symbol']
7841
8171
  } as const;
7842
8172
 
7843
- export const $AnonymousLoginDto = {
8173
+ export const $SymbolQuoteDto = {
7844
8174
  type: 'object',
7845
8175
  properties: {
7846
- accessToken: {
8176
+ symbol: {
7847
8177
  type: 'string',
7848
- description: 'Access token for anonymous login'
8178
+ example: 'AAPL'
8179
+ },
8180
+ name: {
8181
+ type: 'object',
8182
+ example: 'Apple Inc.',
8183
+ nullable: true
8184
+ },
8185
+ exchange: {
8186
+ type: 'object',
8187
+ example: 'US',
8188
+ nullable: true
8189
+ },
8190
+ assetType: {
8191
+ type: 'object',
8192
+ description: 'OpenBB asset_type',
8193
+ example: 'stock',
8194
+ nullable: true
8195
+ },
8196
+ assetClass: {
8197
+ type: 'object',
8198
+ description: 'IGN asset class',
8199
+ example: 'EQUITY',
8200
+ nullable: true
8201
+ },
8202
+ assetSubClass: {
8203
+ type: 'object',
8204
+ description: 'IGN asset sub-class',
8205
+ example: 'STOCK',
8206
+ nullable: true
8207
+ },
8208
+ currency: {
8209
+ type: 'object',
8210
+ description: 'Trading currency (extra_data or inferred from exchange)',
8211
+ example: 'USD',
8212
+ nullable: true
8213
+ },
8214
+ price: {
8215
+ type: 'object',
8216
+ description: 'Latest price (Decimal string)',
8217
+ example: '189.84',
8218
+ nullable: true
8219
+ },
8220
+ priceDate: {
8221
+ type: 'object',
8222
+ description: 'Date the price was observed (ISO yyyy-MM-dd)',
8223
+ example: '2026-08-05',
8224
+ nullable: true
8225
+ },
8226
+ changePercent: {
8227
+ type: 'object',
8228
+ description:
8229
+ '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.',
8230
+ example: 1.7,
8231
+ nullable: true
8232
+ },
8233
+ prevClose: {
8234
+ type: 'object',
8235
+ description: 'Previous close (Decimal string)',
8236
+ nullable: true
8237
+ },
8238
+ open: {
8239
+ type: 'object',
8240
+ description: 'Day open (Decimal string)',
8241
+ nullable: true
8242
+ },
8243
+ high: {
8244
+ type: 'object',
8245
+ description: 'Day high (Decimal string)',
8246
+ nullable: true
8247
+ },
8248
+ low: {
8249
+ type: 'object',
8250
+ description: 'Day low (Decimal string)',
8251
+ nullable: true
8252
+ },
8253
+ volume: {
8254
+ type: 'object',
8255
+ description: 'Day volume (Decimal string)',
8256
+ nullable: true
8257
+ },
8258
+ yearHigh: {
8259
+ type: 'object',
8260
+ description: '52-week high (Decimal string)',
8261
+ nullable: true
8262
+ },
8263
+ yearLow: {
8264
+ type: 'object',
8265
+ description: '52-week low (Decimal string)',
8266
+ nullable: true
7849
8267
  }
7850
- },
7851
- required: ['accessToken']
8268
+ }
7852
8269
  } as const;