adaptic-backend 1.0.75 → 1.0.76

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 (57) hide show
  1. package/Account.cjs +255 -190
  2. package/Action.cjs +594 -524
  3. package/Alert.cjs +343 -278
  4. package/AlpacaAccount.cjs +1181 -1021
  5. package/Asset.cjs +478 -368
  6. package/Authenticator.cjs +276 -211
  7. package/Customer.cjs +255 -190
  8. package/NewsArticle.cjs +232 -212
  9. package/NewsArticleAssetSentiment.cjs +345 -290
  10. package/Order.cjs +676 -541
  11. package/Position.cjs +603 -488
  12. package/Session.cjs +279 -214
  13. package/Trade.cjs +748 -613
  14. package/User.cjs +394 -309
  15. package/package.json +1 -1
  16. package/server/Account.d.ts.map +1 -1
  17. package/server/Account.js.map +1 -1
  18. package/server/Account.mjs +255 -190
  19. package/server/Action.d.ts.map +1 -1
  20. package/server/Action.js.map +1 -1
  21. package/server/Action.mjs +594 -524
  22. package/server/Alert.d.ts.map +1 -1
  23. package/server/Alert.js.map +1 -1
  24. package/server/Alert.mjs +343 -278
  25. package/server/AlpacaAccount.d.ts.map +1 -1
  26. package/server/AlpacaAccount.js.map +1 -1
  27. package/server/AlpacaAccount.mjs +1181 -1021
  28. package/server/Asset.d.ts.map +1 -1
  29. package/server/Asset.js.map +1 -1
  30. package/server/Asset.mjs +478 -368
  31. package/server/Authenticator.d.ts.map +1 -1
  32. package/server/Authenticator.js.map +1 -1
  33. package/server/Authenticator.mjs +276 -211
  34. package/server/Customer.d.ts.map +1 -1
  35. package/server/Customer.js.map +1 -1
  36. package/server/Customer.mjs +255 -190
  37. package/server/NewsArticle.d.ts.map +1 -1
  38. package/server/NewsArticle.js.map +1 -1
  39. package/server/NewsArticle.mjs +232 -212
  40. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  41. package/server/NewsArticleAssetSentiment.js.map +1 -1
  42. package/server/NewsArticleAssetSentiment.mjs +345 -290
  43. package/server/Order.d.ts.map +1 -1
  44. package/server/Order.js.map +1 -1
  45. package/server/Order.mjs +676 -541
  46. package/server/Position.d.ts.map +1 -1
  47. package/server/Position.js.map +1 -1
  48. package/server/Position.mjs +603 -488
  49. package/server/Session.d.ts.map +1 -1
  50. package/server/Session.js.map +1 -1
  51. package/server/Session.mjs +279 -214
  52. package/server/Trade.d.ts.map +1 -1
  53. package/server/Trade.js.map +1 -1
  54. package/server/Trade.mjs +748 -613
  55. package/server/User.d.ts.map +1 -1
  56. package/server/User.js.map +1 -1
  57. package/server/User.mjs +394 -309
