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/server/Asset.mjs CHANGED
@@ -305,6 +305,12 @@ export const Asset = {
305
305
  : { connectOrCreate: props.trades.map((item) => ({
306
306
  where: {
307
307
  id: item.id !== undefined ? item.id : undefined,
308
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
309
+ equals: item.alpacaAccountId
310
+ } : undefined,
311
+ assetId: item.assetId !== undefined ? {
312
+ equals: item.assetId
313
+ } : undefined,
308
314
  },
309
315
  create: {
310
316
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -327,6 +333,9 @@ export const Asset = {
327
333
  : { connectOrCreate: {
328
334
  where: {
329
335
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
336
+ userId: item.alpacaAccount.userId !== undefined ? {
337
+ equals: item.alpacaAccount.userId
338
+ } : undefined,
330
339
  },
331
340
  create: {
332
341
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -376,6 +385,15 @@ export const Asset = {
376
385
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
377
386
  where: {
378
387
  id: item.id !== undefined ? item.id : undefined,
388
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
389
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
390
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
391
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
392
+ equals: item.alpacaAccountId
393
+ } : undefined,
394
+ assetId: item.assetId !== undefined ? {
395
+ equals: item.assetId
396
+ } : undefined,
379
397
  },
380
398
  create: {
381
399
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -412,6 +430,12 @@ export const Asset = {
412
430
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
413
431
  where: {
414
432
  id: item.id !== undefined ? item.id : undefined,
433
+ assetId: item.assetId !== undefined ? {
434
+ equals: item.assetId
435
+ } : undefined,
436
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
437
+ equals: item.alpacaAccountId
438
+ } : undefined,
415
439
  },
416
440
  create: {
417
441
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -439,6 +463,9 @@ export const Asset = {
439
463
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
440
464
  where: {
441
465
  id: item.id !== undefined ? item.id : undefined,
466
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
467
+ equals: item.alpacaAccountId
468
+ } : undefined,
442
469
  },
443
470
  create: {
444
471
  message: item.message !== undefined ? item.message : undefined,
@@ -459,6 +486,9 @@ export const Asset = {
459
486
  : { connectOrCreate: item.actions.map((item) => ({
460
487
  where: {
461
488
  id: item.id !== undefined ? item.id : undefined,
489
+ tradeId: item.tradeId !== undefined ? {
490
+ equals: item.tradeId
491
+ } : undefined,
462
492
  },
463
493
  create: {
464
494
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -475,6 +505,15 @@ export const Asset = {
475
505
  : { connectOrCreate: {
476
506
  where: {
477
507
  id: item.order.id !== undefined ? item.order.id : undefined,
508
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
509
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
510
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
511
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
512
+ equals: item.order.alpacaAccountId
513
+ } : undefined,
514
+ assetId: item.order.assetId !== undefined ? {
515
+ equals: item.order.assetId
516
+ } : undefined,
478
517
  },
479
518
  create: {
480
519
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -517,6 +556,15 @@ export const Asset = {
517
556
  : { connectOrCreate: props.orders.map((item) => ({
518
557
  where: {
519
558
  id: item.id !== undefined ? item.id : undefined,
559
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
560
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
561
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
562
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
563
+ equals: item.alpacaAccountId
564
+ } : undefined,
565
+ assetId: item.assetId !== undefined ? {
566
+ equals: item.assetId
567
+ } : undefined,
520
568
  },
521
569
  create: {
522
570
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -550,6 +598,7 @@ export const Asset = {
550
598
  : { connectOrCreate: {
551
599
  where: {
552
600
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
601
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
553
602
  },
554
603
  create: {
555
604
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -566,6 +615,7 @@ export const Asset = {
566
615
  : { connectOrCreate: {
567
616
  where: {
568
617
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
618
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
569
619
  },
570
620
  create: {
571
621
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -582,6 +632,9 @@ export const Asset = {
582
632
  : { connectOrCreate: {
583
633
  where: {
584
634
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
635
+ userId: item.alpacaAccount.userId !== undefined ? {
636
+ equals: item.alpacaAccount.userId
637
+ } : undefined,
585
638
  },
586
639
  create: {
587
640
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -631,6 +684,12 @@ export const Asset = {
631
684
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
632
685
  where: {
633
686
  id: item.id !== undefined ? item.id : undefined,
687
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
688
+ equals: item.alpacaAccountId
689
+ } : undefined,
690
+ assetId: item.assetId !== undefined ? {
691
+ equals: item.assetId
692
+ } : undefined,
634
693
  },
635
694
  create: {
636
695
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -656,6 +715,12 @@ export const Asset = {
656
715
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
657
716
  where: {
658
717
  id: item.id !== undefined ? item.id : undefined,
718
+ assetId: item.assetId !== undefined ? {
719
+ equals: item.assetId
720
+ } : undefined,
721
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
722
+ equals: item.alpacaAccountId
723
+ } : undefined,
659
724
  },
660
725
  create: {
661
726
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -683,6 +748,9 @@ export const Asset = {
683
748
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
684
749
  where: {
685
750
  id: item.id !== undefined ? item.id : undefined,
751
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
752
+ equals: item.alpacaAccountId
753
+ } : undefined,
686
754
  },
687
755
  create: {
688
756
  message: item.message !== undefined ? item.message : undefined,
@@ -703,6 +771,9 @@ export const Asset = {
703
771
  : { connectOrCreate: {
704
772
  where: {
705
773
  id: item.action.id !== undefined ? item.action.id : undefined,
774
+ tradeId: item.action.tradeId !== undefined ? {
775
+ equals: item.action.tradeId
776
+ } : undefined,
706
777
  },
707
778
  create: {
708
779
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -719,6 +790,12 @@ export const Asset = {
719
790
  : { connectOrCreate: {
720
791
  where: {
721
792
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
793
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
794
+ equals: item.action.trade.alpacaAccountId
795
+ } : undefined,
796
+ assetId: item.action.trade.assetId !== undefined ? {
797
+ equals: item.action.trade.assetId
798
+ } : undefined,
722
799
  },
723
800
  create: {
724
801
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -750,6 +827,12 @@ export const Asset = {
750
827
  : { connectOrCreate: props.positions.map((item) => ({
751
828
  where: {
752
829
  id: item.id !== undefined ? item.id : undefined,
830
+ assetId: item.assetId !== undefined ? {
831
+ equals: item.assetId
832
+ } : undefined,
833
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
834
+ equals: item.alpacaAccountId
835
+ } : undefined,
753
836
  },
754
837
  create: {
755
838
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -774,6 +857,9 @@ export const Asset = {
774
857
  : { connectOrCreate: {
775
858
  where: {
776
859
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
860
+ userId: item.alpacaAccount.userId !== undefined ? {
861
+ equals: item.alpacaAccount.userId
862
+ } : undefined,
777
863
  },
778
864
  create: {
779
865
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -823,6 +909,12 @@ export const Asset = {
823
909
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
824
910
  where: {
825
911
  id: item.id !== undefined ? item.id : undefined,
912
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
913
+ equals: item.alpacaAccountId
914
+ } : undefined,
915
+ assetId: item.assetId !== undefined ? {
916
+ equals: item.assetId
917
+ } : undefined,
826
918
  },
827
919
  create: {
828
920
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -848,6 +940,15 @@ export const Asset = {
848
940
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
849
941
  where: {
850
942
  id: item.id !== undefined ? item.id : undefined,
943
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
944
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
945
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
946
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
947
+ equals: item.alpacaAccountId
948
+ } : undefined,
949
+ assetId: item.assetId !== undefined ? {
950
+ equals: item.assetId
951
+ } : undefined,
851
952
  },
852
953
  create: {
853
954
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -884,6 +985,9 @@ export const Asset = {
884
985
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
885
986
  where: {
886
987
  id: item.id !== undefined ? item.id : undefined,
988
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
989
+ equals: item.alpacaAccountId
990
+ } : undefined,
887
991
  },
888
992
  create: {
889
993
  message: item.message !== undefined ? item.message : undefined,
@@ -908,6 +1012,12 @@ export const Asset = {
908
1012
  where: {
909
1013
  id: item.id !== undefined ? item.id : undefined,
910
1014
  url: item.url !== undefined ? item.url : undefined,
1015
+ assetId: item.assetId !== undefined ? {
1016
+ equals: item.assetId
1017
+ } : undefined,
1018
+ newsArticleId: item.newsArticleId !== undefined ? {
1019
+ equals: item.newsArticleId
1020
+ } : undefined,
911
1021
  },
912
1022
  create: {
913
1023
  url: item.url !== undefined ? item.url : undefined,
@@ -1307,6 +1417,12 @@ export const Asset = {
1307
1417
  upsert: props.trades.map((item) => ({
1308
1418
  where: {
1309
1419
  id: item.id !== undefined ? item.id : undefined,
1420
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1421
+ equals: item.alpacaAccountId
1422
+ } : undefined,
1423
+ assetId: item.assetId !== undefined ? {
1424
+ equals: item.assetId
1425
+ } : undefined,
1310
1426
  },
1311
1427
  update: {
1312
1428
  id: item.id !== undefined ? {
@@ -1351,6 +1467,9 @@ export const Asset = {
1351
1467
  id: item.alpacaAccount.id !== undefined ? {
1352
1468
  equals: item.alpacaAccount.id
1353
1469
  } : undefined,
1470
+ userId: item.alpacaAccount.userId !== undefined ? {
1471
+ equals: item.alpacaAccount.userId
1472
+ } : undefined,
1354
1473
  },
1355
1474
  update: {
1356
1475
  id: item.alpacaAccount.id !== undefined ? {
@@ -1453,6 +1572,15 @@ export const Asset = {
1453
1572
  upsert: item.alpacaAccount.orders.map((item) => ({
1454
1573
  where: {
1455
1574
  id: item.id !== undefined ? item.id : undefined,
1575
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1576
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1577
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1578
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1579
+ equals: item.alpacaAccountId
1580
+ } : undefined,
1581
+ assetId: item.assetId !== undefined ? {
1582
+ equals: item.assetId
1583
+ } : undefined,
1456
1584
  },
1457
1585
  update: {
1458
1586
  id: item.id !== undefined ? {
@@ -1555,6 +1683,12 @@ export const Asset = {
1555
1683
  upsert: item.alpacaAccount.positions.map((item) => ({
1556
1684
  where: {
1557
1685
  id: item.id !== undefined ? item.id : undefined,
1686
+ assetId: item.assetId !== undefined ? {
1687
+ equals: item.assetId
1688
+ } : undefined,
1689
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1690
+ equals: item.alpacaAccountId
1691
+ } : undefined,
1558
1692
  },
1559
1693
  update: {
1560
1694
  id: item.id !== undefined ? {
@@ -1621,6 +1755,9 @@ export const Asset = {
1621
1755
  upsert: item.alpacaAccount.alerts.map((item) => ({
1622
1756
  where: {
1623
1757
  id: item.id !== undefined ? item.id : undefined,
1758
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1759
+ equals: item.alpacaAccountId
1760
+ } : undefined,
1624
1761
  },
1625
1762
  update: {
1626
1763
  id: item.id !== undefined ? {
@@ -1692,6 +1829,15 @@ export const Asset = {
1692
1829
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
1693
1830
  where: {
1694
1831
  id: item.id !== undefined ? item.id : undefined,
1832
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1833
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1834
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1835
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1836
+ equals: item.alpacaAccountId
1837
+ } : undefined,
1838
+ assetId: item.assetId !== undefined ? {
1839
+ equals: item.assetId
1840
+ } : undefined,
1695
1841
  },
1696
1842
  create: {
1697
1843
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1728,6 +1874,12 @@ export const Asset = {
1728
1874
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
1729
1875
  where: {
1730
1876
  id: item.id !== undefined ? item.id : undefined,
1877
+ assetId: item.assetId !== undefined ? {
1878
+ equals: item.assetId
1879
+ } : undefined,
1880
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1881
+ equals: item.alpacaAccountId
1882
+ } : undefined,
1731
1883
  },
1732
1884
  create: {
1733
1885
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1755,6 +1907,9 @@ export const Asset = {
1755
1907
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
1756
1908
  where: {
1757
1909
  id: item.id !== undefined ? item.id : undefined,
1910
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1911
+ equals: item.alpacaAccountId
1912
+ } : undefined,
1758
1913
  },
1759
1914
  create: {
1760
1915
  message: item.message !== undefined ? item.message : undefined,
@@ -1770,6 +1925,9 @@ export const Asset = {
1770
1925
  upsert: item.actions.map((item) => ({
1771
1926
  where: {
1772
1927
  id: item.id !== undefined ? item.id : undefined,
1928
+ tradeId: item.tradeId !== undefined ? {
1929
+ equals: item.tradeId
1930
+ } : undefined,
1773
1931
  },
1774
1932
  update: {
1775
1933
  id: item.id !== undefined ? {
@@ -1796,6 +1954,18 @@ export const Asset = {
1796
1954
  id: item.order.id !== undefined ? {
1797
1955
  equals: item.order.id
1798
1956
  } : undefined,
1957
+ clientOrderId: item.order.clientOrderId !== undefined ? {
1958
+ equals: item.order.clientOrderId
1959
+ } : undefined,
1960
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
1961
+ equals: item.order.alpacaAccountId
1962
+ } : undefined,
1963
+ assetId: item.order.assetId !== undefined ? {
1964
+ equals: item.order.assetId
1965
+ } : undefined,
1966
+ actionId: item.order.actionId !== undefined ? {
1967
+ equals: item.order.actionId
1968
+ } : undefined,
1799
1969
  },
1800
1970
  update: {
1801
1971
  id: item.order.id !== undefined ? {
@@ -1910,6 +2080,15 @@ export const Asset = {
1910
2080
  : { connectOrCreate: {
1911
2081
  where: {
1912
2082
  id: item.order.id !== undefined ? item.order.id : undefined,
2083
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2084
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2085
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2086
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2087
+ equals: item.order.alpacaAccountId
2088
+ } : undefined,
2089
+ assetId: item.order.assetId !== undefined ? {
2090
+ equals: item.order.assetId
2091
+ } : undefined,
1913
2092
  },
1914
2093
  create: {
1915
2094
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -1962,6 +2141,9 @@ export const Asset = {
1962
2141
  : { connectOrCreate: {
1963
2142
  where: {
1964
2143
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2144
+ userId: item.alpacaAccount.userId !== undefined ? {
2145
+ equals: item.alpacaAccount.userId
2146
+ } : undefined,
1965
2147
  },
1966
2148
  create: {
1967
2149
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2011,6 +2193,15 @@ export const Asset = {
2011
2193
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
2012
2194
  where: {
2013
2195
  id: item.id !== undefined ? item.id : undefined,
2196
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2197
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2198
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2199
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2200
+ equals: item.alpacaAccountId
2201
+ } : undefined,
2202
+ assetId: item.assetId !== undefined ? {
2203
+ equals: item.assetId
2204
+ } : undefined,
2014
2205
  },
2015
2206
  create: {
2016
2207
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2047,6 +2238,12 @@ export const Asset = {
2047
2238
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2048
2239
  where: {
2049
2240
  id: item.id !== undefined ? item.id : undefined,
2241
+ assetId: item.assetId !== undefined ? {
2242
+ equals: item.assetId
2243
+ } : undefined,
2244
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2245
+ equals: item.alpacaAccountId
2246
+ } : undefined,
2050
2247
  },
2051
2248
  create: {
2052
2249
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2074,6 +2271,9 @@ export const Asset = {
2074
2271
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2075
2272
  where: {
2076
2273
  id: item.id !== undefined ? item.id : undefined,
2274
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2275
+ equals: item.alpacaAccountId
2276
+ } : undefined,
2077
2277
  },
2078
2278
  create: {
2079
2279
  message: item.message !== undefined ? item.message : undefined,
@@ -2094,6 +2294,9 @@ export const Asset = {
2094
2294
  : { connectOrCreate: item.actions.map((item) => ({
2095
2295
  where: {
2096
2296
  id: item.id !== undefined ? item.id : undefined,
2297
+ tradeId: item.tradeId !== undefined ? {
2298
+ equals: item.tradeId
2299
+ } : undefined,
2097
2300
  },
2098
2301
  create: {
2099
2302
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2110,6 +2313,15 @@ export const Asset = {
2110
2313
  : { connectOrCreate: {
2111
2314
  where: {
2112
2315
  id: item.order.id !== undefined ? item.order.id : undefined,
2316
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2317
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2318
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2319
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2320
+ equals: item.order.alpacaAccountId
2321
+ } : undefined,
2322
+ assetId: item.order.assetId !== undefined ? {
2323
+ equals: item.order.assetId
2324
+ } : undefined,
2113
2325
  },
2114
2326
  create: {
2115
2327
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -2147,6 +2359,15 @@ export const Asset = {
2147
2359
  upsert: props.orders.map((item) => ({
2148
2360
  where: {
2149
2361
  id: item.id !== undefined ? item.id : undefined,
2362
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2363
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2364
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2365
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2366
+ equals: item.alpacaAccountId
2367
+ } : undefined,
2368
+ assetId: item.assetId !== undefined ? {
2369
+ equals: item.assetId
2370
+ } : undefined,
2150
2371
  },
2151
2372
  update: {
2152
2373
  id: item.id !== undefined ? {
@@ -2224,6 +2445,9 @@ export const Asset = {
2224
2445
  id: item.stopLoss.id !== undefined ? {
2225
2446
  equals: item.stopLoss.id
2226
2447
  } : undefined,
2448
+ orderId: item.stopLoss.orderId !== undefined ? {
2449
+ equals: item.stopLoss.orderId
2450
+ } : undefined,
2227
2451
  },
2228
2452
  update: {
2229
2453
  id: item.stopLoss.id !== undefined ? {
@@ -2248,6 +2472,9 @@ export const Asset = {
2248
2472
  id: item.takeProfit.id !== undefined ? {
2249
2473
  equals: item.takeProfit.id
2250
2474
  } : undefined,
2475
+ orderId: item.takeProfit.orderId !== undefined ? {
2476
+ equals: item.takeProfit.orderId
2477
+ } : undefined,
2251
2478
  },
2252
2479
  update: {
2253
2480
  id: item.takeProfit.id !== undefined ? {
@@ -2272,6 +2499,9 @@ export const Asset = {
2272
2499
  id: item.alpacaAccount.id !== undefined ? {
2273
2500
  equals: item.alpacaAccount.id
2274
2501
  } : undefined,
2502
+ userId: item.alpacaAccount.userId !== undefined ? {
2503
+ equals: item.alpacaAccount.userId
2504
+ } : undefined,
2275
2505
  },
2276
2506
  update: {
2277
2507
  id: item.alpacaAccount.id !== undefined ? {
@@ -2374,6 +2604,12 @@ export const Asset = {
2374
2604
  upsert: item.alpacaAccount.trades.map((item) => ({
2375
2605
  where: {
2376
2606
  id: item.id !== undefined ? item.id : undefined,
2607
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2608
+ equals: item.alpacaAccountId
2609
+ } : undefined,
2610
+ assetId: item.assetId !== undefined ? {
2611
+ equals: item.assetId
2612
+ } : undefined,
2377
2613
  },
2378
2614
  update: {
2379
2615
  id: item.id !== undefined ? {
@@ -2432,6 +2668,12 @@ export const Asset = {
2432
2668
  upsert: item.alpacaAccount.positions.map((item) => ({
2433
2669
  where: {
2434
2670
  id: item.id !== undefined ? item.id : undefined,
2671
+ assetId: item.assetId !== undefined ? {
2672
+ equals: item.assetId
2673
+ } : undefined,
2674
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2675
+ equals: item.alpacaAccountId
2676
+ } : undefined,
2435
2677
  },
2436
2678
  update: {
2437
2679
  id: item.id !== undefined ? {
@@ -2498,6 +2740,9 @@ export const Asset = {
2498
2740
  upsert: item.alpacaAccount.alerts.map((item) => ({
2499
2741
  where: {
2500
2742
  id: item.id !== undefined ? item.id : undefined,
2743
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2744
+ equals: item.alpacaAccountId
2745
+ } : undefined,
2501
2746
  },
2502
2747
  update: {
2503
2748
  id: item.id !== undefined ? {
@@ -2569,6 +2814,12 @@ export const Asset = {
2569
2814
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2570
2815
  where: {
2571
2816
  id: item.id !== undefined ? item.id : undefined,
2817
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2818
+ equals: item.alpacaAccountId
2819
+ } : undefined,
2820
+ assetId: item.assetId !== undefined ? {
2821
+ equals: item.assetId
2822
+ } : undefined,
2572
2823
  },
2573
2824
  create: {
2574
2825
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2594,6 +2845,12 @@ export const Asset = {
2594
2845
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2595
2846
  where: {
2596
2847
  id: item.id !== undefined ? item.id : undefined,
2848
+ assetId: item.assetId !== undefined ? {
2849
+ equals: item.assetId
2850
+ } : undefined,
2851
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2852
+ equals: item.alpacaAccountId
2853
+ } : undefined,
2597
2854
  },
2598
2855
  create: {
2599
2856
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2621,6 +2878,9 @@ export const Asset = {
2621
2878
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2622
2879
  where: {
2623
2880
  id: item.id !== undefined ? item.id : undefined,
2881
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2882
+ equals: item.alpacaAccountId
2883
+ } : undefined,
2624
2884
  },
2625
2885
  create: {
2626
2886
  message: item.message !== undefined ? item.message : undefined,
@@ -2638,6 +2898,9 @@ export const Asset = {
2638
2898
  id: item.action.id !== undefined ? {
2639
2899
  equals: item.action.id
2640
2900
  } : undefined,
2901
+ tradeId: item.action.tradeId !== undefined ? {
2902
+ equals: item.action.tradeId
2903
+ } : undefined,
2641
2904
  },
2642
2905
  update: {
2643
2906
  id: item.action.id !== undefined ? {
@@ -2664,6 +2927,12 @@ export const Asset = {
2664
2927
  id: item.action.trade.id !== undefined ? {
2665
2928
  equals: item.action.trade.id
2666
2929
  } : undefined,
2930
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
2931
+ equals: item.action.trade.alpacaAccountId
2932
+ } : undefined,
2933
+ assetId: item.action.trade.assetId !== undefined ? {
2934
+ equals: item.action.trade.assetId
2935
+ } : undefined,
2667
2936
  },
2668
2937
  update: {
2669
2938
  id: item.action.trade.id !== undefined ? {
@@ -2734,6 +3003,12 @@ export const Asset = {
2734
3003
  : { connectOrCreate: {
2735
3004
  where: {
2736
3005
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3006
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3007
+ equals: item.action.trade.alpacaAccountId
3008
+ } : undefined,
3009
+ assetId: item.action.trade.assetId !== undefined ? {
3010
+ equals: item.action.trade.assetId
3011
+ } : undefined,
2737
3012
  },
2738
3013
  create: {
2739
3014
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2786,6 +3061,7 @@ export const Asset = {
2786
3061
  : { connectOrCreate: {
2787
3062
  where: {
2788
3063
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3064
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2789
3065
  },
2790
3066
  create: {
2791
3067
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2802,6 +3078,7 @@ export const Asset = {
2802
3078
  : { connectOrCreate: {
2803
3079
  where: {
2804
3080
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3081
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2805
3082
  },
2806
3083
  create: {
2807
3084
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2818,6 +3095,9 @@ export const Asset = {
2818
3095
  : { connectOrCreate: {
2819
3096
  where: {
2820
3097
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3098
+ userId: item.alpacaAccount.userId !== undefined ? {
3099
+ equals: item.alpacaAccount.userId
3100
+ } : undefined,
2821
3101
  },
2822
3102
  create: {
2823
3103
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2867,6 +3147,12 @@ export const Asset = {
2867
3147
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2868
3148
  where: {
2869
3149
  id: item.id !== undefined ? item.id : undefined,
3150
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3151
+ equals: item.alpacaAccountId
3152
+ } : undefined,
3153
+ assetId: item.assetId !== undefined ? {
3154
+ equals: item.assetId
3155
+ } : undefined,
2870
3156
  },
2871
3157
  create: {
2872
3158
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2892,6 +3178,12 @@ export const Asset = {
2892
3178
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2893
3179
  where: {
2894
3180
  id: item.id !== undefined ? item.id : undefined,
3181
+ assetId: item.assetId !== undefined ? {
3182
+ equals: item.assetId
3183
+ } : undefined,
3184
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3185
+ equals: item.alpacaAccountId
3186
+ } : undefined,
2895
3187
  },
2896
3188
  create: {
2897
3189
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2919,6 +3211,9 @@ export const Asset = {
2919
3211
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2920
3212
  where: {
2921
3213
  id: item.id !== undefined ? item.id : undefined,
3214
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3215
+ equals: item.alpacaAccountId
3216
+ } : undefined,
2922
3217
  },
2923
3218
  create: {
2924
3219
  message: item.message !== undefined ? item.message : undefined,
@@ -2939,6 +3234,9 @@ export const Asset = {
2939
3234
  : { connectOrCreate: {
2940
3235
  where: {
2941
3236
  id: item.action.id !== undefined ? item.action.id : undefined,
3237
+ tradeId: item.action.tradeId !== undefined ? {
3238
+ equals: item.action.tradeId
3239
+ } : undefined,
2942
3240
  },
2943
3241
  create: {
2944
3242
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2955,6 +3253,12 @@ export const Asset = {
2955
3253
  : { connectOrCreate: {
2956
3254
  where: {
2957
3255
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3256
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3257
+ equals: item.action.trade.alpacaAccountId
3258
+ } : undefined,
3259
+ assetId: item.action.trade.assetId !== undefined ? {
3260
+ equals: item.action.trade.assetId
3261
+ } : undefined,
2958
3262
  },
2959
3263
  create: {
2960
3264
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2981,6 +3285,12 @@ export const Asset = {
2981
3285
  upsert: props.positions.map((item) => ({
2982
3286
  where: {
2983
3287
  id: item.id !== undefined ? item.id : undefined,
3288
+ assetId: item.assetId !== undefined ? {
3289
+ equals: item.assetId
3290
+ } : undefined,
3291
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3292
+ equals: item.alpacaAccountId
3293
+ } : undefined,
2984
3294
  },
2985
3295
  update: {
2986
3296
  id: item.id !== undefined ? {
@@ -3031,6 +3341,9 @@ export const Asset = {
3031
3341
  id: item.alpacaAccount.id !== undefined ? {
3032
3342
  equals: item.alpacaAccount.id
3033
3343
  } : undefined,
3344
+ userId: item.alpacaAccount.userId !== undefined ? {
3345
+ equals: item.alpacaAccount.userId
3346
+ } : undefined,
3034
3347
  },
3035
3348
  update: {
3036
3349
  id: item.alpacaAccount.id !== undefined ? {
@@ -3133,6 +3446,12 @@ export const Asset = {
3133
3446
  upsert: item.alpacaAccount.trades.map((item) => ({
3134
3447
  where: {
3135
3448
  id: item.id !== undefined ? item.id : undefined,
3449
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3450
+ equals: item.alpacaAccountId
3451
+ } : undefined,
3452
+ assetId: item.assetId !== undefined ? {
3453
+ equals: item.assetId
3454
+ } : undefined,
3136
3455
  },
3137
3456
  update: {
3138
3457
  id: item.id !== undefined ? {
@@ -3191,6 +3510,15 @@ export const Asset = {
3191
3510
  upsert: item.alpacaAccount.orders.map((item) => ({
3192
3511
  where: {
3193
3512
  id: item.id !== undefined ? item.id : undefined,
3513
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3514
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3515
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3516
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3517
+ equals: item.alpacaAccountId
3518
+ } : undefined,
3519
+ assetId: item.assetId !== undefined ? {
3520
+ equals: item.assetId
3521
+ } : undefined,
3194
3522
  },
3195
3523
  update: {
3196
3524
  id: item.id !== undefined ? {
@@ -3293,6 +3621,9 @@ export const Asset = {
3293
3621
  upsert: item.alpacaAccount.alerts.map((item) => ({
3294
3622
  where: {
3295
3623
  id: item.id !== undefined ? item.id : undefined,
3624
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3625
+ equals: item.alpacaAccountId
3626
+ } : undefined,
3296
3627
  },
3297
3628
  update: {
3298
3629
  id: item.id !== undefined ? {
@@ -3364,6 +3695,12 @@ export const Asset = {
3364
3695
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3365
3696
  where: {
3366
3697
  id: item.id !== undefined ? item.id : undefined,
3698
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3699
+ equals: item.alpacaAccountId
3700
+ } : undefined,
3701
+ assetId: item.assetId !== undefined ? {
3702
+ equals: item.assetId
3703
+ } : undefined,
3367
3704
  },
3368
3705
  create: {
3369
3706
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3389,6 +3726,15 @@ export const Asset = {
3389
3726
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3390
3727
  where: {
3391
3728
  id: item.id !== undefined ? item.id : undefined,
3729
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3730
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3731
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3732
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3733
+ equals: item.alpacaAccountId
3734
+ } : undefined,
3735
+ assetId: item.assetId !== undefined ? {
3736
+ equals: item.assetId
3737
+ } : undefined,
3392
3738
  },
3393
3739
  create: {
3394
3740
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3425,6 +3771,9 @@ export const Asset = {
3425
3771
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3426
3772
  where: {
3427
3773
  id: item.id !== undefined ? item.id : undefined,
3774
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3775
+ equals: item.alpacaAccountId
3776
+ } : undefined,
3428
3777
  },
3429
3778
  create: {
3430
3779
  message: item.message !== undefined ? item.message : undefined,
@@ -3460,6 +3809,9 @@ export const Asset = {
3460
3809
  : { connectOrCreate: {
3461
3810
  where: {
3462
3811
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3812
+ userId: item.alpacaAccount.userId !== undefined ? {
3813
+ equals: item.alpacaAccount.userId
3814
+ } : undefined,
3463
3815
  },
3464
3816
  create: {
3465
3817
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -3509,6 +3861,12 @@ export const Asset = {
3509
3861
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3510
3862
  where: {
3511
3863
  id: item.id !== undefined ? item.id : undefined,
3864
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3865
+ equals: item.alpacaAccountId
3866
+ } : undefined,
3867
+ assetId: item.assetId !== undefined ? {
3868
+ equals: item.assetId
3869
+ } : undefined,
3512
3870
  },
3513
3871
  create: {
3514
3872
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3534,6 +3892,15 @@ export const Asset = {
3534
3892
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3535
3893
  where: {
3536
3894
  id: item.id !== undefined ? item.id : undefined,
3895
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3896
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3897
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3898
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3899
+ equals: item.alpacaAccountId
3900
+ } : undefined,
3901
+ assetId: item.assetId !== undefined ? {
3902
+ equals: item.assetId
3903
+ } : undefined,
3537
3904
  },
3538
3905
  create: {
3539
3906
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3570,6 +3937,9 @@ export const Asset = {
3570
3937
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3571
3938
  where: {
3572
3939
  id: item.id !== undefined ? item.id : undefined,
3940
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3941
+ equals: item.alpacaAccountId
3942
+ } : undefined,
3573
3943
  },
3574
3944
  create: {
3575
3945
  message: item.message !== undefined ? item.message : undefined,
@@ -3589,6 +3959,12 @@ export const Asset = {
3589
3959
  where: {
3590
3960
  id: item.id !== undefined ? item.id : undefined,
3591
3961
  url: item.url !== undefined ? item.url : undefined,
3962
+ assetId: item.assetId !== undefined ? {
3963
+ equals: item.assetId
3964
+ } : undefined,
3965
+ newsArticleId: item.newsArticleId !== undefined ? {
3966
+ equals: item.newsArticleId
3967
+ } : undefined,
3592
3968
  },
3593
3969
  update: {
3594
3970
  id: item.id !== undefined ? {
@@ -3990,6 +4366,12 @@ export const Asset = {
3990
4366
  upsert: prop.trades.map((item) => ({
3991
4367
  where: {
3992
4368
  id: item.id !== undefined ? item.id : undefined,
4369
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4370
+ equals: item.alpacaAccountId
4371
+ } : undefined,
4372
+ assetId: item.assetId !== undefined ? {
4373
+ equals: item.assetId
4374
+ } : undefined,
3993
4375
  },
3994
4376
  update: {
3995
4377
  id: item.id !== undefined ? {
@@ -4034,6 +4416,9 @@ export const Asset = {
4034
4416
  id: item.alpacaAccount.id !== undefined ? {
4035
4417
  equals: item.alpacaAccount.id
4036
4418
  } : undefined,
4419
+ userId: item.alpacaAccount.userId !== undefined ? {
4420
+ equals: item.alpacaAccount.userId
4421
+ } : undefined,
4037
4422
  },
4038
4423
  update: {
4039
4424
  id: item.alpacaAccount.id !== undefined ? {
@@ -4136,6 +4521,15 @@ export const Asset = {
4136
4521
  upsert: item.alpacaAccount.orders.map((item) => ({
4137
4522
  where: {
4138
4523
  id: item.id !== undefined ? item.id : undefined,
4524
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4525
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4526
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4527
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4528
+ equals: item.alpacaAccountId
4529
+ } : undefined,
4530
+ assetId: item.assetId !== undefined ? {
4531
+ equals: item.assetId
4532
+ } : undefined,
4139
4533
  },
4140
4534
  update: {
4141
4535
  id: item.id !== undefined ? {
@@ -4238,6 +4632,12 @@ export const Asset = {
4238
4632
  upsert: item.alpacaAccount.positions.map((item) => ({
4239
4633
  where: {
4240
4634
  id: item.id !== undefined ? item.id : undefined,
4635
+ assetId: item.assetId !== undefined ? {
4636
+ equals: item.assetId
4637
+ } : undefined,
4638
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4639
+ equals: item.alpacaAccountId
4640
+ } : undefined,
4241
4641
  },
4242
4642
  update: {
4243
4643
  id: item.id !== undefined ? {
@@ -4304,6 +4704,9 @@ export const Asset = {
4304
4704
  upsert: item.alpacaAccount.alerts.map((item) => ({
4305
4705
  where: {
4306
4706
  id: item.id !== undefined ? item.id : undefined,
4707
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4708
+ equals: item.alpacaAccountId
4709
+ } : undefined,
4307
4710
  },
4308
4711
  update: {
4309
4712
  id: item.id !== undefined ? {
@@ -4375,6 +4778,15 @@ export const Asset = {
4375
4778
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4376
4779
  where: {
4377
4780
  id: item.id !== undefined ? item.id : undefined,
4781
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4782
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4783
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4784
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4785
+ equals: item.alpacaAccountId
4786
+ } : undefined,
4787
+ assetId: item.assetId !== undefined ? {
4788
+ equals: item.assetId
4789
+ } : undefined,
4378
4790
  },
4379
4791
  create: {
4380
4792
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4411,6 +4823,12 @@ export const Asset = {
4411
4823
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4412
4824
  where: {
4413
4825
  id: item.id !== undefined ? item.id : undefined,
4826
+ assetId: item.assetId !== undefined ? {
4827
+ equals: item.assetId
4828
+ } : undefined,
4829
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4830
+ equals: item.alpacaAccountId
4831
+ } : undefined,
4414
4832
  },
4415
4833
  create: {
4416
4834
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4438,6 +4856,9 @@ export const Asset = {
4438
4856
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4439
4857
  where: {
4440
4858
  id: item.id !== undefined ? item.id : undefined,
4859
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4860
+ equals: item.alpacaAccountId
4861
+ } : undefined,
4441
4862
  },
4442
4863
  create: {
4443
4864
  message: item.message !== undefined ? item.message : undefined,
@@ -4453,6 +4874,9 @@ export const Asset = {
4453
4874
  upsert: item.actions.map((item) => ({
4454
4875
  where: {
4455
4876
  id: item.id !== undefined ? item.id : undefined,
4877
+ tradeId: item.tradeId !== undefined ? {
4878
+ equals: item.tradeId
4879
+ } : undefined,
4456
4880
  },
4457
4881
  update: {
4458
4882
  id: item.id !== undefined ? {
@@ -4479,6 +4903,18 @@ export const Asset = {
4479
4903
  id: item.order.id !== undefined ? {
4480
4904
  equals: item.order.id
4481
4905
  } : undefined,
4906
+ clientOrderId: item.order.clientOrderId !== undefined ? {
4907
+ equals: item.order.clientOrderId
4908
+ } : undefined,
4909
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
4910
+ equals: item.order.alpacaAccountId
4911
+ } : undefined,
4912
+ assetId: item.order.assetId !== undefined ? {
4913
+ equals: item.order.assetId
4914
+ } : undefined,
4915
+ actionId: item.order.actionId !== undefined ? {
4916
+ equals: item.order.actionId
4917
+ } : undefined,
4482
4918
  },
4483
4919
  update: {
4484
4920
  id: item.order.id !== undefined ? {
@@ -4593,6 +5029,15 @@ export const Asset = {
4593
5029
  : { connectOrCreate: {
4594
5030
  where: {
4595
5031
  id: item.order.id !== undefined ? item.order.id : undefined,
5032
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5033
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5034
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5035
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5036
+ equals: item.order.alpacaAccountId
5037
+ } : undefined,
5038
+ assetId: item.order.assetId !== undefined ? {
5039
+ equals: item.order.assetId
5040
+ } : undefined,
4596
5041
  },
4597
5042
  create: {
4598
5043
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4645,6 +5090,9 @@ export const Asset = {
4645
5090
  : { connectOrCreate: {
4646
5091
  where: {
4647
5092
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
5093
+ userId: item.alpacaAccount.userId !== undefined ? {
5094
+ equals: item.alpacaAccount.userId
5095
+ } : undefined,
4648
5096
  },
4649
5097
  create: {
4650
5098
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -4694,6 +5142,15 @@ export const Asset = {
4694
5142
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4695
5143
  where: {
4696
5144
  id: item.id !== undefined ? item.id : undefined,
5145
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5146
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5147
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5148
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5149
+ equals: item.alpacaAccountId
5150
+ } : undefined,
5151
+ assetId: item.assetId !== undefined ? {
5152
+ equals: item.assetId
5153
+ } : undefined,
4697
5154
  },
4698
5155
  create: {
4699
5156
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4730,6 +5187,12 @@ export const Asset = {
4730
5187
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4731
5188
  where: {
4732
5189
  id: item.id !== undefined ? item.id : undefined,
5190
+ assetId: item.assetId !== undefined ? {
5191
+ equals: item.assetId
5192
+ } : undefined,
5193
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5194
+ equals: item.alpacaAccountId
5195
+ } : undefined,
4733
5196
  },
4734
5197
  create: {
4735
5198
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4757,6 +5220,9 @@ export const Asset = {
4757
5220
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4758
5221
  where: {
4759
5222
  id: item.id !== undefined ? item.id : undefined,
5223
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5224
+ equals: item.alpacaAccountId
5225
+ } : undefined,
4760
5226
  },
4761
5227
  create: {
4762
5228
  message: item.message !== undefined ? item.message : undefined,
@@ -4777,6 +5243,9 @@ export const Asset = {
4777
5243
  : { connectOrCreate: item.actions.map((item) => ({
4778
5244
  where: {
4779
5245
  id: item.id !== undefined ? item.id : undefined,
5246
+ tradeId: item.tradeId !== undefined ? {
5247
+ equals: item.tradeId
5248
+ } : undefined,
4780
5249
  },
4781
5250
  create: {
4782
5251
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -4793,6 +5262,15 @@ export const Asset = {
4793
5262
  : { connectOrCreate: {
4794
5263
  where: {
4795
5264
  id: item.order.id !== undefined ? item.order.id : undefined,
5265
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5266
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5267
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5268
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5269
+ equals: item.order.alpacaAccountId
5270
+ } : undefined,
5271
+ assetId: item.order.assetId !== undefined ? {
5272
+ equals: item.order.assetId
5273
+ } : undefined,
4796
5274
  },
4797
5275
  create: {
4798
5276
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4830,6 +5308,15 @@ export const Asset = {
4830
5308
  upsert: prop.orders.map((item) => ({
4831
5309
  where: {
4832
5310
  id: item.id !== undefined ? item.id : undefined,
5311
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5312
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5313
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5314
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5315
+ equals: item.alpacaAccountId
5316
+ } : undefined,
5317
+ assetId: item.assetId !== undefined ? {
5318
+ equals: item.assetId
5319
+ } : undefined,
4833
5320
  },
4834
5321
  update: {
4835
5322
  id: item.id !== undefined ? {
@@ -4907,6 +5394,9 @@ export const Asset = {
4907
5394
  id: item.stopLoss.id !== undefined ? {
4908
5395
  equals: item.stopLoss.id
4909
5396
  } : undefined,
5397
+ orderId: item.stopLoss.orderId !== undefined ? {
5398
+ equals: item.stopLoss.orderId
5399
+ } : undefined,
4910
5400
  },
4911
5401
  update: {
4912
5402
  id: item.stopLoss.id !== undefined ? {
@@ -4931,6 +5421,9 @@ export const Asset = {
4931
5421
  id: item.takeProfit.id !== undefined ? {
4932
5422
  equals: item.takeProfit.id
4933
5423
  } : undefined,
5424
+ orderId: item.takeProfit.orderId !== undefined ? {
5425
+ equals: item.takeProfit.orderId
5426
+ } : undefined,
4934
5427
  },
4935
5428
  update: {
4936
5429
  id: item.takeProfit.id !== undefined ? {
@@ -4955,6 +5448,9 @@ export const Asset = {
4955
5448
  id: item.alpacaAccount.id !== undefined ? {
4956
5449
  equals: item.alpacaAccount.id
4957
5450
  } : undefined,
5451
+ userId: item.alpacaAccount.userId !== undefined ? {
5452
+ equals: item.alpacaAccount.userId
5453
+ } : undefined,
4958
5454
  },
4959
5455
  update: {
4960
5456
  id: item.alpacaAccount.id !== undefined ? {
@@ -5057,6 +5553,12 @@ export const Asset = {
5057
5553
  upsert: item.alpacaAccount.trades.map((item) => ({
5058
5554
  where: {
5059
5555
  id: item.id !== undefined ? item.id : undefined,
5556
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5557
+ equals: item.alpacaAccountId
5558
+ } : undefined,
5559
+ assetId: item.assetId !== undefined ? {
5560
+ equals: item.assetId
5561
+ } : undefined,
5060
5562
  },
5061
5563
  update: {
5062
5564
  id: item.id !== undefined ? {
@@ -5115,6 +5617,12 @@ export const Asset = {
5115
5617
  upsert: item.alpacaAccount.positions.map((item) => ({
5116
5618
  where: {
5117
5619
  id: item.id !== undefined ? item.id : undefined,
5620
+ assetId: item.assetId !== undefined ? {
5621
+ equals: item.assetId
5622
+ } : undefined,
5623
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5624
+ equals: item.alpacaAccountId
5625
+ } : undefined,
5118
5626
  },
5119
5627
  update: {
5120
5628
  id: item.id !== undefined ? {
@@ -5181,6 +5689,9 @@ export const Asset = {
5181
5689
  upsert: item.alpacaAccount.alerts.map((item) => ({
5182
5690
  where: {
5183
5691
  id: item.id !== undefined ? item.id : undefined,
5692
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5693
+ equals: item.alpacaAccountId
5694
+ } : undefined,
5184
5695
  },
5185
5696
  update: {
5186
5697
  id: item.id !== undefined ? {
@@ -5252,6 +5763,12 @@ export const Asset = {
5252
5763
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5253
5764
  where: {
5254
5765
  id: item.id !== undefined ? item.id : undefined,
5766
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5767
+ equals: item.alpacaAccountId
5768
+ } : undefined,
5769
+ assetId: item.assetId !== undefined ? {
5770
+ equals: item.assetId
5771
+ } : undefined,
5255
5772
  },
5256
5773
  create: {
5257
5774
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5277,6 +5794,12 @@ export const Asset = {
5277
5794
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5278
5795
  where: {
5279
5796
  id: item.id !== undefined ? item.id : undefined,
5797
+ assetId: item.assetId !== undefined ? {
5798
+ equals: item.assetId
5799
+ } : undefined,
5800
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5801
+ equals: item.alpacaAccountId
5802
+ } : undefined,
5280
5803
  },
5281
5804
  create: {
5282
5805
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5304,6 +5827,9 @@ export const Asset = {
5304
5827
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5305
5828
  where: {
5306
5829
  id: item.id !== undefined ? item.id : undefined,
5830
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5831
+ equals: item.alpacaAccountId
5832
+ } : undefined,
5307
5833
  },
5308
5834
  create: {
5309
5835
  message: item.message !== undefined ? item.message : undefined,
@@ -5321,6 +5847,9 @@ export const Asset = {
5321
5847
  id: item.action.id !== undefined ? {
5322
5848
  equals: item.action.id
5323
5849
  } : undefined,
5850
+ tradeId: item.action.tradeId !== undefined ? {
5851
+ equals: item.action.tradeId
5852
+ } : undefined,
5324
5853
  },
5325
5854
  update: {
5326
5855
  id: item.action.id !== undefined ? {
@@ -5347,6 +5876,12 @@ export const Asset = {
5347
5876
  id: item.action.trade.id !== undefined ? {
5348
5877
  equals: item.action.trade.id
5349
5878
  } : undefined,
5879
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
5880
+ equals: item.action.trade.alpacaAccountId
5881
+ } : undefined,
5882
+ assetId: item.action.trade.assetId !== undefined ? {
5883
+ equals: item.action.trade.assetId
5884
+ } : undefined,
5350
5885
  },
5351
5886
  update: {
5352
5887
  id: item.action.trade.id !== undefined ? {
@@ -5417,6 +5952,12 @@ export const Asset = {
5417
5952
  : { connectOrCreate: {
5418
5953
  where: {
5419
5954
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
5955
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
5956
+ equals: item.action.trade.alpacaAccountId
5957
+ } : undefined,
5958
+ assetId: item.action.trade.assetId !== undefined ? {
5959
+ equals: item.action.trade.assetId
5960
+ } : undefined,
5420
5961
  },
5421
5962
  create: {
5422
5963
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5469,6 +6010,7 @@ export const Asset = {
5469
6010
  : { connectOrCreate: {
5470
6011
  where: {
5471
6012
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
6013
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
5472
6014
  },
5473
6015
  create: {
5474
6016
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -5485,6 +6027,7 @@ export const Asset = {
5485
6027
  : { connectOrCreate: {
5486
6028
  where: {
5487
6029
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
6030
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
5488
6031
  },
5489
6032
  create: {
5490
6033
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -5501,6 +6044,9 @@ export const Asset = {
5501
6044
  : { connectOrCreate: {
5502
6045
  where: {
5503
6046
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
6047
+ userId: item.alpacaAccount.userId !== undefined ? {
6048
+ equals: item.alpacaAccount.userId
6049
+ } : undefined,
5504
6050
  },
5505
6051
  create: {
5506
6052
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -5550,6 +6096,12 @@ export const Asset = {
5550
6096
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5551
6097
  where: {
5552
6098
  id: item.id !== undefined ? item.id : undefined,
6099
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6100
+ equals: item.alpacaAccountId
6101
+ } : undefined,
6102
+ assetId: item.assetId !== undefined ? {
6103
+ equals: item.assetId
6104
+ } : undefined,
5553
6105
  },
5554
6106
  create: {
5555
6107
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5575,6 +6127,12 @@ export const Asset = {
5575
6127
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5576
6128
  where: {
5577
6129
  id: item.id !== undefined ? item.id : undefined,
6130
+ assetId: item.assetId !== undefined ? {
6131
+ equals: item.assetId
6132
+ } : undefined,
6133
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6134
+ equals: item.alpacaAccountId
6135
+ } : undefined,
5578
6136
  },
5579
6137
  create: {
5580
6138
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5602,6 +6160,9 @@ export const Asset = {
5602
6160
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5603
6161
  where: {
5604
6162
  id: item.id !== undefined ? item.id : undefined,
6163
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6164
+ equals: item.alpacaAccountId
6165
+ } : undefined,
5605
6166
  },
5606
6167
  create: {
5607
6168
  message: item.message !== undefined ? item.message : undefined,
@@ -5622,6 +6183,9 @@ export const Asset = {
5622
6183
  : { connectOrCreate: {
5623
6184
  where: {
5624
6185
  id: item.action.id !== undefined ? item.action.id : undefined,
6186
+ tradeId: item.action.tradeId !== undefined ? {
6187
+ equals: item.action.tradeId
6188
+ } : undefined,
5625
6189
  },
5626
6190
  create: {
5627
6191
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -5638,6 +6202,12 @@ export const Asset = {
5638
6202
  : { connectOrCreate: {
5639
6203
  where: {
5640
6204
  id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6205
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6206
+ equals: item.action.trade.alpacaAccountId
6207
+ } : undefined,
6208
+ assetId: item.action.trade.assetId !== undefined ? {
6209
+ equals: item.action.trade.assetId
6210
+ } : undefined,
5641
6211
  },
5642
6212
  create: {
5643
6213
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5664,6 +6234,12 @@ export const Asset = {
5664
6234
  upsert: prop.positions.map((item) => ({
5665
6235
  where: {
5666
6236
  id: item.id !== undefined ? item.id : undefined,
6237
+ assetId: item.assetId !== undefined ? {
6238
+ equals: item.assetId
6239
+ } : undefined,
6240
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6241
+ equals: item.alpacaAccountId
6242
+ } : undefined,
5667
6243
  },
5668
6244
  update: {
5669
6245
  id: item.id !== undefined ? {
@@ -5714,6 +6290,9 @@ export const Asset = {
5714
6290
  id: item.alpacaAccount.id !== undefined ? {
5715
6291
  equals: item.alpacaAccount.id
5716
6292
  } : undefined,
6293
+ userId: item.alpacaAccount.userId !== undefined ? {
6294
+ equals: item.alpacaAccount.userId
6295
+ } : undefined,
5717
6296
  },
5718
6297
  update: {
5719
6298
  id: item.alpacaAccount.id !== undefined ? {
@@ -5816,6 +6395,12 @@ export const Asset = {
5816
6395
  upsert: item.alpacaAccount.trades.map((item) => ({
5817
6396
  where: {
5818
6397
  id: item.id !== undefined ? item.id : undefined,
6398
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6399
+ equals: item.alpacaAccountId
6400
+ } : undefined,
6401
+ assetId: item.assetId !== undefined ? {
6402
+ equals: item.assetId
6403
+ } : undefined,
5819
6404
  },
5820
6405
  update: {
5821
6406
  id: item.id !== undefined ? {
@@ -5874,6 +6459,15 @@ export const Asset = {
5874
6459
  upsert: item.alpacaAccount.orders.map((item) => ({
5875
6460
  where: {
5876
6461
  id: item.id !== undefined ? item.id : undefined,
6462
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6463
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6464
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6465
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6466
+ equals: item.alpacaAccountId
6467
+ } : undefined,
6468
+ assetId: item.assetId !== undefined ? {
6469
+ equals: item.assetId
6470
+ } : undefined,
5877
6471
  },
5878
6472
  update: {
5879
6473
  id: item.id !== undefined ? {
@@ -5976,6 +6570,9 @@ export const Asset = {
5976
6570
  upsert: item.alpacaAccount.alerts.map((item) => ({
5977
6571
  where: {
5978
6572
  id: item.id !== undefined ? item.id : undefined,
6573
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6574
+ equals: item.alpacaAccountId
6575
+ } : undefined,
5979
6576
  },
5980
6577
  update: {
5981
6578
  id: item.id !== undefined ? {
@@ -6047,6 +6644,12 @@ export const Asset = {
6047
6644
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6048
6645
  where: {
6049
6646
  id: item.id !== undefined ? item.id : undefined,
6647
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6648
+ equals: item.alpacaAccountId
6649
+ } : undefined,
6650
+ assetId: item.assetId !== undefined ? {
6651
+ equals: item.assetId
6652
+ } : undefined,
6050
6653
  },
6051
6654
  create: {
6052
6655
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6072,6 +6675,15 @@ export const Asset = {
6072
6675
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6073
6676
  where: {
6074
6677
  id: item.id !== undefined ? item.id : undefined,
6678
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6679
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6680
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6681
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6682
+ equals: item.alpacaAccountId
6683
+ } : undefined,
6684
+ assetId: item.assetId !== undefined ? {
6685
+ equals: item.assetId
6686
+ } : undefined,
6075
6687
  },
6076
6688
  create: {
6077
6689
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6108,6 +6720,9 @@ export const Asset = {
6108
6720
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6109
6721
  where: {
6110
6722
  id: item.id !== undefined ? item.id : undefined,
6723
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6724
+ equals: item.alpacaAccountId
6725
+ } : undefined,
6111
6726
  },
6112
6727
  create: {
6113
6728
  message: item.message !== undefined ? item.message : undefined,
@@ -6143,6 +6758,9 @@ export const Asset = {
6143
6758
  : { connectOrCreate: {
6144
6759
  where: {
6145
6760
  id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
6761
+ userId: item.alpacaAccount.userId !== undefined ? {
6762
+ equals: item.alpacaAccount.userId
6763
+ } : undefined,
6146
6764
  },
6147
6765
  create: {
6148
6766
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -6192,6 +6810,12 @@ export const Asset = {
6192
6810
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6193
6811
  where: {
6194
6812
  id: item.id !== undefined ? item.id : undefined,
6813
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6814
+ equals: item.alpacaAccountId
6815
+ } : undefined,
6816
+ assetId: item.assetId !== undefined ? {
6817
+ equals: item.assetId
6818
+ } : undefined,
6195
6819
  },
6196
6820
  create: {
6197
6821
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6217,6 +6841,15 @@ export const Asset = {
6217
6841
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6218
6842
  where: {
6219
6843
  id: item.id !== undefined ? item.id : undefined,
6844
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6845
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6846
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6847
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6848
+ equals: item.alpacaAccountId
6849
+ } : undefined,
6850
+ assetId: item.assetId !== undefined ? {
6851
+ equals: item.assetId
6852
+ } : undefined,
6220
6853
  },
6221
6854
  create: {
6222
6855
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6253,6 +6886,9 @@ export const Asset = {
6253
6886
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6254
6887
  where: {
6255
6888
  id: item.id !== undefined ? item.id : undefined,
6889
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6890
+ equals: item.alpacaAccountId
6891
+ } : undefined,
6256
6892
  },
6257
6893
  create: {
6258
6894
  message: item.message !== undefined ? item.message : undefined,
@@ -6272,6 +6908,12 @@ export const Asset = {
6272
6908
  where: {
6273
6909
  id: item.id !== undefined ? item.id : undefined,
6274
6910
  url: item.url !== undefined ? item.url : undefined,
6911
+ assetId: item.assetId !== undefined ? {
6912
+ equals: item.assetId
6913
+ } : undefined,
6914
+ newsArticleId: item.newsArticleId !== undefined ? {
6915
+ equals: item.newsArticleId
6916
+ } : undefined,
6275
6917
  },
6276
6918
  update: {
6277
6919
  id: item.id !== undefined ? {