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
@@ -551,7 +551,9 @@ export const AlpacaAccount = {
551
551
  }
552
552
  : { connectOrCreate: {
553
553
  where: {
554
- id: props.user.id !== undefined ? props.user.id : undefined,
554
+ id: props.user.id !== undefined ? {
555
+ equals: props.user.id
556
+ } : undefined,
555
557
  email: props.user.email !== undefined ? props.user.email : undefined,
556
558
  name: props.user.name !== undefined ? {
557
559
  equals: props.user.name
@@ -577,10 +579,20 @@ export const AlpacaAccount = {
577
579
  }
578
580
  : { connectOrCreate: {
579
581
  where: {
580
- id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
582
+ id: props.user.customer.id !== undefined ? {
583
+ equals: props.user.customer.id
584
+ } : undefined,
585
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
586
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
587
+ authUserId: props.user.customer.authUserId !== undefined ? {
588
+ equals: props.user.customer.authUserId
589
+ } : undefined,
581
590
  name: props.user.customer.name !== undefined ? {
582
591
  equals: props.user.customer.name
583
592
  } : undefined,
593
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? {
594
+ equals: props.user.customer.stripePriceId
595
+ } : undefined,
584
596
  },
585
597
  create: {
586
598
  authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
@@ -601,7 +613,15 @@ export const AlpacaAccount = {
601
613
  }
602
614
  : { connectOrCreate: props.user.accounts.map((item) => ({
603
615
  where: {
604
- id: item.id !== undefined ? item.id : undefined,
616
+ id: item.id !== undefined ? {
617
+ equals: item.id
618
+ } : undefined,
619
+ userId: item.userId !== undefined ? {
620
+ equals: item.userId
621
+ } : undefined,
622
+ providerAccountId: item.providerAccountId !== undefined ? {
623
+ equals: item.providerAccountId
624
+ } : undefined,
605
625
  },
606
626
  create: {
607
627
  type: item.type !== undefined ? item.type : undefined,
@@ -625,7 +645,12 @@ export const AlpacaAccount = {
625
645
  }
626
646
  : { connectOrCreate: props.user.sessions.map((item) => ({
627
647
  where: {
628
- id: item.id !== undefined ? item.id : undefined,
648
+ id: item.id !== undefined ? {
649
+ equals: item.id
650
+ } : undefined,
651
+ userId: item.userId !== undefined ? {
652
+ equals: item.userId
653
+ } : undefined,
629
654
  },
630
655
  create: {
631
656
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -641,7 +666,12 @@ export const AlpacaAccount = {
641
666
  }
642
667
  : { connectOrCreate: props.user.authenticators.map((item) => ({
643
668
  where: {
644
- id: item.id !== undefined ? item.id : undefined,
669
+ id: item.id !== undefined ? {
670
+ equals: item.id
671
+ } : undefined,
672
+ userId: item.userId !== undefined ? {
673
+ equals: item.userId
674
+ } : undefined,
645
675
  },
646
676
  create: {
647
677
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -661,7 +691,15 @@ export const AlpacaAccount = {
661
691
  }
662
692
  : { connectOrCreate: props.trades.map((item) => ({
663
693
  where: {
664
- id: item.id !== undefined ? item.id : undefined,
694
+ id: item.id !== undefined ? {
695
+ equals: item.id
696
+ } : undefined,
697
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
698
+ equals: item.alpacaAccountId
699
+ } : undefined,
700
+ assetId: item.assetId !== undefined ? {
701
+ equals: item.assetId
702
+ } : undefined,
665
703
  },
666
704
  create: {
667
705
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -683,7 +721,9 @@ export const AlpacaAccount = {
683
721
  }
684
722
  : { connectOrCreate: {
685
723
  where: {
686
- id: item.asset.id !== undefined ? item.asset.id : undefined,
724
+ id: item.asset.id !== undefined ? {
725
+ equals: item.asset.id
726
+ } : undefined,
687
727
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
688
728
  name: item.asset.name !== undefined ? item.asset.name : undefined,
689
729
  },
@@ -751,7 +791,18 @@ export const AlpacaAccount = {
751
791
  }
752
792
  : { connectOrCreate: item.asset.orders.map((item) => ({
753
793
  where: {
754
- id: item.id !== undefined ? item.id : undefined,
794
+ id: item.id !== undefined ? {
795
+ equals: item.id
796
+ } : undefined,
797
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
798
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
799
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
800
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
801
+ equals: item.alpacaAccountId
802
+ } : undefined,
803
+ assetId: item.assetId !== undefined ? {
804
+ equals: item.assetId
805
+ } : undefined,
755
806
  },
756
807
  create: {
757
808
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -787,7 +838,15 @@ export const AlpacaAccount = {
787
838
  }
788
839
  : { connectOrCreate: item.asset.positions.map((item) => ({
789
840
  where: {
790
- id: item.id !== undefined ? item.id : undefined,
841
+ id: item.id !== undefined ? {
842
+ equals: item.id
843
+ } : undefined,
844
+ assetId: item.assetId !== undefined ? {
845
+ equals: item.assetId
846
+ } : undefined,
847
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
848
+ equals: item.alpacaAccountId
849
+ } : undefined,
791
850
  },
792
851
  create: {
793
852
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -814,8 +873,16 @@ export const AlpacaAccount = {
814
873
  }
815
874
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
816
875
  where: {
817
- id: item.id !== undefined ? item.id : undefined,
876
+ id: item.id !== undefined ? {
877
+ equals: item.id
878
+ } : undefined,
818
879
  url: item.url !== undefined ? item.url : undefined,
880
+ assetId: item.assetId !== undefined ? {
881
+ equals: item.assetId
882
+ } : undefined,
883
+ newsArticleId: item.newsArticleId !== undefined ? {
884
+ equals: item.newsArticleId
885
+ } : undefined,
819
886
  },
820
887
  create: {
821
888
  url: item.url !== undefined ? item.url : undefined,
@@ -836,7 +903,12 @@ export const AlpacaAccount = {
836
903
  }
837
904
  : { connectOrCreate: item.actions.map((item) => ({
838
905
  where: {
839
- id: item.id !== undefined ? item.id : undefined,
906
+ id: item.id !== undefined ? {
907
+ equals: item.id
908
+ } : undefined,
909
+ tradeId: item.tradeId !== undefined ? {
910
+ equals: item.tradeId
911
+ } : undefined,
840
912
  },
841
913
  create: {
842
914
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -852,7 +924,18 @@ export const AlpacaAccount = {
852
924
  }
853
925
  : { connectOrCreate: {
854
926
  where: {
855
- id: item.order.id !== undefined ? item.order.id : undefined,
927
+ id: item.order.id !== undefined ? {
928
+ equals: item.order.id
929
+ } : undefined,
930
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
931
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
932
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
933
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
934
+ equals: item.order.alpacaAccountId
935
+ } : undefined,
936
+ assetId: item.order.assetId !== undefined ? {
937
+ equals: item.order.assetId
938
+ } : undefined,
856
939
  },
857
940
  create: {
858
941
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -894,7 +977,18 @@ export const AlpacaAccount = {
894
977
  }
895
978
  : { connectOrCreate: props.orders.map((item) => ({
896
979
  where: {
897
- id: item.id !== undefined ? item.id : undefined,
980
+ id: item.id !== undefined ? {
981
+ equals: item.id
982
+ } : undefined,
983
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
984
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
985
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
986
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
987
+ equals: item.alpacaAccountId
988
+ } : undefined,
989
+ assetId: item.assetId !== undefined ? {
990
+ equals: item.assetId
991
+ } : undefined,
898
992
  },
899
993
  create: {
900
994
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -927,7 +1021,10 @@ export const AlpacaAccount = {
927
1021
  }
928
1022
  : { connectOrCreate: {
929
1023
  where: {
930
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1024
+ id: item.stopLoss.id !== undefined ? {
1025
+ equals: item.stopLoss.id
1026
+ } : undefined,
1027
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
931
1028
  },
932
1029
  create: {
933
1030
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -943,7 +1040,10 @@ export const AlpacaAccount = {
943
1040
  }
944
1041
  : { connectOrCreate: {
945
1042
  where: {
946
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1043
+ id: item.takeProfit.id !== undefined ? {
1044
+ equals: item.takeProfit.id
1045
+ } : undefined,
1046
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
947
1047
  },
948
1048
  create: {
949
1049
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -959,7 +1059,12 @@ export const AlpacaAccount = {
959
1059
  }
960
1060
  : { connectOrCreate: {
961
1061
  where: {
962
- id: item.action.id !== undefined ? item.action.id : undefined,
1062
+ id: item.action.id !== undefined ? {
1063
+ equals: item.action.id
1064
+ } : undefined,
1065
+ tradeId: item.action.tradeId !== undefined ? {
1066
+ equals: item.action.tradeId
1067
+ } : undefined,
963
1068
  },
964
1069
  create: {
965
1070
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -975,7 +1080,15 @@ export const AlpacaAccount = {
975
1080
  }
976
1081
  : { connectOrCreate: {
977
1082
  where: {
978
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
1083
+ id: item.action.trade.id !== undefined ? {
1084
+ equals: item.action.trade.id
1085
+ } : undefined,
1086
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
1087
+ equals: item.action.trade.alpacaAccountId
1088
+ } : undefined,
1089
+ assetId: item.action.trade.assetId !== undefined ? {
1090
+ equals: item.action.trade.assetId
1091
+ } : undefined,
979
1092
  },
980
1093
  create: {
981
1094
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -1003,7 +1116,9 @@ export const AlpacaAccount = {
1003
1116
  }
1004
1117
  : { connectOrCreate: {
1005
1118
  where: {
1006
- id: item.asset.id !== undefined ? item.asset.id : undefined,
1119
+ id: item.asset.id !== undefined ? {
1120
+ equals: item.asset.id
1121
+ } : undefined,
1007
1122
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1008
1123
  name: item.asset.name !== undefined ? item.asset.name : undefined,
1009
1124
  },
@@ -1071,7 +1186,15 @@ export const AlpacaAccount = {
1071
1186
  }
1072
1187
  : { connectOrCreate: item.asset.trades.map((item) => ({
1073
1188
  where: {
1074
- id: item.id !== undefined ? item.id : undefined,
1189
+ id: item.id !== undefined ? {
1190
+ equals: item.id
1191
+ } : undefined,
1192
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1193
+ equals: item.alpacaAccountId
1194
+ } : undefined,
1195
+ assetId: item.assetId !== undefined ? {
1196
+ equals: item.assetId
1197
+ } : undefined,
1075
1198
  },
1076
1199
  create: {
1077
1200
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -1096,7 +1219,15 @@ export const AlpacaAccount = {
1096
1219
  }
1097
1220
  : { connectOrCreate: item.asset.positions.map((item) => ({
1098
1221
  where: {
1099
- id: item.id !== undefined ? item.id : undefined,
1222
+ id: item.id !== undefined ? {
1223
+ equals: item.id
1224
+ } : undefined,
1225
+ assetId: item.assetId !== undefined ? {
1226
+ equals: item.assetId
1227
+ } : undefined,
1228
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1229
+ equals: item.alpacaAccountId
1230
+ } : undefined,
1100
1231
  },
1101
1232
  create: {
1102
1233
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1123,8 +1254,16 @@ export const AlpacaAccount = {
1123
1254
  }
1124
1255
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
1125
1256
  where: {
1126
- id: item.id !== undefined ? item.id : undefined,
1257
+ id: item.id !== undefined ? {
1258
+ equals: item.id
1259
+ } : undefined,
1127
1260
  url: item.url !== undefined ? item.url : undefined,
1261
+ assetId: item.assetId !== undefined ? {
1262
+ equals: item.assetId
1263
+ } : undefined,
1264
+ newsArticleId: item.newsArticleId !== undefined ? {
1265
+ equals: item.newsArticleId
1266
+ } : undefined,
1128
1267
  },
1129
1268
  create: {
1130
1269
  url: item.url !== undefined ? item.url : undefined,
@@ -1148,7 +1287,15 @@ export const AlpacaAccount = {
1148
1287
  }
1149
1288
  : { connectOrCreate: props.positions.map((item) => ({
1150
1289
  where: {
1151
- id: item.id !== undefined ? item.id : undefined,
1290
+ id: item.id !== undefined ? {
1291
+ equals: item.id
1292
+ } : undefined,
1293
+ assetId: item.assetId !== undefined ? {
1294
+ equals: item.assetId
1295
+ } : undefined,
1296
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1297
+ equals: item.alpacaAccountId
1298
+ } : undefined,
1152
1299
  },
1153
1300
  create: {
1154
1301
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1172,7 +1319,9 @@ export const AlpacaAccount = {
1172
1319
  }
1173
1320
  : { connectOrCreate: {
1174
1321
  where: {
1175
- id: item.asset.id !== undefined ? item.asset.id : undefined,
1322
+ id: item.asset.id !== undefined ? {
1323
+ equals: item.asset.id
1324
+ } : undefined,
1176
1325
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
1177
1326
  name: item.asset.name !== undefined ? item.asset.name : undefined,
1178
1327
  },
@@ -1240,7 +1389,15 @@ export const AlpacaAccount = {
1240
1389
  }
1241
1390
  : { connectOrCreate: item.asset.trades.map((item) => ({
1242
1391
  where: {
1243
- id: item.id !== undefined ? item.id : undefined,
1392
+ id: item.id !== undefined ? {
1393
+ equals: item.id
1394
+ } : undefined,
1395
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1396
+ equals: item.alpacaAccountId
1397
+ } : undefined,
1398
+ assetId: item.assetId !== undefined ? {
1399
+ equals: item.assetId
1400
+ } : undefined,
1244
1401
  },
1245
1402
  create: {
1246
1403
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -1265,7 +1422,18 @@ export const AlpacaAccount = {
1265
1422
  }
1266
1423
  : { connectOrCreate: item.asset.orders.map((item) => ({
1267
1424
  where: {
1268
- id: item.id !== undefined ? item.id : undefined,
1425
+ id: item.id !== undefined ? {
1426
+ equals: item.id
1427
+ } : undefined,
1428
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1429
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1430
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1431
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1432
+ equals: item.alpacaAccountId
1433
+ } : undefined,
1434
+ assetId: item.assetId !== undefined ? {
1435
+ equals: item.assetId
1436
+ } : undefined,
1269
1437
  },
1270
1438
  create: {
1271
1439
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1301,8 +1469,16 @@ export const AlpacaAccount = {
1301
1469
  }
1302
1470
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
1303
1471
  where: {
1304
- id: item.id !== undefined ? item.id : undefined,
1472
+ id: item.id !== undefined ? {
1473
+ equals: item.id
1474
+ } : undefined,
1305
1475
  url: item.url !== undefined ? item.url : undefined,
1476
+ assetId: item.assetId !== undefined ? {
1477
+ equals: item.assetId
1478
+ } : undefined,
1479
+ newsArticleId: item.newsArticleId !== undefined ? {
1480
+ equals: item.newsArticleId
1481
+ } : undefined,
1306
1482
  },
1307
1483
  create: {
1308
1484
  url: item.url !== undefined ? item.url : undefined,
@@ -1326,7 +1502,12 @@ export const AlpacaAccount = {
1326
1502
  }
1327
1503
  : { connectOrCreate: props.alerts.map((item) => ({
1328
1504
  where: {
1329
- id: item.id !== undefined ? item.id : undefined,
1505
+ id: item.id !== undefined ? {
1506
+ equals: item.id
1507
+ } : undefined,
1508
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1509
+ equals: item.alpacaAccountId
1510
+ } : undefined,
1330
1511
  },
1331
1512
  create: {
1332
1513
  message: item.message !== undefined ? item.message : undefined,
@@ -1413,7 +1594,9 @@ export const AlpacaAccount = {
1413
1594
  }`;
1414
1595
  const variables = {
1415
1596
  where: {
1416
- id: props.id !== undefined ? props.id : undefined,
1597
+ id: props.id !== undefined ? {
1598
+ equals: props.id
1599
+ } : undefined,
1417
1600
  type: props.type !== undefined ? props.type : undefined,
1418
1601
  APIKey: props.APIKey !== undefined ? props.APIKey : undefined,
1419
1602
  APISecret: props.APISecret !== undefined ? props.APISecret : undefined,
@@ -1422,7 +1605,9 @@ export const AlpacaAccount = {
1422
1605
  maxOrderSize: props.maxOrderSize !== undefined ? props.maxOrderSize : undefined,
1423
1606
  minPercentageChange: props.minPercentageChange !== undefined ? props.minPercentageChange : undefined,
1424
1607
  volumeThreshold: props.volumeThreshold !== undefined ? props.volumeThreshold : undefined,
1425
- userId: props.userId !== undefined ? props.userId : undefined,
1608
+ userId: props.userId !== undefined ? {
1609
+ equals: props.userId
1610
+ } : undefined,
1426
1611
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
1427
1612
  updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
1428
1613
  },
@@ -1519,9 +1704,21 @@ export const AlpacaAccount = {
1519
1704
  id: props.user.customer.id !== undefined ? {
1520
1705
  equals: props.user.customer.id
1521
1706
  } : undefined,
1707
+ authUserId: props.user.customer.authUserId !== undefined ? {
1708
+ equals: props.user.customer.authUserId
1709
+ } : undefined,
1522
1710
  name: props.user.customer.name !== undefined ? {
1523
1711
  equals: props.user.customer.name
1524
1712
  } : undefined,
1713
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? {
1714
+ equals: props.user.customer.stripeCustomerId
1715
+ } : undefined,
1716
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? {
1717
+ equals: props.user.customer.stripeSubscriptionId
1718
+ } : undefined,
1719
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? {
1720
+ equals: props.user.customer.stripePriceId
1721
+ } : undefined,
1525
1722
  },
1526
1723
  update: {
1527
1724
  authUserId: props.user.customer.authUserId !== undefined ? {
@@ -1560,7 +1757,15 @@ export const AlpacaAccount = {
1560
1757
  accounts: props.user.accounts ? {
1561
1758
  upsert: props.user.accounts.map((item) => ({
1562
1759
  where: {
1563
- id: item.id !== undefined ? item.id : undefined,
1760
+ id: item.id !== undefined ? {
1761
+ equals: item.id
1762
+ } : undefined,
1763
+ userId: item.userId !== undefined ? {
1764
+ equals: item.userId
1765
+ } : undefined,
1766
+ providerAccountId: item.providerAccountId !== undefined ? {
1767
+ equals: item.providerAccountId
1768
+ } : undefined,
1564
1769
  },
1565
1770
  update: {
1566
1771
  id: item.id !== undefined ? {
@@ -1614,7 +1819,12 @@ export const AlpacaAccount = {
1614
1819
  sessions: props.user.sessions ? {
1615
1820
  upsert: props.user.sessions.map((item) => ({
1616
1821
  where: {
1617
- id: item.id !== undefined ? item.id : undefined,
1822
+ id: item.id !== undefined ? {
1823
+ equals: item.id
1824
+ } : undefined,
1825
+ userId: item.userId !== undefined ? {
1826
+ equals: item.userId
1827
+ } : undefined,
1618
1828
  },
1619
1829
  update: {
1620
1830
  id: item.id !== undefined ? {
@@ -1636,7 +1846,12 @@ export const AlpacaAccount = {
1636
1846
  authenticators: props.user.authenticators ? {
1637
1847
  upsert: props.user.authenticators.map((item) => ({
1638
1848
  where: {
1639
- id: item.id !== undefined ? item.id : undefined,
1849
+ id: item.id !== undefined ? {
1850
+ equals: item.id
1851
+ } : undefined,
1852
+ userId: item.userId !== undefined ? {
1853
+ equals: item.userId
1854
+ } : undefined,
1640
1855
  },
1641
1856
  update: {
1642
1857
  id: item.id !== undefined ? {
@@ -1680,10 +1895,20 @@ export const AlpacaAccount = {
1680
1895
  }
1681
1896
  : { connectOrCreate: {
1682
1897
  where: {
1683
- id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
1898
+ id: props.user.customer.id !== undefined ? {
1899
+ equals: props.user.customer.id
1900
+ } : undefined,
1901
+ stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
1902
+ stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
1903
+ authUserId: props.user.customer.authUserId !== undefined ? {
1904
+ equals: props.user.customer.authUserId
1905
+ } : undefined,
1684
1906
  name: props.user.customer.name !== undefined ? {
1685
1907
  equals: props.user.customer.name
1686
1908
  } : undefined,
1909
+ stripePriceId: props.user.customer.stripePriceId !== undefined ? {
1910
+ equals: props.user.customer.stripePriceId
1911
+ } : undefined,
1687
1912
  },
1688
1913
  create: {
1689
1914
  authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
@@ -1704,7 +1929,15 @@ export const AlpacaAccount = {
1704
1929
  }
1705
1930
  : { connectOrCreate: props.user.accounts.map((item) => ({
1706
1931
  where: {
1707
- id: item.id !== undefined ? item.id : undefined,
1932
+ id: item.id !== undefined ? {
1933
+ equals: item.id
1934
+ } : undefined,
1935
+ userId: item.userId !== undefined ? {
1936
+ equals: item.userId
1937
+ } : undefined,
1938
+ providerAccountId: item.providerAccountId !== undefined ? {
1939
+ equals: item.providerAccountId
1940
+ } : undefined,
1708
1941
  },
1709
1942
  create: {
1710
1943
  type: item.type !== undefined ? item.type : undefined,
@@ -1728,7 +1961,12 @@ export const AlpacaAccount = {
1728
1961
  }
1729
1962
  : { connectOrCreate: props.user.sessions.map((item) => ({
1730
1963
  where: {
1731
- id: item.id !== undefined ? item.id : undefined,
1964
+ id: item.id !== undefined ? {
1965
+ equals: item.id
1966
+ } : undefined,
1967
+ userId: item.userId !== undefined ? {
1968
+ equals: item.userId
1969
+ } : undefined,
1732
1970
  },
1733
1971
  create: {
1734
1972
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -1744,7 +1982,12 @@ export const AlpacaAccount = {
1744
1982
  }
1745
1983
  : { connectOrCreate: props.user.authenticators.map((item) => ({
1746
1984
  where: {
1747
- id: item.id !== undefined ? item.id : undefined,
1985
+ id: item.id !== undefined ? {
1986
+ equals: item.id
1987
+ } : undefined,
1988
+ userId: item.userId !== undefined ? {
1989
+ equals: item.userId
1990
+ } : undefined,
1748
1991
  },
1749
1992
  create: {
1750
1993
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -1759,7 +2002,15 @@ export const AlpacaAccount = {
1759
2002
  trades: props.trades ? {
1760
2003
  upsert: props.trades.map((item) => ({
1761
2004
  where: {
1762
- id: item.id !== undefined ? item.id : undefined,
2005
+ id: item.id !== undefined ? {
2006
+ equals: item.id
2007
+ } : undefined,
2008
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2009
+ equals: item.alpacaAccountId
2010
+ } : undefined,
2011
+ assetId: item.assetId !== undefined ? {
2012
+ equals: item.assetId
2013
+ } : undefined,
1763
2014
  },
1764
2015
  update: {
1765
2016
  id: item.id !== undefined ? {
@@ -1983,7 +2234,18 @@ export const AlpacaAccount = {
1983
2234
  orders: item.asset.orders ? {
1984
2235
  upsert: item.asset.orders.map((item) => ({
1985
2236
  where: {
1986
- id: item.id !== undefined ? item.id : undefined,
2237
+ id: item.id !== undefined ? {
2238
+ equals: item.id
2239
+ } : undefined,
2240
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2241
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2242
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2243
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2244
+ equals: item.alpacaAccountId
2245
+ } : undefined,
2246
+ assetId: item.assetId !== undefined ? {
2247
+ equals: item.assetId
2248
+ } : undefined,
1987
2249
  },
1988
2250
  update: {
1989
2251
  id: item.id !== undefined ? {
@@ -2085,7 +2347,15 @@ export const AlpacaAccount = {
2085
2347
  positions: item.asset.positions ? {
2086
2348
  upsert: item.asset.positions.map((item) => ({
2087
2349
  where: {
2088
- id: item.id !== undefined ? item.id : undefined,
2350
+ id: item.id !== undefined ? {
2351
+ equals: item.id
2352
+ } : undefined,
2353
+ assetId: item.assetId !== undefined ? {
2354
+ equals: item.assetId
2355
+ } : undefined,
2356
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2357
+ equals: item.alpacaAccountId
2358
+ } : undefined,
2089
2359
  },
2090
2360
  update: {
2091
2361
  id: item.id !== undefined ? {
@@ -2151,8 +2421,16 @@ export const AlpacaAccount = {
2151
2421
  newsMentions: item.asset.newsMentions ? {
2152
2422
  upsert: item.asset.newsMentions.map((item) => ({
2153
2423
  where: {
2154
- id: item.id !== undefined ? item.id : undefined,
2424
+ id: item.id !== undefined ? {
2425
+ equals: item.id
2426
+ } : undefined,
2155
2427
  url: item.url !== undefined ? item.url : undefined,
2428
+ assetId: item.assetId !== undefined ? {
2429
+ equals: item.assetId
2430
+ } : undefined,
2431
+ newsArticleId: item.newsArticleId !== undefined ? {
2432
+ equals: item.newsArticleId
2433
+ } : undefined,
2156
2434
  },
2157
2435
  update: {
2158
2436
  id: item.id !== undefined ? {
@@ -2244,7 +2522,18 @@ export const AlpacaAccount = {
2244
2522
  }
2245
2523
  : { connectOrCreate: item.asset.orders.map((item) => ({
2246
2524
  where: {
2247
- id: item.id !== undefined ? item.id : undefined,
2525
+ id: item.id !== undefined ? {
2526
+ equals: item.id
2527
+ } : undefined,
2528
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2529
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2530
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2531
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2532
+ equals: item.alpacaAccountId
2533
+ } : undefined,
2534
+ assetId: item.assetId !== undefined ? {
2535
+ equals: item.assetId
2536
+ } : undefined,
2248
2537
  },
2249
2538
  create: {
2250
2539
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2280,7 +2569,15 @@ export const AlpacaAccount = {
2280
2569
  }
2281
2570
  : { connectOrCreate: item.asset.positions.map((item) => ({
2282
2571
  where: {
2283
- id: item.id !== undefined ? item.id : undefined,
2572
+ id: item.id !== undefined ? {
2573
+ equals: item.id
2574
+ } : undefined,
2575
+ assetId: item.assetId !== undefined ? {
2576
+ equals: item.assetId
2577
+ } : undefined,
2578
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2579
+ equals: item.alpacaAccountId
2580
+ } : undefined,
2284
2581
  },
2285
2582
  create: {
2286
2583
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2307,8 +2604,16 @@ export const AlpacaAccount = {
2307
2604
  }
2308
2605
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
2309
2606
  where: {
2310
- id: item.id !== undefined ? item.id : undefined,
2607
+ id: item.id !== undefined ? {
2608
+ equals: item.id
2609
+ } : undefined,
2311
2610
  url: item.url !== undefined ? item.url : undefined,
2611
+ assetId: item.assetId !== undefined ? {
2612
+ equals: item.assetId
2613
+ } : undefined,
2614
+ newsArticleId: item.newsArticleId !== undefined ? {
2615
+ equals: item.newsArticleId
2616
+ } : undefined,
2312
2617
  },
2313
2618
  create: {
2314
2619
  url: item.url !== undefined ? item.url : undefined,
@@ -2324,7 +2629,12 @@ export const AlpacaAccount = {
2324
2629
  actions: item.actions ? {
2325
2630
  upsert: item.actions.map((item) => ({
2326
2631
  where: {
2327
- id: item.id !== undefined ? item.id : undefined,
2632
+ id: item.id !== undefined ? {
2633
+ equals: item.id
2634
+ } : undefined,
2635
+ tradeId: item.tradeId !== undefined ? {
2636
+ equals: item.tradeId
2637
+ } : undefined,
2328
2638
  },
2329
2639
  update: {
2330
2640
  id: item.id !== undefined ? {
@@ -2351,6 +2661,18 @@ export const AlpacaAccount = {
2351
2661
  id: item.order.id !== undefined ? {
2352
2662
  equals: item.order.id
2353
2663
  } : undefined,
2664
+ clientOrderId: item.order.clientOrderId !== undefined ? {
2665
+ equals: item.order.clientOrderId
2666
+ } : undefined,
2667
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2668
+ equals: item.order.alpacaAccountId
2669
+ } : undefined,
2670
+ assetId: item.order.assetId !== undefined ? {
2671
+ equals: item.order.assetId
2672
+ } : undefined,
2673
+ actionId: item.order.actionId !== undefined ? {
2674
+ equals: item.order.actionId
2675
+ } : undefined,
2354
2676
  },
2355
2677
  update: {
2356
2678
  id: item.order.id !== undefined ? {
@@ -2464,7 +2786,18 @@ export const AlpacaAccount = {
2464
2786
  }
2465
2787
  : { connectOrCreate: {
2466
2788
  where: {
2467
- id: item.order.id !== undefined ? item.order.id : undefined,
2789
+ id: item.order.id !== undefined ? {
2790
+ equals: item.order.id
2791
+ } : undefined,
2792
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2793
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2794
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2795
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2796
+ equals: item.order.alpacaAccountId
2797
+ } : undefined,
2798
+ assetId: item.order.assetId !== undefined ? {
2799
+ equals: item.order.assetId
2800
+ } : undefined,
2468
2801
  },
2469
2802
  create: {
2470
2803
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -2516,7 +2849,9 @@ export const AlpacaAccount = {
2516
2849
  }
2517
2850
  : { connectOrCreate: {
2518
2851
  where: {
2519
- id: item.asset.id !== undefined ? item.asset.id : undefined,
2852
+ id: item.asset.id !== undefined ? {
2853
+ equals: item.asset.id
2854
+ } : undefined,
2520
2855
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
2521
2856
  name: item.asset.name !== undefined ? item.asset.name : undefined,
2522
2857
  },
@@ -2584,7 +2919,18 @@ export const AlpacaAccount = {
2584
2919
  }
2585
2920
  : { connectOrCreate: item.asset.orders.map((item) => ({
2586
2921
  where: {
2587
- id: item.id !== undefined ? item.id : undefined,
2922
+ id: item.id !== undefined ? {
2923
+ equals: item.id
2924
+ } : undefined,
2925
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2926
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2927
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2928
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2929
+ equals: item.alpacaAccountId
2930
+ } : undefined,
2931
+ assetId: item.assetId !== undefined ? {
2932
+ equals: item.assetId
2933
+ } : undefined,
2588
2934
  },
2589
2935
  create: {
2590
2936
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2620,7 +2966,15 @@ export const AlpacaAccount = {
2620
2966
  }
2621
2967
  : { connectOrCreate: item.asset.positions.map((item) => ({
2622
2968
  where: {
2623
- id: item.id !== undefined ? item.id : undefined,
2969
+ id: item.id !== undefined ? {
2970
+ equals: item.id
2971
+ } : undefined,
2972
+ assetId: item.assetId !== undefined ? {
2973
+ equals: item.assetId
2974
+ } : undefined,
2975
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2976
+ equals: item.alpacaAccountId
2977
+ } : undefined,
2624
2978
  },
2625
2979
  create: {
2626
2980
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2647,8 +3001,16 @@ export const AlpacaAccount = {
2647
3001
  }
2648
3002
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
2649
3003
  where: {
2650
- id: item.id !== undefined ? item.id : undefined,
3004
+ id: item.id !== undefined ? {
3005
+ equals: item.id
3006
+ } : undefined,
2651
3007
  url: item.url !== undefined ? item.url : undefined,
3008
+ assetId: item.assetId !== undefined ? {
3009
+ equals: item.assetId
3010
+ } : undefined,
3011
+ newsArticleId: item.newsArticleId !== undefined ? {
3012
+ equals: item.newsArticleId
3013
+ } : undefined,
2652
3014
  },
2653
3015
  create: {
2654
3016
  url: item.url !== undefined ? item.url : undefined,
@@ -2669,7 +3031,12 @@ export const AlpacaAccount = {
2669
3031
  }
2670
3032
  : { connectOrCreate: item.actions.map((item) => ({
2671
3033
  where: {
2672
- id: item.id !== undefined ? item.id : undefined,
3034
+ id: item.id !== undefined ? {
3035
+ equals: item.id
3036
+ } : undefined,
3037
+ tradeId: item.tradeId !== undefined ? {
3038
+ equals: item.tradeId
3039
+ } : undefined,
2673
3040
  },
2674
3041
  create: {
2675
3042
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2685,7 +3052,18 @@ export const AlpacaAccount = {
2685
3052
  }
2686
3053
  : { connectOrCreate: {
2687
3054
  where: {
2688
- id: item.order.id !== undefined ? item.order.id : undefined,
3055
+ id: item.order.id !== undefined ? {
3056
+ equals: item.order.id
3057
+ } : undefined,
3058
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
3059
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
3060
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
3061
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
3062
+ equals: item.order.alpacaAccountId
3063
+ } : undefined,
3064
+ assetId: item.order.assetId !== undefined ? {
3065
+ equals: item.order.assetId
3066
+ } : undefined,
2689
3067
  },
2690
3068
  create: {
2691
3069
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -2722,7 +3100,18 @@ export const AlpacaAccount = {
2722
3100
  orders: props.orders ? {
2723
3101
  upsert: props.orders.map((item) => ({
2724
3102
  where: {
2725
- id: item.id !== undefined ? item.id : undefined,
3103
+ id: item.id !== undefined ? {
3104
+ equals: item.id
3105
+ } : undefined,
3106
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3107
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3108
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3109
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3110
+ equals: item.alpacaAccountId
3111
+ } : undefined,
3112
+ assetId: item.assetId !== undefined ? {
3113
+ equals: item.assetId
3114
+ } : undefined,
2726
3115
  },
2727
3116
  update: {
2728
3117
  id: item.id !== undefined ? {
@@ -2800,6 +3189,9 @@ export const AlpacaAccount = {
2800
3189
  id: item.stopLoss.id !== undefined ? {
2801
3190
  equals: item.stopLoss.id
2802
3191
  } : undefined,
3192
+ orderId: item.stopLoss.orderId !== undefined ? {
3193
+ equals: item.stopLoss.orderId
3194
+ } : undefined,
2803
3195
  },
2804
3196
  update: {
2805
3197
  id: item.stopLoss.id !== undefined ? {
@@ -2824,6 +3216,9 @@ export const AlpacaAccount = {
2824
3216
  id: item.takeProfit.id !== undefined ? {
2825
3217
  equals: item.takeProfit.id
2826
3218
  } : undefined,
3219
+ orderId: item.takeProfit.orderId !== undefined ? {
3220
+ equals: item.takeProfit.orderId
3221
+ } : undefined,
2827
3222
  },
2828
3223
  update: {
2829
3224
  id: item.takeProfit.id !== undefined ? {
@@ -2848,6 +3243,9 @@ export const AlpacaAccount = {
2848
3243
  id: item.action.id !== undefined ? {
2849
3244
  equals: item.action.id
2850
3245
  } : undefined,
3246
+ tradeId: item.action.tradeId !== undefined ? {
3247
+ equals: item.action.tradeId
3248
+ } : undefined,
2851
3249
  },
2852
3250
  update: {
2853
3251
  id: item.action.id !== undefined ? {
@@ -2874,6 +3272,12 @@ export const AlpacaAccount = {
2874
3272
  id: item.action.trade.id !== undefined ? {
2875
3273
  equals: item.action.trade.id
2876
3274
  } : undefined,
3275
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3276
+ equals: item.action.trade.alpacaAccountId
3277
+ } : undefined,
3278
+ assetId: item.action.trade.assetId !== undefined ? {
3279
+ equals: item.action.trade.assetId
3280
+ } : undefined,
2877
3281
  },
2878
3282
  update: {
2879
3283
  id: item.action.trade.id !== undefined ? {
@@ -2943,7 +3347,15 @@ export const AlpacaAccount = {
2943
3347
  }
2944
3348
  : { connectOrCreate: {
2945
3349
  where: {
2946
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3350
+ id: item.action.trade.id !== undefined ? {
3351
+ equals: item.action.trade.id
3352
+ } : undefined,
3353
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3354
+ equals: item.action.trade.alpacaAccountId
3355
+ } : undefined,
3356
+ assetId: item.action.trade.assetId !== undefined ? {
3357
+ equals: item.action.trade.assetId
3358
+ } : undefined,
2947
3359
  },
2948
3360
  create: {
2949
3361
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -3148,7 +3560,15 @@ export const AlpacaAccount = {
3148
3560
  trades: item.asset.trades ? {
3149
3561
  upsert: item.asset.trades.map((item) => ({
3150
3562
  where: {
3151
- id: item.id !== undefined ? item.id : undefined,
3563
+ id: item.id !== undefined ? {
3564
+ equals: item.id
3565
+ } : undefined,
3566
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3567
+ equals: item.alpacaAccountId
3568
+ } : undefined,
3569
+ assetId: item.assetId !== undefined ? {
3570
+ equals: item.assetId
3571
+ } : undefined,
3152
3572
  },
3153
3573
  update: {
3154
3574
  id: item.id !== undefined ? {
@@ -3206,7 +3626,15 @@ export const AlpacaAccount = {
3206
3626
  positions: item.asset.positions ? {
3207
3627
  upsert: item.asset.positions.map((item) => ({
3208
3628
  where: {
3209
- id: item.id !== undefined ? item.id : undefined,
3629
+ id: item.id !== undefined ? {
3630
+ equals: item.id
3631
+ } : undefined,
3632
+ assetId: item.assetId !== undefined ? {
3633
+ equals: item.assetId
3634
+ } : undefined,
3635
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3636
+ equals: item.alpacaAccountId
3637
+ } : undefined,
3210
3638
  },
3211
3639
  update: {
3212
3640
  id: item.id !== undefined ? {
@@ -3272,8 +3700,16 @@ export const AlpacaAccount = {
3272
3700
  newsMentions: item.asset.newsMentions ? {
3273
3701
  upsert: item.asset.newsMentions.map((item) => ({
3274
3702
  where: {
3275
- id: item.id !== undefined ? item.id : undefined,
3703
+ id: item.id !== undefined ? {
3704
+ equals: item.id
3705
+ } : undefined,
3276
3706
  url: item.url !== undefined ? item.url : undefined,
3707
+ assetId: item.assetId !== undefined ? {
3708
+ equals: item.assetId
3709
+ } : undefined,
3710
+ newsArticleId: item.newsArticleId !== undefined ? {
3711
+ equals: item.newsArticleId
3712
+ } : undefined,
3277
3713
  },
3278
3714
  update: {
3279
3715
  id: item.id !== undefined ? {
@@ -3365,7 +3801,15 @@ export const AlpacaAccount = {
3365
3801
  }
3366
3802
  : { connectOrCreate: item.asset.trades.map((item) => ({
3367
3803
  where: {
3368
- id: item.id !== undefined ? item.id : undefined,
3804
+ id: item.id !== undefined ? {
3805
+ equals: item.id
3806
+ } : undefined,
3807
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3808
+ equals: item.alpacaAccountId
3809
+ } : undefined,
3810
+ assetId: item.assetId !== undefined ? {
3811
+ equals: item.assetId
3812
+ } : undefined,
3369
3813
  },
3370
3814
  create: {
3371
3815
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3390,7 +3834,15 @@ export const AlpacaAccount = {
3390
3834
  }
3391
3835
  : { connectOrCreate: item.asset.positions.map((item) => ({
3392
3836
  where: {
3393
- id: item.id !== undefined ? item.id : undefined,
3837
+ id: item.id !== undefined ? {
3838
+ equals: item.id
3839
+ } : undefined,
3840
+ assetId: item.assetId !== undefined ? {
3841
+ equals: item.assetId
3842
+ } : undefined,
3843
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3844
+ equals: item.alpacaAccountId
3845
+ } : undefined,
3394
3846
  },
3395
3847
  create: {
3396
3848
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -3417,8 +3869,16 @@ export const AlpacaAccount = {
3417
3869
  }
3418
3870
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
3419
3871
  where: {
3420
- id: item.id !== undefined ? item.id : undefined,
3872
+ id: item.id !== undefined ? {
3873
+ equals: item.id
3874
+ } : undefined,
3421
3875
  url: item.url !== undefined ? item.url : undefined,
3876
+ assetId: item.assetId !== undefined ? {
3877
+ equals: item.assetId
3878
+ } : undefined,
3879
+ newsArticleId: item.newsArticleId !== undefined ? {
3880
+ equals: item.newsArticleId
3881
+ } : undefined,
3422
3882
  },
3423
3883
  create: {
3424
3884
  url: item.url !== undefined ? item.url : undefined,
@@ -3463,7 +3923,10 @@ export const AlpacaAccount = {
3463
3923
  }
3464
3924
  : { connectOrCreate: {
3465
3925
  where: {
3466
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3926
+ id: item.stopLoss.id !== undefined ? {
3927
+ equals: item.stopLoss.id
3928
+ } : undefined,
3929
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
3467
3930
  },
3468
3931
  create: {
3469
3932
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -3479,7 +3942,10 @@ export const AlpacaAccount = {
3479
3942
  }
3480
3943
  : { connectOrCreate: {
3481
3944
  where: {
3482
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3945
+ id: item.takeProfit.id !== undefined ? {
3946
+ equals: item.takeProfit.id
3947
+ } : undefined,
3948
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
3483
3949
  },
3484
3950
  create: {
3485
3951
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -3495,7 +3961,12 @@ export const AlpacaAccount = {
3495
3961
  }
3496
3962
  : { connectOrCreate: {
3497
3963
  where: {
3498
- id: item.action.id !== undefined ? item.action.id : undefined,
3964
+ id: item.action.id !== undefined ? {
3965
+ equals: item.action.id
3966
+ } : undefined,
3967
+ tradeId: item.action.tradeId !== undefined ? {
3968
+ equals: item.action.tradeId
3969
+ } : undefined,
3499
3970
  },
3500
3971
  create: {
3501
3972
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -3511,7 +3982,15 @@ export const AlpacaAccount = {
3511
3982
  }
3512
3983
  : { connectOrCreate: {
3513
3984
  where: {
3514
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3985
+ id: item.action.trade.id !== undefined ? {
3986
+ equals: item.action.trade.id
3987
+ } : undefined,
3988
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3989
+ equals: item.action.trade.alpacaAccountId
3990
+ } : undefined,
3991
+ assetId: item.action.trade.assetId !== undefined ? {
3992
+ equals: item.action.trade.assetId
3993
+ } : undefined,
3515
3994
  },
3516
3995
  create: {
3517
3996
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -3539,7 +4018,9 @@ export const AlpacaAccount = {
3539
4018
  }
3540
4019
  : { connectOrCreate: {
3541
4020
  where: {
3542
- id: item.asset.id !== undefined ? item.asset.id : undefined,
4021
+ id: item.asset.id !== undefined ? {
4022
+ equals: item.asset.id
4023
+ } : undefined,
3543
4024
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
3544
4025
  name: item.asset.name !== undefined ? item.asset.name : undefined,
3545
4026
  },
@@ -3607,7 +4088,15 @@ export const AlpacaAccount = {
3607
4088
  }
3608
4089
  : { connectOrCreate: item.asset.trades.map((item) => ({
3609
4090
  where: {
3610
- id: item.id !== undefined ? item.id : undefined,
4091
+ id: item.id !== undefined ? {
4092
+ equals: item.id
4093
+ } : undefined,
4094
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4095
+ equals: item.alpacaAccountId
4096
+ } : undefined,
4097
+ assetId: item.assetId !== undefined ? {
4098
+ equals: item.assetId
4099
+ } : undefined,
3611
4100
  },
3612
4101
  create: {
3613
4102
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3632,7 +4121,15 @@ export const AlpacaAccount = {
3632
4121
  }
3633
4122
  : { connectOrCreate: item.asset.positions.map((item) => ({
3634
4123
  where: {
3635
- id: item.id !== undefined ? item.id : undefined,
4124
+ id: item.id !== undefined ? {
4125
+ equals: item.id
4126
+ } : undefined,
4127
+ assetId: item.assetId !== undefined ? {
4128
+ equals: item.assetId
4129
+ } : undefined,
4130
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4131
+ equals: item.alpacaAccountId
4132
+ } : undefined,
3636
4133
  },
3637
4134
  create: {
3638
4135
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -3659,8 +4156,16 @@ export const AlpacaAccount = {
3659
4156
  }
3660
4157
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
3661
4158
  where: {
3662
- id: item.id !== undefined ? item.id : undefined,
4159
+ id: item.id !== undefined ? {
4160
+ equals: item.id
4161
+ } : undefined,
3663
4162
  url: item.url !== undefined ? item.url : undefined,
4163
+ assetId: item.assetId !== undefined ? {
4164
+ equals: item.assetId
4165
+ } : undefined,
4166
+ newsArticleId: item.newsArticleId !== undefined ? {
4167
+ equals: item.newsArticleId
4168
+ } : undefined,
3664
4169
  },
3665
4170
  create: {
3666
4171
  url: item.url !== undefined ? item.url : undefined,
@@ -3679,7 +4184,15 @@ export const AlpacaAccount = {
3679
4184
  positions: props.positions ? {
3680
4185
  upsert: props.positions.map((item) => ({
3681
4186
  where: {
3682
- id: item.id !== undefined ? item.id : undefined,
4187
+ id: item.id !== undefined ? {
4188
+ equals: item.id
4189
+ } : undefined,
4190
+ assetId: item.assetId !== undefined ? {
4191
+ equals: item.assetId
4192
+ } : undefined,
4193
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4194
+ equals: item.alpacaAccountId
4195
+ } : undefined,
3683
4196
  },
3684
4197
  update: {
3685
4198
  id: item.id !== undefined ? {
@@ -3909,7 +4422,15 @@ export const AlpacaAccount = {
3909
4422
  trades: item.asset.trades ? {
3910
4423
  upsert: item.asset.trades.map((item) => ({
3911
4424
  where: {
3912
- id: item.id !== undefined ? item.id : undefined,
4425
+ id: item.id !== undefined ? {
4426
+ equals: item.id
4427
+ } : undefined,
4428
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4429
+ equals: item.alpacaAccountId
4430
+ } : undefined,
4431
+ assetId: item.assetId !== undefined ? {
4432
+ equals: item.assetId
4433
+ } : undefined,
3913
4434
  },
3914
4435
  update: {
3915
4436
  id: item.id !== undefined ? {
@@ -3967,7 +4488,18 @@ export const AlpacaAccount = {
3967
4488
  orders: item.asset.orders ? {
3968
4489
  upsert: item.asset.orders.map((item) => ({
3969
4490
  where: {
3970
- id: item.id !== undefined ? item.id : undefined,
4491
+ id: item.id !== undefined ? {
4492
+ equals: item.id
4493
+ } : undefined,
4494
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4495
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4496
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4497
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4498
+ equals: item.alpacaAccountId
4499
+ } : undefined,
4500
+ assetId: item.assetId !== undefined ? {
4501
+ equals: item.assetId
4502
+ } : undefined,
3971
4503
  },
3972
4504
  update: {
3973
4505
  id: item.id !== undefined ? {
@@ -4069,8 +4601,16 @@ export const AlpacaAccount = {
4069
4601
  newsMentions: item.asset.newsMentions ? {
4070
4602
  upsert: item.asset.newsMentions.map((item) => ({
4071
4603
  where: {
4072
- id: item.id !== undefined ? item.id : undefined,
4604
+ id: item.id !== undefined ? {
4605
+ equals: item.id
4606
+ } : undefined,
4073
4607
  url: item.url !== undefined ? item.url : undefined,
4608
+ assetId: item.assetId !== undefined ? {
4609
+ equals: item.assetId
4610
+ } : undefined,
4611
+ newsArticleId: item.newsArticleId !== undefined ? {
4612
+ equals: item.newsArticleId
4613
+ } : undefined,
4074
4614
  },
4075
4615
  update: {
4076
4616
  id: item.id !== undefined ? {
@@ -4162,7 +4702,15 @@ export const AlpacaAccount = {
4162
4702
  }
4163
4703
  : { connectOrCreate: item.asset.trades.map((item) => ({
4164
4704
  where: {
4165
- id: item.id !== undefined ? item.id : undefined,
4705
+ id: item.id !== undefined ? {
4706
+ equals: item.id
4707
+ } : undefined,
4708
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4709
+ equals: item.alpacaAccountId
4710
+ } : undefined,
4711
+ assetId: item.assetId !== undefined ? {
4712
+ equals: item.assetId
4713
+ } : undefined,
4166
4714
  },
4167
4715
  create: {
4168
4716
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -4187,7 +4735,18 @@ export const AlpacaAccount = {
4187
4735
  }
4188
4736
  : { connectOrCreate: item.asset.orders.map((item) => ({
4189
4737
  where: {
4190
- id: item.id !== undefined ? item.id : undefined,
4738
+ id: item.id !== undefined ? {
4739
+ equals: item.id
4740
+ } : undefined,
4741
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4742
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4743
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4744
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4745
+ equals: item.alpacaAccountId
4746
+ } : undefined,
4747
+ assetId: item.assetId !== undefined ? {
4748
+ equals: item.assetId
4749
+ } : undefined,
4191
4750
  },
4192
4751
  create: {
4193
4752
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4223,8 +4782,16 @@ export const AlpacaAccount = {
4223
4782
  }
4224
4783
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
4225
4784
  where: {
4226
- id: item.id !== undefined ? item.id : undefined,
4785
+ id: item.id !== undefined ? {
4786
+ equals: item.id
4787
+ } : undefined,
4227
4788
  url: item.url !== undefined ? item.url : undefined,
4789
+ assetId: item.assetId !== undefined ? {
4790
+ equals: item.assetId
4791
+ } : undefined,
4792
+ newsArticleId: item.newsArticleId !== undefined ? {
4793
+ equals: item.newsArticleId
4794
+ } : undefined,
4228
4795
  },
4229
4796
  create: {
4230
4797
  url: item.url !== undefined ? item.url : undefined,
@@ -4260,7 +4827,9 @@ export const AlpacaAccount = {
4260
4827
  }
4261
4828
  : { connectOrCreate: {
4262
4829
  where: {
4263
- id: item.asset.id !== undefined ? item.asset.id : undefined,
4830
+ id: item.asset.id !== undefined ? {
4831
+ equals: item.asset.id
4832
+ } : undefined,
4264
4833
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4265
4834
  name: item.asset.name !== undefined ? item.asset.name : undefined,
4266
4835
  },
@@ -4328,7 +4897,15 @@ export const AlpacaAccount = {
4328
4897
  }
4329
4898
  : { connectOrCreate: item.asset.trades.map((item) => ({
4330
4899
  where: {
4331
- id: item.id !== undefined ? item.id : undefined,
4900
+ id: item.id !== undefined ? {
4901
+ equals: item.id
4902
+ } : undefined,
4903
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4904
+ equals: item.alpacaAccountId
4905
+ } : undefined,
4906
+ assetId: item.assetId !== undefined ? {
4907
+ equals: item.assetId
4908
+ } : undefined,
4332
4909
  },
4333
4910
  create: {
4334
4911
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -4353,7 +4930,18 @@ export const AlpacaAccount = {
4353
4930
  }
4354
4931
  : { connectOrCreate: item.asset.orders.map((item) => ({
4355
4932
  where: {
4356
- id: item.id !== undefined ? item.id : undefined,
4933
+ id: item.id !== undefined ? {
4934
+ equals: item.id
4935
+ } : undefined,
4936
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4937
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4938
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4939
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4940
+ equals: item.alpacaAccountId
4941
+ } : undefined,
4942
+ assetId: item.assetId !== undefined ? {
4943
+ equals: item.assetId
4944
+ } : undefined,
4357
4945
  },
4358
4946
  create: {
4359
4947
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4389,8 +4977,16 @@ export const AlpacaAccount = {
4389
4977
  }
4390
4978
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
4391
4979
  where: {
4392
- id: item.id !== undefined ? item.id : undefined,
4980
+ id: item.id !== undefined ? {
4981
+ equals: item.id
4982
+ } : undefined,
4393
4983
  url: item.url !== undefined ? item.url : undefined,
4984
+ assetId: item.assetId !== undefined ? {
4985
+ equals: item.assetId
4986
+ } : undefined,
4987
+ newsArticleId: item.newsArticleId !== undefined ? {
4988
+ equals: item.newsArticleId
4989
+ } : undefined,
4394
4990
  },
4395
4991
  create: {
4396
4992
  url: item.url !== undefined ? item.url : undefined,
@@ -4409,7 +5005,12 @@ export const AlpacaAccount = {
4409
5005
  alerts: props.alerts ? {
4410
5006
  upsert: props.alerts.map((item) => ({
4411
5007
  where: {
4412
- id: item.id !== undefined ? item.id : undefined,
5008
+ id: item.id !== undefined ? {
5009
+ equals: item.id
5010
+ } : undefined,
5011
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5012
+ equals: item.alpacaAccountId
5013
+ } : undefined,
4413
5014
  },
4414
5015
  update: {
4415
5016
  id: item.id !== undefined ? {
@@ -4466,7 +5067,9 @@ export const AlpacaAccount = {
4466
5067
  }`;
4467
5068
  const variables = props.map(prop => ({
4468
5069
  where: {
4469
- id: prop.id !== undefined ? prop.id : undefined,
5070
+ id: prop.id !== undefined ? {
5071
+ equals: prop.id
5072
+ } : undefined,
4470
5073
  type: prop.type !== undefined ? prop.type : undefined,
4471
5074
  APIKey: prop.APIKey !== undefined ? prop.APIKey : undefined,
4472
5075
  APISecret: prop.APISecret !== undefined ? prop.APISecret : undefined,
@@ -4475,7 +5078,9 @@ export const AlpacaAccount = {
4475
5078
  maxOrderSize: prop.maxOrderSize !== undefined ? prop.maxOrderSize : undefined,
4476
5079
  minPercentageChange: prop.minPercentageChange !== undefined ? prop.minPercentageChange : undefined,
4477
5080
  volumeThreshold: prop.volumeThreshold !== undefined ? prop.volumeThreshold : undefined,
4478
- userId: prop.userId !== undefined ? prop.userId : undefined,
5081
+ userId: prop.userId !== undefined ? {
5082
+ equals: prop.userId
5083
+ } : undefined,
4479
5084
  createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
4480
5085
  updatedAt: prop.updatedAt !== undefined ? prop.updatedAt : undefined,
4481
5086
  },
@@ -4572,9 +5177,21 @@ export const AlpacaAccount = {
4572
5177
  id: prop.user.customer.id !== undefined ? {
4573
5178
  equals: prop.user.customer.id
4574
5179
  } : undefined,
5180
+ authUserId: prop.user.customer.authUserId !== undefined ? {
5181
+ equals: prop.user.customer.authUserId
5182
+ } : undefined,
4575
5183
  name: prop.user.customer.name !== undefined ? {
4576
5184
  equals: prop.user.customer.name
4577
5185
  } : undefined,
5186
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? {
5187
+ equals: prop.user.customer.stripeCustomerId
5188
+ } : undefined,
5189
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? {
5190
+ equals: prop.user.customer.stripeSubscriptionId
5191
+ } : undefined,
5192
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
5193
+ equals: prop.user.customer.stripePriceId
5194
+ } : undefined,
4578
5195
  },
4579
5196
  update: {
4580
5197
  authUserId: prop.user.customer.authUserId !== undefined ? {
@@ -4613,7 +5230,15 @@ export const AlpacaAccount = {
4613
5230
  accounts: prop.user.accounts ? {
4614
5231
  upsert: prop.user.accounts.map((item) => ({
4615
5232
  where: {
4616
- id: item.id !== undefined ? item.id : undefined,
5233
+ id: item.id !== undefined ? {
5234
+ equals: item.id
5235
+ } : undefined,
5236
+ userId: item.userId !== undefined ? {
5237
+ equals: item.userId
5238
+ } : undefined,
5239
+ providerAccountId: item.providerAccountId !== undefined ? {
5240
+ equals: item.providerAccountId
5241
+ } : undefined,
4617
5242
  },
4618
5243
  update: {
4619
5244
  id: item.id !== undefined ? {
@@ -4667,7 +5292,12 @@ export const AlpacaAccount = {
4667
5292
  sessions: prop.user.sessions ? {
4668
5293
  upsert: prop.user.sessions.map((item) => ({
4669
5294
  where: {
4670
- id: item.id !== undefined ? item.id : undefined,
5295
+ id: item.id !== undefined ? {
5296
+ equals: item.id
5297
+ } : undefined,
5298
+ userId: item.userId !== undefined ? {
5299
+ equals: item.userId
5300
+ } : undefined,
4671
5301
  },
4672
5302
  update: {
4673
5303
  id: item.id !== undefined ? {
@@ -4689,7 +5319,12 @@ export const AlpacaAccount = {
4689
5319
  authenticators: prop.user.authenticators ? {
4690
5320
  upsert: prop.user.authenticators.map((item) => ({
4691
5321
  where: {
4692
- id: item.id !== undefined ? item.id : undefined,
5322
+ id: item.id !== undefined ? {
5323
+ equals: item.id
5324
+ } : undefined,
5325
+ userId: item.userId !== undefined ? {
5326
+ equals: item.userId
5327
+ } : undefined,
4693
5328
  },
4694
5329
  update: {
4695
5330
  id: item.id !== undefined ? {
@@ -4733,10 +5368,20 @@ export const AlpacaAccount = {
4733
5368
  }
4734
5369
  : { connectOrCreate: {
4735
5370
  where: {
4736
- id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
5371
+ id: prop.user.customer.id !== undefined ? {
5372
+ equals: prop.user.customer.id
5373
+ } : undefined,
5374
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
5375
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
5376
+ authUserId: prop.user.customer.authUserId !== undefined ? {
5377
+ equals: prop.user.customer.authUserId
5378
+ } : undefined,
4737
5379
  name: prop.user.customer.name !== undefined ? {
4738
5380
  equals: prop.user.customer.name
4739
5381
  } : undefined,
5382
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
5383
+ equals: prop.user.customer.stripePriceId
5384
+ } : undefined,
4740
5385
  },
4741
5386
  create: {
4742
5387
  authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
@@ -4757,7 +5402,15 @@ export const AlpacaAccount = {
4757
5402
  }
4758
5403
  : { connectOrCreate: prop.user.accounts.map((item) => ({
4759
5404
  where: {
4760
- id: item.id !== undefined ? item.id : undefined,
5405
+ id: item.id !== undefined ? {
5406
+ equals: item.id
5407
+ } : undefined,
5408
+ userId: item.userId !== undefined ? {
5409
+ equals: item.userId
5410
+ } : undefined,
5411
+ providerAccountId: item.providerAccountId !== undefined ? {
5412
+ equals: item.providerAccountId
5413
+ } : undefined,
4761
5414
  },
4762
5415
  create: {
4763
5416
  type: item.type !== undefined ? item.type : undefined,
@@ -4781,7 +5434,12 @@ export const AlpacaAccount = {
4781
5434
  }
4782
5435
  : { connectOrCreate: prop.user.sessions.map((item) => ({
4783
5436
  where: {
4784
- id: item.id !== undefined ? item.id : undefined,
5437
+ id: item.id !== undefined ? {
5438
+ equals: item.id
5439
+ } : undefined,
5440
+ userId: item.userId !== undefined ? {
5441
+ equals: item.userId
5442
+ } : undefined,
4785
5443
  },
4786
5444
  create: {
4787
5445
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -4797,7 +5455,12 @@ export const AlpacaAccount = {
4797
5455
  }
4798
5456
  : { connectOrCreate: prop.user.authenticators.map((item) => ({
4799
5457
  where: {
4800
- id: item.id !== undefined ? item.id : undefined,
5458
+ id: item.id !== undefined ? {
5459
+ equals: item.id
5460
+ } : undefined,
5461
+ userId: item.userId !== undefined ? {
5462
+ equals: item.userId
5463
+ } : undefined,
4801
5464
  },
4802
5465
  create: {
4803
5466
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -4812,7 +5475,15 @@ export const AlpacaAccount = {
4812
5475
  trades: prop.trades ? {
4813
5476
  upsert: prop.trades.map((item) => ({
4814
5477
  where: {
4815
- id: item.id !== undefined ? item.id : undefined,
5478
+ id: item.id !== undefined ? {
5479
+ equals: item.id
5480
+ } : undefined,
5481
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5482
+ equals: item.alpacaAccountId
5483
+ } : undefined,
5484
+ assetId: item.assetId !== undefined ? {
5485
+ equals: item.assetId
5486
+ } : undefined,
4816
5487
  },
4817
5488
  update: {
4818
5489
  id: item.id !== undefined ? {
@@ -5036,7 +5707,18 @@ export const AlpacaAccount = {
5036
5707
  orders: item.asset.orders ? {
5037
5708
  upsert: item.asset.orders.map((item) => ({
5038
5709
  where: {
5039
- id: item.id !== undefined ? item.id : undefined,
5710
+ id: item.id !== undefined ? {
5711
+ equals: item.id
5712
+ } : undefined,
5713
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5714
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5715
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5716
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5717
+ equals: item.alpacaAccountId
5718
+ } : undefined,
5719
+ assetId: item.assetId !== undefined ? {
5720
+ equals: item.assetId
5721
+ } : undefined,
5040
5722
  },
5041
5723
  update: {
5042
5724
  id: item.id !== undefined ? {
@@ -5138,7 +5820,15 @@ export const AlpacaAccount = {
5138
5820
  positions: item.asset.positions ? {
5139
5821
  upsert: item.asset.positions.map((item) => ({
5140
5822
  where: {
5141
- id: item.id !== undefined ? item.id : undefined,
5823
+ id: item.id !== undefined ? {
5824
+ equals: item.id
5825
+ } : undefined,
5826
+ assetId: item.assetId !== undefined ? {
5827
+ equals: item.assetId
5828
+ } : undefined,
5829
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5830
+ equals: item.alpacaAccountId
5831
+ } : undefined,
5142
5832
  },
5143
5833
  update: {
5144
5834
  id: item.id !== undefined ? {
@@ -5204,8 +5894,16 @@ export const AlpacaAccount = {
5204
5894
  newsMentions: item.asset.newsMentions ? {
5205
5895
  upsert: item.asset.newsMentions.map((item) => ({
5206
5896
  where: {
5207
- id: item.id !== undefined ? item.id : undefined,
5897
+ id: item.id !== undefined ? {
5898
+ equals: item.id
5899
+ } : undefined,
5208
5900
  url: item.url !== undefined ? item.url : undefined,
5901
+ assetId: item.assetId !== undefined ? {
5902
+ equals: item.assetId
5903
+ } : undefined,
5904
+ newsArticleId: item.newsArticleId !== undefined ? {
5905
+ equals: item.newsArticleId
5906
+ } : undefined,
5209
5907
  },
5210
5908
  update: {
5211
5909
  id: item.id !== undefined ? {
@@ -5297,7 +5995,18 @@ export const AlpacaAccount = {
5297
5995
  }
5298
5996
  : { connectOrCreate: item.asset.orders.map((item) => ({
5299
5997
  where: {
5300
- id: item.id !== undefined ? item.id : undefined,
5998
+ id: item.id !== undefined ? {
5999
+ equals: item.id
6000
+ } : undefined,
6001
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6002
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6003
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6004
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6005
+ equals: item.alpacaAccountId
6006
+ } : undefined,
6007
+ assetId: item.assetId !== undefined ? {
6008
+ equals: item.assetId
6009
+ } : undefined,
5301
6010
  },
5302
6011
  create: {
5303
6012
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -5333,7 +6042,15 @@ export const AlpacaAccount = {
5333
6042
  }
5334
6043
  : { connectOrCreate: item.asset.positions.map((item) => ({
5335
6044
  where: {
5336
- id: item.id !== undefined ? item.id : undefined,
6045
+ id: item.id !== undefined ? {
6046
+ equals: item.id
6047
+ } : undefined,
6048
+ assetId: item.assetId !== undefined ? {
6049
+ equals: item.assetId
6050
+ } : undefined,
6051
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6052
+ equals: item.alpacaAccountId
6053
+ } : undefined,
5337
6054
  },
5338
6055
  create: {
5339
6056
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5360,8 +6077,16 @@ export const AlpacaAccount = {
5360
6077
  }
5361
6078
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
5362
6079
  where: {
5363
- id: item.id !== undefined ? item.id : undefined,
6080
+ id: item.id !== undefined ? {
6081
+ equals: item.id
6082
+ } : undefined,
5364
6083
  url: item.url !== undefined ? item.url : undefined,
6084
+ assetId: item.assetId !== undefined ? {
6085
+ equals: item.assetId
6086
+ } : undefined,
6087
+ newsArticleId: item.newsArticleId !== undefined ? {
6088
+ equals: item.newsArticleId
6089
+ } : undefined,
5365
6090
  },
5366
6091
  create: {
5367
6092
  url: item.url !== undefined ? item.url : undefined,
@@ -5377,7 +6102,12 @@ export const AlpacaAccount = {
5377
6102
  actions: item.actions ? {
5378
6103
  upsert: item.actions.map((item) => ({
5379
6104
  where: {
5380
- id: item.id !== undefined ? item.id : undefined,
6105
+ id: item.id !== undefined ? {
6106
+ equals: item.id
6107
+ } : undefined,
6108
+ tradeId: item.tradeId !== undefined ? {
6109
+ equals: item.tradeId
6110
+ } : undefined,
5381
6111
  },
5382
6112
  update: {
5383
6113
  id: item.id !== undefined ? {
@@ -5404,6 +6134,18 @@ export const AlpacaAccount = {
5404
6134
  id: item.order.id !== undefined ? {
5405
6135
  equals: item.order.id
5406
6136
  } : undefined,
6137
+ clientOrderId: item.order.clientOrderId !== undefined ? {
6138
+ equals: item.order.clientOrderId
6139
+ } : undefined,
6140
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
6141
+ equals: item.order.alpacaAccountId
6142
+ } : undefined,
6143
+ assetId: item.order.assetId !== undefined ? {
6144
+ equals: item.order.assetId
6145
+ } : undefined,
6146
+ actionId: item.order.actionId !== undefined ? {
6147
+ equals: item.order.actionId
6148
+ } : undefined,
5407
6149
  },
5408
6150
  update: {
5409
6151
  id: item.order.id !== undefined ? {
@@ -5517,7 +6259,18 @@ export const AlpacaAccount = {
5517
6259
  }
5518
6260
  : { connectOrCreate: {
5519
6261
  where: {
5520
- id: item.order.id !== undefined ? item.order.id : undefined,
6262
+ id: item.order.id !== undefined ? {
6263
+ equals: item.order.id
6264
+ } : undefined,
6265
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
6266
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
6267
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
6268
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
6269
+ equals: item.order.alpacaAccountId
6270
+ } : undefined,
6271
+ assetId: item.order.assetId !== undefined ? {
6272
+ equals: item.order.assetId
6273
+ } : undefined,
5521
6274
  },
5522
6275
  create: {
5523
6276
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -5569,7 +6322,9 @@ export const AlpacaAccount = {
5569
6322
  }
5570
6323
  : { connectOrCreate: {
5571
6324
  where: {
5572
- id: item.asset.id !== undefined ? item.asset.id : undefined,
6325
+ id: item.asset.id !== undefined ? {
6326
+ equals: item.asset.id
6327
+ } : undefined,
5573
6328
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5574
6329
  name: item.asset.name !== undefined ? item.asset.name : undefined,
5575
6330
  },
@@ -5637,7 +6392,18 @@ export const AlpacaAccount = {
5637
6392
  }
5638
6393
  : { connectOrCreate: item.asset.orders.map((item) => ({
5639
6394
  where: {
5640
- id: item.id !== undefined ? item.id : undefined,
6395
+ id: item.id !== undefined ? {
6396
+ equals: item.id
6397
+ } : undefined,
6398
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6399
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6400
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6401
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6402
+ equals: item.alpacaAccountId
6403
+ } : undefined,
6404
+ assetId: item.assetId !== undefined ? {
6405
+ equals: item.assetId
6406
+ } : undefined,
5641
6407
  },
5642
6408
  create: {
5643
6409
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -5673,7 +6439,15 @@ export const AlpacaAccount = {
5673
6439
  }
5674
6440
  : { connectOrCreate: item.asset.positions.map((item) => ({
5675
6441
  where: {
5676
- id: item.id !== undefined ? item.id : undefined,
6442
+ id: item.id !== undefined ? {
6443
+ equals: item.id
6444
+ } : undefined,
6445
+ assetId: item.assetId !== undefined ? {
6446
+ equals: item.assetId
6447
+ } : undefined,
6448
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6449
+ equals: item.alpacaAccountId
6450
+ } : undefined,
5677
6451
  },
5678
6452
  create: {
5679
6453
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5700,8 +6474,16 @@ export const AlpacaAccount = {
5700
6474
  }
5701
6475
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
5702
6476
  where: {
5703
- id: item.id !== undefined ? item.id : undefined,
6477
+ id: item.id !== undefined ? {
6478
+ equals: item.id
6479
+ } : undefined,
5704
6480
  url: item.url !== undefined ? item.url : undefined,
6481
+ assetId: item.assetId !== undefined ? {
6482
+ equals: item.assetId
6483
+ } : undefined,
6484
+ newsArticleId: item.newsArticleId !== undefined ? {
6485
+ equals: item.newsArticleId
6486
+ } : undefined,
5705
6487
  },
5706
6488
  create: {
5707
6489
  url: item.url !== undefined ? item.url : undefined,
@@ -5722,7 +6504,12 @@ export const AlpacaAccount = {
5722
6504
  }
5723
6505
  : { connectOrCreate: item.actions.map((item) => ({
5724
6506
  where: {
5725
- id: item.id !== undefined ? item.id : undefined,
6507
+ id: item.id !== undefined ? {
6508
+ equals: item.id
6509
+ } : undefined,
6510
+ tradeId: item.tradeId !== undefined ? {
6511
+ equals: item.tradeId
6512
+ } : undefined,
5726
6513
  },
5727
6514
  create: {
5728
6515
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -5738,7 +6525,18 @@ export const AlpacaAccount = {
5738
6525
  }
5739
6526
  : { connectOrCreate: {
5740
6527
  where: {
5741
- id: item.order.id !== undefined ? item.order.id : undefined,
6528
+ id: item.order.id !== undefined ? {
6529
+ equals: item.order.id
6530
+ } : undefined,
6531
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
6532
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
6533
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
6534
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
6535
+ equals: item.order.alpacaAccountId
6536
+ } : undefined,
6537
+ assetId: item.order.assetId !== undefined ? {
6538
+ equals: item.order.assetId
6539
+ } : undefined,
5742
6540
  },
5743
6541
  create: {
5744
6542
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -5775,7 +6573,18 @@ export const AlpacaAccount = {
5775
6573
  orders: prop.orders ? {
5776
6574
  upsert: prop.orders.map((item) => ({
5777
6575
  where: {
5778
- id: item.id !== undefined ? item.id : undefined,
6576
+ id: item.id !== undefined ? {
6577
+ equals: item.id
6578
+ } : undefined,
6579
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6580
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6581
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6582
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6583
+ equals: item.alpacaAccountId
6584
+ } : undefined,
6585
+ assetId: item.assetId !== undefined ? {
6586
+ equals: item.assetId
6587
+ } : undefined,
5779
6588
  },
5780
6589
  update: {
5781
6590
  id: item.id !== undefined ? {
@@ -5853,6 +6662,9 @@ export const AlpacaAccount = {
5853
6662
  id: item.stopLoss.id !== undefined ? {
5854
6663
  equals: item.stopLoss.id
5855
6664
  } : undefined,
6665
+ orderId: item.stopLoss.orderId !== undefined ? {
6666
+ equals: item.stopLoss.orderId
6667
+ } : undefined,
5856
6668
  },
5857
6669
  update: {
5858
6670
  id: item.stopLoss.id !== undefined ? {
@@ -5877,6 +6689,9 @@ export const AlpacaAccount = {
5877
6689
  id: item.takeProfit.id !== undefined ? {
5878
6690
  equals: item.takeProfit.id
5879
6691
  } : undefined,
6692
+ orderId: item.takeProfit.orderId !== undefined ? {
6693
+ equals: item.takeProfit.orderId
6694
+ } : undefined,
5880
6695
  },
5881
6696
  update: {
5882
6697
  id: item.takeProfit.id !== undefined ? {
@@ -5901,6 +6716,9 @@ export const AlpacaAccount = {
5901
6716
  id: item.action.id !== undefined ? {
5902
6717
  equals: item.action.id
5903
6718
  } : undefined,
6719
+ tradeId: item.action.tradeId !== undefined ? {
6720
+ equals: item.action.tradeId
6721
+ } : undefined,
5904
6722
  },
5905
6723
  update: {
5906
6724
  id: item.action.id !== undefined ? {
@@ -5927,6 +6745,12 @@ export const AlpacaAccount = {
5927
6745
  id: item.action.trade.id !== undefined ? {
5928
6746
  equals: item.action.trade.id
5929
6747
  } : undefined,
6748
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6749
+ equals: item.action.trade.alpacaAccountId
6750
+ } : undefined,
6751
+ assetId: item.action.trade.assetId !== undefined ? {
6752
+ equals: item.action.trade.assetId
6753
+ } : undefined,
5930
6754
  },
5931
6755
  update: {
5932
6756
  id: item.action.trade.id !== undefined ? {
@@ -5996,7 +6820,15 @@ export const AlpacaAccount = {
5996
6820
  }
5997
6821
  : { connectOrCreate: {
5998
6822
  where: {
5999
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6823
+ id: item.action.trade.id !== undefined ? {
6824
+ equals: item.action.trade.id
6825
+ } : undefined,
6826
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6827
+ equals: item.action.trade.alpacaAccountId
6828
+ } : undefined,
6829
+ assetId: item.action.trade.assetId !== undefined ? {
6830
+ equals: item.action.trade.assetId
6831
+ } : undefined,
6000
6832
  },
6001
6833
  create: {
6002
6834
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -6201,7 +7033,15 @@ export const AlpacaAccount = {
6201
7033
  trades: item.asset.trades ? {
6202
7034
  upsert: item.asset.trades.map((item) => ({
6203
7035
  where: {
6204
- id: item.id !== undefined ? item.id : undefined,
7036
+ id: item.id !== undefined ? {
7037
+ equals: item.id
7038
+ } : undefined,
7039
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7040
+ equals: item.alpacaAccountId
7041
+ } : undefined,
7042
+ assetId: item.assetId !== undefined ? {
7043
+ equals: item.assetId
7044
+ } : undefined,
6205
7045
  },
6206
7046
  update: {
6207
7047
  id: item.id !== undefined ? {
@@ -6259,7 +7099,15 @@ export const AlpacaAccount = {
6259
7099
  positions: item.asset.positions ? {
6260
7100
  upsert: item.asset.positions.map((item) => ({
6261
7101
  where: {
6262
- id: item.id !== undefined ? item.id : undefined,
7102
+ id: item.id !== undefined ? {
7103
+ equals: item.id
7104
+ } : undefined,
7105
+ assetId: item.assetId !== undefined ? {
7106
+ equals: item.assetId
7107
+ } : undefined,
7108
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7109
+ equals: item.alpacaAccountId
7110
+ } : undefined,
6263
7111
  },
6264
7112
  update: {
6265
7113
  id: item.id !== undefined ? {
@@ -6325,8 +7173,16 @@ export const AlpacaAccount = {
6325
7173
  newsMentions: item.asset.newsMentions ? {
6326
7174
  upsert: item.asset.newsMentions.map((item) => ({
6327
7175
  where: {
6328
- id: item.id !== undefined ? item.id : undefined,
7176
+ id: item.id !== undefined ? {
7177
+ equals: item.id
7178
+ } : undefined,
6329
7179
  url: item.url !== undefined ? item.url : undefined,
7180
+ assetId: item.assetId !== undefined ? {
7181
+ equals: item.assetId
7182
+ } : undefined,
7183
+ newsArticleId: item.newsArticleId !== undefined ? {
7184
+ equals: item.newsArticleId
7185
+ } : undefined,
6330
7186
  },
6331
7187
  update: {
6332
7188
  id: item.id !== undefined ? {
@@ -6418,7 +7274,15 @@ export const AlpacaAccount = {
6418
7274
  }
6419
7275
  : { connectOrCreate: item.asset.trades.map((item) => ({
6420
7276
  where: {
6421
- id: item.id !== undefined ? item.id : undefined,
7277
+ id: item.id !== undefined ? {
7278
+ equals: item.id
7279
+ } : undefined,
7280
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7281
+ equals: item.alpacaAccountId
7282
+ } : undefined,
7283
+ assetId: item.assetId !== undefined ? {
7284
+ equals: item.assetId
7285
+ } : undefined,
6422
7286
  },
6423
7287
  create: {
6424
7288
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6443,7 +7307,15 @@ export const AlpacaAccount = {
6443
7307
  }
6444
7308
  : { connectOrCreate: item.asset.positions.map((item) => ({
6445
7309
  where: {
6446
- id: item.id !== undefined ? item.id : undefined,
7310
+ id: item.id !== undefined ? {
7311
+ equals: item.id
7312
+ } : undefined,
7313
+ assetId: item.assetId !== undefined ? {
7314
+ equals: item.assetId
7315
+ } : undefined,
7316
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7317
+ equals: item.alpacaAccountId
7318
+ } : undefined,
6447
7319
  },
6448
7320
  create: {
6449
7321
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -6470,8 +7342,16 @@ export const AlpacaAccount = {
6470
7342
  }
6471
7343
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
6472
7344
  where: {
6473
- id: item.id !== undefined ? item.id : undefined,
7345
+ id: item.id !== undefined ? {
7346
+ equals: item.id
7347
+ } : undefined,
6474
7348
  url: item.url !== undefined ? item.url : undefined,
7349
+ assetId: item.assetId !== undefined ? {
7350
+ equals: item.assetId
7351
+ } : undefined,
7352
+ newsArticleId: item.newsArticleId !== undefined ? {
7353
+ equals: item.newsArticleId
7354
+ } : undefined,
6475
7355
  },
6476
7356
  create: {
6477
7357
  url: item.url !== undefined ? item.url : undefined,
@@ -6516,7 +7396,10 @@ export const AlpacaAccount = {
6516
7396
  }
6517
7397
  : { connectOrCreate: {
6518
7398
  where: {
6519
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
7399
+ id: item.stopLoss.id !== undefined ? {
7400
+ equals: item.stopLoss.id
7401
+ } : undefined,
7402
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
6520
7403
  },
6521
7404
  create: {
6522
7405
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -6532,7 +7415,10 @@ export const AlpacaAccount = {
6532
7415
  }
6533
7416
  : { connectOrCreate: {
6534
7417
  where: {
6535
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
7418
+ id: item.takeProfit.id !== undefined ? {
7419
+ equals: item.takeProfit.id
7420
+ } : undefined,
7421
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
6536
7422
  },
6537
7423
  create: {
6538
7424
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -6548,7 +7434,12 @@ export const AlpacaAccount = {
6548
7434
  }
6549
7435
  : { connectOrCreate: {
6550
7436
  where: {
6551
- id: item.action.id !== undefined ? item.action.id : undefined,
7437
+ id: item.action.id !== undefined ? {
7438
+ equals: item.action.id
7439
+ } : undefined,
7440
+ tradeId: item.action.tradeId !== undefined ? {
7441
+ equals: item.action.tradeId
7442
+ } : undefined,
6552
7443
  },
6553
7444
  create: {
6554
7445
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -6564,7 +7455,15 @@ export const AlpacaAccount = {
6564
7455
  }
6565
7456
  : { connectOrCreate: {
6566
7457
  where: {
6567
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
7458
+ id: item.action.trade.id !== undefined ? {
7459
+ equals: item.action.trade.id
7460
+ } : undefined,
7461
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
7462
+ equals: item.action.trade.alpacaAccountId
7463
+ } : undefined,
7464
+ assetId: item.action.trade.assetId !== undefined ? {
7465
+ equals: item.action.trade.assetId
7466
+ } : undefined,
6568
7467
  },
6569
7468
  create: {
6570
7469
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -6592,7 +7491,9 @@ export const AlpacaAccount = {
6592
7491
  }
6593
7492
  : { connectOrCreate: {
6594
7493
  where: {
6595
- id: item.asset.id !== undefined ? item.asset.id : undefined,
7494
+ id: item.asset.id !== undefined ? {
7495
+ equals: item.asset.id
7496
+ } : undefined,
6596
7497
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
6597
7498
  name: item.asset.name !== undefined ? item.asset.name : undefined,
6598
7499
  },
@@ -6660,7 +7561,15 @@ export const AlpacaAccount = {
6660
7561
  }
6661
7562
  : { connectOrCreate: item.asset.trades.map((item) => ({
6662
7563
  where: {
6663
- id: item.id !== undefined ? item.id : undefined,
7564
+ id: item.id !== undefined ? {
7565
+ equals: item.id
7566
+ } : undefined,
7567
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7568
+ equals: item.alpacaAccountId
7569
+ } : undefined,
7570
+ assetId: item.assetId !== undefined ? {
7571
+ equals: item.assetId
7572
+ } : undefined,
6664
7573
  },
6665
7574
  create: {
6666
7575
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6685,7 +7594,15 @@ export const AlpacaAccount = {
6685
7594
  }
6686
7595
  : { connectOrCreate: item.asset.positions.map((item) => ({
6687
7596
  where: {
6688
- id: item.id !== undefined ? item.id : undefined,
7597
+ id: item.id !== undefined ? {
7598
+ equals: item.id
7599
+ } : undefined,
7600
+ assetId: item.assetId !== undefined ? {
7601
+ equals: item.assetId
7602
+ } : undefined,
7603
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7604
+ equals: item.alpacaAccountId
7605
+ } : undefined,
6689
7606
  },
6690
7607
  create: {
6691
7608
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -6712,8 +7629,16 @@ export const AlpacaAccount = {
6712
7629
  }
6713
7630
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
6714
7631
  where: {
6715
- id: item.id !== undefined ? item.id : undefined,
7632
+ id: item.id !== undefined ? {
7633
+ equals: item.id
7634
+ } : undefined,
6716
7635
  url: item.url !== undefined ? item.url : undefined,
7636
+ assetId: item.assetId !== undefined ? {
7637
+ equals: item.assetId
7638
+ } : undefined,
7639
+ newsArticleId: item.newsArticleId !== undefined ? {
7640
+ equals: item.newsArticleId
7641
+ } : undefined,
6717
7642
  },
6718
7643
  create: {
6719
7644
  url: item.url !== undefined ? item.url : undefined,
@@ -6732,7 +7657,15 @@ export const AlpacaAccount = {
6732
7657
  positions: prop.positions ? {
6733
7658
  upsert: prop.positions.map((item) => ({
6734
7659
  where: {
6735
- id: item.id !== undefined ? item.id : undefined,
7660
+ id: item.id !== undefined ? {
7661
+ equals: item.id
7662
+ } : undefined,
7663
+ assetId: item.assetId !== undefined ? {
7664
+ equals: item.assetId
7665
+ } : undefined,
7666
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7667
+ equals: item.alpacaAccountId
7668
+ } : undefined,
6736
7669
  },
6737
7670
  update: {
6738
7671
  id: item.id !== undefined ? {
@@ -6962,7 +7895,15 @@ export const AlpacaAccount = {
6962
7895
  trades: item.asset.trades ? {
6963
7896
  upsert: item.asset.trades.map((item) => ({
6964
7897
  where: {
6965
- id: item.id !== undefined ? item.id : undefined,
7898
+ id: item.id !== undefined ? {
7899
+ equals: item.id
7900
+ } : undefined,
7901
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7902
+ equals: item.alpacaAccountId
7903
+ } : undefined,
7904
+ assetId: item.assetId !== undefined ? {
7905
+ equals: item.assetId
7906
+ } : undefined,
6966
7907
  },
6967
7908
  update: {
6968
7909
  id: item.id !== undefined ? {
@@ -7020,7 +7961,18 @@ export const AlpacaAccount = {
7020
7961
  orders: item.asset.orders ? {
7021
7962
  upsert: item.asset.orders.map((item) => ({
7022
7963
  where: {
7023
- id: item.id !== undefined ? item.id : undefined,
7964
+ id: item.id !== undefined ? {
7965
+ equals: item.id
7966
+ } : undefined,
7967
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
7968
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
7969
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
7970
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7971
+ equals: item.alpacaAccountId
7972
+ } : undefined,
7973
+ assetId: item.assetId !== undefined ? {
7974
+ equals: item.assetId
7975
+ } : undefined,
7024
7976
  },
7025
7977
  update: {
7026
7978
  id: item.id !== undefined ? {
@@ -7122,8 +8074,16 @@ export const AlpacaAccount = {
7122
8074
  newsMentions: item.asset.newsMentions ? {
7123
8075
  upsert: item.asset.newsMentions.map((item) => ({
7124
8076
  where: {
7125
- id: item.id !== undefined ? item.id : undefined,
8077
+ id: item.id !== undefined ? {
8078
+ equals: item.id
8079
+ } : undefined,
7126
8080
  url: item.url !== undefined ? item.url : undefined,
8081
+ assetId: item.assetId !== undefined ? {
8082
+ equals: item.assetId
8083
+ } : undefined,
8084
+ newsArticleId: item.newsArticleId !== undefined ? {
8085
+ equals: item.newsArticleId
8086
+ } : undefined,
7127
8087
  },
7128
8088
  update: {
7129
8089
  id: item.id !== undefined ? {
@@ -7215,7 +8175,15 @@ export const AlpacaAccount = {
7215
8175
  }
7216
8176
  : { connectOrCreate: item.asset.trades.map((item) => ({
7217
8177
  where: {
7218
- id: item.id !== undefined ? item.id : undefined,
8178
+ id: item.id !== undefined ? {
8179
+ equals: item.id
8180
+ } : undefined,
8181
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
8182
+ equals: item.alpacaAccountId
8183
+ } : undefined,
8184
+ assetId: item.assetId !== undefined ? {
8185
+ equals: item.assetId
8186
+ } : undefined,
7219
8187
  },
7220
8188
  create: {
7221
8189
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -7240,7 +8208,18 @@ export const AlpacaAccount = {
7240
8208
  }
7241
8209
  : { connectOrCreate: item.asset.orders.map((item) => ({
7242
8210
  where: {
7243
- id: item.id !== undefined ? item.id : undefined,
8211
+ id: item.id !== undefined ? {
8212
+ equals: item.id
8213
+ } : undefined,
8214
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
8215
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
8216
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
8217
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
8218
+ equals: item.alpacaAccountId
8219
+ } : undefined,
8220
+ assetId: item.assetId !== undefined ? {
8221
+ equals: item.assetId
8222
+ } : undefined,
7244
8223
  },
7245
8224
  create: {
7246
8225
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -7276,8 +8255,16 @@ export const AlpacaAccount = {
7276
8255
  }
7277
8256
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
7278
8257
  where: {
7279
- id: item.id !== undefined ? item.id : undefined,
8258
+ id: item.id !== undefined ? {
8259
+ equals: item.id
8260
+ } : undefined,
7280
8261
  url: item.url !== undefined ? item.url : undefined,
8262
+ assetId: item.assetId !== undefined ? {
8263
+ equals: item.assetId
8264
+ } : undefined,
8265
+ newsArticleId: item.newsArticleId !== undefined ? {
8266
+ equals: item.newsArticleId
8267
+ } : undefined,
7281
8268
  },
7282
8269
  create: {
7283
8270
  url: item.url !== undefined ? item.url : undefined,
@@ -7313,7 +8300,9 @@ export const AlpacaAccount = {
7313
8300
  }
7314
8301
  : { connectOrCreate: {
7315
8302
  where: {
7316
- id: item.asset.id !== undefined ? item.asset.id : undefined,
8303
+ id: item.asset.id !== undefined ? {
8304
+ equals: item.asset.id
8305
+ } : undefined,
7317
8306
  symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
7318
8307
  name: item.asset.name !== undefined ? item.asset.name : undefined,
7319
8308
  },
@@ -7381,7 +8370,15 @@ export const AlpacaAccount = {
7381
8370
  }
7382
8371
  : { connectOrCreate: item.asset.trades.map((item) => ({
7383
8372
  where: {
7384
- id: item.id !== undefined ? item.id : undefined,
8373
+ id: item.id !== undefined ? {
8374
+ equals: item.id
8375
+ } : undefined,
8376
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
8377
+ equals: item.alpacaAccountId
8378
+ } : undefined,
8379
+ assetId: item.assetId !== undefined ? {
8380
+ equals: item.assetId
8381
+ } : undefined,
7385
8382
  },
7386
8383
  create: {
7387
8384
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -7406,7 +8403,18 @@ export const AlpacaAccount = {
7406
8403
  }
7407
8404
  : { connectOrCreate: item.asset.orders.map((item) => ({
7408
8405
  where: {
7409
- id: item.id !== undefined ? item.id : undefined,
8406
+ id: item.id !== undefined ? {
8407
+ equals: item.id
8408
+ } : undefined,
8409
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
8410
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
8411
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
8412
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
8413
+ equals: item.alpacaAccountId
8414
+ } : undefined,
8415
+ assetId: item.assetId !== undefined ? {
8416
+ equals: item.assetId
8417
+ } : undefined,
7410
8418
  },
7411
8419
  create: {
7412
8420
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -7442,8 +8450,16 @@ export const AlpacaAccount = {
7442
8450
  }
7443
8451
  : { connectOrCreate: item.asset.newsMentions.map((item) => ({
7444
8452
  where: {
7445
- id: item.id !== undefined ? item.id : undefined,
8453
+ id: item.id !== undefined ? {
8454
+ equals: item.id
8455
+ } : undefined,
7446
8456
  url: item.url !== undefined ? item.url : undefined,
8457
+ assetId: item.assetId !== undefined ? {
8458
+ equals: item.assetId
8459
+ } : undefined,
8460
+ newsArticleId: item.newsArticleId !== undefined ? {
8461
+ equals: item.newsArticleId
8462
+ } : undefined,
7447
8463
  },
7448
8464
  create: {
7449
8465
  url: item.url !== undefined ? item.url : undefined,
@@ -7462,7 +8478,12 @@ export const AlpacaAccount = {
7462
8478
  alerts: prop.alerts ? {
7463
8479
  upsert: prop.alerts.map((item) => ({
7464
8480
  where: {
7465
- id: item.id !== undefined ? item.id : undefined,
8481
+ id: item.id !== undefined ? {
8482
+ equals: item.id
8483
+ } : undefined,
8484
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
8485
+ equals: item.alpacaAccountId
8486
+ } : undefined,
7466
8487
  },
7467
8488
  update: {
7468
8489
  id: item.id !== undefined ? {
@@ -7554,7 +8575,9 @@ export const AlpacaAccount = {
7554
8575
  }`;
7555
8576
  const variables = {
7556
8577
  where: {
7557
- id: props.id !== undefined ? props.id : undefined,
8578
+ id: props.id !== undefined ? {
8579
+ equals: props.id
8580
+ } : undefined,
7558
8581
  type: props.type !== undefined ? props.type : undefined,
7559
8582
  APIKey: props.APIKey !== undefined ? props.APIKey : undefined,
7560
8583
  APISecret: props.APISecret !== undefined ? props.APISecret : undefined,
@@ -7563,7 +8586,9 @@ export const AlpacaAccount = {
7563
8586
  maxOrderSize: props.maxOrderSize !== undefined ? props.maxOrderSize : undefined,
7564
8587
  minPercentageChange: props.minPercentageChange !== undefined ? props.minPercentageChange : undefined,
7565
8588
  volumeThreshold: props.volumeThreshold !== undefined ? props.volumeThreshold : undefined,
7566
- userId: props.userId !== undefined ? props.userId : undefined,
8589
+ userId: props.userId !== undefined ? {
8590
+ equals: props.userId
8591
+ } : undefined,
7567
8592
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
7568
8593
  updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
7569
8594
  },
@@ -7639,7 +8664,9 @@ export const AlpacaAccount = {
7639
8664
  maxOrderSize: props.maxOrderSize !== undefined ? props.maxOrderSize : undefined,
7640
8665
  minPercentageChange: props.minPercentageChange !== undefined ? props.minPercentageChange : undefined,
7641
8666
  volumeThreshold: props.volumeThreshold !== undefined ? props.volumeThreshold : undefined,
7642
- userId: props.userId !== undefined ? props.userId : undefined,
8667
+ userId: props.userId !== undefined ? {
8668
+ equals: props.userId
8669
+ } : undefined,
7643
8670
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
7644
8671
  updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
7645
8672
  },