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/Trade.mjs
CHANGED
@@ -293,9 +293,7 @@ export const Trade = {
|
|
293
293
|
}
|
294
294
|
: { connectOrCreate: {
|
295
295
|
where: {
|
296
|
-
id: props.alpacaAccount.id !== undefined ?
|
297
|
-
equals: props.alpacaAccount.id
|
298
|
-
} : undefined,
|
296
|
+
id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
|
299
297
|
userId: props.alpacaAccount.userId !== undefined ? {
|
300
298
|
equals: props.alpacaAccount.userId
|
301
299
|
} : undefined,
|
@@ -318,9 +316,7 @@ export const Trade = {
|
|
318
316
|
}
|
319
317
|
: { connectOrCreate: {
|
320
318
|
where: {
|
321
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
322
|
-
equals: props.alpacaAccount.user.id
|
323
|
-
} : undefined,
|
319
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
324
320
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
325
321
|
name: props.alpacaAccount.user.name !== undefined ? {
|
326
322
|
equals: props.alpacaAccount.user.name
|
@@ -346,9 +342,7 @@ export const Trade = {
|
|
346
342
|
}
|
347
343
|
: { connectOrCreate: {
|
348
344
|
where: {
|
349
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
350
|
-
equals: props.alpacaAccount.user.customer.id
|
351
|
-
} : undefined,
|
345
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
352
346
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
353
347
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
354
348
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -380,9 +374,7 @@ export const Trade = {
|
|
380
374
|
}
|
381
375
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
382
376
|
where: {
|
383
|
-
id: item.id !== undefined ?
|
384
|
-
equals: item.id
|
385
|
-
} : undefined,
|
377
|
+
id: item.id !== undefined ? item.id : undefined,
|
386
378
|
userId: item.userId !== undefined ? {
|
387
379
|
equals: item.userId
|
388
380
|
} : undefined,
|
@@ -412,9 +404,7 @@ export const Trade = {
|
|
412
404
|
}
|
413
405
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
414
406
|
where: {
|
415
|
-
id: item.id !== undefined ?
|
416
|
-
equals: item.id
|
417
|
-
} : undefined,
|
407
|
+
id: item.id !== undefined ? item.id : undefined,
|
418
408
|
userId: item.userId !== undefined ? {
|
419
409
|
equals: item.userId
|
420
410
|
} : undefined,
|
@@ -433,9 +423,7 @@ export const Trade = {
|
|
433
423
|
}
|
434
424
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
435
425
|
where: {
|
436
|
-
id: item.id !== undefined ?
|
437
|
-
equals: item.id
|
438
|
-
} : undefined,
|
426
|
+
id: item.id !== undefined ? item.id : undefined,
|
439
427
|
userId: item.userId !== undefined ? {
|
440
428
|
equals: item.userId
|
441
429
|
} : undefined,
|
@@ -458,9 +446,7 @@ export const Trade = {
|
|
458
446
|
}
|
459
447
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
460
448
|
where: {
|
461
|
-
id: item.id !== undefined ?
|
462
|
-
equals: item.id
|
463
|
-
} : undefined,
|
449
|
+
id: item.id !== undefined ? item.id : undefined,
|
464
450
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
465
451
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
466
452
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -502,9 +488,7 @@ export const Trade = {
|
|
502
488
|
}
|
503
489
|
: { connectOrCreate: {
|
504
490
|
where: {
|
505
|
-
id: item.stopLoss.id !== undefined ?
|
506
|
-
equals: item.stopLoss.id
|
507
|
-
} : undefined,
|
491
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
508
492
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
509
493
|
},
|
510
494
|
create: {
|
@@ -521,9 +505,7 @@ export const Trade = {
|
|
521
505
|
}
|
522
506
|
: { connectOrCreate: {
|
523
507
|
where: {
|
524
|
-
id: item.takeProfit.id !== undefined ?
|
525
|
-
equals: item.takeProfit.id
|
526
|
-
} : undefined,
|
508
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
527
509
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
528
510
|
},
|
529
511
|
create: {
|
@@ -540,9 +522,7 @@ export const Trade = {
|
|
540
522
|
}
|
541
523
|
: { connectOrCreate: {
|
542
524
|
where: {
|
543
|
-
id: item.action.id !== undefined ?
|
544
|
-
equals: item.action.id
|
545
|
-
} : undefined,
|
525
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
546
526
|
tradeId: item.action.tradeId !== undefined ? {
|
547
527
|
equals: item.action.tradeId
|
548
528
|
} : undefined,
|
@@ -564,9 +544,7 @@ export const Trade = {
|
|
564
544
|
}
|
565
545
|
: { connectOrCreate: {
|
566
546
|
where: {
|
567
|
-
id: item.asset.id !== undefined ?
|
568
|
-
equals: item.asset.id
|
569
|
-
} : undefined,
|
547
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
570
548
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
571
549
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
572
550
|
},
|
@@ -640,9 +618,7 @@ export const Trade = {
|
|
640
618
|
}
|
641
619
|
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
642
620
|
where: {
|
643
|
-
id: item.id !== undefined ?
|
644
|
-
equals: item.id
|
645
|
-
} : undefined,
|
621
|
+
id: item.id !== undefined ? item.id : undefined,
|
646
622
|
assetId: item.assetId !== undefined ? {
|
647
623
|
equals: item.assetId
|
648
624
|
} : undefined,
|
@@ -672,9 +648,7 @@ export const Trade = {
|
|
672
648
|
}
|
673
649
|
: { connectOrCreate: {
|
674
650
|
where: {
|
675
|
-
id: item.asset.id !== undefined ?
|
676
|
-
equals: item.asset.id
|
677
|
-
} : undefined,
|
651
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
678
652
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
679
653
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
680
654
|
},
|
@@ -748,9 +722,7 @@ export const Trade = {
|
|
748
722
|
}
|
749
723
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
750
724
|
where: {
|
751
|
-
id: item.id !== undefined ?
|
752
|
-
equals: item.id
|
753
|
-
} : undefined,
|
725
|
+
id: item.id !== undefined ? item.id : undefined,
|
754
726
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
755
727
|
equals: item.alpacaAccountId
|
756
728
|
} : undefined,
|
@@ -773,9 +745,7 @@ export const Trade = {
|
|
773
745
|
}
|
774
746
|
: { connectOrCreate: {
|
775
747
|
where: {
|
776
|
-
id: props.asset.id !== undefined ?
|
777
|
-
equals: props.asset.id
|
778
|
-
} : undefined,
|
748
|
+
id: props.asset.id !== undefined ? props.asset.id : undefined,
|
779
749
|
symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
|
780
750
|
name: props.asset.name !== undefined ? props.asset.name : undefined,
|
781
751
|
},
|
@@ -843,9 +813,7 @@ export const Trade = {
|
|
843
813
|
}
|
844
814
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
845
815
|
where: {
|
846
|
-
id: item.id !== undefined ?
|
847
|
-
equals: item.id
|
848
|
-
} : undefined,
|
816
|
+
id: item.id !== undefined ? item.id : undefined,
|
849
817
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
850
818
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
851
819
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -887,9 +855,7 @@ export const Trade = {
|
|
887
855
|
}
|
888
856
|
: { connectOrCreate: {
|
889
857
|
where: {
|
890
|
-
id: item.stopLoss.id !== undefined ?
|
891
|
-
equals: item.stopLoss.id
|
892
|
-
} : undefined,
|
858
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
893
859
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
894
860
|
},
|
895
861
|
create: {
|
@@ -906,9 +872,7 @@ export const Trade = {
|
|
906
872
|
}
|
907
873
|
: { connectOrCreate: {
|
908
874
|
where: {
|
909
|
-
id: item.takeProfit.id !== undefined ?
|
910
|
-
equals: item.takeProfit.id
|
911
|
-
} : undefined,
|
875
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
912
876
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
913
877
|
},
|
914
878
|
create: {
|
@@ -925,9 +889,7 @@ export const Trade = {
|
|
925
889
|
}
|
926
890
|
: { connectOrCreate: {
|
927
891
|
where: {
|
928
|
-
id: item.alpacaAccount.id !== undefined ?
|
929
|
-
equals: item.alpacaAccount.id
|
930
|
-
} : undefined,
|
892
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
931
893
|
userId: item.alpacaAccount.userId !== undefined ? {
|
932
894
|
equals: item.alpacaAccount.userId
|
933
895
|
} : undefined,
|
@@ -953,9 +915,7 @@ export const Trade = {
|
|
953
915
|
}
|
954
916
|
: { connectOrCreate: {
|
955
917
|
where: {
|
956
|
-
id: item.action.id !== undefined ?
|
957
|
-
equals: item.action.id
|
958
|
-
} : undefined,
|
918
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
959
919
|
tradeId: item.action.tradeId !== undefined ? {
|
960
920
|
equals: item.action.tradeId
|
961
921
|
} : undefined,
|
@@ -980,9 +940,7 @@ export const Trade = {
|
|
980
940
|
}
|
981
941
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
982
942
|
where: {
|
983
|
-
id: item.id !== undefined ?
|
984
|
-
equals: item.id
|
985
|
-
} : undefined,
|
943
|
+
id: item.id !== undefined ? item.id : undefined,
|
986
944
|
assetId: item.assetId !== undefined ? {
|
987
945
|
equals: item.assetId
|
988
946
|
} : undefined,
|
@@ -1012,9 +970,7 @@ export const Trade = {
|
|
1012
970
|
}
|
1013
971
|
: { connectOrCreate: {
|
1014
972
|
where: {
|
1015
|
-
id: item.alpacaAccount.id !== undefined ?
|
1016
|
-
equals: item.alpacaAccount.id
|
1017
|
-
} : undefined,
|
973
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
1018
974
|
userId: item.alpacaAccount.userId !== undefined ? {
|
1019
975
|
equals: item.alpacaAccount.userId
|
1020
976
|
} : undefined,
|
@@ -1043,9 +999,7 @@ export const Trade = {
|
|
1043
999
|
}
|
1044
1000
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
1045
1001
|
where: {
|
1046
|
-
id: item.id !== undefined ?
|
1047
|
-
equals: item.id
|
1048
|
-
} : undefined,
|
1002
|
+
id: item.id !== undefined ? item.id : undefined,
|
1049
1003
|
url: item.url !== undefined ? item.url : undefined,
|
1050
1004
|
assetId: item.assetId !== undefined ? {
|
1051
1005
|
equals: item.assetId
|
@@ -1067,9 +1021,7 @@ export const Trade = {
|
|
1067
1021
|
}
|
1068
1022
|
: { connectOrCreate: {
|
1069
1023
|
where: {
|
1070
|
-
id: item.news.id !== undefined ?
|
1071
|
-
equals: item.news.id
|
1072
|
-
} : undefined,
|
1024
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
1073
1025
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
1074
1026
|
title: item.news.title !== undefined ? {
|
1075
1027
|
equals: item.news.title
|
@@ -1106,9 +1058,7 @@ export const Trade = {
|
|
1106
1058
|
}
|
1107
1059
|
: { connectOrCreate: props.actions.map((item) => ({
|
1108
1060
|
where: {
|
1109
|
-
id: item.id !== undefined ?
|
1110
|
-
equals: item.id
|
1111
|
-
} : undefined,
|
1061
|
+
id: item.id !== undefined ? item.id : undefined,
|
1112
1062
|
tradeId: item.tradeId !== undefined ? {
|
1113
1063
|
equals: item.tradeId
|
1114
1064
|
} : undefined,
|
@@ -1127,9 +1077,7 @@ export const Trade = {
|
|
1127
1077
|
}
|
1128
1078
|
: { connectOrCreate: {
|
1129
1079
|
where: {
|
1130
|
-
id: item.order.id !== undefined ?
|
1131
|
-
equals: item.order.id
|
1132
|
-
} : undefined,
|
1080
|
+
id: item.order.id !== undefined ? item.order.id : undefined,
|
1133
1081
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
1134
1082
|
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
1135
1083
|
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
@@ -1171,9 +1119,7 @@ export const Trade = {
|
|
1171
1119
|
}
|
1172
1120
|
: { connectOrCreate: {
|
1173
1121
|
where: {
|
1174
|
-
id: item.order.stopLoss.id !== undefined ?
|
1175
|
-
equals: item.order.stopLoss.id
|
1176
|
-
} : undefined,
|
1122
|
+
id: item.order.stopLoss.id !== undefined ? item.order.stopLoss.id : undefined,
|
1177
1123
|
orderId: item.order.stopLoss.orderId !== undefined ? item.order.stopLoss.orderId : undefined,
|
1178
1124
|
},
|
1179
1125
|
create: {
|
@@ -1190,9 +1136,7 @@ export const Trade = {
|
|
1190
1136
|
}
|
1191
1137
|
: { connectOrCreate: {
|
1192
1138
|
where: {
|
1193
|
-
id: item.order.takeProfit.id !== undefined ?
|
1194
|
-
equals: item.order.takeProfit.id
|
1195
|
-
} : undefined,
|
1139
|
+
id: item.order.takeProfit.id !== undefined ? item.order.takeProfit.id : undefined,
|
1196
1140
|
orderId: item.order.takeProfit.orderId !== undefined ? item.order.takeProfit.orderId : undefined,
|
1197
1141
|
},
|
1198
1142
|
create: {
|
@@ -1209,9 +1153,7 @@ export const Trade = {
|
|
1209
1153
|
}
|
1210
1154
|
: { connectOrCreate: {
|
1211
1155
|
where: {
|
1212
|
-
id: item.order.alpacaAccount.id !== undefined ?
|
1213
|
-
equals: item.order.alpacaAccount.id
|
1214
|
-
} : undefined,
|
1156
|
+
id: item.order.alpacaAccount.id !== undefined ? item.order.alpacaAccount.id : undefined,
|
1215
1157
|
userId: item.order.alpacaAccount.userId !== undefined ? {
|
1216
1158
|
equals: item.order.alpacaAccount.userId
|
1217
1159
|
} : undefined,
|
@@ -1237,9 +1179,7 @@ export const Trade = {
|
|
1237
1179
|
}
|
1238
1180
|
: { connectOrCreate: {
|
1239
1181
|
where: {
|
1240
|
-
id: item.order.asset.id !== undefined ?
|
1241
|
-
equals: item.order.asset.id
|
1242
|
-
} : undefined,
|
1182
|
+
id: item.order.asset.id !== undefined ? item.order.asset.id : undefined,
|
1243
1183
|
symbol: item.order.asset.symbol !== undefined ? item.order.asset.symbol : undefined,
|
1244
1184
|
name: item.order.asset.name !== undefined ? item.order.asset.name : undefined,
|
1245
1185
|
},
|
@@ -1389,9 +1329,7 @@ export const Trade = {
|
|
1389
1329
|
}`;
|
1390
1330
|
const variables = {
|
1391
1331
|
where: {
|
1392
|
-
id: props.id !== undefined ?
|
1393
|
-
equals: props.id
|
1394
|
-
} : undefined,
|
1332
|
+
id: props.id !== undefined ? props.id : undefined,
|
1395
1333
|
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
1396
1334
|
equals: props.alpacaAccountId
|
1397
1335
|
} : undefined,
|
@@ -1605,9 +1543,7 @@ export const Trade = {
|
|
1605
1543
|
accounts: props.alpacaAccount.user.accounts ? {
|
1606
1544
|
upsert: props.alpacaAccount.user.accounts.map((item) => ({
|
1607
1545
|
where: {
|
1608
|
-
id: item.id !== undefined ?
|
1609
|
-
equals: item.id
|
1610
|
-
} : undefined,
|
1546
|
+
id: item.id !== undefined ? item.id : undefined,
|
1611
1547
|
userId: item.userId !== undefined ? {
|
1612
1548
|
equals: item.userId
|
1613
1549
|
} : undefined,
|
@@ -1667,9 +1603,7 @@ export const Trade = {
|
|
1667
1603
|
sessions: props.alpacaAccount.user.sessions ? {
|
1668
1604
|
upsert: props.alpacaAccount.user.sessions.map((item) => ({
|
1669
1605
|
where: {
|
1670
|
-
id: item.id !== undefined ?
|
1671
|
-
equals: item.id
|
1672
|
-
} : undefined,
|
1606
|
+
id: item.id !== undefined ? item.id : undefined,
|
1673
1607
|
userId: item.userId !== undefined ? {
|
1674
1608
|
equals: item.userId
|
1675
1609
|
} : undefined,
|
@@ -1694,9 +1628,7 @@ export const Trade = {
|
|
1694
1628
|
authenticators: props.alpacaAccount.user.authenticators ? {
|
1695
1629
|
upsert: props.alpacaAccount.user.authenticators.map((item) => ({
|
1696
1630
|
where: {
|
1697
|
-
id: item.id !== undefined ?
|
1698
|
-
equals: item.id
|
1699
|
-
} : undefined,
|
1631
|
+
id: item.id !== undefined ? item.id : undefined,
|
1700
1632
|
userId: item.userId !== undefined ? {
|
1701
1633
|
equals: item.userId
|
1702
1634
|
} : undefined,
|
@@ -1743,9 +1675,7 @@ export const Trade = {
|
|
1743
1675
|
}
|
1744
1676
|
: { connectOrCreate: {
|
1745
1677
|
where: {
|
1746
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
1747
|
-
equals: props.alpacaAccount.user.customer.id
|
1748
|
-
} : undefined,
|
1678
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
1749
1679
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
1750
1680
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
1751
1681
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -1777,9 +1707,7 @@ export const Trade = {
|
|
1777
1707
|
}
|
1778
1708
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
1779
1709
|
where: {
|
1780
|
-
id: item.id !== undefined ?
|
1781
|
-
equals: item.id
|
1782
|
-
} : undefined,
|
1710
|
+
id: item.id !== undefined ? item.id : undefined,
|
1783
1711
|
userId: item.userId !== undefined ? {
|
1784
1712
|
equals: item.userId
|
1785
1713
|
} : undefined,
|
@@ -1809,9 +1737,7 @@ export const Trade = {
|
|
1809
1737
|
}
|
1810
1738
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
1811
1739
|
where: {
|
1812
|
-
id: item.id !== undefined ?
|
1813
|
-
equals: item.id
|
1814
|
-
} : undefined,
|
1740
|
+
id: item.id !== undefined ? item.id : undefined,
|
1815
1741
|
userId: item.userId !== undefined ? {
|
1816
1742
|
equals: item.userId
|
1817
1743
|
} : undefined,
|
@@ -1830,9 +1756,7 @@ export const Trade = {
|
|
1830
1756
|
}
|
1831
1757
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
1832
1758
|
where: {
|
1833
|
-
id: item.id !== undefined ?
|
1834
|
-
equals: item.id
|
1835
|
-
} : undefined,
|
1759
|
+
id: item.id !== undefined ? item.id : undefined,
|
1836
1760
|
userId: item.userId !== undefined ? {
|
1837
1761
|
equals: item.userId
|
1838
1762
|
} : undefined,
|
@@ -1850,9 +1774,7 @@ export const Trade = {
|
|
1850
1774
|
orders: props.alpacaAccount.orders ? {
|
1851
1775
|
upsert: props.alpacaAccount.orders.map((item) => ({
|
1852
1776
|
where: {
|
1853
|
-
id: item.id !== undefined ?
|
1854
|
-
equals: item.id
|
1855
|
-
} : undefined,
|
1777
|
+
id: item.id !== undefined ? item.id : undefined,
|
1856
1778
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1857
1779
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1858
1780
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -2300,9 +2222,7 @@ export const Trade = {
|
|
2300
2222
|
}
|
2301
2223
|
: { connectOrCreate: {
|
2302
2224
|
where: {
|
2303
|
-
id: item.stopLoss.id !== undefined ?
|
2304
|
-
equals: item.stopLoss.id
|
2305
|
-
} : undefined,
|
2225
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
2306
2226
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2307
2227
|
},
|
2308
2228
|
create: {
|
@@ -2319,9 +2239,7 @@ export const Trade = {
|
|
2319
2239
|
}
|
2320
2240
|
: { connectOrCreate: {
|
2321
2241
|
where: {
|
2322
|
-
id: item.takeProfit.id !== undefined ?
|
2323
|
-
equals: item.takeProfit.id
|
2324
|
-
} : undefined,
|
2242
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
2325
2243
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2326
2244
|
},
|
2327
2245
|
create: {
|
@@ -2338,9 +2256,7 @@ export const Trade = {
|
|
2338
2256
|
}
|
2339
2257
|
: { connectOrCreate: {
|
2340
2258
|
where: {
|
2341
|
-
id: item.action.id !== undefined ?
|
2342
|
-
equals: item.action.id
|
2343
|
-
} : undefined,
|
2259
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
2344
2260
|
tradeId: item.action.tradeId !== undefined ? {
|
2345
2261
|
equals: item.action.tradeId
|
2346
2262
|
} : undefined,
|
@@ -2362,9 +2278,7 @@ export const Trade = {
|
|
2362
2278
|
}
|
2363
2279
|
: { connectOrCreate: {
|
2364
2280
|
where: {
|
2365
|
-
id: item.asset.id !== undefined ?
|
2366
|
-
equals: item.asset.id
|
2367
|
-
} : undefined,
|
2281
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
2368
2282
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2369
2283
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2370
2284
|
},
|
@@ -2433,9 +2347,7 @@ export const Trade = {
|
|
2433
2347
|
positions: props.alpacaAccount.positions ? {
|
2434
2348
|
upsert: props.alpacaAccount.positions.map((item) => ({
|
2435
2349
|
where: {
|
2436
|
-
id: item.id !== undefined ?
|
2437
|
-
equals: item.id
|
2438
|
-
} : undefined,
|
2350
|
+
id: item.id !== undefined ? item.id : undefined,
|
2439
2351
|
assetId: item.assetId !== undefined ? {
|
2440
2352
|
equals: item.assetId
|
2441
2353
|
} : undefined,
|
@@ -2751,9 +2663,7 @@ export const Trade = {
|
|
2751
2663
|
}
|
2752
2664
|
: { connectOrCreate: {
|
2753
2665
|
where: {
|
2754
|
-
id: item.asset.id !== undefined ?
|
2755
|
-
equals: item.asset.id
|
2756
|
-
} : undefined,
|
2666
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
2757
2667
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2758
2668
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2759
2669
|
},
|
@@ -2822,9 +2732,7 @@ export const Trade = {
|
|
2822
2732
|
alerts: props.alpacaAccount.alerts ? {
|
2823
2733
|
upsert: props.alpacaAccount.alerts.map((item) => ({
|
2824
2734
|
where: {
|
2825
|
-
id: item.id !== undefined ?
|
2826
|
-
equals: item.id
|
2827
|
-
} : undefined,
|
2735
|
+
id: item.id !== undefined ? item.id : undefined,
|
2828
2736
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2829
2737
|
equals: item.alpacaAccountId
|
2830
2738
|
} : undefined,
|
@@ -2869,9 +2777,7 @@ export const Trade = {
|
|
2869
2777
|
}
|
2870
2778
|
: { connectOrCreate: {
|
2871
2779
|
where: {
|
2872
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
2873
|
-
equals: props.alpacaAccount.user.id
|
2874
|
-
} : undefined,
|
2780
|
+
id: props.alpacaAccount.user.id !== undefined ? props.alpacaAccount.user.id : undefined,
|
2875
2781
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
2876
2782
|
name: props.alpacaAccount.user.name !== undefined ? {
|
2877
2783
|
equals: props.alpacaAccount.user.name
|
@@ -2897,9 +2803,7 @@ export const Trade = {
|
|
2897
2803
|
}
|
2898
2804
|
: { connectOrCreate: {
|
2899
2805
|
where: {
|
2900
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
2901
|
-
equals: props.alpacaAccount.user.customer.id
|
2902
|
-
} : undefined,
|
2806
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
|
2903
2807
|
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
2904
2808
|
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
2905
2809
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -2931,9 +2835,7 @@ export const Trade = {
|
|
2931
2835
|
}
|
2932
2836
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
2933
2837
|
where: {
|
2934
|
-
id: item.id !== undefined ?
|
2935
|
-
equals: item.id
|
2936
|
-
} : undefined,
|
2838
|
+
id: item.id !== undefined ? item.id : undefined,
|
2937
2839
|
userId: item.userId !== undefined ? {
|
2938
2840
|
equals: item.userId
|
2939
2841
|
} : undefined,
|
@@ -2963,9 +2865,7 @@ export const Trade = {
|
|
2963
2865
|
}
|
2964
2866
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
2965
2867
|
where: {
|
2966
|
-
id: item.id !== undefined ?
|
2967
|
-
equals: item.id
|
2968
|
-
} : undefined,
|
2868
|
+
id: item.id !== undefined ? item.id : undefined,
|
2969
2869
|
userId: item.userId !== undefined ? {
|
2970
2870
|
equals: item.userId
|
2971
2871
|
} : undefined,
|
@@ -2984,9 +2884,7 @@ export const Trade = {
|
|
2984
2884
|
}
|
2985
2885
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
2986
2886
|
where: {
|
2987
|
-
id: item.id !== undefined ?
|
2988
|
-
equals: item.id
|
2989
|
-
} : undefined,
|
2887
|
+
id: item.id !== undefined ? item.id : undefined,
|
2990
2888
|
userId: item.userId !== undefined ? {
|
2991
2889
|
equals: item.userId
|
2992
2890
|
} : undefined,
|
@@ -3009,9 +2907,7 @@ export const Trade = {
|
|
3009
2907
|
}
|
3010
2908
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
3011
2909
|
where: {
|
3012
|
-
id: item.id !== undefined ?
|
3013
|
-
equals: item.id
|
3014
|
-
} : undefined,
|
2910
|
+
id: item.id !== undefined ? item.id : undefined,
|
3015
2911
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3016
2912
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3017
2913
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -3053,9 +2949,7 @@ export const Trade = {
|
|
3053
2949
|
}
|
3054
2950
|
: { connectOrCreate: {
|
3055
2951
|
where: {
|
3056
|
-
id: item.stopLoss.id !== undefined ?
|
3057
|
-
equals: item.stopLoss.id
|
3058
|
-
} : undefined,
|
2952
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
3059
2953
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3060
2954
|
},
|
3061
2955
|
create: {
|
@@ -3072,9 +2966,7 @@ export const Trade = {
|
|
3072
2966
|
}
|
3073
2967
|
: { connectOrCreate: {
|
3074
2968
|
where: {
|
3075
|
-
id: item.takeProfit.id !== undefined ?
|
3076
|
-
equals: item.takeProfit.id
|
3077
|
-
} : undefined,
|
2969
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
3078
2970
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3079
2971
|
},
|
3080
2972
|
create: {
|
@@ -3091,9 +2983,7 @@ export const Trade = {
|
|
3091
2983
|
}
|
3092
2984
|
: { connectOrCreate: {
|
3093
2985
|
where: {
|
3094
|
-
id: item.action.id !== undefined ?
|
3095
|
-
equals: item.action.id
|
3096
|
-
} : undefined,
|
2986
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
3097
2987
|
tradeId: item.action.tradeId !== undefined ? {
|
3098
2988
|
equals: item.action.tradeId
|
3099
2989
|
} : undefined,
|
@@ -3115,9 +3005,7 @@ export const Trade = {
|
|
3115
3005
|
}
|
3116
3006
|
: { connectOrCreate: {
|
3117
3007
|
where: {
|
3118
|
-
id: item.asset.id !== undefined ?
|
3119
|
-
equals: item.asset.id
|
3120
|
-
} : undefined,
|
3008
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
3121
3009
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3122
3010
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3123
3011
|
},
|
@@ -3191,9 +3079,7 @@ export const Trade = {
|
|
3191
3079
|
}
|
3192
3080
|
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
3193
3081
|
where: {
|
3194
|
-
id: item.id !== undefined ?
|
3195
|
-
equals: item.id
|
3196
|
-
} : undefined,
|
3082
|
+
id: item.id !== undefined ? item.id : undefined,
|
3197
3083
|
assetId: item.assetId !== undefined ? {
|
3198
3084
|
equals: item.assetId
|
3199
3085
|
} : undefined,
|
@@ -3223,9 +3109,7 @@ export const Trade = {
|
|
3223
3109
|
}
|
3224
3110
|
: { connectOrCreate: {
|
3225
3111
|
where: {
|
3226
|
-
id: item.asset.id !== undefined ?
|
3227
|
-
equals: item.asset.id
|
3228
|
-
} : undefined,
|
3112
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
3229
3113
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3230
3114
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3231
3115
|
},
|
@@ -3299,9 +3183,7 @@ export const Trade = {
|
|
3299
3183
|
}
|
3300
3184
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
3301
3185
|
where: {
|
3302
|
-
id: item.id !== undefined ?
|
3303
|
-
equals: item.id
|
3304
|
-
} : undefined,
|
3186
|
+
id: item.id !== undefined ? item.id : undefined,
|
3305
3187
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3306
3188
|
equals: item.alpacaAccountId
|
3307
3189
|
} : undefined,
|
@@ -3501,9 +3383,7 @@ export const Trade = {
|
|
3501
3383
|
orders: props.asset.orders ? {
|
3502
3384
|
upsert: props.asset.orders.map((item) => ({
|
3503
3385
|
where: {
|
3504
|
-
id: item.id !== undefined ?
|
3505
|
-
equals: item.id
|
3506
|
-
} : undefined,
|
3386
|
+
id: item.id !== undefined ? item.id : undefined,
|
3507
3387
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3508
3388
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3509
3389
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -3764,9 +3644,7 @@ export const Trade = {
|
|
3764
3644
|
}
|
3765
3645
|
: { connectOrCreate: {
|
3766
3646
|
where: {
|
3767
|
-
id: item.stopLoss.id !== undefined ?
|
3768
|
-
equals: item.stopLoss.id
|
3769
|
-
} : undefined,
|
3647
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
3770
3648
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3771
3649
|
},
|
3772
3650
|
create: {
|
@@ -3783,9 +3661,7 @@ export const Trade = {
|
|
3783
3661
|
}
|
3784
3662
|
: { connectOrCreate: {
|
3785
3663
|
where: {
|
3786
|
-
id: item.takeProfit.id !== undefined ?
|
3787
|
-
equals: item.takeProfit.id
|
3788
|
-
} : undefined,
|
3664
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
3789
3665
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3790
3666
|
},
|
3791
3667
|
create: {
|
@@ -3802,9 +3678,7 @@ export const Trade = {
|
|
3802
3678
|
}
|
3803
3679
|
: { connectOrCreate: {
|
3804
3680
|
where: {
|
3805
|
-
id: item.alpacaAccount.id !== undefined ?
|
3806
|
-
equals: item.alpacaAccount.id
|
3807
|
-
} : undefined,
|
3681
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
3808
3682
|
userId: item.alpacaAccount.userId !== undefined ? {
|
3809
3683
|
equals: item.alpacaAccount.userId
|
3810
3684
|
} : undefined,
|
@@ -3830,9 +3704,7 @@ export const Trade = {
|
|
3830
3704
|
}
|
3831
3705
|
: { connectOrCreate: {
|
3832
3706
|
where: {
|
3833
|
-
id: item.action.id !== undefined ?
|
3834
|
-
equals: item.action.id
|
3835
|
-
} : undefined,
|
3707
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
3836
3708
|
tradeId: item.action.tradeId !== undefined ? {
|
3837
3709
|
equals: item.action.tradeId
|
3838
3710
|
} : undefined,
|
@@ -3852,9 +3724,7 @@ export const Trade = {
|
|
3852
3724
|
positions: props.asset.positions ? {
|
3853
3725
|
upsert: props.asset.positions.map((item) => ({
|
3854
3726
|
where: {
|
3855
|
-
id: item.id !== undefined ?
|
3856
|
-
equals: item.id
|
3857
|
-
} : undefined,
|
3727
|
+
id: item.id !== undefined ? item.id : undefined,
|
3858
3728
|
assetId: item.assetId !== undefined ? {
|
3859
3729
|
equals: item.assetId
|
3860
3730
|
} : undefined,
|
@@ -3983,9 +3853,7 @@ export const Trade = {
|
|
3983
3853
|
}
|
3984
3854
|
: { connectOrCreate: {
|
3985
3855
|
where: {
|
3986
|
-
id: item.alpacaAccount.id !== undefined ?
|
3987
|
-
equals: item.alpacaAccount.id
|
3988
|
-
} : undefined,
|
3856
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
3989
3857
|
userId: item.alpacaAccount.userId !== undefined ? {
|
3990
3858
|
equals: item.alpacaAccount.userId
|
3991
3859
|
} : undefined,
|
@@ -4009,9 +3877,7 @@ export const Trade = {
|
|
4009
3877
|
newsMentions: props.asset.newsMentions ? {
|
4010
3878
|
upsert: props.asset.newsMentions.map((item) => ({
|
4011
3879
|
where: {
|
4012
|
-
id: item.id !== undefined ?
|
4013
|
-
equals: item.id
|
4014
|
-
} : undefined,
|
3880
|
+
id: item.id !== undefined ? item.id : undefined,
|
4015
3881
|
url: item.url !== undefined ? item.url : undefined,
|
4016
3882
|
assetId: item.assetId !== undefined ? {
|
4017
3883
|
equals: item.assetId
|
@@ -4124,9 +3990,7 @@ export const Trade = {
|
|
4124
3990
|
}
|
4125
3991
|
: { connectOrCreate: {
|
4126
3992
|
where: {
|
4127
|
-
id: item.news.id !== undefined ?
|
4128
|
-
equals: item.news.id
|
4129
|
-
} : undefined,
|
3993
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
4130
3994
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
4131
3995
|
title: item.news.title !== undefined ? {
|
4132
3996
|
equals: item.news.title
|
@@ -4217,9 +4081,7 @@ export const Trade = {
|
|
4217
4081
|
}
|
4218
4082
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
4219
4083
|
where: {
|
4220
|
-
id: item.id !== undefined ?
|
4221
|
-
equals: item.id
|
4222
|
-
} : undefined,
|
4084
|
+
id: item.id !== undefined ? item.id : undefined,
|
4223
4085
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4224
4086
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4225
4087
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -4261,9 +4123,7 @@ export const Trade = {
|
|
4261
4123
|
}
|
4262
4124
|
: { connectOrCreate: {
|
4263
4125
|
where: {
|
4264
|
-
id: item.stopLoss.id !== undefined ?
|
4265
|
-
equals: item.stopLoss.id
|
4266
|
-
} : undefined,
|
4126
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
4267
4127
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
4268
4128
|
},
|
4269
4129
|
create: {
|
@@ -4280,9 +4140,7 @@ export const Trade = {
|
|
4280
4140
|
}
|
4281
4141
|
: { connectOrCreate: {
|
4282
4142
|
where: {
|
4283
|
-
id: item.takeProfit.id !== undefined ?
|
4284
|
-
equals: item.takeProfit.id
|
4285
|
-
} : undefined,
|
4143
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
4286
4144
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
4287
4145
|
},
|
4288
4146
|
create: {
|
@@ -4299,9 +4157,7 @@ export const Trade = {
|
|
4299
4157
|
}
|
4300
4158
|
: { connectOrCreate: {
|
4301
4159
|
where: {
|
4302
|
-
id: item.alpacaAccount.id !== undefined ?
|
4303
|
-
equals: item.alpacaAccount.id
|
4304
|
-
} : undefined,
|
4160
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
4305
4161
|
userId: item.alpacaAccount.userId !== undefined ? {
|
4306
4162
|
equals: item.alpacaAccount.userId
|
4307
4163
|
} : undefined,
|
@@ -4327,9 +4183,7 @@ export const Trade = {
|
|
4327
4183
|
}
|
4328
4184
|
: { connectOrCreate: {
|
4329
4185
|
where: {
|
4330
|
-
id: item.action.id !== undefined ?
|
4331
|
-
equals: item.action.id
|
4332
|
-
} : undefined,
|
4186
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
4333
4187
|
tradeId: item.action.tradeId !== undefined ? {
|
4334
4188
|
equals: item.action.tradeId
|
4335
4189
|
} : undefined,
|
@@ -4354,9 +4208,7 @@ export const Trade = {
|
|
4354
4208
|
}
|
4355
4209
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
4356
4210
|
where: {
|
4357
|
-
id: item.id !== undefined ?
|
4358
|
-
equals: item.id
|
4359
|
-
} : undefined,
|
4211
|
+
id: item.id !== undefined ? item.id : undefined,
|
4360
4212
|
assetId: item.assetId !== undefined ? {
|
4361
4213
|
equals: item.assetId
|
4362
4214
|
} : undefined,
|
@@ -4386,9 +4238,7 @@ export const Trade = {
|
|
4386
4238
|
}
|
4387
4239
|
: { connectOrCreate: {
|
4388
4240
|
where: {
|
4389
|
-
id: item.alpacaAccount.id !== undefined ?
|
4390
|
-
equals: item.alpacaAccount.id
|
4391
|
-
} : undefined,
|
4241
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
4392
4242
|
userId: item.alpacaAccount.userId !== undefined ? {
|
4393
4243
|
equals: item.alpacaAccount.userId
|
4394
4244
|
} : undefined,
|
@@ -4417,9 +4267,7 @@ export const Trade = {
|
|
4417
4267
|
}
|
4418
4268
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
4419
4269
|
where: {
|
4420
|
-
id: item.id !== undefined ?
|
4421
|
-
equals: item.id
|
4422
|
-
} : undefined,
|
4270
|
+
id: item.id !== undefined ? item.id : undefined,
|
4423
4271
|
url: item.url !== undefined ? item.url : undefined,
|
4424
4272
|
assetId: item.assetId !== undefined ? {
|
4425
4273
|
equals: item.assetId
|
@@ -4441,9 +4289,7 @@ export const Trade = {
|
|
4441
4289
|
}
|
4442
4290
|
: { connectOrCreate: {
|
4443
4291
|
where: {
|
4444
|
-
id: item.news.id !== undefined ?
|
4445
|
-
equals: item.news.id
|
4446
|
-
} : undefined,
|
4292
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
4447
4293
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
4448
4294
|
title: item.news.title !== undefined ? {
|
4449
4295
|
equals: item.news.title
|
@@ -4475,9 +4321,7 @@ export const Trade = {
|
|
4475
4321
|
actions: props.actions ? {
|
4476
4322
|
upsert: props.actions.map((item) => ({
|
4477
4323
|
where: {
|
4478
|
-
id: item.id !== undefined ?
|
4479
|
-
equals: item.id
|
4480
|
-
} : undefined,
|
4324
|
+
id: item.id !== undefined ? item.id : undefined,
|
4481
4325
|
tradeId: item.tradeId !== undefined ? {
|
4482
4326
|
equals: item.tradeId
|
4483
4327
|
} : undefined,
|
@@ -4973,9 +4817,7 @@ export const Trade = {
|
|
4973
4817
|
}
|
4974
4818
|
: { connectOrCreate: {
|
4975
4819
|
where: {
|
4976
|
-
id: item.order.stopLoss.id !== undefined ?
|
4977
|
-
equals: item.order.stopLoss.id
|
4978
|
-
} : undefined,
|
4820
|
+
id: item.order.stopLoss.id !== undefined ? item.order.stopLoss.id : undefined,
|
4979
4821
|
orderId: item.order.stopLoss.orderId !== undefined ? item.order.stopLoss.orderId : undefined,
|
4980
4822
|
},
|
4981
4823
|
create: {
|
@@ -4992,9 +4834,7 @@ export const Trade = {
|
|
4992
4834
|
}
|
4993
4835
|
: { connectOrCreate: {
|
4994
4836
|
where: {
|
4995
|
-
id: item.order.takeProfit.id !== undefined ?
|
4996
|
-
equals: item.order.takeProfit.id
|
4997
|
-
} : undefined,
|
4837
|
+
id: item.order.takeProfit.id !== undefined ? item.order.takeProfit.id : undefined,
|
4998
4838
|
orderId: item.order.takeProfit.orderId !== undefined ? item.order.takeProfit.orderId : undefined,
|
4999
4839
|
},
|
5000
4840
|
create: {
|
@@ -5011,9 +4851,7 @@ export const Trade = {
|
|
5011
4851
|
}
|
5012
4852
|
: { connectOrCreate: {
|
5013
4853
|
where: {
|
5014
|
-
id: item.order.alpacaAccount.id !== undefined ?
|
5015
|
-
equals: item.order.alpacaAccount.id
|
5016
|
-
} : undefined,
|
4854
|
+
id: item.order.alpacaAccount.id !== undefined ? item.order.alpacaAccount.id : undefined,
|
5017
4855
|
userId: item.order.alpacaAccount.userId !== undefined ? {
|
5018
4856
|
equals: item.order.alpacaAccount.userId
|
5019
4857
|
} : undefined,
|
@@ -5039,9 +4877,7 @@ export const Trade = {
|
|
5039
4877
|
}
|
5040
4878
|
: { connectOrCreate: {
|
5041
4879
|
where: {
|
5042
|
-
id: item.order.asset.id !== undefined ?
|
5043
|
-
equals: item.order.asset.id
|
5044
|
-
} : undefined,
|
4880
|
+
id: item.order.asset.id !== undefined ? item.order.asset.id : undefined,
|
5045
4881
|
symbol: item.order.asset.symbol !== undefined ? item.order.asset.symbol : undefined,
|
5046
4882
|
name: item.order.asset.name !== undefined ? item.order.asset.name : undefined,
|
5047
4883
|
},
|
@@ -5122,9 +4958,7 @@ export const Trade = {
|
|
5122
4958
|
}
|
5123
4959
|
: { connectOrCreate: {
|
5124
4960
|
where: {
|
5125
|
-
id: item.order.id !== undefined ?
|
5126
|
-
equals: item.order.id
|
5127
|
-
} : undefined,
|
4961
|
+
id: item.order.id !== undefined ? item.order.id : undefined,
|
5128
4962
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
5129
4963
|
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
5130
4964
|
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
@@ -5166,9 +5000,7 @@ export const Trade = {
|
|
5166
5000
|
}
|
5167
5001
|
: { connectOrCreate: {
|
5168
5002
|
where: {
|
5169
|
-
id: item.order.stopLoss.id !== undefined ?
|
5170
|
-
equals: item.order.stopLoss.id
|
5171
|
-
} : undefined,
|
5003
|
+
id: item.order.stopLoss.id !== undefined ? item.order.stopLoss.id : undefined,
|
5172
5004
|
orderId: item.order.stopLoss.orderId !== undefined ? item.order.stopLoss.orderId : undefined,
|
5173
5005
|
},
|
5174
5006
|
create: {
|
@@ -5185,9 +5017,7 @@ export const Trade = {
|
|
5185
5017
|
}
|
5186
5018
|
: { connectOrCreate: {
|
5187
5019
|
where: {
|
5188
|
-
id: item.order.takeProfit.id !== undefined ?
|
5189
|
-
equals: item.order.takeProfit.id
|
5190
|
-
} : undefined,
|
5020
|
+
id: item.order.takeProfit.id !== undefined ? item.order.takeProfit.id : undefined,
|
5191
5021
|
orderId: item.order.takeProfit.orderId !== undefined ? item.order.takeProfit.orderId : undefined,
|
5192
5022
|
},
|
5193
5023
|
create: {
|
@@ -5204,9 +5034,7 @@ export const Trade = {
|
|
5204
5034
|
}
|
5205
5035
|
: { connectOrCreate: {
|
5206
5036
|
where: {
|
5207
|
-
id: item.order.alpacaAccount.id !== undefined ?
|
5208
|
-
equals: item.order.alpacaAccount.id
|
5209
|
-
} : undefined,
|
5037
|
+
id: item.order.alpacaAccount.id !== undefined ? item.order.alpacaAccount.id : undefined,
|
5210
5038
|
userId: item.order.alpacaAccount.userId !== undefined ? {
|
5211
5039
|
equals: item.order.alpacaAccount.userId
|
5212
5040
|
} : undefined,
|
@@ -5232,9 +5060,7 @@ export const Trade = {
|
|
5232
5060
|
}
|
5233
5061
|
: { connectOrCreate: {
|
5234
5062
|
where: {
|
5235
|
-
id: item.order.asset.id !== undefined ?
|
5236
|
-
equals: item.order.asset.id
|
5237
|
-
} : undefined,
|
5063
|
+
id: item.order.asset.id !== undefined ? item.order.asset.id : undefined,
|
5238
5064
|
symbol: item.order.asset.symbol !== undefined ? item.order.asset.symbol : undefined,
|
5239
5065
|
name: item.order.asset.name !== undefined ? item.order.asset.name : undefined,
|
5240
5066
|
},
|
@@ -5337,9 +5163,7 @@ export const Trade = {
|
|
5337
5163
|
}`;
|
5338
5164
|
const variables = props.map(prop => ({
|
5339
5165
|
where: {
|
5340
|
-
id: prop.id !== undefined ?
|
5341
|
-
equals: prop.id
|
5342
|
-
} : undefined,
|
5166
|
+
id: prop.id !== undefined ? prop.id : undefined,
|
5343
5167
|
alpacaAccountId: prop.alpacaAccountId !== undefined ? {
|
5344
5168
|
equals: prop.alpacaAccountId
|
5345
5169
|
} : undefined,
|
@@ -5553,9 +5377,7 @@ export const Trade = {
|
|
5553
5377
|
accounts: prop.alpacaAccount.user.accounts ? {
|
5554
5378
|
upsert: prop.alpacaAccount.user.accounts.map((item) => ({
|
5555
5379
|
where: {
|
5556
|
-
id: item.id !== undefined ?
|
5557
|
-
equals: item.id
|
5558
|
-
} : undefined,
|
5380
|
+
id: item.id !== undefined ? item.id : undefined,
|
5559
5381
|
userId: item.userId !== undefined ? {
|
5560
5382
|
equals: item.userId
|
5561
5383
|
} : undefined,
|
@@ -5615,9 +5437,7 @@ export const Trade = {
|
|
5615
5437
|
sessions: prop.alpacaAccount.user.sessions ? {
|
5616
5438
|
upsert: prop.alpacaAccount.user.sessions.map((item) => ({
|
5617
5439
|
where: {
|
5618
|
-
id: item.id !== undefined ?
|
5619
|
-
equals: item.id
|
5620
|
-
} : undefined,
|
5440
|
+
id: item.id !== undefined ? item.id : undefined,
|
5621
5441
|
userId: item.userId !== undefined ? {
|
5622
5442
|
equals: item.userId
|
5623
5443
|
} : undefined,
|
@@ -5642,9 +5462,7 @@ export const Trade = {
|
|
5642
5462
|
authenticators: prop.alpacaAccount.user.authenticators ? {
|
5643
5463
|
upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5644
5464
|
where: {
|
5645
|
-
id: item.id !== undefined ?
|
5646
|
-
equals: item.id
|
5647
|
-
} : undefined,
|
5465
|
+
id: item.id !== undefined ? item.id : undefined,
|
5648
5466
|
userId: item.userId !== undefined ? {
|
5649
5467
|
equals: item.userId
|
5650
5468
|
} : undefined,
|
@@ -5691,9 +5509,7 @@ export const Trade = {
|
|
5691
5509
|
}
|
5692
5510
|
: { connectOrCreate: {
|
5693
5511
|
where: {
|
5694
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
5695
|
-
equals: prop.alpacaAccount.user.customer.id
|
5696
|
-
} : undefined,
|
5512
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
|
5697
5513
|
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
5698
5514
|
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
5699
5515
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -5725,9 +5541,7 @@ export const Trade = {
|
|
5725
5541
|
}
|
5726
5542
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
5727
5543
|
where: {
|
5728
|
-
id: item.id !== undefined ?
|
5729
|
-
equals: item.id
|
5730
|
-
} : undefined,
|
5544
|
+
id: item.id !== undefined ? item.id : undefined,
|
5731
5545
|
userId: item.userId !== undefined ? {
|
5732
5546
|
equals: item.userId
|
5733
5547
|
} : undefined,
|
@@ -5757,9 +5571,7 @@ export const Trade = {
|
|
5757
5571
|
}
|
5758
5572
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
5759
5573
|
where: {
|
5760
|
-
id: item.id !== undefined ?
|
5761
|
-
equals: item.id
|
5762
|
-
} : undefined,
|
5574
|
+
id: item.id !== undefined ? item.id : undefined,
|
5763
5575
|
userId: item.userId !== undefined ? {
|
5764
5576
|
equals: item.userId
|
5765
5577
|
} : undefined,
|
@@ -5778,9 +5590,7 @@ export const Trade = {
|
|
5778
5590
|
}
|
5779
5591
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5780
5592
|
where: {
|
5781
|
-
id: item.id !== undefined ?
|
5782
|
-
equals: item.id
|
5783
|
-
} : undefined,
|
5593
|
+
id: item.id !== undefined ? item.id : undefined,
|
5784
5594
|
userId: item.userId !== undefined ? {
|
5785
5595
|
equals: item.userId
|
5786
5596
|
} : undefined,
|
@@ -5798,9 +5608,7 @@ export const Trade = {
|
|
5798
5608
|
orders: prop.alpacaAccount.orders ? {
|
5799
5609
|
upsert: prop.alpacaAccount.orders.map((item) => ({
|
5800
5610
|
where: {
|
5801
|
-
id: item.id !== undefined ?
|
5802
|
-
equals: item.id
|
5803
|
-
} : undefined,
|
5611
|
+
id: item.id !== undefined ? item.id : undefined,
|
5804
5612
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5805
5613
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5806
5614
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -6248,9 +6056,7 @@ export const Trade = {
|
|
6248
6056
|
}
|
6249
6057
|
: { connectOrCreate: {
|
6250
6058
|
where: {
|
6251
|
-
id: item.stopLoss.id !== undefined ?
|
6252
|
-
equals: item.stopLoss.id
|
6253
|
-
} : undefined,
|
6059
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
6254
6060
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
6255
6061
|
},
|
6256
6062
|
create: {
|
@@ -6267,9 +6073,7 @@ export const Trade = {
|
|
6267
6073
|
}
|
6268
6074
|
: { connectOrCreate: {
|
6269
6075
|
where: {
|
6270
|
-
id: item.takeProfit.id !== undefined ?
|
6271
|
-
equals: item.takeProfit.id
|
6272
|
-
} : undefined,
|
6076
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
6273
6077
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
6274
6078
|
},
|
6275
6079
|
create: {
|
@@ -6286,9 +6090,7 @@ export const Trade = {
|
|
6286
6090
|
}
|
6287
6091
|
: { connectOrCreate: {
|
6288
6092
|
where: {
|
6289
|
-
id: item.action.id !== undefined ?
|
6290
|
-
equals: item.action.id
|
6291
|
-
} : undefined,
|
6093
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
6292
6094
|
tradeId: item.action.tradeId !== undefined ? {
|
6293
6095
|
equals: item.action.tradeId
|
6294
6096
|
} : undefined,
|
@@ -6310,9 +6112,7 @@ export const Trade = {
|
|
6310
6112
|
}
|
6311
6113
|
: { connectOrCreate: {
|
6312
6114
|
where: {
|
6313
|
-
id: item.asset.id !== undefined ?
|
6314
|
-
equals: item.asset.id
|
6315
|
-
} : undefined,
|
6115
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
6316
6116
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6317
6117
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6318
6118
|
},
|
@@ -6381,9 +6181,7 @@ export const Trade = {
|
|
6381
6181
|
positions: prop.alpacaAccount.positions ? {
|
6382
6182
|
upsert: prop.alpacaAccount.positions.map((item) => ({
|
6383
6183
|
where: {
|
6384
|
-
id: item.id !== undefined ?
|
6385
|
-
equals: item.id
|
6386
|
-
} : undefined,
|
6184
|
+
id: item.id !== undefined ? item.id : undefined,
|
6387
6185
|
assetId: item.assetId !== undefined ? {
|
6388
6186
|
equals: item.assetId
|
6389
6187
|
} : undefined,
|
@@ -6699,9 +6497,7 @@ export const Trade = {
|
|
6699
6497
|
}
|
6700
6498
|
: { connectOrCreate: {
|
6701
6499
|
where: {
|
6702
|
-
id: item.asset.id !== undefined ?
|
6703
|
-
equals: item.asset.id
|
6704
|
-
} : undefined,
|
6500
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
6705
6501
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6706
6502
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6707
6503
|
},
|
@@ -6770,9 +6566,7 @@ export const Trade = {
|
|
6770
6566
|
alerts: prop.alpacaAccount.alerts ? {
|
6771
6567
|
upsert: prop.alpacaAccount.alerts.map((item) => ({
|
6772
6568
|
where: {
|
6773
|
-
id: item.id !== undefined ?
|
6774
|
-
equals: item.id
|
6775
|
-
} : undefined,
|
6569
|
+
id: item.id !== undefined ? item.id : undefined,
|
6776
6570
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6777
6571
|
equals: item.alpacaAccountId
|
6778
6572
|
} : undefined,
|
@@ -6817,9 +6611,7 @@ export const Trade = {
|
|
6817
6611
|
}
|
6818
6612
|
: { connectOrCreate: {
|
6819
6613
|
where: {
|
6820
|
-
id: prop.alpacaAccount.user.id !== undefined ?
|
6821
|
-
equals: prop.alpacaAccount.user.id
|
6822
|
-
} : undefined,
|
6614
|
+
id: prop.alpacaAccount.user.id !== undefined ? prop.alpacaAccount.user.id : undefined,
|
6823
6615
|
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
6824
6616
|
name: prop.alpacaAccount.user.name !== undefined ? {
|
6825
6617
|
equals: prop.alpacaAccount.user.name
|
@@ -6845,9 +6637,7 @@ export const Trade = {
|
|
6845
6637
|
}
|
6846
6638
|
: { connectOrCreate: {
|
6847
6639
|
where: {
|
6848
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
6849
|
-
equals: prop.alpacaAccount.user.customer.id
|
6850
|
-
} : undefined,
|
6640
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
|
6851
6641
|
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
6852
6642
|
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
6853
6643
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -6879,9 +6669,7 @@ export const Trade = {
|
|
6879
6669
|
}
|
6880
6670
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
6881
6671
|
where: {
|
6882
|
-
id: item.id !== undefined ?
|
6883
|
-
equals: item.id
|
6884
|
-
} : undefined,
|
6672
|
+
id: item.id !== undefined ? item.id : undefined,
|
6885
6673
|
userId: item.userId !== undefined ? {
|
6886
6674
|
equals: item.userId
|
6887
6675
|
} : undefined,
|
@@ -6911,9 +6699,7 @@ export const Trade = {
|
|
6911
6699
|
}
|
6912
6700
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
6913
6701
|
where: {
|
6914
|
-
id: item.id !== undefined ?
|
6915
|
-
equals: item.id
|
6916
|
-
} : undefined,
|
6702
|
+
id: item.id !== undefined ? item.id : undefined,
|
6917
6703
|
userId: item.userId !== undefined ? {
|
6918
6704
|
equals: item.userId
|
6919
6705
|
} : undefined,
|
@@ -6932,9 +6718,7 @@ export const Trade = {
|
|
6932
6718
|
}
|
6933
6719
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
6934
6720
|
where: {
|
6935
|
-
id: item.id !== undefined ?
|
6936
|
-
equals: item.id
|
6937
|
-
} : undefined,
|
6721
|
+
id: item.id !== undefined ? item.id : undefined,
|
6938
6722
|
userId: item.userId !== undefined ? {
|
6939
6723
|
equals: item.userId
|
6940
6724
|
} : undefined,
|
@@ -6957,9 +6741,7 @@ export const Trade = {
|
|
6957
6741
|
}
|
6958
6742
|
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
6959
6743
|
where: {
|
6960
|
-
id: item.id !== undefined ?
|
6961
|
-
equals: item.id
|
6962
|
-
} : undefined,
|
6744
|
+
id: item.id !== undefined ? item.id : undefined,
|
6963
6745
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6964
6746
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6965
6747
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -7001,9 +6783,7 @@ export const Trade = {
|
|
7001
6783
|
}
|
7002
6784
|
: { connectOrCreate: {
|
7003
6785
|
where: {
|
7004
|
-
id: item.stopLoss.id !== undefined ?
|
7005
|
-
equals: item.stopLoss.id
|
7006
|
-
} : undefined,
|
6786
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7007
6787
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
7008
6788
|
},
|
7009
6789
|
create: {
|
@@ -7020,9 +6800,7 @@ export const Trade = {
|
|
7020
6800
|
}
|
7021
6801
|
: { connectOrCreate: {
|
7022
6802
|
where: {
|
7023
|
-
id: item.takeProfit.id !== undefined ?
|
7024
|
-
equals: item.takeProfit.id
|
7025
|
-
} : undefined,
|
6803
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7026
6804
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
7027
6805
|
},
|
7028
6806
|
create: {
|
@@ -7039,9 +6817,7 @@ export const Trade = {
|
|
7039
6817
|
}
|
7040
6818
|
: { connectOrCreate: {
|
7041
6819
|
where: {
|
7042
|
-
id: item.action.id !== undefined ?
|
7043
|
-
equals: item.action.id
|
7044
|
-
} : undefined,
|
6820
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
7045
6821
|
tradeId: item.action.tradeId !== undefined ? {
|
7046
6822
|
equals: item.action.tradeId
|
7047
6823
|
} : undefined,
|
@@ -7063,9 +6839,7 @@ export const Trade = {
|
|
7063
6839
|
}
|
7064
6840
|
: { connectOrCreate: {
|
7065
6841
|
where: {
|
7066
|
-
id: item.asset.id !== undefined ?
|
7067
|
-
equals: item.asset.id
|
7068
|
-
} : undefined,
|
6842
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7069
6843
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7070
6844
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7071
6845
|
},
|
@@ -7139,9 +6913,7 @@ export const Trade = {
|
|
7139
6913
|
}
|
7140
6914
|
: { connectOrCreate: prop.alpacaAccount.positions.map((item) => ({
|
7141
6915
|
where: {
|
7142
|
-
id: item.id !== undefined ?
|
7143
|
-
equals: item.id
|
7144
|
-
} : undefined,
|
6916
|
+
id: item.id !== undefined ? item.id : undefined,
|
7145
6917
|
assetId: item.assetId !== undefined ? {
|
7146
6918
|
equals: item.assetId
|
7147
6919
|
} : undefined,
|
@@ -7171,9 +6943,7 @@ export const Trade = {
|
|
7171
6943
|
}
|
7172
6944
|
: { connectOrCreate: {
|
7173
6945
|
where: {
|
7174
|
-
id: item.asset.id !== undefined ?
|
7175
|
-
equals: item.asset.id
|
7176
|
-
} : undefined,
|
6946
|
+
id: item.asset.id !== undefined ? item.asset.id : undefined,
|
7177
6947
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
7178
6948
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
7179
6949
|
},
|
@@ -7247,9 +7017,7 @@ export const Trade = {
|
|
7247
7017
|
}
|
7248
7018
|
: { connectOrCreate: prop.alpacaAccount.alerts.map((item) => ({
|
7249
7019
|
where: {
|
7250
|
-
id: item.id !== undefined ?
|
7251
|
-
equals: item.id
|
7252
|
-
} : undefined,
|
7020
|
+
id: item.id !== undefined ? item.id : undefined,
|
7253
7021
|
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7254
7022
|
equals: item.alpacaAccountId
|
7255
7023
|
} : undefined,
|
@@ -7449,9 +7217,7 @@ export const Trade = {
|
|
7449
7217
|
orders: prop.asset.orders ? {
|
7450
7218
|
upsert: prop.asset.orders.map((item) => ({
|
7451
7219
|
where: {
|
7452
|
-
id: item.id !== undefined ?
|
7453
|
-
equals: item.id
|
7454
|
-
} : undefined,
|
7220
|
+
id: item.id !== undefined ? item.id : undefined,
|
7455
7221
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7456
7222
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7457
7223
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -7712,9 +7478,7 @@ export const Trade = {
|
|
7712
7478
|
}
|
7713
7479
|
: { connectOrCreate: {
|
7714
7480
|
where: {
|
7715
|
-
id: item.stopLoss.id !== undefined ?
|
7716
|
-
equals: item.stopLoss.id
|
7717
|
-
} : undefined,
|
7481
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7718
7482
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
7719
7483
|
},
|
7720
7484
|
create: {
|
@@ -7731,9 +7495,7 @@ export const Trade = {
|
|
7731
7495
|
}
|
7732
7496
|
: { connectOrCreate: {
|
7733
7497
|
where: {
|
7734
|
-
id: item.takeProfit.id !== undefined ?
|
7735
|
-
equals: item.takeProfit.id
|
7736
|
-
} : undefined,
|
7498
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7737
7499
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
7738
7500
|
},
|
7739
7501
|
create: {
|
@@ -7750,9 +7512,7 @@ export const Trade = {
|
|
7750
7512
|
}
|
7751
7513
|
: { connectOrCreate: {
|
7752
7514
|
where: {
|
7753
|
-
id: item.alpacaAccount.id !== undefined ?
|
7754
|
-
equals: item.alpacaAccount.id
|
7755
|
-
} : undefined,
|
7515
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
7756
7516
|
userId: item.alpacaAccount.userId !== undefined ? {
|
7757
7517
|
equals: item.alpacaAccount.userId
|
7758
7518
|
} : undefined,
|
@@ -7778,9 +7538,7 @@ export const Trade = {
|
|
7778
7538
|
}
|
7779
7539
|
: { connectOrCreate: {
|
7780
7540
|
where: {
|
7781
|
-
id: item.action.id !== undefined ?
|
7782
|
-
equals: item.action.id
|
7783
|
-
} : undefined,
|
7541
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
7784
7542
|
tradeId: item.action.tradeId !== undefined ? {
|
7785
7543
|
equals: item.action.tradeId
|
7786
7544
|
} : undefined,
|
@@ -7800,9 +7558,7 @@ export const Trade = {
|
|
7800
7558
|
positions: prop.asset.positions ? {
|
7801
7559
|
upsert: prop.asset.positions.map((item) => ({
|
7802
7560
|
where: {
|
7803
|
-
id: item.id !== undefined ?
|
7804
|
-
equals: item.id
|
7805
|
-
} : undefined,
|
7561
|
+
id: item.id !== undefined ? item.id : undefined,
|
7806
7562
|
assetId: item.assetId !== undefined ? {
|
7807
7563
|
equals: item.assetId
|
7808
7564
|
} : undefined,
|
@@ -7931,9 +7687,7 @@ export const Trade = {
|
|
7931
7687
|
}
|
7932
7688
|
: { connectOrCreate: {
|
7933
7689
|
where: {
|
7934
|
-
id: item.alpacaAccount.id !== undefined ?
|
7935
|
-
equals: item.alpacaAccount.id
|
7936
|
-
} : undefined,
|
7690
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
7937
7691
|
userId: item.alpacaAccount.userId !== undefined ? {
|
7938
7692
|
equals: item.alpacaAccount.userId
|
7939
7693
|
} : undefined,
|
@@ -7957,9 +7711,7 @@ export const Trade = {
|
|
7957
7711
|
newsMentions: prop.asset.newsMentions ? {
|
7958
7712
|
upsert: prop.asset.newsMentions.map((item) => ({
|
7959
7713
|
where: {
|
7960
|
-
id: item.id !== undefined ?
|
7961
|
-
equals: item.id
|
7962
|
-
} : undefined,
|
7714
|
+
id: item.id !== undefined ? item.id : undefined,
|
7963
7715
|
url: item.url !== undefined ? item.url : undefined,
|
7964
7716
|
assetId: item.assetId !== undefined ? {
|
7965
7717
|
equals: item.assetId
|
@@ -8072,9 +7824,7 @@ export const Trade = {
|
|
8072
7824
|
}
|
8073
7825
|
: { connectOrCreate: {
|
8074
7826
|
where: {
|
8075
|
-
id: item.news.id !== undefined ?
|
8076
|
-
equals: item.news.id
|
8077
|
-
} : undefined,
|
7827
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
8078
7828
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
8079
7829
|
title: item.news.title !== undefined ? {
|
8080
7830
|
equals: item.news.title
|
@@ -8165,9 +7915,7 @@ export const Trade = {
|
|
8165
7915
|
}
|
8166
7916
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
8167
7917
|
where: {
|
8168
|
-
id: item.id !== undefined ?
|
8169
|
-
equals: item.id
|
8170
|
-
} : undefined,
|
7918
|
+
id: item.id !== undefined ? item.id : undefined,
|
8171
7919
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
8172
7920
|
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
8173
7921
|
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
@@ -8209,9 +7957,7 @@ export const Trade = {
|
|
8209
7957
|
}
|
8210
7958
|
: { connectOrCreate: {
|
8211
7959
|
where: {
|
8212
|
-
id: item.stopLoss.id !== undefined ?
|
8213
|
-
equals: item.stopLoss.id
|
8214
|
-
} : undefined,
|
7960
|
+
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
8215
7961
|
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
8216
7962
|
},
|
8217
7963
|
create: {
|
@@ -8228,9 +7974,7 @@ export const Trade = {
|
|
8228
7974
|
}
|
8229
7975
|
: { connectOrCreate: {
|
8230
7976
|
where: {
|
8231
|
-
id: item.takeProfit.id !== undefined ?
|
8232
|
-
equals: item.takeProfit.id
|
8233
|
-
} : undefined,
|
7977
|
+
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
8234
7978
|
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
8235
7979
|
},
|
8236
7980
|
create: {
|
@@ -8247,9 +7991,7 @@ export const Trade = {
|
|
8247
7991
|
}
|
8248
7992
|
: { connectOrCreate: {
|
8249
7993
|
where: {
|
8250
|
-
id: item.alpacaAccount.id !== undefined ?
|
8251
|
-
equals: item.alpacaAccount.id
|
8252
|
-
} : undefined,
|
7994
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
8253
7995
|
userId: item.alpacaAccount.userId !== undefined ? {
|
8254
7996
|
equals: item.alpacaAccount.userId
|
8255
7997
|
} : undefined,
|
@@ -8275,9 +8017,7 @@ export const Trade = {
|
|
8275
8017
|
}
|
8276
8018
|
: { connectOrCreate: {
|
8277
8019
|
where: {
|
8278
|
-
id: item.action.id !== undefined ?
|
8279
|
-
equals: item.action.id
|
8280
|
-
} : undefined,
|
8020
|
+
id: item.action.id !== undefined ? item.action.id : undefined,
|
8281
8021
|
tradeId: item.action.tradeId !== undefined ? {
|
8282
8022
|
equals: item.action.tradeId
|
8283
8023
|
} : undefined,
|
@@ -8302,9 +8042,7 @@ export const Trade = {
|
|
8302
8042
|
}
|
8303
8043
|
: { connectOrCreate: prop.asset.positions.map((item) => ({
|
8304
8044
|
where: {
|
8305
|
-
id: item.id !== undefined ?
|
8306
|
-
equals: item.id
|
8307
|
-
} : undefined,
|
8045
|
+
id: item.id !== undefined ? item.id : undefined,
|
8308
8046
|
assetId: item.assetId !== undefined ? {
|
8309
8047
|
equals: item.assetId
|
8310
8048
|
} : undefined,
|
@@ -8334,9 +8072,7 @@ export const Trade = {
|
|
8334
8072
|
}
|
8335
8073
|
: { connectOrCreate: {
|
8336
8074
|
where: {
|
8337
|
-
id: item.alpacaAccount.id !== undefined ?
|
8338
|
-
equals: item.alpacaAccount.id
|
8339
|
-
} : undefined,
|
8075
|
+
id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
|
8340
8076
|
userId: item.alpacaAccount.userId !== undefined ? {
|
8341
8077
|
equals: item.alpacaAccount.userId
|
8342
8078
|
} : undefined,
|
@@ -8365,9 +8101,7 @@ export const Trade = {
|
|
8365
8101
|
}
|
8366
8102
|
: { connectOrCreate: prop.asset.newsMentions.map((item) => ({
|
8367
8103
|
where: {
|
8368
|
-
id: item.id !== undefined ?
|
8369
|
-
equals: item.id
|
8370
|
-
} : undefined,
|
8104
|
+
id: item.id !== undefined ? item.id : undefined,
|
8371
8105
|
url: item.url !== undefined ? item.url : undefined,
|
8372
8106
|
assetId: item.assetId !== undefined ? {
|
8373
8107
|
equals: item.assetId
|
@@ -8389,9 +8123,7 @@ export const Trade = {
|
|
8389
8123
|
}
|
8390
8124
|
: { connectOrCreate: {
|
8391
8125
|
where: {
|
8392
|
-
id: item.news.id !== undefined ?
|
8393
|
-
equals: item.news.id
|
8394
|
-
} : undefined,
|
8126
|
+
id: item.news.id !== undefined ? item.news.id : undefined,
|
8395
8127
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
8396
8128
|
title: item.news.title !== undefined ? {
|
8397
8129
|
equals: item.news.title
|
@@ -8423,9 +8155,7 @@ export const Trade = {
|
|
8423
8155
|
actions: prop.actions ? {
|
8424
8156
|
upsert: prop.actions.map((item) => ({
|
8425
8157
|
where: {
|
8426
|
-
id: item.id !== undefined ?
|
8427
|
-
equals: item.id
|
8428
|
-
} : undefined,
|
8158
|
+
id: item.id !== undefined ? item.id : undefined,
|
8429
8159
|
tradeId: item.tradeId !== undefined ? {
|
8430
8160
|
equals: item.tradeId
|
8431
8161
|
} : undefined,
|
@@ -8921,9 +8651,7 @@ export const Trade = {
|
|
8921
8651
|
}
|
8922
8652
|
: { connectOrCreate: {
|
8923
8653
|
where: {
|
8924
|
-
id: item.order.stopLoss.id !== undefined ?
|
8925
|
-
equals: item.order.stopLoss.id
|
8926
|
-
} : undefined,
|
8654
|
+
id: item.order.stopLoss.id !== undefined ? item.order.stopLoss.id : undefined,
|
8927
8655
|
orderId: item.order.stopLoss.orderId !== undefined ? item.order.stopLoss.orderId : undefined,
|
8928
8656
|
},
|
8929
8657
|
create: {
|
@@ -8940,9 +8668,7 @@ export const Trade = {
|
|
8940
8668
|
}
|
8941
8669
|
: { connectOrCreate: {
|
8942
8670
|
where: {
|
8943
|
-
id: item.order.takeProfit.id !== undefined ?
|
8944
|
-
equals: item.order.takeProfit.id
|
8945
|
-
} : undefined,
|
8671
|
+
id: item.order.takeProfit.id !== undefined ? item.order.takeProfit.id : undefined,
|
8946
8672
|
orderId: item.order.takeProfit.orderId !== undefined ? item.order.takeProfit.orderId : undefined,
|
8947
8673
|
},
|
8948
8674
|
create: {
|
@@ -8959,9 +8685,7 @@ export const Trade = {
|
|
8959
8685
|
}
|
8960
8686
|
: { connectOrCreate: {
|
8961
8687
|
where: {
|
8962
|
-
id: item.order.alpacaAccount.id !== undefined ?
|
8963
|
-
equals: item.order.alpacaAccount.id
|
8964
|
-
} : undefined,
|
8688
|
+
id: item.order.alpacaAccount.id !== undefined ? item.order.alpacaAccount.id : undefined,
|
8965
8689
|
userId: item.order.alpacaAccount.userId !== undefined ? {
|
8966
8690
|
equals: item.order.alpacaAccount.userId
|
8967
8691
|
} : undefined,
|
@@ -8987,9 +8711,7 @@ export const Trade = {
|
|
8987
8711
|
}
|
8988
8712
|
: { connectOrCreate: {
|
8989
8713
|
where: {
|
8990
|
-
id: item.order.asset.id !== undefined ?
|
8991
|
-
equals: item.order.asset.id
|
8992
|
-
} : undefined,
|
8714
|
+
id: item.order.asset.id !== undefined ? item.order.asset.id : undefined,
|
8993
8715
|
symbol: item.order.asset.symbol !== undefined ? item.order.asset.symbol : undefined,
|
8994
8716
|
name: item.order.asset.name !== undefined ? item.order.asset.name : undefined,
|
8995
8717
|
},
|
@@ -9070,9 +8792,7 @@ export const Trade = {
|
|
9070
8792
|
}
|
9071
8793
|
: { connectOrCreate: {
|
9072
8794
|
where: {
|
9073
|
-
id: item.order.id !== undefined ?
|
9074
|
-
equals: item.order.id
|
9075
|
-
} : undefined,
|
8795
|
+
id: item.order.id !== undefined ? item.order.id : undefined,
|
9076
8796
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
9077
8797
|
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
9078
8798
|
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
@@ -9114,9 +8834,7 @@ export const Trade = {
|
|
9114
8834
|
}
|
9115
8835
|
: { connectOrCreate: {
|
9116
8836
|
where: {
|
9117
|
-
id: item.order.stopLoss.id !== undefined ?
|
9118
|
-
equals: item.order.stopLoss.id
|
9119
|
-
} : undefined,
|
8837
|
+
id: item.order.stopLoss.id !== undefined ? item.order.stopLoss.id : undefined,
|
9120
8838
|
orderId: item.order.stopLoss.orderId !== undefined ? item.order.stopLoss.orderId : undefined,
|
9121
8839
|
},
|
9122
8840
|
create: {
|
@@ -9133,9 +8851,7 @@ export const Trade = {
|
|
9133
8851
|
}
|
9134
8852
|
: { connectOrCreate: {
|
9135
8853
|
where: {
|
9136
|
-
id: item.order.takeProfit.id !== undefined ?
|
9137
|
-
equals: item.order.takeProfit.id
|
9138
|
-
} : undefined,
|
8854
|
+
id: item.order.takeProfit.id !== undefined ? item.order.takeProfit.id : undefined,
|
9139
8855
|
orderId: item.order.takeProfit.orderId !== undefined ? item.order.takeProfit.orderId : undefined,
|
9140
8856
|
},
|
9141
8857
|
create: {
|
@@ -9152,9 +8868,7 @@ export const Trade = {
|
|
9152
8868
|
}
|
9153
8869
|
: { connectOrCreate: {
|
9154
8870
|
where: {
|
9155
|
-
id: item.order.alpacaAccount.id !== undefined ?
|
9156
|
-
equals: item.order.alpacaAccount.id
|
9157
|
-
} : undefined,
|
8871
|
+
id: item.order.alpacaAccount.id !== undefined ? item.order.alpacaAccount.id : undefined,
|
9158
8872
|
userId: item.order.alpacaAccount.userId !== undefined ? {
|
9159
8873
|
equals: item.order.alpacaAccount.userId
|
9160
8874
|
} : undefined,
|
@@ -9180,9 +8894,7 @@ export const Trade = {
|
|
9180
8894
|
}
|
9181
8895
|
: { connectOrCreate: {
|
9182
8896
|
where: {
|
9183
|
-
id: item.order.asset.id !== undefined ?
|
9184
|
-
equals: item.order.asset.id
|
9185
|
-
} : undefined,
|
8897
|
+
id: item.order.asset.id !== undefined ? item.order.asset.id : undefined,
|
9186
8898
|
symbol: item.order.asset.symbol !== undefined ? item.order.asset.symbol : undefined,
|
9187
8899
|
name: item.order.asset.name !== undefined ? item.order.asset.name : undefined,
|
9188
8900
|
},
|
@@ -9320,9 +9032,7 @@ export const Trade = {
|
|
9320
9032
|
}`;
|
9321
9033
|
const variables = {
|
9322
9034
|
where: {
|
9323
|
-
id: props.id !== undefined ?
|
9324
|
-
equals: props.id
|
9325
|
-
} : undefined,
|
9035
|
+
id: props.id !== undefined ? props.id : undefined,
|
9326
9036
|
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
9327
9037
|
equals: props.alpacaAccountId
|
9328
9038
|
} : undefined,
|