adaptic-backend 1.0.159 → 1.0.160

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 (73) hide show
  1. package/Account.cjs +435 -58
  2. package/Action.cjs +966 -121
  3. package/Alert.cjs +593 -89
  4. package/AlpacaAccount.cjs +1161 -134
  5. package/Asset.cjs +1029 -129
  6. package/Authenticator.cjs +438 -54
  7. package/Customer.cjs +435 -64
  8. package/EconomicEvent.cjs +9 -3
  9. package/NewsArticle.cjs +255 -30
  10. package/NewsArticleAssetSentiment.cjs +427 -65
  11. package/Order.cjs +867 -129
  12. package/Position.cjs +945 -141
  13. package/Session.cjs +438 -54
  14. package/StopLoss.cjs +552 -69
  15. package/TakeProfit.cjs +552 -69
  16. package/Trade.cjs +1042 -153
  17. package/User.cjs +480 -73
  18. package/VerificationToken.cjs +9 -3
  19. package/package.json +1 -1
  20. package/server/Account.d.ts.map +1 -1
  21. package/server/Account.js.map +1 -1
  22. package/server/Account.mjs +435 -58
  23. package/server/Action.d.ts.map +1 -1
  24. package/server/Action.js.map +1 -1
  25. package/server/Action.mjs +966 -121
  26. package/server/Alert.d.ts.map +1 -1
  27. package/server/Alert.js.map +1 -1
  28. package/server/Alert.mjs +593 -89
  29. package/server/AlpacaAccount.d.ts.map +1 -1
  30. package/server/AlpacaAccount.js.map +1 -1
  31. package/server/AlpacaAccount.mjs +1161 -134
  32. package/server/Asset.d.ts.map +1 -1
  33. package/server/Asset.js.map +1 -1
  34. package/server/Asset.mjs +1029 -129
  35. package/server/Authenticator.d.ts.map +1 -1
  36. package/server/Authenticator.js.map +1 -1
  37. package/server/Authenticator.mjs +438 -54
  38. package/server/Customer.d.ts.map +1 -1
  39. package/server/Customer.js.map +1 -1
  40. package/server/Customer.mjs +435 -64
  41. package/server/EconomicEvent.d.ts.map +1 -1
  42. package/server/EconomicEvent.js.map +1 -1
  43. package/server/EconomicEvent.mjs +9 -3
  44. package/server/NewsArticle.d.ts.map +1 -1
  45. package/server/NewsArticle.js.map +1 -1
  46. package/server/NewsArticle.mjs +255 -30
  47. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  48. package/server/NewsArticleAssetSentiment.js.map +1 -1
  49. package/server/NewsArticleAssetSentiment.mjs +427 -65
  50. package/server/Order.d.ts.map +1 -1
  51. package/server/Order.js.map +1 -1
  52. package/server/Order.mjs +867 -129
  53. package/server/Position.d.ts.map +1 -1
  54. package/server/Position.js.map +1 -1
  55. package/server/Position.mjs +945 -141
  56. package/server/Session.d.ts.map +1 -1
  57. package/server/Session.js.map +1 -1
  58. package/server/Session.mjs +438 -54
  59. package/server/StopLoss.d.ts.map +1 -1
  60. package/server/StopLoss.js.map +1 -1
  61. package/server/StopLoss.mjs +552 -69
  62. package/server/TakeProfit.d.ts.map +1 -1
  63. package/server/TakeProfit.js.map +1 -1
  64. package/server/TakeProfit.mjs +552 -69
  65. package/server/Trade.d.ts.map +1 -1
  66. package/server/Trade.js.map +1 -1
  67. package/server/Trade.mjs +1042 -153
  68. package/server/User.d.ts.map +1 -1
  69. package/server/User.js.map +1 -1
  70. package/server/User.mjs +480 -73
  71. package/server/VerificationToken.d.ts.map +1 -1
  72. package/server/VerificationToken.js.map +1 -1
  73. package/server/VerificationToken.mjs +9 -3
package/server/Asset.mjs CHANGED
@@ -304,7 +304,15 @@ export const Asset = {
304
304
  }