@@ -298,393 +298,463 @@ export const AlpacaAccount = {
298
298
  APISecret: props.APISecret !== undefined ? props.APISecret : undefined,
299
299
  configuration: props.configuration !== undefined ? props.configuration : undefined,
300
300
  marketOpen: props.marketOpen !== undefined ? props.marketOpen : undefined,
301
- user: props.user ? {
302
- connectOrCreate: {
303
- where: {
304
- id: props.user.id !== undefined ? props.user.id : undefined,
305
- email: props.user.email !== undefined ? props.user.email : undefined,
306
- name: props.user.name !== undefined ? {
307
- equals: props.user.name
308
- } : undefined,
309
- },
310
- create: {
311
- name: props.user.name !== undefined ? props.user.name : undefined,
312
- email: props.user.email !== undefined ? props.user.email : undefined,
313
- emailVerified: props.user.emailVerified !== undefined ? props.user.emailVerified : undefined,
314
- image: props.user.image !== undefined ? props.user.image : undefined,
315
- role: props.user.role !== undefined ? props.user.role : undefined,
316
- bio: props.user.bio !== undefined ? props.user.bio : undefined,
317
- jobTitle: props.user.jobTitle !== undefined ? props.user.jobTitle : undefined,
318
- currentAccount: props.user.currentAccount !== undefined ? props.user.currentAccount : undefined,
319
- plan: props.user.plan !== undefined ? props.user.plan : undefined,
320
- customer: props.user.customer ? {
321
- connectOrCreate: {
322
- where: {
323
- id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
324
- name: props.user.customer.name !== undefined ? {
325
- equals: props.user.customer.name
326
- } : undefined,
327
- },
328
- create: {
329
- authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
330
- name: props.user.customer.name !== undefined ? props.user.customer.name : undefined,
331
- plan: props.user.customer.plan !== undefined ? props.user.customer.plan : undefined,
332
- stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
333
- stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
334
- stripePriceId: props.user.customer.stripePriceId !== undefined ? props.user.customer.stripePriceId : undefined,
335
- stripeCurrentPeriodEnd: props.user.customer.stripeCurrentPeriodEnd !== undefined ? props.user.customer.stripeCurrentPeriodEnd : undefined,
336
- },
337
- }
338
- } : undefined,
339
- accounts: props.user.accounts ? {
340
- connectOrCreate: props.user.accounts.map((item) => ({
341
- where: {
342
- id: item.id !== undefined ? item.id : undefined,
343
- },
344
- create: {
345
- type: item.type !== undefined ? item.type : undefined,
346
- provider: item.provider !== undefined ? item.provider : undefined,
347
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
348
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
349
- access_token: item.access_token !== undefined ? item.access_token : undefined,
350
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
351
- token_type: item.token_type !== undefined ? item.token_type : undefined,
352
- scope: item.scope !== undefined ? item.scope : undefined,
353
- id_token: item.id_token !== undefined ? item.id_token : undefined,
354
- session_state: item.session_state !== undefined ? item.session_state : undefined,
355
- },
356
- }))
357
- } : undefined,
358
- sessions: props.user.sessions ? {
359
- connectOrCreate: props.user.sessions.map((item) => ({
360
- where: {
361
- id: item.id !== undefined ? item.id : undefined,
362
- },
363
- create: {
364
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
365
- expires: item.expires !== undefined ? item.expires : undefined,
366
- },
367
- }))
368
- } : undefined,
369
- authenticators: props.user.authenticators ? {
370
- connectOrCreate: props.user.authenticators.map((item) => ({
371
- where: {
372
- id: item.id !== undefined ? item.id : undefined,
373
- },
374
- create: {
375
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
376
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
377
- counter: item.counter !== undefined ? item.counter : undefined,
378
- },
379
- }))
380
- } : undefined,
381
- },
382
- }
383
- } : undefined,
384
- trades: props.trades ? {
385
- connectOrCreate: props.trades.map((item) => ({
386
- where: {
387
- id: item.id !== undefined ? item.id : undefined,
388
- },
389
- create: {
390
- qty: item.qty !== undefined ? item.qty : undefined,
391
- price: item.price !== undefined ? item.price : undefined,
392
- total: item.total !== undefined ? item.total : undefined,
393
- signal: item.signal !== undefined ? item.signal : undefined,
394
- strategy: item.strategy !== undefined ? item.strategy : undefined,
395
- analysis: item.analysis !== undefined ? item.analysis : undefined,
396
- confidence: item.confidence !== undefined ? item.confidence : undefined,
397
- timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
398
- status: item.status !== undefined ? item.status : undefined,
399
- optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
400
- asset: item.asset ? {
401
- connectOrCreate: {
402
- where: {
403
- id: item.asset.id !== undefined ? item.asset.id : undefined,
404
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
405
- name: item.asset.name !== undefined ? item.asset.name : undefined,
406
- },
407
- create: {
408
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
409
- name: item.asset.name !== undefined ? item.asset.name : undefined,
410
- type: item.asset.type !== undefined ? item.asset.type : undefined,
411
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
412
- description: item.asset.description !== undefined ? item.asset.description : undefined,
413
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
414
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
415
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
416
- country: item.asset.country !== undefined ? item.asset.country : undefined,
417
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
418
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
419
- address: item.asset.address !== undefined ? item.asset.address : undefined,
420
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
421
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
422
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
423
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
424
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
425
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
426
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
427
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
428
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
429
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
430
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
431
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
432
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
433
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
434
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
435
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
436
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
437
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
438
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
439
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
440
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
441
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
442
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
443
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
444
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
445
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
446
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
447
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
448
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
449
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
450
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
451
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
452
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
453
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
454
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
455
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
456
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
457
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
458
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
459
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
460
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
461
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
462
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
463
- },
464
- }
465
- } : undefined,
466
- actions: item.actions ? {
467
- connectOrCreate: item.actions.map((item) => ({
468
- where: {
469
- id: item.id !== undefined ? item.id : undefined,
470
- },
471
- create: {
472
- sequence: item.sequence !== undefined ? item.sequence : undefined,
473
- type: item.type !== undefined ? item.type : undefined,
474
- note: item.note !== undefined ? item.note : undefined,
475
- status: item.status !== undefined ? item.status : undefined,
476
- fee: item.fee !== undefined ? item.fee : undefined,
477
- },
478
- }))
479
- } : undefined,
480
- },
481
- }))
482
- } : undefined,
483
- orders: props.orders ? {
484
- connectOrCreate: props.orders.map((item) => ({
485
- where: {
486
- id: item.id !== undefined ? item.id : undefined,
487
- },
488
- create: {
489
- qty: item.qty !== undefined ? item.qty : undefined,
490
- notional: item.notional !== undefined ? item.notional : undefined,
491
- side: item.side !== undefined ? item.side : undefined,
492
- type: item.type !== undefined ? item.type : undefined,
493
- timeInForce: item.timeInForce !== undefined ? item.timeInForce : undefined,
494
- limitPrice: item.limitPrice !== undefined ? item.limitPrice : undefined,
495
- stopPrice: item.stopPrice !== undefined ? item.stopPrice : undefined,
496
- trailPrice: item.trailPrice !== undefined ? item.trailPrice : undefined,
497
- trailPercent: item.trailPercent !== undefined ? item.trailPercent : undefined,
498
- extendedHours: item.extendedHours !== undefined ? item.extendedHours : undefined,
499
- clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
500
- status: item.status !== undefined ? item.status : undefined,
501
- submittedAt: item.submittedAt !== undefined ? item.submittedAt : undefined,
502
- filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
503
- filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
504
- fee: item.fee !== undefined ? item.fee : undefined,
505
- action: item.action ? {
506
- connectOrCreate: {
507
- where: {
508
- id: item.action.id !== undefined ? item.action.id : undefined,
509
- },
510
- create: {
511
- sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
512
- type: item.action.type !== undefined ? item.action.type : undefined,
513
- note: item.action.note !== undefined ? item.action.note : undefined,
514
- status: item.action.status !== undefined ? item.action.status : undefined,
515
- fee: item.action.fee !== undefined ? item.action.fee : undefined,
516
- },
517
- }
518
- } : undefined,
519
- asset: item.asset ? {
520
- connectOrCreate: {
521
- where: {
522
- id: item.asset.id !== undefined ? item.asset.id : undefined,
523
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
524
- name: item.asset.name !== undefined ? item.asset.name : undefined,
525
- },
526
- create: {
527
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
528
- name: item.asset.name !== undefined ? item.asset.name : undefined,
529
- type: item.asset.type !== undefined ? item.asset.type : undefined,
530
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
531
- description: item.asset.description !== undefined ? item.asset.description : undefined,
532
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
533
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
534
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
535
- country: item.asset.country !== undefined ? item.asset.country : undefined,
536
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
537
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
538
- address: item.asset.address !== undefined ? item.asset.address : undefined,
539
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
540
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
541
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
542
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
543
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
544
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
545
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
546
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
547
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
548
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
549
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
550
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
551
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
552
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
553
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
554
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
555
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
556
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
557
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
558
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
559
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
560
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
561
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
562
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
563
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
564
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
565
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
566
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
567
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
568
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
569
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
570
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
571
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
572
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
573
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
574
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
575
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
576
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
577
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
578
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
579
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
580
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
581
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
582
- },
583
- }
584
- } : undefined,
585
- },
586
- }))
587
- } : undefined,
588
- positions: props.positions ? {
589
- connectOrCreate: props.positions.map((item) => ({
590
- where: {
591
- id: item.id !== undefined ? item.id : undefined,
592
- },
593
- create: {
594
- averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
595
- qty: item.qty !== undefined ? item.qty : undefined,
596
- qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
597
- marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
598
- costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
599
- unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
600
- unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
601
- unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
602
- unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
603
- currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
604
- lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
605
- changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
606
- assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
607
- asset: item.asset ? {
608
- connectOrCreate: {
609
- where: {
610
- id: item.asset.id !== undefined ? item.asset.id : undefined,
611
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
612
- name: item.asset.name !== undefined ? item.asset.name : undefined,
613
- },
614
- create: {
615
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
616
- name: item.asset.name !== undefined ? item.asset.name : undefined,
617
- type: item.asset.type !== undefined ? item.asset.type : undefined,
618
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
619
- description: item.asset.description !== undefined ? item.asset.description : undefined,
620
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
621
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
622
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
623
- country: item.asset.country !== undefined ? item.asset.country : undefined,
624
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
625
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
626
- address: item.asset.address !== undefined ? item.asset.address : undefined,
627
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
628
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
629
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
630
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
631
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
632
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
633
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
634
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
635
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
636
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
637
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
638
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
639
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
640
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
641
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
642
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
643
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
644
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
645
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
646
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
647
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
648
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
649
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
650
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
651
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
652
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
653
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
654
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
655
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
656
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
657
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
658
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
659
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
660
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
661
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
662
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
663
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
664
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
665
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
666
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
667
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
668
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
669
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
670
- },
671
- }
672
- } : undefined,
673
- },
674
- }))
675
- } : undefined,
676
- alerts: props.alerts ? {
677
- connectOrCreate: props.alerts.map((item) => ({
678
- where: {
679
- id: item.id !== undefined ? item.id : undefined,
680
- },
681
- create: {
682
- message: item.message !== undefined ? item.message : undefined,
683
- type: item.type !== undefined ? item.type : undefined,
684
- isRead: item.isRead !== undefined ? item.isRead : undefined,
685
- },
686
- }))
687
- } : undefined,
301
+ user: props.user ?
302
+ typeof props.user === 'object' && Object.keys(props.user).length === 1 && Object.keys(props.user)[0] === 'id'
303
+ ? { connect: {
304
+ id: props.user.id
305
+ }
306
+ }
307
+ : { connectOrCreate: {
308
+ where: {
309
+ id: props.user.id !== undefined ? props.user.id : undefined,
310
+ email: props.user.email !== undefined ? props.user.email : undefined,
311
+ name: props.user.name !== undefined ? {
312
+ equals: props.user.name
313
+ } : undefined,
314
+ },
315
+ create: {
316
+ name: props.user.name !== undefined ? props.user.name : undefined,
317
+ email: props.user.email !== undefined ? props.user.email : undefined,
318
+ emailVerified: props.user.emailVerified !== undefined ? props.user.emailVerified : undefined,
319
+ image: props.user.image !== undefined ? props.user.image : undefined,
320
+ role: props.user.role !== undefined ? props.user.role : undefined,
321
+ bio: props.user.bio !== undefined ? props.user.bio : undefined,
322
+ jobTitle: props.user.jobTitle !== undefined ? props.user.jobTitle : undefined,
323
+ currentAccount: props.user.currentAccount !== undefined ? props.user.currentAccount : undefined,
324
+ plan: props.user.plan !== undefined ? props.user.plan : undefined,
325
+ customer: props.user.customer ?
326
+ typeof props.user.customer === 'object' && Object.keys(props.user.customer).length === 1 && Object.keys(props.user.customer)[0] === 'id'
327
+ ? { connect: {
328
+ id: props.user.customer.id
329
+ }
330
+ }
331
+ : { connectOrCreate: {
332
+ where: {
333
+ id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
334
+ name: props.user.customer.name !== undefined ? {
335
+ equals: props.user.customer.name
336
+ } : undefined,
337
+ },
338
+ create: {
339
+ authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
340
+ name: props.user.customer.name !== undefined ? props.user.customer.name : undefined,
341
+ plan: props.user.customer.plan !== undefined ? props.user.customer.plan : undefined,
342
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
343
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
344
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? props.user.customer.stripePriceId : undefined,
345
+ stripeCurrentPeriodEnd: props.user.customer.stripeCurrentPeriodEnd !== undefined ? props.user.customer.stripeCurrentPeriodEnd : undefined,
346
+ },
347
+ }
348
+ } : undefined,
349
+ accounts: props.user.accounts ?
350
+ typeof props.user.accounts[0] === 'object' && Object.keys(props.user.accounts).length === 1 && Object.keys(props.user.accounts)[0] === 'id'
351
+ ? { connect: props.user.accounts.map((item) => ({
352
+ id: item.id
353
+ }))
354
+ }
355
+ : { connectOrCreate: props.user.accounts.map((item) => ({
356
+ where: {
357
+ id: item.id !== undefined ? item.id : undefined,
358
+ },
359
+ create: {
360
+ type: item.type !== undefined ? item.type : undefined,
361
+ provider: item.provider !== undefined ? item.provider : undefined,
362
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
363
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
364
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
365
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
366
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
367
+ scope: item.scope !== undefined ? item.scope : undefined,
368
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
369
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
370
+ },
371
+ }))
372
+ } : undefined,
373
+ sessions: props.user.sessions ?
374
+ typeof props.user.sessions[0] === 'object' && Object.keys(props.user.sessions).length === 1 && Object.keys(props.user.sessions)[0] === 'id'
375
+ ? { connect: props.user.sessions.map((item) => ({
376
+ id: item.id
377
+ }))
378
+ }
379
+ : { connectOrCreate: props.user.sessions.map((item) => ({
380
+ where: {
381
+ id: item.id !== undefined ? item.id : undefined,
382
+ },
383
+ create: {
384
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
385
+ expires: item.expires !== undefined ? item.expires : undefined,
386
+ },
387
+ }))
388
+ } : undefined,
389
+ authenticators: props.user.authenticators ?
390
+ typeof props.user.authenticators[0] === 'object' && Object.keys(props.user.authenticators).length === 1 && Object.keys(props.user.authenticators)[0] === 'id'
391
+ ? { connect: props.user.authenticators.map((item) => ({
392
+ id: item.id
393
+ }))
394
+ }
395
+ : { connectOrCreate: props.user.authenticators.map((item) => ({
396
+ where: {
397
+ id: item.id !== undefined ? item.id : undefined,
398
+ },
399
+ create: {
400
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
401
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
402
+ counter: item.counter !== undefined ? item.counter : undefined,
403
+ },
404
+ }))
405
+ } : undefined,
406
+ },
407
+ }
408
+ } : undefined,
409
+ trades: props.trades ?
410
+ typeof props.trades[0] === 'object' && Object.keys(props.trades).length === 1 && Object.keys(props.trades)[0] === 'id'
411
+ ? { connect: props.trades.map((item) => ({
412
+ id: item.id
413
+ }))
414
+ }
415
+ : { connectOrCreate: props.trades.map((item) => ({
416
+ where: {
417
+ id: item.id !== undefined ? item.id : undefined,
418
+ },
419
+ create: {
420
+ qty: item.qty !== undefined ? item.qty : undefined,
421
+ price: item.price !== undefined ? item.price : undefined,
422
+ total: item.total !== undefined ? item.total : undefined,
423
+ signal: item.signal !== undefined ? item.signal : undefined,
424
+ strategy: item.strategy !== undefined ? item.strategy : undefined,
425
+ analysis: item.analysis !== undefined ? item.analysis : undefined,
426
+ confidence: item.confidence !== undefined ? item.confidence : undefined,
427
+ timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
428
+ status: item.status !== undefined ? item.status : undefined,
429
+ optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
430
+ asset: item.asset ?
431
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
432
+ ? { connect: {
433
+ id: item.asset.id
434
+ }
435
+ }
436
+ : { connectOrCreate: {
437
+ where: {
438
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
439
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
440
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
441
+ },
442
+ create: {
443
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
444
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
445
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
446
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
447
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
448
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
449
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
450
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
451
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
452
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
453
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
454
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
455
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
456
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
457
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
458
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
459
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
460
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
461
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
462
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
463
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
464
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
465
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
466
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
467
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
468
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
469
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
470
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
471
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
472
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
473
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
474
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
475
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
476
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
477
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
478
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
479
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
480
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
481
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
482
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
483
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
484
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
485
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
486
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
487
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
488
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
489
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
490
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
491
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
492
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
493
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
494
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
495
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
496
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
497
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
498
+ },
499
+ }
500
+ } : undefined,
501
+ actions: item.actions ?
502
+ typeof item.actions[0] === 'object' && Object.keys(item.actions).length === 1 && Object.keys(item.actions)[0] === 'id'
503
+ ? { connect: item.actions.map((item) => ({
504
+ id: item.id
505
+ }))
506
+ }
507
+ : { connectOrCreate: item.actions.map((item) => ({
508
+ where: {
509
+ id: item.id !== undefined ? item.id : undefined,
510
+ },
511
+ create: {
512
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
513
+ type: item.type !== undefined ? item.type : undefined,
514
+ note: item.note !== undefined ? item.note : undefined,
515
+ status: item.status !== undefined ? item.status : undefined,
516
+ fee: item.fee !== undefined ? item.fee : undefined,
517
+ },
518
+ }))
519
+ } : undefined,
520
+ },
521
+ }))
522
+ } : undefined,
523
+ orders: props.orders ?
524
+ typeof props.orders[0] === 'object' && Object.keys(props.orders).length === 1 && Object.keys(props.orders)[0] === 'id'
525
+ ? { connect: props.orders.map((item) => ({
526
+ id: item.id
527
+ }))
528
+ }
529
+ : { connectOrCreate: props.orders.map((item) => ({
530
+ where: {
531
+ id: item.id !== undefined ? item.id : undefined,
532
+ },
533
+ create: {
534
+ qty: item.qty !== undefined ? item.qty : undefined,
535
+ notional: item.notional !== undefined ? item.notional : undefined,
536
+ side: item.side !== undefined ? item.side : undefined,
537
+ type: item.type !== undefined ? item.type : undefined,
538
+ timeInForce: item.timeInForce !== undefined ? item.timeInForce : undefined,
539
+ limitPrice: item.limitPrice !== undefined ? item.limitPrice : undefined,
540
+ stopPrice: item.stopPrice !== undefined ? item.stopPrice : undefined,
541
+ trailPrice: item.trailPrice !== undefined ? item.trailPrice : undefined,
542
+ trailPercent: item.trailPercent !== undefined ? item.trailPercent : undefined,
543
+ extendedHours: item.extendedHours !== undefined ? item.extendedHours : undefined,
544
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
545
+ status: item.status !== undefined ? item.status : undefined,
546
+ submittedAt: item.submittedAt !== undefined ? item.submittedAt : undefined,
547
+ filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
548
+ filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
549
+ fee: item.fee !== undefined ? item.fee : undefined,
550
+ action: item.action ?
551
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
552
+ ? { connect: {
553
+ id: item.action.id
554
+ }
555
+ }
556
+ : { connectOrCreate: {
557
+ where: {
558
+ id: item.action.id !== undefined ? item.action.id : undefined,
559
+ },
560
+ create: {
561
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
562
+ type: item.action.type !== undefined ? item.action.type : undefined,
563
+ note: item.action.note !== undefined ? item.action.note : undefined,
564
+ status: item.action.status !== undefined ? item.action.status : undefined,
565
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
566
+ },
567
+ }
568
+ } : undefined,
569
+ asset: item.asset ?
570
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
571
+ ? { connect: {
572
+ id: item.asset.id
573
+ }
574
+ }
575
+ : { connectOrCreate: {
576
+ where: {
577
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
578
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
579
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
580
+ },
581
+ create: {
582
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
583
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
584
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
585
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
586
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
587
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
588
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
589
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
590
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
591
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
592
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
593
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
594
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
595
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
596
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
597
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
598
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
599
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
600
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
601
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
602
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
603
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
604
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
605
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
606
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
607
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
608
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
609
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
610
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
611
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
612
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
613
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
614
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
615
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
616
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
617
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
618
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
619
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
620
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
621
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
622
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
623
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
624
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
625
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
626
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
627
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
628
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
629
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
630
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
631
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
632
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
633
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
634
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
635
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
636
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
637
+ },
638
+ }
639
+ } : undefined,
640
+ },
641
+ }))
642
+ } : undefined,
643
+ positions: props.positions ?
644
+ typeof props.positions[0] === 'object' && Object.keys(props.positions).length === 1 && Object.keys(props.positions)[0] === 'id'
645
+ ? { connect: props.positions.map((item) => ({
646
+ id: item.id
647
+ }))
648
+ }
649
+ : { connectOrCreate: props.positions.map((item) => ({
650
+ where: {
651
+ id: item.id !== undefined ? item.id : undefined,
652
+ },
653
+ create: {
654
+ averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
655
+ qty: item.qty !== undefined ? item.qty : undefined,
656
+ qtyAvailable: item.qtyAvailable !== undefined ? item.qtyAvailable : undefined,
657
+ marketValue: item.marketValue !== undefined ? item.marketValue : undefined,
658
+ costBasis: item.costBasis !== undefined ? item.costBasis : undefined,
659
+ unrealizedPL: item.unrealizedPL !== undefined ? item.unrealizedPL : undefined,
660
+ unrealizedPLPC: item.unrealizedPLPC !== undefined ? item.unrealizedPLPC : undefined,
661
+ unrealisedIntradayPL: item.unrealisedIntradayPL !== undefined ? item.unrealisedIntradayPL : undefined,
662
+ unrealisedIntradayPLPC: item.unrealisedIntradayPLPC !== undefined ? item.unrealisedIntradayPLPC : undefined,
663
+ currentPrice: item.currentPrice !== undefined ? item.currentPrice : undefined,
664
+ lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
665
+ changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
666
+ assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
667
+ asset: item.asset ?
668
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
669
+ ? { connect: {
670
+ id: item.asset.id
671
+ }
672
+ }
673
+ : { connectOrCreate: {
674
+ where: {
675
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
676
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
677
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
678
+ },
679
+ create: {
680
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
681
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
682
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
683
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
684
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
685
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
686
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
687
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
688
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
689
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
690
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
691
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
692
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
693
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
694
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
695
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
696
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
697
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
698
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
699
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
700
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
701
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
702
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
703
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
704
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
705
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
706
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
707
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
708
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
709
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
710
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
711
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
712
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
713
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
714
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
715
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
716
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
717
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
718
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
719
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
720
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
721
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
722
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
723
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
724
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
725
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
726
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
727
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
728
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
729
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
730
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
731
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
732
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
733
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
734
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
735
+ },
736
+ }
737
+ } : undefined,
738
+ },
739
+ }))
740
+ } : undefined,
741
+ alerts: props.alerts ?
742
+ typeof props.alerts[0] === 'object' && Object.keys(props.alerts).length === 1 && Object.keys(props.alerts)[0] === 'id'
743
+ ? { connect: props.alerts.map((item) => ({
744
+ id: item.id
745
+ }))
746
+ }
747
+ : { connectOrCreate: props.alerts.map((item) => ({
748
+ where: {
749
+ id: item.id !== undefined ? item.id : undefined,
750
+ },
751
+ create: {
752
+ message: item.message !== undefined ? item.message : undefined,
753
+ type: item.type !== undefined ? item.type : undefined,
754
+ isRead: item.isRead !== undefined ? item.isRead : undefined,
755
+ },
756
+ }))
757
+ } : undefined,
688
758
  },
