adaptic-backend 1.0.151 → 1.0.152

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.
Files changed (65) hide show
  1. package/Account.cjs +1029 -0
  2. package/Action.cjs +3460 -0
  3. package/Alert.cjs +3800 -0
  4. package/AlpacaAccount.cjs +2888 -0
  5. package/Asset.cjs +3659 -0
  6. package/Authenticator.cjs +1029 -0
  7. package/Customer.cjs +1029 -0
  8. package/NewsArticle.cjs +892 -0
  9. package/NewsArticleAssetSentiment.cjs +1243 -0
  10. package/Order.cjs +4500 -0
  11. package/Position.cjs +4288 -0
  12. package/Session.cjs +1029 -0
  13. package/StopLoss.cjs +1832 -0
  14. package/TakeProfit.cjs +1832 -0
  15. package/Trade.cjs +5276 -0
  16. package/User.cjs +3103 -0
  17. package/package.json +1 -1
  18. package/server/Account.d.ts.map +1 -1
  19. package/server/Account.js.map +1 -1
  20. package/server/Account.mjs +1029 -0
  21. package/server/Action.d.ts.map +1 -1
  22. package/server/Action.js.map +1 -1
  23. package/server/Action.mjs +3460 -0
  24. package/server/Alert.d.ts.map +1 -1
  25. package/server/Alert.js.map +1 -1
  26. package/server/Alert.mjs +3800 -0
  27. package/server/AlpacaAccount.d.ts.map +1 -1
  28. package/server/AlpacaAccount.js.map +1 -1
  29. package/server/AlpacaAccount.mjs +2888 -0
  30. package/server/Asset.d.ts.map +1 -1
  31. package/server/Asset.js.map +1 -1
  32. package/server/Asset.mjs +3659 -0
  33. package/server/Authenticator.d.ts.map +1 -1
  34. package/server/Authenticator.js.map +1 -1
  35. package/server/Authenticator.mjs +1029 -0
  36. package/server/Customer.d.ts.map +1 -1
  37. package/server/Customer.js.map +1 -1
  38. package/server/Customer.mjs +1029 -0
  39. package/server/NewsArticle.d.ts.map +1 -1
  40. package/server/NewsArticle.js.map +1 -1
  41. package/server/NewsArticle.mjs +892 -0
  42. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  43. package/server/NewsArticleAssetSentiment.js.map +1 -1
  44. package/server/NewsArticleAssetSentiment.mjs +1243 -0
  45. package/server/Order.d.ts.map +1 -1
  46. package/server/Order.js.map +1 -1
  47. package/server/Order.mjs +4500 -0
  48. package/server/Position.d.ts.map +1 -1
  49. package/server/Position.js.map +1 -1
  50. package/server/Position.mjs +4288 -0
  51. package/server/Session.d.ts.map +1 -1
  52. package/server/Session.js.map +1 -1
  53. package/server/Session.mjs +1029 -0
  54. package/server/StopLoss.d.ts.map +1 -1
  55. package/server/StopLoss.js.map +1 -1
  56. package/server/StopLoss.mjs +1832 -0
  57. package/server/TakeProfit.d.ts.map +1 -1
  58. package/server/TakeProfit.js.map +1 -1
  59. package/server/TakeProfit.mjs +1832 -0
  60. package/server/Trade.d.ts.map +1 -1
  61. package/server/Trade.js.map +1 -1
  62. package/server/Trade.mjs +5276 -0
  63. package/server/User.d.ts.map +1 -1
  64. package/server/User.js.map +1 -1
  65. package/server/User.mjs +3103 -0
package/server/Alert.mjs CHANGED
@@ -82,6 +82,87 @@ export const Alert = {
82
82
  plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
83
83
  openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
84
84
  openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
85
+ customer: props.alpacaAccount.user.customer ?
86
+ typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
87
+ ? { connect: {
88
+ id: props.alpacaAccount.user.customer.id
89
+ }
90
+ }
91
+ : { connectOrCreate: {
92
+ where: {
93
+ id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
94
+ name: props.alpacaAccount.user.customer.name !== undefined ? {
95
+ equals: props.alpacaAccount.user.customer.name
96
+ } : undefined,
97
+ },
98
+ create: {
99
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
100
+ name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
101
+ plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
102
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
103
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
104
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
105
+ stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
106
+ },
107
+ }
108
+ } : undefined,
109
+ accounts: props.alpacaAccount.user.accounts ?
110
+ Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
111
+ connect: props.alpacaAccount.user.accounts.map((item) => ({
112
+ id: item.id
113
+ }))
114
+ }
115
+ : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
116
+ where: {
117
+ id: item.id !== undefined ? item.id : undefined,
118
+ },
119
+ create: {
120
+ type: item.type !== undefined ? item.type : undefined,
121
+ provider: item.provider !== undefined ? item.provider : undefined,
122
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
123
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
124
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
125
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
126
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
127
+ scope: item.scope !== undefined ? item.scope : undefined,
128
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
129
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
130
+ },
131
+ }))
132
+ } : undefined,
133
+ sessions: props.alpacaAccount.user.sessions ?
134
+ Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
135
+ connect: props.alpacaAccount.user.sessions.map((item) => ({
136
+ id: item.id
137
+ }))
138
+ }
139
+ : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
140
+ where: {
141
+ id: item.id !== undefined ? item.id : undefined,
142
+ },
143
+ create: {
144
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
145
+ expires: item.expires !== undefined ? item.expires : undefined,
146
+ },
147
+ }))
148
+ } : undefined,
149
+ authenticators: props.alpacaAccount.user.authenticators ?
150
+ Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
151
+ connect: props.alpacaAccount.user.authenticators.map((item) => ({
152
+ id: item.id
153
+ }))
154
+ }
155
+ : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
156
+ where: {
157
+ id: item.id !== undefined ? item.id : undefined,
158
+ },
159
+ create: {
160
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
161
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
162
+ counter: item.counter !== undefined ? item.counter : undefined,
163
+ },
164
+ }))
165
+ } : undefined,
85
166
  },
86
167
  }
87
168
  } : undefined,
@@ -107,6 +188,96 @@ export const Alert = {
107
188
  confidence: item.confidence !== undefined ? item.confidence : undefined,
108
189
  timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
109
190
  status: item.status !== undefined ? item.status : undefined,
191
+ asset: item.asset ?
192
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
193
+ ? { connect: {
194
+ id: item.asset.id
195
+ }
196
+ }
197
+ : { connectOrCreate: {
198
+ where: {
199
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
200
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
201
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
202
+ },
203
+ create: {
204
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
205
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
206
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
207
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
208
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
209
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
210
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
211
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
212
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
213
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
214
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
215
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
216
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
217
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
218
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
219
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
220
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
221
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
222
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
223
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
224
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
225
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
226
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
227
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
228
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
229
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
230
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
231
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
232
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
233
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
234
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
235
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
236
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
237
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
238
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
239
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
240
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
241
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
242
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
243
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
244
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
245
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
246
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
247
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
248
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
249
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
250
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
251
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
252
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
253
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
254
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
255
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
256
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
257
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
258
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
259
+ },
260
+ }
261
+ } : undefined,
262
+ actions: item.actions ?
263
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
264
+ connect: item.actions.map((item) => ({
265
+ id: item.id
266
+ }))
267
+ }
268
+ : { connectOrCreate: item.actions.map((item) => ({
269
+ where: {
270
+ id: item.id !== undefined ? item.id : undefined,
271
+ },
272
+ create: {
273
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
274
+ type: item.type !== undefined ? item.type : undefined,
275
+ note: item.note !== undefined ? item.note : undefined,
276
+ status: item.status !== undefined ? item.status : undefined,
277
+ fee: item.fee !== undefined ? item.fee : undefined,
278
+ },
279
+ }))
280
+ } : undefined,
110
281
  },
111
282
  }))
112
283
  } : undefined,
@@ -143,6 +314,128 @@ export const Alert = {
143
314
  optionType: item.optionType !== undefined ? item.optionType : undefined,
144
315
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
145
316
  takeProfitId: item.takeProfitId !== undefined ? item.takeProfitId : undefined,
317
+ stopLoss: item.stopLoss ?
318
+ typeof item.stopLoss === 'object' && Object.keys(item.stopLoss).length === 1 && Object.keys(item.stopLoss)[0] === 'id'
319
+ ? { connect: {
320
+ id: item.stopLoss.id
321
+ }
322
+ }
323
+ : { connectOrCreate: {
324
+ where: {
325
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
326
+ },
327
+ create: {
328
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
329
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
330
+ },
331
+ }
332
+ } : undefined,
333
+ takeProfit: item.takeProfit ?
334
+ typeof item.takeProfit === 'object' && Object.keys(item.takeProfit).length === 1 && Object.keys(item.takeProfit)[0] === 'id'
335
+ ? { connect: {
336
+ id: item.takeProfit.id
337
+ }
338
+ }
339
+ : { connectOrCreate: {
340
+ where: {
341
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
342
+ },
343
+ create: {
344
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
345
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
346
+ },
347
+ }
348
+ } : undefined,
349
+ action: item.action ?
350
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
351
+ ? { connect: {
352
+ id: item.action.id
353
+ }
354
+ }
355
+ : { connectOrCreate: {
356
+ where: {
357
+ id: item.action.id !== undefined ? item.action.id : undefined,
358
+ },
359
+ create: {
360
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
361
+ type: item.action.type !== undefined ? item.action.type : undefined,
362
+ note: item.action.note !== undefined ? item.action.note : undefined,
363
+ status: item.action.status !== undefined ? item.action.status : undefined,
364
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
365
+ },
366
+ }
367
+ } : undefined,
368
+ asset: item.asset ?
369
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
370
+ ? { connect: {
371
+ id: item.asset.id
372
+ }
373
+ }
374
+ : { connectOrCreate: {
375
+ where: {
376
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
377
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
378
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
379
+ },
380
+ create: {
381
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
382
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
383
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
384
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
385
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
386
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
387
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
388
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
389
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
390
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
391
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
392
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
393
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
394
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
395
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
396
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
397
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
398
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
399
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
400
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
401
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
402
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
403
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
404
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
405
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
406
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
407
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
408
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
409
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
410
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
411
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
412
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
413
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
414
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
415
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
416
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
417
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
418
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
419
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
420
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
421
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
422
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
423
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
424
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
425
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
426
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
427
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
428
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
429
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
430
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
431
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
432
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
433
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
434
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
435
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
436
+ },
437
+ }
438
+ } : undefined,
146
439
  },
147
440
  }))
148
441
  } : undefined,
@@ -170,6 +463,77 @@ export const Alert = {
170
463
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
171
464
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
172
465
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
466
+ asset: item.asset ?
467
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
468
+ ? { connect: {
469
+ id: item.asset.id
470
+ }
471
+ }
472
+ : { connectOrCreate: {
473
+ where: {
474
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
475
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
476
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
477
+ },
478
+ create: {
479
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
480
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
481
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
482
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
483
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
484
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
485
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
486
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
487
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
488
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
489
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
490
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
491
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
492
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
493
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
494
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
495
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
496
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
497
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
498
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
499
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
500
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
501
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
502
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
503
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
504
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
505
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
506
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
507
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
508
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
509
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
510
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
511
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
512
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
513
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
514
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
515
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
516
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
517
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
518
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
519
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
520
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
521
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
522
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
523
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
524
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
525
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
526
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
527
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
528
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
529
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
530
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
531
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
532
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
533
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
534
+ },
535
+ }
536
+ } : undefined,
173
537
  },
174
538
  }))
175
539
  } : undefined,
@@ -362,6 +726,152 @@ export const Alert = {
362
726
  openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? {
363
727
  set: props.alpacaAccount.user.openaiModel
364
728
  } : undefined,
729
+ customer: props.alpacaAccount.user.customer ? {
730
+ upsert: {
731
+ where: {
732
+ id: props.alpacaAccount.user.customer.id !== undefined ? {
733
+ equals: props.alpacaAccount.user.customer.id
734
+ } : undefined,
735
+ name: props.alpacaAccount.user.customer.name !== undefined ? {
736
+ equals: props.alpacaAccount.user.customer.name
737
+ } : undefined,
738
+ },
739
+ update: {
740
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
741
+ set: props.alpacaAccount.user.customer.authUserId
742
+ } : undefined,
743
+ name: props.alpacaAccount.user.customer.name !== undefined ? {
744
+ set: props.alpacaAccount.user.customer.name
745
+ } : undefined,
746
+ plan: props.alpacaAccount.user.customer.plan !== undefined ? {
747
+ set: props.alpacaAccount.user.customer.plan
748
+ } : undefined,
749
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
750
+ set: props.alpacaAccount.user.customer.stripeCustomerId
751
+ } : undefined,
752
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
753
+ set: props.alpacaAccount.user.customer.stripeSubscriptionId
754
+ } : undefined,
755
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
756
+ set: props.alpacaAccount.user.customer.stripePriceId
757
+ } : undefined,
758
+ stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? {
759
+ set: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd
760
+ } : undefined,
761
+ },
762
+ create: {
763
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
764
+ name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
765
+ plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
766
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
767
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
768
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
769
+ stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
770
+ },
771
+ }
772
+ } : undefined,
773
+ accounts: props.alpacaAccount.user.accounts ? {
774
+ upsert: props.alpacaAccount.user.accounts.map((item) => ({
775
+ where: {
776
+ id: item.id !== undefined ? item.id : undefined,
777
+ },
778
+ update: {
779
+ id: item.id !== undefined ? {
780
+ set: item.id
781
+ } : undefined,
782
+ type: item.type !== undefined ? {
783
+ set: item.type
784
+ } : undefined,
785
+ provider: item.provider !== undefined ? {
786
+ set: item.provider
787
+ } : undefined,
788
+ providerAccountId: item.providerAccountId !== undefined ? {
789
+ set: item.providerAccountId
790
+ } : undefined,
791
+ refresh_token: item.refresh_token !== undefined ? {
792
+ set: item.refresh_token
793
+ } : undefined,
794
+ access_token: item.access_token !== undefined ? {
795
+ set: item.access_token
796
+ } : undefined,
797
+ expires_at: item.expires_at !== undefined ? {
798
+ set: item.expires_at
799
+ } : undefined,
800
+ token_type: item.token_type !== undefined ? {
801
+ set: item.token_type
802
+ } : undefined,
803
+ scope: item.scope !== undefined ? {
804
+ set: item.scope
805
+ } : undefined,
806
+ id_token: item.id_token !== undefined ? {
807
+ set: item.id_token
808
+ } : undefined,
809
+ session_state: item.session_state !== undefined ? {
810
+ set: item.session_state
811
+ } : undefined,
812
+ },
813
+ create: {
814
+ type: item.type !== undefined ? item.type : undefined,
815
+ provider: item.provider !== undefined ? item.provider : undefined,
816
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
817
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
818
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
819
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
820
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
821
+ scope: item.scope !== undefined ? item.scope : undefined,
822
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
823
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
824
+ },
825
+ }))
826
+ } : undefined,
827
+ sessions: props.alpacaAccount.user.sessions ? {
828
+ upsert: props.alpacaAccount.user.sessions.map((item) => ({
829
+ where: {
830
+ id: item.id !== undefined ? item.id : undefined,
831
+ },
832
+ update: {
833
+ id: item.id !== undefined ? {
834
+ set: item.id
835
+ } : undefined,
836
+ sessionToken: item.sessionToken !== undefined ? {
837
+ set: item.sessionToken
838
+ } : undefined,
839
+ expires: item.expires !== undefined ? {
840
+ set: item.expires
841
+ } : undefined,
842
+ },
843
+ create: {
844
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
845
+ expires: item.expires !== undefined ? item.expires : undefined,
846
+ },
847
+ }))
848
+ } : undefined,
849
+ authenticators: props.alpacaAccount.user.authenticators ? {
850
+ upsert: props.alpacaAccount.user.authenticators.map((item) => ({
851
+ where: {
852
+ id: item.id !== undefined ? item.id : undefined,
853
+ },
854
+ update: {
855
+ id: item.id !== undefined ? {
856
+ set: item.id
857
+ } : undefined,
858
+ credentialID: item.credentialID !== undefined ? {
859
+ set: item.credentialID
860
+ } : undefined,
861
+ publicKey: item.publicKey !== undefined ? {
862
+ set: item.publicKey
863
+ } : undefined,
864
+ counter: item.counter !== undefined ? {
865
+ set: item.counter
866
+ } : undefined,
867
+ },
868
+ create: {
869
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
870
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
871
+ counter: item.counter !== undefined ? item.counter : undefined,
872
+ },
873
+ }))
874
+ } : undefined,
365
875
  },
