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