689
759
  };
690
760
  const filteredVariables = removeUndefinedProps(variables);
@@ -1258,67 +1328,87 @@ export const AlpacaAccount = {
1258
1328
  jobTitle: props.user.jobTitle !== undefined ? props.user.jobTitle : undefined,
1259
1329
  currentAccount: props.user.currentAccount !== undefined ? props.user.currentAccount : undefined,
1260
1330
  plan: props.user.plan !== undefined ? props.user.plan : undefined,
1261
- customer: props.user.customer ? {
1262
- connectOrCreate: {
1263
- where: {
1264
- id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
1265
- name: props.user.customer.name !== undefined ? {
1266
- equals: props.user.customer.name
1267
- } : undefined,
1268
- },
1269
- create: {
1270
- authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
1271
- name: props.user.customer.name !== undefined ? props.user.customer.name : undefined,
1272
- plan: props.user.customer.plan !== undefined ? props.user.customer.plan : undefined,
1273
- stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
1274
- stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
1275
- stripePriceId: props.user.customer.stripePriceId !== undefined ? props.user.customer.stripePriceId : undefined,
1276
- stripeCurrentPeriodEnd: props.user.customer.stripeCurrentPeriodEnd !== undefined ? props.user.customer.stripeCurrentPeriodEnd : undefined,
1277
- },
1278
- }
1279
- } : undefined,
1280
- accounts: props.user.accounts ? {
1281
- connectOrCreate: props.user.accounts.map((item) => ({
1282
- where: {
1283
- id: item.id !== undefined ? item.id : undefined,
1284
- },
1285
- create: {
1286
- type: item.type !== undefined ? item.type : undefined,
1287
- provider: item.provider !== undefined ? item.provider : undefined,
1288
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1289
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1290
- access_token: item.access_token !== undefined ? item.access_token : undefined,
1291
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1292
- token_type: item.token_type !== undefined ? item.token_type : undefined,
1293
- scope: item.scope !== undefined ? item.scope : undefined,
1294
- id_token: item.id_token !== undefined ? item.id_token : undefined,
1295
- session_state: item.session_state !== undefined ? item.session_state : undefined,
1296
- },
1297
- }))
1298
- } : undefined,
1299
- sessions: props.user.sessions ? {
1300
- connectOrCreate: props.user.sessions.map((item) => ({
1301
- where: {
1302
- id: item.id !== undefined ? item.id : undefined,
1303
- },
1304
- create: {
1305
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1306
- expires: item.expires !== undefined ? item.expires : undefined,
1307
- },
1308
- }))
1309
- } : undefined,
1310
- authenticators: props.user.authenticators ? {
1311
- connectOrCreate: props.user.authenticators.map((item) => ({
1312
- where: {
1313
- id: item.id !== undefined ? item.id : undefined,
1314
- },
1315
- create: {
1316
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1317
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1318
- counter: item.counter !== undefined ? item.counter : undefined,
1319
- },
1320
- }))
1321
- } : undefined,
1331
+ customer: props.user.customer ?
1332
+ typeof props.user.customer === 'object' && Object.keys(props.user.customer).length === 1 && Object.keys(props.user.customer)[0] === 'id'
1333
+ ? { connect: {
1334
+ id: props.user.customer.id
1335
+ }
1336
+ }
1337
+ : { connectOrCreate: {
1338
+ where: {
1339
+ id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
1340
+ name: props.user.customer.name !== undefined ? {
1341
+ equals: props.user.customer.name
1342
+ } : undefined,
1343
+ },
1344
+ create: {
1345
+ authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
1346
+ name: props.user.customer.name !== undefined ? props.user.customer.name : undefined,
1347
+ plan: props.user.customer.plan !== undefined ? props.user.customer.plan : undefined,
1348
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
1349
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
1350
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? props.user.customer.stripePriceId : undefined,
1351
+ stripeCurrentPeriodEnd: props.user.customer.stripeCurrentPeriodEnd !== undefined ? props.user.customer.stripeCurrentPeriodEnd : undefined,
1352
+ },
1353
+ }
1354
+ } : undefined,
1355
+ accounts: props.user.accounts ?
1356
+ typeof props.user.accounts[0] === 'object' && Object.keys(props.user.accounts).length === 1 && Object.keys(props.user.accounts)[0] === 'id'
1357
+ ? { connect: props.user.accounts.map((item) => ({
1358
+ id: item.id
1359
+ }))
1360
+ }
1361
+ : { connectOrCreate: props.user.accounts.map((item) => ({
1362
+ where: {
1363
+ id: item.id !== undefined ? item.id : undefined,
1364
+ },
1365
+ create: {
1366
+ type: item.type !== undefined ? item.type : undefined,
1367
+ provider: item.provider !== undefined ? item.provider : undefined,
1368
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
1369
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
1370
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
1371
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
1372
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
1373
+ scope: item.scope !== undefined ? item.scope : undefined,
1374
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
1375
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
1376
+ },
1377
+ }))
1378
+ } : undefined,
1379
+ sessions: props.user.sessions ?
1380
+ typeof props.user.sessions[0] === 'object' && Object.keys(props.user.sessions).length === 1 && Object.keys(props.user.sessions)[0] === 'id'
1381
+ ? { connect: props.user.sessions.map((item) => ({
1382
+ id: item.id
1383
+ }))
1384
+ }
1385
+ : { connectOrCreate: props.user.sessions.map((item) => ({
1386
+ where: {
1387
+ id: item.id !== undefined ? item.id : undefined,
1388
+ },
1389
+ create: {
1390
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
1391
+ expires: item.expires !== undefined ? item.expires : undefined,
1392
+ },
1393
+ }))
1394
+ } : undefined,
1395
+ authenticators: props.user.authenticators ?
1396
+ typeof props.user.authenticators[0] === 'object' && Object.keys(props.user.authenticators).length === 1 && Object.keys(props.user.authenticators)[0] === 'id'
1397
+ ? { connect: props.user.authenticators.map((item) => ({
1398
+ id: item.id
1399
+ }))
1400
+ }
1401
+ : { connectOrCreate: props.user.authenticators.map((item) => ({
1402
+ where: {
1403
+ id: item.id !== undefined ? item.id : undefined,
1404
+ },
1405
+ create: {
1406
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
1407
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
1408
+ counter: item.counter !== undefined ? item.counter : undefined,
1409
+ },
1410
+ }))
1411
+ } : undefined,
1322
1412
  },