366
876
  create: {
367
877
  name: props.alpacaAccount.user.name !== undefined ? props.alpacaAccount.user.name : undefined,
@@ -375,6 +885,87 @@ export const Alert = {
375
885
  plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
376
886
  openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
377
887
  openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
888
+ customer: props.alpacaAccount.user.customer ?
889
+ typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
890
+ ? { connect: {
891
+ id: props.alpacaAccount.user.customer.id
892
+ }
893
+ }
894
+ : { connectOrCreate: {
895
+ where: {
896
+ id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
897
+ name: props.alpacaAccount.user.customer.name !== undefined ? {
898
+ equals: props.alpacaAccount.user.customer.name
899
+ } : undefined,
900
+ },
901
+ create: {
902
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
903
+ name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
904
+ plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
905
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
906
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
907
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
908
+ stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
909
+ },
910
+ }
911
+ } : undefined,
912
+ accounts: props.alpacaAccount.user.accounts ?
913
+ Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
914
+ connect: props.alpacaAccount.user.accounts.map((item) => ({
915
+ id: item.id
916
+ }))
917
+ }
918
+ : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
919
+ where: {
920
+ id: item.id !== undefined ? item.id : undefined,
921
+ },
922
+ create: {
923
+ type: item.type !== undefined ? item.type : undefined,
924
+ provider: item.provider !== undefined ? item.provider : undefined,
925
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
926
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
927
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
928
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
929
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
930
+ scope: item.scope !== undefined ? item.scope : undefined,
931
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
932
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
933
+ },
934
+ }))
935
+ } : undefined,
936
+ sessions: props.alpacaAccount.user.sessions ?
937
+ Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
938
+ connect: props.alpacaAccount.user.sessions.map((item) => ({
939
+ id: item.id
940
+ }))
941
+ }
942
+ : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
943
+ where: {
944
+ id: item.id !== undefined ? item.id : undefined,
945
+ },
946
+ create: {
947
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
948
+ expires: item.expires !== undefined ? item.expires : undefined,
949
+ },
950
+ }))
951
+ } : undefined,
952
+ authenticators: props.alpacaAccount.user.authenticators ?
953
+ Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
954
+ connect: props.alpacaAccount.user.authenticators.map((item) => ({
955
+ id: item.id
956
+ }))
957
+ }
958
+ : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
959
+ where: {
960
+ id: item.id !== undefined ? item.id : undefined,
961
+ },
962
+ create: {
963
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
964
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
965
+ counter: item.counter !== undefined ? item.counter : undefined,
966
+ },
967
+ }))
968
+ } : undefined,
378
969
  },
379
970
  }
380
971
  } : undefined,
@@ -420,6 +1011,282 @@ export const Alert = {
420
1011
  status: item.status !== undefined ? {
421
1012
  set: item.status
422
1013
  } : undefined,
1014
+ asset: item.asset ? {
1015
+ upsert: {
1016
+ where: {
1017
+ id: item.asset.id !== undefined ? {
1018
+ equals: item.asset.id
1019
+ } : undefined,
1020
+ symbol: item.asset.symbol !== undefined ? {
1021
+ equals: item.asset.symbol
1022
+ } : undefined,
1023
+ name: item.asset.name !== undefined ? {
1024
+ equals: item.asset.name
1025
+ } : undefined,
1026
+ },
1027
+ update: {
1028
+ id: item.asset.id !== undefined ? {
1029
+ set: item.asset.id
1030
+ } : undefined,
1031
+ symbol: item.asset.symbol !== undefined ? {
1032
+ set: item.asset.symbol
1033
+ } : undefined,
1034
+ name: item.asset.name !== undefined ? {
1035
+ set: item.asset.name
1036
+ } : undefined,
1037
+ type: item.asset.type !== undefined ? {
1038
+ set: item.asset.type
1039
+ } : undefined,
1040
+ logoUrl: item.asset.logoUrl !== undefined ? {
1041
+ set: item.asset.logoUrl
1042
+ } : undefined,
1043
+ description: item.asset.description !== undefined ? {
1044
+ set: item.asset.description
1045
+ } : undefined,
1046
+ cik: item.asset.cik !== undefined ? {
1047
+ set: item.asset.cik
1048
+ } : undefined,
1049
+ exchange: item.asset.exchange !== undefined ? {
1050
+ set: item.asset.exchange
1051
+ } : undefined,
1052
+ currency: item.asset.currency !== undefined ? {
1053
+ set: item.asset.currency
1054
+ } : undefined,
1055
+ country: item.asset.country !== undefined ? {
1056
+ set: item.asset.country
1057
+ } : undefined,
1058
+ sector: item.asset.sector !== undefined ? {
1059
+ set: item.asset.sector
1060
+ } : undefined,
1061
+ industry: item.asset.industry !== undefined ? {
1062
+ set: item.asset.industry
1063
+ } : undefined,
1064
+ address: item.asset.address !== undefined ? {
1065
+ set: item.asset.address
1066
+ } : undefined,
1067
+ officialSite: item.asset.officialSite !== undefined ? {
1068
+ set: item.asset.officialSite
1069
+ } : undefined,
1070
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
1071
+ set: item.asset.fiscalYearEnd
1072
+ } : undefined,
1073
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
1074
+ set: item.asset.latestQuarter
1075
+ } : undefined,
1076
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
1077
+ set: item.asset.marketCapitalization
1078
+ } : undefined,
1079
+ ebitda: item.asset.ebitda !== undefined ? {
1080
+ set: item.asset.ebitda
1081
+ } : undefined,
1082
+ peRatio: item.asset.peRatio !== undefined ? {
1083
+ set: item.asset.peRatio
1084
+ } : undefined,
1085
+ pegRatio: item.asset.pegRatio !== undefined ? {
1086
+ set: item.asset.pegRatio
1087
+ } : undefined,
1088
+ bookValue: item.asset.bookValue !== undefined ? {
1089
+ set: item.asset.bookValue
1090
+ } : undefined,
1091
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
1092
+ set: item.asset.dividendPerShare
1093
+ } : undefined,
1094
+ dividendYield: item.asset.dividendYield !== undefined ? {
1095
+ set: item.asset.dividendYield
1096
+ } : undefined,
1097
+ eps: item.asset.eps !== undefined ? {
1098
+ set: item.asset.eps
1099
+ } : undefined,
1100
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
1101
+ set: item.asset.revenuePerShareTTM
1102
+ } : undefined,
1103
+ profitMargin: item.asset.profitMargin !== undefined ? {
1104
+ set: item.asset.profitMargin
1105
+ } : undefined,
1106
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
1107
+ set: item.asset.operatingMarginTTM
1108
+ } : undefined,
1109
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
1110
+ set: item.asset.returnOnAssetsTTM
1111
+ } : undefined,
1112
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
1113
+ set: item.asset.returnOnEquityTTM
1114
+ } : undefined,
1115
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
1116
+ set: item.asset.revenueTTM
1117
+ } : undefined,
1118
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
1119
+ set: item.asset.grossProfitTTM
1120
+ } : undefined,
1121
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
1122
+ set: item.asset.dilutedEPSTTM
1123
+ } : undefined,
1124
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
1125
+ set: item.asset.quarterlyEarningsGrowthYOY
1126
+ } : undefined,
1127
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
1128
+ set: item.asset.quarterlyRevenueGrowthYOY
1129
+ } : undefined,
1130
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
1131
+ set: item.asset.analystTargetPrice
1132
+ } : undefined,
1133
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
1134
+ set: item.asset.analystRatingStrongBuy
1135
+ } : undefined,
1136
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
1137
+ set: item.asset.analystRatingBuy
1138
+ } : undefined,
1139
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
1140
+ set: item.asset.analystRatingHold
1141
+ } : undefined,
1142
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
1143
+ set: item.asset.analystRatingSell
1144
+ } : undefined,
1145
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
1146
+ set: item.asset.analystRatingStrongSell
1147
+ } : undefined,
1148
+ trailingPE: item.asset.trailingPE !== undefined ? {
1149
+ set: item.asset.trailingPE
1150
+ } : undefined,
1151
+ forwardPE: item.asset.forwardPE !== undefined ? {
1152
+ set: item.asset.forwardPE
1153
+ } : undefined,
1154
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
1155
+ set: item.asset.priceToSalesRatioTTM
1156
+ } : undefined,
1157
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
1158
+ set: item.asset.priceToBookRatio
1159
+ } : undefined,
1160
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
1161
+ set: item.asset.evToRevenue
1162
+ } : undefined,
1163
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
1164
+ set: item.asset.evToEbitda
1165
+ } : undefined,
1166
+ beta: item.asset.beta !== undefined ? {
1167
+ set: item.asset.beta
1168
+ } : undefined,
1169
+ week52High: item.asset.week52High !== undefined ? {
1170
+ set: item.asset.week52High
1171
+ } : undefined,
1172
+ week52Low: item.asset.week52Low !== undefined ? {
1173
+ set: item.asset.week52Low
1174
+ } : undefined,
1175
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
1176
+ set: item.asset.day50MovingAverage
1177
+ } : undefined,
1178
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
1179
+ set: item.asset.day200MovingAverage
1180
+ } : undefined,
1181
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
1182
+ set: item.asset.sharesOutstanding
1183
+ } : undefined,
1184
+ dividendDate: item.asset.dividendDate !== undefined ? {
1185
+ set: item.asset.dividendDate
1186
+ } : undefined,
1187
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
1188
+ set: item.asset.exDividendDate
1189
+ } : undefined,
1190
+ askPrice: item.asset.askPrice !== undefined ? {
1191
+ set: item.asset.askPrice
1192
+ } : undefined,
1193
+ bidPrice: item.asset.bidPrice !== undefined ? {
1194
+ set: item.asset.bidPrice
1195
+ } : undefined,
1196
+ },
1197
+ create: {
1198
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1199
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1200
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
1201
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
1202
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
1203
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
1204
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
1205
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
1206
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
1207
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
1208
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
1209
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
1210
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
1211
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
1212
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
1213
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
1214
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
1215
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
1216
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
1217
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
1218
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
1219
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
1220
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
1221
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
1222
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
1223
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
1224
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
1225
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
1226
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
1227
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
1228
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
1229
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
1230
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
1231
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
1232
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
1233
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
1234
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
1235
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
1236
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
1237
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
1238
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
1239
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
1240
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
1241
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
1242
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
1243
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
1244
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
1245
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
1246
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
1247
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
1248
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
1249
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
1250
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
1251
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
1252
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
1253
+ },
1254
+ }
1255
+ } : undefined,
1256
+ actions: item.actions ? {
1257
+ upsert: item.actions.map((item) => ({
1258
+ where: {
1259
+ id: item.id !== undefined ? item.id : undefined,
1260
+ },
1261
+ update: {
1262
+ id: item.id !== undefined ? {
1263
+ set: item.id
1264
+ } : undefined,
1265
+ sequence: item.sequence !== undefined ? {
1266
+ set: item.sequence
1267
+ } : undefined,
1268
+ type: item.type !== undefined ? {
1269
+ set: item.type
1270
+ } : undefined,
1271
+ note: item.note !== undefined ? {
1272
+ set: item.note
1273
+ } : undefined,
1274
+ status: item.status !== undefined ? {
1275
+ set: item.status
1276
+ } : undefined,
1277
+ fee: item.fee !== undefined ? {
1278
+ set: item.fee
1279
+ } : undefined,
1280
+ },
1281
+ create: {
1282
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
1283
+ type: item.type !== undefined ? item.type : undefined,
1284
+ note: item.note !== undefined ? item.note : undefined,
1285
+ status: item.status !== undefined ? item.status : undefined,
1286
+ fee: item.fee !== undefined ? item.fee : undefined,
1287
+ },
1288
+ }))
1289
+ } : undefined,
423
1290
  },
424
1291
  create: {
425
1292
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -433,6 +1300,96 @@ export const Alert = {
433
1300
  confidence: item.confidence !== undefined ? item.confidence : undefined,
434
1301
  timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
435
1302
  status: item.status !== undefined ? item.status : undefined,
1303
+ asset: item.asset ?
1304
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
1305
+ ? { connect: {
1306
+ id: item.asset.id
1307
+ }
1308
+ }
1309
+ : { connectOrCreate: {
1310
+ where: {
1311
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
1312
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1313
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1314
+ },
1315
+ create: {
1316
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1317
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1318
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
1319
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
1320
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
1321
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
1322
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
1323
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
1324
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
1325
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
1326
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
1327
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
1328
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
1329
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
1330
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
1331
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
1332
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
1333
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
1334
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
1335
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
1336
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
1337
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
1338
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
1339
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
1340
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
1341
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
1342
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
1343
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
1344
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
1345
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
1346
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
1347
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
1348
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
1349
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
1350
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
1351
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
1352
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
1353
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
1354
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
1355
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
1356
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
1357
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
1358
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
1359
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
1360
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
1361
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
1362
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
1363
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
1364
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
1365
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
1366
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
1367
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
1368
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
1369
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
1370
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
1371
+ },
1372
+ }
1373
+ } : undefined,
1374
+ actions: item.actions ?
1375
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
1376
+ connect: item.actions.map((item) => ({
1377
+ id: item.id
1378
+ }))
1379
+ }
1380
+ : { connectOrCreate: item.actions.map((item) => ({
1381
+ where: {
1382
+ id: item.id !== undefined ? item.id : undefined,
1383
+ },
1384
+ create: {
1385
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
1386
+ type: item.type !== undefined ? item.type : undefined,
1387
+ note: item.note !== undefined ? item.note : undefined,
1388
+ status: item.status !== undefined ? item.status : undefined,
1389
+ fee: item.fee !== undefined ? item.fee : undefined,
1390
+ },
1391
+ }))
1392
+ } : undefined,
436
1393
  },
