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
@@ -123,7 +123,9 @@ export const NewsArticleAssetSentiment = {
123
123
  }
124
124
  : { connectOrCreate: {
125
125
  where: {
126
- id: props.news.id !== undefined ? props.news.id : undefined,
126
+ id: props.news.id !== undefined ? {
127
+ equals: props.news.id
128
+ } : undefined,
127
129
  url: props.news.url !== undefined ? props.news.url : undefined,
128
130
  title: props.news.title !== undefined ? {
129
131
  equals: props.news.title
@@ -154,7 +156,9 @@ export const NewsArticleAssetSentiment = {
154
156
  }
155
157
  : { connectOrCreate: {
156
158
  where: {
157
- id: props.asset.id !== undefined ? props.asset.id : undefined,
159
+ id: props.asset.id !== undefined ? {
160
+ equals: props.asset.id
161
+ } : undefined,
158
162
  symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
159
163
  name: props.asset.name !== undefined ? props.asset.name : undefined,
160
164
  },
@@ -222,7 +226,15 @@ export const NewsArticleAssetSentiment = {
222
226
  }
223
227
  : { connectOrCreate: props.asset.trades.map((item) => ({
224
228
  where: {
225
- id: item.id !== undefined ? item.id : undefined,
229
+ id: item.id !== undefined ? {
230
+ equals: item.id
231
+ } : undefined,
232
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
233
+ equals: item.alpacaAccountId
234
+ } : undefined,
235
+ assetId: item.assetId !== undefined ? {
236
+ equals: item.assetId
237
+ } : undefined,
226
238
  },
227
239
  create: {
228
240
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -244,7 +256,12 @@ export const NewsArticleAssetSentiment = {
244
256
  }
245
257
  : { connectOrCreate: {
246
258
  where: {
247
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
259
+ id: item.alpacaAccount.id !== undefined ? {
260
+ equals: item.alpacaAccount.id
261
+ } : undefined,
262
+ userId: item.alpacaAccount.userId !== undefined ? {
263
+ equals: item.alpacaAccount.userId
264
+ } : undefined,
248
265
  },
249
266
  create: {
250
267
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -267,7 +284,12 @@ export const NewsArticleAssetSentiment = {
267
284
  }
268
285
  : { connectOrCreate: item.actions.map((item) => ({
269
286
  where: {
270
- id: item.id !== undefined ? item.id : undefined,
287
+ id: item.id !== undefined ? {
288
+ equals: item.id
289
+ } : undefined,
290
+ tradeId: item.tradeId !== undefined ? {
291
+ equals: item.tradeId
292
+ } : undefined,
271
293
  },
272
294
  create: {
273
295
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -289,7 +311,18 @@ export const NewsArticleAssetSentiment = {
289
311
  }
290
312
  : { connectOrCreate: props.asset.orders.map((item) => ({
291
313
  where: {
292
- id: item.id !== undefined ? item.id : undefined,
314
+ id: item.id !== undefined ? {
315
+ equals: item.id
316
+ } : undefined,
317
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
318
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
319
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
320
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
321
+ equals: item.alpacaAccountId
322
+ } : undefined,
323
+ assetId: item.assetId !== undefined ? {
324
+ equals: item.assetId
325
+ } : undefined,
293
326
  },
294
327
  create: {
295
328
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -322,7 +355,10 @@ export const NewsArticleAssetSentiment = {
322
355
  }
323
356
  : { connectOrCreate: {
324
357
  where: {
325
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
358
+ id: item.stopLoss.id !== undefined ? {
359
+ equals: item.stopLoss.id
360
+ } : undefined,
361
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
326
362
  },
327
363
  create: {
328
364
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -338,7 +374,10 @@ export const NewsArticleAssetSentiment = {
338
374
  }
339
375
  : { connectOrCreate: {
340
376
  where: {
341
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
377
+ id: item.takeProfit.id !== undefined ? {
378
+ equals: item.takeProfit.id
379
+ } : undefined,
380
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
342
381
  },
343
382
  create: {
344
383
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -354,7 +393,12 @@ export const NewsArticleAssetSentiment = {
354
393
  }
355
394
  : { connectOrCreate: {
356
395
  where: {
357
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
396
+ id: item.alpacaAccount.id !== undefined ? {
397
+ equals: item.alpacaAccount.id
398
+ } : undefined,
399
+ userId: item.alpacaAccount.userId !== undefined ? {
400
+ equals: item.alpacaAccount.userId
401
+ } : undefined,
358
402
  },
359
403
  create: {
360
404
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -377,7 +421,12 @@ export const NewsArticleAssetSentiment = {
377
421
  }
378
422
  : { connectOrCreate: {
379
423
  where: {
380
- id: item.action.id !== undefined ? item.action.id : undefined,
424
+ id: item.action.id !== undefined ? {
425
+ equals: item.action.id
426
+ } : undefined,
427
+ tradeId: item.action.tradeId !== undefined ? {
428
+ equals: item.action.tradeId
429
+ } : undefined,
381
430
  },
382
431
  create: {
383
432
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -399,7 +448,15 @@ export const NewsArticleAssetSentiment = {
399
448
  }
400
449
  : { connectOrCreate: props.asset.positions.map((item) => ({
401
450
  where: {
402
- id: item.id !== undefined ? item.id : undefined,
451
+ id: item.id !== undefined ? {
452
+ equals: item.id
453
+ } : undefined,
454
+ assetId: item.assetId !== undefined ? {
455
+ equals: item.assetId
456
+ } : undefined,
457
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
458
+ equals: item.alpacaAccountId
459
+ } : undefined,
403
460
  },
404
461
  create: {
405
462
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -423,7 +480,12 @@ export const NewsArticleAssetSentiment = {
423
480
  }
424
481
  : { connectOrCreate: {
425
482
  where: {
426
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
483
+ id: item.alpacaAccount.id !== undefined ? {
484
+ equals: item.alpacaAccount.id
485
+ } : undefined,
486
+ userId: item.alpacaAccount.userId !== undefined ? {
487
+ equals: item.alpacaAccount.userId
488
+ } : undefined,
427
489
  },
428
490
  create: {
429
491
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -518,10 +580,16 @@ export const NewsArticleAssetSentiment = {
518
580
  }`;
519
581
  const variables = {
520
582
  where: {
521
- id: props.id !== undefined ? props.id : undefined,
583
+ id: props.id !== undefined ? {
584
+ equals: props.id
585
+ } : undefined,
522
586
  url: props.url !== undefined ? props.url : undefined,
523
- assetId: props.assetId !== undefined ? props.assetId : undefined,
524
- newsArticleId: props.newsArticleId !== undefined ? props.newsArticleId : undefined,
587
+ assetId: props.assetId !== undefined ? {
588
+ equals: props.assetId
589
+ } : undefined,
590
+ newsArticleId: props.newsArticleId !== undefined ? {
591
+ equals: props.newsArticleId
592
+ } : undefined,
525
593
  relevancyScore: props.relevancyScore !== undefined ? props.relevancyScore : undefined,
526
594
  sentimentScore: props.sentimentScore !== undefined ? props.sentimentScore : undefined,
527
595
  sentimentLabel: props.sentimentLabel !== undefined ? props.sentimentLabel : undefined,
@@ -801,7 +869,15 @@ export const NewsArticleAssetSentiment = {
801
869
  trades: props.asset.trades ? {
802
870
  upsert: props.asset.trades.map((item) => ({
803
871
  where: {
804
- id: item.id !== undefined ? item.id : undefined,
872
+ id: item.id !== undefined ? {
873
+ equals: item.id
874
+ } : undefined,
875
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
876
+ equals: item.alpacaAccountId
877
+ } : undefined,
878
+ assetId: item.assetId !== undefined ? {
879
+ equals: item.assetId
880
+ } : undefined,
805
881
  },
806
882
  update: {
807
883
  id: item.id !== undefined ? {
@@ -846,6 +922,9 @@ export const NewsArticleAssetSentiment = {
846
922
  id: item.alpacaAccount.id !== undefined ? {
847
923
  equals: item.alpacaAccount.id
848
924
  } : undefined,
925
+ userId: item.alpacaAccount.userId !== undefined ? {
926
+ equals: item.alpacaAccount.userId
927
+ } : undefined,
849
928
  },
850
929
  update: {
851
930
  id: item.alpacaAccount.id !== undefined ? {
@@ -895,7 +974,12 @@ export const NewsArticleAssetSentiment = {
895
974
  actions: item.actions ? {
896
975
  upsert: item.actions.map((item) => ({
897
976
  where: {
898
- id: item.id !== undefined ? item.id : undefined,
977
+ id: item.id !== undefined ? {
978
+ equals: item.id
979
+ } : undefined,
980
+ tradeId: item.tradeId !== undefined ? {
981
+ equals: item.tradeId
982
+ } : undefined,
899
983
  },
900
984
  update: {
901
985
  id: item.id !== undefined ? {
@@ -947,7 +1031,12 @@ export const NewsArticleAssetSentiment = {
947
1031
  }
948
1032
  : { connectOrCreate: {
949
1033
  where: {
950
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1034
+ id: item.alpacaAccount.id !== undefined ? {
1035
+ equals: item.alpacaAccount.id
1036
+ } : undefined,
1037
+ userId: item.alpacaAccount.userId !== undefined ? {
1038
+ equals: item.alpacaAccount.userId
1039
+ } : undefined,
951
1040
  },
952
1041
  create: {
953
1042
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -970,7 +1059,12 @@ export const NewsArticleAssetSentiment = {
970
1059
  }
971
1060
  : { connectOrCreate: item.actions.map((item) => ({
972
1061
  where: {
973
- id: item.id !== undefined ? item.id : undefined,
1062
+ id: item.id !== undefined ? {
1063
+ equals: item.id
1064
+ } : undefined,
1065
+ tradeId: item.tradeId !== undefined ? {
1066
+ equals: item.tradeId
1067
+ } : undefined,
974
1068
  },
975
1069
  create: {
976
1070
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -987,7 +1081,18 @@ export const NewsArticleAssetSentiment = {
987
1081
  orders: props.asset.orders ? {
988
1082
  upsert: props.asset.orders.map((item) => ({
989
1083
  where: {
990
- id: item.id !== undefined ? item.id : undefined,
1084
+ id: item.id !== undefined ? {
1085
+ equals: item.id
1086
+ } : undefined,
1087
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1088
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1089
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1090
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1091
+ equals: item.alpacaAccountId
1092
+ } : undefined,
1093
+ assetId: item.assetId !== undefined ? {
1094
+ equals: item.assetId
1095
+ } : undefined,
991
1096
  },
992
1097
  update: {
993
1098
  id: item.id !== undefined ? {
@@ -1065,6 +1170,9 @@ export const NewsArticleAssetSentiment = {
1065
1170
  id: item.stopLoss.id !== undefined ? {
1066
1171
  equals: item.stopLoss.id
1067
1172
  } : undefined,
1173
+ orderId: item.stopLoss.orderId !== undefined ? {
1174
+ equals: item.stopLoss.orderId
1175
+ } : undefined,
1068
1176
  },
1069
1177
  update: {
1070
1178
  id: item.stopLoss.id !== undefined ? {
@@ -1089,6 +1197,9 @@ export const NewsArticleAssetSentiment = {
1089
1197
  id: item.takeProfit.id !== undefined ? {
1090
1198
  equals: item.takeProfit.id
1091
1199
  } : undefined,
1200
+ orderId: item.takeProfit.orderId !== undefined ? {
1201
+ equals: item.takeProfit.orderId
1202
+ } : undefined,
1092
1203
  },
1093
1204
  update: {
1094
1205
  id: item.takeProfit.id !== undefined ? {
@@ -1113,6 +1224,9 @@ export const NewsArticleAssetSentiment = {
1113
1224
  id: item.alpacaAccount.id !== undefined ? {
1114
1225
  equals: item.alpacaAccount.id
1115
1226
  } : undefined,
1227
+ userId: item.alpacaAccount.userId !== undefined ? {
1228
+ equals: item.alpacaAccount.userId
1229
+ } : undefined,
1116
1230
  },
1117
1231
  update: {
1118
1232
  id: item.alpacaAccount.id !== undefined ? {
@@ -1165,6 +1279,9 @@ export const NewsArticleAssetSentiment = {
1165
1279
  id: item.action.id !== undefined ? {
1166
1280
  equals: item.action.id
1167
1281
  } : undefined,
1282
+ tradeId: item.action.tradeId !== undefined ? {
1283
+ equals: item.action.tradeId
1284
+ } : undefined,
1168
1285
  },
1169
1286
  update: {
1170
1287
  id: item.action.id !== undefined ? {
@@ -1227,7 +1344,10 @@ export const NewsArticleAssetSentiment = {
1227
1344
  }
1228
1345
  : { connectOrCreate: {
1229
1346
  where: {
1230
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1347
+ id: item.stopLoss.id !== undefined ? {
1348
+ equals: item.stopLoss.id
1349
+ } : undefined,
1350
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
1231
1351
  },
1232
1352
  create: {
1233
1353
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -1243,7 +1363,10 @@ export const NewsArticleAssetSentiment = {
1243
1363
  }
1244
1364
  : { connectOrCreate: {
1245
1365
  where: {
1246
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1366
+ id: item.takeProfit.id !== undefined ? {
1367
+ equals: item.takeProfit.id
1368
+ } : undefined,
1369
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
1247
1370
  },
1248
1371
  create: {
1249
1372
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -1259,7 +1382,12 @@ export const NewsArticleAssetSentiment = {
1259
1382
  }
1260
1383
  : { connectOrCreate: {
1261
1384
  where: {
1262
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1385
+ id: item.alpacaAccount.id !== undefined ? {
1386
+ equals: item.alpacaAccount.id
1387
+ } : undefined,
1388
+ userId: item.alpacaAccount.userId !== undefined ? {
1389
+ equals: item.alpacaAccount.userId
1390
+ } : undefined,
1263
1391
  },
1264
1392
  create: {
1265
1393
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1282,7 +1410,12 @@ export const NewsArticleAssetSentiment = {
1282
1410
  }
1283
1411
  : { connectOrCreate: {
1284
1412
  where: {
1285
- id: item.action.id !== undefined ? item.action.id : undefined,
1413
+ id: item.action.id !== undefined ? {
1414
+ equals: item.action.id
1415
+ } : undefined,
1416
+ tradeId: item.action.tradeId !== undefined ? {
1417
+ equals: item.action.tradeId
1418
+ } : undefined,
1286
1419
  },
1287
1420
  create: {
1288
1421
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -1299,7 +1432,15 @@ export const NewsArticleAssetSentiment = {
1299
1432
  positions: props.asset.positions ? {
1300
1433
  upsert: props.asset.positions.map((item) => ({
1301
1434
  where: {
1302
- id: item.id !== undefined ? item.id : undefined,
1435
+ id: item.id !== undefined ? {
1436
+ equals: item.id
1437
+ } : undefined,
1438
+ assetId: item.assetId !== undefined ? {
1439
+ equals: item.assetId
1440
+ } : undefined,
1441
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1442
+ equals: item.alpacaAccountId
1443
+ } : undefined,
1303
1444
  },
1304
1445
  update: {
1305
1446
  id: item.id !== undefined ? {
@@ -1350,6 +1491,9 @@ export const NewsArticleAssetSentiment = {
1350
1491
  id: item.alpacaAccount.id !== undefined ? {
1351
1492
  equals: item.alpacaAccount.id
1352
1493
  } : undefined,
1494
+ userId: item.alpacaAccount.userId !== undefined ? {
1495
+ equals: item.alpacaAccount.userId
1496
+ } : undefined,
1353
1497
  },
1354
1498
  update: {
1355
1499
  id: item.alpacaAccount.id !== undefined ? {
@@ -1419,7 +1563,12 @@ export const NewsArticleAssetSentiment = {
1419
1563
  }
1420
1564
  : { connectOrCreate: {
1421
1565
  where: {
1422
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1566
+ id: item.alpacaAccount.id !== undefined ? {
1567
+ equals: item.alpacaAccount.id
1568
+ } : undefined,
1569
+ userId: item.alpacaAccount.userId !== undefined ? {
1570
+ equals: item.alpacaAccount.userId
1571
+ } : undefined,
1423
1572
  },
1424
1573
  create: {
1425
1574
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1502,7 +1651,15 @@ export const NewsArticleAssetSentiment = {
1502
1651
  }
1503
1652
  : { connectOrCreate: props.asset.trades.map((item) => ({
1504
1653
  where: {
1505
- id: item.id !== undefined ? item.id : undefined,
1654
+ id: item.id !== undefined ? {
1655
+ equals: item.id
1656
+ } : undefined,
1657
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1658
+ equals: item.alpacaAccountId
1659
+ } : undefined,
1660
+ assetId: item.assetId !== undefined ? {
1661
+ equals: item.assetId
1662
+ } : undefined,
1506
1663
  },
1507
1664
  create: {
1508
1665
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -1524,7 +1681,12 @@ export const NewsArticleAssetSentiment = {
1524
1681
  }
1525
1682
  : { connectOrCreate: {
1526
1683
  where: {
1527
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1684
+ id: item.alpacaAccount.id !== undefined ? {
1685
+ equals: item.alpacaAccount.id
1686
+ } : undefined,
1687
+ userId: item.alpacaAccount.userId !== undefined ? {
1688
+ equals: item.alpacaAccount.userId
1689
+ } : undefined,
1528
1690
  },
1529
1691
  create: {
1530
1692
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1547,7 +1709,12 @@ export const NewsArticleAssetSentiment = {
1547
1709
  }
1548
1710
  : { connectOrCreate: item.actions.map((item) => ({
1549
1711
  where: {
1550
- id: item.id !== undefined ? item.id : undefined,
1712
+ id: item.id !== undefined ? {
1713
+ equals: item.id
1714
+ } : undefined,
1715
+ tradeId: item.tradeId !== undefined ? {
1716
+ equals: item.tradeId
1717
+ } : undefined,
1551
1718
  },
1552
1719
  create: {
1553
1720
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -1569,7 +1736,18 @@ export const NewsArticleAssetSentiment = {
1569
1736
  }
1570
1737
  : { connectOrCreate: props.asset.orders.map((item) => ({
1571
1738
  where: {
1572
- id: item.id !== undefined ? item.id : undefined,
1739
+ id: item.id !== undefined ? {
1740
+ equals: item.id
1741
+ } : undefined,
1742
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1743
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1744
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1745
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1746
+ equals: item.alpacaAccountId
1747
+ } : undefined,
1748
+ assetId: item.assetId !== undefined ? {
1749
+ equals: item.assetId
1750
+ } : undefined,
1573
1751
  },
1574
1752
  create: {
1575
1753
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1602,7 +1780,10 @@ export const NewsArticleAssetSentiment = {
1602
1780
  }
1603
1781
  : { connectOrCreate: {
1604
1782
  where: {
1605
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1783
+ id: item.stopLoss.id !== undefined ? {
1784
+ equals: item.stopLoss.id
1785
+ } : undefined,
1786
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
1606
1787
  },
1607
1788
  create: {
1608
1789
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -1618,7 +1799,10 @@ export const NewsArticleAssetSentiment = {
1618
1799
  }
1619
1800
  : { connectOrCreate: {
1620
1801
  where: {
1621
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1802
+ id: item.takeProfit.id !== undefined ? {
1803
+ equals: item.takeProfit.id
1804
+ } : undefined,
1805
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
1622
1806
  },
1623
1807
  create: {
1624
1808
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -1634,7 +1818,12 @@ export const NewsArticleAssetSentiment = {
1634
1818
  }
1635
1819
  : { connectOrCreate: {
1636
1820
  where: {
1637
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1821
+ id: item.alpacaAccount.id !== undefined ? {
1822
+ equals: item.alpacaAccount.id
1823
+ } : undefined,
1824
+ userId: item.alpacaAccount.userId !== undefined ? {
1825
+ equals: item.alpacaAccount.userId
1826
+ } : undefined,
1638
1827
  },
1639
1828
  create: {
1640
1829
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1657,7 +1846,12 @@ export const NewsArticleAssetSentiment = {
1657
1846
  }
1658
1847
  : { connectOrCreate: {
1659
1848
  where: {
1660
- id: item.action.id !== undefined ? item.action.id : undefined,
1849
+ id: item.action.id !== undefined ? {
1850
+ equals: item.action.id
1851
+ } : undefined,
1852
+ tradeId: item.action.tradeId !== undefined ? {
1853
+ equals: item.action.tradeId
1854
+ } : undefined,
1661
1855
  },
1662
1856
  create: {
1663
1857
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -1679,7 +1873,15 @@ export const NewsArticleAssetSentiment = {
1679
1873
  }
1680
1874
  : { connectOrCreate: props.asset.positions.map((item) => ({
1681
1875
  where: {
1682
- id: item.id !== undefined ? item.id : undefined,
1876
+ id: item.id !== undefined ? {
1877
+ equals: item.id
1878
+ } : undefined,
1879
+ assetId: item.assetId !== undefined ? {
1880
+ equals: item.assetId
1881
+ } : undefined,
1882
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1883
+ equals: item.alpacaAccountId
1884
+ } : undefined,
1683
1885
  },
1684
1886
  create: {
1685
1887
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1703,7 +1905,12 @@ export const NewsArticleAssetSentiment = {
1703
1905
  }
1704
1906
  : { connectOrCreate: {
1705
1907
  where: {
1706
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
1908
+ id: item.alpacaAccount.id !== undefined ? {
1909
+ equals: item.alpacaAccount.id
1910
+ } : undefined,
1911
+ userId: item.alpacaAccount.userId !== undefined ? {
1912
+ equals: item.alpacaAccount.userId
1913
+ } : undefined,
1707
1914
  },
1708
1915
  create: {
1709
1916
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1758,10 +1965,16 @@ export const NewsArticleAssetSentiment = {
1758
1965
  }`;
1759
1966
  const variables = props.map(prop => ({
1760
1967
  where: {
1761
- id: prop.id !== undefined ? prop.id : undefined,
1968
+ id: prop.id !== undefined ? {
1969
+ equals: prop.id
1970
+ } : undefined,
1762
1971
  url: prop.url !== undefined ? prop.url : undefined,
1763
- assetId: prop.assetId !== undefined ? prop.assetId : undefined,
1764
- newsArticleId: prop.newsArticleId !== undefined ? prop.newsArticleId : undefined,
1972
+ assetId: prop.assetId !== undefined ? {
1973
+ equals: prop.assetId
1974
+ } : undefined,
1975
+ newsArticleId: prop.newsArticleId !== undefined ? {
1976
+ equals: prop.newsArticleId
1977
+ } : undefined,
1765
1978
  relevancyScore: prop.relevancyScore !== undefined ? prop.relevancyScore : undefined,
1766
1979
  sentimentScore: prop.sentimentScore !== undefined ? prop.sentimentScore : undefined,
1767
1980
  sentimentLabel: prop.sentimentLabel !== undefined ? prop.sentimentLabel : undefined,
@@ -2041,7 +2254,15 @@ export const NewsArticleAssetSentiment = {
2041
2254
  trades: prop.asset.trades ? {
2042
2255
  upsert: prop.asset.trades.map((item) => ({
2043
2256
  where: {
2044
- id: item.id !== undefined ? item.id : undefined,
2257
+ id: item.id !== undefined ? {
2258
+ equals: item.id
2259
+ } : undefined,
2260
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2261
+ equals: item.alpacaAccountId
2262
+ } : undefined,
2263
+ assetId: item.assetId !== undefined ? {
2264
+ equals: item.assetId
2265
+ } : undefined,
2045
2266
  },
2046
2267
  update: {
2047
2268
  id: item.id !== undefined ? {
@@ -2086,6 +2307,9 @@ export const NewsArticleAssetSentiment = {
2086
2307
  id: item.alpacaAccount.id !== undefined ? {
2087
2308
  equals: item.alpacaAccount.id
2088
2309
  } : undefined,
2310
+ userId: item.alpacaAccount.userId !== undefined ? {
2311
+ equals: item.alpacaAccount.userId
2312
+ } : undefined,
2089
2313
  },
2090
2314
  update: {
2091
2315
  id: item.alpacaAccount.id !== undefined ? {
@@ -2135,7 +2359,12 @@ export const NewsArticleAssetSentiment = {
2135
2359
  actions: item.actions ? {
2136
2360
  upsert: item.actions.map((item) => ({
2137
2361
  where: {
2138
- id: item.id !== undefined ? item.id : undefined,
2362
+ id: item.id !== undefined ? {
2363
+ equals: item.id
2364
+ } : undefined,
2365
+ tradeId: item.tradeId !== undefined ? {
2366
+ equals: item.tradeId
2367
+ } : undefined,
2139
2368
  },
2140
2369
  update: {
2141
2370
  id: item.id !== undefined ? {
@@ -2187,7 +2416,12 @@ export const NewsArticleAssetSentiment = {
2187
2416
  }
2188
2417
  : { connectOrCreate: {
2189
2418
  where: {
2190
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2419
+ id: item.alpacaAccount.id !== undefined ? {
2420
+ equals: item.alpacaAccount.id
2421
+ } : undefined,
2422
+ userId: item.alpacaAccount.userId !== undefined ? {
2423
+ equals: item.alpacaAccount.userId
2424
+ } : undefined,
2191
2425
  },
2192
2426
  create: {
2193
2427
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2210,7 +2444,12 @@ export const NewsArticleAssetSentiment = {
2210
2444
  }
2211
2445
  : { connectOrCreate: item.actions.map((item) => ({
2212
2446
  where: {
2213
- id: item.id !== undefined ? item.id : undefined,
2447
+ id: item.id !== undefined ? {
2448
+ equals: item.id
2449
+ } : undefined,
2450
+ tradeId: item.tradeId !== undefined ? {
2451
+ equals: item.tradeId
2452
+ } : undefined,
2214
2453
  },
2215
2454
  create: {
2216
2455
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2227,7 +2466,18 @@ export const NewsArticleAssetSentiment = {
2227
2466
  orders: prop.asset.orders ? {
2228
2467
  upsert: prop.asset.orders.map((item) => ({
2229
2468
  where: {
2230
- id: item.id !== undefined ? item.id : undefined,
2469
+ id: item.id !== undefined ? {
2470
+ equals: item.id
2471
+ } : undefined,
2472
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2473
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2474
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2475
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2476
+ equals: item.alpacaAccountId
2477
+ } : undefined,
2478
+ assetId: item.assetId !== undefined ? {
2479
+ equals: item.assetId
2480
+ } : undefined,
2231
2481
  },
2232
2482
  update: {
2233
2483
  id: item.id !== undefined ? {
@@ -2305,6 +2555,9 @@ export const NewsArticleAssetSentiment = {
2305
2555
  id: item.stopLoss.id !== undefined ? {
2306
2556
  equals: item.stopLoss.id
2307
2557
  } : undefined,
2558
+ orderId: item.stopLoss.orderId !== undefined ? {
2559
+ equals: item.stopLoss.orderId
2560
+ } : undefined,
2308
2561
  },
2309
2562
  update: {
2310
2563
  id: item.stopLoss.id !== undefined ? {
@@ -2329,6 +2582,9 @@ export const NewsArticleAssetSentiment = {
2329
2582
  id: item.takeProfit.id !== undefined ? {
2330
2583
  equals: item.takeProfit.id
2331
2584
  } : undefined,
2585
+ orderId: item.takeProfit.orderId !== undefined ? {
2586
+ equals: item.takeProfit.orderId
2587
+ } : undefined,
2332
2588
  },
2333
2589
  update: {
2334
2590
  id: item.takeProfit.id !== undefined ? {
@@ -2353,6 +2609,9 @@ export const NewsArticleAssetSentiment = {
2353
2609
  id: item.alpacaAccount.id !== undefined ? {
2354
2610
  equals: item.alpacaAccount.id
2355
2611
  } : undefined,
2612
+ userId: item.alpacaAccount.userId !== undefined ? {
2613
+ equals: item.alpacaAccount.userId
2614
+ } : undefined,
2356
2615
  },
2357
2616
  update: {
2358
2617
  id: item.alpacaAccount.id !== undefined ? {
@@ -2405,6 +2664,9 @@ export const NewsArticleAssetSentiment = {
2405
2664
  id: item.action.id !== undefined ? {
2406
2665
  equals: item.action.id
2407
2666
  } : undefined,
2667
+ tradeId: item.action.tradeId !== undefined ? {
2668
+ equals: item.action.tradeId
2669
+ } : undefined,
2408
2670
  },
2409
2671
  update: {
2410
2672
  id: item.action.id !== undefined ? {
@@ -2467,7 +2729,10 @@ export const NewsArticleAssetSentiment = {
2467
2729
  }
2468
2730
  : { connectOrCreate: {
2469
2731
  where: {
2470
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
2732
+ id: item.stopLoss.id !== undefined ? {
2733
+ equals: item.stopLoss.id
2734
+ } : undefined,
2735
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2471
2736
  },
2472
2737
  create: {
2473
2738
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2483,7 +2748,10 @@ export const NewsArticleAssetSentiment = {
2483
2748
  }
2484
2749
  : { connectOrCreate: {
2485
2750
  where: {
2486
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
2751
+ id: item.takeProfit.id !== undefined ? {
2752
+ equals: item.takeProfit.id
2753
+ } : undefined,
2754
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2487
2755
  },
2488
2756
  create: {
2489
2757
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2499,7 +2767,12 @@ export const NewsArticleAssetSentiment = {
2499
2767
  }
2500
2768
  : { connectOrCreate: {
2501
2769
  where: {
2502
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2770
+ id: item.alpacaAccount.id !== undefined ? {
2771
+ equals: item.alpacaAccount.id
2772
+ } : undefined,
2773
+ userId: item.alpacaAccount.userId !== undefined ? {
2774
+ equals: item.alpacaAccount.userId
2775
+ } : undefined,
2503
2776
  },
2504
2777
  create: {
2505
2778
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2522,7 +2795,12 @@ export const NewsArticleAssetSentiment = {
2522
2795
  }
2523
2796
  : { connectOrCreate: {
2524
2797
  where: {
2525
- id: item.action.id !== undefined ? item.action.id : undefined,
2798
+ id: item.action.id !== undefined ? {
2799
+ equals: item.action.id
2800
+ } : undefined,
2801
+ tradeId: item.action.tradeId !== undefined ? {
2802
+ equals: item.action.tradeId
2803
+ } : undefined,
2526
2804
  },
2527
2805
  create: {
2528
2806
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2539,7 +2817,15 @@ export const NewsArticleAssetSentiment = {
2539
2817
  positions: prop.asset.positions ? {
2540
2818
  upsert: prop.asset.positions.map((item) => ({
2541
2819
  where: {
2542
- id: item.id !== undefined ? item.id : undefined,
2820
+ id: item.id !== undefined ? {
2821
+ equals: item.id
2822
+ } : undefined,
2823
+ assetId: item.assetId !== undefined ? {
2824
+ equals: item.assetId
2825
+ } : undefined,
2826
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2827
+ equals: item.alpacaAccountId
2828
+ } : undefined,
2543
2829
  },
2544
2830
  update: {
2545
2831
  id: item.id !== undefined ? {
@@ -2590,6 +2876,9 @@ export const NewsArticleAssetSentiment = {
2590
2876
  id: item.alpacaAccount.id !== undefined ? {
2591
2877
  equals: item.alpacaAccount.id
2592
2878
  } : undefined,
2879
+ userId: item.alpacaAccount.userId !== undefined ? {
2880
+ equals: item.alpacaAccount.userId
2881
+ } : undefined,
2593
2882
  },
2594
2883
  update: {
2595
2884
  id: item.alpacaAccount.id !== undefined ? {
@@ -2659,7 +2948,12 @@ export const NewsArticleAssetSentiment = {
2659
2948
  }
2660
2949
  : { connectOrCreate: {
2661
2950
  where: {
2662
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2951
+ id: item.alpacaAccount.id !== undefined ? {
2952
+ equals: item.alpacaAccount.id
2953
+ } : undefined,
2954
+ userId: item.alpacaAccount.userId !== undefined ? {
2955
+ equals: item.alpacaAccount.userId
2956
+ } : undefined,
2663
2957
  },
2664
2958
  create: {
2665
2959
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2742,7 +3036,15 @@ export const NewsArticleAssetSentiment = {
2742
3036
  }
2743
3037
  : { connectOrCreate: prop.asset.trades.map((item) => ({
2744
3038
  where: {
2745
- id: item.id !== undefined ? item.id : undefined,
3039
+ id: item.id !== undefined ? {
3040
+ equals: item.id
3041
+ } : undefined,
3042
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3043
+ equals: item.alpacaAccountId
3044
+ } : undefined,
3045
+ assetId: item.assetId !== undefined ? {
3046
+ equals: item.assetId
3047
+ } : undefined,
2746
3048
  },
2747
3049
  create: {
2748
3050
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2764,7 +3066,12 @@ export const NewsArticleAssetSentiment = {
2764
3066
  }
2765
3067
  : { connectOrCreate: {
2766
3068
  where: {
2767
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3069
+ id: item.alpacaAccount.id !== undefined ? {
3070
+ equals: item.alpacaAccount.id
3071
+ } : undefined,
3072
+ userId: item.alpacaAccount.userId !== undefined ? {
3073
+ equals: item.alpacaAccount.userId
3074
+ } : undefined,
2768
3075
  },
2769
3076
  create: {
2770
3077
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2787,7 +3094,12 @@ export const NewsArticleAssetSentiment = {
2787
3094
  }
2788
3095
  : { connectOrCreate: item.actions.map((item) => ({
2789
3096
  where: {
2790
- id: item.id !== undefined ? item.id : undefined,
3097
+ id: item.id !== undefined ? {
3098
+ equals: item.id
3099
+ } : undefined,
3100
+ tradeId: item.tradeId !== undefined ? {
3101
+ equals: item.tradeId
3102
+ } : undefined,
2791
3103
  },
2792
3104
  create: {
2793
3105
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2809,7 +3121,18 @@ export const NewsArticleAssetSentiment = {
2809
3121
  }
2810
3122
  : { connectOrCreate: prop.asset.orders.map((item) => ({
2811
3123
  where: {
2812
- id: item.id !== undefined ? item.id : undefined,
3124
+ id: item.id !== undefined ? {
3125
+ equals: item.id
3126
+ } : undefined,
3127
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3128
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3129
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3130
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3131
+ equals: item.alpacaAccountId
3132
+ } : undefined,
3133
+ assetId: item.assetId !== undefined ? {
3134
+ equals: item.assetId
3135
+ } : undefined,
2813
3136
  },
2814
3137
  create: {
2815
3138
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2842,7 +3165,10 @@ export const NewsArticleAssetSentiment = {
2842
3165
  }
2843
3166
  : { connectOrCreate: {
2844
3167
  where: {
2845
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3168
+ id: item.stopLoss.id !== undefined ? {
3169
+ equals: item.stopLoss.id
3170
+ } : undefined,
3171
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2846
3172
  },
2847
3173
  create: {
2848
3174
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2858,7 +3184,10 @@ export const NewsArticleAssetSentiment = {
2858
3184
  }
2859
3185
  : { connectOrCreate: {
2860
3186
  where: {
2861
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3187
+ id: item.takeProfit.id !== undefined ? {
3188
+ equals: item.takeProfit.id
3189
+ } : undefined,
3190
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2862
3191
  },
2863
3192
  create: {
2864
3193
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2874,7 +3203,12 @@ export const NewsArticleAssetSentiment = {
2874
3203
  }
2875
3204
  : { connectOrCreate: {
2876
3205
  where: {
2877
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3206
+ id: item.alpacaAccount.id !== undefined ? {
3207
+ equals: item.alpacaAccount.id
3208
+ } : undefined,
3209
+ userId: item.alpacaAccount.userId !== undefined ? {
3210
+ equals: item.alpacaAccount.userId
3211
+ } : undefined,
2878
3212
  },
2879
3213
  create: {
2880
3214
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2897,7 +3231,12 @@ export const NewsArticleAssetSentiment = {
2897
3231
  }
2898
3232
  : { connectOrCreate: {
2899
3233
  where: {
2900
- id: item.action.id !== undefined ? item.action.id : undefined,
3234
+ id: item.action.id !== undefined ? {
3235
+ equals: item.action.id
3236
+ } : undefined,
3237
+ tradeId: item.action.tradeId !== undefined ? {
3238
+ equals: item.action.tradeId
3239
+ } : undefined,
2901
3240
  },
2902
3241
  create: {
2903
3242
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2919,7 +3258,15 @@ export const NewsArticleAssetSentiment = {
2919
3258
  }
2920
3259
  : { connectOrCreate: prop.asset.positions.map((item) => ({
2921
3260
  where: {
2922
- id: item.id !== undefined ? item.id : undefined,
3261
+ id: item.id !== undefined ? {
3262
+ equals: item.id
3263
+ } : undefined,
3264
+ assetId: item.assetId !== undefined ? {
3265
+ equals: item.assetId
3266
+ } : undefined,
3267
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3268
+ equals: item.alpacaAccountId
3269
+ } : undefined,
2923
3270
  },
2924
3271
  create: {
2925
3272
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2943,7 +3290,12 @@ export const NewsArticleAssetSentiment = {
2943
3290
  }
2944
3291
  : { connectOrCreate: {
2945
3292
  where: {
2946
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3293
+ id: item.alpacaAccount.id !== undefined ? {
3294
+ equals: item.alpacaAccount.id
3295
+ } : undefined,
3296
+ userId: item.alpacaAccount.userId !== undefined ? {
3297
+ equals: item.alpacaAccount.userId
3298
+ } : undefined,
2947
3299
  },
2948
3300
  create: {
2949
3301
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -3033,10 +3385,16 @@ export const NewsArticleAssetSentiment = {
3033
3385
  }`;
3034
3386
  const variables = {
3035
3387
  where: {
3036
- id: props.id !== undefined ? props.id : undefined,
3388
+ id: props.id !== undefined ? {
3389
+ equals: props.id
3390
+ } : undefined,
3037
3391
  url: props.url !== undefined ? props.url : undefined,
3038
- assetId: props.assetId !== undefined ? props.assetId : undefined,
3039
- newsArticleId: props.newsArticleId !== undefined ? props.newsArticleId : undefined,
3392
+ assetId: props.assetId !== undefined ? {
3393
+ equals: props.assetId
3394
+ } : undefined,
3395
+ newsArticleId: props.newsArticleId !== undefined ? {
3396
+ equals: props.newsArticleId
3397
+ } : undefined,
3040
3398
  relevancyScore: props.relevancyScore !== undefined ? props.relevancyScore : undefined,
3041
3399
  sentimentScore: props.sentimentScore !== undefined ? props.sentimentScore : undefined,
3042
3400
  sentimentLabel: props.sentimentLabel !== undefined ? props.sentimentLabel : undefined,
@@ -3105,8 +3463,12 @@ export const NewsArticleAssetSentiment = {
3105
3463
  id: props.id !== undefined ? {
3106
3464
  equals: props.id
3107
3465
  } : undefined,
3108
- assetId: props.assetId !== undefined ? props.assetId : undefined,
3109
- newsArticleId: props.newsArticleId !== undefined ? props.newsArticleId : undefined,
3466
+ assetId: props.assetId !== undefined ? {
3467
+ equals: props.assetId
3468
+ } : undefined,
3469
+ newsArticleId: props.newsArticleId !== undefined ? {
3470
+ equals: props.newsArticleId
3471
+ } : undefined,
3110
3472
  url: props.url !== undefined ? {
3111
3473
  equals: props.url
3112
3474
  } : undefined,