1323
1413
  }
1324
1414
  } : undefined,
@@ -1618,107 +1708,15 @@ export const AlpacaAccount = {
1618
1708
  type: item.type !== undefined ? {
1619
1709
  set: item.type
1620
1710
  } : undefined,
1621
- note: item.note !== undefined ? {
1622
- set: item.note
1623
- } : undefined,
1624
- status: item.status !== undefined ? {
1625
- set: item.status
1626
- } : undefined,
1627
- fee: item.fee !== undefined ? {
1628
- set: item.fee
1629
- } : undefined,
1630
- },
1631
- create: {
1632
- sequence: item.sequence !== undefined ? item.sequence : undefined,
1633
- type: item.type !== undefined ? item.type : undefined,
1634
- note: item.note !== undefined ? item.note : undefined,
1635
- status: item.status !== undefined ? item.status : undefined,
1636
- fee: item.fee !== undefined ? item.fee : undefined,
1637
- },
1638
- }))
1639
- } : undefined,
1640
- },
1641
- create: {
1642
- qty: item.qty !== undefined ? item.qty : undefined,
1643
- price: item.price !== undefined ? item.price : undefined,
1644
- total: item.total !== undefined ? item.total : undefined,
1645
- signal: item.signal !== undefined ? item.signal : undefined,
1646
- strategy: item.strategy !== undefined ? item.strategy : undefined,
1647
- analysis: item.analysis !== undefined ? item.analysis : undefined,
1648
- confidence: item.confidence !== undefined ? item.confidence : undefined,
1649
- timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
1650
- status: item.status !== undefined ? item.status : undefined,
1651
- optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
1652
- asset: item.asset ? {
1653
- connectOrCreate: {
1654
- where: {
1655
- id: item.asset.id !== undefined ? item.asset.id : undefined,
1656
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1657
- name: item.asset.name !== undefined ? item.asset.name : undefined,
1658
- },
1659
- create: {
1660
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1661
- name: item.asset.name !== undefined ? item.asset.name : undefined,
1662
- type: item.asset.type !== undefined ? item.asset.type : undefined,
1663
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
1664
- description: item.asset.description !== undefined ? item.asset.description : undefined,
1665
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
1666
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
1667
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
1668
- country: item.asset.country !== undefined ? item.asset.country : undefined,
1669
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
1670
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
1671
- address: item.asset.address !== undefined ? item.asset.address : undefined,
1672
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
1673
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
1674
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
1675
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
1676
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
1677
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
1678
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
1679
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
1680
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
1681
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
1682
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
1683
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
1684
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
1685
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
1686
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
1687
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
1688
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
1689
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
1690
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
1691
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
1692
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
1693
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
1694
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
1695
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
1696
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
1697
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
1698
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
1699
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
1700
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
1701
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
1702
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
1703
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
1704
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
1705
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
1706
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
1707
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
1708
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
1709
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
1710
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
1711
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
1712
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
1713
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
1714
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
1715
- },
1716
- }
1717
- } : undefined,
1718
- actions: item.actions ? {
1719
- connectOrCreate: item.actions.map((item) => ({
1720
- where: {
1721
- id: item.id !== undefined ? item.id : undefined,
1711
+ note: item.note !== undefined ? {
1712
+ set: item.note
1713
+ } : undefined,
1714
+ status: item.status !== undefined ? {
1715
+ set: item.status
1716
+ } : undefined,
1717
+ fee: item.fee !== undefined ? {
1718
+ set: item.fee
1719
+ } : undefined,
1722
1720
  },
1723
1721
  create: {
1724
1722
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -1730,6 +1728,108 @@ export const AlpacaAccount = {
1730
1728
  }))
1731
1729
  } : undefined,
1732
1730
  },
1731
+ create: {
1732
+ qty: item.qty !== undefined ? item.qty : undefined,
1733
+ price: item.price !== undefined ? item.price : undefined,
1734
+ total: item.total !== undefined ? item.total : undefined,
1735
+ signal: item.signal !== undefined ? item.signal : undefined,
1736
+ strategy: item.strategy !== undefined ? item.strategy : undefined,
1737
+ analysis: item.analysis !== undefined ? item.analysis : undefined,
1738
+ confidence: item.confidence !== undefined ? item.confidence : undefined,
1739
+ timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
1740
+ status: item.status !== undefined ? item.status : undefined,
1741
+ optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
1742
+ asset: item.asset ?
1743
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
1744
+ ? { connect: {
1745
+ id: item.asset.id
1746
+ }
1747
+ }
1748
+ : { connectOrCreate: {
1749
+ where: {
1750
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
1751
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1752
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1753
+ },
1754
+ create: {
1755
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1756
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
1757
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
1758
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
1759
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
1760
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
1761
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
1762
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
1763
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
1764
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
1765
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
1766
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
1767
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
1768
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
1769
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
1770
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
1771
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
1772
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
1773
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
1774
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
1775
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
1776
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
1777
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
1778
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
1779
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
1780
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
1781
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
1782
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
1783
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
1784
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
1785
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
1786
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
1787
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
1788
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
1789
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
1790
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
1791
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
1792
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
1793
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
1794
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
1795
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
1796
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
1797
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
1798
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
1799
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
1800
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
1801
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
1802
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
1803
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
1804
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
1805
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
1806
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
1807
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
1808
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
1809
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
1810
+ },
1811
+ }
1812
+ } : undefined,
1813
+ actions: item.actions ?
1814
+ typeof item.actions[0] === 'object' && Object.keys(item.actions).length === 1 && Object.keys(item.actions)[0] === 'id'
1815
+ ? { connect: item.actions.map((item) => ({
1816
+ id: item.id
1817
+ }))
1818
+ }
1819
+ : { connectOrCreate: item.actions.map((item) => ({
1820
+ where: {
1821
+ id: item.id !== undefined ? item.id : undefined,
1822
+ },
1823
+ create: {
1824
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
1825
+ type: item.type !== undefined ? item.type : undefined,
1826
+ note: item.note !== undefined ? item.note : undefined,
1827
+ status: item.status !== undefined ? item.status : undefined,
1828
+ fee: item.fee !== undefined ? item.fee : undefined,
1829
+ },
1830
+ }))
1831
+ } : undefined,
1832
+ },
1733
1833
  }))
