adaptic-backend 1.0.159 → 1.0.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/Account.cjs +285 -8
  2. package/Action.cjs +615 -4
  3. package/Alert.cjs +338 -4
  4. package/AlpacaAccount.cjs +771 -4
  5. package/Asset.cjs +642 -0
  6. package/Authenticator.cjs +288 -4
  7. package/Customer.cjs +273 -10
  8. package/NewsArticle.cjs +165 -0
  9. package/NewsArticleAssetSentiment.cjs +256 -8
  10. package/Order.cjs +510 -10
  11. package/Position.cjs +546 -8
  12. package/Session.cjs +288 -4
  13. package/StopLoss.cjs +348 -1
  14. package/TakeProfit.cjs +348 -1
  15. package/Trade.cjs +607 -8
  16. package/User.cjs +261 -0
  17. package/package.json +1 -1
  18. package/server/Account.d.ts.map +1 -1
  19. package/server/Account.js.map +1 -1
  20. package/server/Account.mjs +285 -8
  21. package/server/Action.d.ts.map +1 -1
  22. package/server/Action.js.map +1 -1
  23. package/server/Action.mjs +615 -4
  24. package/server/Alert.d.ts.map +1 -1
  25. package/server/Alert.js.map +1 -1
  26. package/server/Alert.mjs +338 -4
  27. package/server/AlpacaAccount.d.ts.map +1 -1
  28. package/server/AlpacaAccount.js.map +1 -1
  29. package/server/AlpacaAccount.mjs +771 -4
  30. package/server/Asset.d.ts.map +1 -1
  31. package/server/Asset.js.map +1 -1
  32. package/server/Asset.mjs +642 -0
  33. package/server/Authenticator.d.ts.map +1 -1
  34. package/server/Authenticator.js.map +1 -1
  35. package/server/Authenticator.mjs +288 -4
  36. package/server/Customer.d.ts.map +1 -1
  37. package/server/Customer.js.map +1 -1
  38. package/server/Customer.mjs +273 -10
  39. package/server/NewsArticle.d.ts.map +1 -1
  40. package/server/NewsArticle.js.map +1 -1
  41. package/server/NewsArticle.mjs +165 -0
  42. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  43. package/server/NewsArticleAssetSentiment.js.map +1 -1
  44. package/server/NewsArticleAssetSentiment.mjs +256 -8
  45. package/server/Order.d.ts.map +1 -1
  46. package/server/Order.js.map +1 -1
  47. package/server/Order.mjs +510 -10
  48. package/server/Position.d.ts.map +1 -1
  49. package/server/Position.js.map +1 -1
  50. package/server/Position.mjs +546 -8
  51. package/server/Session.d.ts.map +1 -1
  52. package/server/Session.js.map +1 -1
  53. package/server/Session.mjs +288 -4
  54. package/server/StopLoss.d.ts.map +1 -1
  55. package/server/StopLoss.js.map +1 -1
  56. package/server/StopLoss.mjs +348 -1
  57. package/server/TakeProfit.d.ts.map +1 -1
  58. package/server/TakeProfit.js.map +1 -1
  59. package/server/TakeProfit.mjs +348 -1
  60. package/server/Trade.d.ts.map +1 -1
  61. package/server/Trade.js.map +1 -1
  62. package/server/Trade.mjs +607 -8
  63. package/server/User.d.ts.map +1 -1
  64. package/server/User.js.map +1 -1
  65. package/server/User.mjs +261 -0