437
1394
  }))
438
1395
  } : undefined,
@@ -511,6 +1468,332 @@ export const Alert = {
511
1468
  takeProfitId: item.takeProfitId !== undefined ? {
512
1469
  set: item.takeProfitId
513
1470
  } : undefined,
1471
+ stopLoss: item.stopLoss ? {
1472
+ upsert: {
1473
+ where: {
1474
+ id: item.stopLoss.id !== undefined ? {
1475
+ equals: item.stopLoss.id
1476
+ } : undefined,
1477
+ },
1478
+ update: {
1479
+ id: item.stopLoss.id !== undefined ? {
1480
+ set: item.stopLoss.id
1481
+ } : undefined,
1482
+ stopPrice: item.stopLoss.stopPrice !== undefined ? {
1483
+ set: item.stopLoss.stopPrice
1484
+ } : undefined,
1485
+ limitPrice: item.stopLoss.limitPrice !== undefined ? {
1486
+ set: item.stopLoss.limitPrice
1487
+ } : undefined,
1488
+ },
1489
+ create: {
1490
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
1491
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
1492
+ },
1493
+ }
1494
+ } : undefined,
1495
+ takeProfit: item.takeProfit ? {
1496
+ upsert: {
1497
+ where: {
1498
+ id: item.takeProfit.id !== undefined ? {
1499
+ equals: item.takeProfit.id
1500
+ } : undefined,
1501
+ },
1502
+ update: {
1503
+ id: item.takeProfit.id !== undefined ? {
1504
+ set: item.takeProfit.id
1505
+ } : undefined,
1506
+ limitPrice: item.takeProfit.limitPrice !== undefined ? {
1507
+ set: item.takeProfit.limitPrice
1508
+ } : undefined,
1509
+ stopPrice: item.takeProfit.stopPrice !== undefined ? {
1510
+ set: item.takeProfit.stopPrice
1511
+ } : undefined,
1512
+ },
1513
+ create: {
1514
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
1515
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
1516
+ },
1517
+ }
1518
+ } : undefined,
1519
+ action: item.action ? {
1520
+ upsert: {
1521
+ where: {
1522
+ id: item.action.id !== undefined ? {
1523
+ equals: item.action.id
1524
+ } : undefined,
1525
+ },
1526
+ update: {
1527
+ id: item.action.id !== undefined ? {
1528
+ set: item.action.id
1529
+ } : undefined,
1530
+ sequence: item.action.sequence !== undefined ? {
1531
+ set: item.action.sequence
1532
+ } : undefined,
1533
+ type: item.action.type !== undefined ? {
1534
+ set: item.action.type
1535
+ } : undefined,
1536
+ note: item.action.note !== undefined ? {
1537
+ set: item.action.note
1538
+ } : undefined,
1539
+ status: item.action.status !== undefined ? {
1540
+ set: item.action.status
1541
+ } : undefined,
1542
+ fee: item.action.fee !== undefined ? {
1543
+ set: item.action.fee
1544
+ } : undefined,
1545
+ },
1546
+ create: {
1547
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
1548
+ type: item.action.type !== undefined ? item.action.type : undefined,
1549
+ note: item.action.note !== undefined ? item.action.note : undefined,
1550
+ status: item.action.status !== undefined ? item.action.status : undefined,
1551
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
1552
+ },
1553
+ }
1554
+ } : undefined,
1555
+ asset: item.asset ? {
1556
+ upsert: {
1557
+ where: {
1558
+ id: item.asset.id !== undefined ? {
1559
+ equals: item.asset.id
1560
+ } : undefined,
1561
+ symbol: item.asset.symbol !== undefined ? {
1562
+ equals: item.asset.symbol
1563
+ } : undefined,
1564
+ name: item.asset.name !== undefined ? {
1565
+ equals: item.asset.name
1566
+ } : undefined,
1567
+ },
1568
+ update: {
1569
+ id: item.asset.id !== undefined ? {
1570
+ set: item.asset.id
1571
+ } : undefined,
1572
+ symbol: item.asset.symbol !== undefined ? {
1573
+ set: item.asset.symbol
1574
+ } : undefined,
1575
+ name: item.asset.name !== undefined ? {
1576
+ set: item.asset.name
1577
+ } : undefined,
1578
+ type: item.asset.type !== undefined ? {
1579
+ set: item.asset.type
1580
+ } : undefined,
1581
+ logoUrl: item.asset.logoUrl !== undefined ? {
1582
+ set: item.asset.logoUrl
1583
+ } : undefined,
1584
+ description: item.asset.description !== undefined ? {
1585
+ set: item.asset.description
1586
+ } : undefined,
1587
+ cik: item.asset.cik !== undefined ? {
1588
+ set: item.asset.cik
1589
+ } : undefined,
1590
+ exchange: item.asset.exchange !== undefined ? {
1591
+ set: item.asset.exchange
1592
+ } : undefined,
1593
+ currency: item.asset.currency !== undefined ? {
1594
+ set: item.asset.currency
1595
+ } : undefined,
1596
+ country: item.asset.country !== undefined ? {
1597
+ set: item.asset.country
1598
+ } : undefined,
1599
+ sector: item.asset.sector !== undefined ? {
1600
+ set: item.asset.sector
1601
+ } : undefined,
1602
+ industry: item.asset.industry !== undefined ? {
1603
+ set: item.asset.industry
1604
+ } : undefined,
1605
+ address: item.asset.address !== undefined ? {
1606
+ set: item.asset.address
1607
+ } : undefined,
1608
+ officialSite: item.asset.officialSite !== undefined ? {
1609
+ set: item.asset.officialSite
1610
+ } : undefined,
1611
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
1612
+ set: item.asset.fiscalYearEnd
1613
+ } : undefined,
1614
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
1615
+ set: item.asset.latestQuarter
1616
+ } : undefined,
1617
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
1618
+ set: item.asset.marketCapitalization
1619
+ } : undefined,
1620
+ ebitda: item.asset.ebitda !== undefined ? {
1621
+ set: item.asset.ebitda
1622
+ } : undefined,
1623
+ peRatio: item.asset.peRatio !== undefined ? {
1624
+ set: item.asset.peRatio
1625
+ } : undefined,
1626
+ pegRatio: item.asset.pegRatio !== undefined ? {
1627
+ set: item.asset.pegRatio
1628
+ } : undefined,
1629
+ bookValue: item.asset.bookValue !== undefined ? {
1630
+ set: item.asset.bookValue
1631
+ } : undefined,
1632
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
1633
+ set: item.asset.dividendPerShare
1634
+ } : undefined,
1635
+ dividendYield: item.asset.dividendYield !== undefined ? {
1636
+ set: item.asset.dividendYield
1637
+ } : undefined,
1638
+ eps: item.asset.eps !== undefined ? {
1639
+ set: item.asset.eps
1640
+ } : undefined,
1641
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
1642
+ set: item.asset.revenuePerShareTTM
1643
+ } : undefined,
1644
+ profitMargin: item.asset.profitMargin !== undefined ? {
1645
+ set: item.asset.profitMargin
1646
+ } : undefined,
1647
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
1648
+ set: item.asset.operatingMarginTTM
1649
+ } : undefined,
1650
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
1651
+ set: item.asset.returnOnAssetsTTM
1652
+ } : undefined,
1653
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
1654
+ set: item.asset.returnOnEquityTTM
1655
+ } : undefined,
1656
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
1657
+ set: item.asset.revenueTTM
1658
+ } : undefined,
1659
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
1660
+ set: item.asset.grossProfitTTM
1661
+ } : undefined,
1662
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
1663
+ set: item.asset.dilutedEPSTTM
1664
+ } : undefined,
1665
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
1666
+ set: item.asset.quarterlyEarningsGrowthYOY
1667
+ } : undefined,
1668
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
1669
+ set: item.asset.quarterlyRevenueGrowthYOY
1670
+ } : undefined,
1671
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
1672
+ set: item.asset.analystTargetPrice
1673
+ } : undefined,
1674
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
1675
+ set: item.asset.analystRatingStrongBuy
1676
+ } : undefined,
1677
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
1678
+ set: item.asset.analystRatingBuy
1679
+ } : undefined,
1680
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
1681
+ set: item.asset.analystRatingHold
1682
+ } : undefined,
1683
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
1684
+ set: item.asset.analystRatingSell
1685
+ } : undefined,
1686
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
1687
+ set: item.asset.analystRatingStrongSell
1688
+ } : undefined,
1689
+ trailingPE: item.asset.trailingPE !== undefined ? {
1690
+ set: item.asset.trailingPE
1691
+ } : undefined,
1692
+ forwardPE: item.asset.forwardPE !== undefined ? {
1693
+ set: item.asset.forwardPE
1694
+ } : undefined,
1695
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
1696
+ set: item.asset.priceToSalesRatioTTM
1697
+ } : undefined,
1698
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
1699
+ set: item.asset.priceToBookRatio
1700
+ } : undefined,
1701
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
1702
+ set: item.asset.evToRevenue
1703
+ } : undefined,
1704
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
1705
+ set: item.asset.evToEbitda
1706
+ } : undefined,
1707
+ beta: item.asset.beta !== undefined ? {
1708
+ set: item.asset.beta
1709
+ } : undefined,
1710
+ week52High: item.asset.week52High !== undefined ? {
1711
+ set: item.asset.week52High
1712
+ } : undefined,
1713
+ week52Low: item.asset.week52Low !== undefined ? {
1714
+ set: item.asset.week52Low
1715
+ } : undefined,
1716
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
1717
+ set: item.asset.day50MovingAverage
1718
+ } : undefined,
1719
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
1720
+ set: item.asset.day200MovingAverage
1721
+ } : undefined,
1722
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
1723
+ set: item.asset.sharesOutstanding
1724
+ } : undefined,
1725
+ dividendDate: item.asset.dividendDate !== undefined ? {
1726
+ set: item.asset.dividendDate
1727
+ } : undefined,
1728
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
1729
+ set: item.asset.exDividendDate
1730
+ } : undefined,
1731
+ askPrice: item.asset.askPrice !== undefined ? {
1732
+ set: item.asset.askPrice
1733
+ } : undefined,
1734
+ bidPrice: item.asset.bidPrice !== undefined ? {
1735
+ set: item.asset.bidPrice
1736
+ } : undefined,
1737
+ },
1738
+ create: {
1739
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1740
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1741
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
1742
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
1743
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
1744
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
1745
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
1746
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
1747
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
1748
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
1749
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
1750
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
1751
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
1752
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
1753
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
1754
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
1755
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
1756
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
1757
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
1758
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
1759
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
1760
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
1761
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
1762
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
1763
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
1764
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
1765
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
1766
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
1767
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
1768
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
1769
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
1770
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
1771
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
1772
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
1773
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
1774
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
1775
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
1776
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
1777
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
1778
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
1779
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
1780
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
1781
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
1782
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
1783
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
1784
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
1785
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
1786
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
1787
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
1788
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
1789
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
1790
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
1791
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
1792
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
1793
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
1794
+ },
1795
+ }
1796
+ } : undefined,
514
1797
  },
515
1798
  create: {
516
1799
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -535,6 +1818,128 @@ export const Alert = {
535
1818
  optionType: item.optionType !== undefined ? item.optionType : undefined,
536
1819
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
537
1820
  takeProfitId: item.takeProfitId !== undefined ? item.takeProfitId : undefined,
1821
+ stopLoss: item.stopLoss ?
1822
+ typeof item.stopLoss === 'object' && Object.keys(item.stopLoss).length === 1 && Object.keys(item.stopLoss)[0] === 'id'
1823
+ ? { connect: {
1824
+ id: item.stopLoss.id
1825
+ }
1826
+ }
1827
+ : { connectOrCreate: {
1828
+ where: {
1829
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1830
+ },
1831
+ create: {
1832
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
1833
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
1834
+ },
1835
+ }
1836
+ } : undefined,
1837
+ takeProfit: item.takeProfit ?
1838
+ typeof item.takeProfit === 'object' && Object.keys(item.takeProfit).length === 1 && Object.keys(item.takeProfit)[0] === 'id'
1839
+ ? { connect: {
1840
+ id: item.takeProfit.id
1841
+ }
1842
+ }
1843
+ : { connectOrCreate: {
1844
+ where: {
1845
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1846
+ },
1847
+ create: {
1848
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
1849
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
1850
+ },
1851
+ }
1852
+ } : undefined,
1853
+ action: item.action ?
1854
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
1855
+ ? { connect: {
1856
+ id: item.action.id
1857
+ }
1858
+ }
1859
+ : { connectOrCreate: {
1860
+ where: {
1861
+ id: item.action.id !== undefined ? item.action.id : undefined,
1862
+ },
1863
+ create: {
1864
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
1865
+ type: item.action.type !== undefined ? item.action.type : undefined,
1866
+ note: item.action.note !== undefined ? item.action.note : undefined,
1867
+ status: item.action.status !== undefined ? item.action.status : undefined,
1868
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
1869
+ },
1870
+ }
1871
+ } : undefined,
1872
+ asset: item.asset ?
1873
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
1874
+ ? { connect: {
1875
+ id: item.asset.id
1876
+ }
1877
+ }
1878
+ : { connectOrCreate: {
1879
+ where: {
1880
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
1881
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1882
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1883
+ },
1884
+ create: {
1885
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1886
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1887
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
1888
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
1889
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
1890
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
1891
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
1892
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
1893
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
1894
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
1895
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
1896
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
1897
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
1898
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
1899
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
1900
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
1901
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
1902
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
1903
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
1904
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
1905
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
1906
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
1907
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
1908
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
1909
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
1910
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
1911
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
1912
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
1913
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
1914
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
1915
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
1916
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
1917
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
1918
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
1919
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
1920
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
1921
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
1922
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
1923
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
1924
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
1925
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
1926
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
1927
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
1928
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
1929
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
1930
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
1931
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
1932
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
1933
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
1934
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
1935
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
1936
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
1937
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
1938
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
1939
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
1940
+ },
1941
+ }
1942
+ } : undefined,
538
1943
  },
539
1944
  }))