1734
1834
  } : undefined,
1735
1835
  orders: props.orders ? {
@@ -2085,86 +2185,96 @@ export const AlpacaAccount = {
2085
2185
  filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
2086
2186
  filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
2087
2187
  fee: item.fee !== undefined ? item.fee : undefined,
2088
- action: item.action ? {
2089
- connectOrCreate: {
2090
- where: {
2091
- id: item.action.id !== undefined ? item.action.id : undefined,
2092
- },
2093
- create: {
2094
- sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
2095
- type: item.action.type !== undefined ? item.action.type : undefined,
2096
- note: item.action.note !== undefined ? item.action.note : undefined,
2097
- status: item.action.status !== undefined ? item.action.status : undefined,
2098
- fee: item.action.fee !== undefined ? item.action.fee : undefined,
2099
- },
2100
- }
2101
- } : undefined,
2102
- asset: item.asset ? {
2103
- connectOrCreate: {
2104
- where: {
2105
- id: item.asset.id !== undefined ? item.asset.id : undefined,
2106
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2107
- name: item.asset.name !== undefined ? item.asset.name : undefined,
2108
- },
2109
- create: {
2110
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2111
- name: item.asset.name !== undefined ? item.asset.name : undefined,
2112
- type: item.asset.type !== undefined ? item.asset.type : undefined,
2113
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2114
- description: item.asset.description !== undefined ? item.asset.description : undefined,
2115
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2116
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2117
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2118
- country: item.asset.country !== undefined ? item.asset.country : undefined,
2119
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2120
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2121
- address: item.asset.address !== undefined ? item.asset.address : undefined,
2122
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2123
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2124
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2125
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2126
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2127
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2128
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2129
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2130
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2131
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2132
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2133
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2134
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2135
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2136
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2137
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2138
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2139
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2140
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2141
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2142
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2143
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2144
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2145
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2146
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2147
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2148
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2149
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2150
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2151
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2152
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2153
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2154
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2155
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2156
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2157
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2158
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2159
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2160
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2161
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2162
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2163
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
2164
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
2165
- },
2166
- }
2167
- } : undefined,
2188
+ action: item.action ?
2189
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
2190
+ ? { connect: {
2191
+ id: item.action.id
2192
+ }
2193
+ }
2194
+ : { connectOrCreate: {
2195
+ where: {
2196
+ id: item.action.id !== undefined ? item.action.id : undefined,
2197
+ },
2198
+ create: {
2199
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
2200
+ type: item.action.type !== undefined ? item.action.type : undefined,
2201
+ note: item.action.note !== undefined ? item.action.note : undefined,
2202
+ status: item.action.status !== undefined ? item.action.status : undefined,
2203
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
2204
+ },
2205
+ }
2206
+ } : undefined,
2207
+ asset: item.asset ?
2208
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
2209
+ ? { connect: {
2210
+ id: item.asset.id
2211
+ }
2212
+ }
2213
+ : { connectOrCreate: {
2214
+ where: {
2215
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2216
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2217
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2218
+ },
2219
+ create: {
2220
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2221
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2222
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2223
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2224
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2225
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2226
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2227
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2228
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2229
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2230
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2231
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2232
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2233
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2234
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2235
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2236
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2237
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2238
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2239
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2240
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2241
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2242
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2243
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2244
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2245
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2246
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2247
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2248
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2249
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2250
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2251
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2252
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2253
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2254
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2255
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2256
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2257
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2258
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2259
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2260
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2261
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2262
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2263
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2264
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2265
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2266
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2267
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2268
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2269
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2270
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2271
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2272
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2273
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
2274
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
2275
+ },
2276
+ }
2277
+ } : undefined,
2168
2278
  },
2169
2279
  }))