package/Action.cjs CHANGED
@@ -197,6 +197,12 @@ exports.Action = {
197
197
  : { connectOrCreate: {
198
198
  where: {
199
199
  id: props.trade.id !== undefined ? props.trade.id : undefined,
200
+ alpacaAccountId: props.trade.alpacaAccountId !== undefined ? {
201
+ equals: props.trade.alpacaAccountId
202
+ } : undefined,
203
+ assetId: props.trade.assetId !== undefined ? {
204
+ equals: props.trade.assetId
205
+ } : undefined,
200
206
  },
201
207
  create: {
202
208
  qty: props.trade.qty !== undefined ? props.trade.qty : undefined,
@@ -219,6 +225,9 @@ exports.Action = {
219
225
  : { connectOrCreate: {
220
226
  where: {
221
227
  id: props.trade.alpacaAccount.id !== undefined ? props.trade.alpacaAccount.id : undefined,
228
+ userId: props.trade.alpacaAccount.userId !== undefined ? {
229
+ equals: props.trade.alpacaAccount.userId
230
+ } : undefined,
222
231
  },
223
232
  create: {
224
233
  type: props.trade.alpacaAccount.type !== undefined ? props.trade.alpacaAccount.type : undefined,
@@ -268,6 +277,15 @@ exports.Action = {
268
277
  : { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
269
278
  where: {
270
279
  id: item.id !== undefined ? item.id : undefined,
280
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
281
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
282
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
283
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
284
+ equals: item.alpacaAccountId
285
+ } : undefined,
286
+ assetId: item.assetId !== undefined ? {
287
+ equals: item.assetId
288
+ } : undefined,
271
289
  },
272
290
  create: {
273
291
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -304,6 +322,12 @@ exports.Action = {
304
322
  : { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
305
323
  where: {
306
324
  id: item.id !== undefined ? item.id : undefined,
325
+ assetId: item.assetId !== undefined ? {
326
+ equals: item.assetId
327
+ } : undefined,
328
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
329
+ equals: item.alpacaAccountId
330
+ } : undefined,
307
331
  },
308
332
  create: {
309
333
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -331,6 +355,9 @@ exports.Action = {
331
355
  : { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
332
356
  where: {
333
357
  id: item.id !== undefined ? item.id : undefined,
358
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
359
+ equals: item.alpacaAccountId
360
+ } : undefined,
334
361
  },
335
362
  create: {
336
363
  message: item.message !== undefined ? item.message : undefined,
@@ -419,6 +446,15 @@ exports.Action = {
419
446
  : { connectOrCreate: props.trade.asset.orders.map((item) => ({
420
447
  where: {
421
448
  id: item.id !== undefined ? item.id : undefined,
449
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
450
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
451
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
452
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
453
+ equals: item.alpacaAccountId
454
+ } : undefined,
455
+ assetId: item.assetId !== undefined ? {
456
+ equals: item.assetId
457
+ } : undefined,
422
458
  },
423
459
  create: {
424
460
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -455,6 +491,12 @@ exports.Action = {
455
491
  : { connectOrCreate: props.trade.asset.positions.map((item) => ({
456
492
  where: {
457
493
  id: item.id !== undefined ? item.id : undefined,
494
+ assetId: item.assetId !== undefined ? {
495
+ equals: item.assetId
496
+ } : undefined,
497
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
498
+ equals: item.alpacaAccountId
499
+ } : undefined,
458
500
  },
459
501
  create: {
460
502
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -483,6 +525,12 @@ exports.Action = {
483
525
  where: {
484
526
  id: item.id !== undefined ? item.id : undefined,
485
527
  url: item.url !== undefined ? item.url : undefined,
528
+ assetId: item.assetId !== undefined ? {
529
+ equals: item.assetId
530
+ } : undefined,
531
+ newsArticleId: item.newsArticleId !== undefined ? {
532
+ equals: item.newsArticleId
533
+ } : undefined,
486
534
  },
487
535
  create: {
488
536
  url: item.url !== undefined ? item.url : undefined,
@@ -507,6 +555,15 @@ exports.Action = {
507
555
  : { connectOrCreate: {
508
556
  where: {
509
557
  id: props.order.id !== undefined ? props.order.id : undefined,
558
+ clientOrderId: props.order.clientOrderId !== undefined ? props.order.clientOrderId : undefined,
559
+ actionId: props.order.actionId !== undefined ? props.order.actionId : undefined,
560
+ stopLossId: props.order.stopLossId !== undefined ? props.order.stopLossId : undefined,
561
+ alpacaAccountId: props.order.alpacaAccountId !== undefined ? {
562
+ equals: props.order.alpacaAccountId
563
+ } : undefined,
564
+ assetId: props.order.assetId !== undefined ? {
565
+ equals: props.order.assetId
566
+ } : undefined,
510
567
  },
511
568
  create: {
512
569
  clientOrderId: props.order.clientOrderId !== undefined ? props.order.clientOrderId : undefined,
@@ -540,6 +597,7 @@ exports.Action = {
540
597
  : { connectOrCreate: {
541
598
  where: {
542
599
  id: props.order.stopLoss.id !== undefined ? props.order.stopLoss.id : undefined,
600
+ orderId: props.order.stopLoss.orderId !== undefined ? props.order.stopLoss.orderId : undefined,
543
601
  },
544
602
  create: {
545
603
  stopPrice: props.order.stopLoss.stopPrice !== undefined ? props.order.stopLoss.stopPrice : undefined,
@@ -556,6 +614,7 @@ exports.Action = {
556
614
  : { connectOrCreate: {
557
615
  where: {
558
616
  id: props.order.takeProfit.id !== undefined ? props.order.takeProfit.id : undefined,
617
+ orderId: props.order.takeProfit.orderId !== undefined ? props.order.takeProfit.orderId : undefined,
559
618
  },
560
619
  create: {
561
620
  limitPrice: props.order.takeProfit.limitPrice !== undefined ? props.order.takeProfit.limitPrice : undefined,
@@ -572,6 +631,9 @@ exports.Action = {
572
631
  : { connectOrCreate: {
573
632
  where: {
574
633
  id: props.order.alpacaAccount.id !== undefined ? props.order.alpacaAccount.id : undefined,
634
+ userId: props.order.alpacaAccount.userId !== undefined ? {
635
+ equals: props.order.alpacaAccount.userId
636
+ } : undefined,
575
637
  },
576
638
  create: {
577
639
  type: props.order.alpacaAccount.type !== undefined ? props.order.alpacaAccount.type : undefined,
@@ -621,6 +683,12 @@ exports.Action = {
621
683
  : { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
622
684
  where: {
623
685
  id: item.id !== undefined ? item.id : undefined,
686
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
687
+ equals: item.alpacaAccountId
688
+ } : undefined,
689
+ assetId: item.assetId !== undefined ? {
690
+ equals: item.assetId
691
+ } : undefined,
624
692
  },
625
693
  create: {
626
694
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -646,6 +714,12 @@ exports.Action = {
646
714
  : { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
647
715
  where: {
648
716
  id: item.id !== undefined ? item.id : undefined,
717
+ assetId: item.assetId !== undefined ? {
718
+ equals: item.assetId
719
+ } : undefined,
720
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
721
+ equals: item.alpacaAccountId
722
+ } : undefined,
649
723
  },
650
724
  create: {
651
725
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -673,6 +747,9 @@ exports.Action = {
673
747
  : { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
674
748
  where: {
675
749
  id: item.id !== undefined ? item.id : undefined,
750
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
751
+ equals: item.alpacaAccountId
752
+ } : undefined,
676
753
  },
677
754
  create: {
678
755
  message: item.message !== undefined ? item.message : undefined,
@@ -761,6 +838,12 @@ exports.Action = {
761
838
  : { connectOrCreate: props.order.asset.trades.map((item) => ({
762
839
  where: {
763
840
  id: item.id !== undefined ? item.id : undefined,
841
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
842
+ equals: item.alpacaAccountId
843
+ } : undefined,
844
+ assetId: item.assetId !== undefined ? {
845
+ equals: item.assetId
846
+ } : undefined,
764
847
  },
765
848
  create: {
766
849
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -786,6 +869,12 @@ exports.Action = {
786
869
  : { connectOrCreate: props.order.asset.positions.map((item) => ({
787
870
  where: {
788
871
  id: item.id !== undefined ? item.id : undefined,
872
+ assetId: item.assetId !== undefined ? {
873
+ equals: item.assetId
874
+ } : undefined,
875
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
876
+ equals: item.alpacaAccountId
877
+ } : undefined,
789
878
  },
790
879
  create: {
791
880
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -814,6 +903,12 @@ exports.Action = {
814
903
  where: {
815
904
  id: item.id !== undefined ? item.id : undefined,
816
905
  url: item.url !== undefined ? item.url : undefined,
906
+ assetId: item.assetId !== undefined ? {
907
+ equals: item.assetId
908
+ } : undefined,
909
+ newsArticleId: item.newsArticleId !== undefined ? {
910
+ equals: item.newsArticleId
911
+ } : undefined,
817
912
  },
818
913
  create: {
819
914
  url: item.url !== undefined ? item.url : undefined,
@@ -905,7 +1000,9 @@ exports.Action = {
905
1000
  where: {
906
1001
  id: props.id !== undefined ? props.id : undefined,
907
1002
  sequence: props.sequence !== undefined ? props.sequence : undefined,
908
- tradeId: props.tradeId !== undefined ? props.tradeId : undefined,
1003
+ tradeId: props.tradeId !== undefined ? {
1004
+ equals: props.tradeId
1005
+ } : undefined,
909
1006
  type: props.type !== undefined ? props.type : undefined,
910
1007
  note: props.note !== undefined ? props.note : undefined,
911
1008
  status: props.status !== undefined ? props.status : undefined,
@@ -935,6 +1032,12 @@ exports.Action = {
935
1032
  id: props.trade.id !== undefined ? {
936
1033
  equals: props.trade.id
937
1034
  } : undefined,
1035
+ alpacaAccountId: props.trade.alpacaAccountId !== undefined ? {
1036
+ equals: props.trade.alpacaAccountId
1037
+ } : undefined,
1038
+ assetId: props.trade.assetId !== undefined ? {
1039
+ equals: props.trade.assetId
1040
+ } : undefined,
938
1041
  },
939
1042
  update: {
940
1043
  id: props.trade.id !== undefined ? {
@@ -979,6 +1082,9 @@ exports.Action = {
979
1082
  id: props.trade.alpacaAccount.id !== undefined ? {
980
1083
  equals: props.trade.alpacaAccount.id
981
1084
  } : undefined,
1085
+ userId: props.trade.alpacaAccount.userId !== undefined ? {
1086
+ equals: props.trade.alpacaAccount.userId
1087
+ } : undefined,
982
1088
  },
983
1089
  update: {
984
1090
  id: props.trade.alpacaAccount.id !== undefined ? {
@@ -1081,6 +1187,15 @@ exports.Action = {
1081
1187
  upsert: props.trade.alpacaAccount.orders.map((item) => ({
1082
1188
  where: {
1083
1189
  id: item.id !== undefined ? item.id : undefined,
1190
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1191
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1192
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1193
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1194
+ equals: item.alpacaAccountId
1195
+ } : undefined,
1196
+ assetId: item.assetId !== undefined ? {
1197
+ equals: item.assetId
1198
+ } : undefined,
1084
1199
  },
1085
1200
  update: {
1086
1201
  id: item.id !== undefined ? {
@@ -1183,6 +1298,12 @@ exports.Action = {
1183
1298
  upsert: props.trade.alpacaAccount.positions.map((item) => ({
1184
1299
  where: {
1185
1300
  id: item.id !== undefined ? item.id : undefined,
1301
+ assetId: item.assetId !== undefined ? {
1302
+ equals: item.assetId
1303
+ } : undefined,
1304
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1305
+ equals: item.alpacaAccountId
1306
+ } : undefined,
1186
1307
  },
1187
1308
  update: {
1188
1309
  id: item.id !== undefined ? {
@@ -1249,6 +1370,9 @@ exports.Action = {
1249
1370
  upsert: props.trade.alpacaAccount.alerts.map((item) => ({
1250
1371
  where: {
1251
1372
  id: item.id !== undefined ? item.id : undefined,
1373
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1374
+ equals: item.alpacaAccountId
1375
+ } : undefined,
1252
1376
  },
1253
1377
  update: {
1254
1378
  id: item.id !== undefined ? {
@@ -1320,6 +1444,15 @@ exports.Action = {
1320
1444
  : { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
1321
1445
  where: {
1322
1446
  id: item.id !== undefined ? item.id : undefined,
1447
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1448
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1449
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1450
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1451
+ equals: item.alpacaAccountId
1452
+ } : undefined,
1453
+ assetId: item.assetId !== undefined ? {
1454
+ equals: item.assetId
1455
+ } : undefined,
1323
1456
  },
1324
1457
  create: {
1325
1458
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1356,6 +1489,12 @@ exports.Action = {
1356
1489
  : { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
1357
1490
  where: {
1358
1491
  id: item.id !== undefined ? item.id : undefined,
1492
+ assetId: item.assetId !== undefined ? {
1493
+ equals: item.assetId
1494
+ } : undefined,
1495
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1496
+ equals: item.alpacaAccountId
1497
+ } : undefined,
1359
1498
  },
1360
1499
  create: {
1361
1500
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1383,6 +1522,9 @@ exports.Action = {
1383
1522
  : { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
1384
1523
  where: {
1385
1524
  id: item.id !== undefined ? item.id : undefined,
1525
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1526
+ equals: item.alpacaAccountId
1527
+ } : undefined,
1386
1528
  },
1387
1529
  create: {
1388
1530
  message: item.message !== undefined ? item.message : undefined,
@@ -1580,6 +1722,15 @@ exports.Action = {
1580
1722
  upsert: props.trade.asset.orders.map((item) => ({
1581
1723
  where: {
1582
1724
  id: item.id !== undefined ? item.id : undefined,
1725
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1726
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1727
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1728
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1729
+ equals: item.alpacaAccountId
1730
+ } : undefined,
1731
+ assetId: item.assetId !== undefined ? {
1732
+ equals: item.assetId
1733
+ } : undefined,
1583
1734
  },
1584
1735
  update: {
1585
1736
  id: item.id !== undefined ? {
@@ -1682,6 +1833,12 @@ exports.Action = {
1682
1833
  upsert: props.trade.asset.positions.map((item) => ({
1683
1834
  where: {
1684
1835
  id: item.id !== undefined ? item.id : undefined,
1836
+ assetId: item.assetId !== undefined ? {
1837
+ equals: item.assetId
1838
+ } : undefined,
1839
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1840
+ equals: item.alpacaAccountId
1841
+ } : undefined,
1685
1842
  },
1686
1843
  update: {
1687
1844
  id: item.id !== undefined ? {
@@ -1749,6 +1906,12 @@ exports.Action = {
1749
1906
  where: {
1750
1907
  id: item.id !== undefined ? item.id : undefined,
1751
1908
  url: item.url !== undefined ? item.url : undefined,
1909
+ assetId: item.assetId !== undefined ? {
1910
+ equals: item.assetId
1911
+ } : undefined,
1912
+ newsArticleId: item.newsArticleId !== undefined ? {
1913
+ equals: item.newsArticleId
1914
+ } : undefined,
1752
1915
  },
1753
1916
  update: {
1754
1917
  id: item.id !== undefined ? {
@@ -1841,6 +2004,15 @@ exports.Action = {
1841
2004
  : { connectOrCreate: props.trade.asset.orders.map((item) => ({
1842
2005
  where: {
1843
2006
  id: item.id !== undefined ? item.id : undefined,
2007
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2008
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2009
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2010
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2011
+ equals: item.alpacaAccountId
2012
+ } : undefined,
2013
+ assetId: item.assetId !== undefined ? {
2014
+ equals: item.assetId
2015
+ } : undefined,
1844
2016
  },
1845
2017
  create: {
1846
2018
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1877,6 +2049,12 @@ exports.Action = {
1877
2049
  : { connectOrCreate: props.trade.asset.positions.map((item) => ({
1878
2050
  where: {
1879
2051
  id: item.id !== undefined ? item.id : undefined,
2052
+ assetId: item.assetId !== undefined ? {
2053
+ equals: item.assetId
2054
+ } : undefined,
2055
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2056
+ equals: item.alpacaAccountId
2057
+ } : undefined,
1880
2058
  },
1881
2059
  create: {
1882
2060
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1905,6 +2083,12 @@ exports.Action = {
1905
2083
  where: {
1906
2084
  id: item.id !== undefined ? item.id : undefined,
1907
2085
  url: item.url !== undefined ? item.url : undefined,
2086
+ assetId: item.assetId !== undefined ? {
2087
+ equals: item.assetId
2088
+ } : undefined,
2089
+ newsArticleId: item.newsArticleId !== undefined ? {
2090
+ equals: item.newsArticleId
2091
+ } : undefined,
1908
2092
  },
1909
2093
  create: {
1910
2094
  url: item.url !== undefined ? item.url : undefined,
@@ -1939,6 +2123,9 @@ exports.Action = {
1939
2123
  : { connectOrCreate: {
1940
2124
  where: {
1941
2125
  id: props.trade.alpacaAccount.id !== undefined ? props.trade.alpacaAccount.id : undefined,
2126
+ userId: props.trade.alpacaAccount.userId !== undefined ? {
2127
+ equals: props.trade.alpacaAccount.userId
2128
+ } : undefined,
1942
2129
  },
1943
2130
  create: {
1944
2131
  type: props.trade.alpacaAccount.type !== undefined ? props.trade.alpacaAccount.type : undefined,
@@ -1988,6 +2175,15 @@ exports.Action = {
1988
2175
  : { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
1989
2176
  where: {
1990
2177
  id: item.id !== undefined ? item.id : undefined,
2178
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2179
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2180
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2181
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2182
+ equals: item.alpacaAccountId
2183
+ } : undefined,
2184
+ assetId: item.assetId !== undefined ? {
2185
+ equals: item.assetId
2186
+ } : undefined,
1991
2187
  },
1992
2188
  create: {
1993
2189
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2024,6 +2220,12 @@ exports.Action = {
2024
2220
  : { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
2025
2221
  where: {
2026
2222
  id: item.id !== undefined ? item.id : undefined,
2223
+ assetId: item.assetId !== undefined ? {
2224
+ equals: item.assetId
2225
+ } : undefined,
2226
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2227
+ equals: item.alpacaAccountId
2228
+ } : undefined,
2027
2229
  },
2028
2230
  create: {
2029
2231
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2051,6 +2253,9 @@ exports.Action = {
2051
2253
  : { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
2052
2254
  where: {
2053
2255
  id: item.id !== undefined ? item.id : undefined,
2256
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2257
+ equals: item.alpacaAccountId
2258
+ } : undefined,
2054
2259
  },
2055
2260
  create: {
2056
2261
  message: item.message !== undefined ? item.message : undefined,
@@ -2139,6 +2344,15 @@ exports.Action = {
2139
2344
  : { connectOrCreate: props.trade.asset.orders.map((item) => ({
2140
2345
  where: {
2141
2346
  id: item.id !== undefined ? item.id : undefined,
2347
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2348
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2349
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2350
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2351
+ equals: item.alpacaAccountId
2352
+ } : undefined,
2353
+ assetId: item.assetId !== undefined ? {
2354
+ equals: item.assetId
2355
+ } : undefined,
2142
2356
  },
2143
2357
  create: {
2144
2358
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2175,6 +2389,12 @@ exports.Action = {
2175
2389
  : { connectOrCreate: props.trade.asset.positions.map((item) => ({
2176
2390
  where: {
2177
2391
  id: item.id !== undefined ? item.id : undefined,
2392
+ assetId: item.assetId !== undefined ? {
2393
+ equals: item.assetId
2394
+ } : undefined,
2395
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2396
+ equals: item.alpacaAccountId
2397
+ } : undefined,
2178
2398
  },
2179
2399
  create: {
2180
2400
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2203,6 +2423,12 @@ exports.Action = {
2203
2423
  where: {
2204
2424
  id: item.id !== undefined ? item.id : undefined,
2205
2425
  url: item.url !== undefined ? item.url : undefined,
2426
+ assetId: item.assetId !== undefined ? {
2427
+ equals: item.assetId
2428
+ } : undefined,
2429
+ newsArticleId: item.newsArticleId !== undefined ? {
2430
+ equals: item.newsArticleId
2431
+ } : undefined,
2206
2432
  },
2207
2433
  create: {
2208
2434
  url: item.url !== undefined ? item.url : undefined,
@@ -2224,6 +2450,18 @@ exports.Action = {
2224
2450
  id: props.order.id !== undefined ? {
2225
2451
  equals: props.order.id
2226
2452
  } : undefined,
2453
+ clientOrderId: props.order.clientOrderId !== undefined ? {
2454
+ equals: props.order.clientOrderId
2455
+ } : undefined,
2456
+ alpacaAccountId: props.order.alpacaAccountId !== undefined ? {
2457
+ equals: props.order.alpacaAccountId
2458
+ } : undefined,
2459
+ assetId: props.order.assetId !== undefined ? {
2460
+ equals: props.order.assetId
2461
+ } : undefined,
2462
+ actionId: props.order.actionId !== undefined ? {
2463
+ equals: props.order.actionId
2464
+ } : undefined,
2227
2465
  },
2228
2466
  update: {
2229
2467
  id: props.order.id !== undefined ? {
@@ -2301,6 +2539,9 @@ exports.Action = {
2301
2539
  id: props.order.stopLoss.id !== undefined ? {
2302
2540
  equals: props.order.stopLoss.id
2303
2541
  } : undefined,
2542
+ orderId: props.order.stopLoss.orderId !== undefined ? {
2543
+ equals: props.order.stopLoss.orderId
2544
+ } : undefined,
2304
2545
  },
2305
2546
  update: {
2306
2547
  id: props.order.stopLoss.id !== undefined ? {
@@ -2325,6 +2566,9 @@ exports.Action = {
2325
2566
  id: props.order.takeProfit.id !== undefined ? {
2326
2567
  equals: props.order.takeProfit.id
2327
2568
  } : undefined,
2569
+ orderId: props.order.takeProfit.orderId !== undefined ? {
2570
+ equals: props.order.takeProfit.orderId
2571
+ } : undefined,
2328
2572
  },
2329
2573
  update: {
2330
2574
  id: props.order.takeProfit.id !== undefined ? {
@@ -2349,6 +2593,9 @@ exports.Action = {
2349
2593
  id: props.order.alpacaAccount.id !== undefined ? {
2350
2594
  equals: props.order.alpacaAccount.id
2351
2595
  } : undefined,
2596
+ userId: props.order.alpacaAccount.userId !== undefined ? {
2597
+ equals: props.order.alpacaAccount.userId
2598
+ } : undefined,
2352
2599
  },
2353
2600
  update: {
2354
2601
  id: props.order.alpacaAccount.id !== undefined ? {
@@ -2451,6 +2698,12 @@ exports.Action = {
2451
2698
  upsert: props.order.alpacaAccount.trades.map((item) => ({
2452
2699
  where: {
2453
2700
  id: item.id !== undefined ? item.id : undefined,
2701
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2702
+ equals: item.alpacaAccountId
2703
+ } : undefined,
2704
+ assetId: item.assetId !== undefined ? {
2705
+ equals: item.assetId
2706
+ } : undefined,
2454
2707
  },
2455
2708
  update: {
2456
2709
  id: item.id !== undefined ? {
@@ -2509,6 +2762,12 @@ exports.Action = {
2509
2762
  upsert: props.order.alpacaAccount.positions.map((item) => ({
2510
2763
  where: {
2511
2764
  id: item.id !== undefined ? item.id : undefined,
2765
+ assetId: item.assetId !== undefined ? {
2766
+ equals: item.assetId
2767
+ } : undefined,
2768
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2769
+ equals: item.alpacaAccountId
2770
+ } : undefined,
2512
2771
  },
2513
2772
  update: {
2514
2773
  id: item.id !== undefined ? {
@@ -2575,6 +2834,9 @@ exports.Action = {
2575
2834
  upsert: props.order.alpacaAccount.alerts.map((item) => ({
2576
2835
  where: {
2577
2836
  id: item.id !== undefined ? item.id : undefined,
2837
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2838
+ equals: item.alpacaAccountId
2839
+ } : undefined,
2578
2840
  },
2579
2841
  update: {
2580
2842
  id: item.id !== undefined ? {
@@ -2646,6 +2908,12 @@ exports.Action = {
2646
2908
  : { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
2647
2909
  where: {
2648
2910
  id: item.id !== undefined ? item.id : undefined,
2911
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2912
+ equals: item.alpacaAccountId
2913
+ } : undefined,
2914
+ assetId: item.assetId !== undefined ? {
2915
+ equals: item.assetId
2916
+ } : undefined,
2649
2917
  },
2650
2918
  create: {
2651
2919
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2671,6 +2939,12 @@ exports.Action = {
2671
2939
  : { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
2672
2940
  where: {
2673
2941
  id: item.id !== undefined ? item.id : undefined,
2942
+ assetId: item.assetId !== undefined ? {
2943
+ equals: item.assetId
2944
+ } : undefined,
2945
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2946
+ equals: item.alpacaAccountId
2947
+ } : undefined,
2674
2948
  },
2675
2949
  create: {
2676
2950
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2698,6 +2972,9 @@ exports.Action = {
2698
2972
  : { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
2699
2973
  where: {
2700
2974
  id: item.id !== undefined ? item.id : undefined,
2975
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2976
+ equals: item.alpacaAccountId
2977
+ } : undefined,
2701
2978
  },
2702
2979
  create: {
2703
2980
  message: item.message !== undefined ? item.message : undefined,
@@ -2895,6 +3172,12 @@ exports.Action = {
2895
3172
  upsert: props.order.asset.trades.map((item) => ({
2896
3173
  where: {
2897
3174
  id: item.id !== undefined ? item.id : undefined,
3175
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3176
+ equals: item.alpacaAccountId
3177
+ } : undefined,
3178
+ assetId: item.assetId !== undefined ? {
3179
+ equals: item.assetId
3180
+ } : undefined,
2898
3181
  },
2899
3182
  update: {
2900
3183
  id: item.id !== undefined ? {
@@ -2953,6 +3236,12 @@ exports.Action = {
2953
3236
  upsert: props.order.asset.positions.map((item) => ({
2954
3237
  where: {
2955
3238
  id: item.id !== undefined ? item.id : undefined,
3239
+ assetId: item.assetId !== undefined ? {
3240
+ equals: item.assetId
3241
+ } : undefined,
3242
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3243
+ equals: item.alpacaAccountId
3244
+ } : undefined,
2956
3245
  },
2957
3246
  update: {
2958
3247
  id: item.id !== undefined ? {
@@ -3020,6 +3309,12 @@ exports.Action = {
3020
3309
  where: {
3021
3310
  id: item.id !== undefined ? item.id : undefined,
3022
3311
  url: item.url !== undefined ? item.url : undefined,
3312
+ assetId: item.assetId !== undefined ? {
3313
+ equals: item.assetId
3314
+ } : undefined,
3315
+ newsArticleId: item.newsArticleId !== undefined ? {
3316
+ equals: item.newsArticleId
3317
+ } : undefined,
3023
3318
  },
3024
3319
  update: {
3025
3320
  id: item.id !== undefined ? {
@@ -3112,6 +3407,12 @@ exports.Action = {
3112
3407
  : { connectOrCreate: props.order.asset.trades.map((item) => ({
3113
3408
  where: {
3114
3409
  id: item.id !== undefined ? item.id : undefined,
3410
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3411
+ equals: item.alpacaAccountId
3412
+ } : undefined,
3413
+ assetId: item.assetId !== undefined ? {
3414
+ equals: item.assetId
3415
+ } : undefined,
3115
3416
  },
3116
3417
  create: {
3117
3418
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3137,6 +3438,12 @@ exports.Action = {
3137
3438
  : { connectOrCreate: props.order.asset.positions.map((item) => ({
3138
3439
  where: {
3139
3440
  id: item.id !== undefined ? item.id : undefined,
3441
+ assetId: item.assetId !== undefined ? {
3442
+ equals: item.assetId
3443
+ } : undefined,
3444
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3445
+ equals: item.alpacaAccountId
3446
+ } : undefined,
3140
3447
  },
3141
3448
  create: {
3142
3449
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -3165,6 +3472,12 @@ exports.Action = {
3165
3472
  where: {
3166
3473
  id: item.id !== undefined ? item.id : undefined,
3167
3474
  url: item.url !== undefined ? item.url : undefined,
3475
+ assetId: item.assetId !== undefined ? {
3476
+ equals: item.assetId
3477
+ } : undefined,
3478
+ newsArticleId: item.newsArticleId !== undefined ? {
3479
+ equals: item.newsArticleId
3480
+ } : undefined,
3168
3481
  },
3169
3482
  create: {
3170
3483
  url: item.url !== undefined ? item.url : undefined,
@@ -3210,6 +3523,7 @@ exports.Action = {
3210
3523
  : { connectOrCreate: {
3211
3524
  where: {
3212
3525
  id: props.order.stopLoss.id !== undefined ? props.order.stopLoss.id : undefined,
3526
+ orderId: props.order.stopLoss.orderId !== undefined ? props.order.stopLoss.orderId : undefined,
3213
3527
  },
3214
3528
  create: {
3215
3529
  stopPrice: props.order.stopLoss.stopPrice !== undefined ? props.order.stopLoss.stopPrice : undefined,
@@ -3226,6 +3540,7 @@ exports.Action = {
3226
3540
  : { connectOrCreate: {
3227
3541
  where: {
3228
3542
  id: props.order.takeProfit.id !== undefined ? props.order.takeProfit.id : undefined,
3543
+ orderId: props.order.takeProfit.orderId !== undefined ? props.order.takeProfit.orderId : undefined,
3229
3544
  },
3230
3545
  create: {
3231
3546
  limitPrice: props.order.takeProfit.limitPrice !== undefined ? props.order.takeProfit.limitPrice : undefined,
@@ -3242,6 +3557,9 @@ exports.Action = {
3242
3557
  : { connectOrCreate: {
3243
3558
  where: {
3244
3559
  id: props.order.alpacaAccount.id !== undefined ? props.order.alpacaAccount.id : undefined,
3560
+ userId: props.order.alpacaAccount.userId !== undefined ? {
3561
+ equals: props.order.alpacaAccount.userId
3562
+ } : undefined,
3245
3563
  },
3246
3564
  create: {
3247
3565
  type: props.order.alpacaAccount.type !== undefined ? props.order.alpacaAccount.type : undefined,
@@ -3291,6 +3609,12 @@ exports.Action = {
3291
3609
  : { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
3292
3610
  where: {
3293
3611
  id: item.id !== undefined ? item.id : undefined,
3612
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3613
+ equals: item.alpacaAccountId
3614
+ } : undefined,
3615
+ assetId: item.assetId !== undefined ? {
3616
+ equals: item.assetId
3617
+ } : undefined,
3294
3618
  },
3295
3619
  create: {
3296
3620
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3316,6 +3640,12 @@ exports.Action = {
3316
3640
  : { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
3317
3641
  where: {
3318
3642
  id: item.id !== undefined ? item.id : undefined,
3643
+ assetId: item.assetId !== undefined ? {
3644
+ equals: item.assetId
3645
+ } : undefined,
3646
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3647
+ equals: item.alpacaAccountId
3648
+ } : undefined,
3319
3649
  },
3320
3650
  create: {
3321
3651
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -3343,6 +3673,9 @@ exports.Action = {
3343
3673
  : { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
3344
3674
  where: {
3345
3675
  id: item.id !== undefined ? item.id : undefined,
3676
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3677
+ equals: item.alpacaAccountId
3678
+ } : undefined,
3346
3679
  },
3347
3680
  create: {
3348
3681
  message: item.message !== undefined ? item.message : undefined,
@@ -3431,6 +3764,12 @@ exports.Action = {
3431
3764
  : { connectOrCreate: props.order.asset.trades.map((item) => ({
3432
3765
  where: {
3433
3766
  id: item.id !== undefined ? item.id : undefined,
3767
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3768
+ equals: item.alpacaAccountId
3769
+ } : undefined,
3770
+ assetId: item.assetId !== undefined ? {
3771
+ equals: item.assetId
3772
+ } : undefined,
3434
3773
  },
3435
3774
  create: {
3436
3775
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3456,6 +3795,12 @@ exports.Action = {
3456
3795
  : { connectOrCreate: props.order.asset.positions.map((item) => ({
3457
3796
  where: {
3458
3797
  id: item.id !== undefined ? item.id : undefined,
3798
+ assetId: item.assetId !== undefined ? {
3799
+ equals: item.assetId
3800
+ } : undefined,
3801
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3802
+ equals: item.alpacaAccountId
3803
+ } : undefined,
3459
3804
  },
3460
3805
  create: {
3461
3806
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -3484,6 +3829,12 @@ exports.Action = {
3484
3829
  where: {
3485
3830
  id: item.id !== undefined ? item.id : undefined,
3486
3831
  url: item.url !== undefined ? item.url : undefined,
3832
+ assetId: item.assetId !== undefined ? {
3833
+ equals: item.assetId
3834
+ } : undefined,
3835
+ newsArticleId: item.newsArticleId !== undefined ? {
3836
+ equals: item.newsArticleId
3837
+ } : undefined,
3487
3838
  },
3488
3839
  create: {
3489
3840
  url: item.url !== undefined ? item.url : undefined,
@@ -3535,7 +3886,9 @@ exports.Action = {
3535
3886
  where: {
3536
3887
  id: prop.id !== undefined ? prop.id : undefined,
3537
3888
  sequence: prop.sequence !== undefined ? prop.sequence : undefined,
3538
- tradeId: prop.tradeId !== undefined ? prop.tradeId : undefined,
3889
+ tradeId: prop.tradeId !== undefined ? {
3890
+ equals: prop.tradeId
3891
+ } : undefined,
3539
3892
  type: prop.type !== undefined ? prop.type : undefined,
3540
3893
  note: prop.note !== undefined ? prop.note : undefined,
3541
3894
  status: prop.status !== undefined ? prop.status : undefined,
@@ -3565,6 +3918,12 @@ exports.Action = {
3565
3918
  id: prop.trade.id !== undefined ? {
3566
3919
  equals: prop.trade.id
3567
3920
  } : undefined,
3921
+ alpacaAccountId: prop.trade.alpacaAccountId !== undefined ? {
3922
+ equals: prop.trade.alpacaAccountId
3923
+ } : undefined,
3924
+ assetId: prop.trade.assetId !== undefined ? {
3925
+ equals: prop.trade.assetId
3926
+ } : undefined,
3568
3927
  },
3569
3928
  update: {
3570
3929
  id: prop.trade.id !== undefined ? {
@@ -3609,6 +3968,9 @@ exports.Action = {
3609
3968
  id: prop.trade.alpacaAccount.id !== undefined ? {
3610
3969
  equals: prop.trade.alpacaAccount.id
3611
3970
  } : undefined,
3971
+ userId: prop.trade.alpacaAccount.userId !== undefined ? {
3972
+ equals: prop.trade.alpacaAccount.userId
3973
+ } : undefined,
3612
3974
  },
3613
3975
  update: {
3614
3976
  id: prop.trade.alpacaAccount.id !== undefined ? {
@@ -3711,6 +4073,15 @@ exports.Action = {
3711
4073
  upsert: prop.trade.alpacaAccount.orders.map((item) => ({
3712
4074
  where: {
3713
4075
  id: item.id !== undefined ? item.id : undefined,
4076
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4077
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4078
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4079
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4080
+ equals: item.alpacaAccountId
4081
+ } : undefined,
4082
+ assetId: item.assetId !== undefined ? {
4083
+ equals: item.assetId
4084
+ } : undefined,
3714
4085
  },
3715
4086
  update: {
3716
4087
  id: item.id !== undefined ? {
@@ -3813,6 +4184,12 @@ exports.Action = {
3813
4184
  upsert: prop.trade.alpacaAccount.positions.map((item) => ({
3814
4185
  where: {
3815
4186
  id: item.id !== undefined ? item.id : undefined,
4187
+ assetId: item.assetId !== undefined ? {
4188
+ equals: item.assetId
4189
+ } : undefined,
4190
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4191
+ equals: item.alpacaAccountId
4192
+ } : undefined,
3816
4193
  },
3817
4194
  update: {
3818
4195
  id: item.id !== undefined ? {
@@ -3879,6 +4256,9 @@ exports.Action = {
3879
4256
  upsert: prop.trade.alpacaAccount.alerts.map((item) => ({
3880
4257
  where: {
3881
4258
  id: item.id !== undefined ? item.id : undefined,
4259
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4260
+ equals: item.alpacaAccountId
4261
+ } : undefined,
3882
4262
  },
3883
4263
  update: {
3884
4264
  id: item.id !== undefined ? {
@@ -3950,6 +4330,15 @@ exports.Action = {
3950
4330
  : { connectOrCreate: prop.trade.alpacaAccount.orders.map((item) => ({
3951
4331
  where: {
3952
4332
  id: item.id !== undefined ? item.id : undefined,
4333
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4334
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4335
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4336
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4337
+ equals: item.alpacaAccountId
4338
+ } : undefined,
4339
+ assetId: item.assetId !== undefined ? {
4340
+ equals: item.assetId
4341
+ } : undefined,
3953
4342
  },
3954
4343
  create: {
3955
4344
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3986,6 +4375,12 @@ exports.Action = {
3986
4375
  : { connectOrCreate: prop.trade.alpacaAccount.positions.map((item) => ({
3987
4376
  where: {
3988
4377
  id: item.id !== undefined ? item.id : undefined,
4378
+ assetId: item.assetId !== undefined ? {
4379
+ equals: item.assetId
4380
+ } : undefined,
4381
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4382
+ equals: item.alpacaAccountId
4383
+ } : undefined,
3989
4384
  },
3990
4385
  create: {
3991
4386
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4013,6 +4408,9 @@ exports.Action = {
4013
4408
  : { connectOrCreate: prop.trade.alpacaAccount.alerts.map((item) => ({
4014
4409
  where: {
4015
4410
  id: item.id !== undefined ? item.id : undefined,
4411
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4412
+ equals: item.alpacaAccountId
4413
+ } : undefined,
4016
4414
  },
4017
4415
  create: {
4018
4416
  message: item.message !== undefined ? item.message : undefined,
@@ -4210,6 +4608,15 @@ exports.Action = {
4210
4608
  upsert: prop.trade.asset.orders.map((item) => ({
4211
4609
  where: {
4212
4610
  id: item.id !== undefined ? item.id : undefined,
4611
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4612
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4613
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4614
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4615
+ equals: item.alpacaAccountId
4616
+ } : undefined,
4617
+ assetId: item.assetId !== undefined ? {
4618
+ equals: item.assetId
4619
+ } : undefined,
4213
4620
  },
4214
4621
  update: {
4215
4622
  id: item.id !== undefined ? {
@@ -4312,6 +4719,12 @@ exports.Action = {
4312
4719
  upsert: prop.trade.asset.positions.map((item) => ({
4313
4720
  where: {
4314
4721
  id: item.id !== undefined ? item.id : undefined,
4722
+ assetId: item.assetId !== undefined ? {
4723
+ equals: item.assetId
4724
+ } : undefined,
4725
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4726
+ equals: item.alpacaAccountId
4727
+ } : undefined,
4315
4728
  },
4316
4729
  update: {
4317
4730
  id: item.id !== undefined ? {
@@ -4379,6 +4792,12 @@ exports.Action = {
4379
4792
  where: {
4380
4793
  id: item.id !== undefined ? item.id : undefined,
4381
4794
  url: item.url !== undefined ? item.url : undefined,
4795
+ assetId: item.assetId !== undefined ? {
4796
+ equals: item.assetId
4797
+ } : undefined,
4798
+ newsArticleId: item.newsArticleId !== undefined ? {
4799
+ equals: item.newsArticleId
4800
+ } : undefined,
4382
4801
  },
4383
4802
  update: {
4384
4803
  id: item.id !== undefined ? {
@@ -4471,6 +4890,15 @@ exports.Action = {
4471
4890
  : { connectOrCreate: prop.trade.asset.orders.map((item) => ({
4472
4891
  where: {
4473
4892
  id: item.id !== undefined ? item.id : undefined,
4893
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4894
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4895
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4896
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4897
+ equals: item.alpacaAccountId
4898
+ } : undefined,
4899
+ assetId: item.assetId !== undefined ? {
4900
+ equals: item.assetId
4901
+ } : undefined,
4474
4902
  },
4475
4903
  create: {
4476
4904
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4507,6 +4935,12 @@ exports.Action = {
4507
4935
  : { connectOrCreate: prop.trade.asset.positions.map((item) => ({
4508
4936
  where: {
4509
4937
  id: item.id !== undefined ? item.id : undefined,
4938
+ assetId: item.assetId !== undefined ? {
4939
+ equals: item.assetId
4940
+ } : undefined,
4941
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4942
+ equals: item.alpacaAccountId
4943
+ } : undefined,
4510
4944
  },
4511
4945
  create: {
4512
4946
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4535,6 +4969,12 @@ exports.Action = {
4535
4969
  where: {
4536
4970
  id: item.id !== undefined ? item.id : undefined,
4537
4971
  url: item.url !== undefined ? item.url : undefined,
4972
+ assetId: item.assetId !== undefined ? {
4973
+ equals: item.assetId
4974
+ } : undefined,
4975
+ newsArticleId: item.newsArticleId !== undefined ? {
4976
+ equals: item.newsArticleId
4977
+ } : undefined,
4538
4978
  },
4539
4979
  create: {
4540
4980
  url: item.url !== undefined ? item.url : undefined,
@@ -4569,6 +5009,9 @@ exports.Action = {
4569
5009
  : { connectOrCreate: {
4570
5010
  where: {
4571
5011
  id: prop.trade.alpacaAccount.id !== undefined ? prop.trade.alpacaAccount.id : undefined,
5012
+ userId: prop.trade.alpacaAccount.userId !== undefined ? {
5013
+ equals: prop.trade.alpacaAccount.userId
5014
+ } : undefined,
4572
5015
  },
4573
5016
  create: {
4574
5017
  type: prop.trade.alpacaAccount.type !== undefined ? prop.trade.alpacaAccount.type : undefined,
@@ -4618,6 +5061,15 @@ exports.Action = {
4618
5061
  : { connectOrCreate: prop.trade.alpacaAccount.orders.map((item) => ({
4619
5062
  where: {
4620
5063
  id: item.id !== undefined ? item.id : undefined,
5064
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5065
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5066
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5067
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5068
+ equals: item.alpacaAccountId
5069
+ } : undefined,
5070
+ assetId: item.assetId !== undefined ? {
5071
+ equals: item.assetId
5072
+ } : undefined,
4621
5073
  },
4622
5074
  create: {
4623
5075
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4654,6 +5106,12 @@ exports.Action = {
4654
5106
  : { connectOrCreate: prop.trade.alpacaAccount.positions.map((item) => ({
4655
5107
  where: {
4656
5108
  id: item.id !== undefined ? item.id : undefined,
5109
+ assetId: item.assetId !== undefined ? {
5110
+ equals: item.assetId
5111
+ } : undefined,
5112
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5113
+ equals: item.alpacaAccountId
5114
+ } : undefined,
4657
5115
  },
4658
5116
  create: {
4659
5117
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4681,6 +5139,9 @@ exports.Action = {
4681
5139
  : { connectOrCreate: prop.trade.alpacaAccount.alerts.map((item) => ({
4682
5140
  where: {
4683
5141
  id: item.id !== undefined ? item.id : undefined,
5142
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5143
+ equals: item.alpacaAccountId
5144
+ } : undefined,
4684
5145
  },
4685
5146
  create: {
4686
5147
  message: item.message !== undefined ? item.message : undefined,
@@ -4769,6 +5230,15 @@ exports.Action = {
4769
5230
  : { connectOrCreate: prop.trade.asset.orders.map((item) => ({
4770
5231
  where: {
4771
5232
  id: item.id !== undefined ? item.id : undefined,
5233
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5234
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5235
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5236
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5237
+ equals: item.alpacaAccountId
5238
+ } : undefined,
5239
+ assetId: item.assetId !== undefined ? {
5240
+ equals: item.assetId
5241
+ } : undefined,
4772
5242
  },
4773
5243
  create: {
4774
5244
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4805,6 +5275,12 @@ exports.Action = {
4805
5275
  : { connectOrCreate: prop.trade.asset.positions.map((item) => ({
4806
5276
  where: {
4807
5277
  id: item.id !== undefined ? item.id : undefined,
5278
+ assetId: item.assetId !== undefined ? {
5279
+ equals: item.assetId
5280
+ } : undefined,
5281
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5282
+ equals: item.alpacaAccountId
5283
+ } : undefined,
4808
5284
  },
4809
5285
  create: {
4810
5286
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4833,6 +5309,12 @@ exports.Action = {
4833
5309
  where: {
4834
5310
  id: item.id !== undefined ? item.id : undefined,
4835
5311
  url: item.url !== undefined ? item.url : undefined,
5312
+ assetId: item.assetId !== undefined ? {
5313
+ equals: item.assetId
5314
+ } : undefined,
5315
+ newsArticleId: item.newsArticleId !== undefined ? {
5316
+ equals: item.newsArticleId
5317
+ } : undefined,
4836
5318
  },
4837
5319
  create: {
4838
5320
  url: item.url !== undefined ? item.url : undefined,
@@ -4854,6 +5336,18 @@ exports.Action = {
4854
5336
  id: prop.order.id !== undefined ? {
4855
5337
  equals: prop.order.id
4856
5338
  } : undefined,
5339
+ clientOrderId: prop.order.clientOrderId !== undefined ? {
5340
+ equals: prop.order.clientOrderId
5341
+ } : undefined,
5342
+ alpacaAccountId: prop.order.alpacaAccountId !== undefined ? {
5343
+ equals: prop.order.alpacaAccountId
5344
+ } : undefined,
5345
+ assetId: prop.order.assetId !== undefined ? {
5346
+ equals: prop.order.assetId
5347
+ } : undefined,
5348
+ actionId: prop.order.actionId !== undefined ? {
5349
+ equals: prop.order.actionId
5350
+ } : undefined,
4857
5351
  },
4858
5352
  update: {
4859
5353
  id: prop.order.id !== undefined ? {
@@ -4931,6 +5425,9 @@ exports.Action = {
4931
5425
  id: prop.order.stopLoss.id !== undefined ? {
4932
5426
  equals: prop.order.stopLoss.id
4933
5427
  } : undefined,
5428
+ orderId: prop.order.stopLoss.orderId !== undefined ? {
5429
+ equals: prop.order.stopLoss.orderId
5430
+ } : undefined,
4934
5431
  },
4935
5432
  update: {
4936
5433
  id: prop.order.stopLoss.id !== undefined ? {
@@ -4955,6 +5452,9 @@ exports.Action = {
4955
5452
  id: prop.order.takeProfit.id !== undefined ? {
4956
5453
  equals: prop.order.takeProfit.id
4957
5454
  } : undefined,
5455
+ orderId: prop.order.takeProfit.orderId !== undefined ? {
5456
+ equals: prop.order.takeProfit.orderId
5457
+ } : undefined,
4958
5458
  },
4959
5459
  update: {
4960
5460
  id: prop.order.takeProfit.id !== undefined ? {
@@ -4979,6 +5479,9 @@ exports.Action = {
4979
5479
  id: prop.order.alpacaAccount.id !== undefined ? {
4980
5480
  equals: prop.order.alpacaAccount.id
4981
5481
  } : undefined,
5482
+ userId: prop.order.alpacaAccount.userId !== undefined ? {
5483
+ equals: prop.order.alpacaAccount.userId
5484
+ } : undefined,
4982
5485
  },
4983
5486
  update: {
4984
5487
  id: prop.order.alpacaAccount.id !== undefined ? {
@@ -5081,6 +5584,12 @@ exports.Action = {
5081
5584
  upsert: prop.order.alpacaAccount.trades.map((item) => ({
5082
5585
  where: {
5083
5586
  id: item.id !== undefined ? item.id : undefined,
5587
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5588
+ equals: item.alpacaAccountId
5589
+ } : undefined,
5590
+ assetId: item.assetId !== undefined ? {
5591
+ equals: item.assetId
5592
+ } : undefined,
5084
5593
  },
5085
5594
  update: {
5086
5595
  id: item.id !== undefined ? {
@@ -5139,6 +5648,12 @@ exports.Action = {
5139
5648
  upsert: prop.order.alpacaAccount.positions.map((item) => ({
5140
5649
  where: {
5141
5650
  id: item.id !== undefined ? item.id : undefined,
5651
+ assetId: item.assetId !== undefined ? {
5652
+ equals: item.assetId
5653
+ } : undefined,
5654
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5655
+ equals: item.alpacaAccountId
5656
+ } : undefined,
5142
5657
  },
5143
5658
  update: {
5144
5659
  id: item.id !== undefined ? {
@@ -5205,6 +5720,9 @@ exports.Action = {
5205
5720
  upsert: prop.order.alpacaAccount.alerts.map((item) => ({
5206
5721
  where: {
5207
5722
  id: item.id !== undefined ? item.id : undefined,
5723
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5724
+ equals: item.alpacaAccountId
5725
+ } : undefined,
5208
5726
  },
5209
5727
  update: {
5210
5728
  id: item.id !== undefined ? {
@@ -5276,6 +5794,12 @@ exports.Action = {
5276
5794
  : { connectOrCreate: prop.order.alpacaAccount.trades.map((item) => ({
5277
5795
  where: {
5278
5796
  id: item.id !== undefined ? item.id : undefined,
5797
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5798
+ equals: item.alpacaAccountId
5799
+ } : undefined,
5800
+ assetId: item.assetId !== undefined ? {
5801
+ equals: item.assetId
5802
+ } : undefined,
5279
5803
  },
5280
5804
  create: {
5281
5805
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5301,6 +5825,12 @@ exports.Action = {
5301
5825
  : { connectOrCreate: prop.order.alpacaAccount.positions.map((item) => ({
5302
5826
  where: {
5303
5827
  id: item.id !== undefined ? item.id : undefined,
5828
+ assetId: item.assetId !== undefined ? {
5829
+ equals: item.assetId
5830
+ } : undefined,
5831
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5832
+ equals: item.alpacaAccountId
5833
+ } : undefined,
5304
5834
  },
5305
5835
  create: {
5306
5836
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5328,6 +5858,9 @@ exports.Action = {
5328
5858
  : { connectOrCreate: prop.order.alpacaAccount.alerts.map((item) => ({
5329
5859
  where: {
5330
5860
  id: item.id !== undefined ? item.id : undefined,
5861
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5862
+ equals: item.alpacaAccountId
5863
+ } : undefined,
5331
5864
  },
5332
5865
  create: {
5333
5866
  message: item.message !== undefined ? item.message : undefined,
@@ -5525,6 +6058,12 @@ exports.Action = {
5525
6058
  upsert: prop.order.asset.trades.map((item) => ({
5526
6059
  where: {
5527
6060
  id: item.id !== undefined ? item.id : undefined,
6061
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6062
+ equals: item.alpacaAccountId
6063
+ } : undefined,
6064
+ assetId: item.assetId !== undefined ? {
6065
+ equals: item.assetId
6066
+ } : undefined,
5528
6067
  },
5529
6068
  update: {
5530
6069
  id: item.id !== undefined ? {
@@ -5583,6 +6122,12 @@ exports.Action = {
5583
6122
  upsert: prop.order.asset.positions.map((item) => ({
5584
6123
  where: {
5585
6124
  id: item.id !== undefined ? item.id : undefined,
6125
+ assetId: item.assetId !== undefined ? {
6126
+ equals: item.assetId
6127
+ } : undefined,
6128
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6129
+ equals: item.alpacaAccountId
6130
+ } : undefined,
5586
6131
  },
5587
6132
  update: {
5588
6133
  id: item.id !== undefined ? {
@@ -5650,6 +6195,12 @@ exports.Action = {
5650
6195
  where: {
5651
6196
  id: item.id !== undefined ? item.id : undefined,
5652
6197
  url: item.url !== undefined ? item.url : undefined,
6198
+ assetId: item.assetId !== undefined ? {
6199
+ equals: item.assetId
6200
+ } : undefined,
6201
+ newsArticleId: item.newsArticleId !== undefined ? {
6202
+ equals: item.newsArticleId
6203
+ } : undefined,
5653
6204
  },
5654
6205
  update: {
5655
6206
  id: item.id !== undefined ? {
@@ -5742,6 +6293,12 @@ exports.Action = {
5742
6293
  : { connectOrCreate: prop.order.asset.trades.map((item) => ({
5743
6294
  where: {
5744
6295
  id: item.id !== undefined ? item.id : undefined,
6296
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6297
+ equals: item.alpacaAccountId
6298
+ } : undefined,
6299
+ assetId: item.assetId !== undefined ? {
6300
+ equals: item.assetId
6301
+ } : undefined,
5745
6302
  },
5746
6303
  create: {
5747
6304
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5767,6 +6324,12 @@ exports.Action = {
5767
6324
  : { connectOrCreate: prop.order.asset.positions.map((item) => ({
5768
6325
  where: {
5769
6326
  id: item.id !== undefined ? item.id : undefined,
6327
+ assetId: item.assetId !== undefined ? {
6328
+ equals: item.assetId
6329
+ } : undefined,
6330
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6331
+ equals: item.alpacaAccountId
6332
+ } : undefined,
5770
6333
  },
5771
6334
  create: {
5772
6335
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5795,6 +6358,12 @@ exports.Action = {
5795
6358
  where: {
5796
6359
  id: item.id !== undefined ? item.id : undefined,
5797
6360
  url: item.url !== undefined ? item.url : undefined,
6361
+ assetId: item.assetId !== undefined ? {
6362
+ equals: item.assetId
6363
+ } : undefined,
6364
+ newsArticleId: item.newsArticleId !== undefined ? {
6365
+ equals: item.newsArticleId
6366
+ } : undefined,
5798
6367
  },
5799
6368
  create: {
5800
6369
  url: item.url !== undefined ? item.url : undefined,
@@ -5840,6 +6409,7 @@ exports.Action = {
5840
6409
  : { connectOrCreate: {
5841
6410
  where: {
5842
6411
  id: prop.order.stopLoss.id !== undefined ? prop.order.stopLoss.id : undefined,
6412
+ orderId: prop.order.stopLoss.orderId !== undefined ? prop.order.stopLoss.orderId : undefined,
5843
6413
  },
5844
6414
  create: {
5845
6415
  stopPrice: prop.order.stopLoss.stopPrice !== undefined ? prop.order.stopLoss.stopPrice : undefined,
@@ -5856,6 +6426,7 @@ exports.Action = {
5856
6426
  : { connectOrCreate: {
5857
6427
  where: {
5858
6428
  id: prop.order.takeProfit.id !== undefined ? prop.order.takeProfit.id : undefined,
6429
+ orderId: prop.order.takeProfit.orderId !== undefined ? prop.order.takeProfit.orderId : undefined,
5859
6430
  },
5860
6431
  create: {
5861
6432
  limitPrice: prop.order.takeProfit.limitPrice !== undefined ? prop.order.takeProfit.limitPrice : undefined,
@@ -5872,6 +6443,9 @@ exports.Action = {
5872
6443
  : { connectOrCreate: {
5873
6444
  where: {
5874
6445
  id: prop.order.alpacaAccount.id !== undefined ? prop.order.alpacaAccount.id : undefined,
6446
+ userId: prop.order.alpacaAccount.userId !== undefined ? {
6447
+ equals: prop.order.alpacaAccount.userId
6448
+ } : undefined,
5875
6449
  },
5876
6450
  create: {
5877
6451
  type: prop.order.alpacaAccount.type !== undefined ? prop.order.alpacaAccount.type : undefined,
@@ -5921,6 +6495,12 @@ exports.Action = {
5921
6495
  : { connectOrCreate: prop.order.alpacaAccount.trades.map((item) => ({
5922
6496
  where: {
5923
6497
  id: item.id !== undefined ? item.id : undefined,
6498
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6499
+ equals: item.alpacaAccountId
6500
+ } : undefined,
6501
+ assetId: item.assetId !== undefined ? {
6502
+ equals: item.assetId
6503
+ } : undefined,
5924
6504
  },
5925
6505
  create: {
5926
6506
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5946,6 +6526,12 @@ exports.Action = {
5946
6526
  : { connectOrCreate: prop.order.alpacaAccount.positions.map((item) => ({
5947
6527
  where: {
5948
6528
  id: item.id !== undefined ? item.id : undefined,
6529
+ assetId: item.assetId !== undefined ? {
6530
+ equals: item.assetId
6531
+ } : undefined,
6532
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6533
+ equals: item.alpacaAccountId
6534
+ } : undefined,
5949
6535
  },
5950
6536
  create: {
5951
6537
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5973,6 +6559,9 @@ exports.Action = {
5973
6559
  : { connectOrCreate: prop.order.alpacaAccount.alerts.map((item) => ({
5974
6560
  where: {
5975
6561
  id: item.id !== undefined ? item.id : undefined,
6562
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6563
+ equals: item.alpacaAccountId
6564
+ } : undefined,
5976
6565
  },
5977
6566
  create: {
5978
6567
  message: item.message !== undefined ? item.message : undefined,
@@ -6061,6 +6650,12 @@ exports.Action = {
6061
6650
  : { connectOrCreate: prop.order.asset.trades.map((item) => ({
6062
6651
  where: {
6063
6652
  id: item.id !== undefined ? item.id : undefined,
6653
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6654
+ equals: item.alpacaAccountId
6655
+ } : undefined,
6656
+ assetId: item.assetId !== undefined ? {
6657
+ equals: item.assetId
6658
+ } : undefined,
6064
6659
  },
6065
6660
  create: {
6066
6661
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6086,6 +6681,12 @@ exports.Action = {
6086
6681
  : { connectOrCreate: prop.order.asset.positions.map((item) => ({
6087
6682
  where: {
6088
6683
  id: item.id !== undefined ? item.id : undefined,
6684
+ assetId: item.assetId !== undefined ? {
6685
+ equals: item.assetId
6686
+ } : undefined,
6687
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6688
+ equals: item.alpacaAccountId
6689
+ } : undefined,
6089
6690
  },
6090
6691
  create: {
6091
6692
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -6114,6 +6715,12 @@ exports.Action = {
6114
6715
  where: {
6115
6716
  id: item.id !== undefined ? item.id : undefined,
6116
6717
  url: item.url !== undefined ? item.url : undefined,
6718
+ assetId: item.assetId !== undefined ? {
6719
+ equals: item.assetId
6720
+ } : undefined,
6721
+ newsArticleId: item.newsArticleId !== undefined ? {
6722
+ equals: item.newsArticleId
6723
+ } : undefined,
6117
6724
  },
6118
6725
  create: {
6119
6726
  url: item.url !== undefined ? item.url : undefined,
@@ -6201,7 +6808,9 @@ exports.Action = {
6201
6808
  where: {
6202
6809
  id: props.id !== undefined ? props.id : undefined,
6203
6810
  sequence: props.sequence !== undefined ? props.sequence : undefined,
6204
- tradeId: props.tradeId !== undefined ? props.tradeId : undefined,
6811
+ tradeId: props.tradeId !== undefined ? {
6812
+ equals: props.tradeId
6813
+ } : undefined,
6205
6814
  type: props.type !== undefined ? props.type : undefined,
6206
6815
  note: props.note !== undefined ? props.note : undefined,
6207
6816
  status: props.status !== undefined ? props.status : undefined,
@@ -6272,7 +6881,9 @@ exports.Action = {
6272
6881
  equals: props.id
6273
6882
  } : undefined,
6274
6883
  sequence: props.sequence !== undefined ? props.sequence : undefined,
6275
- tradeId: props.tradeId !== undefined ? props.tradeId : undefined,
6884
+ tradeId: props.tradeId !== undefined ? {
6885
+ equals: props.tradeId
6886
+ } : undefined,
6276
6887
  type: props.type !== undefined ? props.type : undefined,
6277
6888
  note: props.note !== undefined ? props.note : undefined,
6278
6889
  status: props.status !== undefined ? props.status : undefined,