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/server/Position.mjs
CHANGED
@@ -226,9 +226,7 @@ export const Position = {
|
|
226
226
|
}
|
227
227
|
: { connectOrCreate: {
|
228
228
|
where: {
|
229
|
-
id: props.asset.id !== undefined ?
|
230
|
-
equals: props.asset.id
|
231
|
-
} : undefined,
|
229
|
+
id: props.asset.id !== undefined ? props.asset.id : undefined,
|
232
230
|
symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
|
233
231
|
name: props.asset.name !== undefined ? props.asset.name : undefined,
|
234
232
|
},
|
@@ -296,9 +294,7 @@ export const Position = {
|
|
296
294
|
}
|
297
295
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
298
296
|
where: {
|
299
|
-
id: item.id !== undefined ?
|
300
|
-
equals: item.id
|
301
|
-
} : undefined,
|
297
|
+
id: item.id !== undefined ? item.id : undefined,
|
302
298
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
303
299
|
equals: item.alpacaAccountId
|
304
300
|
} : undefined,
|
@@ -326,9 +322,7 @@ export const Position = {
|
|
326
322
|
}
|
327
323
|
: { connectOrCreate: {
|
328
324
|
where: {
|
329
|
-
id: item.alpacaAccount.id !== undefined ?
|
330
|
-
equals: item.alpacaAccount.id
|
331
|
-
} : undefined,
|
325
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
332
326
|
userId: item.alpacaAccount.userId !== undefined ? {
|
333
327
|
equals: item.alpacaAccount.userId
|
334
328
|
} : undefined,
|
@@ -354,9 +348,7 @@ export const Position = {
|
|
354
348
|
}
|
355
349
|
: { connectOrCreate: item.actions.map((item) => ({
|
356
350
|
where: {
|
357
|
-
id: item.id !== undefined ?
|
358
|
-
equals: item.id
|
359
|
-
} : undefined,
|
351
|
+
id: item.id !== undefined ? item.id : undefined,
|
360
352
|
tradeId: item.tradeId !== undefined ? {
|
361
353
|
equals: item.tradeId
|
362
354
|
} : undefined,
|
@@ -381,9 +373,7 @@ export const Position = {
|
|
381
373
|
}
|
382
374
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
383
375
|
where: {
|
384
|
-
id: item.id !== undefined ?
|
385
|
-
equals: item.id
|
386
|
-
} : undefined,
|
376
|
+
id: item.id !== undefined ? item.id : undefined,
|
387
377
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
388
378
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
389
379
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -425,9 +415,7 @@ export const Position = {
|
|
425
415
|
}
|
426
416
|
: { connectOrCreate: {
|
427
417
|
where: {
|
428
|
-
id: item.stopLoss.id !== undefined ?
|
429
|
-
equals: item.stopLoss.id
|
430
|
-
} : undefined,
|
418
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
431
419
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
432
420
|
},
|
433
421
|
create: {
|
@@ -444,9 +432,7 @@ export const Position = {
|
|
444
432
|
}
|
445
433
|
: { connectOrCreate: {
|
446
434
|
where: {
|
447
|
-
id: item.takeProfit.id !== undefined ?
|
448
|
-
equals: item.takeProfit.id
|
449
|
-
} : undefined,
|
435
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
450
436
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
451
437
|
},
|
452
438
|
create: {
|
@@ -463,9 +449,7 @@ export const Position = {
|
|
463
449
|
}
|
464
450
|
: { connectOrCreate: {
|
465
451
|
where: {
|
466
|
-
id: item.alpacaAccount.id !== undefined ?
|
467
|
-
equals: item.alpacaAccount.id
|
468
|
-
} : undefined,
|
452
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
469
453
|
userId: item.alpacaAccount.userId !== undefined ? {
|
470
454
|
equals: item.alpacaAccount.userId
|
471
455
|
} : undefined,
|
@@ -491,9 +475,7 @@ export const Position = {
|
|
491
475
|
}
|
492
476
|
: { connectOrCreate: {
|
493
477
|
where: {
|
494
|
-
id: item.action.id !== undefined ?
|
495
|
-
equals: item.action.id
|
496
|
-
} : undefined,
|
478
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
497
479
|
tradeId: item.action.tradeId !== undefined ? {
|
498
480
|
equals: item.action.tradeId
|
499
481
|
} : undefined,
|
@@ -518,9 +500,7 @@ export const Position = {
|
|
518
500
|
}
|
519
501
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
520
502
|
where: {
|
521
|
-
id: item.id !== undefined ?
|
522
|
-
equals: item.id
|
523
|
-
} : undefined,
|
503
|
+
id: item.id !== undefined ? item.id : undefined,
|
524
504
|
url: item.url !== undefined ? item.url : undefined,
|
525
505
|
assetId: item.assetId !== undefined ? {
|
526
506
|
equals: item.assetId
|
@@ -542,9 +522,7 @@ export const Position = {
|
|
542
522
|
}
|
543
523
|
: { connectOrCreate: {
|
544
524
|
where: {
|
545
|
-
id: item.news.id !== undefined ?
|
546
|
-
equals: item.news.id
|
547
|
-
} : undefined,
|
525
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
548
526
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
549
527
|
title: item.news.title !== undefined ? {
|
550
528
|
equals: item.news.title
|
@@ -581,9 +559,7 @@ export const Position = {
|
|
581
559
|
}
|
582
560
|
: { connectOrCreate: {
|
583
561
|
where: {
|
584
|
-
id: props.alpacaAccount.id !== undefined ?
|
585
|
-
equals: props.alpacaAccount.id
|
586
|
-
} : undefined,
|
562
|
+
id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
|
587
563
|
userId: props.alpacaAccount.userId !== undefined ? {
|
588
564
|
equals: props.alpacaAccount.userId
|
589
565
|
} : undefined,
|
@@ -606,9 +582,7 @@ export const Position = {
|
|
606
582
|
}
|
607
583
|
: { connectOrCreate: {
|
608
584
|
where: {
|
609
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
610
|
-
equals: props.alpacaAccount.user.id
|
611
|
-
} : undefined,
|
585
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
612
586
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
613
587
|
name: props.alpacaAccount.user.name !== undefined ? {
|
614
588
|
equals: props.alpacaAccount.user.name
|
@@ -634,9 +608,7 @@ export const Position = {
|
|
634
608
|
}
|
635
609
|
: { connectOrCreate: {
|
636
610
|
where: {
|
637
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
638
|
-
equals: props.alpacaAccount.user.customer.id
|
639
|
-
} : undefined,
|
611
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
640
612
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
641
613
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
642
614
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -668,9 +640,7 @@ export const Position = {
|
|
668
640
|
}
|
669
641
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
670
642
|
where: {
|
671
|
-
id: item.id !== undefined ?
|
672
|
-
equals: item.id
|
673
|
-
} : undefined,
|
643
|
+
id: item.id !== undefined ? item.id : undefined,
|
674
644
|
userId: item.userId !== undefined ? {
|
675
645
|
equals: item.userId
|
676
646
|
} : undefined,
|
@@ -700,9 +670,7 @@ export const Position = {
|
|
700
670
|
}
|
701
671
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
702
672
|
where: {
|
703
|
-
id: item.id !== undefined ?
|
704
|
-
equals: item.id
|
705
|
-
} : undefined,
|
673
|
+
id: item.id !== undefined ? item.id : undefined,
|
706
674
|
userId: item.userId !== undefined ? {
|
707
675
|
equals: item.userId
|
708
676
|
} : undefined,
|
@@ -721,9 +689,7 @@ export const Position = {
|
|
721
689
|
}
|
722
690
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
723
691
|
where: {
|
724
|
-
id: item.id !== undefined ?
|
725
|
-
equals: item.id
|
726
|
-
} : undefined,
|
692
|
+
id: item.id !== undefined ? item.id : undefined,
|
727
693
|
userId: item.userId !== undefined ? {
|
728
694
|
equals: item.userId
|
729
695
|
} : undefined,
|
@@ -746,9 +712,7 @@ export const Position = {
|
|
746
712
|
}
|
747
713
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
748
714
|
where: {
|
749
|
-
id: item.id !== undefined ?
|
750
|
-
equals: item.id
|
751
|
-
} : undefined,
|
715
|
+
id: item.id !== undefined ? item.id : undefined,
|
752
716
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
753
717
|
equals: item.alpacaAccountId
|
754
718
|
} : undefined,
|
@@ -776,9 +740,7 @@ export const Position = {
|
|
776
740
|
}
|
777
741
|
: { connectOrCreate: {
|
778
742
|
where: {
|
779
|
-
id: item.asset.id !== undefined ?
|
780
|
-
equals: item.asset.id
|
781
|
-
} : undefined,
|
743
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
782
744
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
783
745
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
784
746
|
},
|
@@ -849,9 +811,7 @@ export const Position = {
|
|
849
811
|
}
|
850
812
|
: { connectOrCreate: item.actions.map((item) => ({
|
851
813
|
where: {
|
852
|
-
id: item.id !== undefined ?
|
853
|
-
equals: item.id
|
854
|
-
} : undefined,
|
814
|
+
id: item.id !== undefined ? item.id : undefined,
|
855
815
|
tradeId: item.tradeId !== undefined ? {
|
856
816
|
equals: item.tradeId
|
857
817
|
} : undefined,
|
@@ -876,9 +836,7 @@ export const Position = {
|
|
876
836
|
}
|
877
837
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
878
838
|
where: {
|
879
|
-
id: item.id !== undefined ?
|
880
|
-
equals: item.id
|
881
|
-
} : undefined,
|
839
|
+
id: item.id !== undefined ? item.id : undefined,
|
882
840
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
883
841
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
884
842
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -920,9 +878,7 @@ export const Position = {
|
|
920
878
|
}
|
921
879
|
: { connectOrCreate: {
|
922
880
|
where: {
|
923
|
-
id: item.stopLoss.id !== undefined ?
|
924
|
-
equals: item.stopLoss.id
|
925
|
-
} : undefined,
|
881
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
926
882
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
927
883
|
},
|
928
884
|
create: {
|
@@ -939,9 +895,7 @@ export const Position = {
|
|
939
895
|
}
|
940
896
|
: { connectOrCreate: {
|
941
897
|
where: {
|
942
|
-
id: item.takeProfit.id !== undefined ?
|
943
|
-
equals: item.takeProfit.id
|
944
|
-
} : undefined,
|
898
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
945
899
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
946
900
|
},
|
947
901
|
create: {
|
@@ -958,9 +912,7 @@ export const Position = {
|
|
958
912
|
}
|
959
913
|
: { connectOrCreate: {
|
960
914
|
where: {
|
961
|
-
id: item.action.id !== undefined ?
|
962
|
-
equals: item.action.id
|
963
|
-
} : undefined,
|
915
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
964
916
|
tradeId: item.action.tradeId !== undefined ? {
|
965
917
|
equals: item.action.tradeId
|
966
918
|
} : undefined,
|
@@ -982,9 +934,7 @@ export const Position = {
|
|
982
934
|
}
|
983
935
|
: { connectOrCreate: {
|
984
936
|
where: {
|
985
|
-
id: item.asset.id !== undefined ?
|
986
|
-
equals: item.asset.id
|
987
|
-
} : undefined,
|
937
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
988
938
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
989
939
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
990
940
|
},
|
@@ -1058,9 +1008,7 @@ export const Position = {
|
|
1058
1008
|
}
|
1059
1009
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
1060
1010
|
where: {
|
1061
|
-
id: item.id !== undefined ?
|
1062
|
-
equals: item.id
|
1063
|
-
} : undefined,
|
1011
|
+
id: item.id !== undefined ? item.id : undefined,
|
1064
1012
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1065
1013
|
equals: item.alpacaAccountId
|
1066
1014
|
} : undefined,
|
@@ -1158,9 +1106,7 @@ export const Position = {
|
|
1158
1106
|
}`;
|
1159
1107
|
const variables = {
|
1160
1108
|
where: {
|
1161
|
-
id: props.id !== undefined ?
|
1162
|
-
equals: props.id
|
1163
|
-
} : undefined,
|
1109
|
+
id: props.id !== undefined ? props.id : undefined,
|
1164
1110
|
assetId: props.assetId !== undefined ? {
|
1165
1111
|
equals: props.assetId
|
1166
1112
|
} : undefined,
|
@@ -1408,9 +1354,7 @@ export const Position = {
|
|
1408
1354
|
trades: props.asset.trades ? {
|
1409
1355
|
upsert: props.asset.trades.map((item) => ({
|
1410
1356
|
where: {
|
1411
|
-
id: item.id !== undefined ?
|
1412
|
-
equals: item.id
|
1413
|
-
} : undefined,
|
1357
|
+
id: item.id !== undefined ? item.id : undefined,
|
1414
1358
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1415
1359
|
equals: item.alpacaAccountId
|
1416
1360
|
} : undefined,
|
@@ -1513,9 +1457,7 @@ export const Position = {
|
|
1513
1457
|
actions: item.actions ? {
|
1514
1458
|
upsert: item.actions.map((item) => ({
|
1515
1459
|
where: {
|
1516
|
-
id: item.id !== undefined ?
|
1517
|
-
equals: item.id
|
1518
|
-
} : undefined,
|
1460
|
+
id: item.id !== undefined ? item.id : undefined,
|
1519
1461
|
tradeId: item.tradeId !== undefined ? {
|
1520
1462
|
equals: item.tradeId
|
1521
1463
|
} : undefined,
|
@@ -1570,9 +1512,7 @@ export const Position = {
|
|
1570
1512
|
}
|
1571
1513
|
: { connectOrCreate: {
|
1572
1514
|
where: {
|
1573
|
-
id: item.alpacaAccount.id !== undefined ?
|
1574
|
-
equals: item.alpacaAccount.id
|
1575
|
-
} : undefined,
|
1515
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1576
1516
|
userId: item.alpacaAccount.userId !== undefined ? {
|
1577
1517
|
equals: item.alpacaAccount.userId
|
1578
1518
|
} : undefined,
|
@@ -1598,9 +1538,7 @@ export const Position = {
|
|
1598
1538
|
}
|
1599
1539
|
: { connectOrCreate: item.actions.map((item) => ({
|
1600
1540
|
where: {
|
1601
|
-
id: item.id !== undefined ?
|
1602
|
-
equals: item.id
|
1603
|
-
} : undefined,
|
1541
|
+
id: item.id !== undefined ? item.id : undefined,
|
1604
1542
|
tradeId: item.tradeId !== undefined ? {
|
1605
1543
|
equals: item.tradeId
|
1606
1544
|
} : undefined,
|
@@ -1620,9 +1558,7 @@ export const Position = {
|
|
1620
1558
|
orders: props.asset.orders ? {
|
1621
1559
|
upsert: props.asset.orders.map((item) => ({
|
1622
1560
|
where: {
|
1623
|
-
id: item.id !== undefined ?
|
1624
|
-
equals: item.id
|
1625
|
-
} : undefined,
|
1561
|
+
id: item.id !== undefined ? item.id : undefined,
|
1626
1562
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1627
1563
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1628
1564
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -1883,9 +1819,7 @@ export const Position = {
|
|
1883
1819
|
}
|
1884
1820
|
: { connectOrCreate: {
|
1885
1821
|
where: {
|
1886
|
-
id: item.stopLoss.id !== undefined ?
|
1887
|
-
equals: item.stopLoss.id
|
1888
|
-
} : undefined,
|
1822
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
1889
1823
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
1890
1824
|
},
|
1891
1825
|
create: {
|
@@ -1902,9 +1836,7 @@ export const Position = {
|
|
1902
1836
|
}
|
1903
1837
|
: { connectOrCreate: {
|
1904
1838
|
where: {
|
1905
|
-
id: item.takeProfit.id !== undefined ?
|
1906
|
-
equals: item.takeProfit.id
|
1907
|
-
} : undefined,
|
1839
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
1908
1840
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
1909
1841
|
},
|
1910
1842
|
create: {
|
@@ -1921,9 +1853,7 @@ export const Position = {
|
|
1921
1853
|
}
|
1922
1854
|
: { connectOrCreate: {
|
1923
1855
|
where: {
|
1924
|
-
id: item.alpacaAccount.id !== undefined ?
|
1925
|
-
equals: item.alpacaAccount.id
|
1926
|
-
} : undefined,
|
1856
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1927
1857
|
userId: item.alpacaAccount.userId !== undefined ? {
|
1928
1858
|
equals: item.alpacaAccount.userId
|
1929
1859
|
} : undefined,
|
@@ -1949,9 +1879,7 @@ export const Position = {
|
|
1949
1879
|
}
|
1950
1880
|
: { connectOrCreate: {
|
1951
1881
|
where: {
|
1952
|
-
id: item.action.id !== undefined ?
|
1953
|
-
equals: item.action.id
|
1954
|
-
} : undefined,
|
1882
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
1955
1883
|
tradeId: item.action.tradeId !== undefined ? {
|
1956
1884
|
equals: item.action.tradeId
|
1957
1885
|
} : undefined,
|
@@ -1971,9 +1899,7 @@ export const Position = {
|
|
1971
1899
|
newsMentions: props.asset.newsMentions ? {
|
1972
1900
|
upsert: props.asset.newsMentions.map((item) => ({
|
1973
1901
|
where: {
|
1974
|
-
id: item.id !== undefined ?
|
1975
|
-
equals: item.id
|
1976
|
-
} : undefined,
|
1902
|
+
id: item.id !== undefined ? item.id : undefined,
|
1977
1903
|
url: item.url !== undefined ? item.url : undefined,
|
1978
1904
|
assetId: item.assetId !== undefined ? {
|
1979
1905
|
equals: item.assetId
|
@@ -2086,9 +2012,7 @@ export const Position = {
|
|
2086
2012
|
}
|
2087
2013
|
: { connectOrCreate: {
|
2088
2014
|
where: {
|
2089
|
-
id: item.news.id !== undefined ?
|
2090
|
-
equals: item.news.id
|
2091
|
-
} : undefined,
|
2015
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
2092
2016
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
2093
2017
|
title: item.news.title !== undefined ? {
|
2094
2018
|
equals: item.news.title
|
@@ -2179,9 +2103,7 @@ export const Position = {
|
|
2179
2103
|
}
|
2180
2104
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
2181
2105
|
where: {
|
2182
|
-
id: item.id !== undefined ?
|
2183
|
-
equals: item.id
|
2184
|
-
} : undefined,
|
2106
|
+
id: item.id !== undefined ? item.id : undefined,
|
2185
2107
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2186
2108
|
equals: item.alpacaAccountId
|
2187
2109
|
} : undefined,
|
@@ -2209,9 +2131,7 @@ export const Position = {
|
|
2209
2131
|
}
|
2210
2132
|
: { connectOrCreate: {
|
2211
2133
|
where: {
|
2212
|
-
id: item.alpacaAccount.id !== undefined ?
|
2213
|
-
equals: item.alpacaAccount.id
|
2214
|
-
} : undefined,
|
2134
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2215
2135
|
userId: item.alpacaAccount.userId !== undefined ? {
|
2216
2136
|
equals: item.alpacaAccount.userId
|
2217
2137
|
} : undefined,
|
@@ -2237,9 +2157,7 @@ export const Position = {
|
|
2237
2157
|
}
|
2238
2158
|
: { connectOrCreate: item.actions.map((item) => ({
|
2239
2159
|
where: {
|
2240
|
-
id: item.id !== undefined ?
|
2241
|
-
equals: item.id
|
2242
|
-
} : undefined,
|
2160
|
+
id: item.id !== undefined ? item.id : undefined,
|
2243
2161
|
tradeId: item.tradeId !== undefined ? {
|
2244
2162
|
equals: item.tradeId
|
2245
2163
|
} : undefined,
|
@@ -2264,9 +2182,7 @@ export const Position = {
|
|
2264
2182
|
}
|
2265
2183
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
2266
2184
|
where: {
|
2267
|
-
id: item.id !== undefined ?
|
2268
|
-
equals: item.id
|
2269
|
-
} : undefined,
|
2185
|
+
id: item.id !== undefined ? item.id : undefined,
|
2270
2186
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2271
2187
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2272
2188
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -2308,9 +2224,7 @@ export const Position = {
|
|
2308
2224
|
}
|
2309
2225
|
: { connectOrCreate: {
|
2310
2226
|
where: {
|
2311
|
-
id: item.stopLoss.id !== undefined ?
|
2312
|
-
equals: item.stopLoss.id
|
2313
|
-
} : undefined,
|
2227
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
2314
2228
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2315
2229
|
},
|
2316
2230
|
create: {
|
@@ -2327,9 +2241,7 @@ export const Position = {
|
|
2327
2241
|
}
|
2328
2242
|
: { connectOrCreate: {
|
2329
2243
|
where: {
|
2330
|
-
id: item.takeProfit.id !== undefined ?
|
2331
|
-
equals: item.takeProfit.id
|
2332
|
-
} : undefined,
|
2244
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
2333
2245
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2334
2246
|
},
|
2335
2247
|
create: {
|
@@ -2346,9 +2258,7 @@ export const Position = {
|
|
2346
2258
|
}
|
2347
2259
|
: { connectOrCreate: {
|
2348
2260
|
where: {
|
2349
|
-
id: item.alpacaAccount.id !== undefined ?
|
2350
|
-
equals: item.alpacaAccount.id
|
2351
|
-
} : undefined,
|
2261
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
2352
2262
|
userId: item.alpacaAccount.userId !== undefined ? {
|
2353
2263
|
equals: item.alpacaAccount.userId
|
2354
2264
|
} : undefined,
|
@@ -2374,9 +2284,7 @@ export const Position = {
|
|
2374
2284
|
}
|
2375
2285
|
: { connectOrCreate: {
|
2376
2286
|
where: {
|
2377
|
-
id: item.action.id !== undefined ?
|
2378
|
-
equals: item.action.id
|
2379
|
-
} : undefined,
|
2287
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
2380
2288
|
tradeId: item.action.tradeId !== undefined ? {
|
2381
2289
|
equals: item.action.tradeId
|
2382
2290
|
} : undefined,
|
@@ -2401,9 +2309,7 @@ export const Position = {
|
|
2401
2309
|
}
|
2402
2310
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
2403
2311
|
where: {
|
2404
|
-
id: item.id !== undefined ?
|
2405
|
-
equals: item.id
|
2406
|
-
} : undefined,
|
2312
|
+
id: item.id !== undefined ? item.id : undefined,
|
2407
2313
|
url: item.url !== undefined ? item.url : undefined,
|
2408
2314
|
assetId: item.assetId !== undefined ? {
|
2409
2315
|
equals: item.assetId
|
@@ -2425,9 +2331,7 @@ export const Position = {
|
|
2425
2331
|
}
|
2426
2332
|
: { connectOrCreate: {
|
2427
2333
|
where: {
|
2428
|
-
id: item.news.id !== undefined ?
|
2429
|
-
equals: item.news.id
|
2430
|
-
} : undefined,
|
2334
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
2431
2335
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
2432
2336
|
title: item.news.title !== undefined ? {
|
2433
2337
|
equals: item.news.title
|
@@ -2606,9 +2510,7 @@ export const Position = {
|
|
2606
2510
|
accounts: props.alpacaAccount.user.accounts ? {
|
2607
2511
|
upsert: props.alpacaAccount.user.accounts.map((item) => ({
|
2608
2512
|
where: {
|
2609
|
-
id: item.id !== undefined ?
|
2610
|
-
equals: item.id
|
2611
|
-
} : undefined,
|
2513
|
+
id: item.id !== undefined ? item.id : undefined,
|
2612
2514
|
userId: item.userId !== undefined ? {
|
2613
2515
|
equals: item.userId
|
2614
2516
|
} : undefined,
|
@@ -2668,9 +2570,7 @@ export const Position = {
|
|
2668
2570
|
sessions: props.alpacaAccount.user.sessions ? {
|
2669
2571
|
upsert: props.alpacaAccount.user.sessions.map((item) => ({
|
2670
2572
|
where: {
|
2671
|
-
id: item.id !== undefined ?
|
2672
|
-
equals: item.id
|
2673
|
-
} : undefined,
|
2573
|
+
id: item.id !== undefined ? item.id : undefined,
|
2674
2574
|
userId: item.userId !== undefined ? {
|
2675
2575
|
equals: item.userId
|
2676
2576
|
} : undefined,
|
@@ -2695,9 +2595,7 @@ export const Position = {
|
|
2695
2595
|
authenticators: props.alpacaAccount.user.authenticators ? {
|
2696
2596
|
upsert: props.alpacaAccount.user.authenticators.map((item) => ({
|
2697
2597
|
where: {
|
2698
|
-
id: item.id !== undefined ?
|
2699
|
-
equals: item.id
|
2700
|
-
} : undefined,
|
2598
|
+
id: item.id !== undefined ? item.id : undefined,
|
2701
2599
|
userId: item.userId !== undefined ? {
|
2702
2600
|
equals: item.userId
|
2703
2601
|
} : undefined,
|
@@ -2744,9 +2642,7 @@ export const Position = {
|
|
2744
2642
|
}
|
2745
2643
|
: { connectOrCreate: {
|
2746
2644
|
where: {
|
2747
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
2748
|
-
equals: props.alpacaAccount.user.customer.id
|
2749
|
-
} : undefined,
|
2645
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
2750
2646
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
2751
2647
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
2752
2648
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -2778,9 +2674,7 @@ export const Position = {
|
|
2778
2674
|
}
|
2779
2675
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
2780
2676
|
where: {
|
2781
|
-
id: item.id !== undefined ?
|
2782
|
-
equals: item.id
|
2783
|
-
} : undefined,
|
2677
|
+
id: item.id !== undefined ? item.id : undefined,
|
2784
2678
|
userId: item.userId !== undefined ? {
|
2785
2679
|
equals: item.userId
|
2786
2680
|
} : undefined,
|
@@ -2810,9 +2704,7 @@ export const Position = {
|
|
2810
2704
|
}
|
2811
2705
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
2812
2706
|
where: {
|
2813
|
-
id: item.id !== undefined ?
|
2814
|
-
equals: item.id
|
2815
|
-
} : undefined,
|
2707
|
+
id: item.id !== undefined ? item.id : undefined,
|
2816
2708
|
userId: item.userId !== undefined ? {
|
2817
2709
|
equals: item.userId
|
2818
2710
|
} : undefined,
|
@@ -2831,9 +2723,7 @@ export const Position = {
|
|
2831
2723
|
}
|
2832
2724
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
2833
2725
|
where: {
|
2834
|
-
id: item.id !== undefined ?
|
2835
|
-
equals: item.id
|
2836
|
-
} : undefined,
|
2726
|
+
id: item.id !== undefined ? item.id : undefined,
|
2837
2727
|
userId: item.userId !== undefined ? {
|
2838
2728
|
equals: item.userId
|
2839
2729
|
} : undefined,
|
@@ -2851,9 +2741,7 @@ export const Position = {
|
|
2851
2741
|
trades: props.alpacaAccount.trades ? {
|
2852
2742
|
upsert: props.alpacaAccount.trades.map((item) => ({
|
2853
2743
|
where: {
|
2854
|
-
id: item.id !== undefined ?
|
2855
|
-
equals: item.id
|
2856
|
-
} : undefined,
|
2744
|
+
id: item.id !== undefined ? item.id : undefined,
|
2857
2745
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2858
2746
|
equals: item.alpacaAccountId
|
2859
2747
|
} : undefined,
|
@@ -3143,9 +3031,7 @@ export const Position = {
|
|
3143
3031
|
actions: item.actions ? {
|
3144
3032
|
upsert: item.actions.map((item) => ({
|
3145
3033
|
where: {
|
3146
|
-
id: item.id !== undefined ?
|
3147
|
-
equals: item.id
|
3148
|
-
} : undefined,
|
3034
|
+
id: item.id !== undefined ? item.id : undefined,
|
3149
3035
|
tradeId: item.tradeId !== undefined ? {
|
3150
3036
|
equals: item.tradeId
|
3151
3037
|
} : undefined,
|
@@ -3200,9 +3086,7 @@ export const Position = {
|
|
3200
3086
|
}
|
3201
3087
|
: { connectOrCreate: {
|
3202
3088
|
where: {
|
3203
|
-
id: item.asset.id !== undefined ?
|
3204
|
-
equals: item.asset.id
|
3205
|
-
} : undefined,
|
3089
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
3206
3090
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3207
3091
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3208
3092
|
},
|
@@ -3273,9 +3157,7 @@ export const Position = {
|
|
3273
3157
|
}
|
3274
3158
|
: { connectOrCreate: item.actions.map((item) => ({
|
3275
3159
|
where: {
|
3276
|
-
id: item.id !== undefined ?
|
3277
|
-
equals: item.id
|
3278
|
-
} : undefined,
|
3160
|
+
id: item.id !== undefined ? item.id : undefined,
|
3279
3161
|
tradeId: item.tradeId !== undefined ? {
|
3280
3162
|
equals: item.tradeId
|
3281
3163
|
} : undefined,
|
@@ -3295,9 +3177,7 @@ export const Position = {
|
|
3295
3177
|
orders: props.alpacaAccount.orders ? {
|
3296
3178
|
upsert: props.alpacaAccount.orders.map((item) => ({
|
3297
3179
|
where: {
|
3298
|
-
id: item.id !== undefined ?
|
3299
|
-
equals: item.id
|
3300
|
-
} : undefined,
|
3180
|
+
id: item.id !== undefined ? item.id : undefined,
|
3301
3181
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3302
3182
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3303
3183
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -3745,9 +3625,7 @@ export const Position = {
|
|
3745
3625
|
}
|
3746
3626
|
: { connectOrCreate: {
|
3747
3627
|
where: {
|
3748
|
-
id: item.stopLoss.id !== undefined ?
|
3749
|
-
equals: item.stopLoss.id
|
3750
|
-
} : undefined,
|
3628
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
3751
3629
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3752
3630
|
},
|
3753
3631
|
create: {
|
@@ -3764,9 +3642,7 @@ export const Position = {
|
|
3764
3642
|
}
|
3765
3643
|
: { connectOrCreate: {
|
3766
3644
|
where: {
|
3767
|
-
id: item.takeProfit.id !== undefined ?
|
3768
|
-
equals: item.takeProfit.id
|
3769
|
-
} : undefined,
|
3645
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
3770
3646
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3771
3647
|
},
|
3772
3648
|
create: {
|
@@ -3783,9 +3659,7 @@ export const Position = {
|
|
3783
3659
|
}
|
3784
3660
|
: { connectOrCreate: {
|
3785
3661
|
where: {
|
3786
|
-
id: item.action.id !== undefined ?
|
3787
|
-
equals: item.action.id
|
3788
|
-
} : undefined,
|
3662
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
3789
3663
|
tradeId: item.action.tradeId !== undefined ? {
|
3790
3664
|
equals: item.action.tradeId
|
3791
3665
|
} : undefined,
|
@@ -3807,9 +3681,7 @@ export const Position = {
|
|
3807
3681
|
}
|
3808
3682
|
: { connectOrCreate: {
|
3809
3683
|
where: {
|
3810
|
-
id: item.asset.id !== undefined ?
|
3811
|
-
equals: item.asset.id
|
3812
|
-
} : undefined,
|
3684
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
3813
3685
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3814
3686
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3815
3687
|
},
|
@@ -3878,9 +3750,7 @@ export const Position = {
|
|
3878
3750
|
alerts: props.alpacaAccount.alerts ? {
|
3879
3751
|
upsert: props.alpacaAccount.alerts.map((item) => ({
|
3880
3752
|
where: {
|
3881
|
-
id: item.id !== undefined ?
|
3882
|
-
equals: item.id
|
3883
|
-
} : undefined,
|
3753
|
+
id: item.id !== undefined ? item.id : undefined,
|
3884
3754
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3885
3755
|
equals: item.alpacaAccountId
|
3886
3756
|
} : undefined,
|
@@ -3925,9 +3795,7 @@ export const Position = {
|
|
3925
3795
|
}
|
3926
3796
|
: { connectOrCreate: {
|
3927
3797
|
where: {
|
3928
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
3929
|
-
equals: props.alpacaAccount.user.id
|
3930
|
-
} : undefined,
|
3798
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
3931
3799
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
3932
3800
|
name: props.alpacaAccount.user.name !== undefined ? {
|
3933
3801
|
equals: props.alpacaAccount.user.name
|
@@ -3953,9 +3821,7 @@ export const Position = {
|
|
3953
3821
|
}
|
3954
3822
|
: { connectOrCreate: {
|
3955
3823
|
where: {
|
3956
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
3957
|
-
equals: props.alpacaAccount.user.customer.id
|
3958
|
-
} : undefined,
|
3824
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
3959
3825
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
3960
3826
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
3961
3827
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -3987,9 +3853,7 @@ export const Position = {
|
|
3987
3853
|
}
|
3988
3854
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
3989
3855
|
where: {
|
3990
|
-
id: item.id !== undefined ?
|
3991
|
-
equals: item.id
|
3992
|
-
} : undefined,
|
3856
|
+
id: item.id !== undefined ? item.id : undefined,
|
3993
3857
|
userId: item.userId !== undefined ? {
|
3994
3858
|
equals: item.userId
|
3995
3859
|
} : undefined,
|
@@ -4019,9 +3883,7 @@ export const Position = {
|
|
4019
3883
|
}
|
4020
3884
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
4021
3885
|
where: {
|
4022
|
-
id: item.id !== undefined ?
|
4023
|
-
equals: item.id
|
4024
|
-
} : undefined,
|
3886
|
+
id: item.id !== undefined ? item.id : undefined,
|
4025
3887
|
userId: item.userId !== undefined ? {
|
4026
3888
|
equals: item.userId
|
4027
3889
|
} : undefined,
|
@@ -4040,9 +3902,7 @@ export const Position = {
|
|
4040
3902
|
}
|
4041
3903
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
4042
3904
|
where: {
|
4043
|
-
id: item.id !== undefined ?
|
4044
|
-
equals: item.id
|
4045
|
-
} : undefined,
|
3905
|
+
id: item.id !== undefined ? item.id : undefined,
|
4046
3906
|
userId: item.userId !== undefined ? {
|
4047
3907
|
equals: item.userId
|
4048
3908
|
} : undefined,
|
@@ -4065,9 +3925,7 @@ export const Position = {
|
|
4065
3925
|
}
|
4066
3926
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
4067
3927
|
where: {
|
4068
|
-
id: item.id !== undefined ?
|
4069
|
-
equals: item.id
|
4070
|
-
} : undefined,
|
3928
|
+
id: item.id !== undefined ? item.id : undefined,
|
4071
3929
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4072
3930
|
equals: item.alpacaAccountId
|
4073
3931
|
} : undefined,
|
@@ -4095,9 +3953,7 @@ export const Position = {
|
|
4095
3953
|
}
|
4096
3954
|
: { connectOrCreate: {
|
4097
3955
|
where: {
|
4098
|
-
id: item.asset.id !== undefined ?
|
4099
|
-
equals: item.asset.id
|
4100
|
-
} : undefined,
|
3956
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
4101
3957
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4102
3958
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4103
3959
|
},
|
@@ -4168,9 +4024,7 @@ export const Position = {
|
|
4168
4024
|
}
|
4169
4025
|
: { connectOrCreate: item.actions.map((item) => ({
|
4170
4026
|
where: {
|
4171
|
-
id: item.id !== undefined ?
|
4172
|
-
equals: item.id
|
4173
|
-
} : undefined,
|
4027
|
+
id: item.id !== undefined ? item.id : undefined,
|
4174
4028
|
tradeId: item.tradeId !== undefined ? {
|
4175
4029
|
equals: item.tradeId
|
4176
4030
|
} : undefined,
|
@@ -4195,9 +4049,7 @@ export const Position = {
|
|
4195
4049
|
}
|
4196
4050
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
4197
4051
|
where: {
|
4198
|
-
id: item.id !== undefined ?
|
4199
|
-
equals: item.id
|
4200
|
-
} : undefined,
|
4052
|
+
id: item.id !== undefined ? item.id : undefined,
|
4201
4053
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4202
4054
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4203
4055
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -4239,9 +4091,7 @@ export const Position = {
|
|
4239
4091
|
}
|
4240
4092
|
: { connectOrCreate: {
|
4241
4093
|
where: {
|
4242
|
-
id: item.stopLoss.id !== undefined ?
|
4243
|
-
equals: item.stopLoss.id
|
4244
|
-
} : undefined,
|
4094
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
4245
4095
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
4246
4096
|
},
|
4247
4097
|
create: {
|
@@ -4258,9 +4108,7 @@ export const Position = {
|
|
4258
4108
|
}
|
4259
4109
|
: { connectOrCreate: {
|
4260
4110
|
where: {
|
4261
|
-
id: item.takeProfit.id !== undefined ?
|
4262
|
-
equals: item.takeProfit.id
|
4263
|
-
} : undefined,
|
4111
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
4264
4112
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
4265
4113
|
},
|
4266
4114
|
create: {
|
@@ -4277,9 +4125,7 @@ export const Position = {
|
|
4277
4125
|
}
|
4278
4126
|
: { connectOrCreate: {
|
4279
4127
|
where: {
|
4280
|
-
id: item.action.id !== undefined ?
|
4281
|
-
equals: item.action.id
|
4282
|
-
} : undefined,
|
4128
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
4283
4129
|
tradeId: item.action.tradeId !== undefined ? {
|
4284
4130
|
equals: item.action.tradeId
|
4285
4131
|
} : undefined,
|
@@ -4301,9 +4147,7 @@ export const Position = {
|
|
4301
4147
|
}
|
4302
4148
|
: { connectOrCreate: {
|
4303
4149
|
where: {
|
4304
|
-
id: item.asset.id !== undefined ?
|
4305
|
-
equals: item.asset.id
|
4306
|
-
} : undefined,
|
4150
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
4307
4151
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4308
4152
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4309
4153
|
},
|
@@ -4377,9 +4221,7 @@ export const Position = {
|
|
4377
4221
|
}
|
4378
4222
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
4379
4223
|
where: {
|
4380
|
-
id: item.id !== undefined ?
|
4381
|
-
equals: item.id
|
4382
|
-
} : undefined,
|
4224
|
+
id: item.id !== undefined ? item.id : undefined,
|
4383
4225
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4384
4226
|
equals: item.alpacaAccountId
|
4385
4227
|
} : undefined,
|
@@ -4428,9 +4270,7 @@ export const Position = {
|
|
4428
4270
|
}`;
|
4429
4271
|
const variables = props.map(prop => ({
|
4430
4272
|
where: {
|
4431
|
-
id: prop.id !== undefined ?
|
4432
|
-
equals: prop.id
|
4433
|
-
} : undefined,
|
4273
|
+
id: prop.id !== undefined ? prop.id : undefined,
|
4434
4274
|
assetId: prop.assetId !== undefined ? {
|
4435
4275
|
equals: prop.assetId
|
4436
4276
|
} : undefined,
|
@@ -4678,9 +4518,7 @@ export const Position = {
|
|
4678
4518
|
trades: prop.asset.trades ? {
|
4679
4519
|
upsert: prop.asset.trades.map((item) => ({
|
4680
4520
|
where: {
|
4681
|
-
id: item.id !== undefined ?
|
4682
|
-
equals: item.id
|
4683
|
-
} : undefined,
|
4521
|
+
id: item.id !== undefined ? item.id : undefined,
|
4684
4522
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4685
4523
|
equals: item.alpacaAccountId
|
4686
4524
|
} : undefined,
|
@@ -4783,9 +4621,7 @@ export const Position = {
|
|
4783
4621
|
actions: item.actions ? {
|
4784
4622
|
upsert: item.actions.map((item) => ({
|
4785
4623
|
where: {
|
4786
|
-
id: item.id !== undefined ?
|
4787
|
-
equals: item.id
|
4788
|
-
} : undefined,
|
4624
|
+
id: item.id !== undefined ? item.id : undefined,
|
4789
4625
|
tradeId: item.tradeId !== undefined ? {
|
4790
4626
|
equals: item.tradeId
|
4791
4627
|
} : undefined,
|
@@ -4840,9 +4676,7 @@ export const Position = {
|
|
4840
4676
|
}
|
4841
4677
|
: { connectOrCreate: {
|
4842
4678
|
where: {
|
4843
|
-
id: item.alpacaAccount.id !== undefined ?
|
4844
|
-
equals: item.alpacaAccount.id
|
4845
|
-
} : undefined,
|
4679
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
4846
4680
|
userId: item.alpacaAccount.userId !== undefined ? {
|
4847
4681
|
equals: item.alpacaAccount.userId
|
4848
4682
|
} : undefined,
|
@@ -4868,9 +4702,7 @@ export const Position = {
|
|
4868
4702
|
}
|
4869
4703
|
: { connectOrCreate: item.actions.map((item) => ({
|
4870
4704
|
where: {
|
4871
|
-
id: item.id !== undefined ?
|
4872
|
-
equals: item.id
|
4873
|
-
} : undefined,
|
4705
|
+
id: item.id !== undefined ? item.id : undefined,
|
4874
4706
|
tradeId: item.tradeId !== undefined ? {
|
4875
4707
|
equals: item.tradeId
|
4876
4708
|
} : undefined,
|
@@ -4890,9 +4722,7 @@ export const Position = {
|
|
4890
4722
|
orders: prop.asset.orders ? {
|
4891
4723
|
upsert: prop.asset.orders.map((item) => ({
|
4892
4724
|
where: {
|
4893
|
-
id: item.id !== undefined ?
|
4894
|
-
equals: item.id
|
4895
|
-
} : undefined,
|
4725
|
+
id: item.id !== undefined ? item.id : undefined,
|
4896
4726
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4897
4727
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4898
4728
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -5153,9 +4983,7 @@ export const Position = {
|
|
5153
4983
|
}
|
5154
4984
|
: { connectOrCreate: {
|
5155
4985
|
where: {
|
5156
|
-
id: item.stopLoss.id !== undefined ?
|
5157
|
-
equals: item.stopLoss.id
|
5158
|
-
} : undefined,
|
4986
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
5159
4987
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
5160
4988
|
},
|
5161
4989
|
create: {
|
@@ -5172,9 +5000,7 @@ export const Position = {
|
|
5172
5000
|
}
|
5173
5001
|
: { connectOrCreate: {
|
5174
5002
|
where: {
|
5175
|
-
id: item.takeProfit.id !== undefined ?
|
5176
|
-
equals: item.takeProfit.id
|
5177
|
-
} : undefined,
|
5003
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
5178
5004
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
5179
5005
|
},
|
5180
5006
|
create: {
|
@@ -5191,9 +5017,7 @@ export const Position = {
|
|
5191
5017
|
}
|
5192
5018
|
: { connectOrCreate: {
|
5193
5019
|
where: {
|
5194
|
-
id: item.alpacaAccount.id !== undefined ?
|
5195
|
-
equals: item.alpacaAccount.id
|
5196
|
-
} : undefined,
|
5020
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
5197
5021
|
userId: item.alpacaAccount.userId !== undefined ? {
|
5198
5022
|
equals: item.alpacaAccount.userId
|
5199
5023
|
} : undefined,
|
@@ -5219,9 +5043,7 @@ export const Position = {
|
|
5219
5043
|
}
|
5220
5044
|
: { connectOrCreate: {
|
5221
5045
|
where: {
|
5222
|
-
id: item.action.id !== undefined ?
|
5223
|
-
equals: item.action.id
|
5224
|
-
} : undefined,
|
5046
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
5225
5047
|
tradeId: item.action.tradeId !== undefined ? {
|
5226
5048
|
equals: item.action.tradeId
|
5227
5049
|
} : undefined,
|
@@ -5241,9 +5063,7 @@ export const Position = {
|
|
5241
5063
|
newsMentions: prop.asset.newsMentions ? {
|
5242
5064
|
upsert: prop.asset.newsMentions.map((item) => ({
|
5243
5065
|
where: {
|
5244
|
-
id: item.id !== undefined ?
|
5245
|
-
equals: item.id
|
5246
|
-
} : undefined,
|
5066
|
+
id: item.id !== undefined ? item.id : undefined,
|
5247
5067
|
url: item.url !== undefined ? item.url : undefined,
|
5248
5068
|
assetId: item.assetId !== undefined ? {
|
5249
5069
|
equals: item.assetId
|
@@ -5356,9 +5176,7 @@ export const Position = {
|
|
5356
5176
|
}
|
5357
5177
|
: { connectOrCreate: {
|
5358
5178
|
where: {
|
5359
|
-
id: item.news.id !== undefined ?
|
5360
|
-
equals: item.news.id
|
5361
|
-
} : undefined,
|
5179
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
5362
5180
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
5363
5181
|
title: item.news.title !== undefined ? {
|
5364
5182
|
equals: item.news.title
|
@@ -5449,9 +5267,7 @@ export const Position = {
|
|
5449
5267
|
}
|
5450
5268
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
5451
5269
|
where: {
|
5452
|
-
id: item.id !== undefined ?
|
5453
|
-
equals: item.id
|
5454
|
-
} : undefined,
|
5270
|
+
id: item.id !== undefined ? item.id : undefined,
|
5455
5271
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5456
5272
|
equals: item.alpacaAccountId
|
5457
5273
|
} : undefined,
|
@@ -5479,9 +5295,7 @@ export const Position = {
|
|
5479
5295
|
}
|
5480
5296
|
: { connectOrCreate: {
|
5481
5297
|
where: {
|
5482
|
-
id: item.alpacaAccount.id !== undefined ?
|
5483
|
-
equals: item.alpacaAccount.id
|
5484
|
-
} : undefined,
|
5298
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
5485
5299
|
userId: item.alpacaAccount.userId !== undefined ? {
|
5486
5300
|
equals: item.alpacaAccount.userId
|
5487
5301
|
} : undefined,
|
@@ -5507,9 +5321,7 @@ export const Position = {
|
|
5507
5321
|
}
|
5508
5322
|
: { connectOrCreate: item.actions.map((item) => ({
|
5509
5323
|
where: {
|
5510
|
-
id: item.id !== undefined ?
|
5511
|
-
equals: item.id
|
5512
|
-
} : undefined,
|
5324
|
+
id: item.id !== undefined ? item.id : undefined,
|
5513
5325
|
tradeId: item.tradeId !== undefined ? {
|
5514
5326
|
equals: item.tradeId
|
5515
5327
|
} : undefined,
|
@@ -5534,9 +5346,7 @@ export const Position = {
|
|
5534
5346
|
}
|
5535
5347
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
5536
5348
|
where: {
|
5537
|
-
id: item.id !== undefined ?
|
5538
|
-
equals: item.id
|
5539
|
-
} : undefined,
|
5349
|
+
id: item.id !== undefined ? item.id : undefined,
|
5540
5350
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5541
5351
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5542
5352
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -5578,9 +5388,7 @@ export const Position = {
|
|
5578
5388
|
}
|
5579
5389
|
: { connectOrCreate: {
|
5580
5390
|
where: {
|
5581
|
-
id: item.stopLoss.id !== undefined ?
|
5582
|
-
equals: item.stopLoss.id
|
5583
|
-
} : undefined,
|
5391
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
5584
5392
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
5585
5393
|
},
|
5586
5394
|
create: {
|
@@ -5597,9 +5405,7 @@ export const Position = {
|
|
5597
5405
|
}
|
5598
5406
|
: { connectOrCreate: {
|
5599
5407
|
where: {
|
5600
|
-
id: item.takeProfit.id !== undefined ?
|
5601
|
-
equals: item.takeProfit.id
|
5602
|
-
} : undefined,
|
5408
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
5603
5409
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
5604
5410
|
},
|
5605
5411
|
create: {
|
@@ -5616,9 +5422,7 @@ export const Position = {
|
|
5616
5422
|
}
|
5617
5423
|
: { connectOrCreate: {
|
5618
5424
|
where: {
|
5619
|
-
id: item.alpacaAccount.id !== undefined ?
|
5620
|
-
equals: item.alpacaAccount.id
|
5621
|
-
} : undefined,
|
5425
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
5622
5426
|
userId: item.alpacaAccount.userId !== undefined ? {
|
5623
5427
|
equals: item.alpacaAccount.userId
|
5624
5428
|
} : undefined,
|
@@ -5644,9 +5448,7 @@ export const Position = {
|
|
5644
5448
|
}
|
5645
5449
|
: { connectOrCreate: {
|
5646
5450
|
where: {
|
5647
|
-
id: item.action.id !== undefined ?
|
5648
|
-
equals: item.action.id
|
5649
|
-
} : undefined,
|
5451
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
5650
5452
|
tradeId: item.action.tradeId !== undefined ? {
|
5651
5453
|
equals: item.action.tradeId
|
5652
5454
|
} : undefined,
|
@@ -5671,9 +5473,7 @@ export const Position = {
|
|
5671
5473
|
}
|
5672
5474
|
: { connectOrCreate: prop.asset.newsMentions.map((item) => ({
|
5673
5475
|
where: {
|
5674
|
-
id: item.id !== undefined ?
|
5675
|
-
equals: item.id
|
5676
|
-
} : undefined,
|
5476
|
+
id: item.id !== undefined ? item.id : undefined,
|
5677
5477
|
url: item.url !== undefined ? item.url : undefined,
|
5678
5478
|
assetId: item.assetId !== undefined ? {
|
5679
5479
|
equals: item.assetId
|
@@ -5695,9 +5495,7 @@ export const Position = {
|
|
5695
5495
|
}
|
5696
5496
|
: { connectOrCreate: {
|
5697
5497
|
where: {
|
5698
|
-
id: item.news.id !== undefined ?
|
5699
|
-
equals: item.news.id
|
5700
|
-
} : undefined,
|
5498
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
5701
5499
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
5702
5500
|
title: item.news.title !== undefined ? {
|
5703
5501
|
equals: item.news.title
|
@@ -5876,9 +5674,7 @@ export const Position = {
|
|
5876
5674
|
accounts: prop.alpacaAccount.user.accounts ? {
|
5877
5675
|
upsert: prop.alpacaAccount.user.accounts.map((item) => ({
|
5878
5676
|
where: {
|
5879
|
-
id: item.id !== undefined ?
|
5880
|
-
equals: item.id
|
5881
|
-
} : undefined,
|
5677
|
+
id: item.id !== undefined ? item.id : undefined,
|
5882
5678
|
userId: item.userId !== undefined ? {
|
5883
5679
|
equals: item.userId
|
5884
5680
|
} : undefined,
|
@@ -5938,9 +5734,7 @@ export const Position = {
|
|
5938
5734
|
sessions: prop.alpacaAccount.user.sessions ? {
|
5939
5735
|
upsert: prop.alpacaAccount.user.sessions.map((item) => ({
|
5940
5736
|
where: {
|
5941
|
-
id: item.id !== undefined ?
|
5942
|
-
equals: item.id
|
5943
|
-
} : undefined,
|
5737
|
+
id: item.id !== undefined ? item.id : undefined,
|
5944
5738
|
userId: item.userId !== undefined ? {
|
5945
5739
|
equals: item.userId
|
5946
5740
|
} : undefined,
|
@@ -5965,9 +5759,7 @@ export const Position = {
|
|
5965
5759
|
authenticators: prop.alpacaAccount.user.authenticators ? {
|
5966
5760
|
upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5967
5761
|
where: {
|
5968
|
-
id: item.id !== undefined ?
|
5969
|
-
equals: item.id
|
5970
|
-
} : undefined,
|
5762
|
+
id: item.id !== undefined ? item.id : undefined,
|
5971
5763
|
userId: item.userId !== undefined ? {
|
5972
5764
|
equals: item.userId
|
5973
5765
|
} : undefined,
|
@@ -6014,9 +5806,7 @@ export const Position = {
|
|
6014
5806
|
}
|
6015
5807
|
: { connectOrCreate: {
|
6016
5808
|
where: {
|
6017
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
6018
|
-
equals: prop.alpacaAccount.user.customer.id
|
6019
|
-
} : undefined,
|
5809
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
|
6020
5810
|
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
6021
5811
|
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
6022
5812
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -6048,9 +5838,7 @@ export const Position = {
|
|
6048
5838
|
}
|
6049
5839
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
6050
5840
|
where: {
|
6051
|
-
id: item.id !== undefined ?
|
6052
|
-
equals: item.id
|
6053
|
-
} : undefined,
|
5841
|
+
id: item.id !== undefined ? item.id : undefined,
|
6054
5842
|
userId: item.userId !== undefined ? {
|
6055
5843
|
equals: item.userId
|
6056
5844
|
} : undefined,
|
@@ -6080,9 +5868,7 @@ export const Position = {
|
|
6080
5868
|
}
|
6081
5869
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
6082
5870
|
where: {
|
6083
|
-
id: item.id !== undefined ?
|
6084
|
-
equals: item.id
|
6085
|
-
} : undefined,
|
5871
|
+
id: item.id !== undefined ? item.id : undefined,
|
6086
5872
|
userId: item.userId !== undefined ? {
|
6087
5873
|
equals: item.userId
|
6088
5874
|
} : undefined,
|
@@ -6101,9 +5887,7 @@ export const Position = {
|
|
6101
5887
|
}
|
6102
5888
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
6103
5889
|
where: {
|
6104
|
-
id: item.id !== undefined ?
|
6105
|
-
equals: item.id
|
6106
|
-
} : undefined,
|
5890
|
+
id: item.id !== undefined ? item.id : undefined,
|
6107
5891
|
userId: item.userId !== undefined ? {
|
6108
5892
|
equals: item.userId
|
6109
5893
|
} : undefined,
|
@@ -6121,9 +5905,7 @@ export const Position = {
|
|
6121
5905
|
trades: prop.alpacaAccount.trades ? {
|
6122
5906
|
upsert: prop.alpacaAccount.trades.map((item) => ({
|
6123
5907
|
where: {
|
6124
|
-
id: item.id !== undefined ?
|
6125
|
-
equals: item.id
|
6126
|
-
} : undefined,
|
5908
|
+
id: item.id !== undefined ? item.id : undefined,
|
6127
5909
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6128
5910
|
equals: item.alpacaAccountId
|
6129
5911
|
} : undefined,
|
@@ -6413,9 +6195,7 @@ export const Position = {
|
|
6413
6195
|
actions: item.actions ? {
|
6414
6196
|
upsert: item.actions.map((item) => ({
|
6415
6197
|
where: {
|
6416
|
-
id: item.id !== undefined ?
|
6417
|
-
equals: item.id
|
6418
|
-
} : undefined,
|
6198
|
+
id: item.id !== undefined ? item.id : undefined,
|
6419
6199
|
tradeId: item.tradeId !== undefined ? {
|
6420
6200
|
equals: item.tradeId
|
6421
6201
|
} : undefined,
|
@@ -6470,9 +6250,7 @@ export const Position = {
|
|
6470
6250
|
}
|
6471
6251
|
: { connectOrCreate: {
|
6472
6252
|
where: {
|
6473
|
-
id: item.asset.id !== undefined ?
|
6474
|
-
equals: item.asset.id
|
6475
|
-
} : undefined,
|
6253
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
6476
6254
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6477
6255
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6478
6256
|
},
|
@@ -6543,9 +6321,7 @@ export const Position = {
|
|
6543
6321
|
}
|
6544
6322
|
: { connectOrCreate: item.actions.map((item) => ({
|
6545
6323
|
where: {
|
6546
|
-
id: item.id !== undefined ?
|
6547
|
-
equals: item.id
|
6548
|
-
} : undefined,
|
6324
|
+
id: item.id !== undefined ? item.id : undefined,
|
6549
6325
|
tradeId: item.tradeId !== undefined ? {
|
6550
6326
|
equals: item.tradeId
|
6551
6327
|
} : undefined,
|
@@ -6565,9 +6341,7 @@ export const Position = {
|
|
6565
6341
|
orders: prop.alpacaAccount.orders ? {
|
6566
6342
|
upsert: prop.alpacaAccount.orders.map((item) => ({
|
6567
6343
|
where: {
|
6568
|
-
id: item.id !== undefined ?
|
6569
|
-
equals: item.id
|
6570
|
-
} : undefined,
|
6344
|
+
id: item.id !== undefined ? item.id : undefined,
|
6571
6345
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6572
6346
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6573
6347
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -7015,9 +6789,7 @@ export const Position = {
|
|
7015
6789
|
}
|
7016
6790
|
: { connectOrCreate: {
|
7017
6791
|
where: {
|
7018
|
-
id: item.stopLoss.id !== undefined ?
|
7019
|
-
equals: item.stopLoss.id
|
7020
|
-
} : undefined,
|
6792
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7021
6793
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
7022
6794
|
},
|
7023
6795
|
create: {
|
@@ -7034,9 +6806,7 @@ export const Position = {
|
|
7034
6806
|
}
|
7035
6807
|
: { connectOrCreate: {
|
7036
6808
|
where: {
|
7037
|
-
id: item.takeProfit.id !== undefined ?
|
7038
|
-
equals: item.takeProfit.id
|
7039
|
-
} : undefined,
|
6809
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7040
6810
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
7041
6811
|
},
|
7042
6812
|
create: {
|
@@ -7053,9 +6823,7 @@ export const Position = {
|
|
7053
6823
|
}
|
7054
6824
|
: { connectOrCreate: {
|
7055
6825
|
where: {
|
7056
|
-
id: item.action.id !== undefined ?
|
7057
|
-
equals: item.action.id
|
7058
|
-
} : undefined,
|
6826
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
7059
6827
|
tradeId: item.action.tradeId !== undefined ? {
|
7060
6828
|
equals: item.action.tradeId
|
7061
6829
|
} : undefined,
|
@@ -7077,9 +6845,7 @@ export const Position = {
|
|
7077
6845
|
}
|
7078
6846
|
: { connectOrCreate: {
|
7079
6847
|
where: {
|
7080
|
-
id: item.asset.id !== undefined ?
|
7081
|
-
equals: item.asset.id
|
7082
|
-
} : undefined,
|
6848
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7083
6849
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7084
6850
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7085
6851
|
},
|
@@ -7148,9 +6914,7 @@ export const Position = {
|
|
7148
6914
|
alerts: prop.alpacaAccount.alerts ? {
|
7149
6915
|
upsert: prop.alpacaAccount.alerts.map((item) => ({
|
7150
6916
|
where: {
|
7151
|
-
id: item.id !== undefined ?
|
7152
|
-
equals: item.id
|
7153
|
-
} : undefined,
|
6917
|
+
id: item.id !== undefined ? item.id : undefined,
|
7154
6918
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7155
6919
|
equals: item.alpacaAccountId
|
7156
6920
|
} : undefined,
|
@@ -7195,9 +6959,7 @@ export const Position = {
|
|
7195
6959
|
}
|
7196
6960
|
: { connectOrCreate: {
|
7197
6961
|
where: {
|
7198
|
-
id: prop.alpacaAccount.user.id !== undefined ?
|
7199
|
-
equals: prop.alpacaAccount.user.id
|
7200
|
-
} : undefined,
|
6962
|
+
id: prop.alpacaAccount.user.id !== undefined ? prop.alpacaAccount.user.id : undefined,
|
7201
6963
|
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
7202
6964
|
name: prop.alpacaAccount.user.name !== undefined ? {
|
7203
6965
|
equals: prop.alpacaAccount.user.name
|
@@ -7223,9 +6985,7 @@ export const Position = {
|
|
7223
6985
|
}
|
7224
6986
|
: { connectOrCreate: {
|
7225
6987
|
where: {
|
7226
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
7227
|
-
equals: prop.alpacaAccount.user.customer.id
|
7228
|
-
} : undefined,
|
6988
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
|
7229
6989
|
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
7230
6990
|
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
7231
6991
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -7257,9 +7017,7 @@ export const Position = {
|
|
7257
7017
|
}
|
7258
7018
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
7259
7019
|
where: {
|
7260
|
-
id: item.id !== undefined ?
|
7261
|
-
equals: item.id
|
7262
|
-
} : undefined,
|
7020
|
+
id: item.id !== undefined ? item.id : undefined,
|
7263
7021
|
userId: item.userId !== undefined ? {
|
7264
7022
|
equals: item.userId
|
7265
7023
|
} : undefined,
|
@@ -7289,9 +7047,7 @@ export const Position = {
|
|
7289
7047
|
}
|
7290
7048
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
7291
7049
|
where: {
|
7292
|
-
id: item.id !== undefined ?
|
7293
|
-
equals: item.id
|
7294
|
-
} : undefined,
|
7050
|
+
id: item.id !== undefined ? item.id : undefined,
|
7295
7051
|
userId: item.userId !== undefined ? {
|
7296
7052
|
equals: item.userId
|
7297
7053
|
} : undefined,
|
@@ -7310,9 +7066,7 @@ export const Position = {
|
|
7310
7066
|
}
|
7311
7067
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
7312
7068
|
where: {
|
7313
|
-
id: item.id !== undefined ?
|
7314
|
-
equals: item.id
|
7315
|
-
} : undefined,
|
7069
|
+
id: item.id !== undefined ? item.id : undefined,
|
7316
7070
|
userId: item.userId !== undefined ? {
|
7317
7071
|
equals: item.userId
|
7318
7072
|
} : undefined,
|
@@ -7335,9 +7089,7 @@ export const Position = {
|
|
7335
7089
|
}
|
7336
7090
|
: { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
|
7337
7091
|
where: {
|
7338
|
-
id: item.id !== undefined ?
|
7339
|
-
equals: item.id
|
7340
|
-
} : undefined,
|
7092
|
+
id: item.id !== undefined ? item.id : undefined,
|
7341
7093
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7342
7094
|
equals: item.alpacaAccountId
|
7343
7095
|
} : undefined,
|
@@ -7365,9 +7117,7 @@ export const Position = {
|
|
7365
7117
|
}
|
7366
7118
|
: { connectOrCreate: {
|
7367
7119
|
where: {
|
7368
|
-
id: item.asset.id !== undefined ?
|
7369
|
-
equals: item.asset.id
|
7370
|
-
} : undefined,
|
7120
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7371
7121
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7372
7122
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7373
7123
|
},
|
@@ -7438,9 +7188,7 @@ export const Position = {
|
|
7438
7188
|
}
|
7439
7189
|
: { connectOrCreate: item.actions.map((item) => ({
|
7440
7190
|
where: {
|
7441
|
-
id: item.id !== undefined ?
|
7442
|
-
equals: item.id
|
7443
|
-
} : undefined,
|
7191
|
+
id: item.id !== undefined ? item.id : undefined,
|
7444
7192
|
tradeId: item.tradeId !== undefined ? {
|
7445
7193
|
equals: item.tradeId
|
7446
7194
|
} : undefined,
|
@@ -7465,9 +7213,7 @@ export const Position = {
|
|
7465
7213
|
}
|
7466
7214
|
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
7467
7215
|
where: {
|
7468
|
-
id: item.id !== undefined ?
|
7469
|
-
equals: item.id
|
7470
|
-
} : undefined,
|
7216
|
+
id: item.id !== undefined ? item.id : undefined,
|
7471
7217
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7472
7218
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7473
7219
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -7509,9 +7255,7 @@ export const Position = {
|
|
7509
7255
|
}
|
7510
7256
|
: { connectOrCreate: {
|
7511
7257
|
where: {
|
7512
|
-
id: item.stopLoss.id !== undefined ?
|
7513
|
-
equals: item.stopLoss.id
|
7514
|
-
} : undefined,
|
7258
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7515
7259
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
7516
7260
|
},
|
7517
7261
|
create: {
|
@@ -7528,9 +7272,7 @@ export const Position = {
|
|
7528
7272
|
}
|
7529
7273
|
: { connectOrCreate: {
|
7530
7274
|
where: {
|
7531
|
-
id: item.takeProfit.id !== undefined ?
|
7532
|
-
equals: item.takeProfit.id
|
7533
|
-
} : undefined,
|
7275
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7534
7276
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
7535
7277
|
},
|
7536
7278
|
create: {
|
@@ -7547,9 +7289,7 @@ export const Position = {
|
|
7547
7289
|
}
|
7548
7290
|
: { connectOrCreate: {
|
7549
7291
|
where: {
|
7550
|
-
id: item.action.id !== undefined ?
|
7551
|
-
equals: item.action.id
|
7552
|
-
} : undefined,
|
7292
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
7553
7293
|
tradeId: item.action.tradeId !== undefined ? {
|
7554
7294
|
equals: item.action.tradeId
|
7555
7295
|
} : undefined,
|
@@ -7571,9 +7311,7 @@ export const Position = {
|
|
7571
7311
|
}
|
7572
7312
|
: { connectOrCreate: {
|
7573
7313
|
where: {
|
7574
|
-
id: item.asset.id !== undefined ?
|
7575
|
-
equals: item.asset.id
|
7576
|
-
} : undefined,
|
7314
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7577
7315
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7578
7316
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7579
7317
|
},
|
@@ -7647,9 +7385,7 @@ export const Position = {
|
|
7647
7385
|
}
|
7648
7386
|
: { connectOrCreate: prop.alpacaAccount.alerts.map((item) => ({
|
7649
7387
|
where: {
|
7650
|
-
id: item.id !== undefined ?
|
7651
|
-
equals: item.id
|
7652
|
-
} : undefined,
|
7388
|
+
id: item.id !== undefined ? item.id : undefined,
|
7653
7389
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7654
7390
|
equals: item.alpacaAccountId
|
7655
7391
|
} : undefined,
|
@@ -7733,9 +7469,7 @@ export const Position = {
|
|
7733
7469
|
}`;
|
7734
7470
|
const variables = {
|
7735
7471
|
where: {
|
7736
|
-
id: props.id !== undefined ?
|
7737
|
-
equals: props.id
|
7738
|
-
} : undefined,
|
7472
|
+
id: props.id !== undefined ? props.id : undefined,
|
7739
7473
|
assetId: props.assetId !== undefined ? {
|
7740
7474
|
equals: props.assetId
|
7741
7475
|
} : undefined,
|