540
1945
  } : undefined,
@@ -586,6 +1991,248 @@ export const Alert = {
586
1991
  assetMarginable: item.assetMarginable !== undefined ? {
587
1992
  set: item.assetMarginable
588
1993
  } : undefined,
1994
+ asset: item.asset ? {
1995
+ upsert: {
1996
+ where: {
1997
+ id: item.asset.id !== undefined ? {
1998
+ equals: item.asset.id
1999
+ } : undefined,
2000
+ symbol: item.asset.symbol !== undefined ? {
2001
+ equals: item.asset.symbol
2002
+ } : undefined,
2003
+ name: item.asset.name !== undefined ? {
2004
+ equals: item.asset.name
2005
+ } : undefined,
2006
+ },
2007
+ update: {
2008
+ id: item.asset.id !== undefined ? {
2009
+ set: item.asset.id
2010
+ } : undefined,
2011
+ symbol: item.asset.symbol !== undefined ? {
2012
+ set: item.asset.symbol
2013
+ } : undefined,
2014
+ name: item.asset.name !== undefined ? {
2015
+ set: item.asset.name
2016
+ } : undefined,
2017
+ type: item.asset.type !== undefined ? {
2018
+ set: item.asset.type
2019
+ } : undefined,
2020
+ logoUrl: item.asset.logoUrl !== undefined ? {
2021
+ set: item.asset.logoUrl
2022
+ } : undefined,
2023
+ description: item.asset.description !== undefined ? {
2024
+ set: item.asset.description
2025
+ } : undefined,
2026
+ cik: item.asset.cik !== undefined ? {
2027
+ set: item.asset.cik
2028
+ } : undefined,
2029
+ exchange: item.asset.exchange !== undefined ? {
2030
+ set: item.asset.exchange
2031
+ } : undefined,
2032
+ currency: item.asset.currency !== undefined ? {
2033
+ set: item.asset.currency
2034
+ } : undefined,
2035
+ country: item.asset.country !== undefined ? {
2036
+ set: item.asset.country
2037
+ } : undefined,
2038
+ sector: item.asset.sector !== undefined ? {
2039
+ set: item.asset.sector
2040
+ } : undefined,
2041
+ industry: item.asset.industry !== undefined ? {
2042
+ set: item.asset.industry
2043
+ } : undefined,
2044
+ address: item.asset.address !== undefined ? {
2045
+ set: item.asset.address
2046
+ } : undefined,
2047
+ officialSite: item.asset.officialSite !== undefined ? {
2048
+ set: item.asset.officialSite
2049
+ } : undefined,
2050
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
2051
+ set: item.asset.fiscalYearEnd
2052
+ } : undefined,
2053
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
2054
+ set: item.asset.latestQuarter
2055
+ } : undefined,
2056
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
2057
+ set: item.asset.marketCapitalization
2058
+ } : undefined,
2059
+ ebitda: item.asset.ebitda !== undefined ? {
2060
+ set: item.asset.ebitda
2061
+ } : undefined,
2062
+ peRatio: item.asset.peRatio !== undefined ? {
2063
+ set: item.asset.peRatio
2064
+ } : undefined,
2065
+ pegRatio: item.asset.pegRatio !== undefined ? {
2066
+ set: item.asset.pegRatio
2067
+ } : undefined,
2068
+ bookValue: item.asset.bookValue !== undefined ? {
2069
+ set: item.asset.bookValue
2070
+ } : undefined,
2071
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
2072
+ set: item.asset.dividendPerShare
2073
+ } : undefined,
2074
+ dividendYield: item.asset.dividendYield !== undefined ? {
2075
+ set: item.asset.dividendYield
2076
+ } : undefined,
2077
+ eps: item.asset.eps !== undefined ? {
2078
+ set: item.asset.eps
2079
+ } : undefined,
2080
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
2081
+ set: item.asset.revenuePerShareTTM
2082
+ } : undefined,
2083
+ profitMargin: item.asset.profitMargin !== undefined ? {
2084
+ set: item.asset.profitMargin
2085
+ } : undefined,
2086
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
2087
+ set: item.asset.operatingMarginTTM
2088
+ } : undefined,
2089
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
2090
+ set: item.asset.returnOnAssetsTTM
2091
+ } : undefined,
2092
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
2093
+ set: item.asset.returnOnEquityTTM
2094
+ } : undefined,
2095
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
2096
+ set: item.asset.revenueTTM
2097
+ } : undefined,
2098
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
2099
+ set: item.asset.grossProfitTTM
2100
+ } : undefined,
2101
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
2102
+ set: item.asset.dilutedEPSTTM
2103
+ } : undefined,
2104
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
2105
+ set: item.asset.quarterlyEarningsGrowthYOY
2106
+ } : undefined,
2107
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
2108
+ set: item.asset.quarterlyRevenueGrowthYOY
2109
+ } : undefined,
2110
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
2111
+ set: item.asset.analystTargetPrice
2112
+ } : undefined,
2113
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
2114
+ set: item.asset.analystRatingStrongBuy
2115
+ } : undefined,
2116
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
2117
+ set: item.asset.analystRatingBuy
2118
+ } : undefined,
2119
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
2120
+ set: item.asset.analystRatingHold
2121
+ } : undefined,
2122
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
2123
+ set: item.asset.analystRatingSell
2124
+ } : undefined,
2125
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
2126
+ set: item.asset.analystRatingStrongSell
2127
+ } : undefined,
2128
+ trailingPE: item.asset.trailingPE !== undefined ? {
2129
+ set: item.asset.trailingPE
2130
+ } : undefined,
2131
+ forwardPE: item.asset.forwardPE !== undefined ? {
2132
+ set: item.asset.forwardPE
2133
+ } : undefined,
2134
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
2135
+ set: item.asset.priceToSalesRatioTTM
2136
+ } : undefined,
2137
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
2138
+ set: item.asset.priceToBookRatio
2139
+ } : undefined,
2140
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
2141
+ set: item.asset.evToRevenue
2142
+ } : undefined,
2143
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
2144
+ set: item.asset.evToEbitda
2145
+ } : undefined,
2146
+ beta: item.asset.beta !== undefined ? {
2147
+ set: item.asset.beta
2148
+ } : undefined,
2149
+ week52High: item.asset.week52High !== undefined ? {
2150
+ set: item.asset.week52High
2151
+ } : undefined,
2152
+ week52Low: item.asset.week52Low !== undefined ? {
2153
+ set: item.asset.week52Low
2154
+ } : undefined,
2155
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
2156
+ set: item.asset.day50MovingAverage
2157
+ } : undefined,
2158
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
2159
+ set: item.asset.day200MovingAverage
2160
+ } : undefined,
2161
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
2162
+ set: item.asset.sharesOutstanding
2163
+ } : undefined,
2164
+ dividendDate: item.asset.dividendDate !== undefined ? {
2165
+ set: item.asset.dividendDate
2166
+ } : undefined,
2167
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
2168
+ set: item.asset.exDividendDate
2169
+ } : undefined,
2170
+ askPrice: item.asset.askPrice !== undefined ? {
2171
+ set: item.asset.askPrice
2172
+ } : undefined,
2173
+ bidPrice: item.asset.bidPrice !== undefined ? {
2174
+ set: item.asset.bidPrice
2175
+ } : undefined,
2176
+ },
2177
+ create: {
2178
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2179
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2180
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2181
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2182
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2183
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2184
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2185
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2186
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2187
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2188
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2189
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2190
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2191
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2192
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2193
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2194
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2195
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2196
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2197
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2198
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2199
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2200
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2201
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2202
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2203
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2204
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2205
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2206
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2207
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2208
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2209
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2210
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2211
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2212
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2213
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2214
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2215
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2216
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2217
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2218
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2219
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2220
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2221
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2222
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2223
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2224
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2225
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2226
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2227
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2228
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2229
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2230
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2231
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
2232
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
2233
+ },
2234
+ }
2235
+ } : undefined,
589
2236
  },
590
2237
  create: {
591
2238
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -601,6 +2248,77 @@ export const Alert = {
601
2248
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
602
2249
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
603
2250
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
2251
+ asset: item.asset ?
2252
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
2253
+ ? { connect: {
2254
+ id: item.asset.id
2255
+ }
2256
+ }
2257
+ : { connectOrCreate: {
2258
+ where: {
2259
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2260
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2261
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2262
+ },
2263
+ create: {
2264
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2265
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2266
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2267
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2268
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2269
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2270
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2271
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2272
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2273
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2274
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2275
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2276
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2277
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2278
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2279
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2280
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2281
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2282
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2283
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2284
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2285
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2286
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2287
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2288
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2289
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2290
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2291
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2292
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2293
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2294
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2295
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2296
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2297
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2298
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2299
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2300
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2301
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2302
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2303
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2304
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2305
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2306
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2307
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2308
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2309
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2310
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2311
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2312
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2313
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2314
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2315
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2316
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2317
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
2318
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
2319
+ },
2320
+ }
2321
+ } : undefined,
604
2322
  },
605
2323
  }))
606
2324
  } : undefined,
@@ -641,6 +2359,87 @@ export const Alert = {
641
2359
  plan: props.alpacaAccount.user.plan !== undefined ? props.alpacaAccount.user.plan : undefined,
642
2360
  openaiAPIKey: props.alpacaAccount.user.openaiAPIKey !== undefined ? props.alpacaAccount.user.openaiAPIKey : undefined,
643
2361
  openaiModel: props.alpacaAccount.user.openaiModel !== undefined ? props.alpacaAccount.user.openaiModel : undefined,
2362
+ customer: props.alpacaAccount.user.customer ?
2363
+ typeof props.alpacaAccount.user.customer === 'object' && Object.keys(props.alpacaAccount.user.customer).length === 1 && Object.keys(props.alpacaAccount.user.customer)[0] === 'id'
2364
+ ? { connect: {
2365
+ id: props.alpacaAccount.user.customer.id
2366
+ }
2367
+ }
2368
+ : { connectOrCreate: {
2369
+ where: {
2370
+ id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
2371
+ name: props.alpacaAccount.user.customer.name !== undefined ? {
2372
+ equals: props.alpacaAccount.user.customer.name
2373
+ } : undefined,
2374
+ },
2375
+ create: {
2376
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
2377
+ name: props.alpacaAccount.user.customer.name !== undefined ? props.alpacaAccount.user.customer.name : undefined,
2378
+ plan: props.alpacaAccount.user.customer.plan !== undefined ? props.alpacaAccount.user.customer.plan : undefined,
2379
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2380
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2381
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? props.alpacaAccount.user.customer.stripePriceId : undefined,
2382
+ stripeCurrentPeriodEnd: props.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? props.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
2383
+ },
2384
+ }
2385
+ } : undefined,
2386
+ accounts: props.alpacaAccount.user.accounts ?
2387
+ Array.isArray(props.alpacaAccount.user.accounts) && props.alpacaAccount.user.accounts.length > 0 && props.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2388
+ connect: props.alpacaAccount.user.accounts.map((item) => ({
2389
+ id: item.id
2390
+ }))
2391
+ }
2392
+ : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
2393
+ where: {
2394
+ id: item.id !== undefined ? item.id : undefined,
2395
+ },
2396
+ create: {
2397
+ type: item.type !== undefined ? item.type : undefined,
2398
+ provider: item.provider !== undefined ? item.provider : undefined,
2399
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
2400
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
2401
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
2402
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
2403
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
2404
+ scope: item.scope !== undefined ? item.scope : undefined,
2405
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
2406
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
2407
+ },
2408
+ }))
2409
+ } : undefined,
2410
+ sessions: props.alpacaAccount.user.sessions ?
2411
+ Array.isArray(props.alpacaAccount.user.sessions) && props.alpacaAccount.user.sessions.length > 0 && props.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2412
+ connect: props.alpacaAccount.user.sessions.map((item) => ({
2413
+ id: item.id
2414
+ }))
2415
+ }
2416
+ : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
2417
+ where: {
2418
+ id: item.id !== undefined ? item.id : undefined,
2419
+ },
2420
+ create: {
2421
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
2422
+ expires: item.expires !== undefined ? item.expires : undefined,
2423
+ },
2424
+ }))
2425
+ } : undefined,
2426
+ authenticators: props.alpacaAccount.user.authenticators ?
2427
+ Array.isArray(props.alpacaAccount.user.authenticators) && props.alpacaAccount.user.authenticators.length > 0 && props.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2428
+ connect: props.alpacaAccount.user.authenticators.map((item) => ({
2429
+ id: item.id
2430
+ }))
2431
+ }
2432
+ : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
2433
+ where: {
2434
+ id: item.id !== undefined ? item.id : undefined,
2435
+ },
2436
+ create: {
2437
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
2438
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
2439
+ counter: item.counter !== undefined ? item.counter : undefined,
2440
+ },
2441
+ }))
2442
+ } : undefined,
644
2443
  },
645
2444
  }
646
2445
  } : undefined,
@@ -666,6 +2465,96 @@ export const Alert = {
666
2465
  confidence: item.confidence !== undefined ? item.confidence : undefined,
667
2466
  timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
668
2467
  status: item.status !== undefined ? item.status : undefined,
2468
+ asset: item.asset ?
2469
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
2470
+ ? { connect: {
2471
+ id: item.asset.id
2472
+ }
2473
+ }
2474
+ : { connectOrCreate: {
2475
+ where: {
2476
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2477
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2478
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2479
+ },
2480
+ create: {
2481
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2482
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2483
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2484
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2485
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2486
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2487
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2488
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2489
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2490
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2491
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2492
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2493
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2494
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2495
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2496
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2497
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2498
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2499
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2500
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2501
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2502
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2503
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2504
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2505
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2506
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2507
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2508
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2509
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2510
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2511
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2512
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2513
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2514
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2515
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2516
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2517
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2518
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2519
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2520
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2521
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2522
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2523
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2524
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2525
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2526
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2527
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2528
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2529
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2530
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2531
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2532
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2533
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2534
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
2535
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
2536
+ },
2537
+ }
2538
+ } : undefined,
2539
+ actions: item.actions ?
2540
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
2541
+ connect: item.actions.map((item) => ({
2542
+ id: item.id
2543
+ }))
2544
+ }
2545
+ : { connectOrCreate: item.actions.map((item) => ({
2546
+ where: {
2547
+ id: item.id !== undefined ? item.id : undefined,
2548
+ },
2549
+ create: {
2550
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
2551
+ type: item.type !== undefined ? item.type : undefined,
2552
+ note: item.note !== undefined ? item.note : undefined,
2553
+ status: item.status !== undefined ? item.status : undefined,
2554
+ fee: item.fee !== undefined ? item.fee : undefined,
2555
+ },
2556
+ }))
2557
+ } : undefined,
669
2558
  },