305
305
  : { connectOrCreate: props.trades.map((item) => ({
306
306
  where: {
307
- id: item.id !== undefined ? item.id : undefined,
307
+ id: item.id !== undefined ? {
308
+ equals: item.id
309
+ } : undefined,
310
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
311
+ equals: item.alpacaAccountId
312
+ } : undefined,
313
+ assetId: item.assetId !== undefined ? {
314
+ equals: item.assetId
315
+ } : undefined,
308
316
  },
309
317
  create: {
310
318
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -326,7 +334,12 @@ export const Asset = {
326
334
  }
327
335
  : { connectOrCreate: {
328
336
  where: {
329
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
337
+ id: item.alpacaAccount.id !== undefined ? {
338
+ equals: item.alpacaAccount.id
339
+ } : undefined,
340
+ userId: item.alpacaAccount.userId !== undefined ? {
341
+ equals: item.alpacaAccount.userId
342
+ } : undefined,
330
343
  },
331
344
  create: {
332
345
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -346,7 +359,9 @@ export const Asset = {
346
359
  }
347
360
  : { connectOrCreate: {
348
361
  where: {
349
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
362
+ id: item.alpacaAccount.user.id !== undefined ? {
363
+ equals: item.alpacaAccount.user.id
364
+ } : undefined,
350
365
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
351
366
  name: item.alpacaAccount.user.name !== undefined ? {
352
367
  equals: item.alpacaAccount.user.name
@@ -375,7 +390,18 @@ export const Asset = {
375
390
  }
376
391
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
377
392
  where: {
378
- id: item.id !== undefined ? item.id : undefined,
393
+ id: item.id !== undefined ? {
394
+ equals: item.id
395
+ } : undefined,
396
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
397
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
398
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
399
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
400
+ equals: item.alpacaAccountId
401
+ } : undefined,
402
+ assetId: item.assetId !== undefined ? {
403
+ equals: item.assetId
404
+ } : undefined,
379
405
  },
380
406
  create: {
381
407
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -411,7 +437,15 @@ export const Asset = {
411
437
  }
412
438
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
413
439
  where: {
414
- id: item.id !== undefined ? item.id : undefined,
440
+ id: item.id !== undefined ? {
441
+ equals: item.id
442
+ } : undefined,
443
+ assetId: item.assetId !== undefined ? {
444
+ equals: item.assetId
445
+ } : undefined,
446
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
447
+ equals: item.alpacaAccountId
448
+ } : undefined,
415
449
  },
416
450
  create: {
417
451
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -438,7 +472,12 @@ export const Asset = {
438
472
  }
439
473
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
440
474
  where: {
441
- id: item.id !== undefined ? item.id : undefined,
475
+ id: item.id !== undefined ? {
476
+ equals: item.id
477
+ } : undefined,
478
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
479
+ equals: item.alpacaAccountId
480
+ } : undefined,
442
481
  },
443
482
  create: {
444
483
  message: item.message !== undefined ? item.message : undefined,
@@ -458,7 +497,12 @@ export const Asset = {
458
497
  }
459
498
  : { connectOrCreate: item.actions.map((item) => ({
460
499
  where: {
461
- id: item.id !== undefined ? item.id : undefined,
500
+ id: item.id !== undefined ? {
501
+ equals: item.id
502
+ } : undefined,
503
+ tradeId: item.tradeId !== undefined ? {
504
+ equals: item.tradeId
505
+ } : undefined,
462
506
  },
463
507
  create: {
464
508
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -474,7 +518,18 @@ export const Asset = {
474
518
  }
475
519
  : { connectOrCreate: {
476
520
  where: {
477
- id: item.order.id !== undefined ? item.order.id : undefined,
521
+ id: item.order.id !== undefined ? {
522
+ equals: item.order.id
523
+ } : undefined,
524
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
525
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
526
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
527
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
528
+ equals: item.order.alpacaAccountId
529
+ } : undefined,
530
+ assetId: item.order.assetId !== undefined ? {
531
+ equals: item.order.assetId
532
+ } : undefined,
478
533
  },
479
534
  create: {
480
535
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -516,7 +571,18 @@ export const Asset = {
516
571
  }
517
572
  : { connectOrCreate: props.orders.map((item) => ({
518
573
  where: {
519
- id: item.id !== undefined ? item.id : undefined,
574
+ id: item.id !== undefined ? {
575
+ equals: item.id
576
+ } : undefined,
577
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
578
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
579
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
580
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
581
+ equals: item.alpacaAccountId
582
+ } : undefined,
583
+ assetId: item.assetId !== undefined ? {
584
+ equals: item.assetId
585
+ } : undefined,
520
586
  },
521
587
  create: {
522
588
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -549,7 +615,10 @@ export const Asset = {
549
615
  }
550
616
  : { connectOrCreate: {
551
617
  where: {
552
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
618
+ id: item.stopLoss.id !== undefined ? {
619
+ equals: item.stopLoss.id
620
+ } : undefined,
621
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
553
622
  },
554
623
  create: {
555
624
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -565,7 +634,10 @@ export const Asset = {
565
634
  }
566
635
  : { connectOrCreate: {
567
636
  where: {
568
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
637
+ id: item.takeProfit.id !== undefined ? {
638
+ equals: item.takeProfit.id
639
+ } : undefined,
640
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
569
641
  },
570
642
  create: {
571
643
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -581,7 +653,12 @@ export const Asset = {
581
653
  }
582
654
  : { connectOrCreate: {
583
655
  where: {
584
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
656
+ id: item.alpacaAccount.id !== undefined ? {
657
+ equals: item.alpacaAccount.id
658
+ } : undefined,
659
+ userId: item.alpacaAccount.userId !== undefined ? {
660
+ equals: item.alpacaAccount.userId
661
+ } : undefined,
585
662
  },
586
663
  create: {
587
664
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -601,7 +678,9 @@ export const Asset = {
601
678
  }
602
679
  : { connectOrCreate: {
603
680
  where: {
604
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
681
+ id: item.alpacaAccount.user.id !== undefined ? {
682
+ equals: item.alpacaAccount.user.id
683
+ } : undefined,
605
684
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
606
685
  name: item.alpacaAccount.user.name !== undefined ? {
607
686
  equals: item.alpacaAccount.user.name
@@ -630,7 +709,15 @@ export const Asset = {
630
709
  }
631
710
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
632
711
  where: {
633
- id: item.id !== undefined ? item.id : undefined,
712
+ id: item.id !== undefined ? {
713
+ equals: item.id
714
+ } : undefined,
715
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
716
+ equals: item.alpacaAccountId
717
+ } : undefined,
718
+ assetId: item.assetId !== undefined ? {
719
+ equals: item.assetId
720
+ } : undefined,
634
721
  },
635
722
  create: {
636
723
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -655,7 +742,15 @@ export const Asset = {
655
742
  }
656
743
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
657
744
  where: {
658
- id: item.id !== undefined ? item.id : undefined,
745
+ id: item.id !== undefined ? {
746
+ equals: item.id
747
+ } : undefined,
748
+ assetId: item.assetId !== undefined ? {
749
+ equals: item.assetId
750
+ } : undefined,
751
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
752
+ equals: item.alpacaAccountId
753
+ } : undefined,
659
754
  },
660
755
  create: {
661
756
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -682,7 +777,12 @@ export const Asset = {
682
777
  }
683
778
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
684
779
  where: {
685
- id: item.id !== undefined ? item.id : undefined,
780
+ id: item.id !== undefined ? {
781
+ equals: item.id
782
+ } : undefined,
783
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
784
+ equals: item.alpacaAccountId
785
+ } : undefined,
686
786
  },
687
787
  create: {
688
788
  message: item.message !== undefined ? item.message : undefined,
@@ -702,7 +802,12 @@ export const Asset = {
702
802
  }
703
803
  : { connectOrCreate: {
704
804
  where: {
705
- id: item.action.id !== undefined ? item.action.id : undefined,
805
+ id: item.action.id !== undefined ? {
806
+ equals: item.action.id
807
+ } : undefined,
808
+ tradeId: item.action.tradeId !== undefined ? {
809
+ equals: item.action.tradeId
810
+ } : undefined,
706
811
  },
707
812
  create: {
708
813
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -718,7 +823,15 @@ export const Asset = {
718
823
  }
719
824
  : { connectOrCreate: {
720
825
  where: {
721
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
826
+ id: item.action.trade.id !== undefined ? {
827
+ equals: item.action.trade.id
828
+ } : undefined,
829
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
830
+ equals: item.action.trade.alpacaAccountId
831
+ } : undefined,
832
+ assetId: item.action.trade.assetId !== undefined ? {
833
+ equals: item.action.trade.assetId
834
+ } : undefined,
722
835
  },
723
836
  create: {
724
837
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -749,7 +862,15 @@ export const Asset = {
749
862
  }
750
863
  : { connectOrCreate: props.positions.map((item) => ({
751
864
  where: {
752
- id: item.id !== undefined ? item.id : undefined,
865
+ id: item.id !== undefined ? {
866
+ equals: item.id
867
+ } : undefined,
868
+ assetId: item.assetId !== undefined ? {
869
+ equals: item.assetId
870
+ } : undefined,
871
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
872
+ equals: item.alpacaAccountId
873
+ } : undefined,
753
874
  },
754
875
  create: {
755
876
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -773,7 +894,12 @@ export const Asset = {
773
894
  }
774
895
  : { connectOrCreate: {
775
896
  where: {
776
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
897
+ id: item.alpacaAccount.id !== undefined ? {
898
+ equals: item.alpacaAccount.id
899
+ } : undefined,
900
+ userId: item.alpacaAccount.userId !== undefined ? {
901
+ equals: item.alpacaAccount.userId
902
+ } : undefined,
777
903
  },
778
904
  create: {
779
905
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -793,7 +919,9 @@ export const Asset = {
793
919
  }
794
920
  : { connectOrCreate: {
795
921
  where: {
796
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
922
+ id: item.alpacaAccount.user.id !== undefined ? {
923
+ equals: item.alpacaAccount.user.id
924
+ } : undefined,
797
925
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
798
926
  name: item.alpacaAccount.user.name !== undefined ? {
799
927
  equals: item.alpacaAccount.user.name
@@ -822,7 +950,15 @@ export const Asset = {
822
950
  }
823
951
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
824
952
  where: {
825
- id: item.id !== undefined ? item.id : undefined,
953
+ id: item.id !== undefined ? {
954
+ equals: item.id
955
+ } : undefined,
956
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
957
+ equals: item.alpacaAccountId
958
+ } : undefined,
959
+ assetId: item.assetId !== undefined ? {
960
+ equals: item.assetId
961
+ } : undefined,
826
962
  },
827
963
  create: {
828
964
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -847,7 +983,18 @@ export const Asset = {
847
983
  }
848
984
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
849
985
  where: {
850
- id: item.id !== undefined ? item.id : undefined,
986
+ id: item.id !== undefined ? {
987
+ equals: item.id
988
+ } : undefined,
989
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
990
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
991
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
992
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
993
+ equals: item.alpacaAccountId
994
+ } : undefined,
995
+ assetId: item.assetId !== undefined ? {
996
+ equals: item.assetId
997
+ } : undefined,
851
998
  },
852
999
  create: {
853
1000
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -883,7 +1030,12 @@ export const Asset = {
883
1030
  }
884
1031
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
885
1032
  where: {
886
- id: item.id !== undefined ? item.id : undefined,
1033
+ id: item.id !== undefined ? {
1034
+ equals: item.id
1035
+ } : undefined,
1036
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1037
+ equals: item.alpacaAccountId
1038
+ } : undefined,
887
1039
  },
888
1040
  create: {
889
1041
  message: item.message !== undefined ? item.message : undefined,
@@ -906,8 +1058,16 @@ export const Asset = {
906
1058
  }
907
1059
  : { connectOrCreate: props.newsMentions.map((item) => ({
908
1060
  where: {
909
- id: item.id !== undefined ? item.id : undefined,
1061
+ id: item.id !== undefined ? {
1062
+ equals: item.id
1063
+ } : undefined,
910
1064
  url: item.url !== undefined ? item.url : undefined,
1065
+ assetId: item.assetId !== undefined ? {
1066
+ equals: item.assetId
1067
+ } : undefined,
1068
+ newsArticleId: item.newsArticleId !== undefined ? {
1069
+ equals: item.newsArticleId
1070
+ } : undefined,
911
1071
  },
912
1072
  create: {
913
1073
  url: item.url !== undefined ? item.url : undefined,
@@ -922,7 +1082,9 @@ export const Asset = {
922
1082
  }
923
1083
  : { connectOrCreate: {
924
1084
  where: {
925
- id: item.news.id !== undefined ? item.news.id : undefined,
1085
+ id: item.news.id !== undefined ? {
1086
+ equals: item.news.id
1087
+ } : undefined,
926
1088
  url: item.news.url !== undefined ? item.news.url : undefined,
927
1089
  title: item.news.title !== undefined ? {
928
1090
  equals: item.news.title
@@ -1071,7 +1233,9 @@ export const Asset = {
1071
1233
  }`;
1072
1234
  const variables = {
1073
1235
  where: {
1074
- id: props.id !== undefined ? props.id : undefined,
1236
+ id: props.id !== undefined ? {
1237
+ equals: props.id
1238
+ } : undefined,
1075
1239
  symbol: props.symbol !== undefined ? props.symbol : undefined,
1076
1240
  name: props.name !== undefined ? props.name : undefined,
1077
1241
  type: props.type !== undefined ? props.type : undefined,
@@ -1306,7 +1470,15 @@ export const Asset = {
1306
1470
  trades: props.trades ? {
1307
1471
  upsert: props.trades.map((item) => ({
1308
1472
  where: {
1309
- id: item.id !== undefined ? item.id : undefined,
1473
+ id: item.id !== undefined ? {
1474
+ equals: item.id
1475
+ } : undefined,
1476
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1477
+ equals: item.alpacaAccountId
1478
+ } : undefined,
1479
+ assetId: item.assetId !== undefined ? {
1480
+ equals: item.assetId
1481
+ } : undefined,
1310
1482
  },
1311
1483
  update: {
1312
1484
  id: item.id !== undefined ? {
@@ -1351,6 +1523,9 @@ export const Asset = {
1351
1523
  id: item.alpacaAccount.id !== undefined ? {
1352
1524
  equals: item.alpacaAccount.id
1353
1525
  } : undefined,
1526
+ userId: item.alpacaAccount.userId !== undefined ? {
1527
+ equals: item.alpacaAccount.userId
1528
+ } : undefined,
1354
1529
  },
1355
1530
  update: {
1356
1531
  id: item.alpacaAccount.id !== undefined ? {
@@ -1452,7 +1627,18 @@ export const Asset = {
1452
1627
  orders: item.alpacaAccount.orders ? {
1453
1628
  upsert: item.alpacaAccount.orders.map((item) => ({
1454
1629
  where: {
1455
- id: item.id !== undefined ? item.id : undefined,
1630
+ id: item.id !== undefined ? {
1631
+ equals: item.id
1632
+ } : undefined,
1633
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1634
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1635
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1636
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1637
+ equals: item.alpacaAccountId
1638
+ } : undefined,
1639
+ assetId: item.assetId !== undefined ? {
1640
+ equals: item.assetId
1641
+ } : undefined,
1456
1642
  },
1457
1643
  update: {
1458
1644
  id: item.id !== undefined ? {
@@ -1554,7 +1740,15 @@ export const Asset = {
1554
1740
  positions: item.alpacaAccount.positions ? {
1555
1741
  upsert: item.alpacaAccount.positions.map((item) => ({
1556
1742
  where: {
1557
- id: item.id !== undefined ? item.id : undefined,
1743
+ id: item.id !== undefined ? {
1744
+ equals: item.id
1745
+ } : undefined,
1746
+ assetId: item.assetId !== undefined ? {
1747
+ equals: item.assetId
1748
+ } : undefined,
1749
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1750
+ equals: item.alpacaAccountId
1751
+ } : undefined,
1558
1752
  },
1559
1753
  update: {
1560
1754
  id: item.id !== undefined ? {
@@ -1620,7 +1814,12 @@ export const Asset = {
1620
1814
  alerts: item.alpacaAccount.alerts ? {
1621
1815
  upsert: item.alpacaAccount.alerts.map((item) => ({
1622
1816
  where: {
1623
- id: item.id !== undefined ? item.id : undefined,
1817
+ id: item.id !== undefined ? {
1818
+ equals: item.id
1819
+ } : undefined,
1820
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1821
+ equals: item.alpacaAccountId
1822
+ } : undefined,
1624
1823
  },
1625
1824
  update: {
1626
1825
  id: item.id !== undefined ? {
@@ -1662,7 +1861,9 @@ export const Asset = {
1662
1861
  }
1663
1862
  : { connectOrCreate: {
1664
1863
  where: {
1665
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
1864
+ id: item.alpacaAccount.user.id !== undefined ? {
1865
+ equals: item.alpacaAccount.user.id
1866
+ } : undefined,
1666
1867
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
1667
1868
  name: item.alpacaAccount.user.name !== undefined ? {
1668
1869
  equals: item.alpacaAccount.user.name
@@ -1691,7 +1892,18 @@ export const Asset = {
1691
1892
  }
1692
1893
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
1693
1894
  where: {
1694
- id: item.id !== undefined ? item.id : undefined,
1895
+ id: item.id !== undefined ? {
1896
+ equals: item.id
1897
+ } : undefined,
1898
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1899
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1900
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1901
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1902
+ equals: item.alpacaAccountId
1903
+ } : undefined,
1904
+ assetId: item.assetId !== undefined ? {
1905
+ equals: item.assetId
1906
+ } : undefined,
1695
1907
  },
1696
1908
  create: {
1697
1909
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1727,7 +1939,15 @@ export const Asset = {
1727
1939
  }
1728
1940
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
1729
1941
  where: {
1730
- id: item.id !== undefined ? item.id : undefined,
1942
+ id: item.id !== undefined ? {
1943
+ equals: item.id
1944
+ } : undefined,
1945
+ assetId: item.assetId !== undefined ? {
1946
+ equals: item.assetId
1947
+ } : undefined,
1948
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1949
+ equals: item.alpacaAccountId
1950
+ } : undefined,
1731
1951
  },
1732
1952
  create: {
1733
1953
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1754,7 +1974,12 @@ export const Asset = {
1754
1974
  }
1755
1975
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
1756
1976
  where: {
1757
- id: item.id !== undefined ? item.id : undefined,
1977
+ id: item.id !== undefined ? {
1978
+ equals: item.id
1979
+ } : undefined,
1980
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1981
+ equals: item.alpacaAccountId
1982
+ } : undefined,
1758
1983
  },
1759
1984
  create: {
1760
1985
  message: item.message !== undefined ? item.message : undefined,
@@ -1769,7 +1994,12 @@ export const Asset = {
1769
1994
  actions: item.actions ? {
1770
1995
  upsert: item.actions.map((item) => ({
1771
1996
  where: {
1772
- id: item.id !== undefined ? item.id : undefined,
1997
+ id: item.id !== undefined ? {
1998
+ equals: item.id
1999
+ } : undefined,
2000
+ tradeId: item.tradeId !== undefined ? {
2001
+ equals: item.tradeId
2002
+ } : undefined,
1773
2003
  },
1774
2004
  update: {
1775
2005
  id: item.id !== undefined ? {
@@ -1796,6 +2026,18 @@ export const Asset = {
1796
2026
  id: item.order.id !== undefined ? {
1797
2027
  equals: item.order.id
1798
2028
  } : undefined,
2029
+ clientOrderId: item.order.clientOrderId !== undefined ? {
2030
+ equals: item.order.clientOrderId
2031
+ } : undefined,
2032
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2033
+ equals: item.order.alpacaAccountId
2034
+ } : undefined,
2035
+ assetId: item.order.assetId !== undefined ? {
2036
+ equals: item.order.assetId
2037
+ } : undefined,
2038
+ actionId: item.order.actionId !== undefined ? {
2039
+ equals: item.order.actionId
2040
+ } : undefined,
1799
2041
  },
1800
2042
  update: {
1801
2043
  id: item.order.id !== undefined ? {
@@ -1909,7 +2151,18 @@ export const Asset = {
1909
2151
  }
1910
2152
  : { connectOrCreate: {
1911
2153
  where: {
1912
- id: item.order.id !== undefined ? item.order.id : undefined,
2154
+ id: item.order.id !== undefined ? {
2155
+ equals: item.order.id
2156
+ } : undefined,
2157
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2158
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2159
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2160
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2161
+ equals: item.order.alpacaAccountId
2162
+ } : undefined,
2163
+ assetId: item.order.assetId !== undefined ? {
2164
+ equals: item.order.assetId
2165
+ } : undefined,
1913
2166
  },
1914
2167
  create: {
1915
2168
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -1961,7 +2214,12 @@ export const Asset = {
1961
2214
  }
1962
2215
  : { connectOrCreate: {
1963
2216
  where: {
1964
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2217
+ id: item.alpacaAccount.id !== undefined ? {
2218
+ equals: item.alpacaAccount.id
2219
+ } : undefined,
2220
+ userId: item.alpacaAccount.userId !== undefined ? {
2221
+ equals: item.alpacaAccount.userId
2222
+ } : undefined,
1965
2223
  },
1966
2224
  create: {
1967
2225
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1981,7 +2239,9 @@ export const Asset = {
1981
2239
  }
1982
2240
  : { connectOrCreate: {
1983
2241
  where: {
1984
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
2242
+ id: item.alpacaAccount.user.id !== undefined ? {
2243
+ equals: item.alpacaAccount.user.id
2244
+ } : undefined,
1985
2245
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
1986
2246
  name: item.alpacaAccount.user.name !== undefined ? {
1987
2247
  equals: item.alpacaAccount.user.name
@@ -2010,7 +2270,18 @@ export const Asset = {
2010
2270
  }
2011
2271
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
2012
2272
  where: {
2013
- id: item.id !== undefined ? item.id : undefined,
2273
+ id: item.id !== undefined ? {
2274
+ equals: item.id
2275
+ } : undefined,
2276
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2277
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2278
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2279
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2280
+ equals: item.alpacaAccountId
2281
+ } : undefined,
2282
+ assetId: item.assetId !== undefined ? {
2283
+ equals: item.assetId
2284
+ } : undefined,
2014
2285
  },
2015
2286
  create: {
2016
2287
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2046,7 +2317,15 @@ export const Asset = {
2046
2317
  }
2047
2318
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2048
2319
  where: {
2049
- id: item.id !== undefined ? item.id : undefined,
2320
+ id: item.id !== undefined ? {
2321
+ equals: item.id
2322
+ } : undefined,
2323
+ assetId: item.assetId !== undefined ? {
2324
+ equals: item.assetId
2325
+ } : undefined,
2326
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2327
+ equals: item.alpacaAccountId
2328
+ } : undefined,
2050
2329
  },
2051
2330
  create: {
2052
2331
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2073,7 +2352,12 @@ export const Asset = {
2073
2352
  }
2074
2353
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2075
2354
  where: {
2076
- id: item.id !== undefined ? item.id : undefined,
2355
+ id: item.id !== undefined ? {
2356
+ equals: item.id
2357
+ } : undefined,
2358
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2359
+ equals: item.alpacaAccountId
2360
+ } : undefined,
2077
2361
  },
2078
2362
  create: {
2079
2363
  message: item.message !== undefined ? item.message : undefined,
@@ -2093,7 +2377,12 @@ export const Asset = {
2093
2377
  }
2094
2378
  : { connectOrCreate: item.actions.map((item) => ({
2095
2379
  where: {
2096
- id: item.id !== undefined ? item.id : undefined,
2380
+ id: item.id !== undefined ? {
2381
+ equals: item.id
2382
+ } : undefined,
2383
+ tradeId: item.tradeId !== undefined ? {
2384
+ equals: item.tradeId
2385
+ } : undefined,
2097
2386
  },
2098
2387
  create: {
2099
2388
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2109,7 +2398,18 @@ export const Asset = {
2109
2398
  }
2110
2399
  : { connectOrCreate: {
2111
2400
  where: {
2112
- id: item.order.id !== undefined ? item.order.id : undefined,
2401
+ id: item.order.id !== undefined ? {
2402
+ equals: item.order.id
2403
+ } : undefined,
2404
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2405
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2406
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2407
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2408
+ equals: item.order.alpacaAccountId
2409
+ } : undefined,
2410
+ assetId: item.order.assetId !== undefined ? {
2411
+ equals: item.order.assetId
2412
+ } : undefined,
2113
2413
  },
2114
2414
  create: {
2115
2415
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -2146,7 +2446,18 @@ export const Asset = {
2146
2446
  orders: props.orders ? {
2147
2447
  upsert: props.orders.map((item) => ({
2148
2448
  where: {
2149
- id: item.id !== undefined ? item.id : undefined,
2449
+ id: item.id !== undefined ? {
2450
+ equals: item.id
2451
+ } : undefined,
2452
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2453
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2454
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2455
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2456
+ equals: item.alpacaAccountId
2457
+ } : undefined,
2458
+ assetId: item.assetId !== undefined ? {
2459
+ equals: item.assetId
2460
+ } : undefined,
2150
2461
  },
2151
2462
  update: {
2152
2463
  id: item.id !== undefined ? {
@@ -2224,6 +2535,9 @@ export const Asset = {
2224
2535
  id: item.stopLoss.id !== undefined ? {
2225
2536
  equals: item.stopLoss.id
2226
2537
  } : undefined,
2538
+ orderId: item.stopLoss.orderId !== undefined ? {
2539
+ equals: item.stopLoss.orderId
2540
+ } : undefined,
2227
2541
  },
2228
2542
  update: {
2229
2543
  id: item.stopLoss.id !== undefined ? {
@@ -2248,6 +2562,9 @@ export const Asset = {
2248
2562
  id: item.takeProfit.id !== undefined ? {
2249
2563
  equals: item.takeProfit.id
2250
2564
  } : undefined,
2565
+ orderId: item.takeProfit.orderId !== undefined ? {
2566
+ equals: item.takeProfit.orderId
2567
+ } : undefined,
2251
2568
  },
2252
2569
  update: {
2253
2570
  id: item.takeProfit.id !== undefined ? {
@@ -2272,6 +2589,9 @@ export const Asset = {
2272
2589
  id: item.alpacaAccount.id !== undefined ? {
2273
2590
  equals: item.alpacaAccount.id
2274
2591
  } : undefined,
2592
+ userId: item.alpacaAccount.userId !== undefined ? {
2593
+ equals: item.alpacaAccount.userId
2594
+ } : undefined,
2275
2595
  },
2276
2596
  update: {
2277
2597
  id: item.alpacaAccount.id !== undefined ? {
@@ -2373,7 +2693,15 @@ export const Asset = {
2373
2693
  trades: item.alpacaAccount.trades ? {
2374
2694
  upsert: item.alpacaAccount.trades.map((item) => ({
2375
2695
  where: {
2376
- id: item.id !== undefined ? item.id : undefined,
2696
+ id: item.id !== undefined ? {
2697
+ equals: item.id
2698
+ } : undefined,
2699
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2700
+ equals: item.alpacaAccountId
2701
+ } : undefined,
2702
+ assetId: item.assetId !== undefined ? {
2703
+ equals: item.assetId
2704
+ } : undefined,
2377
2705
  },
2378
2706
  update: {
2379
2707
  id: item.id !== undefined ? {
@@ -2431,7 +2759,15 @@ export const Asset = {
2431
2759
  positions: item.alpacaAccount.positions ? {
2432
2760
  upsert: item.alpacaAccount.positions.map((item) => ({
2433
2761
  where: {
2434
- id: item.id !== undefined ? item.id : undefined,
2762
+ id: item.id !== undefined ? {
2763
+ equals: item.id
2764
+ } : undefined,
2765
+ assetId: item.assetId !== undefined ? {
2766
+ equals: item.assetId
2767
+ } : undefined,
2768
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2769
+ equals: item.alpacaAccountId
2770
+ } : undefined,
2435
2771
  },
2436
2772
  update: {
2437
2773
  id: item.id !== undefined ? {
@@ -2497,7 +2833,12 @@ export const Asset = {
2497
2833
  alerts: item.alpacaAccount.alerts ? {
2498
2834
  upsert: item.alpacaAccount.alerts.map((item) => ({
2499
2835
  where: {
2500
- id: item.id !== undefined ? item.id : undefined,
2836
+ id: item.id !== undefined ? {
2837
+ equals: item.id
2838
+ } : undefined,
2839
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2840
+ equals: item.alpacaAccountId
2841
+ } : undefined,
2501
2842
  },
2502
2843
  update: {
2503
2844
  id: item.id !== undefined ? {
@@ -2539,7 +2880,9 @@ export const Asset = {
2539
2880
  }
2540
2881
  : { connectOrCreate: {
2541
2882
  where: {
2542
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
2883
+ id: item.alpacaAccount.user.id !== undefined ? {
2884
+ equals: item.alpacaAccount.user.id
2885
+ } : undefined,
2543
2886
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
2544
2887
  name: item.alpacaAccount.user.name !== undefined ? {
2545
2888
  equals: item.alpacaAccount.user.name
@@ -2568,7 +2911,15 @@ export const Asset = {
2568
2911
  }
2569
2912
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2570
2913
  where: {
2571
- id: item.id !== undefined ? item.id : undefined,
2914
+ id: item.id !== undefined ? {
2915
+ equals: item.id
2916
+ } : undefined,
2917
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2918
+ equals: item.alpacaAccountId
2919
+ } : undefined,
2920
+ assetId: item.assetId !== undefined ? {
2921
+ equals: item.assetId
2922
+ } : undefined,
2572
2923
  },
2573
2924
  create: {
2574
2925
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2593,7 +2944,15 @@ export const Asset = {
2593
2944
  }
2594
2945
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2595
2946
  where: {
2596
- id: item.id !== undefined ? item.id : undefined,
2947
+ id: item.id !== undefined ? {
2948
+ equals: item.id
2949
+ } : undefined,
2950
+ assetId: item.assetId !== undefined ? {
2951
+ equals: item.assetId
2952
+ } : undefined,
2953
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2954
+ equals: item.alpacaAccountId
2955
+ } : undefined,
2597
2956
  },
2598
2957
  create: {
2599
2958
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2620,7 +2979,12 @@ export const Asset = {
2620
2979
  }
2621
2980
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2622
2981
  where: {
2623
- id: item.id !== undefined ? item.id : undefined,
2982
+ id: item.id !== undefined ? {
2983
+ equals: item.id
2984
+ } : undefined,
2985
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2986
+ equals: item.alpacaAccountId
2987
+ } : undefined,
2624
2988
  },
2625
2989
  create: {
2626
2990
  message: item.message !== undefined ? item.message : undefined,
@@ -2638,6 +3002,9 @@ export const Asset = {
2638
3002
  id: item.action.id !== undefined ? {
2639
3003
  equals: item.action.id
2640
3004
  } : undefined,
3005
+ tradeId: item.action.tradeId !== undefined ? {
3006
+ equals: item.action.tradeId
3007
+ } : undefined,
2641
3008
  },
2642
3009
  update: {
2643
3010
  id: item.action.id !== undefined ? {
@@ -2664,6 +3031,12 @@ export const Asset = {
2664
3031
  id: item.action.trade.id !== undefined ? {
2665
3032
  equals: item.action.trade.id
2666
3033
  } : undefined,
3034
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3035
+ equals: item.action.trade.alpacaAccountId
3036
+ } : undefined,
3037
+ assetId: item.action.trade.assetId !== undefined ? {
3038
+ equals: item.action.trade.assetId
3039
+ } : undefined,
2667
3040
  },
2668
3041
  update: {
2669
3042
  id: item.action.trade.id !== undefined ? {
@@ -2733,7 +3106,15 @@ export const Asset = {
2733
3106
  }
2734
3107
  : { connectOrCreate: {
2735
3108
  where: {
2736
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3109
+ id: item.action.trade.id !== undefined ? {
3110
+ equals: item.action.trade.id
3111
+ } : undefined,
3112
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3113
+ equals: item.action.trade.alpacaAccountId
3114
+ } : undefined,
3115
+ assetId: item.action.trade.assetId !== undefined ? {
3116
+ equals: item.action.trade.assetId
3117
+ } : undefined,
2737
3118
  },
2738
3119
  create: {
2739
3120
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2785,7 +3166,10 @@ export const Asset = {
2785
3166
  }
2786
3167
  : { connectOrCreate: {
2787
3168
  where: {
2788
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3169
+ id: item.stopLoss.id !== undefined ? {
3170
+ equals: item.stopLoss.id
3171
+ } : undefined,
3172
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2789
3173
  },
2790
3174
  create: {
2791
3175
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2801,7 +3185,10 @@ export const Asset = {
2801
3185
  }
2802
3186
  : { connectOrCreate: {
2803
3187
  where: {
2804
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3188
+ id: item.takeProfit.id !== undefined ? {
3189
+ equals: item.takeProfit.id
3190
+ } : undefined,
3191
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2805
3192
  },
2806
3193
  create: {
2807
3194
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2817,7 +3204,12 @@ export const Asset = {
2817
3204
  }
2818
3205
  : { connectOrCreate: {
2819
3206
  where: {
2820
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3207
+ id: item.alpacaAccount.id !== undefined ? {
3208
+ equals: item.alpacaAccount.id
3209
+ } : undefined,
3210
+ userId: item.alpacaAccount.userId !== undefined ? {
3211
+ equals: item.alpacaAccount.userId
3212
+ } : undefined,
2821
3213
  },
2822
3214
  create: {
2823
3215
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2837,7 +3229,9 @@ export const Asset = {
2837
3229
  }
2838
3230
  : { connectOrCreate: {
2839
3231
  where: {
2840
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
3232
+ id: item.alpacaAccount.user.id !== undefined ? {
3233
+ equals: item.alpacaAccount.user.id
3234
+ } : undefined,
2841
3235
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
2842
3236
  name: item.alpacaAccount.user.name !== undefined ? {
2843
3237
  equals: item.alpacaAccount.user.name
@@ -2866,7 +3260,15 @@ export const Asset = {
2866
3260
  }
2867
3261
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2868
3262
  where: {
2869
- id: item.id !== undefined ? item.id : undefined,
3263
+ id: item.id !== undefined ? {
3264
+ equals: item.id
3265
+ } : undefined,
3266
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3267
+ equals: item.alpacaAccountId
3268
+ } : undefined,
3269
+ assetId: item.assetId !== undefined ? {
3270
+ equals: item.assetId
3271
+ } : undefined,
2870
3272
  },
2871
3273
  create: {
2872
3274
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2891,7 +3293,15 @@ export const Asset = {
2891
3293
  }
2892
3294
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2893
3295
  where: {
2894
- id: item.id !== undefined ? item.id : undefined,
3296
+ id: item.id !== undefined ? {
3297
+ equals: item.id
3298
+ } : undefined,
3299
+ assetId: item.assetId !== undefined ? {
3300
+ equals: item.assetId
3301
+ } : undefined,
3302
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3303
+ equals: item.alpacaAccountId
3304
+ } : undefined,
2895
3305
  },
2896
3306
  create: {
2897
3307
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2918,7 +3328,12 @@ export const Asset = {
2918
3328
  }
2919
3329
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2920
3330
  where: {
2921
- id: item.id !== undefined ? item.id : undefined,
3331
+ id: item.id !== undefined ? {
3332
+ equals: item.id
3333
+ } : undefined,
3334
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3335
+ equals: item.alpacaAccountId
3336
+ } : undefined,
2922
3337
  },
2923
3338
  create: {
2924
3339
  message: item.message !== undefined ? item.message : undefined,
@@ -2938,7 +3353,12 @@ export const Asset = {
2938
3353
  }
2939
3354
  : { connectOrCreate: {
2940
3355
  where: {
2941
- id: item.action.id !== undefined ? item.action.id : undefined,
3356
+ id: item.action.id !== undefined ? {
3357
+ equals: item.action.id
3358
+ } : undefined,
3359
+ tradeId: item.action.tradeId !== undefined ? {
3360
+ equals: item.action.tradeId
3361
+ } : undefined,
2942
3362
  },
2943
3363
  create: {
2944
3364
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2954,7 +3374,15 @@ export const Asset = {
2954
3374
  }
2955
3375
  : { connectOrCreate: {
2956
3376
  where: {
2957
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3377
+ id: item.action.trade.id !== undefined ? {
3378
+ equals: item.action.trade.id
3379
+ } : undefined,
3380
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3381
+ equals: item.action.trade.alpacaAccountId
3382
+ } : undefined,
3383
+ assetId: item.action.trade.assetId !== undefined ? {
3384
+ equals: item.action.trade.assetId
3385
+ } : undefined,
2958
3386
  },
2959
3387
  create: {
2960
3388
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2980,7 +3408,15 @@ export const Asset = {
2980
3408
  positions: props.positions ? {
2981
3409
  upsert: props.positions.map((item) => ({
2982
3410
  where: {
2983
- id: item.id !== undefined ? item.id : undefined,
3411
+ id: item.id !== undefined ? {
3412
+ equals: item.id
3413
+ } : undefined,
3414
+ assetId: item.assetId !== undefined ? {
3415
+ equals: item.assetId
3416
+ } : undefined,
3417
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3418
+ equals: item.alpacaAccountId
3419
+ } : undefined,
2984
3420
  },
2985
3421
  update: {
2986
3422
  id: item.id !== undefined ? {
@@ -3031,6 +3467,9 @@ export const Asset = {
3031
3467
  id: item.alpacaAccount.id !== undefined ? {
3032
3468
  equals: item.alpacaAccount.id
3033
3469
  } : undefined,
3470
+ userId: item.alpacaAccount.userId !== undefined ? {
3471
+ equals: item.alpacaAccount.userId
3472
+ } : undefined,
3034
3473
  },
3035
3474
  update: {
3036
3475
  id: item.alpacaAccount.id !== undefined ? {
@@ -3132,7 +3571,15 @@ export const Asset = {
3132
3571
  trades: item.alpacaAccount.trades ? {
3133
3572
  upsert: item.alpacaAccount.trades.map((item) => ({
3134
3573
  where: {
3135
- id: item.id !== undefined ? item.id : undefined,
3574
+ id: item.id !== undefined ? {
3575
+ equals: item.id
3576
+ } : undefined,
3577
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3578
+ equals: item.alpacaAccountId
3579
+ } : undefined,
3580
+ assetId: item.assetId !== undefined ? {
3581
+ equals: item.assetId
3582
+ } : undefined,
3136
3583
  },
3137
3584
  update: {
3138
3585
  id: item.id !== undefined ? {
@@ -3190,7 +3637,18 @@ export const Asset = {
3190
3637
  orders: item.alpacaAccount.orders ? {
3191
3638
  upsert: item.alpacaAccount.orders.map((item) => ({
3192
3639
  where: {
3193
- id: item.id !== undefined ? item.id : undefined,
3640
+ id: item.id !== undefined ? {
3641
+ equals: item.id
3642
+ } : undefined,
3643
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3644
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3645
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3646
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3647
+ equals: item.alpacaAccountId
3648
+ } : undefined,
3649
+ assetId: item.assetId !== undefined ? {
3650
+ equals: item.assetId
3651
+ } : undefined,
3194
3652
  },
3195
3653
  update: {
3196
3654
  id: item.id !== undefined ? {
@@ -3292,7 +3750,12 @@ export const Asset = {
3292
3750
  alerts: item.alpacaAccount.alerts ? {
3293
3751
  upsert: item.alpacaAccount.alerts.map((item) => ({
3294
3752
  where: {
3295
- id: item.id !== undefined ? item.id : undefined,
3753
+ id: item.id !== undefined ? {
3754
+ equals: item.id
3755
+ } : undefined,
3756
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3757
+ equals: item.alpacaAccountId
3758
+ } : undefined,
3296
3759
  },
3297
3760
  update: {
3298
3761
  id: item.id !== undefined ? {
@@ -3334,7 +3797,9 @@ export const Asset = {
3334
3797
  }
3335
3798
  : { connectOrCreate: {
3336
3799
  where: {
3337
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
3800
+ id: item.alpacaAccount.user.id !== undefined ? {
3801
+ equals: item.alpacaAccount.user.id
3802
+ } : undefined,
3338
3803
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
3339
3804
  name: item.alpacaAccount.user.name !== undefined ? {
3340
3805
  equals: item.alpacaAccount.user.name
@@ -3363,7 +3828,15 @@ export const Asset = {
3363
3828
  }
3364
3829
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3365
3830
  where: {
3366
- id: item.id !== undefined ? item.id : undefined,
3831
+ id: item.id !== undefined ? {
3832
+ equals: item.id
3833
+ } : undefined,
3834
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3835
+ equals: item.alpacaAccountId
3836
+ } : undefined,
3837
+ assetId: item.assetId !== undefined ? {
3838
+ equals: item.assetId
3839
+ } : undefined,
3367
3840
  },
3368
3841
  create: {
3369
3842
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3388,7 +3861,18 @@ export const Asset = {
3388
3861
  }
3389
3862
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3390
3863
  where: {
3391
- id: item.id !== undefined ? item.id : undefined,
3864
+ id: item.id !== undefined ? {
3865
+ equals: item.id
3866
+ } : undefined,
3867
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3868
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3869
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3870
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3871
+ equals: item.alpacaAccountId
3872
+ } : undefined,
3873
+ assetId: item.assetId !== undefined ? {
3874
+ equals: item.assetId
3875
+ } : undefined,
3392
3876
  },
3393
3877
  create: {
3394
3878
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3424,7 +3908,12 @@ export const Asset = {
3424
3908
  }
3425
3909
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3426
3910
  where: {
3427
- id: item.id !== undefined ? item.id : undefined,
3911
+ id: item.id !== undefined ? {
3912
+ equals: item.id
3913
+ } : undefined,
3914
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3915
+ equals: item.alpacaAccountId
3916
+ } : undefined,
3428
3917
  },
3429
3918
  create: {
3430
3919
  message: item.message !== undefined ? item.message : undefined,
@@ -3459,7 +3948,12 @@ export const Asset = {
3459
3948
  }
3460
3949
  : { connectOrCreate: {
3461
3950
  where: {
3462
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3951
+ id: item.alpacaAccount.id !== undefined ? {
3952
+ equals: item.alpacaAccount.id
3953
+ } : undefined,
3954
+ userId: item.alpacaAccount.userId !== undefined ? {
3955
+ equals: item.alpacaAccount.userId
3956
+ } : undefined,
3463
3957
  },
3464
3958
  create: {
3465
3959
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -3479,7 +3973,9 @@ export const Asset = {
3479
3973
  }
3480
3974
  : { connectOrCreate: {
3481
3975
  where: {
3482
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
3976
+ id: item.alpacaAccount.user.id !== undefined ? {
3977
+ equals: item.alpacaAccount.user.id
3978
+ } : undefined,
3483
3979
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
3484
3980
  name: item.alpacaAccount.user.name !== undefined ? {
3485
3981
  equals: item.alpacaAccount.user.name
@@ -3508,7 +4004,15 @@ export const Asset = {
3508
4004
  }
3509
4005
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3510
4006
  where: {
3511
- id: item.id !== undefined ? item.id : undefined,
4007
+ id: item.id !== undefined ? {
4008
+ equals: item.id
4009
+ } : undefined,
4010
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4011
+ equals: item.alpacaAccountId
4012
+ } : undefined,
4013
+ assetId: item.assetId !== undefined ? {
4014
+ equals: item.assetId
4015
+ } : undefined,
3512
4016
  },
3513
4017
  create: {
3514
4018
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3533,7 +4037,18 @@ export const Asset = {
3533
4037
  }
3534
4038
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3535
4039
  where: {
3536
- id: item.id !== undefined ? item.id : undefined,
4040
+ id: item.id !== undefined ? {
4041
+ equals: item.id
4042
+ } : undefined,
4043
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4044
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4045
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4046
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4047
+ equals: item.alpacaAccountId
4048
+ } : undefined,
4049
+ assetId: item.assetId !== undefined ? {
4050
+ equals: item.assetId
4051
+ } : undefined,
3537
4052
  },
3538
4053
  create: {
3539
4054
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3569,7 +4084,12 @@ export const Asset = {
3569
4084
  }
3570
4085
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3571
4086
  where: {
3572
- id: item.id !== undefined ? item.id : undefined,
4087
+ id: item.id !== undefined ? {
4088
+ equals: item.id
4089
+ } : undefined,
4090
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4091
+ equals: item.alpacaAccountId
4092
+ } : undefined,
3573
4093
  },
3574
4094
  create: {
3575
4095
  message: item.message !== undefined ? item.message : undefined,
@@ -3587,8 +4107,16 @@ export const Asset = {
3587
4107
  newsMentions: props.newsMentions ? {
3588
4108
  upsert: props.newsMentions.map((item) => ({
3589
4109
  where: {
3590
- id: item.id !== undefined ? item.id : undefined,
4110
+ id: item.id !== undefined ? {
4111
+ equals: item.id
4112
+ } : undefined,
3591
4113
  url: item.url !== undefined ? item.url : undefined,
4114
+ assetId: item.assetId !== undefined ? {
4115
+ equals: item.assetId
4116
+ } : undefined,
4117
+ newsArticleId: item.newsArticleId !== undefined ? {
4118
+ equals: item.newsArticleId
4119
+ } : undefined,
3592
4120
  },
3593
4121
  update: {
3594
4122
  id: item.id !== undefined ? {
@@ -3694,7 +4222,9 @@ export const Asset = {
3694
4222
  }
3695
4223
  : { connectOrCreate: {
3696
4224
  where: {
3697
- id: item.news.id !== undefined ? item.news.id : undefined,
4225
+ id: item.news.id !== undefined ? {
4226
+ equals: item.news.id
4227
+ } : undefined,
3698
4228
  url: item.news.url !== undefined ? item.news.url : undefined,
3699
4229
  title: item.news.title !== undefined ? {
3700
4230
  equals: item.news.title
@@ -3754,7 +4284,9 @@ export const Asset = {
3754
4284
  }`;
3755
4285
  const variables = props.map(prop => ({
3756
4286
  where: {
3757
- id: prop.id !== undefined ? prop.id : undefined,
4287
+ id: prop.id !== undefined ? {
4288
+ equals: prop.id
4289
+ } : undefined,
3758
4290
  symbol: prop.symbol !== undefined ? prop.symbol : undefined,
3759
4291
  name: prop.name !== undefined ? prop.name : undefined,
3760
4292
  type: prop.type !== undefined ? prop.type : undefined,
@@ -3989,7 +4521,15 @@ export const Asset = {
3989
4521
  trades: prop.trades ? {
3990
4522
  upsert: prop.trades.map((item) => ({
3991
4523
  where: {
3992
- id: item.id !== undefined ? item.id : undefined,
4524
+ id: item.id !== undefined ? {
4525
+ equals: item.id
4526
+ } : undefined,
4527
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4528
+ equals: item.alpacaAccountId
4529
+ } : undefined,
4530
+ assetId: item.assetId !== undefined ? {
4531
+ equals: item.assetId
4532
+ } : undefined,
3993
4533
  },
3994
4534
  update: {
3995
4535
  id: item.id !== undefined ? {
@@ -4034,6 +4574,9 @@ export const Asset = {
4034
4574
  id: item.alpacaAccount.id !== undefined ? {
4035
4575
  equals: item.alpacaAccount.id
4036
4576
  } : undefined,
4577
+ userId: item.alpacaAccount.userId !== undefined ? {
4578
+ equals: item.alpacaAccount.userId
4579
+ } : undefined,
4037
4580
  },
4038
4581
  update: {
4039
4582
  id: item.alpacaAccount.id !== undefined ? {
@@ -4135,7 +4678,18 @@ export const Asset = {
4135
4678
  orders: item.alpacaAccount.orders ? {
4136
4679
  upsert: item.alpacaAccount.orders.map((item) => ({
4137
4680
  where: {
4138
- id: item.id !== undefined ? item.id : undefined,
4681
+ id: item.id !== undefined ? {
4682
+ equals: item.id
4683
+ } : undefined,
4684
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4685
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4686
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4687
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4688
+ equals: item.alpacaAccountId
4689
+ } : undefined,
4690
+ assetId: item.assetId !== undefined ? {
4691
+ equals: item.assetId
4692
+ } : undefined,
4139
4693
  },
4140
4694
  update: {
4141
4695
  id: item.id !== undefined ? {
@@ -4237,7 +4791,15 @@ export const Asset = {
4237
4791
  positions: item.alpacaAccount.positions ? {
4238
4792
  upsert: item.alpacaAccount.positions.map((item) => ({
4239
4793
  where: {
4240
- id: item.id !== undefined ? item.id : undefined,
4794
+ id: item.id !== undefined ? {
4795
+ equals: item.id
4796
+ } : undefined,
4797
+ assetId: item.assetId !== undefined ? {
4798
+ equals: item.assetId
4799
+ } : undefined,
4800
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4801
+ equals: item.alpacaAccountId
4802
+ } : undefined,
4241
4803
  },
4242
4804
  update: {
4243
4805
  id: item.id !== undefined ? {
@@ -4303,7 +4865,12 @@ export const Asset = {
4303
4865
  alerts: item.alpacaAccount.alerts ? {
4304
4866
  upsert: item.alpacaAccount.alerts.map((item) => ({
4305
4867
  where: {
4306
- id: item.id !== undefined ? item.id : undefined,
4868
+ id: item.id !== undefined ? {
4869
+ equals: item.id
4870
+ } : undefined,
4871
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4872
+ equals: item.alpacaAccountId
4873
+ } : undefined,
4307
4874
  },
4308
4875
  update: {
4309
4876
  id: item.id !== undefined ? {
@@ -4345,7 +4912,9 @@ export const Asset = {
4345
4912
  }
4346
4913
  : { connectOrCreate: {
4347
4914
  where: {
4348
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
4915
+ id: item.alpacaAccount.user.id !== undefined ? {
4916
+ equals: item.alpacaAccount.user.id
4917
+ } : undefined,
4349
4918
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
4350
4919
  name: item.alpacaAccount.user.name !== undefined ? {
4351
4920
  equals: item.alpacaAccount.user.name
@@ -4374,7 +4943,18 @@ export const Asset = {
4374
4943
  }
4375
4944
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4376
4945
  where: {
4377
- id: item.id !== undefined ? item.id : undefined,
4946
+ id: item.id !== undefined ? {
4947
+ equals: item.id
4948
+ } : undefined,
4949
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4950
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4951
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4952
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4953
+ equals: item.alpacaAccountId
4954
+ } : undefined,
4955
+ assetId: item.assetId !== undefined ? {
4956
+ equals: item.assetId
4957
+ } : undefined,
4378
4958
  },
4379
4959
  create: {
4380
4960
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4410,7 +4990,15 @@ export const Asset = {
4410
4990
  }
4411
4991
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4412
4992
  where: {
4413
- id: item.id !== undefined ? item.id : undefined,
4993
+ id: item.id !== undefined ? {
4994
+ equals: item.id
4995
+ } : undefined,
4996
+ assetId: item.assetId !== undefined ? {
4997
+ equals: item.assetId
4998
+ } : undefined,
4999
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5000
+ equals: item.alpacaAccountId
5001
+ } : undefined,
4414
5002
  },
4415
5003
  create: {
4416
5004
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4437,7 +5025,12 @@ export const Asset = {
4437
5025
  }
4438
5026
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4439
5027
  where: {
4440
- id: item.id !== undefined ? item.id : undefined,
5028
+ id: item.id !== undefined ? {
5029
+ equals: item.id
5030
+ } : undefined,
5031
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5032
+ equals: item.alpacaAccountId
5033
+ } : undefined,
4441
5034
  },
4442
5035
  create: {
4443
5036
  message: item.message !== undefined ? item.message : undefined,
@@ -4452,7 +5045,12 @@ export const Asset = {
4452
5045
  actions: item.actions ? {
4453
5046
  upsert: item.actions.map((item) => ({
4454
5047
  where: {
4455
- id: item.id !== undefined ? item.id : undefined,
5048
+ id: item.id !== undefined ? {
5049
+ equals: item.id
5050
+ } : undefined,
5051
+ tradeId: item.tradeId !== undefined ? {
5052
+ equals: item.tradeId
5053
+ } : undefined,
4456
5054
  },
4457
5055
  update: {
4458
5056
  id: item.id !== undefined ? {
@@ -4479,6 +5077,18 @@ export const Asset = {
4479
5077
  id: item.order.id !== undefined ? {
4480
5078
  equals: item.order.id
4481
5079
  } : undefined,
5080
+ clientOrderId: item.order.clientOrderId !== undefined ? {
5081
+ equals: item.order.clientOrderId
5082
+ } : undefined,
5083
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5084
+ equals: item.order.alpacaAccountId
5085
+ } : undefined,
5086
+ assetId: item.order.assetId !== undefined ? {
5087
+ equals: item.order.assetId
5088
+ } : undefined,
5089
+ actionId: item.order.actionId !== undefined ? {
5090
+ equals: item.order.actionId
5091
+ } : undefined,
4482
5092
  },
4483
5093
  update: {
4484
5094
  id: item.order.id !== undefined ? {
@@ -4592,7 +5202,18 @@ export const Asset = {
4592
5202
  }
4593
5203
  : { connectOrCreate: {
4594
5204
  where: {
4595
- id: item.order.id !== undefined ? item.order.id : undefined,
5205
+ id: item.order.id !== undefined ? {
5206
+ equals: item.order.id
5207
+ } : undefined,
5208
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5209
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5210
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5211
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5212
+ equals: item.order.alpacaAccountId
5213
+ } : undefined,
5214
+ assetId: item.order.assetId !== undefined ? {
5215
+ equals: item.order.assetId
5216
+ } : undefined,
4596
5217
  },
4597
5218
  create: {
4598
5219
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4644,7 +5265,12 @@ export const Asset = {
4644
5265
  }
4645
5266
  : { connectOrCreate: {
4646
5267
  where: {
4647
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
5268
+ id: item.alpacaAccount.id !== undefined ? {
5269
+ equals: item.alpacaAccount.id
5270
+ } : undefined,
5271
+ userId: item.alpacaAccount.userId !== undefined ? {
5272
+ equals: item.alpacaAccount.userId
5273
+ } : undefined,
4648
5274
  },
4649
5275
  create: {
4650
5276
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -4664,7 +5290,9 @@ export const Asset = {
4664
5290
  }
4665
5291
  : { connectOrCreate: {
4666
5292
  where: {
4667
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
5293
+ id: item.alpacaAccount.user.id !== undefined ? {
5294
+ equals: item.alpacaAccount.user.id
5295
+ } : undefined,
4668
5296
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
4669
5297
  name: item.alpacaAccount.user.name !== undefined ? {
4670
5298
  equals: item.alpacaAccount.user.name
@@ -4693,7 +5321,18 @@ export const Asset = {
4693
5321
  }
4694
5322
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4695
5323
  where: {
4696
- id: item.id !== undefined ? item.id : undefined,
5324
+ id: item.id !== undefined ? {
5325
+ equals: item.id
5326
+ } : undefined,
5327
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5328
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5329
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5330
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5331
+ equals: item.alpacaAccountId
5332
+ } : undefined,
5333
+ assetId: item.assetId !== undefined ? {
5334
+ equals: item.assetId
5335
+ } : undefined,
4697
5336
  },
4698
5337
  create: {
4699
5338
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4729,7 +5368,15 @@ export const Asset = {
4729
5368
  }
4730
5369
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4731
5370
  where: {
4732
- id: item.id !== undefined ? item.id : undefined,
5371
+ id: item.id !== undefined ? {
5372
+ equals: item.id
5373
+ } : undefined,
5374
+ assetId: item.assetId !== undefined ? {
5375
+ equals: item.assetId
5376
+ } : undefined,
5377
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5378
+ equals: item.alpacaAccountId
5379
+ } : undefined,
4733
5380
  },
4734
5381
  create: {
4735
5382
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4756,7 +5403,12 @@ export const Asset = {
4756
5403
  }
4757
5404
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4758
5405
  where: {
4759
- id: item.id !== undefined ? item.id : undefined,
5406
+ id: item.id !== undefined ? {
5407
+ equals: item.id
5408
+ } : undefined,
5409
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5410
+ equals: item.alpacaAccountId
5411
+ } : undefined,
4760
5412
  },
4761
5413
  create: {
4762
5414
  message: item.message !== undefined ? item.message : undefined,
@@ -4776,7 +5428,12 @@ export const Asset = {
4776
5428
  }
4777
5429
  : { connectOrCreate: item.actions.map((item) => ({
4778
5430
  where: {
4779
- id: item.id !== undefined ? item.id : undefined,
5431
+ id: item.id !== undefined ? {
5432
+ equals: item.id
5433
+ } : undefined,
5434
+ tradeId: item.tradeId !== undefined ? {
5435
+ equals: item.tradeId
5436
+ } : undefined,
4780
5437
  },
4781
5438
  create: {
4782
5439
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -4792,7 +5449,18 @@ export const Asset = {
4792
5449
  }
4793
5450
  : { connectOrCreate: {
4794
5451
  where: {
4795
- id: item.order.id !== undefined ? item.order.id : undefined,
5452
+ id: item.order.id !== undefined ? {
5453
+ equals: item.order.id
5454
+ } : undefined,
5455
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5456
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5457
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5458
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5459
+ equals: item.order.alpacaAccountId
5460
+ } : undefined,
5461
+ assetId: item.order.assetId !== undefined ? {
5462
+ equals: item.order.assetId
5463
+ } : undefined,
4796
5464
  },
4797
5465
  create: {
4798
5466
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4829,7 +5497,18 @@ export const Asset = {
4829
5497
  orders: prop.orders ? {
4830
5498
  upsert: prop.orders.map((item) => ({
4831
5499
  where: {
4832
- id: item.id !== undefined ? item.id : undefined,
5500
+ id: item.id !== undefined ? {
5501
+ equals: item.id
5502
+ } : undefined,
5503
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5504
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5505
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5506
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5507
+ equals: item.alpacaAccountId
5508
+ } : undefined,
5509
+ assetId: item.assetId !== undefined ? {
5510
+ equals: item.assetId
5511
+ } : undefined,
4833
5512
  },
4834
5513
  update: {
4835
5514
  id: item.id !== undefined ? {
@@ -4907,6 +5586,9 @@ export const Asset = {
4907
5586
  id: item.stopLoss.id !== undefined ? {
4908
5587
  equals: item.stopLoss.id
4909
5588
  } : undefined,
5589
+ orderId: item.stopLoss.orderId !== undefined ? {
5590
+ equals: item.stopLoss.orderId
5591
+ } : undefined,
4910
5592
  },
4911
5593
  update: {
4912
5594
  id: item.stopLoss.id !== undefined ? {
@@ -4931,6 +5613,9 @@ export const Asset = {
4931
5613
  id: item.takeProfit.id !== undefined ? {
4932
5614
  equals: item.takeProfit.id
4933
5615
  } : undefined,
5616
+ orderId: item.takeProfit.orderId !== undefined ? {
5617
+ equals: item.takeProfit.orderId
5618
+ } : undefined,
4934
5619
  },
4935
5620
  update: {
4936
5621
  id: item.takeProfit.id !== undefined ? {
@@ -4955,6 +5640,9 @@ export const Asset = {
4955
5640
  id: item.alpacaAccount.id !== undefined ? {
4956
5641
  equals: item.alpacaAccount.id
4957
5642
  } : undefined,
5643
+ userId: item.alpacaAccount.userId !== undefined ? {
5644
+ equals: item.alpacaAccount.userId
5645
+ } : undefined,
4958
5646
  },
4959
5647
  update: {
4960
5648
  id: item.alpacaAccount.id !== undefined ? {
@@ -5056,7 +5744,15 @@ export const Asset = {
5056
5744
  trades: item.alpacaAccount.trades ? {
5057
5745
  upsert: item.alpacaAccount.trades.map((item) => ({
5058
5746
  where: {
5059
- id: item.id !== undefined ? item.id : undefined,
5747
+ id: item.id !== undefined ? {
5748
+ equals: item.id
5749
+ } : undefined,
5750
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5751
+ equals: item.alpacaAccountId
5752
+ } : undefined,
5753
+ assetId: item.assetId !== undefined ? {
5754
+ equals: item.assetId
5755
+ } : undefined,
5060
5756
  },
5061
5757
  update: {
5062
5758
  id: item.id !== undefined ? {
@@ -5114,7 +5810,15 @@ export const Asset = {
5114
5810
  positions: item.alpacaAccount.positions ? {
5115
5811
  upsert: item.alpacaAccount.positions.map((item) => ({
5116
5812
  where: {
5117
- id: item.id !== undefined ? item.id : undefined,
5813
+ id: item.id !== undefined ? {
5814
+ equals: item.id
5815
+ } : undefined,
5816
+ assetId: item.assetId !== undefined ? {
5817
+ equals: item.assetId
5818
+ } : undefined,
5819
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5820
+ equals: item.alpacaAccountId
5821
+ } : undefined,
5118
5822
  },
5119
5823
  update: {
5120
5824
  id: item.id !== undefined ? {
@@ -5180,7 +5884,12 @@ export const Asset = {
5180
5884
  alerts: item.alpacaAccount.alerts ? {
5181
5885
  upsert: item.alpacaAccount.alerts.map((item) => ({
5182
5886
  where: {
5183
- id: item.id !== undefined ? item.id : undefined,
5887
+ id: item.id !== undefined ? {
5888
+ equals: item.id
5889
+ } : undefined,
5890
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5891
+ equals: item.alpacaAccountId
5892
+ } : undefined,
5184
5893
  },
5185
5894
  update: {
5186
5895
  id: item.id !== undefined ? {
@@ -5222,7 +5931,9 @@ export const Asset = {
5222
5931
  }
5223
5932
  : { connectOrCreate: {
5224
5933
  where: {
5225
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
5934
+ id: item.alpacaAccount.user.id !== undefined ? {
5935
+ equals: item.alpacaAccount.user.id
5936
+ } : undefined,
5226
5937
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
5227
5938
  name: item.alpacaAccount.user.name !== undefined ? {
5228
5939
  equals: item.alpacaAccount.user.name
@@ -5251,7 +5962,15 @@ export const Asset = {
5251
5962
  }
5252
5963
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5253
5964
  where: {
5254
- id: item.id !== undefined ? item.id : undefined,
5965
+ id: item.id !== undefined ? {
5966
+ equals: item.id
5967
+ } : undefined,
5968
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5969
+ equals: item.alpacaAccountId
5970
+ } : undefined,
5971
+ assetId: item.assetId !== undefined ? {
5972
+ equals: item.assetId
5973
+ } : undefined,
5255
5974
  },
5256
5975
  create: {
5257
5976
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5276,7 +5995,15 @@ export const Asset = {
5276
5995
  }
5277
5996
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5278
5997
  where: {
5279
- id: item.id !== undefined ? item.id : undefined,
5998
+ id: item.id !== undefined ? {
5999
+ equals: item.id
6000
+ } : undefined,
6001
+ assetId: item.assetId !== undefined ? {
6002
+ equals: item.assetId
6003
+ } : undefined,
6004
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6005
+ equals: item.alpacaAccountId
6006
+ } : undefined,
5280
6007
  },
5281
6008
  create: {
5282
6009
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5303,7 +6030,12 @@ export const Asset = {
5303
6030
  }
5304
6031
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5305
6032
  where: {
5306
- id: item.id !== undefined ? item.id : undefined,
6033
+ id: item.id !== undefined ? {
6034
+ equals: item.id
6035
+ } : undefined,
6036
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6037
+ equals: item.alpacaAccountId
6038
+ } : undefined,
5307
6039
  },
5308
6040
  create: {
5309
6041
  message: item.message !== undefined ? item.message : undefined,
@@ -5321,6 +6053,9 @@ export const Asset = {
5321
6053
  id: item.action.id !== undefined ? {
5322
6054
  equals: item.action.id
5323
6055
  } : undefined,
6056
+ tradeId: item.action.tradeId !== undefined ? {
6057
+ equals: item.action.tradeId
6058
+ } : undefined,
5324
6059
  },
5325
6060
  update: {
5326
6061
  id: item.action.id !== undefined ? {
@@ -5347,6 +6082,12 @@ export const Asset = {
5347
6082
  id: item.action.trade.id !== undefined ? {
5348
6083
  equals: item.action.trade.id
5349
6084
  } : undefined,
6085
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6086
+ equals: item.action.trade.alpacaAccountId
6087
+ } : undefined,
6088
+ assetId: item.action.trade.assetId !== undefined ? {
6089
+ equals: item.action.trade.assetId
6090
+ } : undefined,
5350
6091
  },
5351
6092
  update: {
5352
6093
  id: item.action.trade.id !== undefined ? {
@@ -5416,7 +6157,15 @@ export const Asset = {
5416
6157
  }
5417
6158
  : { connectOrCreate: {
5418
6159
  where: {
5419
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6160
+ id: item.action.trade.id !== undefined ? {
6161
+ equals: item.action.trade.id
6162
+ } : undefined,
6163
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6164
+ equals: item.action.trade.alpacaAccountId
6165
+ } : undefined,
6166
+ assetId: item.action.trade.assetId !== undefined ? {
6167
+ equals: item.action.trade.assetId
6168
+ } : undefined,
5420
6169
  },
5421
6170
  create: {
5422
6171
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5468,7 +6217,10 @@ export const Asset = {
5468
6217
  }
5469
6218
  : { connectOrCreate: {
5470
6219
  where: {
5471
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
6220
+ id: item.stopLoss.id !== undefined ? {
6221
+ equals: item.stopLoss.id
6222
+ } : undefined,
6223
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
5472
6224
  },
5473
6225
  create: {
5474
6226
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -5484,7 +6236,10 @@ export const Asset = {
5484
6236
  }
5485
6237
  : { connectOrCreate: {
5486
6238
  where: {
5487
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
6239
+ id: item.takeProfit.id !== undefined ? {
6240
+ equals: item.takeProfit.id
6241
+ } : undefined,
6242
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
5488
6243
  },
5489
6244
  create: {
5490
6245
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -5500,7 +6255,12 @@ export const Asset = {
5500
6255
  }
5501
6256
  : { connectOrCreate: {
5502
6257
  where: {
5503
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
6258
+ id: item.alpacaAccount.id !== undefined ? {
6259
+ equals: item.alpacaAccount.id
6260
+ } : undefined,
6261
+ userId: item.alpacaAccount.userId !== undefined ? {
6262
+ equals: item.alpacaAccount.userId
6263
+ } : undefined,
5504
6264
  },
5505
6265
  create: {
5506
6266
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -5520,7 +6280,9 @@ export const Asset = {
5520
6280
  }
5521
6281
  : { connectOrCreate: {
5522
6282
  where: {
5523
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
6283
+ id: item.alpacaAccount.user.id !== undefined ? {
6284
+ equals: item.alpacaAccount.user.id
6285
+ } : undefined,
5524
6286
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
5525
6287
  name: item.alpacaAccount.user.name !== undefined ? {
5526
6288
  equals: item.alpacaAccount.user.name
@@ -5549,7 +6311,15 @@ export const Asset = {
5549
6311
  }
5550
6312
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5551
6313
  where: {
5552
- id: item.id !== undefined ? item.id : undefined,
6314
+ id: item.id !== undefined ? {
6315
+ equals: item.id
6316
+ } : undefined,
6317
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6318
+ equals: item.alpacaAccountId
6319
+ } : undefined,
6320
+ assetId: item.assetId !== undefined ? {
6321
+ equals: item.assetId
6322
+ } : undefined,
5553
6323
  },
5554
6324
  create: {
5555
6325
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5574,7 +6344,15 @@ export const Asset = {
5574
6344
  }
5575
6345
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5576
6346
  where: {
5577
- id: item.id !== undefined ? item.id : undefined,
6347
+ id: item.id !== undefined ? {
6348
+ equals: item.id
6349
+ } : undefined,
6350
+ assetId: item.assetId !== undefined ? {
6351
+ equals: item.assetId
6352
+ } : undefined,
6353
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6354
+ equals: item.alpacaAccountId
6355
+ } : undefined,
5578
6356
  },
5579
6357
  create: {
5580
6358
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5601,7 +6379,12 @@ export const Asset = {
5601
6379
  }
5602
6380
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5603
6381
  where: {
5604
- id: item.id !== undefined ? item.id : undefined,
6382
+ id: item.id !== undefined ? {
6383
+ equals: item.id
6384
+ } : undefined,
6385
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6386
+ equals: item.alpacaAccountId
6387
+ } : undefined,
5605
6388
  },
5606
6389
  create: {
5607
6390
  message: item.message !== undefined ? item.message : undefined,
@@ -5621,7 +6404,12 @@ export const Asset = {
5621
6404
  }
5622
6405
  : { connectOrCreate: {
5623
6406
  where: {
5624
- id: item.action.id !== undefined ? item.action.id : undefined,
6407
+ id: item.action.id !== undefined ? {
6408
+ equals: item.action.id
6409
+ } : undefined,
6410
+ tradeId: item.action.tradeId !== undefined ? {
6411
+ equals: item.action.tradeId
6412
+ } : undefined,
5625
6413
  },
5626
6414
  create: {
5627
6415
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -5637,7 +6425,15 @@ export const Asset = {
5637
6425
  }
5638
6426
  : { connectOrCreate: {
5639
6427
  where: {
5640
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6428
+ id: item.action.trade.id !== undefined ? {
6429
+ equals: item.action.trade.id
6430
+ } : undefined,
6431
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6432
+ equals: item.action.trade.alpacaAccountId
6433
+ } : undefined,
6434
+ assetId: item.action.trade.assetId !== undefined ? {
6435
+ equals: item.action.trade.assetId
6436
+ } : undefined,
5641
6437
  },
5642
6438
  create: {
5643
6439
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5663,7 +6459,15 @@ export const Asset = {
5663
6459
  positions: prop.positions ? {
5664
6460
  upsert: prop.positions.map((item) => ({
5665
6461
  where: {
5666
- id: item.id !== undefined ? item.id : undefined,
6462
+ id: item.id !== undefined ? {
6463
+ equals: item.id
6464
+ } : undefined,
6465
+ assetId: item.assetId !== undefined ? {
6466
+ equals: item.assetId
6467
+ } : undefined,
6468
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6469
+ equals: item.alpacaAccountId
6470
+ } : undefined,
5667
6471
  },
5668
6472
  update: {
5669
6473
  id: item.id !== undefined ? {
@@ -5714,6 +6518,9 @@ export const Asset = {
5714
6518
  id: item.alpacaAccount.id !== undefined ? {
5715
6519
  equals: item.alpacaAccount.id
5716
6520
  } : undefined,
6521
+ userId: item.alpacaAccount.userId !== undefined ? {
6522
+ equals: item.alpacaAccount.userId
6523
+ } : undefined,
5717
6524
  },
5718
6525
  update: {
5719
6526
  id: item.alpacaAccount.id !== undefined ? {
@@ -5815,7 +6622,15 @@ export const Asset = {
5815
6622
  trades: item.alpacaAccount.trades ? {
5816
6623
  upsert: item.alpacaAccount.trades.map((item) => ({
5817
6624
  where: {
5818
- id: item.id !== undefined ? item.id : undefined,
6625
+ id: item.id !== undefined ? {
6626
+ equals: item.id
6627
+ } : undefined,
6628
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6629
+ equals: item.alpacaAccountId
6630
+ } : undefined,
6631
+ assetId: item.assetId !== undefined ? {
6632
+ equals: item.assetId
6633
+ } : undefined,
5819
6634
  },
5820
6635
  update: {
5821
6636
  id: item.id !== undefined ? {
@@ -5873,7 +6688,18 @@ export const Asset = {
5873
6688
  orders: item.alpacaAccount.orders ? {
5874
6689
  upsert: item.alpacaAccount.orders.map((item) => ({
5875
6690
  where: {
5876
- id: item.id !== undefined ? item.id : undefined,
6691
+ id: item.id !== undefined ? {
6692
+ equals: item.id
6693
+ } : undefined,
6694
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6695
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6696
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6697
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6698
+ equals: item.alpacaAccountId
6699
+ } : undefined,
6700
+ assetId: item.assetId !== undefined ? {
6701
+ equals: item.assetId
6702
+ } : undefined,
5877
6703
  },
5878
6704
  update: {
5879
6705
  id: item.id !== undefined ? {
@@ -5975,7 +6801,12 @@ export const Asset = {
5975
6801
  alerts: item.alpacaAccount.alerts ? {
5976
6802
  upsert: item.alpacaAccount.alerts.map((item) => ({
5977
6803
  where: {
5978
- id: item.id !== undefined ? item.id : undefined,
6804
+ id: item.id !== undefined ? {
6805
+ equals: item.id
6806
+ } : undefined,
6807
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6808
+ equals: item.alpacaAccountId
6809
+ } : undefined,
5979
6810
  },
5980
6811
  update: {
5981
6812
  id: item.id !== undefined ? {
@@ -6017,7 +6848,9 @@ export const Asset = {
6017
6848
  }
6018
6849
  : { connectOrCreate: {
6019
6850
  where: {
6020
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
6851
+ id: item.alpacaAccount.user.id !== undefined ? {
6852
+ equals: item.alpacaAccount.user.id
6853
+ } : undefined,
6021
6854
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
6022
6855
  name: item.alpacaAccount.user.name !== undefined ? {
6023
6856
  equals: item.alpacaAccount.user.name
@@ -6046,7 +6879,15 @@ export const Asset = {
6046
6879
  }
6047
6880
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6048
6881
  where: {
6049
- id: item.id !== undefined ? item.id : undefined,
6882
+ id: item.id !== undefined ? {
6883
+ equals: item.id
6884
+ } : undefined,
6885
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6886
+ equals: item.alpacaAccountId
6887
+ } : undefined,
6888
+ assetId: item.assetId !== undefined ? {
6889
+ equals: item.assetId
6890
+ } : undefined,
6050
6891
  },
6051
6892
  create: {
6052
6893
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6071,7 +6912,18 @@ export const Asset = {
6071
6912
  }
6072
6913
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6073
6914
  where: {
6074
- id: item.id !== undefined ? item.id : undefined,
6915
+ id: item.id !== undefined ? {
6916
+ equals: item.id
6917
+ } : undefined,
6918
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6919
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6920
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6921
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6922
+ equals: item.alpacaAccountId
6923
+ } : undefined,
6924
+ assetId: item.assetId !== undefined ? {
6925
+ equals: item.assetId
6926
+ } : undefined,
6075
6927
  },
6076
6928
  create: {
6077
6929
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6107,7 +6959,12 @@ export const Asset = {
6107
6959
  }
6108
6960
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6109
6961
  where: {
6110
- id: item.id !== undefined ? item.id : undefined,
6962
+ id: item.id !== undefined ? {
6963
+ equals: item.id
6964
+ } : undefined,
6965
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6966
+ equals: item.alpacaAccountId
6967
+ } : undefined,
6111
6968
  },
6112
6969
  create: {
6113
6970
  message: item.message !== undefined ? item.message : undefined,
@@ -6142,7 +6999,12 @@ export const Asset = {
6142
6999
  }
6143
7000
  : { connectOrCreate: {
6144
7001
  where: {
6145
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
7002
+ id: item.alpacaAccount.id !== undefined ? {
7003
+ equals: item.alpacaAccount.id
7004
+ } : undefined,
7005
+ userId: item.alpacaAccount.userId !== undefined ? {
7006
+ equals: item.alpacaAccount.userId
7007
+ } : undefined,
6146
7008
  },
6147
7009
  create: {
6148
7010
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -6162,7 +7024,9 @@ export const Asset = {
6162
7024
  }
6163
7025
  : { connectOrCreate: {
6164
7026
  where: {
6165
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
7027
+ id: item.alpacaAccount.user.id !== undefined ? {
7028
+ equals: item.alpacaAccount.user.id
7029
+ } : undefined,
6166
7030
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
6167
7031
  name: item.alpacaAccount.user.name !== undefined ? {
6168
7032
  equals: item.alpacaAccount.user.name
@@ -6191,7 +7055,15 @@ export const Asset = {
6191
7055
  }
6192
7056
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6193
7057
  where: {
6194
- id: item.id !== undefined ? item.id : undefined,
7058
+ id: item.id !== undefined ? {
7059
+ equals: item.id
7060
+ } : undefined,
7061
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7062
+ equals: item.alpacaAccountId
7063
+ } : undefined,
7064
+ assetId: item.assetId !== undefined ? {
7065
+ equals: item.assetId
7066
+ } : undefined,
6195
7067
  },
6196
7068
  create: {
6197
7069
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6216,7 +7088,18 @@ export const Asset = {
6216
7088
  }
6217
7089
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6218
7090
  where: {
6219
- id: item.id !== undefined ? item.id : undefined,
7091
+ id: item.id !== undefined ? {
7092
+ equals: item.id
7093
+ } : undefined,
7094
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
7095
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
7096
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
7097
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7098
+ equals: item.alpacaAccountId
7099
+ } : undefined,
7100
+ assetId: item.assetId !== undefined ? {
7101
+ equals: item.assetId
7102
+ } : undefined,
6220
7103
  },
6221
7104
  create: {
6222
7105
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6252,7 +7135,12 @@ export const Asset = {
6252
7135
  }
6253
7136
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6254
7137
  where: {
6255
- id: item.id !== undefined ? item.id : undefined,
7138
+ id: item.id !== undefined ? {
7139
+ equals: item.id
7140
+ } : undefined,
7141
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7142
+ equals: item.alpacaAccountId
7143
+ } : undefined,
6256
7144
  },
6257
7145
  create: {
6258
7146
  message: item.message !== undefined ? item.message : undefined,
@@ -6270,8 +7158,16 @@ export const Asset = {
6270
7158
  newsMentions: prop.newsMentions ? {
6271
7159
  upsert: prop.newsMentions.map((item) => ({
6272
7160
  where: {
6273
- id: item.id !== undefined ? item.id : undefined,
7161
+ id: item.id !== undefined ? {
7162
+ equals: item.id
7163
+ } : undefined,
6274
7164
  url: item.url !== undefined ? item.url : undefined,
7165
+ assetId: item.assetId !== undefined ? {
7166
+ equals: item.assetId
7167
+ } : undefined,
7168
+ newsArticleId: item.newsArticleId !== undefined ? {
7169
+ equals: item.newsArticleId
7170
+ } : undefined,
6275
7171
  },
6276
7172
  update: {
6277
7173
  id: item.id !== undefined ? {
@@ -6377,7 +7273,9 @@ export const Asset = {
6377
7273
  }
6378
7274
  : { connectOrCreate: {
6379
7275
  where: {
6380
- id: item.news.id !== undefined ? item.news.id : undefined,
7276
+ id: item.news.id !== undefined ? {
7277
+ equals: item.news.id
7278
+ } : undefined,
6381
7279
  url: item.news.url !== undefined ? item.news.url : undefined,
6382
7280
  title: item.news.title !== undefined ? {
6383
7281
  equals: item.news.title
@@ -6472,7 +7370,9 @@ export const Asset = {
6472
7370
  }`;
6473
7371
  const variables = {
6474
7372
  where: {
6475
- id: props.id !== undefined ? props.id : undefined,
7373
+ id: props.id !== undefined ? {
7374
+ equals: props.id
7375
+ } : undefined,
6476
7376
  symbol: props.symbol !== undefined ? props.symbol : undefined,
6477
7377
  name: props.name !== undefined ? props.name : undefined,
6478
7378
  type: props.type !== undefined ? props.type : undefined,