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/Asset.cjs CHANGED
@@ -307,6 +307,12 @@ exports.Asset = {
307
307
  : { connectOrCreate: props.trades.map((item) => ({
308
308
  where: {
309
309
  id: item.id !== undefined ? item.id : undefined,
310
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
311
+ equals: item.alpacaAccountId
312
+ } : undefined,
313
+ assetId: item.assetId !== undefined ? {
314
+ equals: item.assetId
315
+ } : undefined,
310
316
  },
311
317
  create: {
312
318
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -329,6 +335,9 @@ exports.Asset = {
329
335
  : { connectOrCreate: {
330
336
  where: {
331
337
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
338
+ userId: item.alpacaAccount.userId !== undefined ? {
339
+ equals: item.alpacaAccount.userId
340
+ } : undefined,
332
341
  },
333
342
  create: {
334
343
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -378,6 +387,15 @@ exports.Asset = {
378
387
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
379
388
  where: {
380
389
  id: item.id !== undefined ? item.id : undefined,
390
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
391
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
392
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
393
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
394
+ equals: item.alpacaAccountId
395
+ } : undefined,
396
+ assetId: item.assetId !== undefined ? {
397
+ equals: item.assetId
398
+ } : undefined,
381
399
  },
382
400
  create: {
383
401
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -414,6 +432,12 @@ exports.Asset = {
414
432
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
415
433
  where: {
416
434
  id: item.id !== undefined ? item.id : undefined,
435
+ assetId: item.assetId !== undefined ? {
436
+ equals: item.assetId
437
+ } : undefined,
438
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
439
+ equals: item.alpacaAccountId
440
+ } : undefined,
417
441
  },
418
442
  create: {
419
443
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -441,6 +465,9 @@ exports.Asset = {
441
465
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
442
466
  where: {
443
467
  id: item.id !== undefined ? item.id : undefined,
468
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
469
+ equals: item.alpacaAccountId
470
+ } : undefined,
444
471
  },
445
472
  create: {
446
473
  message: item.message !== undefined ? item.message : undefined,
@@ -461,6 +488,9 @@ exports.Asset = {
461
488
  : { connectOrCreate: item.actions.map((item) => ({
462
489
  where: {
463
490
  id: item.id !== undefined ? item.id : undefined,
491
+ tradeId: item.tradeId !== undefined ? {
492
+ equals: item.tradeId
493
+ } : undefined,
464
494
  },
465
495
  create: {
466
496
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -477,6 +507,15 @@ exports.Asset = {
477
507
  : { connectOrCreate: {
478
508
  where: {
479
509
  id: item.order.id !== undefined ? item.order.id : undefined,
510
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
511
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
512
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
513
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
514
+ equals: item.order.alpacaAccountId
515
+ } : undefined,
516
+ assetId: item.order.assetId !== undefined ? {
517
+ equals: item.order.assetId
518
+ } : undefined,
480
519
  },
481
520
  create: {
482
521
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -519,6 +558,15 @@ exports.Asset = {
519
558
  : { connectOrCreate: props.orders.map((item) => ({
520
559
  where: {
521
560
  id: item.id !== undefined ? item.id : undefined,
561
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
562
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
563
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
564
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
565
+ equals: item.alpacaAccountId
566
+ } : undefined,
567
+ assetId: item.assetId !== undefined ? {
568
+ equals: item.assetId
569
+ } : undefined,
522
570
  },
523
571
  create: {
524
572
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -552,6 +600,7 @@ exports.Asset = {
552
600
  : { connectOrCreate: {
553
601
  where: {
554
602
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
603
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
555
604
  },
556
605
  create: {
557
606
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -568,6 +617,7 @@ exports.Asset = {
568
617
  : { connectOrCreate: {
569
618
  where: {
570
619
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
620
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
571
621
  },
572
622
  create: {
573
623
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -584,6 +634,9 @@ exports.Asset = {
584
634
  : { connectOrCreate: {
585
635
  where: {
586
636
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
637
+ userId: item.alpacaAccount.userId !== undefined ? {
638
+ equals: item.alpacaAccount.userId
639
+ } : undefined,
587
640
  },
588
641
  create: {
589
642
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -633,6 +686,12 @@ exports.Asset = {
633
686
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
634
687
  where: {
635
688
  id: item.id !== undefined ? item.id : undefined,
689
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
690
+ equals: item.alpacaAccountId
691
+ } : undefined,
692
+ assetId: item.assetId !== undefined ? {
693
+ equals: item.assetId
694
+ } : undefined,
636
695
  },
637
696
  create: {
638
697
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -658,6 +717,12 @@ exports.Asset = {
658
717
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
659
718
  where: {
660
719
  id: item.id !== undefined ? item.id : undefined,
720
+ assetId: item.assetId !== undefined ? {
721
+ equals: item.assetId
722
+ } : undefined,
723
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
724
+ equals: item.alpacaAccountId
725
+ } : undefined,
661
726
  },
662
727
  create: {
663
728
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -685,6 +750,9 @@ exports.Asset = {
685
750
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
686
751
  where: {
687
752
  id: item.id !== undefined ? item.id : undefined,
753
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
754
+ equals: item.alpacaAccountId
755
+ } : undefined,
688
756
  },
689
757
  create: {
690
758
  message: item.message !== undefined ? item.message : undefined,
@@ -705,6 +773,9 @@ exports.Asset = {
705
773
  : { connectOrCreate: {
706
774
  where: {
707
775
  id: item.action.id !== undefined ? item.action.id : undefined,
776
+ tradeId: item.action.tradeId !== undefined ? {
777
+ equals: item.action.tradeId
778
+ } : undefined,
708
779
  },
709
780
  create: {
710
781
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -721,6 +792,12 @@ exports.Asset = {
721
792
  : { connectOrCreate: {
722
793
  where: {
723
794
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
795
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
796
+ equals: item.action.trade.alpacaAccountId
797
+ } : undefined,
798
+ assetId: item.action.trade.assetId !== undefined ? {
799
+ equals: item.action.trade.assetId
800
+ } : undefined,
724
801
  },
725
802
  create: {
726
803
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -752,6 +829,12 @@ exports.Asset = {
752
829
  : { connectOrCreate: props.positions.map((item) => ({
753
830
  where: {
754
831
  id: item.id !== undefined ? item.id : undefined,
832
+ assetId: item.assetId !== undefined ? {
833
+ equals: item.assetId
834
+ } : undefined,
835
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
836
+ equals: item.alpacaAccountId
837
+ } : undefined,
755
838
  },
756
839
  create: {
757
840
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -776,6 +859,9 @@ exports.Asset = {
776
859
  : { connectOrCreate: {
777
860
  where: {
778
861
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
862
+ userId: item.alpacaAccount.userId !== undefined ? {
863
+ equals: item.alpacaAccount.userId
864
+ } : undefined,
779
865
  },
780
866
  create: {
781
867
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -825,6 +911,12 @@ exports.Asset = {
825
911
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
826
912
  where: {
827
913
  id: item.id !== undefined ? item.id : undefined,
914
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
915
+ equals: item.alpacaAccountId
916
+ } : undefined,
917
+ assetId: item.assetId !== undefined ? {
918
+ equals: item.assetId
919
+ } : undefined,
828
920
  },
829
921
  create: {
830
922
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -850,6 +942,15 @@ exports.Asset = {
850
942
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
851
943
  where: {
852
944
  id: item.id !== undefined ? item.id : undefined,
945
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
946
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
947
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
948
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
949
+ equals: item.alpacaAccountId
950
+ } : undefined,
951
+ assetId: item.assetId !== undefined ? {
952
+ equals: item.assetId
953
+ } : undefined,
853
954
  },
854
955
  create: {
855
956
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -886,6 +987,9 @@ exports.Asset = {
886
987
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
887
988
  where: {
888
989
  id: item.id !== undefined ? item.id : undefined,
990
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
991
+ equals: item.alpacaAccountId
992
+ } : undefined,
889
993
  },
890
994
  create: {
891
995
  message: item.message !== undefined ? item.message : undefined,
@@ -910,6 +1014,12 @@ exports.Asset = {
910
1014
  where: {
911
1015
  id: item.id !== undefined ? item.id : undefined,
912
1016
  url: item.url !== undefined ? item.url : undefined,
1017
+ assetId: item.assetId !== undefined ? {
1018
+ equals: item.assetId
1019
+ } : undefined,
1020
+ newsArticleId: item.newsArticleId !== undefined ? {
1021
+ equals: item.newsArticleId
1022
+ } : undefined,
913
1023
  },
914
1024
  create: {
915
1025
  url: item.url !== undefined ? item.url : undefined,
@@ -1309,6 +1419,12 @@ exports.Asset = {
1309
1419
  upsert: props.trades.map((item) => ({
1310
1420
  where: {
1311
1421
  id: item.id !== undefined ? item.id : undefined,
1422
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1423
+ equals: item.alpacaAccountId
1424
+ } : undefined,
1425
+ assetId: item.assetId !== undefined ? {
1426
+ equals: item.assetId
1427
+ } : undefined,
1312
1428
  },
1313
1429
  update: {
1314
1430
  id: item.id !== undefined ? {
@@ -1353,6 +1469,9 @@ exports.Asset = {
1353
1469
  id: item.alpacaAccount.id !== undefined ? {
1354
1470
  equals: item.alpacaAccount.id
1355
1471
  } : undefined,
1472
+ userId: item.alpacaAccount.userId !== undefined ? {
1473
+ equals: item.alpacaAccount.userId
1474
+ } : undefined,
1356
1475
  },
1357
1476
  update: {
1358
1477
  id: item.alpacaAccount.id !== undefined ? {
@@ -1455,6 +1574,15 @@ exports.Asset = {
1455
1574
  upsert: item.alpacaAccount.orders.map((item) => ({
1456
1575
  where: {
1457
1576
  id: item.id !== undefined ? item.id : undefined,
1577
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1578
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1579
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1580
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1581
+ equals: item.alpacaAccountId
1582
+ } : undefined,
1583
+ assetId: item.assetId !== undefined ? {
1584
+ equals: item.assetId
1585
+ } : undefined,
1458
1586
  },
1459
1587
  update: {
1460
1588
  id: item.id !== undefined ? {
@@ -1557,6 +1685,12 @@ exports.Asset = {
1557
1685
  upsert: item.alpacaAccount.positions.map((item) => ({
1558
1686
  where: {
1559
1687
  id: item.id !== undefined ? item.id : undefined,
1688
+ assetId: item.assetId !== undefined ? {
1689
+ equals: item.assetId
1690
+ } : undefined,
1691
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1692
+ equals: item.alpacaAccountId
1693
+ } : undefined,
1560
1694
  },
1561
1695
  update: {
1562
1696
  id: item.id !== undefined ? {
@@ -1623,6 +1757,9 @@ exports.Asset = {
1623
1757
  upsert: item.alpacaAccount.alerts.map((item) => ({
1624
1758
  where: {
1625
1759
  id: item.id !== undefined ? item.id : undefined,
1760
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1761
+ equals: item.alpacaAccountId
1762
+ } : undefined,
1626
1763
  },
1627
1764
  update: {
1628
1765
  id: item.id !== undefined ? {
@@ -1694,6 +1831,15 @@ exports.Asset = {
1694
1831
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
1695
1832
  where: {
1696
1833
  id: item.id !== undefined ? item.id : undefined,
1834
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1835
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1836
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1837
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1838
+ equals: item.alpacaAccountId
1839
+ } : undefined,
1840
+ assetId: item.assetId !== undefined ? {
1841
+ equals: item.assetId
1842
+ } : undefined,
1697
1843
  },
1698
1844
  create: {
1699
1845
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1730,6 +1876,12 @@ exports.Asset = {
1730
1876
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
1731
1877
  where: {
1732
1878
  id: item.id !== undefined ? item.id : undefined,
1879
+ assetId: item.assetId !== undefined ? {
1880
+ equals: item.assetId
1881
+ } : undefined,
1882
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1883
+ equals: item.alpacaAccountId
1884
+ } : undefined,
1733
1885
  },
1734
1886
  create: {
1735
1887
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1757,6 +1909,9 @@ exports.Asset = {
1757
1909
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
1758
1910
  where: {
1759
1911
  id: item.id !== undefined ? item.id : undefined,
1912
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1913
+ equals: item.alpacaAccountId
1914
+ } : undefined,
1760
1915
  },
1761
1916
  create: {
1762
1917
  message: item.message !== undefined ? item.message : undefined,
@@ -1772,6 +1927,9 @@ exports.Asset = {
1772
1927
  upsert: item.actions.map((item) => ({
1773
1928
  where: {
1774
1929
  id: item.id !== undefined ? item.id : undefined,
1930
+ tradeId: item.tradeId !== undefined ? {
1931
+ equals: item.tradeId
1932
+ } : undefined,
1775
1933
  },
1776
1934
  update: {
1777
1935
  id: item.id !== undefined ? {
@@ -1798,6 +1956,18 @@ exports.Asset = {
1798
1956
  id: item.order.id !== undefined ? {
1799
1957
  equals: item.order.id
1800
1958
  } : undefined,
1959
+ clientOrderId: item.order.clientOrderId !== undefined ? {
1960
+ equals: item.order.clientOrderId
1961
+ } : undefined,
1962
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
1963
+ equals: item.order.alpacaAccountId
1964
+ } : undefined,
1965
+ assetId: item.order.assetId !== undefined ? {
1966
+ equals: item.order.assetId
1967
+ } : undefined,
1968
+ actionId: item.order.actionId !== undefined ? {
1969
+ equals: item.order.actionId
1970
+ } : undefined,
1801
1971
  },
1802
1972
  update: {
1803
1973
  id: item.order.id !== undefined ? {
@@ -1912,6 +2082,15 @@ exports.Asset = {
1912
2082
  : { connectOrCreate: {
1913
2083
  where: {
1914
2084
  id: item.order.id !== undefined ? item.order.id : undefined,
2085
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2086
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2087
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2088
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2089
+ equals: item.order.alpacaAccountId
2090
+ } : undefined,
2091
+ assetId: item.order.assetId !== undefined ? {
2092
+ equals: item.order.assetId
2093
+ } : undefined,
1915
2094
  },
1916
2095
  create: {
1917
2096
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -1964,6 +2143,9 @@ exports.Asset = {
1964
2143
  : { connectOrCreate: {
1965
2144
  where: {
1966
2145
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2146
+ userId: item.alpacaAccount.userId !== undefined ? {
2147
+ equals: item.alpacaAccount.userId
2148
+ } : undefined,
1967
2149
  },
1968
2150
  create: {
1969
2151
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2013,6 +2195,15 @@ exports.Asset = {
2013
2195
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
2014
2196
  where: {
2015
2197
  id: item.id !== undefined ? item.id : undefined,
2198
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2199
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2200
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2201
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2202
+ equals: item.alpacaAccountId
2203
+ } : undefined,
2204
+ assetId: item.assetId !== undefined ? {
2205
+ equals: item.assetId
2206
+ } : undefined,
2016
2207
  },
2017
2208
  create: {
2018
2209
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2049,6 +2240,12 @@ exports.Asset = {
2049
2240
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2050
2241
  where: {
2051
2242
  id: item.id !== undefined ? item.id : undefined,
2243
+ assetId: item.assetId !== undefined ? {
2244
+ equals: item.assetId
2245
+ } : undefined,
2246
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2247
+ equals: item.alpacaAccountId
2248
+ } : undefined,
2052
2249
  },
2053
2250
  create: {
2054
2251
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2076,6 +2273,9 @@ exports.Asset = {
2076
2273
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2077
2274
  where: {
2078
2275
  id: item.id !== undefined ? item.id : undefined,
2276
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2277
+ equals: item.alpacaAccountId
2278
+ } : undefined,
2079
2279
  },
2080
2280
  create: {
2081
2281
  message: item.message !== undefined ? item.message : undefined,
@@ -2096,6 +2296,9 @@ exports.Asset = {
2096
2296
  : { connectOrCreate: item.actions.map((item) => ({
2097
2297
  where: {
2098
2298
  id: item.id !== undefined ? item.id : undefined,
2299
+ tradeId: item.tradeId !== undefined ? {
2300
+ equals: item.tradeId
2301
+ } : undefined,
2099
2302
  },
2100
2303
  create: {
2101
2304
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2112,6 +2315,15 @@ exports.Asset = {
2112
2315
  : { connectOrCreate: {
2113
2316
  where: {
2114
2317
  id: item.order.id !== undefined ? item.order.id : undefined,
2318
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2319
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2320
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2321
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2322
+ equals: item.order.alpacaAccountId
2323
+ } : undefined,
2324
+ assetId: item.order.assetId !== undefined ? {
2325
+ equals: item.order.assetId
2326
+ } : undefined,
2115
2327
  },
2116
2328
  create: {
2117
2329
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -2149,6 +2361,15 @@ exports.Asset = {
2149
2361
  upsert: props.orders.map((item) => ({
2150
2362
  where: {
2151
2363
  id: item.id !== undefined ? item.id : undefined,
2364
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2365
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2366
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2367
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2368
+ equals: item.alpacaAccountId
2369
+ } : undefined,
2370
+ assetId: item.assetId !== undefined ? {
2371
+ equals: item.assetId
2372
+ } : undefined,
2152
2373
  },
2153
2374
  update: {
2154
2375
  id: item.id !== undefined ? {
@@ -2226,6 +2447,9 @@ exports.Asset = {
2226
2447
  id: item.stopLoss.id !== undefined ? {
2227
2448
  equals: item.stopLoss.id
2228
2449
  } : undefined,
2450
+ orderId: item.stopLoss.orderId !== undefined ? {
2451
+ equals: item.stopLoss.orderId
2452
+ } : undefined,
2229
2453
  },
2230
2454
  update: {
2231
2455
  id: item.stopLoss.id !== undefined ? {
@@ -2250,6 +2474,9 @@ exports.Asset = {
2250
2474
  id: item.takeProfit.id !== undefined ? {
2251
2475
  equals: item.takeProfit.id
2252
2476
  } : undefined,
2477
+ orderId: item.takeProfit.orderId !== undefined ? {
2478
+ equals: item.takeProfit.orderId
2479
+ } : undefined,
2253
2480
  },
2254
2481
  update: {
2255
2482
  id: item.takeProfit.id !== undefined ? {
@@ -2274,6 +2501,9 @@ exports.Asset = {
2274
2501
  id: item.alpacaAccount.id !== undefined ? {
2275
2502
  equals: item.alpacaAccount.id
2276
2503
  } : undefined,
2504
+ userId: item.alpacaAccount.userId !== undefined ? {
2505
+ equals: item.alpacaAccount.userId
2506
+ } : undefined,
2277
2507
  },
2278
2508
  update: {
2279
2509
  id: item.alpacaAccount.id !== undefined ? {
@@ -2376,6 +2606,12 @@ exports.Asset = {
2376
2606
  upsert: item.alpacaAccount.trades.map((item) => ({
2377
2607
  where: {
2378
2608
  id: item.id !== undefined ? item.id : undefined,
2609
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2610
+ equals: item.alpacaAccountId
2611
+ } : undefined,
2612
+ assetId: item.assetId !== undefined ? {
2613
+ equals: item.assetId
2614
+ } : undefined,
2379
2615
  },
2380
2616
  update: {
2381
2617
  id: item.id !== undefined ? {
@@ -2434,6 +2670,12 @@ exports.Asset = {
2434
2670
  upsert: item.alpacaAccount.positions.map((item) => ({
2435
2671
  where: {
2436
2672
  id: item.id !== undefined ? item.id : undefined,
2673
+ assetId: item.assetId !== undefined ? {
2674
+ equals: item.assetId
2675
+ } : undefined,
2676
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2677
+ equals: item.alpacaAccountId
2678
+ } : undefined,
2437
2679
  },
2438
2680
  update: {
2439
2681
  id: item.id !== undefined ? {
@@ -2500,6 +2742,9 @@ exports.Asset = {
2500
2742
  upsert: item.alpacaAccount.alerts.map((item) => ({
2501
2743
  where: {
2502
2744
  id: item.id !== undefined ? item.id : undefined,
2745
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2746
+ equals: item.alpacaAccountId
2747
+ } : undefined,
2503
2748
  },
2504
2749
  update: {
2505
2750
  id: item.id !== undefined ? {
@@ -2571,6 +2816,12 @@ exports.Asset = {
2571
2816
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2572
2817
  where: {
2573
2818
  id: item.id !== undefined ? item.id : undefined,
2819
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2820
+ equals: item.alpacaAccountId
2821
+ } : undefined,
2822
+ assetId: item.assetId !== undefined ? {
2823
+ equals: item.assetId
2824
+ } : undefined,
2574
2825
  },
2575
2826
  create: {
2576
2827
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2596,6 +2847,12 @@ exports.Asset = {
2596
2847
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2597
2848
  where: {
2598
2849
  id: item.id !== undefined ? item.id : undefined,
2850
+ assetId: item.assetId !== undefined ? {
2851
+ equals: item.assetId
2852
+ } : undefined,
2853
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2854
+ equals: item.alpacaAccountId
2855
+ } : undefined,
2599
2856
  },
2600
2857
  create: {
2601
2858
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2623,6 +2880,9 @@ exports.Asset = {
2623
2880
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2624
2881
  where: {
2625
2882
  id: item.id !== undefined ? item.id : undefined,
2883
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2884
+ equals: item.alpacaAccountId
2885
+ } : undefined,
2626
2886
  },
2627
2887
  create: {
2628
2888
  message: item.message !== undefined ? item.message : undefined,
@@ -2640,6 +2900,9 @@ exports.Asset = {
2640
2900
  id: item.action.id !== undefined ? {
2641
2901
  equals: item.action.id
2642
2902
  } : undefined,
2903
+ tradeId: item.action.tradeId !== undefined ? {
2904
+ equals: item.action.tradeId
2905
+ } : undefined,
2643
2906
  },
2644
2907
  update: {
2645
2908
  id: item.action.id !== undefined ? {
@@ -2666,6 +2929,12 @@ exports.Asset = {
2666
2929
  id: item.action.trade.id !== undefined ? {
2667
2930
  equals: item.action.trade.id
2668
2931
  } : undefined,
2932
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
2933
+ equals: item.action.trade.alpacaAccountId
2934
+ } : undefined,
2935
+ assetId: item.action.trade.assetId !== undefined ? {
2936
+ equals: item.action.trade.assetId
2937
+ } : undefined,
2669
2938
  },
2670
2939
  update: {
2671
2940
  id: item.action.trade.id !== undefined ? {
@@ -2736,6 +3005,12 @@ exports.Asset = {
2736
3005
  : { connectOrCreate: {
2737
3006
  where: {
2738
3007
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3008
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3009
+ equals: item.action.trade.alpacaAccountId
3010
+ } : undefined,
3011
+ assetId: item.action.trade.assetId !== undefined ? {
3012
+ equals: item.action.trade.assetId
3013
+ } : undefined,
2739
3014
  },
2740
3015
  create: {
2741
3016
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2788,6 +3063,7 @@ exports.Asset = {
2788
3063
  : { connectOrCreate: {
2789
3064
  where: {
2790
3065
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3066
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2791
3067
  },
2792
3068
  create: {
2793
3069
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2804,6 +3080,7 @@ exports.Asset = {
2804
3080
  : { connectOrCreate: {
2805
3081
  where: {
2806
3082
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3083
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2807
3084
  },
2808
3085
  create: {
2809
3086
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2820,6 +3097,9 @@ exports.Asset = {
2820
3097
  : { connectOrCreate: {
2821
3098
  where: {
2822
3099
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3100
+ userId: item.alpacaAccount.userId !== undefined ? {
3101
+ equals: item.alpacaAccount.userId
3102
+ } : undefined,
2823
3103
  },
2824
3104
  create: {
2825
3105
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2869,6 +3149,12 @@ exports.Asset = {
2869
3149
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2870
3150
  where: {
2871
3151
  id: item.id !== undefined ? item.id : undefined,
3152
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3153
+ equals: item.alpacaAccountId
3154
+ } : undefined,
3155
+ assetId: item.assetId !== undefined ? {
3156
+ equals: item.assetId
3157
+ } : undefined,
2872
3158
  },
2873
3159
  create: {
2874
3160
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2894,6 +3180,12 @@ exports.Asset = {
2894
3180
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2895
3181
  where: {
2896
3182
  id: item.id !== undefined ? item.id : undefined,
3183
+ assetId: item.assetId !== undefined ? {
3184
+ equals: item.assetId
3185
+ } : undefined,
3186
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3187
+ equals: item.alpacaAccountId
3188
+ } : undefined,
2897
3189
  },
2898
3190
  create: {
2899
3191
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2921,6 +3213,9 @@ exports.Asset = {
2921
3213
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2922
3214
  where: {
2923
3215
  id: item.id !== undefined ? item.id : undefined,
3216
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3217
+ equals: item.alpacaAccountId
3218
+ } : undefined,
2924
3219
  },
2925
3220
  create: {
2926
3221
  message: item.message !== undefined ? item.message : undefined,
@@ -2941,6 +3236,9 @@ exports.Asset = {
2941
3236
  : { connectOrCreate: {
2942
3237
  where: {
2943
3238
  id: item.action.id !== undefined ? item.action.id : undefined,
3239
+ tradeId: item.action.tradeId !== undefined ? {
3240
+ equals: item.action.tradeId
3241
+ } : undefined,
2944
3242
  },
2945
3243
  create: {
2946
3244
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2957,6 +3255,12 @@ exports.Asset = {
2957
3255
  : { connectOrCreate: {
2958
3256
  where: {
2959
3257
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3258
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3259
+ equals: item.action.trade.alpacaAccountId
3260
+ } : undefined,
3261
+ assetId: item.action.trade.assetId !== undefined ? {
3262
+ equals: item.action.trade.assetId
3263
+ } : undefined,
2960
3264
  },
2961
3265
  create: {
2962
3266
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2983,6 +3287,12 @@ exports.Asset = {
2983
3287
  upsert: props.positions.map((item) => ({
2984
3288
  where: {
2985
3289
  id: item.id !== undefined ? item.id : undefined,
3290
+ assetId: item.assetId !== undefined ? {
3291
+ equals: item.assetId
3292
+ } : undefined,
3293
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3294
+ equals: item.alpacaAccountId
3295
+ } : undefined,
2986
3296
  },
2987
3297
  update: {
2988
3298
  id: item.id !== undefined ? {
@@ -3033,6 +3343,9 @@ exports.Asset = {
3033
3343
  id: item.alpacaAccount.id !== undefined ? {
3034
3344
  equals: item.alpacaAccount.id
3035
3345
  } : undefined,
3346
+ userId: item.alpacaAccount.userId !== undefined ? {
3347
+ equals: item.alpacaAccount.userId
3348
+ } : undefined,
3036
3349
  },
3037
3350
  update: {
3038
3351
  id: item.alpacaAccount.id !== undefined ? {
@@ -3135,6 +3448,12 @@ exports.Asset = {
3135
3448
  upsert: item.alpacaAccount.trades.map((item) => ({
3136
3449
  where: {
3137
3450
  id: item.id !== undefined ? item.id : undefined,
3451
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3452
+ equals: item.alpacaAccountId
3453
+ } : undefined,
3454
+ assetId: item.assetId !== undefined ? {
3455
+ equals: item.assetId
3456
+ } : undefined,
3138
3457
  },
3139
3458
  update: {
3140
3459
  id: item.id !== undefined ? {
@@ -3193,6 +3512,15 @@ exports.Asset = {
3193
3512
  upsert: item.alpacaAccount.orders.map((item) => ({
3194
3513
  where: {
3195
3514
  id: item.id !== undefined ? item.id : undefined,
3515
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3516
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3517
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3518
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3519
+ equals: item.alpacaAccountId
3520
+ } : undefined,
3521
+ assetId: item.assetId !== undefined ? {
3522
+ equals: item.assetId
3523
+ } : undefined,
3196
3524
  },
3197
3525
  update: {
3198
3526
  id: item.id !== undefined ? {
@@ -3295,6 +3623,9 @@ exports.Asset = {
3295
3623
  upsert: item.alpacaAccount.alerts.map((item) => ({
3296
3624
  where: {
3297
3625
  id: item.id !== undefined ? item.id : undefined,
3626
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3627
+ equals: item.alpacaAccountId
3628
+ } : undefined,
3298
3629
  },
3299
3630
  update: {
3300
3631
  id: item.id !== undefined ? {
@@ -3366,6 +3697,12 @@ exports.Asset = {
3366
3697
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3367
3698
  where: {
3368
3699
  id: item.id !== undefined ? item.id : undefined,
3700
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3701
+ equals: item.alpacaAccountId
3702
+ } : undefined,
3703
+ assetId: item.assetId !== undefined ? {
3704
+ equals: item.assetId
3705
+ } : undefined,
3369
3706
  },
3370
3707
  create: {
3371
3708
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3391,6 +3728,15 @@ exports.Asset = {
3391
3728
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3392
3729
  where: {
3393
3730
  id: item.id !== undefined ? item.id : undefined,
3731
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3732
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3733
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3734
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3735
+ equals: item.alpacaAccountId
3736
+ } : undefined,
3737
+ assetId: item.assetId !== undefined ? {
3738
+ equals: item.assetId
3739
+ } : undefined,
3394
3740
  },
3395
3741
  create: {
3396
3742
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3427,6 +3773,9 @@ exports.Asset = {
3427
3773
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3428
3774
  where: {
3429
3775
  id: item.id !== undefined ? item.id : undefined,
3776
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3777
+ equals: item.alpacaAccountId
3778
+ } : undefined,
3430
3779
  },
3431
3780
  create: {
3432
3781
  message: item.message !== undefined ? item.message : undefined,
@@ -3462,6 +3811,9 @@ exports.Asset = {
3462
3811
  : { connectOrCreate: {
3463
3812
  where: {
3464
3813
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3814
+ userId: item.alpacaAccount.userId !== undefined ? {
3815
+ equals: item.alpacaAccount.userId
3816
+ } : undefined,
3465
3817
  },
3466
3818
  create: {
3467
3819
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -3511,6 +3863,12 @@ exports.Asset = {
3511
3863
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3512
3864
  where: {
3513
3865
  id: item.id !== undefined ? item.id : undefined,
3866
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3867
+ equals: item.alpacaAccountId
3868
+ } : undefined,
3869
+ assetId: item.assetId !== undefined ? {
3870
+ equals: item.assetId
3871
+ } : undefined,
3514
3872
  },
3515
3873
  create: {
3516
3874
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3536,6 +3894,15 @@ exports.Asset = {
3536
3894
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3537
3895
  where: {
3538
3896
  id: item.id !== undefined ? item.id : undefined,
3897
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3898
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3899
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3900
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3901
+ equals: item.alpacaAccountId
3902
+ } : undefined,
3903
+ assetId: item.assetId !== undefined ? {
3904
+ equals: item.assetId
3905
+ } : undefined,
3539
3906
  },
3540
3907
  create: {
3541
3908
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3572,6 +3939,9 @@ exports.Asset = {
3572
3939
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3573
3940
  where: {
3574
3941
  id: item.id !== undefined ? item.id : undefined,
3942
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3943
+ equals: item.alpacaAccountId
3944
+ } : undefined,
3575
3945
  },
3576
3946
  create: {
3577
3947
  message: item.message !== undefined ? item.message : undefined,
@@ -3591,6 +3961,12 @@ exports.Asset = {
3591
3961
  where: {
3592
3962
  id: item.id !== undefined ? item.id : undefined,
3593
3963
  url: item.url !== undefined ? item.url : undefined,
3964
+ assetId: item.assetId !== undefined ? {
3965
+ equals: item.assetId
3966
+ } : undefined,
3967
+ newsArticleId: item.newsArticleId !== undefined ? {
3968
+ equals: item.newsArticleId
3969
+ } : undefined,
3594
3970
  },
3595
3971
  update: {
3596
3972
  id: item.id !== undefined ? {
@@ -3992,6 +4368,12 @@ exports.Asset = {
3992
4368
  upsert: prop.trades.map((item) => ({
3993
4369
  where: {
3994
4370
  id: item.id !== undefined ? item.id : undefined,
4371
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4372
+ equals: item.alpacaAccountId
4373
+ } : undefined,
4374
+ assetId: item.assetId !== undefined ? {
4375
+ equals: item.assetId
4376
+ } : undefined,
3995
4377
  },
3996
4378
  update: {
3997
4379
  id: item.id !== undefined ? {
@@ -4036,6 +4418,9 @@ exports.Asset = {
4036
4418
  id: item.alpacaAccount.id !== undefined ? {
4037
4419
  equals: item.alpacaAccount.id
4038
4420
  } : undefined,
4421
+ userId: item.alpacaAccount.userId !== undefined ? {
4422
+ equals: item.alpacaAccount.userId
4423
+ } : undefined,
4039
4424
  },
4040
4425
  update: {
4041
4426
  id: item.alpacaAccount.id !== undefined ? {
@@ -4138,6 +4523,15 @@ exports.Asset = {
4138
4523
  upsert: item.alpacaAccount.orders.map((item) => ({
4139
4524
  where: {
4140
4525
  id: item.id !== undefined ? item.id : undefined,
4526
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4527
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4528
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4529
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4530
+ equals: item.alpacaAccountId
4531
+ } : undefined,
4532
+ assetId: item.assetId !== undefined ? {
4533
+ equals: item.assetId
4534
+ } : undefined,
4141
4535
  },
4142
4536
  update: {
4143
4537
  id: item.id !== undefined ? {
@@ -4240,6 +4634,12 @@ exports.Asset = {
4240
4634
  upsert: item.alpacaAccount.positions.map((item) => ({
4241
4635
  where: {
4242
4636
  id: item.id !== undefined ? item.id : undefined,
4637
+ assetId: item.assetId !== undefined ? {
4638
+ equals: item.assetId
4639
+ } : undefined,
4640
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4641
+ equals: item.alpacaAccountId
4642
+ } : undefined,
4243
4643
  },
4244
4644
  update: {
4245
4645
  id: item.id !== undefined ? {
@@ -4306,6 +4706,9 @@ exports.Asset = {
4306
4706
  upsert: item.alpacaAccount.alerts.map((item) => ({
4307
4707
  where: {
4308
4708
  id: item.id !== undefined ? item.id : undefined,
4709
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4710
+ equals: item.alpacaAccountId
4711
+ } : undefined,
4309
4712
  },
4310
4713
  update: {
4311
4714
  id: item.id !== undefined ? {
@@ -4377,6 +4780,15 @@ exports.Asset = {
4377
4780
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4378
4781
  where: {
4379
4782
  id: item.id !== undefined ? item.id : undefined,
4783
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4784
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4785
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4786
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4787
+ equals: item.alpacaAccountId
4788
+ } : undefined,
4789
+ assetId: item.assetId !== undefined ? {
4790
+ equals: item.assetId
4791
+ } : undefined,
4380
4792
  },
4381
4793
  create: {
4382
4794
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4413,6 +4825,12 @@ exports.Asset = {
4413
4825
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4414
4826
  where: {
4415
4827
  id: item.id !== undefined ? item.id : undefined,
4828
+ assetId: item.assetId !== undefined ? {
4829
+ equals: item.assetId
4830
+ } : undefined,
4831
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4832
+ equals: item.alpacaAccountId
4833
+ } : undefined,
4416
4834
  },
4417
4835
  create: {
4418
4836
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4440,6 +4858,9 @@ exports.Asset = {
4440
4858
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4441
4859
  where: {
4442
4860
  id: item.id !== undefined ? item.id : undefined,
4861
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4862
+ equals: item.alpacaAccountId
4863
+ } : undefined,
4443
4864
  },
4444
4865
  create: {
4445
4866
  message: item.message !== undefined ? item.message : undefined,
@@ -4455,6 +4876,9 @@ exports.Asset = {
4455
4876
  upsert: item.actions.map((item) => ({
4456
4877
  where: {
4457
4878
  id: item.id !== undefined ? item.id : undefined,
4879
+ tradeId: item.tradeId !== undefined ? {
4880
+ equals: item.tradeId
4881
+ } : undefined,
4458
4882
  },
4459
4883
  update: {
4460
4884
  id: item.id !== undefined ? {
@@ -4481,6 +4905,18 @@ exports.Asset = {
4481
4905
  id: item.order.id !== undefined ? {
4482
4906
  equals: item.order.id
4483
4907
  } : undefined,
4908
+ clientOrderId: item.order.clientOrderId !== undefined ? {
4909
+ equals: item.order.clientOrderId
4910
+ } : undefined,
4911
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
4912
+ equals: item.order.alpacaAccountId
4913
+ } : undefined,
4914
+ assetId: item.order.assetId !== undefined ? {
4915
+ equals: item.order.assetId
4916
+ } : undefined,
4917
+ actionId: item.order.actionId !== undefined ? {
4918
+ equals: item.order.actionId
4919
+ } : undefined,
4484
4920
  },
4485
4921
  update: {
4486
4922
  id: item.order.id !== undefined ? {
@@ -4595,6 +5031,15 @@ exports.Asset = {
4595
5031
  : { connectOrCreate: {
4596
5032
  where: {
4597
5033
  id: item.order.id !== undefined ? item.order.id : undefined,
5034
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5035
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5036
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5037
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5038
+ equals: item.order.alpacaAccountId
5039
+ } : undefined,
5040
+ assetId: item.order.assetId !== undefined ? {
5041
+ equals: item.order.assetId
5042
+ } : undefined,
4598
5043
  },
4599
5044
  create: {
4600
5045
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4647,6 +5092,9 @@ exports.Asset = {
4647
5092
  : { connectOrCreate: {
4648
5093
  where: {
4649
5094
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
5095
+ userId: item.alpacaAccount.userId !== undefined ? {
5096
+ equals: item.alpacaAccount.userId
5097
+ } : undefined,
4650
5098
  },
4651
5099
  create: {
4652
5100
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -4696,6 +5144,15 @@ exports.Asset = {
4696
5144
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4697
5145
  where: {
4698
5146
  id: item.id !== undefined ? item.id : undefined,
5147
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5148
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5149
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5150
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5151
+ equals: item.alpacaAccountId
5152
+ } : undefined,
5153
+ assetId: item.assetId !== undefined ? {
5154
+ equals: item.assetId
5155
+ } : undefined,
4699
5156
  },
4700
5157
  create: {
4701
5158
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4732,6 +5189,12 @@ exports.Asset = {
4732
5189
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4733
5190
  where: {
4734
5191
  id: item.id !== undefined ? item.id : undefined,
5192
+ assetId: item.assetId !== undefined ? {
5193
+ equals: item.assetId
5194
+ } : undefined,
5195
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5196
+ equals: item.alpacaAccountId
5197
+ } : undefined,
4735
5198
  },
4736
5199
  create: {
4737
5200
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4759,6 +5222,9 @@ exports.Asset = {
4759
5222
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4760
5223
  where: {
4761
5224
  id: item.id !== undefined ? item.id : undefined,
5225
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5226
+ equals: item.alpacaAccountId
5227
+ } : undefined,
4762
5228
  },
4763
5229
  create: {
4764
5230
  message: item.message !== undefined ? item.message : undefined,
@@ -4779,6 +5245,9 @@ exports.Asset = {
4779
5245
  : { connectOrCreate: item.actions.map((item) => ({
4780
5246
  where: {
4781
5247
  id: item.id !== undefined ? item.id : undefined,
5248
+ tradeId: item.tradeId !== undefined ? {
5249
+ equals: item.tradeId
5250
+ } : undefined,
4782
5251
  },
4783
5252
  create: {
4784
5253
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -4795,6 +5264,15 @@ exports.Asset = {
4795
5264
  : { connectOrCreate: {
4796
5265
  where: {
4797
5266
  id: item.order.id !== undefined ? item.order.id : undefined,
5267
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5268
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5269
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5270
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5271
+ equals: item.order.alpacaAccountId
5272
+ } : undefined,
5273
+ assetId: item.order.assetId !== undefined ? {
5274
+ equals: item.order.assetId
5275
+ } : undefined,
4798
5276
  },
4799
5277
  create: {
4800
5278
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4832,6 +5310,15 @@ exports.Asset = {
4832
5310
  upsert: prop.orders.map((item) => ({
4833
5311
  where: {
4834
5312
  id: item.id !== undefined ? item.id : undefined,
5313
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5314
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5315
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5316
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5317
+ equals: item.alpacaAccountId
5318
+ } : undefined,
5319
+ assetId: item.assetId !== undefined ? {
5320
+ equals: item.assetId
5321
+ } : undefined,
4835
5322
  },
4836
5323
  update: {
4837
5324
  id: item.id !== undefined ? {
@@ -4909,6 +5396,9 @@ exports.Asset = {
4909
5396
  id: item.stopLoss.id !== undefined ? {
4910
5397
  equals: item.stopLoss.id
4911
5398
  } : undefined,
5399
+ orderId: item.stopLoss.orderId !== undefined ? {
5400
+ equals: item.stopLoss.orderId
5401
+ } : undefined,
4912
5402
  },
4913
5403
  update: {
4914
5404
  id: item.stopLoss.id !== undefined ? {
@@ -4933,6 +5423,9 @@ exports.Asset = {
4933
5423
  id: item.takeProfit.id !== undefined ? {
4934
5424
  equals: item.takeProfit.id
4935
5425
  } : undefined,
5426
+ orderId: item.takeProfit.orderId !== undefined ? {
5427
+ equals: item.takeProfit.orderId
5428
+ } : undefined,
4936
5429
  },
4937
5430
  update: {
4938
5431
  id: item.takeProfit.id !== undefined ? {
@@ -4957,6 +5450,9 @@ exports.Asset = {
4957
5450
  id: item.alpacaAccount.id !== undefined ? {
4958
5451
  equals: item.alpacaAccount.id
4959
5452
  } : undefined,
5453
+ userId: item.alpacaAccount.userId !== undefined ? {
5454
+ equals: item.alpacaAccount.userId
5455
+ } : undefined,
4960
5456
  },
4961
5457
  update: {
4962
5458
  id: item.alpacaAccount.id !== undefined ? {
@@ -5059,6 +5555,12 @@ exports.Asset = {
5059
5555
  upsert: item.alpacaAccount.trades.map((item) => ({
5060
5556
  where: {
5061
5557
  id: item.id !== undefined ? item.id : undefined,
5558
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5559
+ equals: item.alpacaAccountId
5560
+ } : undefined,
5561
+ assetId: item.assetId !== undefined ? {
5562
+ equals: item.assetId
5563
+ } : undefined,
5062
5564
  },
5063
5565
  update: {
5064
5566
  id: item.id !== undefined ? {
@@ -5117,6 +5619,12 @@ exports.Asset = {
5117
5619
  upsert: item.alpacaAccount.positions.map((item) => ({
5118
5620
  where: {
5119
5621
  id: item.id !== undefined ? item.id : undefined,
5622
+ assetId: item.assetId !== undefined ? {
5623
+ equals: item.assetId
5624
+ } : undefined,
5625
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5626
+ equals: item.alpacaAccountId
5627
+ } : undefined,
5120
5628
  },
5121
5629
  update: {
5122
5630
  id: item.id !== undefined ? {
@@ -5183,6 +5691,9 @@ exports.Asset = {
5183
5691
  upsert: item.alpacaAccount.alerts.map((item) => ({
5184
5692
  where: {
5185
5693
  id: item.id !== undefined ? item.id : undefined,
5694
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5695
+ equals: item.alpacaAccountId
5696
+ } : undefined,
5186
5697
  },
5187
5698
  update: {
5188
5699
  id: item.id !== undefined ? {
@@ -5254,6 +5765,12 @@ exports.Asset = {
5254
5765
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5255
5766
  where: {
5256
5767
  id: item.id !== undefined ? item.id : undefined,
5768
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5769
+ equals: item.alpacaAccountId
5770
+ } : undefined,
5771
+ assetId: item.assetId !== undefined ? {
5772
+ equals: item.assetId
5773
+ } : undefined,
5257
5774
  },
5258
5775
  create: {
5259
5776
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5279,6 +5796,12 @@ exports.Asset = {
5279
5796
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5280
5797
  where: {
5281
5798
  id: item.id !== undefined ? item.id : undefined,
5799
+ assetId: item.assetId !== undefined ? {
5800
+ equals: item.assetId
5801
+ } : undefined,
5802
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5803
+ equals: item.alpacaAccountId
5804
+ } : undefined,
5282
5805
  },
5283
5806
  create: {
5284
5807
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5306,6 +5829,9 @@ exports.Asset = {
5306
5829
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5307
5830
  where: {
5308
5831
  id: item.id !== undefined ? item.id : undefined,
5832
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5833
+ equals: item.alpacaAccountId
5834
+ } : undefined,
5309
5835
  },
5310
5836
  create: {
5311
5837
  message: item.message !== undefined ? item.message : undefined,
@@ -5323,6 +5849,9 @@ exports.Asset = {
5323
5849
  id: item.action.id !== undefined ? {
5324
5850
  equals: item.action.id
5325
5851
  } : undefined,
5852
+ tradeId: item.action.tradeId !== undefined ? {
5853
+ equals: item.action.tradeId
5854
+ } : undefined,
5326
5855
  },
5327
5856
  update: {
5328
5857
  id: item.action.id !== undefined ? {
@@ -5349,6 +5878,12 @@ exports.Asset = {
5349
5878
  id: item.action.trade.id !== undefined ? {
5350
5879
  equals: item.action.trade.id
5351
5880
  } : undefined,
5881
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
5882
+ equals: item.action.trade.alpacaAccountId
5883
+ } : undefined,
5884
+ assetId: item.action.trade.assetId !== undefined ? {
5885
+ equals: item.action.trade.assetId
5886
+ } : undefined,
5352
5887
  },
5353
5888
  update: {
5354
5889
  id: item.action.trade.id !== undefined ? {
@@ -5419,6 +5954,12 @@ exports.Asset = {
5419
5954
  : { connectOrCreate: {
5420
5955
  where: {
5421
5956
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
5957
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
5958
+ equals: item.action.trade.alpacaAccountId
5959
+ } : undefined,
5960
+ assetId: item.action.trade.assetId !== undefined ? {
5961
+ equals: item.action.trade.assetId
5962
+ } : undefined,
5422
5963
  },
5423
5964
  create: {
5424
5965
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5471,6 +6012,7 @@ exports.Asset = {
5471
6012
  : { connectOrCreate: {
5472
6013
  where: {
5473
6014
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
6015
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
5474
6016
  },
5475
6017
  create: {
5476
6018
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -5487,6 +6029,7 @@ exports.Asset = {
5487
6029
  : { connectOrCreate: {
5488
6030
  where: {
5489
6031
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
6032
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
5490
6033
  },
5491
6034
  create: {
5492
6035
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -5503,6 +6046,9 @@ exports.Asset = {
5503
6046
  : { connectOrCreate: {
5504
6047
  where: {
5505
6048
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
6049
+ userId: item.alpacaAccount.userId !== undefined ? {
6050
+ equals: item.alpacaAccount.userId
6051
+ } : undefined,
5506
6052
  },
5507
6053
  create: {
5508
6054
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -5552,6 +6098,12 @@ exports.Asset = {
5552
6098
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5553
6099
  where: {
5554
6100
  id: item.id !== undefined ? item.id : undefined,
6101
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6102
+ equals: item.alpacaAccountId
6103
+ } : undefined,
6104
+ assetId: item.assetId !== undefined ? {
6105
+ equals: item.assetId
6106
+ } : undefined,
5555
6107
  },
5556
6108
  create: {
5557
6109
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5577,6 +6129,12 @@ exports.Asset = {
5577
6129
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5578
6130
  where: {
5579
6131
  id: item.id !== undefined ? item.id : undefined,
6132
+ assetId: item.assetId !== undefined ? {
6133
+ equals: item.assetId
6134
+ } : undefined,
6135
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6136
+ equals: item.alpacaAccountId
6137
+ } : undefined,
5580
6138
  },
5581
6139
  create: {
5582
6140
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5604,6 +6162,9 @@ exports.Asset = {
5604
6162
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5605
6163
  where: {
5606
6164
  id: item.id !== undefined ? item.id : undefined,
6165
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6166
+ equals: item.alpacaAccountId
6167
+ } : undefined,
5607
6168
  },
5608
6169
  create: {
5609
6170
  message: item.message !== undefined ? item.message : undefined,
@@ -5624,6 +6185,9 @@ exports.Asset = {
5624
6185
  : { connectOrCreate: {
5625
6186
  where: {
5626
6187
  id: item.action.id !== undefined ? item.action.id : undefined,
6188
+ tradeId: item.action.tradeId !== undefined ? {
6189
+ equals: item.action.tradeId
6190
+ } : undefined,
5627
6191
  },
5628
6192
  create: {
5629
6193
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -5640,6 +6204,12 @@ exports.Asset = {
5640
6204
  : { connectOrCreate: {
5641
6205
  where: {
5642
6206
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6207
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6208
+ equals: item.action.trade.alpacaAccountId
6209
+ } : undefined,
6210
+ assetId: item.action.trade.assetId !== undefined ? {
6211
+ equals: item.action.trade.assetId
6212
+ } : undefined,
5643
6213
  },
5644
6214
  create: {
5645
6215
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5666,6 +6236,12 @@ exports.Asset = {
5666
6236
  upsert: prop.positions.map((item) => ({
5667
6237
  where: {
5668
6238
  id: item.id !== undefined ? item.id : undefined,
6239
+ assetId: item.assetId !== undefined ? {
6240
+ equals: item.assetId
6241
+ } : undefined,
6242
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6243
+ equals: item.alpacaAccountId
6244
+ } : undefined,
5669
6245
  },
5670
6246
  update: {
5671
6247
  id: item.id !== undefined ? {
@@ -5716,6 +6292,9 @@ exports.Asset = {
5716
6292
  id: item.alpacaAccount.id !== undefined ? {
5717
6293
  equals: item.alpacaAccount.id
5718
6294
  } : undefined,
6295
+ userId: item.alpacaAccount.userId !== undefined ? {
6296
+ equals: item.alpacaAccount.userId
6297
+ } : undefined,
5719
6298
  },
5720
6299
  update: {
5721
6300
  id: item.alpacaAccount.id !== undefined ? {
@@ -5818,6 +6397,12 @@ exports.Asset = {
5818
6397
  upsert: item.alpacaAccount.trades.map((item) => ({
5819
6398
  where: {
5820
6399
  id: item.id !== undefined ? item.id : undefined,
6400
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6401
+ equals: item.alpacaAccountId
6402
+ } : undefined,
6403
+ assetId: item.assetId !== undefined ? {
6404
+ equals: item.assetId
6405
+ } : undefined,
5821
6406
  },
5822
6407
  update: {
5823
6408
  id: item.id !== undefined ? {
@@ -5876,6 +6461,15 @@ exports.Asset = {
5876
6461
  upsert: item.alpacaAccount.orders.map((item) => ({
5877
6462
  where: {
5878
6463
  id: item.id !== undefined ? item.id : undefined,
6464
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6465
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6466
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6467
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6468
+ equals: item.alpacaAccountId
6469
+ } : undefined,
6470
+ assetId: item.assetId !== undefined ? {
6471
+ equals: item.assetId
6472
+ } : undefined,
5879
6473
  },
5880
6474
  update: {
5881
6475
  id: item.id !== undefined ? {
@@ -5978,6 +6572,9 @@ exports.Asset = {
5978
6572
  upsert: item.alpacaAccount.alerts.map((item) => ({
5979
6573
  where: {
5980
6574
  id: item.id !== undefined ? item.id : undefined,
6575
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6576
+ equals: item.alpacaAccountId
6577
+ } : undefined,
5981
6578
  },
5982
6579
  update: {
5983
6580
  id: item.id !== undefined ? {
@@ -6049,6 +6646,12 @@ exports.Asset = {
6049
6646
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6050
6647
  where: {
6051
6648
  id: item.id !== undefined ? item.id : undefined,
6649
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6650
+ equals: item.alpacaAccountId
6651
+ } : undefined,
6652
+ assetId: item.assetId !== undefined ? {
6653
+ equals: item.assetId
6654
+ } : undefined,
6052
6655
  },
6053
6656
  create: {
6054
6657
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6074,6 +6677,15 @@ exports.Asset = {
6074
6677
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6075
6678
  where: {
6076
6679
  id: item.id !== undefined ? item.id : undefined,
6680
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6681
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6682
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6683
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6684
+ equals: item.alpacaAccountId
6685
+ } : undefined,
6686
+ assetId: item.assetId !== undefined ? {
6687
+ equals: item.assetId
6688
+ } : undefined,
6077
6689
  },
6078
6690
  create: {
6079
6691
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6110,6 +6722,9 @@ exports.Asset = {
6110
6722
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6111
6723
  where: {
6112
6724
  id: item.id !== undefined ? item.id : undefined,
6725
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6726
+ equals: item.alpacaAccountId
6727
+ } : undefined,
6113
6728
  },
6114
6729
  create: {
6115
6730
  message: item.message !== undefined ? item.message : undefined,
@@ -6145,6 +6760,9 @@ exports.Asset = {
6145
6760
  : { connectOrCreate: {
6146
6761
  where: {
6147
6762
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
6763
+ userId: item.alpacaAccount.userId !== undefined ? {
6764
+ equals: item.alpacaAccount.userId
6765
+ } : undefined,
6148
6766
  },
6149
6767
  create: {
6150
6768
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -6194,6 +6812,12 @@ exports.Asset = {
6194
6812
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6195
6813
  where: {
6196
6814
  id: item.id !== undefined ? item.id : undefined,
6815
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6816
+ equals: item.alpacaAccountId
6817
+ } : undefined,
6818
+ assetId: item.assetId !== undefined ? {
6819
+ equals: item.assetId
6820
+ } : undefined,
6197
6821
  },
6198
6822
  create: {
6199
6823
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6219,6 +6843,15 @@ exports.Asset = {
6219
6843
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6220
6844
  where: {
6221
6845
  id: item.id !== undefined ? item.id : undefined,
6846
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6847
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6848
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6849
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6850
+ equals: item.alpacaAccountId
6851
+ } : undefined,
6852
+ assetId: item.assetId !== undefined ? {
6853
+ equals: item.assetId
6854
+ } : undefined,
6222
6855
  },
6223
6856
  create: {
6224
6857
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6255,6 +6888,9 @@ exports.Asset = {
6255
6888
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6256
6889
  where: {
6257
6890
  id: item.id !== undefined ? item.id : undefined,
6891
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6892
+ equals: item.alpacaAccountId
6893
+ } : undefined,
6258
6894
  },
6259
6895
  create: {
6260
6896
  message: item.message !== undefined ? item.message : undefined,
@@ -6274,6 +6910,12 @@ exports.Asset = {
6274
6910
  where: {
6275
6911
  id: item.id !== undefined ? item.id : undefined,
6276
6912
  url: item.url !== undefined ? item.url : undefined,
6913
+ assetId: item.assetId !== undefined ? {
6914
+ equals: item.assetId
6915
+ } : undefined,
6916
+ newsArticleId: item.newsArticleId !== undefined ? {
6917
+ equals: item.newsArticleId
6918
+ } : undefined,
6277
6919
  },
6278
6920
  update: {
6279
6921
  id: item.id !== undefined ? {