670
2559
  }))
671
2560
  } : undefined,
@@ -702,6 +2591,128 @@ export const Alert = {
702
2591
  optionType: item.optionType !== undefined ? item.optionType : undefined,
703
2592
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
704
2593
  takeProfitId: item.takeProfitId !== undefined ? item.takeProfitId : undefined,
2594
+ stopLoss: item.stopLoss ?
2595
+ typeof item.stopLoss === 'object' && Object.keys(item.stopLoss).length === 1 && Object.keys(item.stopLoss)[0] === 'id'
2596
+ ? { connect: {
2597
+ id: item.stopLoss.id
2598
+ }
2599
+ }
2600
+ : { connectOrCreate: {
2601
+ where: {
2602
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
2603
+ },
2604
+ create: {
2605
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
2606
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
2607
+ },
2608
+ }
2609
+ } : undefined,
2610
+ takeProfit: item.takeProfit ?
2611
+ typeof item.takeProfit === 'object' && Object.keys(item.takeProfit).length === 1 && Object.keys(item.takeProfit)[0] === 'id'
2612
+ ? { connect: {
2613
+ id: item.takeProfit.id
2614
+ }
2615
+ }
2616
+ : { connectOrCreate: {
2617
+ where: {
2618
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
2619
+ },
2620
+ create: {
2621
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
2622
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
2623
+ },
2624
+ }
2625
+ } : undefined,
2626
+ action: item.action ?
2627
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
2628
+ ? { connect: {
2629
+ id: item.action.id
2630
+ }
2631
+ }
2632
+ : { connectOrCreate: {
2633
+ where: {
2634
+ id: item.action.id !== undefined ? item.action.id : undefined,
2635
+ },
2636
+ create: {
2637
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
2638
+ type: item.action.type !== undefined ? item.action.type : undefined,
2639
+ note: item.action.note !== undefined ? item.action.note : undefined,
2640
+ status: item.action.status !== undefined ? item.action.status : undefined,
2641
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
2642
+ },
2643
+ }
2644
+ } : undefined,
2645
+ asset: item.asset ?
2646
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
2647
+ ? { connect: {
2648
+ id: item.asset.id
2649
+ }
2650
+ }
2651
+ : { connectOrCreate: {
2652
+ where: {
2653
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2654
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2655
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2656
+ },
2657
+ create: {
2658
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2659
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2660
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2661
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2662
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2663
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2664
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2665
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2666
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2667
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2668
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2669
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2670
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2671
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2672
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2673
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2674
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2675
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2676
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2677
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2678
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2679
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2680
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2681
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2682
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2683
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2684
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2685
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2686
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2687
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2688
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2689
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2690
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2691
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2692
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2693
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2694
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2695
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2696
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2697
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2698
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2699
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2700
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2701
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2702
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2703
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2704
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2705
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2706
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2707
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2708
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2709
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2710
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2711
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
2712
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
2713
+ },
2714
+ }
2715
+ } : undefined,
705
2716
  },
706
2717
  }))
707
2718
  } : undefined,
@@ -729,6 +2740,77 @@ export const Alert = {
729
2740
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
730
2741
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
731
2742
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
2743
+ asset: item.asset ?
2744
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
2745
+ ? { connect: {
2746
+ id: item.asset.id
2747
+ }
2748
+ }
2749
+ : { connectOrCreate: {
2750
+ where: {
2751
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2752
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2753
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2754
+ },
2755
+ create: {
2756
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2757
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2758
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2759
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2760
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2761
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2762
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2763
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2764
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2765
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2766
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2767
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2768
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2769
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2770
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2771
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2772
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2773
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2774
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2775
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2776
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2777
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2778
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2779
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2780
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2781
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2782
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2783
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2784
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2785
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2786
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2787
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2788
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2789
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2790
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2791
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2792
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2793
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2794
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2795
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2796
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2797
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2798
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2799
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2800
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2801
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2802
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2803
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2804
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2805
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2806
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2807
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2808
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2809
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
2810
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
2811
+ },
2812
+ }
2813
+ } : undefined,
732
2814
  },
733
2815
  }))
734
2816
  } : undefined,
@@ -883,6 +2965,152 @@ export const Alert = {
883
2965
  openaiModel: prop.alpacaAccount.user.openaiModel !== undefined ? {
884
2966
  set: prop.alpacaAccount.user.openaiModel
885
2967
  } : undefined,
2968
+ customer: prop.alpacaAccount.user.customer ? {
2969
+ upsert: {
2970
+ where: {
2971
+ id: prop.alpacaAccount.user.customer.id !== undefined ? {
2972
+ equals: prop.alpacaAccount.user.customer.id
2973
+ } : undefined,
2974
+ name: prop.alpacaAccount.user.customer.name !== undefined ? {
2975
+ equals: prop.alpacaAccount.user.customer.name
2976
+ } : undefined,
2977
+ },
2978
+ update: {
2979
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
2980
+ set: prop.alpacaAccount.user.customer.authUserId
2981
+ } : undefined,
2982
+ name: prop.alpacaAccount.user.customer.name !== undefined ? {
2983
+ set: prop.alpacaAccount.user.customer.name
2984
+ } : undefined,
2985
+ plan: prop.alpacaAccount.user.customer.plan !== undefined ? {
2986
+ set: prop.alpacaAccount.user.customer.plan
2987
+ } : undefined,
2988
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
2989
+ set: prop.alpacaAccount.user.customer.stripeCustomerId
2990
+ } : undefined,
2991
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
2992
+ set: prop.alpacaAccount.user.customer.stripeSubscriptionId
2993
+ } : undefined,
2994
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
2995
+ set: prop.alpacaAccount.user.customer.stripePriceId
2996
+ } : undefined,
2997
+ stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? {
2998
+ set: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd
2999
+ } : undefined,
3000
+ },
3001
+ create: {
3002
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
3003
+ name: prop.alpacaAccount.user.customer.name !== undefined ? prop.alpacaAccount.user.customer.name : undefined,
3004
+ plan: prop.alpacaAccount.user.customer.plan !== undefined ? prop.alpacaAccount.user.customer.plan : undefined,
3005
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
3006
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
3007
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? prop.alpacaAccount.user.customer.stripePriceId : undefined,
3008
+ stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
3009
+ },
3010
+ }
3011
+ } : undefined,
3012
+ accounts: prop.alpacaAccount.user.accounts ? {
3013
+ upsert: prop.alpacaAccount.user.accounts.map((item) => ({
3014
+ where: {
3015
+ id: item.id !== undefined ? item.id : undefined,
3016
+ },
3017
+ update: {
3018
+ id: item.id !== undefined ? {
3019
+ set: item.id
3020
+ } : undefined,
3021
+ type: item.type !== undefined ? {
3022
+ set: item.type
3023
+ } : undefined,
3024
+ provider: item.provider !== undefined ? {
3025
+ set: item.provider
3026
+ } : undefined,
3027
+ providerAccountId: item.providerAccountId !== undefined ? {
3028
+ set: item.providerAccountId
3029
+ } : undefined,
3030
+ refresh_token: item.refresh_token !== undefined ? {
3031
+ set: item.refresh_token
3032
+ } : undefined,
3033
+ access_token: item.access_token !== undefined ? {
3034
+ set: item.access_token
3035
+ } : undefined,
3036
+ expires_at: item.expires_at !== undefined ? {
3037
+ set: item.expires_at
3038
+ } : undefined,
3039
+ token_type: item.token_type !== undefined ? {
3040
+ set: item.token_type
3041
+ } : undefined,
3042
+ scope: item.scope !== undefined ? {
3043
+ set: item.scope
3044
+ } : undefined,
3045
+ id_token: item.id_token !== undefined ? {
3046
+ set: item.id_token
3047
+ } : undefined,
3048
+ session_state: item.session_state !== undefined ? {
3049
+ set: item.session_state
3050
+ } : undefined,
3051
+ },
3052
+ create: {
3053
+ type: item.type !== undefined ? item.type : undefined,
3054
+ provider: item.provider !== undefined ? item.provider : undefined,
3055
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
3056
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
3057
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
3058
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
3059
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
3060
+ scope: item.scope !== undefined ? item.scope : undefined,
3061
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
3062
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
3063
+ },
3064
+ }))
3065
+ } : undefined,
3066
+ sessions: prop.alpacaAccount.user.sessions ? {
3067
+ upsert: prop.alpacaAccount.user.sessions.map((item) => ({
3068
+ where: {
3069
+ id: item.id !== undefined ? item.id : undefined,
3070
+ },
3071
+ update: {
3072
+ id: item.id !== undefined ? {
3073
+ set: item.id
3074
+ } : undefined,
3075
+ sessionToken: item.sessionToken !== undefined ? {
3076
+ set: item.sessionToken
3077
+ } : undefined,
3078
+ expires: item.expires !== undefined ? {
3079
+ set: item.expires
3080
+ } : undefined,
3081
+ },
3082
+ create: {
3083
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
3084
+ expires: item.expires !== undefined ? item.expires : undefined,
3085
+ },
3086
+ }))
3087
+ } : undefined,
3088
+ authenticators: prop.alpacaAccount.user.authenticators ? {
3089
+ upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
3090
+ where: {
3091
+ id: item.id !== undefined ? item.id : undefined,
3092
+ },
3093
+ update: {
3094
+ id: item.id !== undefined ? {
3095
+ set: item.id
3096
+ } : undefined,
3097
+ credentialID: item.credentialID !== undefined ? {
3098
+ set: item.credentialID
3099
+ } : undefined,
3100
+ publicKey: item.publicKey !== undefined ? {
3101
+ set: item.publicKey
3102
+ } : undefined,
3103
+ counter: item.counter !== undefined ? {
3104
+ set: item.counter
3105
+ } : undefined,
3106
+ },
3107
+ create: {
3108
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
3109
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
3110
+ counter: item.counter !== undefined ? item.counter : undefined,
3111
+ },
3112
+ }))
3113
+ } : undefined,
886
3114
  },
887
3115
  create: {
888
3116
  name: prop.alpacaAccount.user.name !== undefined ? prop.alpacaAccount.user.name : undefined,
@@ -896,6 +3124,87 @@ export const Alert = {
896
3124
  plan: prop.alpacaAccount.user.plan !== undefined ? prop.alpacaAccount.user.plan : undefined,
897
3125
  openaiAPIKey: prop.alpacaAccount.user.openaiAPIKey !== undefined ? prop.alpacaAccount.user.openaiAPIKey : undefined,
898
3126
  openaiModel: prop.alpacaAccount.user.openaiModel !== undefined ? prop.alpacaAccount.user.openaiModel : undefined,
3127
+ customer: prop.alpacaAccount.user.customer ?
3128
+ typeof prop.alpacaAccount.user.customer === 'object' && Object.keys(prop.alpacaAccount.user.customer).length === 1 && Object.keys(prop.alpacaAccount.user.customer)[0] === 'id'
3129
+ ? { connect: {
3130
+ id: prop.alpacaAccount.user.customer.id
3131
+ }
3132
+ }
3133
+ : { connectOrCreate: {
3134
+ where: {
3135
+ id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
3136
+ name: prop.alpacaAccount.user.customer.name !== undefined ? {
3137
+ equals: prop.alpacaAccount.user.customer.name
3138
+ } : undefined,
3139
+ },
3140
+ create: {
3141
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
3142
+ name: prop.alpacaAccount.user.customer.name !== undefined ? prop.alpacaAccount.user.customer.name : undefined,
3143
+ plan: prop.alpacaAccount.user.customer.plan !== undefined ? prop.alpacaAccount.user.customer.plan : undefined,
3144
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
3145
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
3146
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? prop.alpacaAccount.user.customer.stripePriceId : undefined,
3147
+ stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
3148
+ },
3149
+ }
3150
+ } : undefined,
3151
+ accounts: prop.alpacaAccount.user.accounts ?
3152
+ Array.isArray(prop.alpacaAccount.user.accounts) && prop.alpacaAccount.user.accounts.length > 0 && prop.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3153
+ connect: prop.alpacaAccount.user.accounts.map((item) => ({
3154
+ id: item.id
3155
+ }))
3156
+ }
3157
+ : { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
3158
+ where: {
3159
+ id: item.id !== undefined ? item.id : undefined,
3160
+ },
3161
+ create: {
3162
+ type: item.type !== undefined ? item.type : undefined,
3163
+ provider: item.provider !== undefined ? item.provider : undefined,
3164
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
3165
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
3166
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
3167
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
3168
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
3169
+ scope: item.scope !== undefined ? item.scope : undefined,
3170
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
3171
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
3172
+ },
3173
+ }))
3174
+ } : undefined,
3175
+ sessions: prop.alpacaAccount.user.sessions ?
3176
+ Array.isArray(prop.alpacaAccount.user.sessions) && prop.alpacaAccount.user.sessions.length > 0 && prop.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3177
+ connect: prop.alpacaAccount.user.sessions.map((item) => ({
3178
+ id: item.id
3179
+ }))
3180
+ }
3181
+ : { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
3182
+ where: {
3183
+ id: item.id !== undefined ? item.id : undefined,
3184
+ },
3185
+ create: {
3186
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
3187
+ expires: item.expires !== undefined ? item.expires : undefined,
3188
+ },
3189
+ }))
3190
+ } : undefined,
3191
+ authenticators: prop.alpacaAccount.user.authenticators ?
3192
+ Array.isArray(prop.alpacaAccount.user.authenticators) && prop.alpacaAccount.user.authenticators.length > 0 && prop.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3193
+ connect: prop.alpacaAccount.user.authenticators.map((item) => ({
3194
+ id: item.id
3195
+ }))
3196
+ }
3197
+ : { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
3198
+ where: {
3199
+ id: item.id !== undefined ? item.id : undefined,
3200
+ },
3201
+ create: {
3202
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
3203
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
3204
+ counter: item.counter !== undefined ? item.counter : undefined,
3205
+ },
3206
+ }))
3207
+ } : undefined,
899
3208
  },
900
3209
  }
901
3210
  } : undefined,
