adaptic-backend 1.0.160 → 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.
- package/Account.cjs +50 -150
- package/Action.cjs +117 -351
- package/Alert.cjs +85 -255
- package/AlpacaAccount.cjs +130 -390
- package/Asset.cjs +129 -387
- package/Authenticator.cjs +50 -150
- package/Customer.cjs +54 -162
- package/EconomicEvent.cjs +3 -9
- package/NewsArticle.cjs +30 -90
- package/NewsArticleAssetSentiment.cjs +57 -171
- package/Order.cjs +119 -357
- package/Position.cjs +133 -399
- package/Session.cjs +50 -150
- package/StopLoss.cjs +68 -204
- package/TakeProfit.cjs +68 -204
- package/Trade.cjs +145 -435
- package/User.cjs +73 -219
- package/VerificationToken.cjs +3 -9
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +50 -150
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +117 -351
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +85 -255
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +130 -390
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +129 -387
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +50 -150
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +54 -162
- package/server/EconomicEvent.d.ts.map +1 -1
- package/server/EconomicEvent.js.map +1 -1
- package/server/EconomicEvent.mjs +3 -9
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +30 -90
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +57 -171
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +119 -357
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +133 -399
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +50 -150
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +68 -204
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +68 -204
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +145 -435
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +73 -219
- package/server/VerificationToken.d.ts.map +1 -1
- package/server/VerificationToken.js.map +1 -1
- package/server/VerificationToken.mjs +3 -9
package/Position.cjs
CHANGED
@@ -228,9 +228,7 @@ exports.Position = {
|
|
228
228
|
}
|
229
229
|
: { connectOrCreate: {
|
230
230
|
where: {
|
231
|
-
id: props.asset.id !== undefined ?
|
232
|
-
equals: props.asset.id
|
233
|
-
} : undefined,
|
231
|
+
id: props.asset.id !== undefined ? props.asset.id : undefined,
|
234
232
|
symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
|
235
233
|
name: props.asset.name !== undefined ? props.asset.name : undefined,
|
236
234
|
},
|
@@ -298,9 +296,7 @@ exports.Position = {
|
|
298
296
|
}
|
299
297
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
300
298
|
where: {
|
301
|
-
id: item.id !== undefined ?
|
302
|
-
equals: item.id
|
303
|
-
} : undefined,
|
299
|
+
id: item.id !== undefined ? item.id : undefined,
|
304
300
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
305
301
|
equals: item.alpacaAccountId
|
306
302
|
} : undefined,
|
@@ -328,9 +324,7 @@ exports.Position = {
|
|
328
324
|
}
|
329
325
|
: { connectOrCreate: {
|
330
326
|
where: {
|
331
|
-
id: item.alpacaAccount.id !== undefined ?
|
332
|
-
equals: item.alpacaAccount.id
|
333
|
-
} : undefined,
|
327
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
334
328
|
userId: item.alpacaAccount.userId !== undefined ? {
|
335
329
|
equals: item.alpacaAccount.userId
|
336
330
|
} : undefined,
|
@@ -356,9 +350,7 @@ exports.Position = {
|
|
356
350
|
}
|
357
351
|
: { connectOrCreate: item.actions.map((item) => ({
|
358
352
|
where: {
|
359
|
-
id: item.id !== undefined ?
|
360
|
-
equals: item.id
|
361
|
-
} : undefined,
|
353
|
+
id: item.id !== undefined ? item.id : undefined,
|
362
354
|
tradeId: item.tradeId !== undefined ? {
|
363
355
|
equals: item.tradeId
|
364
356
|
} : undefined,
|
@@ -383,9 +375,7 @@ exports.Position = {
|
|
383
375
|
}
|
384
376
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
385
377
|
where: {
|
386
|
-
id: item.id !== undefined ?
|
387
|
-
equals: item.id
|
388
|
-
} : undefined,
|
378
|
+
id: item.id !== undefined ? item.id : undefined,
|
389
379
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
390
380
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
391
381
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -427,9 +417,7 @@ exports.Position = {
|
|
427
417
|
}
|
428
418
|
: { connectOrCreate: {
|
429
419
|
where: {
|
430
|
-
id: item.stopLoss.id !== undefined ?
|
431
|
-
equals: item.stopLoss.id
|
432
|
-
} : undefined,
|
420
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
433
421
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
434
422
|
},
|
435
423
|
create: {
|
@@ -446,9 +434,7 @@ exports.Position = {
|
|
446
434
|
}
|
447
435
|
: { connectOrCreate: {
|
448
436
|
where: {
|
449
|
-
id: item.takeProfit.id !== undefined ?
|
450
|
-
equals: item.takeProfit.id
|
451
|
-
} : undefined,
|
437
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
452
438
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
453
439
|
},
|
454
440
|
create: {
|
@@ -465,9 +451,7 @@ exports.Position = {
|
|
465
451
|
}
|
466
452
|
: { connectOrCreate: {
|
467
453
|
where: {
|
468
|
-
id: item.alpacaAccount.id !== undefined ?
|
469
|
-
equals: item.alpacaAccount.id
|
470
|
-
} : undefined,
|
454
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
471
455
|
userId: item.alpacaAccount.userId !== undefined ? {
|
472
456
|
equals: item.alpacaAccount.userId
|
473
457
|
} : undefined,
|
@@ -493,9 +477,7 @@ exports.Position = {
|
|
493
477
|
}
|
494
478
|
: { connectOrCreate: {
|
495
479
|
where: {
|
496
|
-
id: item.action.id !== undefined ?
|
497
|
-
equals: item.action.id
|
498
|
-
} : undefined,
|
480
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
499
481
|
tradeId: item.action.tradeId !== undefined ? {
|
500
482
|
equals: item.action.tradeId
|
501
483
|
} : undefined,
|
@@ -520,9 +502,7 @@ exports.Position = {
|
|
520
502
|
}
|
521
503
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
522
504
|
where: {
|
523
|
-
id: item.id !== undefined ?
|
524
|
-
equals: item.id
|
525
|
-
} : undefined,
|
505
|
+
id: item.id !== undefined ? item.id : undefined,
|
526
506
|
url: item.url !== undefined ? item.url : undefined,
|
527
507
|
assetId: item.assetId !== undefined ? {
|
528
508
|
equals: item.assetId
|
@@ -544,9 +524,7 @@ exports.Position = {
|
|
544
524
|
}
|
545
525
|
: { connectOrCreate: {
|
546
526
|
where: {
|
547
|
-
id: item.news.id !== undefined ?
|
548
|
-
equals: item.news.id
|
549
|
-
} : undefined,
|
527
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
550
528
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
551
529
|
title: item.news.title !== undefined ? {
|
552
530
|
equals: item.news.title
|
@@ -583,9 +561,7 @@ exports.Position = {
|
|
583
561
|
}
|
584
562
|
: { connectOrCreate: {
|
585
563
|
where: {
|
586
|
-
id: props.alpacaAccount.id !== undefined ?
|
587
|
-
equals: props.alpacaAccount.id
|
588
|
-
} : undefined,
|
564
|
+
id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
|
589
565
|
userId: props.alpacaAccount.userId !== undefined ? {
|
590
566
|
equals: props.alpacaAccount.userId
|
591
567
|
} : undefined,
|
@@ -608,9 +584,7 @@ exports.Position = {
|
|
608
584
|
}
|
609
585
|
: { connectOrCreate: {
|
610
586
|
where: {
|
611
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
612
|
-
equals: props.alpacaAccount.user.id
|
613
|
-
} : undefined,
|
587
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
614
588
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
615
589
|
name: props.alpacaAccount.user.name !== undefined ? {
|
616
590
|
equals: props.alpacaAccount.user.name
|
@@ -636,9 +610,7 @@ exports.Position = {
|
|
636
610
|
}
|
637
611
|
: { connectOrCreate: {
|
638
612
|
where: {
|
639
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
640
|
-
equals: props.alpacaAccount.user.customer.id
|
641
|
-
} : undefined,
|
613
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
642
614
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
643
615
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
644
616
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -670,9 +642,7 @@ exports.Position = {
|
|
670
642
|
}
|
671
643
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
672
644
|
where: {
|
673
|
-
id: item.id !== undefined ?
|
674
|
-
equals: item.id
|
675
|
-
} : undefined,
|
645
|
+
id: item.id !== undefined ? item.id : undefined,
|
676
646
|
userId: item.userId !== undefined ? {
|
677
647
|
equals: item.userId
|
678
648
|
} : undefined,
|
@@ -702,9 +672,7 @@ exports.Position = {
|
|
702
672
|
}
|
703
673
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
704
674
|
where: {
|
705
|
-
id: item.id !== undefined ?
|
706
|
-
equals: item.id
|
707
|
-
} : undefined,
|
675
|
+
id: item.id !== undefined ? item.id : undefined,
|
708
676
|
userId: item.userId !== undefined ? {
|
709
677
|
equals: item.userId
|
710
678
|
} : undefined,
|
@@ -723,9 +691,7 @@ exports.Position = {
|
|
723
691
|
}
|
724
692
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
725
693
|
where: {
|
726
|
-
id: item.id !== undefined ?
|
727
|
-
equals: item.id
|
728
|
-
} : undefined,
|
694
|
+
id: item.id !== undefined ? item.id : undefined,
|
729
695
|
userId: item.userId !== undefined ? {
|
730
696
|
equals: item.userId
|
731
697
|
} : undefined,
|
@@ -748,9 +714,7 @@ exports.Position = {
|
|
748
714
|
}
|
749
715
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
750
716
|
where: {
|
751
|
-
id: item.id !== undefined ?
|
752
|
-
equals: item.id
|
753
|
-
} : undefined,
|
717
|
+
id: item.id !== undefined ? item.id : undefined,
|
754
718
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
755
719
|
equals: item.alpacaAccountId
|
756
720
|
} : undefined,
|
@@ -778,9 +742,7 @@ exports.Position = {
|
|
778
742
|
}
|
779
743
|
: { connectOrCreate: {
|
780
744
|
where: {
|
781
|
-
id: item.asset.id !== undefined ?
|
782
|
-
equals: item.asset.id
|
783
|
-
} : undefined,
|
745
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
784
746
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
785
747
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
786
748
|
},
|
@@ -851,9 +813,7 @@ exports.Position = {
|
|
851
813
|
}
|
852
814
|
: { connectOrCreate: item.actions.map((item) => ({
|
853
815
|
where: {
|
854
|
-
id: item.id !== undefined ?
|
855
|
-
equals: item.id
|
856
|
-
} : undefined,
|
816
|
+
id: item.id !== undefined ? item.id : undefined,
|
857
817
|
tradeId: item.tradeId !== undefined ? {
|
858
818
|
equals: item.tradeId
|
859
819
|
} : undefined,
|
@@ -878,9 +838,7 @@ exports.Position = {
|
|
878
838
|
}
|
879
839
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
880
840
|
where: {
|
881
|
-
id: item.id !== undefined ?
|
882
|
-
equals: item.id
|
883
|
-
} : undefined,
|
841
|
+
id: item.id !== undefined ? item.id : undefined,
|
884
842
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
885
843
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
886
844
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -922,9 +880,7 @@ exports.Position = {
|
|
922
880
|
}
|
923
881
|
: { connectOrCreate: {
|
924
882
|
where: {
|
925
|
-
id: item.stopLoss.id !== undefined ?
|
926
|
-
equals: item.stopLoss.id
|
927
|
-
} : undefined,
|
883
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
928
884
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
929
885
|
},
|
930
886
|
create: {
|
@@ -941,9 +897,7 @@ exports.Position = {
|
|
941
897
|
}
|
942
898
|
: { connectOrCreate: {
|
943
899
|
where: {
|
944
|
-
id: item.takeProfit.id !== undefined ?
|
945
|
-
equals: item.takeProfit.id
|
946
|
-
} : undefined,
|
900
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
947
901
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
948
902
|
},
|
949
903
|
create: {
|
@@ -960,9 +914,7 @@ exports.Position = {
|
|
960
914
|
}
|
961
915
|
: { connectOrCreate: {
|
962
916
|
where: {
|
963
|
-
id: item.action.id !== undefined ?
|
964
|
-
equals: item.action.id
|
965
|
-
} : undefined,
|
917
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
966
918
|
tradeId: item.action.tradeId !== undefined ? {
|
967
919
|
equals: item.action.tradeId
|
968
920
|
} : undefined,
|
@@ -984,9 +936,7 @@ exports.Position = {
|
|
984
936
|
}
|
985
937
|
: { connectOrCreate: {
|
986
938
|
where: {
|
987
|
-
id: item.asset.id !== undefined ?
|
988
|
-
equals: item.asset.id
|
989
|
-
} : undefined,
|
939
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
990
940
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
991
941
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
992
942
|
},
|
@@ -1060,9 +1010,7 @@ exports.Position = {
|
|
1060
1010
|
}
|
1061
1011
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
1062
1012
|
where: {
|
1063
|
-
id: item.id !== undefined ?
|
1064
|
-
equals: item.id
|
1065
|
-
} : undefined,
|
1013
|
+
id: item.id !== undefined ? item.id : undefined,
|
1066
1014
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1067
1015
|
equals: item.alpacaAccountId
|
1068
1016
|
} : undefined,
|
@@ -1160,9 +1108,7 @@ exports.Position = {
|
|
1160
1108
|
}`;
|
1161
1109
|
const variables = {
|
1162
1110
|
where: {
|
1163
|
-
id: props.id !== undefined ?
|
1164
|
-
equals: props.id
|
1165
|
-
} : undefined,
|
1111
|
+
id: props.id !== undefined ? props.id : undefined,
|
1166
1112
|
assetId: props.assetId !== undefined ? {
|
1167
1113
|
equals: props.assetId
|
1168
1114
|
} : undefined,
|
@@ -1410,9 +1356,7 @@ exports.Position = {
|
|
1410
1356
|
trades: props.asset.trades ? {
|
1411
1357
|
upsert: props.asset.trades.map((item) => ({
|
1412
1358
|
where: {
|
1413
|
-
id: item.id !== undefined ?
|
1414
|
-
equals: item.id
|
1415
|
-
} : undefined,
|
1359
|
+
id: item.id !== undefined ? item.id : undefined,
|
1416
1360
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1417
1361
|
equals: item.alpacaAccountId
|
1418
1362
|
} : undefined,
|
@@ -1515,9 +1459,7 @@ exports.Position = {
|
|
1515
1459
|
actions: item.actions ? {
|
1516
1460
|
upsert: item.actions.map((item) => ({
|
1517
1461
|
where: {
|
1518
|
-
id: item.id !== undefined ?
|
1519
|
-
equals: item.id
|
1520
|
-
} : undefined,
|
1462
|
+
id: item.id !== undefined ? item.id : undefined,
|
1521
1463
|
tradeId: item.tradeId !== undefined ? {
|
1522
1464
|
equals: item.tradeId
|
1523
1465
|
} : undefined,
|
@@ -1572,9 +1514,7 @@ exports.Position = {
|
|
1572
1514
|
}
|
1573
1515
|
: { connectOrCreate: {
|
1574
1516
|
where: {
|
1575
|
-
id: item.alpacaAccount.id !== undefined ?
|
1576
|
-
equals: item.alpacaAccount.id
|
1577
|
-
} : undefined,
|
1517
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1578
1518
|
userId: item.alpacaAccount.userId !== undefined ? {
|
1579
1519
|
equals: item.alpacaAccount.userId
|
1580
1520
|
} : undefined,
|
@@ -1600,9 +1540,7 @@ exports.Position = {
|
|
1600
1540
|
}
|
1601
1541
|
: { connectOrCreate: item.actions.map((item) => ({
|
1602
1542
|
where: {
|
1603
|
-
id: item.id !== undefined ?
|
1604
|
-
equals: item.id
|
1605
|
-
} : undefined,
|
1543
|
+
id: item.id !== undefined ? item.id : undefined,
|
1606
1544
|
tradeId: item.tradeId !== undefined ? {
|
1607
1545
|
equals: item.tradeId
|
1608
1546
|
} : undefined,
|
@@ -1622,9 +1560,7 @@ exports.Position = {
|
|
1622
1560
|
orders: props.asset.orders ? {
|
1623
1561
|
upsert: props.asset.orders.map((item) => ({
|
1624
1562
|
where: {
|
1625
|
-
id: item.id !== undefined ?
|
1626
|
-
equals: item.id
|
1627
|
-
} : undefined,
|
1563
|
+
id: item.id !== undefined ? item.id : undefined,
|
1628
1564
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1629
1565
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1630
1566
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -1885,9 +1821,7 @@ exports.Position = {
|
|
1885
1821
|
}
|
1886
1822
|
: { connectOrCreate: {
|
1887
1823
|
where: {
|
1888
|
-
id: item.stopLoss.id !== undefined ?
|
1889
|
-
equals: item.stopLoss.id
|
1890
|
-
} : undefined,
|
1824
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
1891
1825
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
1892
1826
|
},
|
1893
1827
|
create: {
|
@@ -1904,9 +1838,7 @@ exports.Position = {
|
|
1904
1838
|
}
|
1905
1839
|
: { connectOrCreate: {
|
1906
1840
|
where: {
|
1907
|
-
id: item.takeProfit.id !== undefined ?
|
1908
|
-
equals: item.takeProfit.id
|
1909
|
-
} : undefined,
|
1841
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
1910
1842
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
1911
1843
|
},
|
1912
1844
|
create: {
|
@@ -1923,9 +1855,7 @@ exports.Position = {
|
|
1923
1855
|
}
|
1924
1856
|
: { connectOrCreate: {
|
1925
1857
|
where: {
|
1926
|
-
id: item.alpacaAccount.id !== undefined ?
|
1927
|
-
equals: item.alpacaAccount.id
|
1928
|
-
} : undefined,
|
1858
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1929
1859
|
userId: item.alpacaAccount.userId !== undefined ? {
|
1930
1860
|
equals: item.alpacaAccount.userId
|
1931
1861
|
} : undefined,
|
@@ -1951,9 +1881,7 @@ exports.Position = {
|
|
1951
1881
|
}
|
1952
1882
|
: { connectOrCreate: {
|
1953
1883
|
where: {
|
1954
|
-
id: item.action.id !== undefined ?
|
1955
|
-
equals: item.action.id
|
1956
|
-
} : undefined,
|
1884
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
1957
1885
|
tradeId: item.action.tradeId !== undefined ? {
|
1958
1886
|
equals: item.action.tradeId
|
1959
1887
|
} : undefined,
|
@@ -1973,9 +1901,7 @@ exports.Position = {
|
|
1973
1901
|
newsMentions: props.asset.newsMentions ? {
|
1974
1902
|
upsert: props.asset.newsMentions.map((item) => ({
|
1975
1903
|
where: {
|
1976
|
-
id: item.id !== undefined ?
|
1977
|
-
equals: item.id
|
1978
|
-
} : undefined,
|
1904
|
+
id: item.id !== undefined ? item.id : undefined,
|
1979
1905
|
url: item.url !== undefined ? item.url : undefined,
|
1980
1906
|
assetId: item.assetId !== undefined ? {
|
1981
1907
|
equals: item.assetId
|
@@ -2088,9 +2014,7 @@ exports.Position = {
|
|
2088
2014
|
}
|
2089
2015
|
: { connectOrCreate: {
|
2090
2016
|
where: {
|
2091
|
-
id: item.news.id !== undefined ?
|
2092
|
-
equals: item.news.id
|
2093
|
-
} : undefined,
|
2017
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
2094
2018
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
2095
2019
|
title: item.news.title !== undefined ? {
|
2096
2020
|
equals: item.news.title
|
@@ -2181,9 +2105,7 @@ exports.Position = {
|
|
2181
2105
|
}
|
2182
2106
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
2183
2107
|
where: {
|
2184
|
-
id: item.id !== undefined ?
|
2185
|
-
equals: item.id
|
2186
|
-
} : undefined,
|
2108
|
+
id: item.id !== undefined ? item.id : undefined,
|
2187
2109
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2188
2110
|
equals: item.alpacaAccountId
|
2189
2111
|
} : undefined,
|
@@ -2211,9 +2133,7 @@ exports.Position = {
|
|
2211
2133
|
}
|
2212
2134
|
: { connectOrCreate: {
|
2213
2135
|
where: {
|
2214
|
-
id: item.alpacaAccount.id !== undefined ?
|
2215
|
-
equals: item.alpacaAccount.id
|
2216
|
-
} : undefined,
|
2136
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2217
2137
|
userId: item.alpacaAccount.userId !== undefined ? {
|
2218
2138
|
equals: item.alpacaAccount.userId
|
2219
2139
|
} : undefined,
|
@@ -2239,9 +2159,7 @@ exports.Position = {
|
|
2239
2159
|
}
|
2240
2160
|
: { connectOrCreate: item.actions.map((item) => ({
|
2241
2161
|
where: {
|
2242
|
-
id: item.id !== undefined ?
|
2243
|
-
equals: item.id
|
2244
|
-
} : undefined,
|
2162
|
+
id: item.id !== undefined ? item.id : undefined,
|
2245
2163
|
tradeId: item.tradeId !== undefined ? {
|
2246
2164
|
equals: item.tradeId
|
2247
2165
|
} : undefined,
|
@@ -2266,9 +2184,7 @@ exports.Position = {
|
|
2266
2184
|
}
|
2267
2185
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
2268
2186
|
where: {
|
2269
|
-
id: item.id !== undefined ?
|
2270
|
-
equals: item.id
|
2271
|
-
} : undefined,
|
2187
|
+
id: item.id !== undefined ? item.id : undefined,
|
2272
2188
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2273
2189
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2274
2190
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -2310,9 +2226,7 @@ exports.Position = {
|
|
2310
2226
|
}
|
2311
2227
|
: { connectOrCreate: {
|
2312
2228
|
where: {
|
2313
|
-
id: item.stopLoss.id !== undefined ?
|
2314
|
-
equals: item.stopLoss.id
|
2315
|
-
} : undefined,
|
2229
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
2316
2230
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2317
2231
|
},
|
2318
2232
|
create: {
|
@@ -2329,9 +2243,7 @@ exports.Position = {
|
|
2329
2243
|
}
|
2330
2244
|
: { connectOrCreate: {
|
2331
2245
|
where: {
|
2332
|
-
id: item.takeProfit.id !== undefined ?
|
2333
|
-
equals: item.takeProfit.id
|
2334
|
-
} : undefined,
|
2246
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
2335
2247
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2336
2248
|
},
|
2337
2249
|
create: {
|
@@ -2348,9 +2260,7 @@ exports.Position = {
|
|
2348
2260
|
}
|
2349
2261
|
: { connectOrCreate: {
|
2350
2262
|
where: {
|
2351
|
-
id: item.alpacaAccount.id !== undefined ?
|
2352
|
-
equals: item.alpacaAccount.id
|
2353
|
-
} : undefined,
|
2263
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2354
2264
|
userId: item.alpacaAccount.userId !== undefined ? {
|
2355
2265
|
equals: item.alpacaAccount.userId
|
2356
2266
|
} : undefined,
|
@@ -2376,9 +2286,7 @@ exports.Position = {
|
|
2376
2286
|
}
|
2377
2287
|
: { connectOrCreate: {
|
2378
2288
|
where: {
|
2379
|
-
id: item.action.id !== undefined ?
|
2380
|
-
equals: item.action.id
|
2381
|
-
} : undefined,
|
2289
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
2382
2290
|
tradeId: item.action.tradeId !== undefined ? {
|
2383
2291
|
equals: item.action.tradeId
|
2384
2292
|
} : undefined,
|
@@ -2403,9 +2311,7 @@ exports.Position = {
|
|
2403
2311
|
}
|
2404
2312
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
2405
2313
|
where: {
|
2406
|
-
id: item.id !== undefined ?
|
2407
|
-
equals: item.id
|
2408
|
-
} : undefined,
|
2314
|
+
id: item.id !== undefined ? item.id : undefined,
|
2409
2315
|
url: item.url !== undefined ? item.url : undefined,
|
2410
2316
|
assetId: item.assetId !== undefined ? {
|
2411
2317
|
equals: item.assetId
|
@@ -2427,9 +2333,7 @@ exports.Position = {
|
|
2427
2333
|
}
|
2428
2334
|
: { connectOrCreate: {
|
2429
2335
|
where: {
|
2430
|
-
id: item.news.id !== undefined ?
|
2431
|
-
equals: item.news.id
|
2432
|
-
} : undefined,
|
2336
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
2433
2337
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
2434
2338
|
title: item.news.title !== undefined ? {
|
2435
2339
|
equals: item.news.title
|
@@ -2608,9 +2512,7 @@ exports.Position = {
|
|
2608
2512
|
accounts: props.alpacaAccount.user.accounts ? {
|
2609
2513
|
upsert: props.alpacaAccount.user.accounts.map((item) => ({
|
2610
2514
|
where: {
|
2611
|
-
id: item.id !== undefined ?
|
2612
|
-
equals: item.id
|
2613
|
-
} : undefined,
|
2515
|
+
id: item.id !== undefined ? item.id : undefined,
|
2614
2516
|
userId: item.userId !== undefined ? {
|
2615
2517
|
equals: item.userId
|
2616
2518
|
} : undefined,
|
@@ -2670,9 +2572,7 @@ exports.Position = {
|
|
2670
2572
|
sessions: props.alpacaAccount.user.sessions ? {
|
2671
2573
|
upsert: props.alpacaAccount.user.sessions.map((item) => ({
|
2672
2574
|
where: {
|
2673
|
-
id: item.id !== undefined ?
|
2674
|
-
equals: item.id
|
2675
|
-
} : undefined,
|
2575
|
+
id: item.id !== undefined ? item.id : undefined,
|
2676
2576
|
userId: item.userId !== undefined ? {
|
2677
2577
|
equals: item.userId
|
2678
2578
|
} : undefined,
|
@@ -2697,9 +2597,7 @@ exports.Position = {
|
|
2697
2597
|
authenticators: props.alpacaAccount.user.authenticators ? {
|
2698
2598
|
upsert: props.alpacaAccount.user.authenticators.map((item) => ({
|
2699
2599
|
where: {
|
2700
|
-
id: item.id !== undefined ?
|
2701
|
-
equals: item.id
|
2702
|
-
} : undefined,
|
2600
|
+
id: item.id !== undefined ? item.id : undefined,
|
2703
2601
|
userId: item.userId !== undefined ? {
|
2704
2602
|
equals: item.userId
|
2705
2603
|
} : undefined,
|
@@ -2746,9 +2644,7 @@ exports.Position = {
|
|
2746
2644
|
}
|
2747
2645
|
: { connectOrCreate: {
|
2748
2646
|
where: {
|
2749
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
2750
|
-
equals: props.alpacaAccount.user.customer.id
|
2751
|
-
} : undefined,
|
2647
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
2752
2648
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
2753
2649
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
2754
2650
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -2780,9 +2676,7 @@ exports.Position = {
|
|
2780
2676
|
}
|
2781
2677
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
2782
2678
|
where: {
|
2783
|
-
id: item.id !== undefined ?
|
2784
|
-
equals: item.id
|
2785
|
-
} : undefined,
|
2679
|
+
id: item.id !== undefined ? item.id : undefined,
|
2786
2680
|
userId: item.userId !== undefined ? {
|
2787
2681
|
equals: item.userId
|
2788
2682
|
} : undefined,
|
@@ -2812,9 +2706,7 @@ exports.Position = {
|
|
2812
2706
|
}
|
2813
2707
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
2814
2708
|
where: {
|
2815
|
-
id: item.id !== undefined ?
|
2816
|
-
equals: item.id
|
2817
|
-
} : undefined,
|
2709
|
+
id: item.id !== undefined ? item.id : undefined,
|
2818
2710
|
userId: item.userId !== undefined ? {
|
2819
2711
|
equals: item.userId
|
2820
2712
|
} : undefined,
|
@@ -2833,9 +2725,7 @@ exports.Position = {
|
|
2833
2725
|
}
|
2834
2726
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
2835
2727
|
where: {
|
2836
|
-
id: item.id !== undefined ?
|
2837
|
-
equals: item.id
|
2838
|
-
} : undefined,
|
2728
|
+
id: item.id !== undefined ? item.id : undefined,
|
2839
2729
|
userId: item.userId !== undefined ? {
|
2840
2730
|
equals: item.userId
|
2841
2731
|
} : undefined,
|
@@ -2853,9 +2743,7 @@ exports.Position = {
|
|
2853
2743
|
trades: props.alpacaAccount.trades ? {
|
2854
2744
|
upsert: props.alpacaAccount.trades.map((item) => ({
|
2855
2745
|
where: {
|
2856
|
-
id: item.id !== undefined ?
|
2857
|
-
equals: item.id
|
2858
|
-
} : undefined,
|
2746
|
+
id: item.id !== undefined ? item.id : undefined,
|
2859
2747
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2860
2748
|
equals: item.alpacaAccountId
|
2861
2749
|
} : undefined,
|
@@ -3145,9 +3033,7 @@ exports.Position = {
|
|
3145
3033
|
actions: item.actions ? {
|
3146
3034
|
upsert: item.actions.map((item) => ({
|
3147
3035
|
where: {
|
3148
|
-
id: item.id !== undefined ?
|
3149
|
-
equals: item.id
|
3150
|
-
} : undefined,
|
3036
|
+
id: item.id !== undefined ? item.id : undefined,
|
3151
3037
|
tradeId: item.tradeId !== undefined ? {
|
3152
3038
|
equals: item.tradeId
|
3153
3039
|
} : undefined,
|
@@ -3202,9 +3088,7 @@ exports.Position = {
|
|
3202
3088
|
}
|
3203
3089
|
: { connectOrCreate: {
|
3204
3090
|
where: {
|
3205
|
-
id: item.asset.id !== undefined ?
|
3206
|
-
equals: item.asset.id
|
3207
|
-
} : undefined,
|
3091
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
3208
3092
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3209
3093
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3210
3094
|
},
|
@@ -3275,9 +3159,7 @@ exports.Position = {
|
|
3275
3159
|
}
|
3276
3160
|
: { connectOrCreate: item.actions.map((item) => ({
|
3277
3161
|
where: {
|
3278
|
-
id: item.id !== undefined ?
|
3279
|
-
equals: item.id
|
3280
|
-
} : undefined,
|
3162
|
+
id: item.id !== undefined ? item.id : undefined,
|
3281
3163
|
tradeId: item.tradeId !== undefined ? {
|
3282
3164
|
equals: item.tradeId
|
3283
3165
|
} : undefined,
|
@@ -3297,9 +3179,7 @@ exports.Position = {
|
|
3297
3179
|
orders: props.alpacaAccount.orders ? {
|
3298
3180
|
upsert: props.alpacaAccount.orders.map((item) => ({
|
3299
3181
|
where: {
|
3300
|
-
id: item.id !== undefined ?
|
3301
|
-
equals: item.id
|
3302
|
-
} : undefined,
|
3182
|
+
id: item.id !== undefined ? item.id : undefined,
|
3303
3183
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3304
3184
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3305
3185
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -3747,9 +3627,7 @@ exports.Position = {
|
|
3747
3627
|
}
|
3748
3628
|
: { connectOrCreate: {
|
3749
3629
|
where: {
|
3750
|
-
id: item.stopLoss.id !== undefined ?
|
3751
|
-
equals: item.stopLoss.id
|
3752
|
-
} : undefined,
|
3630
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
3753
3631
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3754
3632
|
},
|
3755
3633
|
create: {
|
@@ -3766,9 +3644,7 @@ exports.Position = {
|
|
3766
3644
|
}
|
3767
3645
|
: { connectOrCreate: {
|
3768
3646
|
where: {
|
3769
|
-
id: item.takeProfit.id !== undefined ?
|
3770
|
-
equals: item.takeProfit.id
|
3771
|
-
} : undefined,
|
3647
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
3772
3648
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3773
3649
|
},
|
3774
3650
|
create: {
|
@@ -3785,9 +3661,7 @@ exports.Position = {
|
|
3785
3661
|
}
|
3786
3662
|
: { connectOrCreate: {
|
3787
3663
|
where: {
|
3788
|
-
id: item.action.id !== undefined ?
|
3789
|
-
equals: item.action.id
|
3790
|
-
} : undefined,
|
3664
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
3791
3665
|
tradeId: item.action.tradeId !== undefined ? {
|
3792
3666
|
equals: item.action.tradeId
|
3793
3667
|
} : undefined,
|
@@ -3809,9 +3683,7 @@ exports.Position = {
|
|
3809
3683
|
}
|
3810
3684
|
: { connectOrCreate: {
|
3811
3685
|
where: {
|
3812
|
-
id: item.asset.id !== undefined ?
|
3813
|
-
equals: item.asset.id
|
3814
|
-
} : undefined,
|
3686
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
3815
3687
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3816
3688
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3817
3689
|
},
|
@@ -3880,9 +3752,7 @@ exports.Position = {
|
|
3880
3752
|
alerts: props.alpacaAccount.alerts ? {
|
3881
3753
|
upsert: props.alpacaAccount.alerts.map((item) => ({
|
3882
3754
|
where: {
|
3883
|
-
id: item.id !== undefined ?
|
3884
|
-
equals: item.id
|
3885
|
-
} : undefined,
|
3755
|
+
id: item.id !== undefined ? item.id : undefined,
|
3886
3756
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3887
3757
|
equals: item.alpacaAccountId
|
3888
3758
|
} : undefined,
|
@@ -3927,9 +3797,7 @@ exports.Position = {
|
|
3927
3797
|
}
|
3928
3798
|
: { connectOrCreate: {
|
3929
3799
|
where: {
|
3930
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
3931
|
-
equals: props.alpacaAccount.user.id
|
3932
|
-
} : undefined,
|
3800
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
3933
3801
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
3934
3802
|
name: props.alpacaAccount.user.name !== undefined ? {
|
3935
3803
|
equals: props.alpacaAccount.user.name
|
@@ -3955,9 +3823,7 @@ exports.Position = {
|
|
3955
3823
|
}
|
3956
3824
|
: { connectOrCreate: {
|
3957
3825
|
where: {
|
3958
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
3959
|
-
equals: props.alpacaAccount.user.customer.id
|
3960
|
-
} : undefined,
|
3826
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
3961
3827
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
3962
3828
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
3963
3829
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -3989,9 +3855,7 @@ exports.Position = {
|
|
3989
3855
|
}
|
3990
3856
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
3991
3857
|
where: {
|
3992
|
-
id: item.id !== undefined ?
|
3993
|
-
equals: item.id
|
3994
|
-
} : undefined,
|
3858
|
+
id: item.id !== undefined ? item.id : undefined,
|
3995
3859
|
userId: item.userId !== undefined ? {
|
3996
3860
|
equals: item.userId
|
3997
3861
|
} : undefined,
|
@@ -4021,9 +3885,7 @@ exports.Position = {
|
|
4021
3885
|
}
|
4022
3886
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
4023
3887
|
where: {
|
4024
|
-
id: item.id !== undefined ?
|
4025
|
-
equals: item.id
|
4026
|
-
} : undefined,
|
3888
|
+
id: item.id !== undefined ? item.id : undefined,
|
4027
3889
|
userId: item.userId !== undefined ? {
|
4028
3890
|
equals: item.userId
|
4029
3891
|
} : undefined,
|
@@ -4042,9 +3904,7 @@ exports.Position = {
|
|
4042
3904
|
}
|
4043
3905
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
4044
3906
|
where: {
|
4045
|
-
id: item.id !== undefined ?
|
4046
|
-
equals: item.id
|
4047
|
-
} : undefined,
|
3907
|
+
id: item.id !== undefined ? item.id : undefined,
|
4048
3908
|
userId: item.userId !== undefined ? {
|
4049
3909
|
equals: item.userId
|
4050
3910
|
} : undefined,
|
@@ -4067,9 +3927,7 @@ exports.Position = {
|
|
4067
3927
|
}
|
4068
3928
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
4069
3929
|
where: {
|
4070
|
-
id: item.id !== undefined ?
|
4071
|
-
equals: item.id
|
4072
|
-
} : undefined,
|
3930
|
+
id: item.id !== undefined ? item.id : undefined,
|
4073
3931
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4074
3932
|
equals: item.alpacaAccountId
|
4075
3933
|
} : undefined,
|
@@ -4097,9 +3955,7 @@ exports.Position = {
|
|
4097
3955
|
}
|
4098
3956
|
: { connectOrCreate: {
|
4099
3957
|
where: {
|
4100
|
-
id: item.asset.id !== undefined ?
|
4101
|
-
equals: item.asset.id
|
4102
|
-
} : undefined,
|
3958
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
4103
3959
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4104
3960
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4105
3961
|
},
|
@@ -4170,9 +4026,7 @@ exports.Position = {
|
|
4170
4026
|
}
|
4171
4027
|
: { connectOrCreate: item.actions.map((item) => ({
|
4172
4028
|
where: {
|
4173
|
-
id: item.id !== undefined ?
|
4174
|
-
equals: item.id
|
4175
|
-
} : undefined,
|
4029
|
+
id: item.id !== undefined ? item.id : undefined,
|
4176
4030
|
tradeId: item.tradeId !== undefined ? {
|
4177
4031
|
equals: item.tradeId
|
4178
4032
|
} : undefined,
|
@@ -4197,9 +4051,7 @@ exports.Position = {
|
|
4197
4051
|
}
|
4198
4052
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
4199
4053
|
where: {
|
4200
|
-
id: item.id !== undefined ?
|
4201
|
-
equals: item.id
|
4202
|
-
} : undefined,
|
4054
|
+
id: item.id !== undefined ? item.id : undefined,
|
4203
4055
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4204
4056
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4205
4057
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -4241,9 +4093,7 @@ exports.Position = {
|
|
4241
4093
|
}
|
4242
4094
|
: { connectOrCreate: {
|
4243
4095
|
where: {
|
4244
|
-
id: item.stopLoss.id !== undefined ?
|
4245
|
-
equals: item.stopLoss.id
|
4246
|
-
} : undefined,
|
4096
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
4247
4097
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
4248
4098
|
},
|
4249
4099
|
create: {
|
@@ -4260,9 +4110,7 @@ exports.Position = {
|
|
4260
4110
|
}
|
4261
4111
|
: { connectOrCreate: {
|
4262
4112
|
where: {
|
4263
|
-
id: item.takeProfit.id !== undefined ?
|
4264
|
-
equals: item.takeProfit.id
|
4265
|
-
} : undefined,
|
4113
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
4266
4114
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
4267
4115
|
},
|
4268
4116
|
create: {
|
@@ -4279,9 +4127,7 @@ exports.Position = {
|
|
4279
4127
|
}
|
4280
4128
|
: { connectOrCreate: {
|
4281
4129
|
where: {
|
4282
|
-
id: item.action.id !== undefined ?
|
4283
|
-
equals: item.action.id
|
4284
|
-
} : undefined,
|
4130
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
4285
4131
|
tradeId: item.action.tradeId !== undefined ? {
|
4286
4132
|
equals: item.action.tradeId
|
4287
4133
|
} : undefined,
|
@@ -4303,9 +4149,7 @@ exports.Position = {
|
|
4303
4149
|
}
|
4304
4150
|
: { connectOrCreate: {
|
4305
4151
|
where: {
|
4306
|
-
id: item.asset.id !== undefined ?
|
4307
|
-
equals: item.asset.id
|
4308
|
-
} : undefined,
|
4152
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
4309
4153
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4310
4154
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4311
4155
|
},
|
@@ -4379,9 +4223,7 @@ exports.Position = {
|
|
4379
4223
|
}
|
4380
4224
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
4381
4225
|
where: {
|
4382
|
-
id: item.id !== undefined ?
|
4383
|
-
equals: item.id
|
4384
|
-
} : undefined,
|
4226
|
+
id: item.id !== undefined ? item.id : undefined,
|
4385
4227
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4386
4228
|
equals: item.alpacaAccountId
|
4387
4229
|
} : undefined,
|
@@ -4430,9 +4272,7 @@ exports.Position = {
|
|
4430
4272
|
}`;
|
4431
4273
|
const variables = props.map(prop => ({
|
4432
4274
|
where: {
|
4433
|
-
id: prop.id !== undefined ?
|
4434
|
-
equals: prop.id
|
4435
|
-
} : undefined,
|
4275
|
+
id: prop.id !== undefined ? prop.id : undefined,
|
4436
4276
|
assetId: prop.assetId !== undefined ? {
|
4437
4277
|
equals: prop.assetId
|
4438
4278
|
} : undefined,
|
@@ -4680,9 +4520,7 @@ exports.Position = {
|
|
4680
4520
|
trades: prop.asset.trades ? {
|
4681
4521
|
upsert: prop.asset.trades.map((item) => ({
|
4682
4522
|
where: {
|
4683
|
-
id: item.id !== undefined ?
|
4684
|
-
equals: item.id
|
4685
|
-
} : undefined,
|
4523
|
+
id: item.id !== undefined ? item.id : undefined,
|
4686
4524
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4687
4525
|
equals: item.alpacaAccountId
|
4688
4526
|
} : undefined,
|
@@ -4785,9 +4623,7 @@ exports.Position = {
|
|
4785
4623
|
actions: item.actions ? {
|
4786
4624
|
upsert: item.actions.map((item) => ({
|
4787
4625
|
where: {
|
4788
|
-
id: item.id !== undefined ?
|
4789
|
-
equals: item.id
|
4790
|
-
} : undefined,
|
4626
|
+
id: item.id !== undefined ? item.id : undefined,
|
4791
4627
|
tradeId: item.tradeId !== undefined ? {
|
4792
4628
|
equals: item.tradeId
|
4793
4629
|
} : undefined,
|
@@ -4842,9 +4678,7 @@ exports.Position = {
|
|
4842
4678
|
}
|
4843
4679
|
: { connectOrCreate: {
|
4844
4680
|
where: {
|
4845
|
-
id: item.alpacaAccount.id !== undefined ?
|
4846
|
-
equals: item.alpacaAccount.id
|
4847
|
-
} : undefined,
|
4681
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
4848
4682
|
userId: item.alpacaAccount.userId !== undefined ? {
|
4849
4683
|
equals: item.alpacaAccount.userId
|
4850
4684
|
} : undefined,
|
@@ -4870,9 +4704,7 @@ exports.Position = {
|
|
4870
4704
|
}
|
4871
4705
|
: { connectOrCreate: item.actions.map((item) => ({
|
4872
4706
|
where: {
|
4873
|
-
id: item.id !== undefined ?
|
4874
|
-
equals: item.id
|
4875
|
-
} : undefined,
|
4707
|
+
id: item.id !== undefined ? item.id : undefined,
|
4876
4708
|
tradeId: item.tradeId !== undefined ? {
|
4877
4709
|
equals: item.tradeId
|
4878
4710
|
} : undefined,
|
@@ -4892,9 +4724,7 @@ exports.Position = {
|
|
4892
4724
|
orders: prop.asset.orders ? {
|
4893
4725
|
upsert: prop.asset.orders.map((item) => ({
|
4894
4726
|
where: {
|
4895
|
-
id: item.id !== undefined ?
|
4896
|
-
equals: item.id
|
4897
|
-
} : undefined,
|
4727
|
+
id: item.id !== undefined ? item.id : undefined,
|
4898
4728
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4899
4729
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4900
4730
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -5155,9 +4985,7 @@ exports.Position = {
|
|
5155
4985
|
}
|
5156
4986
|
: { connectOrCreate: {
|
5157
4987
|
where: {
|
5158
|
-
id: item.stopLoss.id !== undefined ?
|
5159
|
-
equals: item.stopLoss.id
|
5160
|
-
} : undefined,
|
4988
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
5161
4989
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
5162
4990
|
},
|
5163
4991
|
create: {
|
@@ -5174,9 +5002,7 @@ exports.Position = {
|
|
5174
5002
|
}
|
5175
5003
|
: { connectOrCreate: {
|
5176
5004
|
where: {
|
5177
|
-
id: item.takeProfit.id !== undefined ?
|
5178
|
-
equals: item.takeProfit.id
|
5179
|
-
} : undefined,
|
5005
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
5180
5006
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
5181
5007
|
},
|
5182
5008
|
create: {
|
@@ -5193,9 +5019,7 @@ exports.Position = {
|
|
5193
5019
|
}
|
5194
5020
|
: { connectOrCreate: {
|
5195
5021
|
where: {
|
5196
|
-
id: item.alpacaAccount.id !== undefined ?
|
5197
|
-
equals: item.alpacaAccount.id
|
5198
|
-
} : undefined,
|
5022
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
5199
5023
|
userId: item.alpacaAccount.userId !== undefined ? {
|
5200
5024
|
equals: item.alpacaAccount.userId
|
5201
5025
|
} : undefined,
|
@@ -5221,9 +5045,7 @@ exports.Position = {
|
|
5221
5045
|
}
|
5222
5046
|
: { connectOrCreate: {
|
5223
5047
|
where: {
|
5224
|
-
id: item.action.id !== undefined ?
|
5225
|
-
equals: item.action.id
|
5226
|
-
} : undefined,
|
5048
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
5227
5049
|
tradeId: item.action.tradeId !== undefined ? {
|
5228
5050
|
equals: item.action.tradeId
|
5229
5051
|
} : undefined,
|
@@ -5243,9 +5065,7 @@ exports.Position = {
|
|
5243
5065
|
newsMentions: prop.asset.newsMentions ? {
|
5244
5066
|
upsert: prop.asset.newsMentions.map((item) => ({
|
5245
5067
|
where: {
|
5246
|
-
id: item.id !== undefined ?
|
5247
|
-
equals: item.id
|
5248
|
-
} : undefined,
|
5068
|
+
id: item.id !== undefined ? item.id : undefined,
|
5249
5069
|
url: item.url !== undefined ? item.url : undefined,
|
5250
5070
|
assetId: item.assetId !== undefined ? {
|
5251
5071
|
equals: item.assetId
|
@@ -5358,9 +5178,7 @@ exports.Position = {
|
|
5358
5178
|
}
|
5359
5179
|
: { connectOrCreate: {
|
5360
5180
|
where: {
|
5361
|
-
id: item.news.id !== undefined ?
|
5362
|
-
equals: item.news.id
|
5363
|
-
} : undefined,
|
5181
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
5364
5182
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
5365
5183
|
title: item.news.title !== undefined ? {
|
5366
5184
|
equals: item.news.title
|
@@ -5451,9 +5269,7 @@ exports.Position = {
|
|
5451
5269
|
}
|
5452
5270
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
5453
5271
|
where: {
|
5454
|
-
id: item.id !== undefined ?
|
5455
|
-
equals: item.id
|
5456
|
-
} : undefined,
|
5272
|
+
id: item.id !== undefined ? item.id : undefined,
|
5457
5273
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5458
5274
|
equals: item.alpacaAccountId
|
5459
5275
|
} : undefined,
|
@@ -5481,9 +5297,7 @@ exports.Position = {
|
|
5481
5297
|
}
|
5482
5298
|
: { connectOrCreate: {
|
5483
5299
|
where: {
|
5484
|
-
id: item.alpacaAccount.id !== undefined ?
|
5485
|
-
equals: item.alpacaAccount.id
|
5486
|
-
} : undefined,
|
5300
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
5487
5301
|
userId: item.alpacaAccount.userId !== undefined ? {
|
5488
5302
|
equals: item.alpacaAccount.userId
|
5489
5303
|
} : undefined,
|
@@ -5509,9 +5323,7 @@ exports.Position = {
|
|
5509
5323
|
}
|
5510
5324
|
: { connectOrCreate: item.actions.map((item) => ({
|
5511
5325
|
where: {
|
5512
|
-
id: item.id !== undefined ?
|
5513
|
-
equals: item.id
|
5514
|
-
} : undefined,
|
5326
|
+
id: item.id !== undefined ? item.id : undefined,
|
5515
5327
|
tradeId: item.tradeId !== undefined ? {
|
5516
5328
|
equals: item.tradeId
|
5517
5329
|
} : undefined,
|
@@ -5536,9 +5348,7 @@ exports.Position = {
|
|
5536
5348
|
}
|
5537
5349
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
5538
5350
|
where: {
|
5539
|
-
id: item.id !== undefined ?
|
5540
|
-
equals: item.id
|
5541
|
-
} : undefined,
|
5351
|
+
id: item.id !== undefined ? item.id : undefined,
|
5542
5352
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5543
5353
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5544
5354
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -5580,9 +5390,7 @@ exports.Position = {
|
|
5580
5390
|
}
|
5581
5391
|
: { connectOrCreate: {
|
5582
5392
|
where: {
|
5583
|
-
id: item.stopLoss.id !== undefined ?
|
5584
|
-
equals: item.stopLoss.id
|
5585
|
-
} : undefined,
|
5393
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
5586
5394
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
5587
5395
|
},
|
5588
5396
|
create: {
|
@@ -5599,9 +5407,7 @@ exports.Position = {
|
|
5599
5407
|
}
|
5600
5408
|
: { connectOrCreate: {
|
5601
5409
|
where: {
|
5602
|
-
id: item.takeProfit.id !== undefined ?
|
5603
|
-
equals: item.takeProfit.id
|
5604
|
-
} : undefined,
|
5410
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
5605
5411
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
5606
5412
|
},
|
5607
5413
|
create: {
|
@@ -5618,9 +5424,7 @@ exports.Position = {
|
|
5618
5424
|
}
|
5619
5425
|
: { connectOrCreate: {
|
5620
5426
|
where: {
|
5621
|
-
id: item.alpacaAccount.id !== undefined ?
|
5622
|
-
equals: item.alpacaAccount.id
|
5623
|
-
} : undefined,
|
5427
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
5624
5428
|
userId: item.alpacaAccount.userId !== undefined ? {
|
5625
5429
|
equals: item.alpacaAccount.userId
|
5626
5430
|
} : undefined,
|
@@ -5646,9 +5450,7 @@ exports.Position = {
|
|
5646
5450
|
}
|
5647
5451
|
: { connectOrCreate: {
|
5648
5452
|
where: {
|
5649
|
-
id: item.action.id !== undefined ?
|
5650
|
-
equals: item.action.id
|
5651
|
-
} : undefined,
|
5453
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
5652
5454
|
tradeId: item.action.tradeId !== undefined ? {
|
5653
5455
|
equals: item.action.tradeId
|
5654
5456
|
} : undefined,
|
@@ -5673,9 +5475,7 @@ exports.Position = {
|
|
5673
5475
|
}
|
5674
5476
|
: { connectOrCreate: prop.asset.newsMentions.map((item) => ({
|
5675
5477
|
where: {
|
5676
|
-
id: item.id !== undefined ?
|
5677
|
-
equals: item.id
|
5678
|
-
} : undefined,
|
5478
|
+
id: item.id !== undefined ? item.id : undefined,
|
5679
5479
|
url: item.url !== undefined ? item.url : undefined,
|
5680
5480
|
assetId: item.assetId !== undefined ? {
|
5681
5481
|
equals: item.assetId
|
@@ -5697,9 +5497,7 @@ exports.Position = {
|
|
5697
5497
|
}
|
5698
5498
|
: { connectOrCreate: {
|
5699
5499
|
where: {
|
5700
|
-
id: item.news.id !== undefined ?
|
5701
|
-
equals: item.news.id
|
5702
|
-
} : undefined,
|
5500
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
5703
5501
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
5704
5502
|
title: item.news.title !== undefined ? {
|
5705
5503
|
equals: item.news.title
|
@@ -5878,9 +5676,7 @@ exports.Position = {
|
|
5878
5676
|
accounts: prop.alpacaAccount.user.accounts ? {
|
5879
5677
|
upsert: prop.alpacaAccount.user.accounts.map((item) => ({
|
5880
5678
|
where: {
|
5881
|
-
id: item.id !== undefined ?
|
5882
|
-
equals: item.id
|
5883
|
-
} : undefined,
|
5679
|
+
id: item.id !== undefined ? item.id : undefined,
|
5884
5680
|
userId: item.userId !== undefined ? {
|
5885
5681
|
equals: item.userId
|
5886
5682
|
} : undefined,
|
@@ -5940,9 +5736,7 @@ exports.Position = {
|
|
5940
5736
|
sessions: prop.alpacaAccount.user.sessions ? {
|
5941
5737
|
upsert: prop.alpacaAccount.user.sessions.map((item) => ({
|
5942
5738
|
where: {
|
5943
|
-
id: item.id !== undefined ?
|
5944
|
-
equals: item.id
|
5945
|
-
} : undefined,
|
5739
|
+
id: item.id !== undefined ? item.id : undefined,
|
5946
5740
|
userId: item.userId !== undefined ? {
|
5947
5741
|
equals: item.userId
|
5948
5742
|
} : undefined,
|
@@ -5967,9 +5761,7 @@ exports.Position = {
|
|
5967
5761
|
authenticators: prop.alpacaAccount.user.authenticators ? {
|
5968
5762
|
upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5969
5763
|
where: {
|
5970
|
-
id: item.id !== undefined ?
|
5971
|
-
equals: item.id
|
5972
|
-
} : undefined,
|
5764
|
+
id: item.id !== undefined ? item.id : undefined,
|
5973
5765
|
userId: item.userId !== undefined ? {
|
5974
5766
|
equals: item.userId
|
5975
5767
|
} : undefined,
|
@@ -6016,9 +5808,7 @@ exports.Position = {
|
|
6016
5808
|
}
|
6017
5809
|
: { connectOrCreate: {
|
6018
5810
|
where: {
|
6019
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
6020
|
-
equals: prop.alpacaAccount.user.customer.id
|
6021
|
-
} : undefined,
|
5811
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
|
6022
5812
|
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
6023
5813
|
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
6024
5814
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -6050,9 +5840,7 @@ exports.Position = {
|
|
6050
5840
|
}
|
6051
5841
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
6052
5842
|
where: {
|
6053
|
-
id: item.id !== undefined ?
|
6054
|
-
equals: item.id
|
6055
|
-
} : undefined,
|
5843
|
+
id: item.id !== undefined ? item.id : undefined,
|
6056
5844
|
userId: item.userId !== undefined ? {
|
6057
5845
|
equals: item.userId
|
6058
5846
|
} : undefined,
|
@@ -6082,9 +5870,7 @@ exports.Position = {
|
|
6082
5870
|
}
|
6083
5871
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
6084
5872
|
where: {
|
6085
|
-
id: item.id !== undefined ?
|
6086
|
-
equals: item.id
|
6087
|
-
} : undefined,
|
5873
|
+
id: item.id !== undefined ? item.id : undefined,
|
6088
5874
|
userId: item.userId !== undefined ? {
|
6089
5875
|
equals: item.userId
|
6090
5876
|
} : undefined,
|
@@ -6103,9 +5889,7 @@ exports.Position = {
|
|
6103
5889
|
}
|
6104
5890
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
6105
5891
|
where: {
|
6106
|
-
id: item.id !== undefined ?
|
6107
|
-
equals: item.id
|
6108
|
-
} : undefined,
|
5892
|
+
id: item.id !== undefined ? item.id : undefined,
|
6109
5893
|
userId: item.userId !== undefined ? {
|
6110
5894
|
equals: item.userId
|
6111
5895
|
} : undefined,
|
@@ -6123,9 +5907,7 @@ exports.Position = {
|
|
6123
5907
|
trades: prop.alpacaAccount.trades ? {
|
6124
5908
|
upsert: prop.alpacaAccount.trades.map((item) => ({
|
6125
5909
|
where: {
|
6126
|
-
id: item.id !== undefined ?
|
6127
|
-
equals: item.id
|
6128
|
-
} : undefined,
|
5910
|
+
id: item.id !== undefined ? item.id : undefined,
|
6129
5911
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6130
5912
|
equals: item.alpacaAccountId
|
6131
5913
|
} : undefined,
|
@@ -6415,9 +6197,7 @@ exports.Position = {
|
|
6415
6197
|
actions: item.actions ? {
|
6416
6198
|
upsert: item.actions.map((item) => ({
|
6417
6199
|
where: {
|
6418
|
-
id: item.id !== undefined ?
|
6419
|
-
equals: item.id
|
6420
|
-
} : undefined,
|
6200
|
+
id: item.id !== undefined ? item.id : undefined,
|
6421
6201
|
tradeId: item.tradeId !== undefined ? {
|
6422
6202
|
equals: item.tradeId
|
6423
6203
|
} : undefined,
|
@@ -6472,9 +6252,7 @@ exports.Position = {
|
|
6472
6252
|
}
|
6473
6253
|
: { connectOrCreate: {
|
6474
6254
|
where: {
|
6475
|
-
id: item.asset.id !== undefined ?
|
6476
|
-
equals: item.asset.id
|
6477
|
-
} : undefined,
|
6255
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
6478
6256
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6479
6257
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6480
6258
|
},
|
@@ -6545,9 +6323,7 @@ exports.Position = {
|
|
6545
6323
|
}
|
6546
6324
|
: { connectOrCreate: item.actions.map((item) => ({
|
6547
6325
|
where: {
|
6548
|
-
id: item.id !== undefined ?
|
6549
|
-
equals: item.id
|
6550
|
-
} : undefined,
|
6326
|
+
id: item.id !== undefined ? item.id : undefined,
|
6551
6327
|
tradeId: item.tradeId !== undefined ? {
|
6552
6328
|
equals: item.tradeId
|
6553
6329
|
} : undefined,
|
@@ -6567,9 +6343,7 @@ exports.Position = {
|
|
6567
6343
|
orders: prop.alpacaAccount.orders ? {
|
6568
6344
|
upsert: prop.alpacaAccount.orders.map((item) => ({
|
6569
6345
|
where: {
|
6570
|
-
id: item.id !== undefined ?
|
6571
|
-
equals: item.id
|
6572
|
-
} : undefined,
|
6346
|
+
id: item.id !== undefined ? item.id : undefined,
|
6573
6347
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6574
6348
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6575
6349
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -7017,9 +6791,7 @@ exports.Position = {
|
|
7017
6791
|
}
|
7018
6792
|
: { connectOrCreate: {
|
7019
6793
|
where: {
|
7020
|
-
id: item.stopLoss.id !== undefined ?
|
7021
|
-
equals: item.stopLoss.id
|
7022
|
-
} : undefined,
|
6794
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7023
6795
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
7024
6796
|
},
|
7025
6797
|
create: {
|
@@ -7036,9 +6808,7 @@ exports.Position = {
|
|
7036
6808
|
}
|
7037
6809
|
: { connectOrCreate: {
|
7038
6810
|
where: {
|
7039
|
-
id: item.takeProfit.id !== undefined ?
|
7040
|
-
equals: item.takeProfit.id
|
7041
|
-
} : undefined,
|
6811
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7042
6812
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
7043
6813
|
},
|
7044
6814
|
create: {
|
@@ -7055,9 +6825,7 @@ exports.Position = {
|
|
7055
6825
|
}
|
7056
6826
|
: { connectOrCreate: {
|
7057
6827
|
where: {
|
7058
|
-
id: item.action.id !== undefined ?
|
7059
|
-
equals: item.action.id
|
7060
|
-
} : undefined,
|
6828
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
7061
6829
|
tradeId: item.action.tradeId !== undefined ? {
|
7062
6830
|
equals: item.action.tradeId
|
7063
6831
|
} : undefined,
|
@@ -7079,9 +6847,7 @@ exports.Position = {
|
|
7079
6847
|
}
|
7080
6848
|
: { connectOrCreate: {
|
7081
6849
|
where: {
|
7082
|
-
id: item.asset.id !== undefined ?
|
7083
|
-
equals: item.asset.id
|
7084
|
-
} : undefined,
|
6850
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7085
6851
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7086
6852
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7087
6853
|
},
|
@@ -7150,9 +6916,7 @@ exports.Position = {
|
|
7150
6916
|
alerts: prop.alpacaAccount.alerts ? {
|
7151
6917
|
upsert: prop.alpacaAccount.alerts.map((item) => ({
|
7152
6918
|
where: {
|
7153
|
-
id: item.id !== undefined ?
|
7154
|
-
equals: item.id
|
7155
|
-
} : undefined,
|
6919
|
+
id: item.id !== undefined ? item.id : undefined,
|
7156
6920
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7157
6921
|
equals: item.alpacaAccountId
|
7158
6922
|
} : undefined,
|
@@ -7197,9 +6961,7 @@ exports.Position = {
|
|
7197
6961
|
}
|
7198
6962
|
: { connectOrCreate: {
|
7199
6963
|
where: {
|
7200
|
-
id: prop.alpacaAccount.user.id !== undefined ?
|
7201
|
-
equals: prop.alpacaAccount.user.id
|
7202
|
-
} : undefined,
|
6964
|
+
id: prop.alpacaAccount.user.id !== undefined ? prop.alpacaAccount.user.id : undefined,
|
7203
6965
|
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
7204
6966
|
name: prop.alpacaAccount.user.name !== undefined ? {
|
7205
6967
|
equals: prop.alpacaAccount.user.name
|
@@ -7225,9 +6987,7 @@ exports.Position = {
|
|
7225
6987
|
}
|
7226
6988
|
: { connectOrCreate: {
|
7227
6989
|
where: {
|
7228
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
7229
|
-
equals: prop.alpacaAccount.user.customer.id
|
7230
|
-
} : undefined,
|
6990
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
|
7231
6991
|
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
7232
6992
|
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
7233
6993
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -7259,9 +7019,7 @@ exports.Position = {
|
|
7259
7019
|
}
|
7260
7020
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
7261
7021
|
where: {
|
7262
|
-
id: item.id !== undefined ?
|
7263
|
-
equals: item.id
|
7264
|
-
} : undefined,
|
7022
|
+
id: item.id !== undefined ? item.id : undefined,
|
7265
7023
|
userId: item.userId !== undefined ? {
|
7266
7024
|
equals: item.userId
|
7267
7025
|
} : undefined,
|
@@ -7291,9 +7049,7 @@ exports.Position = {
|
|
7291
7049
|
}
|
7292
7050
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
7293
7051
|
where: {
|
7294
|
-
id: item.id !== undefined ?
|
7295
|
-
equals: item.id
|
7296
|
-
} : undefined,
|
7052
|
+
id: item.id !== undefined ? item.id : undefined,
|
7297
7053
|
userId: item.userId !== undefined ? {
|
7298
7054
|
equals: item.userId
|
7299
7055
|
} : undefined,
|
@@ -7312,9 +7068,7 @@ exports.Position = {
|
|
7312
7068
|
}
|
7313
7069
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
7314
7070
|
where: {
|
7315
|
-
id: item.id !== undefined ?
|
7316
|
-
equals: item.id
|
7317
|
-
} : undefined,
|
7071
|
+
id: item.id !== undefined ? item.id : undefined,
|
7318
7072
|
userId: item.userId !== undefined ? {
|
7319
7073
|
equals: item.userId
|
7320
7074
|
} : undefined,
|
@@ -7337,9 +7091,7 @@ exports.Position = {
|
|
7337
7091
|
}
|
7338
7092
|
: { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
|
7339
7093
|
where: {
|
7340
|
-
id: item.id !== undefined ?
|
7341
|
-
equals: item.id
|
7342
|
-
} : undefined,
|
7094
|
+
id: item.id !== undefined ? item.id : undefined,
|
7343
7095
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7344
7096
|
equals: item.alpacaAccountId
|
7345
7097
|
} : undefined,
|
@@ -7367,9 +7119,7 @@ exports.Position = {
|
|
7367
7119
|
}
|
7368
7120
|
: { connectOrCreate: {
|
7369
7121
|
where: {
|
7370
|
-
id: item.asset.id !== undefined ?
|
7371
|
-
equals: item.asset.id
|
7372
|
-
} : undefined,
|
7122
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7373
7123
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7374
7124
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7375
7125
|
},
|
@@ -7440,9 +7190,7 @@ exports.Position = {
|
|
7440
7190
|
}
|
7441
7191
|
: { connectOrCreate: item.actions.map((item) => ({
|
7442
7192
|
where: {
|
7443
|
-
id: item.id !== undefined ?
|
7444
|
-
equals: item.id
|
7445
|
-
} : undefined,
|
7193
|
+
id: item.id !== undefined ? item.id : undefined,
|
7446
7194
|
tradeId: item.tradeId !== undefined ? {
|
7447
7195
|
equals: item.tradeId
|
7448
7196
|
} : undefined,
|
@@ -7467,9 +7215,7 @@ exports.Position = {
|
|
7467
7215
|
}
|
7468
7216
|
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
7469
7217
|
where: {
|
7470
|
-
id: item.id !== undefined ?
|
7471
|
-
equals: item.id
|
7472
|
-
} : undefined,
|
7218
|
+
id: item.id !== undefined ? item.id : undefined,
|
7473
7219
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7474
7220
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7475
7221
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -7511,9 +7257,7 @@ exports.Position = {
|
|
7511
7257
|
}
|
7512
7258
|
: { connectOrCreate: {
|
7513
7259
|
where: {
|
7514
|
-
id: item.stopLoss.id !== undefined ?
|
7515
|
-
equals: item.stopLoss.id
|
7516
|
-
} : undefined,
|
7260
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7517
7261
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
7518
7262
|
},
|
7519
7263
|
create: {
|
@@ -7530,9 +7274,7 @@ exports.Position = {
|
|
7530
7274
|
}
|
7531
7275
|
: { connectOrCreate: {
|
7532
7276
|
where: {
|
7533
|
-
id: item.takeProfit.id !== undefined ?
|
7534
|
-
equals: item.takeProfit.id
|
7535
|
-
} : undefined,
|
7277
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7536
7278
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
7537
7279
|
},
|
7538
7280
|
create: {
|
@@ -7549,9 +7291,7 @@ exports.Position = {
|
|
7549
7291
|
}
|
7550
7292
|
: { connectOrCreate: {
|
7551
7293
|
where: {
|
7552
|
-
id: item.action.id !== undefined ?
|
7553
|
-
equals: item.action.id
|
7554
|
-
} : undefined,
|
7294
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
7555
7295
|
tradeId: item.action.tradeId !== undefined ? {
|
7556
7296
|
equals: item.action.tradeId
|
7557
7297
|
} : undefined,
|
@@ -7573,9 +7313,7 @@ exports.Position = {
|
|
7573
7313
|
}
|
7574
7314
|
: { connectOrCreate: {
|
7575
7315
|
where: {
|
7576
|
-
id: item.asset.id !== undefined ?
|
7577
|
-
equals: item.asset.id
|
7578
|
-
} : undefined,
|
7316
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7579
7317
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7580
7318
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7581
7319
|
},
|
@@ -7649,9 +7387,7 @@ exports.Position = {
|
|
7649
7387
|
}
|
7650
7388
|
: { connectOrCreate: prop.alpacaAccount.alerts.map((item) => ({
|
7651
7389
|
where: {
|
7652
|
-
id: item.id !== undefined ?
|
7653
|
-
equals: item.id
|
7654
|
-
} : undefined,
|
7390
|
+
id: item.id !== undefined ? item.id : undefined,
|
7655
7391
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7656
7392
|
equals: item.alpacaAccountId
|
7657
7393
|
} : undefined,
|
@@ -7736,9 +7472,7 @@ exports.Position = {
|
|
7736
7472
|
}`;
|
7737
7473
|
const variables = {
|
7738
7474
|
where: {
|
7739
|
-
id: props.id !== undefined ?
|
7740
|
-
equals: props.id
|
7741
|
-
} : undefined,
|
7475
|
+
id: props.id !== undefined ? props.id : undefined,
|
7742
7476
|
assetId: props.assetId !== undefined ? {
|
7743
7477
|
equals: props.assetId
|
7744
7478
|
} : undefined,
|