2170
2280
  } : undefined,
@@ -2473,72 +2583,77 @@ export const AlpacaAccount = {
2473
2583
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
2474
2584
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
2475
2585
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
2476
- asset: item.asset ? {
2477
- connectOrCreate: {
2478
- where: {
2479
- id: item.asset.id !== undefined ? item.asset.id : undefined,
2480
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2481
- name: item.asset.name !== undefined ? item.asset.name : undefined,
2482
- },
2483
- create: {
2484
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2485
- name: item.asset.name !== undefined ? item.asset.name : undefined,
2486
- type: item.asset.type !== undefined ? item.asset.type : undefined,
2487
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2488
- description: item.asset.description !== undefined ? item.asset.description : undefined,
2489
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2490
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2491
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2492
- country: item.asset.country !== undefined ? item.asset.country : undefined,
2493
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2494
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2495
- address: item.asset.address !== undefined ? item.asset.address : undefined,
2496
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2497
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2498
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2499
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2500
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2501
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2502
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2503
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2504
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2505
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2506
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2507
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2508
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2509
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2510
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2511
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2512
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2513
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2514
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2515
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2516
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2517
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2518
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2519
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2520
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2521
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2522
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2523
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2524
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2525
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2526
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2527
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2528
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2529
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2530
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2531
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2532
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2533
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2534
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2535
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2536
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2537
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
2538
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
2539
- },
2540
- }
2541
- } : undefined,
2586
+ asset: item.asset ?
2587
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
2588
+ ? { connect: {
2589
+ id: item.asset.id
2590
+ }
2591
+ }
2592
+ : { connectOrCreate: {
2593
+ where: {
2594
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
2595
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2596
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2597
+ },
2598
+ create: {
2599
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2600
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
2601
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
2602
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
2603
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
2604
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
2605
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
2606
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
2607
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
2608
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
2609
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
2610
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
2611
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
2612
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
2613
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
2614
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
2615
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
2616
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
2617
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
2618
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
2619
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
2620
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
2621
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
2622
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
2623
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
2624
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
2625
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
2626
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
2627
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
2628
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
2629
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
2630
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
2631
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
2632
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
2633
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
2634
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
2635
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
2636
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
2637
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
2638
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
2639
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
2640
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
2641
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
2642
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
2643
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
2644
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
2645
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
2646
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
2647
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
2648
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
2649
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
2650
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
2651
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
2652
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
2653
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
2654
+ },
2655
+ }
2656
+ } : undefined,
2542
2657
  },
2543
2658
  }))
2544
2659
  } : undefined,
@@ -2755,104 +2870,7 @@ export const AlpacaAccount = {
2755
2870
  } : undefined,