@@ -941,6 +3250,282 @@ export const Alert = {
941
3250
  status: item.status !== undefined ? {
942
3251
  set: item.status
943
3252
  } : undefined,
3253
+ asset: item.asset ? {
3254
+ upsert: {
3255
+ where: {
3256
+ id: item.asset.id !== undefined ? {
3257
+ equals: item.asset.id
3258
+ } : undefined,
3259
+ symbol: item.asset.symbol !== undefined ? {
3260
+ equals: item.asset.symbol
3261
+ } : undefined,
3262
+ name: item.asset.name !== undefined ? {
3263
+ equals: item.asset.name
3264
+ } : undefined,
3265
+ },
3266
+ update: {
3267
+ id: item.asset.id !== undefined ? {
3268
+ set: item.asset.id
3269
+ } : undefined,
3270
+ symbol: item.asset.symbol !== undefined ? {
3271
+ set: item.asset.symbol
3272
+ } : undefined,
3273
+ name: item.asset.name !== undefined ? {
3274
+ set: item.asset.name
3275
+ } : undefined,
3276
+ type: item.asset.type !== undefined ? {
3277
+ set: item.asset.type
3278
+ } : undefined,
3279
+ logoUrl: item.asset.logoUrl !== undefined ? {
3280
+ set: item.asset.logoUrl
3281
+ } : undefined,
3282
+ description: item.asset.description !== undefined ? {
3283
+ set: item.asset.description
3284
+ } : undefined,
3285
+ cik: item.asset.cik !== undefined ? {
3286
+ set: item.asset.cik
3287
+ } : undefined,
3288
+ exchange: item.asset.exchange !== undefined ? {
3289
+ set: item.asset.exchange
3290
+ } : undefined,
3291
+ currency: item.asset.currency !== undefined ? {
3292
+ set: item.asset.currency
3293
+ } : undefined,
3294
+ country: item.asset.country !== undefined ? {
3295
+ set: item.asset.country
3296
+ } : undefined,
3297
+ sector: item.asset.sector !== undefined ? {
3298
+ set: item.asset.sector
3299
+ } : undefined,
3300
+ industry: item.asset.industry !== undefined ? {
3301
+ set: item.asset.industry
3302
+ } : undefined,
3303
+ address: item.asset.address !== undefined ? {
3304
+ set: item.asset.address
3305
+ } : undefined,
3306
+ officialSite: item.asset.officialSite !== undefined ? {
3307
+ set: item.asset.officialSite
3308
+ } : undefined,
3309
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
3310
+ set: item.asset.fiscalYearEnd
3311
+ } : undefined,
3312
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
3313
+ set: item.asset.latestQuarter
3314
+ } : undefined,
3315
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
3316
+ set: item.asset.marketCapitalization
3317
+ } : undefined,
3318
+ ebitda: item.asset.ebitda !== undefined ? {
3319
+ set: item.asset.ebitda
3320
+ } : undefined,
3321
+ peRatio: item.asset.peRatio !== undefined ? {
3322
+ set: item.asset.peRatio
3323
+ } : undefined,
3324
+ pegRatio: item.asset.pegRatio !== undefined ? {
3325
+ set: item.asset.pegRatio
3326
+ } : undefined,
3327
+ bookValue: item.asset.bookValue !== undefined ? {
3328
+ set: item.asset.bookValue
3329
+ } : undefined,
3330
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
3331
+ set: item.asset.dividendPerShare
3332
+ } : undefined,
3333
+ dividendYield: item.asset.dividendYield !== undefined ? {
3334
+ set: item.asset.dividendYield
3335
+ } : undefined,
3336
+ eps: item.asset.eps !== undefined ? {
3337
+ set: item.asset.eps
3338
+ } : undefined,
3339
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
3340
+ set: item.asset.revenuePerShareTTM
3341
+ } : undefined,
3342
+ profitMargin: item.asset.profitMargin !== undefined ? {
3343
+ set: item.asset.profitMargin
3344
+ } : undefined,
3345
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
3346
+ set: item.asset.operatingMarginTTM
3347
+ } : undefined,
3348
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
3349
+ set: item.asset.returnOnAssetsTTM
3350
+ } : undefined,
3351
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
3352
+ set: item.asset.returnOnEquityTTM
3353
+ } : undefined,
3354
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
3355
+ set: item.asset.revenueTTM
3356
+ } : undefined,
3357
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
3358
+ set: item.asset.grossProfitTTM
3359
+ } : undefined,
3360
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
3361
+ set: item.asset.dilutedEPSTTM
3362
+ } : undefined,
3363
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
3364
+ set: item.asset.quarterlyEarningsGrowthYOY
3365
+ } : undefined,
3366
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
3367
+ set: item.asset.quarterlyRevenueGrowthYOY
3368
+ } : undefined,
3369
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
3370
+ set: item.asset.analystTargetPrice
3371
+ } : undefined,
3372
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
3373
+ set: item.asset.analystRatingStrongBuy
3374
+ } : undefined,
3375
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
3376
+ set: item.asset.analystRatingBuy
3377
+ } : undefined,
3378
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
3379
+ set: item.asset.analystRatingHold
3380
+ } : undefined,
3381
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
3382
+ set: item.asset.analystRatingSell
3383
+ } : undefined,
3384
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
3385
+ set: item.asset.analystRatingStrongSell
3386
+ } : undefined,
3387
+ trailingPE: item.asset.trailingPE !== undefined ? {
3388
+ set: item.asset.trailingPE
3389
+ } : undefined,
3390
+ forwardPE: item.asset.forwardPE !== undefined ? {
3391
+ set: item.asset.forwardPE
3392
+ } : undefined,
3393
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
3394
+ set: item.asset.priceToSalesRatioTTM
3395
+ } : undefined,
3396
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
3397
+ set: item.asset.priceToBookRatio
3398
+ } : undefined,
3399
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
3400
+ set: item.asset.evToRevenue
3401
+ } : undefined,
3402
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
3403
+ set: item.asset.evToEbitda
3404
+ } : undefined,
3405
+ beta: item.asset.beta !== undefined ? {
3406
+ set: item.asset.beta
3407
+ } : undefined,
3408
+ week52High: item.asset.week52High !== undefined ? {
3409
+ set: item.asset.week52High
3410
+ } : undefined,
3411
+ week52Low: item.asset.week52Low !== undefined ? {
3412
+ set: item.asset.week52Low
3413
+ } : undefined,
3414
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
3415
+ set: item.asset.day50MovingAverage
3416
+ } : undefined,
3417
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
3418
+ set: item.asset.day200MovingAverage
3419
+ } : undefined,
3420
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
3421
+ set: item.asset.sharesOutstanding
3422
+ } : undefined,
3423
+ dividendDate: item.asset.dividendDate !== undefined ? {
3424
+ set: item.asset.dividendDate
3425
+ } : undefined,
3426
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
3427
+ set: item.asset.exDividendDate
3428
+ } : undefined,
3429
+ askPrice: item.asset.askPrice !== undefined ? {
3430
+ set: item.asset.askPrice
3431
+ } : undefined,
3432
+ bidPrice: item.asset.bidPrice !== undefined ? {
3433
+ set: item.asset.bidPrice
3434
+ } : undefined,
3435
+ },
3436
+ create: {
3437
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3438
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3439
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
3440
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3441
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
3442
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3443
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3444
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3445
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
3446
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3447
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3448
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
3449
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3450
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3451
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3452
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3453
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3454
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3455
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3456
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3457
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3458
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
3459
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
3460
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
3461
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
3462
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
3463
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
3464
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
3465
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
3466
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
3467
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
3468
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
3469
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
3470
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
3471
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
3472
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
3473
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
3474
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
3475
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
3476
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
3477
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
3478
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
3479
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
3480
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
3481
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
3482
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
3483
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
3484
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
3485
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
3486
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
3487
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
3488
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
3489
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
3490
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
3491
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
3492
+ },
3493
+ }
3494
+ } : undefined,
3495
+ actions: item.actions ? {
3496
+ upsert: item.actions.map((item) => ({
3497
+ where: {
3498
+ id: item.id !== undefined ? item.id : undefined,
3499
+ },
3500
+ update: {
3501
+ id: item.id !== undefined ? {
3502
+ set: item.id
3503
+ } : undefined,
3504
+ sequence: item.sequence !== undefined ? {
3505
+ set: item.sequence
3506
+ } : undefined,
3507
+ type: item.type !== undefined ? {
3508
+ set: item.type
3509
+ } : undefined,
3510
+ note: item.note !== undefined ? {
3511
+ set: item.note
3512
+ } : undefined,
3513
+ status: item.status !== undefined ? {
3514
+ set: item.status
3515
+ } : undefined,
3516
+ fee: item.fee !== undefined ? {
3517
+ set: item.fee
3518
+ } : undefined,
3519
+ },
3520
+ create: {
3521
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
3522
+ type: item.type !== undefined ? item.type : undefined,
3523
+ note: item.note !== undefined ? item.note : undefined,
3524
+ status: item.status !== undefined ? item.status : undefined,
3525
+ fee: item.fee !== undefined ? item.fee : undefined,
3526
+ },
3527
+ }))
3528
+ } : undefined,
944
3529
  },
945
3530
  create: {
946
3531
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -954,6 +3539,96 @@ export const Alert = {
954
3539
  confidence: item.confidence !== undefined ? item.confidence : undefined,
955
3540
  timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
956
3541
  status: item.status !== undefined ? item.status : undefined,
3542
+ asset: item.asset ?
3543
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
3544
+ ? { connect: {
3545
+ id: item.asset.id
3546
+ }
3547
+ }
3548
+ : { connectOrCreate: {
3549
+ where: {
3550
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
3551
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3552
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3553
+ },
3554
+ create: {
3555
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3556
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3557
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
3558
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3559
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
3560
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3561
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3562
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3563
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
3564
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3565
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3566
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
3567
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3568
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3569
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3570
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3571
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3572
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3573
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3574
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3575
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3576
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
3577
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
3578
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
3579
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
3580
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
3581
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
3582
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
3583
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
3584
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
3585
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
3586
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
3587
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
3588
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
3589
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
3590
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
3591
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
3592
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
3593
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
3594
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
3595
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
3596
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
3597
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
3598
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
3599
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
3600
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
3601
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
3602
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
3603
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
3604
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
3605
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
3606
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
3607
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
3608
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
3609
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
3610
+ },
3611
+ }
3612
+ } : undefined,
3613
+ actions: item.actions ?
3614
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
3615
+ connect: item.actions.map((item) => ({
3616
+ id: item.id
3617
+ }))
3618
+ }
3619
+ : { connectOrCreate: item.actions.map((item) => ({
3620
+ where: {
3621
+ id: item.id !== undefined ? item.id : undefined,
3622
+ },
3623
+ create: {
3624
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
3625
+ type: item.type !== undefined ? item.type : undefined,
3626
+ note: item.note !== undefined ? item.note : undefined,
3627
+ status: item.status !== undefined ? item.status : undefined,
3628
+ fee: item.fee !== undefined ? item.fee : undefined,
3629
+ },
3630
+ }))
3631
+ } : undefined,
957
3632
  },
958
3633
  }))
959
3634
  } : undefined,