2756
2871
  session_state: item.session_state !== undefined ? {
2757
2872
  set: item.session_state
2758
- } : undefined,
2759
- },
2760
- create: {
2761
- type: item.type !== undefined ? item.type : undefined,
2762
- provider: item.provider !== undefined ? item.provider : undefined,
2763
- providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
2764
- refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
2765
- access_token: item.access_token !== undefined ? item.access_token : undefined,
2766
- expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
2767
- token_type: item.token_type !== undefined ? item.token_type : undefined,
2768
- scope: item.scope !== undefined ? item.scope : undefined,
2769
- id_token: item.id_token !== undefined ? item.id_token : undefined,
2770
- session_state: item.session_state !== undefined ? item.session_state : undefined,
2771
- },
2772
- }))
2773
- } : undefined,
2774
- sessions: prop.user.sessions ? {
2775
- upsert: prop.user.sessions.map((item) => ({
2776
- where: {
2777
- id: item.id !== undefined ? item.id : undefined,
2778
- },
2779
- update: {
2780
- id: item.id !== undefined ? {
2781
- set: item.id
2782
- } : undefined,
2783
- sessionToken: item.sessionToken !== undefined ? {
2784
- set: item.sessionToken
2785
- } : undefined,
2786
- expires: item.expires !== undefined ? {
2787
- set: item.expires
2788
- } : undefined,
2789
- },
2790
- create: {
2791
- sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
2792
- expires: item.expires !== undefined ? item.expires : undefined,
2793
- },
2794
- }))
2795
- } : undefined,
2796
- authenticators: prop.user.authenticators ? {
2797
- upsert: prop.user.authenticators.map((item) => ({
2798
- where: {
2799
- id: item.id !== undefined ? item.id : undefined,
2800
- },
2801
- update: {
2802
- id: item.id !== undefined ? {
2803
- set: item.id
2804
- } : undefined,
2805
- credentialID: item.credentialID !== undefined ? {
2806
- set: item.credentialID
2807
- } : undefined,
2808
- publicKey: item.publicKey !== undefined ? {
2809
- set: item.publicKey
2810
- } : undefined,
2811
- counter: item.counter !== undefined ? {
2812
- set: item.counter
2813
- } : undefined,
2814
- },
2815
- create: {
2816
- credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
2817
- publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
2818
- counter: item.counter !== undefined ? item.counter : undefined,
2819
- },
2820
- }))
2821
- } : undefined,
2822
- },
2823
- create: {
2824
- name: prop.user.name !== undefined ? prop.user.name : undefined,
2825
- email: prop.user.email !== undefined ? prop.user.email : undefined,
2826
- emailVerified: prop.user.emailVerified !== undefined ? prop.user.emailVerified : undefined,
2827
- image: prop.user.image !== undefined ? prop.user.image : undefined,
2828
- role: prop.user.role !== undefined ? prop.user.role : undefined,
2829
- bio: prop.user.bio !== undefined ? prop.user.bio : undefined,
2830
- jobTitle: prop.user.jobTitle !== undefined ? prop.user.jobTitle : undefined,
2831
- currentAccount: prop.user.currentAccount !== undefined ? prop.user.currentAccount : undefined,
2832
- plan: prop.user.plan !== undefined ? prop.user.plan : undefined,
2833
- customer: prop.user.customer ? {
2834
- connectOrCreate: {
2835
- where: {
2836
- id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
2837
- name: prop.user.customer.name !== undefined ? {
2838
- equals: prop.user.customer.name
2839
- } : undefined,
2840
- },
2841
- create: {
2842
- authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
2843
- name: prop.user.customer.name !== undefined ? prop.user.customer.name : undefined,
2844
- plan: prop.user.customer.plan !== undefined ? prop.user.customer.plan : undefined,
2845
- stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
2846
- stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
2847
- stripePriceId: prop.user.customer.stripePriceId !== undefined ? prop.user.customer.stripePriceId : undefined,
2848
- stripeCurrentPeriodEnd: prop.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.user.customer.stripeCurrentPeriodEnd : undefined,
2849
- },
2850
- }
2851
- } : undefined,
2852
- accounts: prop.user.accounts ? {
2853
- connectOrCreate: prop.user.accounts.map((item) => ({
2854
- where: {
2855
- id: item.id !== undefined ? item.id : undefined,
2873
+ } : undefined,
2856
2874
  },
2857
2875
  create: {
2858
2876
  type: item.type !== undefined ? item.type : undefined,
@@ -2869,10 +2887,21 @@ export const AlpacaAccount = {
2869
2887
  }))
2870
2888
  } : undefined,
2871
2889
  sessions: prop.user.sessions ? {
2872
- connectOrCreate: prop.user.sessions.map((item) => ({
2890
+ upsert: prop.user.sessions.map((item) => ({
2873
2891
  where: {
2874
2892
  id: item.id !== undefined ? item.id : undefined,
2875
2893
  },
2894
+ update: {
2895
+ id: item.id !== undefined ? {
2896
+ set: item.id
2897
+ } : undefined,
2898
+ sessionToken: item.sessionToken !== undefined ? {
2899
+ set: item.sessionToken
2900
+ } : undefined,
2901
+ expires: item.expires !== undefined ? {
2902
+ set: item.expires
2903
+ } : undefined,
2904
+ },
2876
2905
  create: {
2877
2906
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
2878
2907
  expires: item.expires !== undefined ? item.expires : undefined,
@@ -2880,10 +2909,24 @@ export const AlpacaAccount = {
2880
2909
  }))
2881
2910
  } : undefined,
2882
2911
  authenticators: prop.user.authenticators ? {
2883
- connectOrCreate: prop.user.authenticators.map((item) => ({
2912
+ upsert: prop.user.authenticators.map((item) => ({
2884
2913
  where: {
2885
2914
  id: item.id !== undefined ? item.id : undefined,
2886
2915
  },
2916
+ update: {
2917
+ id: item.id !== undefined ? {
2918
+ set: item.id
2919
+ } : undefined,
2920
+ credentialID: item.credentialID !== undefined ? {
2921
+ set: item.credentialID
2922
+ } : undefined,
2923
+ publicKey: item.publicKey !== undefined ? {
2924
+ set: item.publicKey
2925
+ } : undefined,
2926
+ counter: item.counter !== undefined ? {
2927
+ set: item.counter
2928
+ } : undefined,
2929
+ },
2887
2930
  create: {
2888
2931
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
2889
2932
  publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
@@ -2892,6 +2935,98 @@ export const AlpacaAccount = {
2892
2935
  }))
2893
2936
  } : undefined,
2894
2937
  },
2938
+ create: {
2939
+ name: prop.user.name !== undefined ? prop.user.name : undefined,
2940
+ email: prop.user.email !== undefined ? prop.user.email : undefined,
2941
+ emailVerified: prop.user.emailVerified !== undefined ? prop.user.emailVerified : undefined,
2942
+ image: prop.user.image !== undefined ? prop.user.image : undefined,
2943
+ role: prop.user.role !== undefined ? prop.user.role : undefined,
2944
+ bio: prop.user.bio !== undefined ? prop.user.bio : undefined,
2945
+ jobTitle: prop.user.jobTitle !== undefined ? prop.user.jobTitle : undefined,
2946
+ currentAccount: prop.user.currentAccount !== undefined ? prop.user.currentAccount : undefined,
2947
+ plan: prop.user.plan !== undefined ? prop.user.plan : undefined,
2948
+ customer: prop.user.customer ?
2949
+ typeof prop.user.customer === 'object' && Object.keys(prop.user.customer).length === 1 && Object.keys(prop.user.customer)[0] === 'id'
2950
+ ? { connect: {
2951
+ id: prop.user.customer.id
2952
+ }
2953
+ }
2954
+ : { connectOrCreate: {
2955
+ where: {
2956
+ id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
2957
+ name: prop.user.customer.name !== undefined ? {
2958
+ equals: prop.user.customer.name
2959
+ } : undefined,
2960
+ },
2961
+ create: {
2962
+ authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
2963
+ name: prop.user.customer.name !== undefined ? prop.user.customer.name : undefined,
2964
+ plan: prop.user.customer.plan !== undefined ? prop.user.customer.plan : undefined,
2965
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
2966
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
2967
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? prop.user.customer.stripePriceId : undefined,
2968
+ stripeCurrentPeriodEnd: prop.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.user.customer.stripeCurrentPeriodEnd : undefined,
2969
+ },
2970
+ }
2971
+ } : undefined,
2972
+ accounts: prop.user.accounts ?
2973
+ typeof prop.user.accounts[0] === 'object' && Object.keys(prop.user.accounts).length === 1 && Object.keys(prop.user.accounts)[0] === 'id'
2974
+ ? { connect: prop.user.accounts.map((item) => ({
2975
+ id: item.id
2976
+ }))
2977
+ }
2978
+ : { connectOrCreate: prop.user.accounts.map((item) => ({
2979
+ where: {
2980
+ id: item.id !== undefined ? item.id : undefined,
2981
+ },
2982
+ create: {
2983
+ type: item.type !== undefined ? item.type : undefined,
2984
+ provider: item.provider !== undefined ? item.provider : undefined,
2985
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
2986
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
2987
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
2988
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
2989
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
2990
+ scope: item.scope !== undefined ? item.scope : undefined,
2991
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
2992
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
2993
+ },
2994
+ }))
2995
+ } : undefined,
2996
+ sessions: prop.user.sessions ?
2997
+ typeof prop.user.sessions[0] === 'object' && Object.keys(prop.user.sessions).length === 1 && Object.keys(prop.user.sessions)[0] === 'id'
2998
+ ? { connect: prop.user.sessions.map((item) => ({
2999
+ id: item.id
3000
+ }))
3001
+ }
3002
+ : { connectOrCreate: prop.user.sessions.map((item) => ({
3003
+ where: {
3004
+ id: item.id !== undefined ? item.id : undefined,
3005
+ },
3006
+ create: {
3007
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
3008
+ expires: item.expires !== undefined ? item.expires : undefined,
3009
+ },
3010
+ }))
3011
+ } : undefined,
3012
+ authenticators: prop.user.authenticators ?
3013
+ typeof prop.user.authenticators[0] === 'object' && Object.keys(prop.user.authenticators).length === 1 && Object.keys(prop.user.authenticators)[0] === 'id'
3014
+ ? { connect: prop.user.authenticators.map((item) => ({
3015
+ id: item.id
3016
+ }))
3017
+ }
3018
+ : { connectOrCreate: prop.user.authenticators.map((item) => ({
3019
+ where: {
3020
+ id: item.id !== undefined ? item.id : undefined,
3021
+ },
3022
+ create: {
3023
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
3024
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
3025
+ counter: item.counter !== undefined ? item.counter : undefined,
3026
+ },
3027
+ }))
3028
+ } : undefined,
3029
+ },
2895
3030
  }
2896
3031
  } : undefined,
2897
3032
  trades: prop.trades ? {
@@ -3221,86 +3356,96 @@ export const AlpacaAccount = {
3221
3356
  timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
3222
3357
  status: item.status !== undefined ? item.status : undefined,
3223
3358
  optionContractType: item.optionContractType !== undefined ? item.optionContractType : undefined,
3224
- asset: item.asset ? {
3225
- connectOrCreate: {
3226
- where: {
3227
- id: item.asset.id !== undefined ? item.asset.id : undefined,
3228
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3229
- name: item.asset.name !== undefined ? item.asset.name : undefined,
3230
- },
3231
- create: {
3232
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3233
- name: item.asset.name !== undefined ? item.asset.name : undefined,
3234
- type: item.asset.type !== undefined ? item.asset.type : undefined,
3235
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3236
- description: item.asset.description !== undefined ? item.asset.description : undefined,
3237
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3238
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3239
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3240
- country: item.asset.country !== undefined ? item.asset.country : undefined,
3241
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3242
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3243
- address: item.asset.address !== undefined ? item.asset.address : undefined,
3244
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3245
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3246
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3247
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3248
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3249
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3250
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3251
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3252
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3253
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
3254
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
3255
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
3256
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
3257
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
3258
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
3259
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
3260
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
3261
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
3262
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
3263
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
3264
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
3265
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
3266
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
3267
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
3268
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
3269
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
3270
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
3271
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
3272
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
3273
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
3274
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
3275
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
3276
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
3277
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
3278
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
3279
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
3280
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
3281
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
3282
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
3283
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
3284
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
3285
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
3286
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
3287
- },
3288
- }
3289
- } : undefined,
3290
- actions: item.actions ? {
3291
- connectOrCreate: item.actions.map((item) => ({
3292
- where: {
3293
- id: item.id !== undefined ? item.id : undefined,
3294
- },
3295
- create: {
3296
- sequence: item.sequence !== undefined ? item.sequence : undefined,
3297
- type: item.type !== undefined ? item.type : undefined,
3298
- note: item.note !== undefined ? item.note : undefined,
3299
- status: item.status !== undefined ? item.status : undefined,
3300
- fee: item.fee !== undefined ? item.fee : undefined,
3301
- },
3302
- }))
3303
- } : undefined,
3359
+ asset: item.asset ?
3360
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
3361
+ ? { connect: {
3362
+ id: item.asset.id
3363
+ }
3364
+ }
3365
+ : { connectOrCreate: {
3366
+ where: {
3367
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
3368
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3369
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3370
+ },
3371
+ create: {
3372
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3373
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3374
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
3375
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3376
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
3377
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3378
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3379
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3380
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
3381
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3382
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3383
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
3384
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3385
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3386
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3387
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3388
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3389
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3390
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3391
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3392
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3393
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
3394
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
3395
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
3396
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
3397
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
3398
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
3399
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
3400
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
3401
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
3402
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
3403
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
3404
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
3405
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
3406
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
3407
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
3408
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
3409
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
3410
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
3411
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
3412
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
3413
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
3414
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
3415
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
3416
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
3417
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
3418
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
3419
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
3420
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
3421
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
3422
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
3423
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
3424
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
3425
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
3426
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
3427
+ },
3428
+ }
3429
+ } : undefined,
3430
+ actions: item.actions ?
3431
+ typeof item.actions[0] === 'object' && Object.keys(item.actions).length === 1 && Object.keys(item.actions)[0] === 'id'
3432
+ ? { connect: item.actions.map((item) => ({
3433
+ id: item.id
3434
+ }))
3435
+ }
3436
+ : { connectOrCreate: item.actions.map((item) => ({
3437
+ where: {
3438
+ id: item.id !== undefined ? item.id : undefined,
3439
+ },
3440
+ create: {
3441
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
3442
+ type: item.type !== undefined ? item.type : undefined,
3443
+ note: item.note !== undefined ? item.note : undefined,
3444
+ status: item.status !== undefined ? item.status : undefined,
3445
+ fee: item.fee !== undefined ? item.fee : undefined,
3446
+ },
3447
+ }))
3448
+ } : undefined,
3304
3449
  },
3305
3450
  }))
3306
3451
  } : undefined,
@@ -3657,86 +3802,96 @@ export const AlpacaAccount = {
3657
3802
  filledAt: item.filledAt !== undefined ? item.filledAt : undefined,
3658
3803
  filledAvgPrice: item.filledAvgPrice !== undefined ? item.filledAvgPrice : undefined,
3659
3804
  fee: item.fee !== undefined ? item.fee : undefined,
3660
- action: item.action ? {
3661
- connectOrCreate: {
3662
- where: {
3663
- id: item.action.id !== undefined ? item.action.id : undefined,
3664
- },
3665
- create: {
3666
- sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
3667
- type: item.action.type !== undefined ? item.action.type : undefined,
3668
- note: item.action.note !== undefined ? item.action.note : undefined,
3669
- status: item.action.status !== undefined ? item.action.status : undefined,
3670
- fee: item.action.fee !== undefined ? item.action.fee : undefined,
3671
- },
3672
- }
3673
- } : undefined,
3674
- asset: item.asset ? {
3675
- connectOrCreate: {
3676
- where: {
3677
- id: item.asset.id !== undefined ? item.asset.id : undefined,
3678
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3679
- name: item.asset.name !== undefined ? item.asset.name : undefined,
3680
- },
3681
- create: {
3682
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3683
- name: item.asset.name !== undefined ? item.asset.name : undefined,
3684
- type: item.asset.type !== undefined ? item.asset.type : undefined,
3685
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3686
- description: item.asset.description !== undefined ? item.asset.description : undefined,
3687
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3688
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3689
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3690
- country: item.asset.country !== undefined ? item.asset.country : undefined,
3691
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3692
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3693
- address: item.asset.address !== undefined ? item.asset.address : undefined,
3694
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3695
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3696
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3697
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3698
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3699
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3700
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3701
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3702
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3703
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
3704
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
3705
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
3706
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
3707
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
3708
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
3709
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
3710
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
3711
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
3712
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
3713
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
3714
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
3715
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
3716
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
3717
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
3718
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
3719
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
3720
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
3721
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
3722
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
3723
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
3724
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
3725
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
3726
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
3727
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
3728
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
3729
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
3730
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
3731
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
3732
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
3733
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
3734
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
3735
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
3736
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
3737
- },
3738
- }
3739
- } : undefined,
3805
+ action: item.action ?
3806
+ typeof item.action === 'object' && Object.keys(item.action).length === 1 && Object.keys(item.action)[0] === 'id'
3807
+ ? { connect: {
3808
+ id: item.action.id
3809
+ }
3810
+ }
3811
+ : { connectOrCreate: {
3812
+ where: {
3813
+ id: item.action.id !== undefined ? item.action.id : undefined,
3814
+ },
3815
+ create: {
3816
+ sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
3817
+ type: item.action.type !== undefined ? item.action.type : undefined,
3818
+ note: item.action.note !== undefined ? item.action.note : undefined,
3819
+ status: item.action.status !== undefined ? item.action.status : undefined,
3820
+ fee: item.action.fee !== undefined ? item.action.fee : undefined,
3821
+ },
3822
+ }
3823
+ } : undefined,
3824
+ asset: item.asset ?
3825
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
3826
+ ? { connect: {
3827
+ id: item.asset.id
3828
+ }
3829
+ }
3830
+ : { connectOrCreate: {
3831
+ where: {
3832
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
3833
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3834
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3835
+ },
3836
+ create: {
3837
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3838
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
3839
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
3840
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
3841
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
3842
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
3843
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
3844
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
3845
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
3846
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
3847
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
3848
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
3849
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
3850
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
3851
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
3852
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
3853
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
3854
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
3855
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
3856
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
3857
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
3858
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
3859
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
3860
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
3861
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
3862
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
3863
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
3864
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
3865
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
3866
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
3867
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
3868
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
3869
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
3870
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
3871
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
3872
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
3873
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
3874
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
3875
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
3876
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
3877
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
3878
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
3879
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
3880
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
3881
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
3882
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
3883
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
3884
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
3885
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
3886
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
3887
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
3888
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
3889
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
3890
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
3891
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
3892
+ },
3893
+ }
3894
+ } : undefined,
3740
3895
  },
3741
3896
  }))
3742
3897
  } : undefined,
@@ -4045,72 +4200,77 @@ export const AlpacaAccount = {
4045
4200
  lastTradePrice: item.lastTradePrice !== undefined ? item.lastTradePrice : undefined,
4046
4201
  changeToday: item.changeToday !== undefined ? item.changeToday : undefined,
4047
4202
  assetMarginable: item.assetMarginable !== undefined ? item.assetMarginable : undefined,
4048
- asset: item.asset ? {
4049
- connectOrCreate: {
4050
- where: {
4051
- id: item.asset.id !== undefined ? item.asset.id : undefined,
4052
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4053
- name: item.asset.name !== undefined ? item.asset.name : undefined,
4054
- },
4055
- create: {
4056
- symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4057
- name: item.asset.name !== undefined ? item.asset.name : undefined,
4058
- type: item.asset.type !== undefined ? item.asset.type : undefined,
4059
- logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4060
- description: item.asset.description !== undefined ? item.asset.description : undefined,
4061
- cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4062
- exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4063
- currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4064
- country: item.asset.country !== undefined ? item.asset.country : undefined,
4065
- sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4066
- industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4067
- address: item.asset.address !== undefined ? item.asset.address : undefined,
4068
- officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4069
- fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4070
- latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4071
- marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4072
- ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4073
- peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4074
- pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4075
- bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4076
- dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4077
- dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4078
- eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4079
- revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4080
- profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4081
- operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4082
- returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4083
- returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4084
- revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4085
- grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4086
- dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4087
- quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4088
- quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4089
- analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4090
- analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4091
- analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4092
- analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4093
- analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4094
- analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4095
- trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4096
- forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4097
- priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4098
- priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4099
- evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4100
- evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4101
- beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4102
- week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4103
- week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4104
- day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4105
- day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4106
- sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4107
- dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4108
- exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4109
- sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
4110
- buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
4111
- },
4112
- }
4113
- } : undefined,
4203
+ asset: item.asset ?
4204
+ typeof item.asset === 'object' && Object.keys(item.asset).length === 1 && Object.keys(item.asset)[0] === 'id'
4205
+ ? { connect: {
4206
+ id: item.asset.id
4207
+ }
4208
+ }
4209
+ : { connectOrCreate: {
4210
+ where: {
4211
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4212
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4213
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4214
+ },
4215
+ create: {
4216
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4217
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4218
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4219
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4220
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4221
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4222
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4223
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4224
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4225
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4226
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4227
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4228
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4229
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4230
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4231
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4232
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4233
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4234
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4235
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4236
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4237
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4238
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4239
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4240
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4241
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4242
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4243
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4244
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4245
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4246
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4247
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4248
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4249
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4250
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4251
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4252
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4253
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4254
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4255
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4256
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4257
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4258
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4259
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4260
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4261
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4262
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4263
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4264
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4265
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4266
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4267
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4268
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4269
+ sellPrice: item.asset.sellPrice !== undefined ? item.asset.sellPrice : undefined,
4270
+ buyPrice: item.asset.buyPrice !== undefined ? item.asset.buyPrice : undefined,
4271
+ },
4272
+ }
4273
+ } : undefined,
4114
4274
  },
4115
4275
  }))
4116
4276
  } : undefined,