@@ -1032,6 +3707,332 @@ export const Alert = {
1032
3707
  takeProfitId: item.takeProfitId !== undefined ? {
1033
3708
  set: item.takeProfitId
1034
3709
  } : undefined,
3710
+ stopLoss: item.stopLoss ? {
3711
+ upsert: {
3712
+ where: {
3713
+ id: item.stopLoss.id !== undefined ? {
3714
+ equals: item.stopLoss.id
3715
+ } : undefined,
3716
+ },
3717
+ update: {
3718
+ id: item.stopLoss.id !== undefined ? {
3719
+ set: item.stopLoss.id
3720
+ } : undefined,
3721
+ stopPrice: item.stopLoss.stopPrice !== undefined ? {
3722
+ set: item.stopLoss.stopPrice
3723
+ } : undefined,
3724
+ limitPrice: item.stopLoss.limitPrice !== undefined ? {
3725
+ set: item.stopLoss.limitPrice
3726
+ } : undefined,
3727
+ },
3728
+ create: {
3729
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
3730
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
3731
+ },
3732
+ }
3733
+ } : undefined,
3734
+ takeProfit: item.takeProfit ? {
3735
+ upsert: {
3736
+ where: {
3737
+ id: item.takeProfit.id !== undefined ? {
3738
+ equals: item.takeProfit.id
3739
+ } : undefined,
3740
+ },
3741
+ update: {
3742
+ id: item.takeProfit.id !== undefined ? {
3743
+ set: item.takeProfit.id
3744
+ } : undefined,
3745
+ limitPrice: item.takeProfit.limitPrice !== undefined ? {
3746
+ set: item.takeProfit.limitPrice
3747
+ } : undefined,
3748
+ stopPrice: item.takeProfit.stopPrice !== undefined ? {
3749
+ set: item.takeProfit.stopPrice
3750
+ } : undefined,
3751
+ },
3752
+ create: {
3753
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
3754
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
3755
+ },
3756
+ }
3757
+ } : undefined,
3758
+ action: item.action ? {
3759
+ upsert: {
3760
+ where: {
3761
+ id: item.action.id !== undefined ? {
3762
+ equals: item.action.id
3763
+ } : undefined,
3764
+ },
3765
+ update: {
3766
+ id: item.action.id !== undefined ? {
3767
+ set: item.action.id
3768
+ } : undefined,
3769
+ sequence: item.action.sequence !== undefined ? {
3770
+ set: item.action.sequence
3771
+ } : undefined,
3772
+ type: item.action.type !== undefined ? {
3773
+ set: item.action.type
3774
+ } : undefined,
3775
+ note: item.action.note !== undefined ? {
3776
+ set: item.action.note
3777
+ } : undefined,
3778
+ status: item.action.status !== undefined ? {
3779
+ set: item.action.status
3780
+ } : undefined,
3781
+ fee: item.action.fee !== undefined ? {
3782
+ set: item.action.fee
3783
+ } : undefined,
3784
+ },
3785
+ create: {
3786
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
3787
+ type: item.action.type !== undefined ? item.action.type : undefined,
3788
+ note: item.action.note !== undefined ? item.action.note : undefined,
3789
+ status: item.action.status !== undefined ? item.action.status : undefined,
3790
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
3791
+ },
3792
+ }
3793
+ } : undefined,
3794
+ asset: item.asset ? {
3795
+ upsert: {
3796
+ where: {
3797
+ id: item.asset.id !== undefined ? {
3798
+ equals: item.asset.id
3799
+ } : undefined,
3800
+ symbol: item.asset.symbol !== undefined ? {
3801
+ equals: item.asset.symbol
3802
+ } : undefined,
3803
+ name: item.asset.name !== undefined ? {
3804
+ equals: item.asset.name
3805
+ } : undefined,
3806
+ },
3807
+ update: {
3808
+ id: item.asset.id !== undefined ? {
3809
+ set: item.asset.id
3810
+ } : undefined,
3811
+ symbol: item.asset.symbol !== undefined ? {
3812
+ set: item.asset.symbol
3813
+ } : undefined,
3814
+ name: item.asset.name !== undefined ? {
3815
+ set: item.asset.name
3816
+ } : undefined,
3817
+ type: item.asset.type !== undefined ? {
3818
+ set: item.asset.type
3819
+ } : undefined,
3820
+ logoUrl: item.asset.logoUrl !== undefined ? {
3821
+ set: item.asset.logoUrl
3822
+ } : undefined,
3823
+ description: item.asset.description !== undefined ? {
3824
+ set: item.asset.description
3825
+ } : undefined,
3826
+ cik: item.asset.cik !== undefined ? {
3827
+ set: item.asset.cik
3828
+ } : undefined,
3829
+ exchange: item.asset.exchange !== undefined ? {
3830
+ set: item.asset.exchange
3831
+ } : undefined,
3832
+ currency: item.asset.currency !== undefined ? {
3833
+ set: item.asset.currency
3834
+ } : undefined,
3835
+ country: item.asset.country !== undefined ? {
3836
+ set: item.asset.country
3837
+ } : undefined,
3838
+ sector: item.asset.sector !== undefined ? {
3839
+ set: item.asset.sector
3840
+ } : undefined,
3841
+ industry: item.asset.industry !== undefined ? {
3842
+ set: item.asset.industry
3843
+ } : undefined,
3844
+ address: item.asset.address !== undefined ? {
3845
+ set: item.asset.address
3846
+ } : undefined,
3847
+ officialSite: item.asset.officialSite !== undefined ? {
3848
+ set: item.asset.officialSite
3849
+ } : undefined,
3850
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
3851
+ set: item.asset.fiscalYearEnd
3852
+ } : undefined,
3853
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
3854
+ set: item.asset.latestQuarter
3855
+ } : undefined,
3856
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
3857
+ set: item.asset.marketCapitalization
3858
+ } : undefined,
3859
+ ebitda: item.asset.ebitda !== undefined ? {
3860
+ set: item.asset.ebitda
3861
+ } : undefined,
3862
+ peRatio: item.asset.peRatio !== undefined ? {
3863
+ set: item.asset.peRatio
3864
+ } : undefined,
3865
+ pegRatio: item.asset.pegRatio !== undefined ? {
3866
+ set: item.asset.pegRatio
3867
+ } : undefined,
3868
+ bookValue: item.asset.bookValue !== undefined ? {
3869
+ set: item.asset.bookValue
3870
+ } : undefined,
3871
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
3872
+ set: item.asset.dividendPerShare
3873
+ } : undefined,
3874
+ dividendYield: item.asset.dividendYield !== undefined ? {
3875
+ set: item.asset.dividendYield
3876
+ } : undefined,
3877
+ eps: item.asset.eps !== undefined ? {
3878
+ set: item.asset.eps
3879
+ } : undefined,
3880
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
3881
+ set: item.asset.revenuePerShareTTM
3882
+ } : undefined,
3883
+ profitMargin: item.asset.profitMargin !== undefined ? {
3884
+ set: item.asset.profitMargin
3885
+ } : undefined,
3886
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
3887
+ set: item.asset.operatingMarginTTM
3888
+ } : undefined,
3889
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
3890
+ set: item.asset.returnOnAssetsTTM
3891
+ } : undefined,
3892
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
3893
+ set: item.asset.returnOnEquityTTM
3894
+ } : undefined,
3895
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
3896
+ set: item.asset.revenueTTM
3897
+ } : undefined,
3898
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
3899
+ set: item.asset.grossProfitTTM
3900
+ } : undefined,
3901
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
3902
+ set: item.asset.dilutedEPSTTM
3903
+ } : undefined,
3904
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
3905
+ set: item.asset.quarterlyEarningsGrowthYOY
3906
+ } : undefined,
3907
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
3908
+ set: item.asset.quarterlyRevenueGrowthYOY
3909
+ } : undefined,
3910
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
3911
+ set: item.asset.analystTargetPrice
3912
+ } : undefined,
3913
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
3914
+ set: item.asset.analystRatingStrongBuy
3915
+ } : undefined,
3916
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
3917
+ set: item.asset.analystRatingBuy
3918
+ } : undefined,
3919
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
3920
+ set: item.asset.analystRatingHold
3921
+ } : undefined,
3922
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
3923
+ set: item.asset.analystRatingSell
3924
+ } : undefined,
3925
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
3926
+ set: item.asset.analystRatingStrongSell
3927
+ } : undefined,
3928
+ trailingPE: item.asset.trailingPE !== undefined ? {
3929
+ set: item.asset.trailingPE
3930
+ } : undefined,
3931
+ forwardPE: item.asset.forwardPE !== undefined ? {
3932
+ set: item.asset.forwardPE
3933
+ } : undefined,
3934
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
3935
+ set: item.asset.priceToSalesRatioTTM
3936
+ } : undefined,
3937
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
3938
+ set: item.asset.priceToBookRatio
3939
+ } : undefined,
3940
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
3941
+ set: item.asset.evToRevenue
3942
+ } : undefined,
3943
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
3944
+ set: item.asset.evToEbitda
3945
+ } : undefined,
3946
+ beta: item.asset.beta !== undefined ? {
3947
+ set: item.asset.beta
3948
+ } : undefined,
3949
+ week52High: item.asset.week52High !== undefined ? {
3950
+ set: item.asset.week52High
3951
+ } : undefined,
3952
+ week52Low: item.asset.week52Low !== undefined ? {
3953
+ set: item.asset.week52Low
3954
+ } : undefined,
3955
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
3956
+ set: item.asset.day50MovingAverage
3957
+ } : undefined,
3958
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
3959
+ set: item.asset.day200MovingAverage
3960
+ } : undefined,
3961
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
3962
+ set: item.asset.sharesOutstanding
3963
+ } : undefined,
3964
+ dividendDate: item.asset.dividendDate !== undefined ? {
3965
+ set: item.asset.dividendDate
3966
+ } : undefined,
3967
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
3968
+ set: item.asset.exDividendDate
3969
+ } : undefined,
3970
+ askPrice: item.asset.askPrice !== undefined ? {
3971
+ set: item.asset.askPrice
3972
+ } : undefined,
3973
+ bidPrice: item.asset.bidPrice !== undefined ? {
3974
+ set: item.asset.bidPrice
3975
+ } : undefined,
3976
+ },
3977
+ create: {
3978
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3979
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3980
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
3981
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3982
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
3983
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3984
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3985
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3986
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
3987
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3988
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3989
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
3990
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3991
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3992
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3993
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3994
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3995
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3996
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3997
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3998
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3999
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4000
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4001
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4002
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4003
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4004
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4005
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4006
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4007
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4008
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4009
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4010
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4011
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4012
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4013
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4014
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4015
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4016
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4017
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4018
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4019
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4020
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4021
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4022
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4023
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4024
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4025
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4026
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4027
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4028
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4029
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4030
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4031
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
4032
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
4033
+ },
4034
+ }
4035
+ } : undefined,
1035
4036
  },
1036
4037
  create: {
1037
4038
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1056,6 +4057,128 @@ export const Alert = {
1056
4057
  optionType: item.optionType !== undefined ? item.optionType : undefined,
1057
4058
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1058
4059
  takeProfitId: item.takeProfitId !== undefined ? item.takeProfitId : undefined,
4060
+ stopLoss: item.stopLoss ?
4061
+ typeof item.stopLoss === 'object' && Object.keys(item.stopLoss).length === 1 && Object.keys(item.stopLoss)[0] === 'id'
4062
+ ? { connect: {
4063
+ id: item.stopLoss.id
4064
+ }
4065
+ }
4066
+ : { connectOrCreate: {
4067
+ where: {
4068
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
4069
+ },
4070
+ create: {
4071
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
4072
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
4073
+ },
4074
+ }
4075
+ } : undefined,
4076
+ takeProfit: item.takeProfit ?
4077
+ typeof item.takeProfit === 'object' && Object.keys(item.takeProfit).length === 1 && Object.keys(item.takeProfit)[0] === 'id'
4078
+ ? { connect: {
4079
+ id: item.takeProfit.id
4080
+ }
4081
+ }
4082
+ : { connectOrCreate: {
4083
+ where: {
4084
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
4085
+ },
4086
+ create: {
4087
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
4088
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
4089
+ },
4090
+ }
4091
+ } : undefined,
4092
+ action: item.action ?
4093
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
4094
+ ? { connect: {
4095
+ id: item.action.id
4096
+ }
4097
+ }
4098
+ : { connectOrCreate: {
4099
+ where: {
4100
+ id: item.action.id !== undefined ? item.action.id : undefined,
4101
+ },
4102
+ create: {
4103
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
4104
+ type: item.action.type !== undefined ? item.action.type : undefined,
4105
+ note: item.action.note !== undefined ? item.action.note : undefined,
4106
+ status: item.action.status !== undefined ? item.action.status : undefined,
4107
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
4108
+ },
4109
+ }
4110
+ } : undefined,
4111
+ asset: item.asset ?
4112
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
4113
+ ? { connect: {
4114
+ id: item.asset.id
4115
+ }
4116
+ }
4117
+ : { connectOrCreate: {
4118
+ where: {
4119
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4120
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4121
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4122
+ },
4123
+ create: {
4124
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4125
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4126
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4127
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4128
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4129
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4130
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4131
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4132
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4133
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4134
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4135
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4136
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4137
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4138
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4139
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4140
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4141
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4142
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4143
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4144
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4145
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4146
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4147
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4148
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4149
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4150
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4151
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4152
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4153
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4154
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4155
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4156
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4157
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4158
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4159
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4160
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4161
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4162
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4163
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4164
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4165
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4166
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4167
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4168
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4169
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4170
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4171
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4172
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4173
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4174
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4175
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4176
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4177
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
4178
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
4179
+ },
4180
+ }
4181
+ } : undefined,
1059
4182
  },
1060
4183
  }))
1061
4184
  } : undefined,
@@ -1107,6 +4230,248 @@ export const Alert = {
1107
4230
  assetMarginable: item.assetMarginable !== undefined ? {
1108
4231
  set: item.assetMarginable
1109
4232
  } : undefined,
4233
+ asset: item.asset ? {
4234
+ upsert: {
4235
+ where: {
4236
+ id: item.asset.id !== undefined ? {
4237
+ equals: item.asset.id
4238
+ } : undefined,
4239
+ symbol: item.asset.symbol !== undefined ? {
4240
+ equals: item.asset.symbol
4241
+ } : undefined,
4242
+ name: item.asset.name !== undefined ? {
4243
+ equals: item.asset.name
4244
+ } : undefined,
4245
+ },
4246
+ update: {
4247
+ id: item.asset.id !== undefined ? {
4248
+ set: item.asset.id
4249
+ } : undefined,
4250
+ symbol: item.asset.symbol !== undefined ? {
4251
+ set: item.asset.symbol
4252
+ } : undefined,
4253
+ name: item.asset.name !== undefined ? {
4254
+ set: item.asset.name
4255
+ } : undefined,
4256
+ type: item.asset.type !== undefined ? {
4257
+ set: item.asset.type
4258
+ } : undefined,
4259
+ logoUrl: item.asset.logoUrl !== undefined ? {
4260
+ set: item.asset.logoUrl
4261
+ } : undefined,
4262
+ description: item.asset.description !== undefined ? {
4263
+ set: item.asset.description
4264
+ } : undefined,
4265
+ cik: item.asset.cik !== undefined ? {
4266
+ set: item.asset.cik
4267
+ } : undefined,
4268
+ exchange: item.asset.exchange !== undefined ? {
4269
+ set: item.asset.exchange
4270
+ } : undefined,
4271
+ currency: item.asset.currency !== undefined ? {
4272
+ set: item.asset.currency
4273
+ } : undefined,
4274
+ country: item.asset.country !== undefined ? {
4275
+ set: item.asset.country
4276
+ } : undefined,
4277
+ sector: item.asset.sector !== undefined ? {
4278
+ set: item.asset.sector
4279
+ } : undefined,
4280
+ industry: item.asset.industry !== undefined ? {
4281
+ set: item.asset.industry
4282
+ } : undefined,
4283
+ address: item.asset.address !== undefined ? {
4284
+ set: item.asset.address
4285
+ } : undefined,
4286
+ officialSite: item.asset.officialSite !== undefined ? {
4287
+ set: item.asset.officialSite
4288
+ } : undefined,
4289
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
4290
+ set: item.asset.fiscalYearEnd
4291
+ } : undefined,
4292
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
4293
+ set: item.asset.latestQuarter
4294
+ } : undefined,
4295
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
4296
+ set: item.asset.marketCapitalization
4297
+ } : undefined,
4298
+ ebitda: item.asset.ebitda !== undefined ? {
4299
+ set: item.asset.ebitda
4300
+ } : undefined,
4301
+ peRatio: item.asset.peRatio !== undefined ? {
4302
+ set: item.asset.peRatio
4303
+ } : undefined,
4304
+ pegRatio: item.asset.pegRatio !== undefined ? {
4305
+ set: item.asset.pegRatio
4306
+ } : undefined,
4307
+ bookValue: item.asset.bookValue !== undefined ? {
4308
+ set: item.asset.bookValue
4309
+ } : undefined,
4310
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
4311
+ set: item.asset.dividendPerShare
4312
+ } : undefined,
4313
+ dividendYield: item.asset.dividendYield !== undefined ? {
4314
+ set: item.asset.dividendYield
4315
+ } : undefined,
4316
+ eps: item.asset.eps !== undefined ? {
4317
+ set: item.asset.eps
4318
+ } : undefined,
4319
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
4320
+ set: item.asset.revenuePerShareTTM
4321
+ } : undefined,
4322
+ profitMargin: item.asset.profitMargin !== undefined ? {
4323
+ set: item.asset.profitMargin
4324
+ } : undefined,
4325
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
4326
+ set: item.asset.operatingMarginTTM
4327
+ } : undefined,
4328
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
4329
+ set: item.asset.returnOnAssetsTTM
4330
+ } : undefined,
4331
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
4332
+ set: item.asset.returnOnEquityTTM
4333
+ } : undefined,
4334
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
4335
+ set: item.asset.revenueTTM
4336
+ } : undefined,
4337
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
4338
+ set: item.asset.grossProfitTTM
4339
+ } : undefined,
4340
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
4341
+ set: item.asset.dilutedEPSTTM
4342
+ } : undefined,
4343
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
4344
+ set: item.asset.quarterlyEarningsGrowthYOY
4345
+ } : undefined,
4346
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
4347
+ set: item.asset.quarterlyRevenueGrowthYOY
4348
+ } : undefined,
4349
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
4350
+ set: item.asset.analystTargetPrice
4351
+ } : undefined,
4352
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
4353
+ set: item.asset.analystRatingStrongBuy
4354
+ } : undefined,
4355
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
4356
+ set: item.asset.analystRatingBuy
4357
+ } : undefined,
4358
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
4359
+ set: item.asset.analystRatingHold
4360
+ } : undefined,
4361
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
4362
+ set: item.asset.analystRatingSell
4363
+ } : undefined,
4364
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
4365
+ set: item.asset.analystRatingStrongSell
4366
+ } : undefined,
4367
+ trailingPE: item.asset.trailingPE !== undefined ? {
4368
+ set: item.asset.trailingPE
4369
+ } : undefined,
4370
+ forwardPE: item.asset.forwardPE !== undefined ? {
4371
+ set: item.asset.forwardPE
4372
+ } : undefined,
4373
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
4374
+ set: item.asset.priceToSalesRatioTTM
4375
+ } : undefined,
4376
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
4377
+ set: item.asset.priceToBookRatio
4378
+ } : undefined,
4379
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
4380
+ set: item.asset.evToRevenue
4381
+ } : undefined,
4382
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
4383
+ set: item.asset.evToEbitda
4384
+ } : undefined,
4385
+ beta: item.asset.beta !== undefined ? {
4386
+ set: item.asset.beta
4387
+ } : undefined,
4388
+ week52High: item.asset.week52High !== undefined ? {
4389
+ set: item.asset.week52High
4390
+ } : undefined,
4391
+ week52Low: item.asset.week52Low !== undefined ? {
4392
+ set: item.asset.week52Low
4393
+ } : undefined,
4394
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
4395
+ set: item.asset.day50MovingAverage
4396
+ } : undefined,
4397
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
4398
+ set: item.asset.day200MovingAverage
4399
+ } : undefined,
4400
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
4401
+ set: item.asset.sharesOutstanding
4402
+ } : undefined,
4403
+ dividendDate: item.asset.dividendDate !== undefined ? {
4404
+ set: item.asset.dividendDate
4405
+ } : undefined,
4406
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
4407
+ set: item.asset.exDividendDate
4408
+ } : undefined,
4409
+ askPrice: item.asset.askPrice !== undefined ? {
4410
+ set: item.asset.askPrice
4411
+ } : undefined,
4412
+ bidPrice: item.asset.bidPrice !== undefined ? {
4413
+ set: item.asset.bidPrice
4414
+ } : undefined,
4415
+ },
4416
+ create: {
4417
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4418
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4419
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4420
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4421
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4422
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4423
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4424
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4425
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4426
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4427
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4428
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4429
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4430
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4431
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4432
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4433
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4434
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4435
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4436
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4437
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4438
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4439
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4440
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4441
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4442
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4443
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4444
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4445
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4446
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4447
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4448
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4449
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4450
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4451
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4452
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4453
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4454
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4455
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4456
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4457
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4458
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4459
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4460
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4461
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4462
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4463
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4464
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4465
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4466
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4467
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4468
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4469
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4470
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
4471
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
4472
+ },
4473
+ }
4474
+ } : undefined,
1110
4475
  },
1111
4476
  create: {
1112
4477
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1122,6 +4487,77 @@ export const Alert = {
1122
4487
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
1123
4488
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
1124
4489
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
4490
+ asset: item.asset ?
4491
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
4492
+ ? { connect: {
4493
+ id: item.asset.id
4494
+ }
4495
+ }
4496
+ : { connectOrCreate: {
4497
+ where: {
4498
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4499
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4500
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4501
+ },
4502
+ create: {
4503
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4504
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4505
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4506
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4507
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4508
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4509
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4510
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4511
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4512
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4513
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4514
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4515
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4516
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4517
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4518
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4519
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4520
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4521
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4522
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4523
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4524
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4525
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4526
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4527
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4528
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4529
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4530
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4531
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4532
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4533
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4534
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4535
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4536
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4537
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4538
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4539
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4540
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4541
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4542
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4543
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4544
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4545
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4546
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4547
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4548
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4549
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4550
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4551
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4552
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4553
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4554
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4555
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4556
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
4557
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
4558
+ },
4559
+ }
4560
+ } : undefined,
1125
4561
  },
1126
4562
  }))
1127
4563
  } : undefined,
@@ -1162,6 +4598,87 @@ export const Alert = {
1162
4598
  plan: prop.alpacaAccount.user.plan !== undefined ? prop.alpacaAccount.user.plan : undefined,
1163
4599
  openaiAPIKey: prop.alpacaAccount.user.openaiAPIKey !== undefined ? prop.alpacaAccount.user.openaiAPIKey : undefined,
1164
4600
  openaiModel: prop.alpacaAccount.user.openaiModel !== undefined ? prop.alpacaAccount.user.openaiModel : undefined,
4601
+ customer: prop.alpacaAccount.user.customer ?
4602
+ typeof prop.alpacaAccount.user.customer === 'object' && Object.keys(prop.alpacaAccount.user.customer).length === 1 && Object.keys(prop.alpacaAccount.user.customer)[0] === 'id'
4603
+ ? { connect: {
4604
+ id: prop.alpacaAccount.user.customer.id
4605
+ }
4606
+ }
4607
+ : { connectOrCreate: {
4608
+ where: {
4609
+ id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
4610
+ name: prop.alpacaAccount.user.customer.name !== undefined ? {
4611
+ equals: prop.alpacaAccount.user.customer.name
4612
+ } : undefined,
4613
+ },
4614
+ create: {
4615
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
4616
+ name: prop.alpacaAccount.user.customer.name !== undefined ? prop.alpacaAccount.user.customer.name : undefined,
4617
+ plan: prop.alpacaAccount.user.customer.plan !== undefined ? prop.alpacaAccount.user.customer.plan : undefined,
4618
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4619
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4620
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? prop.alpacaAccount.user.customer.stripePriceId : undefined,
4621
+ stripeCurrentPeriodEnd: prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.alpacaAccount.user.customer.stripeCurrentPeriodEnd : undefined,
4622
+ },
4623
+ }
4624
+ } : undefined,
4625
+ accounts: prop.alpacaAccount.user.accounts ?
4626
+ Array.isArray(prop.alpacaAccount.user.accounts) && prop.alpacaAccount.user.accounts.length > 0 && prop.alpacaAccount.user.accounts.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4627
+ connect: prop.alpacaAccount.user.accounts.map((item) => ({
4628
+ id: item.id
4629
+ }))
4630
+ }
4631
+ : { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
4632
+ where: {
4633
+ id: item.id !== undefined ? item.id : undefined,
4634
+ },
4635
+ create: {
4636
+ type: item.type !== undefined ? item.type : undefined,
4637
+ provider: item.provider !== undefined ? item.provider : undefined,
4638
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
4639
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
4640
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
4641
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
4642
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
4643
+ scope: item.scope !== undefined ? item.scope : undefined,
4644
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
4645
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
4646
+ },
4647
+ }))
4648
+ } : undefined,
4649
+ sessions: prop.alpacaAccount.user.sessions ?
4650
+ Array.isArray(prop.alpacaAccount.user.sessions) && prop.alpacaAccount.user.sessions.length > 0 && prop.alpacaAccount.user.sessions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4651
+ connect: prop.alpacaAccount.user.sessions.map((item) => ({
4652
+ id: item.id
4653
+ }))
4654
+ }
4655
+ : { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
4656
+ where: {
4657
+ id: item.id !== undefined ? item.id : undefined,
4658
+ },
4659
+ create: {
4660
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
4661
+ expires: item.expires !== undefined ? item.expires : undefined,
4662
+ },
4663
+ }))
4664
+ } : undefined,
4665
+ authenticators: prop.alpacaAccount.user.authenticators ?
4666
+ Array.isArray(prop.alpacaAccount.user.authenticators) && prop.alpacaAccount.user.authenticators.length > 0 && prop.alpacaAccount.user.authenticators.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4667
+ connect: prop.alpacaAccount.user.authenticators.map((item) => ({
4668
+ id: item.id
4669
+ }))
4670
+ }
4671
+ : { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
4672
+ where: {
4673
+ id: item.id !== undefined ? item.id : undefined,
4674
+ },
4675
+ create: {
4676
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
4677
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
4678
+ counter: item.counter !== undefined ? item.counter : undefined,
4679
+ },
4680
+ }))
4681
+ } : undefined,
1165
4682
  },
1166
4683
  }
1167
4684
  } : undefined,
@@ -1187,6 +4704,96 @@ export const Alert = {
1187
4704
  confidence: item.confidence !== undefined ? item.confidence : undefined,
1188
4705
  timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
1189
4706
  status: item.status !== undefined ? item.status : undefined,
4707
+ asset: item.asset ?
4708
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
4709
+ ? { connect: {
4710
+ id: item.asset.id
4711
+ }
4712
+ }
4713
+ : { connectOrCreate: {
4714
+ where: {
4715
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4716
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4717
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4718
+ },
4719
+ create: {
4720
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4721
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4722
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4723
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4724
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4725
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4726
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4727
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4728
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4729
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4730
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4731
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4732
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4733
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4734
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4735
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4736
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4737
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4738
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4739
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4740
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4741
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4742
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4743
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4744
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4745
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4746
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4747
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4748
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4749
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4750
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4751
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4752
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4753
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4754
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4755
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4756
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4757
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4758
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4759
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4760
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4761
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4762
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4763
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4764
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4765
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4766
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4767
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4768
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4769
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4770
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4771
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4772
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4773
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
4774
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
4775
+ },
4776
+ }
4777
+ } : undefined,
4778
+ actions: item.actions ?
4779
+ Array.isArray(item.actions) && item.actions.length > 0 && item.actions.every((item) => typeof item === 'object' && 'id' in item && Object.keys(item).length === 1) ? {
4780
+ connect: item.actions.map((item) => ({
4781
+ id: item.id
4782
+ }))
4783
+ }
4784
+ : { connectOrCreate: item.actions.map((item) => ({
4785
+ where: {
4786
+ id: item.id !== undefined ? item.id : undefined,
4787
+ },
4788
+ create: {
4789
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
4790
+ type: item.type !== undefined ? item.type : undefined,
4791
+ note: item.note !== undefined ? item.note : undefined,
4792
+ status: item.status !== undefined ? item.status : undefined,
4793
+ fee: item.fee !== undefined ? item.fee : undefined,
4794
+ },
4795
+ }))
4796
+ } : undefined,
1190
4797
  },
1191
4798
  }))
1192
4799
  } : undefined,
@@ -1223,6 +4830,128 @@ export const Alert = {
1223
4830
  optionType: item.optionType !== undefined ? item.optionType : undefined,
1224
4831
  stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1225
4832
  takeProfitId: item.takeProfitId !== undefined ? item.takeProfitId : undefined,
4833
+ stopLoss: item.stopLoss ?
4834
+ typeof item.stopLoss === 'object' && Object.keys(item.stopLoss).length === 1 && Object.keys(item.stopLoss)[0] === 'id'
4835
+ ? { connect: {
4836
+ id: item.stopLoss.id
4837
+ }
4838
+ }
4839
+ : { connectOrCreate: {
4840
+ where: {
4841
+ id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
4842
+ },
4843
+ create: {
4844
+ stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
4845
+ limitPrice: item.stopLoss.limitPrice !== undefined ? item.stopLoss.limitPrice : undefined,
4846
+ },
4847
+ }
4848
+ } : undefined,
4849
+ takeProfit: item.takeProfit ?
4850
+ typeof item.takeProfit === 'object' && Object.keys(item.takeProfit).length === 1 && Object.keys(item.takeProfit)[0] === 'id'
4851
+ ? { connect: {
4852
+ id: item.takeProfit.id
4853
+ }
4854
+ }
4855
+ : { connectOrCreate: {
4856
+ where: {
4857
+ id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
4858
+ },
4859
+ create: {
4860
+ limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
4861
+ stopPrice: item.takeProfit.stopPrice !== undefined ? item.takeProfit.stopPrice : undefined,
4862
+ },
4863
+ }
4864
+ } : undefined,
4865
+ action: item.action ?
4866
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
4867
+ ? { connect: {
4868
+ id: item.action.id
4869
+ }
4870
+ }
4871
+ : { connectOrCreate: {
4872
+ where: {
4873
+ id: item.action.id !== undefined ? item.action.id : undefined,
4874
+ },
4875
+ create: {
4876
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
4877
+ type: item.action.type !== undefined ? item.action.type : undefined,
4878
+ note: item.action.note !== undefined ? item.action.note : undefined,
4879
+ status: item.action.status !== undefined ? item.action.status : undefined,
4880
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
4881
+ },
4882
+ }
4883
+ } : undefined,
4884
+ asset: item.asset ?
4885
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
4886
+ ? { connect: {
4887
+ id: item.asset.id
4888
+ }
4889
+ }
4890
+ : { connectOrCreate: {
4891
+ where: {
4892
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4893
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4894
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4895
+ },
4896
+ create: {
4897
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4898
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4899
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4900
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4901
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4902
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4903
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4904
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4905
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4906
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4907
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4908
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4909
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4910
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4911
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4912
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4913
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4914
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4915
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4916
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4917
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4918
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4919
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4920
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4921
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4922
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4923
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4924
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4925
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4926
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4927
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4928
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4929
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4930
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4931
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4932
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4933
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4934
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4935
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4936
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4937
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4938
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4939
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4940
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4941
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4942
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4943
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4944
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4945
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4946
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4947
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4948
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4949
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4950
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
4951
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
4952
+ },
4953
+ }
4954
+ } : undefined,
1226
4955
  },
1227
4956
  }))
1228
4957
  } : undefined,
@@ -1250,6 +4979,77 @@ export const Alert = {
1250
4979
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
1251
4980
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
1252
4981
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
4982
+ asset: item.asset ?
4983
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
4984
+ ? { connect: {
4985
+ id: item.asset.id
4986
+ }
4987
+ }
4988
+ : { connectOrCreate: {
4989
+ where: {
4990
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4991
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4992
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4993
+ },
4994
+ create: {
4995
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4996
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4997
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4998
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4999
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
5000
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
5001
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
5002
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
5003
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
5004
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
5005
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
5006
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
5007
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
5008
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
5009
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
5010
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
5011
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
5012
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
5013
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
5014
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
5015
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
5016
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
5017
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
5018
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
5019
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
5020
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
5021
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
5022
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
5023
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
5024
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
5025
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
5026
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
5027
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
5028
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
5029
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
5030
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
5031
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
5032
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
5033
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
5034
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
5035
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
5036
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
5037
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
5038
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
5039
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
5040
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
5041
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
5042
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
5043
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
5044
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
5045
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
5046
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
5047
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
5048
+ askPrice: item.asset.askPrice !== undefined ? item.asset.askPrice : undefined,
5049
+ bidPrice: item.asset.bidPrice !== undefined ? item.asset.bidPrice : undefined,
5050
+ },
5051
+ }
5052
+ } : undefined,
1253
5053
  },
1254
5054
  }))
1255
5055
  } : undefined,