adaptic-backend 1.0.159 → 1.0.160
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 +435 -58
- package/Action.cjs +966 -121
- package/Alert.cjs +593 -89
- package/AlpacaAccount.cjs +1161 -134
- package/Asset.cjs +1029 -129
- package/Authenticator.cjs +438 -54
- package/Customer.cjs +435 -64
- package/EconomicEvent.cjs +9 -3
- package/NewsArticle.cjs +255 -30
- package/NewsArticleAssetSentiment.cjs +427 -65
- package/Order.cjs +867 -129
- package/Position.cjs +945 -141
- package/Session.cjs +438 -54
- package/StopLoss.cjs +552 -69
- package/TakeProfit.cjs +552 -69
- package/Trade.cjs +1042 -153
- package/User.cjs +480 -73
- package/VerificationToken.cjs +9 -3
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +435 -58
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +966 -121
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +593 -89
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +1161 -134
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +1029 -129
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +438 -54
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +435 -64
- package/server/EconomicEvent.d.ts.map +1 -1
- package/server/EconomicEvent.js.map +1 -1
- package/server/EconomicEvent.mjs +9 -3
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +255 -30
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +427 -65
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +867 -129
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +945 -141
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +438 -54
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +552 -69
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +552 -69
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +1042 -153
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +480 -73
- package/server/VerificationToken.d.ts.map +1 -1
- package/server/VerificationToken.js.map +1 -1
- package/server/VerificationToken.mjs +9 -3
package/Order.cjs
CHANGED
@@ -228,7 +228,10 @@ exports.Order = {
|
|
228
228
|
}
|
229
229
|
: { connectOrCreate: {
|
230
230
|
where: {
|
231
|
-
id: props.stopLoss.id !== undefined ?
|
231
|
+
id: props.stopLoss.id !== undefined ? {
|
232
|
+
equals: props.stopLoss.id
|
233
|
+
} : undefined,
|
234
|
+
orderId: props.stopLoss.orderId !== undefined ? props.stopLoss.orderId : undefined,
|
232
235
|
},
|
233
236
|
create: {
|
234
237
|
stopPrice: props.stopLoss.stopPrice !== undefined ? props.stopLoss.stopPrice : undefined,
|
@@ -244,7 +247,10 @@ exports.Order = {
|
|
244
247
|
}
|
245
248
|
: { connectOrCreate: {
|
246
249
|
where: {
|
247
|
-
id: props.takeProfit.id !== undefined ?
|
250
|
+
id: props.takeProfit.id !== undefined ? {
|
251
|
+
equals: props.takeProfit.id
|
252
|
+
} : undefined,
|
253
|
+
orderId: props.takeProfit.orderId !== undefined ? props.takeProfit.orderId : undefined,
|
248
254
|
},
|
249
255
|
create: {
|
250
256
|
limitPrice: props.takeProfit.limitPrice !== undefined ? props.takeProfit.limitPrice : undefined,
|
@@ -260,7 +266,12 @@ exports.Order = {
|
|
260
266
|
}
|
261
267
|
: { connectOrCreate: {
|
262
268
|
where: {
|
263
|
-
id: props.alpacaAccount.id !== undefined ?
|
269
|
+
id: props.alpacaAccount.id !== undefined ? {
|
270
|
+
equals: props.alpacaAccount.id
|
271
|
+
} : undefined,
|
272
|
+
userId: props.alpacaAccount.userId !== undefined ? {
|
273
|
+
equals: props.alpacaAccount.userId
|
274
|
+
} : undefined,
|
264
275
|
},
|
265
276
|
create: {
|
266
277
|
type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
|
@@ -280,7 +291,9 @@ exports.Order = {
|
|
280
291
|
}
|
281
292
|
: { connectOrCreate: {
|
282
293
|
where: {
|
283
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
294
|
+
id: props.alpacaAccount.user.id !== undefined ? {
|
295
|
+
equals: props.alpacaAccount.user.id
|
296
|
+
} : undefined,
|
284
297
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
285
298
|
name: props.alpacaAccount.user.name !== undefined ? {
|
286
299
|
equals: props.alpacaAccount.user.name
|
@@ -306,10 +319,20 @@ exports.Order = {
|
|
306
319
|
}
|
307
320
|
: { connectOrCreate: {
|
308
321
|
where: {
|
309
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
322
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
323
|
+
equals: props.alpacaAccount.user.customer.id
|
324
|
+
} : undefined,
|
325
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
326
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
327
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
328
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
329
|
+
} : undefined,
|
310
330
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
311
331
|
equals: props.alpacaAccount.user.customer.name
|
312
332
|
} : undefined,
|
333
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
334
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
335
|
+
} : undefined,
|
313
336
|
},
|
314
337
|
create: {
|
315
338
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -330,7 +353,15 @@ exports.Order = {
|
|
330
353
|
}
|
331
354
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
332
355
|
where: {
|
333
|
-
id: item.id !== undefined ?
|
356
|
+
id: item.id !== undefined ? {
|
357
|
+
equals: item.id
|
358
|
+
} : undefined,
|
359
|
+
userId: item.userId !== undefined ? {
|
360
|
+
equals: item.userId
|
361
|
+
} : undefined,
|
362
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
363
|
+
equals: item.providerAccountId
|
364
|
+
} : undefined,
|
334
365
|
},
|
335
366
|
create: {
|
336
367
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -354,7 +385,12 @@ exports.Order = {
|
|
354
385
|
}
|
355
386
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
356
387
|
where: {
|
357
|
-
id: item.id !== undefined ?
|
388
|
+
id: item.id !== undefined ? {
|
389
|
+
equals: item.id
|
390
|
+
} : undefined,
|
391
|
+
userId: item.userId !== undefined ? {
|
392
|
+
equals: item.userId
|
393
|
+
} : undefined,
|
358
394
|
},
|
359
395
|
create: {
|
360
396
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -370,7 +406,12 @@ exports.Order = {
|
|
370
406
|
}
|
371
407
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
372
408
|
where: {
|
373
|
-
id: item.id !== undefined ?
|
409
|
+
id: item.id !== undefined ? {
|
410
|
+
equals: item.id
|
411
|
+
} : undefined,
|
412
|
+
userId: item.userId !== undefined ? {
|
413
|
+
equals: item.userId
|
414
|
+
} : undefined,
|
374
415
|
},
|
375
416
|
create: {
|
376
417
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -390,7 +431,15 @@ exports.Order = {
|
|
390
431
|
}
|
391
432
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
392
433
|
where: {
|
393
|
-
id: item.id !== undefined ?
|
434
|
+
id: item.id !== undefined ? {
|
435
|
+
equals: item.id
|
436
|
+
} : undefined,
|
437
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
438
|
+
equals: item.alpacaAccountId
|
439
|
+
} : undefined,
|
440
|
+
assetId: item.assetId !== undefined ? {
|
441
|
+
equals: item.assetId
|
442
|
+
} : undefined,
|
394
443
|
},
|
395
444
|
create: {
|
396
445
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -412,7 +461,9 @@ exports.Order = {
|
|
412
461
|
}
|
413
462
|
: { connectOrCreate: {
|
414
463
|
where: {
|
415
|
-
id: item.asset.id !== undefined ?
|
464
|
+
id: item.asset.id !== undefined ? {
|
465
|
+
equals: item.asset.id
|
466
|
+
} : undefined,
|
416
467
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
417
468
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
418
469
|
},
|
@@ -483,7 +534,12 @@ exports.Order = {
|
|
483
534
|
}
|
484
535
|
: { connectOrCreate: item.actions.map((item) => ({
|
485
536
|
where: {
|
486
|
-
id: item.id !== undefined ?
|
537
|
+
id: item.id !== undefined ? {
|
538
|
+
equals: item.id
|
539
|
+
} : undefined,
|
540
|
+
tradeId: item.tradeId !== undefined ? {
|
541
|
+
equals: item.tradeId
|
542
|
+
} : undefined,
|
487
543
|
},
|
488
544
|
create: {
|
489
545
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -505,7 +561,15 @@ exports.Order = {
|
|
505
561
|
}
|
506
562
|
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
507
563
|
where: {
|
508
|
-
id: item.id !== undefined ?
|
564
|
+
id: item.id !== undefined ? {
|
565
|
+
equals: item.id
|
566
|
+
} : undefined,
|
567
|
+
assetId: item.assetId !== undefined ? {
|
568
|
+
equals: item.assetId
|
569
|
+
} : undefined,
|
570
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
571
|
+
equals: item.alpacaAccountId
|
572
|
+
} : undefined,
|
509
573
|
},
|
510
574
|
create: {
|
511
575
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -529,7 +593,9 @@ exports.Order = {
|
|
529
593
|
}
|
530
594
|
: { connectOrCreate: {
|
531
595
|
where: {
|
532
|
-
id: item.asset.id !== undefined ?
|
596
|
+
id: item.asset.id !== undefined ? {
|
597
|
+
equals: item.asset.id
|
598
|
+
} : undefined,
|
533
599
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
534
600
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
535
601
|
},
|
@@ -603,7 +669,12 @@ exports.Order = {
|
|
603
669
|
}
|
604
670
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
605
671
|
where: {
|
606
|
-
id: item.id !== undefined ?
|
672
|
+
id: item.id !== undefined ? {
|
673
|
+
equals: item.id
|
674
|
+
} : undefined,
|
675
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
676
|
+
equals: item.alpacaAccountId
|
677
|
+
} : undefined,
|
607
678
|
},
|
608
679
|
create: {
|
609
680
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -623,7 +694,12 @@ exports.Order = {
|
|
623
694
|
}
|
624
695
|
: { connectOrCreate: {
|
625
696
|
where: {
|
626
|
-
id: props.action.id !== undefined ?
|
697
|
+
id: props.action.id !== undefined ? {
|
698
|
+
equals: props.action.id
|
699
|
+
} : undefined,
|
700
|
+
tradeId: props.action.tradeId !== undefined ? {
|
701
|
+
equals: props.action.tradeId
|
702
|
+
} : undefined,
|
627
703
|
},
|
628
704
|
create: {
|
629
705
|
sequence: props.action.sequence !== undefined ? props.action.sequence : undefined,
|
@@ -639,7 +715,15 @@ exports.Order = {
|
|
639
715
|
}
|
640
716
|
: { connectOrCreate: {
|
641
717
|
where: {
|
642
|
-
id: props.action.trade.id !== undefined ?
|
718
|
+
id: props.action.trade.id !== undefined ? {
|
719
|
+
equals: props.action.trade.id
|
720
|
+
} : undefined,
|
721
|
+
alpacaAccountId: props.action.trade.alpacaAccountId !== undefined ? {
|
722
|
+
equals: props.action.trade.alpacaAccountId
|
723
|
+
} : undefined,
|
724
|
+
assetId: props.action.trade.assetId !== undefined ? {
|
725
|
+
equals: props.action.trade.assetId
|
726
|
+
} : undefined,
|
643
727
|
},
|
644
728
|
create: {
|
645
729
|
qty: props.action.trade.qty !== undefined ? props.action.trade.qty : undefined,
|
@@ -661,7 +745,12 @@ exports.Order = {
|
|
661
745
|
}
|
662
746
|
: { connectOrCreate: {
|
663
747
|
where: {
|
664
|
-
id: props.action.trade.alpacaAccount.id !== undefined ?
|
748
|
+
id: props.action.trade.alpacaAccount.id !== undefined ? {
|
749
|
+
equals: props.action.trade.alpacaAccount.id
|
750
|
+
} : undefined,
|
751
|
+
userId: props.action.trade.alpacaAccount.userId !== undefined ? {
|
752
|
+
equals: props.action.trade.alpacaAccount.userId
|
753
|
+
} : undefined,
|
665
754
|
},
|
666
755
|
create: {
|
667
756
|
type: props.action.trade.alpacaAccount.type !== undefined ? props.action.trade.alpacaAccount.type : undefined,
|
@@ -684,7 +773,9 @@ exports.Order = {
|
|
684
773
|
}
|
685
774
|
: { connectOrCreate: {
|
686
775
|
where: {
|
687
|
-
id: props.action.trade.asset.id !== undefined ?
|
776
|
+
id: props.action.trade.asset.id !== undefined ? {
|
777
|
+
equals: props.action.trade.asset.id
|
778
|
+
} : undefined,
|
688
779
|
symbol: props.action.trade.asset.symbol !== undefined ? props.action.trade.asset.symbol : undefined,
|
689
780
|
name: props.action.trade.asset.name !== undefined ? props.action.trade.asset.name : undefined,
|
690
781
|
},
|
@@ -761,7 +852,9 @@ exports.Order = {
|
|
761
852
|
}
|
762
853
|
: { connectOrCreate: {
|
763
854
|
where: {
|
764
|
-
id: props.asset.id !== undefined ?
|
855
|
+
id: props.asset.id !== undefined ? {
|
856
|
+
equals: props.asset.id
|
857
|
+
} : undefined,
|
765
858
|
symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
|
766
859
|
name: props.asset.name !== undefined ? props.asset.name : undefined,
|
767
860
|
},
|
@@ -829,7 +922,15 @@ exports.Order = {
|
|
829
922
|
}
|
830
923
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
831
924
|
where: {
|
832
|
-
id: item.id !== undefined ?
|
925
|
+
id: item.id !== undefined ? {
|
926
|
+
equals: item.id
|
927
|
+
} : undefined,
|
928
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
929
|
+
equals: item.alpacaAccountId
|
930
|
+
} : undefined,
|
931
|
+
assetId: item.assetId !== undefined ? {
|
932
|
+
equals: item.assetId
|
933
|
+
} : undefined,
|
833
934
|
},
|
834
935
|
create: {
|
835
936
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -851,7 +952,12 @@ exports.Order = {
|
|
851
952
|
}
|
852
953
|
: { connectOrCreate: {
|
853
954
|
where: {
|
854
|
-
id: item.alpacaAccount.id !== undefined ?
|
955
|
+
id: item.alpacaAccount.id !== undefined ? {
|
956
|
+
equals: item.alpacaAccount.id
|
957
|
+
} : undefined,
|
958
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
959
|
+
equals: item.alpacaAccount.userId
|
960
|
+
} : undefined,
|
855
961
|
},
|
856
962
|
create: {
|
857
963
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -874,7 +980,12 @@ exports.Order = {
|
|
874
980
|
}
|
875
981
|
: { connectOrCreate: item.actions.map((item) => ({
|
876
982
|
where: {
|
877
|
-
id: item.id !== undefined ?
|
983
|
+
id: item.id !== undefined ? {
|
984
|
+
equals: item.id
|
985
|
+
} : undefined,
|
986
|
+
tradeId: item.tradeId !== undefined ? {
|
987
|
+
equals: item.tradeId
|
988
|
+
} : undefined,
|
878
989
|
},
|
879
990
|
create: {
|
880
991
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -896,7 +1007,15 @@ exports.Order = {
|
|
896
1007
|
}
|
897
1008
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
898
1009
|
where: {
|
899
|
-
id: item.id !== undefined ?
|
1010
|
+
id: item.id !== undefined ? {
|
1011
|
+
equals: item.id
|
1012
|
+
} : undefined,
|
1013
|
+
assetId: item.assetId !== undefined ? {
|
1014
|
+
equals: item.assetId
|
1015
|
+
} : undefined,
|
1016
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1017
|
+
equals: item.alpacaAccountId
|
1018
|
+
} : undefined,
|
900
1019
|
},
|
901
1020
|
create: {
|
902
1021
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -920,7 +1039,12 @@ exports.Order = {
|
|
920
1039
|
}
|
921
1040
|
: { connectOrCreate: {
|
922
1041
|
where: {
|
923
|
-
id: item.alpacaAccount.id !== undefined ?
|
1042
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1043
|
+
equals: item.alpacaAccount.id
|
1044
|
+
} : undefined,
|
1045
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1046
|
+
equals: item.alpacaAccount.userId
|
1047
|
+
} : undefined,
|
924
1048
|
},
|
925
1049
|
create: {
|
926
1050
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -946,8 +1070,16 @@ exports.Order = {
|
|
946
1070
|
}
|
947
1071
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
948
1072
|
where: {
|
949
|
-
id: item.id !== undefined ?
|
1073
|
+
id: item.id !== undefined ? {
|
1074
|
+
equals: item.id
|
1075
|
+
} : undefined,
|
950
1076
|
url: item.url !== undefined ? item.url : undefined,
|
1077
|
+
assetId: item.assetId !== undefined ? {
|
1078
|
+
equals: item.assetId
|
1079
|
+
} : undefined,
|
1080
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1081
|
+
equals: item.newsArticleId
|
1082
|
+
} : undefined,
|
951
1083
|
},
|
952
1084
|
create: {
|
953
1085
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -962,7 +1094,9 @@ exports.Order = {
|
|
962
1094
|
}
|
963
1095
|
: { connectOrCreate: {
|
964
1096
|
where: {
|
965
|
-
id: item.news.id !== undefined ?
|
1097
|
+
id: item.news.id !== undefined ? {
|
1098
|
+
equals: item.news.id
|
1099
|
+
} : undefined,
|
966
1100
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
967
1101
|
title: item.news.title !== undefined ? {
|
968
1102
|
equals: item.news.title
|
@@ -1084,12 +1218,18 @@ exports.Order = {
|
|
1084
1218
|
}`;
|
1085
1219
|
const variables = {
|
1086
1220
|
where: {
|
1087
|
-
id: props.id !== undefined ?
|
1221
|
+
id: props.id !== undefined ? {
|
1222
|
+
equals: props.id
|
1223
|
+
} : undefined,
|
1088
1224
|
clientOrderId: props.clientOrderId !== undefined ? props.clientOrderId : undefined,
|
1089
1225
|
actionId: props.actionId !== undefined ? props.actionId : undefined,
|
1090
1226
|
stopLossId: props.stopLossId !== undefined ? props.stopLossId : undefined,
|
1091
|
-
alpacaAccountId: props.alpacaAccountId !== undefined ?
|
1092
|
-
|
1227
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
1228
|
+
equals: props.alpacaAccountId
|
1229
|
+
} : undefined,
|
1230
|
+
assetId: props.assetId !== undefined ? {
|
1231
|
+
equals: props.assetId
|
1232
|
+
} : undefined,
|
1093
1233
|
side: props.side !== undefined ? props.side : undefined,
|
1094
1234
|
type: props.type !== undefined ? props.type : undefined,
|
1095
1235
|
orderClass: props.orderClass !== undefined ? props.orderClass : undefined,
|
@@ -1184,6 +1324,9 @@ exports.Order = {
|
|
1184
1324
|
id: props.stopLoss.id !== undefined ? {
|
1185
1325
|
equals: props.stopLoss.id
|
1186
1326
|
} : undefined,
|
1327
|
+
orderId: props.stopLoss.orderId !== undefined ? {
|
1328
|
+
equals: props.stopLoss.orderId
|
1329
|
+
} : undefined,
|
1187
1330
|
},
|
1188
1331
|
update: {
|
1189
1332
|
id: props.stopLoss.id !== undefined ? {
|
@@ -1208,6 +1351,9 @@ exports.Order = {
|
|
1208
1351
|
id: props.takeProfit.id !== undefined ? {
|
1209
1352
|
equals: props.takeProfit.id
|
1210
1353
|
} : undefined,
|
1354
|
+
orderId: props.takeProfit.orderId !== undefined ? {
|
1355
|
+
equals: props.takeProfit.orderId
|
1356
|
+
} : undefined,
|
1211
1357
|
},
|
1212
1358
|
update: {
|
1213
1359
|
id: props.takeProfit.id !== undefined ? {
|
@@ -1232,6 +1378,9 @@ exports.Order = {
|
|
1232
1378
|
id: props.alpacaAccount.id !== undefined ? {
|
1233
1379
|
equals: props.alpacaAccount.id
|
1234
1380
|
} : undefined,
|
1381
|
+
userId: props.alpacaAccount.userId !== undefined ? {
|
1382
|
+
equals: props.alpacaAccount.userId
|
1383
|
+
} : undefined,
|
1235
1384
|
},
|
1236
1385
|
update: {
|
1237
1386
|
id: props.alpacaAccount.id !== undefined ? {
|
@@ -1320,9 +1469,21 @@ exports.Order = {
|
|
1320
1469
|
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
1321
1470
|
equals: props.alpacaAccount.user.customer.id
|
1322
1471
|
} : undefined,
|
1472
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
1473
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
1474
|
+
} : undefined,
|
1323
1475
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
1324
1476
|
equals: props.alpacaAccount.user.customer.name
|
1325
1477
|
} : undefined,
|
1478
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
|
1479
|
+
equals: props.alpacaAccount.user.customer.stripeCustomerId
|
1480
|
+
} : undefined,
|
1481
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
|
1482
|
+
equals: props.alpacaAccount.user.customer.stripeSubscriptionId
|
1483
|
+
} : undefined,
|
1484
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
1485
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
1486
|
+
} : undefined,
|
1326
1487
|
},
|
1327
1488
|
update: {
|
1328
1489
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -1361,7 +1522,15 @@ exports.Order = {
|
|
1361
1522
|
accounts: props.alpacaAccount.user.accounts ? {
|
1362
1523
|
upsert: props.alpacaAccount.user.accounts.map((item) => ({
|
1363
1524
|
where: {
|
1364
|
-
id: item.id !== undefined ?
|
1525
|
+
id: item.id !== undefined ? {
|
1526
|
+
equals: item.id
|
1527
|
+
} : undefined,
|
1528
|
+
userId: item.userId !== undefined ? {
|
1529
|
+
equals: item.userId
|
1530
|
+
} : undefined,
|
1531
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1532
|
+
equals: item.providerAccountId
|
1533
|
+
} : undefined,
|
1365
1534
|
},
|
1366
1535
|
update: {
|
1367
1536
|
id: item.id !== undefined ? {
|
@@ -1415,7 +1584,12 @@ exports.Order = {
|
|
1415
1584
|
sessions: props.alpacaAccount.user.sessions ? {
|
1416
1585
|
upsert: props.alpacaAccount.user.sessions.map((item) => ({
|
1417
1586
|
where: {
|
1418
|
-
id: item.id !== undefined ?
|
1587
|
+
id: item.id !== undefined ? {
|
1588
|
+
equals: item.id
|
1589
|
+
} : undefined,
|
1590
|
+
userId: item.userId !== undefined ? {
|
1591
|
+
equals: item.userId
|
1592
|
+
} : undefined,
|
1419
1593
|
},
|
1420
1594
|
update: {
|
1421
1595
|
id: item.id !== undefined ? {
|
@@ -1437,7 +1611,12 @@ exports.Order = {
|
|
1437
1611
|
authenticators: props.alpacaAccount.user.authenticators ? {
|
1438
1612
|
upsert: props.alpacaAccount.user.authenticators.map((item) => ({
|
1439
1613
|
where: {
|
1440
|
-
id: item.id !== undefined ?
|
1614
|
+
id: item.id !== undefined ? {
|
1615
|
+
equals: item.id
|
1616
|
+
} : undefined,
|
1617
|
+
userId: item.userId !== undefined ? {
|
1618
|
+
equals: item.userId
|
1619
|
+
} : undefined,
|
1441
1620
|
},
|
1442
1621
|
update: {
|
1443
1622
|
id: item.id !== undefined ? {
|
@@ -1481,10 +1660,20 @@ exports.Order = {
|
|
1481
1660
|
}
|
1482
1661
|
: { connectOrCreate: {
|
1483
1662
|
where: {
|
1484
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
1663
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
1664
|
+
equals: props.alpacaAccount.user.customer.id
|
1665
|
+
} : undefined,
|
1666
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
1667
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
1668
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
1669
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
1670
|
+
} : undefined,
|
1485
1671
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
1486
1672
|
equals: props.alpacaAccount.user.customer.name
|
1487
1673
|
} : undefined,
|
1674
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
1675
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
1676
|
+
} : undefined,
|
1488
1677
|
},
|
1489
1678
|
create: {
|
1490
1679
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -1505,7 +1694,15 @@ exports.Order = {
|
|
1505
1694
|
}
|
1506
1695
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
1507
1696
|
where: {
|
1508
|
-
id: item.id !== undefined ?
|
1697
|
+
id: item.id !== undefined ? {
|
1698
|
+
equals: item.id
|
1699
|
+
} : undefined,
|
1700
|
+
userId: item.userId !== undefined ? {
|
1701
|
+
equals: item.userId
|
1702
|
+
} : undefined,
|
1703
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1704
|
+
equals: item.providerAccountId
|
1705
|
+
} : undefined,
|
1509
1706
|
},
|
1510
1707
|
create: {
|
1511
1708
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -1529,7 +1726,12 @@ exports.Order = {
|
|
1529
1726
|
}
|
1530
1727
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
1531
1728
|
where: {
|
1532
|
-
id: item.id !== undefined ?
|
1729
|
+
id: item.id !== undefined ? {
|
1730
|
+
equals: item.id
|
1731
|
+
} : undefined,
|
1732
|
+
userId: item.userId !== undefined ? {
|
1733
|
+
equals: item.userId
|
1734
|
+
} : undefined,
|
1533
1735
|
},
|
1534
1736
|
create: {
|
1535
1737
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -1545,7 +1747,12 @@ exports.Order = {
|
|
1545
1747
|
}
|
1546
1748
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
1547
1749
|
where: {
|
1548
|
-
id: item.id !== undefined ?
|
1750
|
+
id: item.id !== undefined ? {
|
1751
|
+
equals: item.id
|
1752
|
+
} : undefined,
|
1753
|
+
userId: item.userId !== undefined ? {
|
1754
|
+
equals: item.userId
|
1755
|
+
} : undefined,
|
1549
1756
|
},
|
1550
1757
|
create: {
|
1551
1758
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -1560,7 +1767,15 @@ exports.Order = {
|
|
1560
1767
|
trades: props.alpacaAccount.trades ? {
|
1561
1768
|
upsert: props.alpacaAccount.trades.map((item) => ({
|
1562
1769
|
where: {
|
1563
|
-
id: item.id !== undefined ?
|
1770
|
+
id: item.id !== undefined ? {
|
1771
|
+
equals: item.id
|
1772
|
+
} : undefined,
|
1773
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1774
|
+
equals: item.alpacaAccountId
|
1775
|
+
} : undefined,
|
1776
|
+
assetId: item.assetId !== undefined ? {
|
1777
|
+
equals: item.assetId
|
1778
|
+
} : undefined,
|
1564
1779
|
},
|
1565
1780
|
update: {
|
1566
1781
|
id: item.id !== undefined ? {
|
@@ -1844,7 +2059,12 @@ exports.Order = {
|
|
1844
2059
|
actions: item.actions ? {
|
1845
2060
|
upsert: item.actions.map((item) => ({
|
1846
2061
|
where: {
|
1847
|
-
id: item.id !== undefined ?
|
2062
|
+
id: item.id !== undefined ? {
|
2063
|
+
equals: item.id
|
2064
|
+
} : undefined,
|
2065
|
+
tradeId: item.tradeId !== undefined ? {
|
2066
|
+
equals: item.tradeId
|
2067
|
+
} : undefined,
|
1848
2068
|
},
|
1849
2069
|
update: {
|
1850
2070
|
id: item.id !== undefined ? {
|
@@ -1896,7 +2116,9 @@ exports.Order = {
|
|
1896
2116
|
}
|
1897
2117
|
: { connectOrCreate: {
|
1898
2118
|
where: {
|
1899
|
-
id: item.asset.id !== undefined ?
|
2119
|
+
id: item.asset.id !== undefined ? {
|
2120
|
+
equals: item.asset.id
|
2121
|
+
} : undefined,
|
1900
2122
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
1901
2123
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
1902
2124
|
},
|
@@ -1967,7 +2189,12 @@ exports.Order = {
|
|
1967
2189
|
}
|
1968
2190
|
: { connectOrCreate: item.actions.map((item) => ({
|
1969
2191
|
where: {
|
1970
|
-
id: item.id !== undefined ?
|
2192
|
+
id: item.id !== undefined ? {
|
2193
|
+
equals: item.id
|
2194
|
+
} : undefined,
|
2195
|
+
tradeId: item.tradeId !== undefined ? {
|
2196
|
+
equals: item.tradeId
|
2197
|
+
} : undefined,
|
1971
2198
|
},
|
1972
2199
|
create: {
|
1973
2200
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -1984,7 +2211,15 @@ exports.Order = {
|
|
1984
2211
|
positions: props.alpacaAccount.positions ? {
|
1985
2212
|
upsert: props.alpacaAccount.positions.map((item) => ({
|
1986
2213
|
where: {
|
1987
|
-
id: item.id !== undefined ?
|
2214
|
+
id: item.id !== undefined ? {
|
2215
|
+
equals: item.id
|
2216
|
+
} : undefined,
|
2217
|
+
assetId: item.assetId !== undefined ? {
|
2218
|
+
equals: item.assetId
|
2219
|
+
} : undefined,
|
2220
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2221
|
+
equals: item.alpacaAccountId
|
2222
|
+
} : undefined,
|
1988
2223
|
},
|
1989
2224
|
update: {
|
1990
2225
|
id: item.id !== undefined ? {
|
@@ -2294,7 +2529,9 @@ exports.Order = {
|
|
2294
2529
|
}
|
2295
2530
|
: { connectOrCreate: {
|
2296
2531
|
where: {
|
2297
|
-
id: item.asset.id !== undefined ?
|
2532
|
+
id: item.asset.id !== undefined ? {
|
2533
|
+
equals: item.asset.id
|
2534
|
+
} : undefined,
|
2298
2535
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2299
2536
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2300
2537
|
},
|
@@ -2363,7 +2600,12 @@ exports.Order = {
|
|
2363
2600
|
alerts: props.alpacaAccount.alerts ? {
|
2364
2601
|
upsert: props.alpacaAccount.alerts.map((item) => ({
|
2365
2602
|
where: {
|
2366
|
-
id: item.id !== undefined ?
|
2603
|
+
id: item.id !== undefined ? {
|
2604
|
+
equals: item.id
|
2605
|
+
} : undefined,
|
2606
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2607
|
+
equals: item.alpacaAccountId
|
2608
|
+
} : undefined,
|
2367
2609
|
},
|
2368
2610
|
update: {
|
2369
2611
|
id: item.id !== undefined ? {
|
@@ -2405,7 +2647,9 @@ exports.Order = {
|
|
2405
2647
|
}
|
2406
2648
|
: { connectOrCreate: {
|
2407
2649
|
where: {
|
2408
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
2650
|
+
id: props.alpacaAccount.user.id !== undefined ? {
|
2651
|
+
equals: props.alpacaAccount.user.id
|
2652
|
+
} : undefined,
|
2409
2653
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
2410
2654
|
name: props.alpacaAccount.user.name !== undefined ? {
|
2411
2655
|
equals: props.alpacaAccount.user.name
|
@@ -2431,10 +2675,20 @@ exports.Order = {
|
|
2431
2675
|
}
|
2432
2676
|
: { connectOrCreate: {
|
2433
2677
|
where: {
|
2434
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
2678
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
2679
|
+
equals: props.alpacaAccount.user.customer.id
|
2680
|
+
} : undefined,
|
2681
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
2682
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
2683
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
2684
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
2685
|
+
} : undefined,
|
2435
2686
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
2436
2687
|
equals: props.alpacaAccount.user.customer.name
|
2437
2688
|
} : undefined,
|
2689
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
2690
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
2691
|
+
} : undefined,
|
2438
2692
|
},
|
2439
2693
|
create: {
|
2440
2694
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -2455,7 +2709,15 @@ exports.Order = {
|
|
2455
2709
|
}
|
2456
2710
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
2457
2711
|
where: {
|
2458
|
-
id: item.id !== undefined ?
|
2712
|
+
id: item.id !== undefined ? {
|
2713
|
+
equals: item.id
|
2714
|
+
} : undefined,
|
2715
|
+
userId: item.userId !== undefined ? {
|
2716
|
+
equals: item.userId
|
2717
|
+
} : undefined,
|
2718
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
2719
|
+
equals: item.providerAccountId
|
2720
|
+
} : undefined,
|
2459
2721
|
},
|
2460
2722
|
create: {
|
2461
2723
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -2479,7 +2741,12 @@ exports.Order = {
|
|
2479
2741
|
}
|
2480
2742
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
2481
2743
|
where: {
|
2482
|
-
id: item.id !== undefined ?
|
2744
|
+
id: item.id !== undefined ? {
|
2745
|
+
equals: item.id
|
2746
|
+
} : undefined,
|
2747
|
+
userId: item.userId !== undefined ? {
|
2748
|
+
equals: item.userId
|
2749
|
+
} : undefined,
|
2483
2750
|
},
|
2484
2751
|
create: {
|
2485
2752
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -2495,7 +2762,12 @@ exports.Order = {
|
|
2495
2762
|
}
|
2496
2763
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
2497
2764
|
where: {
|
2498
|
-
id: item.id !== undefined ?
|
2765
|
+
id: item.id !== undefined ? {
|
2766
|
+
equals: item.id
|
2767
|
+
} : undefined,
|
2768
|
+
userId: item.userId !== undefined ? {
|
2769
|
+
equals: item.userId
|
2770
|
+
} : undefined,
|
2499
2771
|
},
|
2500
2772
|
create: {
|
2501
2773
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -2515,7 +2787,15 @@ exports.Order = {
|
|
2515
2787
|
}
|
2516
2788
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
2517
2789
|
where: {
|
2518
|
-
id: item.id !== undefined ?
|
2790
|
+
id: item.id !== undefined ? {
|
2791
|
+
equals: item.id
|
2792
|
+
} : undefined,
|
2793
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2794
|
+
equals: item.alpacaAccountId
|
2795
|
+
} : undefined,
|
2796
|
+
assetId: item.assetId !== undefined ? {
|
2797
|
+
equals: item.assetId
|
2798
|
+
} : undefined,
|
2519
2799
|
},
|
2520
2800
|
create: {
|
2521
2801
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2537,7 +2817,9 @@ exports.Order = {
|
|
2537
2817
|
}
|
2538
2818
|
: { connectOrCreate: {
|
2539
2819
|
where: {
|
2540
|
-
id: item.asset.id !== undefined ?
|
2820
|
+
id: item.asset.id !== undefined ? {
|
2821
|
+
equals: item.asset.id
|
2822
|
+
} : undefined,
|
2541
2823
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2542
2824
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2543
2825
|
},
|
@@ -2608,7 +2890,12 @@ exports.Order = {
|
|
2608
2890
|
}
|
2609
2891
|
: { connectOrCreate: item.actions.map((item) => ({
|
2610
2892
|
where: {
|
2611
|
-
id: item.id !== undefined ?
|
2893
|
+
id: item.id !== undefined ? {
|
2894
|
+
equals: item.id
|
2895
|
+
} : undefined,
|
2896
|
+
tradeId: item.tradeId !== undefined ? {
|
2897
|
+
equals: item.tradeId
|
2898
|
+
} : undefined,
|
2612
2899
|
},
|
2613
2900
|
create: {
|
2614
2901
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2630,7 +2917,15 @@ exports.Order = {
|
|
2630
2917
|
}
|
2631
2918
|
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
2632
2919
|
where: {
|
2633
|
-
id: item.id !== undefined ?
|
2920
|
+
id: item.id !== undefined ? {
|
2921
|
+
equals: item.id
|
2922
|
+
} : undefined,
|
2923
|
+
assetId: item.assetId !== undefined ? {
|
2924
|
+
equals: item.assetId
|
2925
|
+
} : undefined,
|
2926
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2927
|
+
equals: item.alpacaAccountId
|
2928
|
+
} : undefined,
|
2634
2929
|
},
|
2635
2930
|
create: {
|
2636
2931
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2654,7 +2949,9 @@ exports.Order = {
|
|
2654
2949
|
}
|
2655
2950
|
: { connectOrCreate: {
|
2656
2951
|
where: {
|
2657
|
-
id: item.asset.id !== undefined ?
|
2952
|
+
id: item.asset.id !== undefined ? {
|
2953
|
+
equals: item.asset.id
|
2954
|
+
} : undefined,
|
2658
2955
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2659
2956
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2660
2957
|
},
|
@@ -2728,7 +3025,12 @@ exports.Order = {
|
|
2728
3025
|
}
|
2729
3026
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
2730
3027
|
where: {
|
2731
|
-
id: item.id !== undefined ?
|
3028
|
+
id: item.id !== undefined ? {
|
3029
|
+
equals: item.id
|
3030
|
+
} : undefined,
|
3031
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3032
|
+
equals: item.alpacaAccountId
|
3033
|
+
} : undefined,
|
2732
3034
|
},
|
2733
3035
|
create: {
|
2734
3036
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2746,6 +3048,9 @@ exports.Order = {
|
|
2746
3048
|
id: props.action.id !== undefined ? {
|
2747
3049
|
equals: props.action.id
|
2748
3050
|
} : undefined,
|
3051
|
+
tradeId: props.action.tradeId !== undefined ? {
|
3052
|
+
equals: props.action.tradeId
|
3053
|
+
} : undefined,
|
2749
3054
|
},
|
2750
3055
|
update: {
|
2751
3056
|
id: props.action.id !== undefined ? {
|
@@ -2772,6 +3077,12 @@ exports.Order = {
|
|
2772
3077
|
id: props.action.trade.id !== undefined ? {
|
2773
3078
|
equals: props.action.trade.id
|
2774
3079
|
} : undefined,
|
3080
|
+
alpacaAccountId: props.action.trade.alpacaAccountId !== undefined ? {
|
3081
|
+
equals: props.action.trade.alpacaAccountId
|
3082
|
+
} : undefined,
|
3083
|
+
assetId: props.action.trade.assetId !== undefined ? {
|
3084
|
+
equals: props.action.trade.assetId
|
3085
|
+
} : undefined,
|
2775
3086
|
},
|
2776
3087
|
update: {
|
2777
3088
|
id: props.action.trade.id !== undefined ? {
|
@@ -2816,6 +3127,9 @@ exports.Order = {
|
|
2816
3127
|
id: props.action.trade.alpacaAccount.id !== undefined ? {
|
2817
3128
|
equals: props.action.trade.alpacaAccount.id
|
2818
3129
|
} : undefined,
|
3130
|
+
userId: props.action.trade.alpacaAccount.userId !== undefined ? {
|
3131
|
+
equals: props.action.trade.alpacaAccount.userId
|
3132
|
+
} : undefined,
|
2819
3133
|
},
|
2820
3134
|
update: {
|
2821
3135
|
id: props.action.trade.alpacaAccount.id !== undefined ? {
|
@@ -3125,7 +3439,12 @@ exports.Order = {
|
|
3125
3439
|
}
|
3126
3440
|
: { connectOrCreate: {
|
3127
3441
|
where: {
|
3128
|
-
id: props.action.trade.alpacaAccount.id !== undefined ?
|
3442
|
+
id: props.action.trade.alpacaAccount.id !== undefined ? {
|
3443
|
+
equals: props.action.trade.alpacaAccount.id
|
3444
|
+
} : undefined,
|
3445
|
+
userId: props.action.trade.alpacaAccount.userId !== undefined ? {
|
3446
|
+
equals: props.action.trade.alpacaAccount.userId
|
3447
|
+
} : undefined,
|
3129
3448
|
},
|
3130
3449
|
create: {
|
3131
3450
|
type: props.action.trade.alpacaAccount.type !== undefined ? props.action.trade.alpacaAccount.type : undefined,
|
@@ -3148,7 +3467,9 @@ exports.Order = {
|
|
3148
3467
|
}
|
3149
3468
|
: { connectOrCreate: {
|
3150
3469
|
where: {
|
3151
|
-
id: props.action.trade.asset.id !== undefined ?
|
3470
|
+
id: props.action.trade.asset.id !== undefined ? {
|
3471
|
+
equals: props.action.trade.asset.id
|
3472
|
+
} : undefined,
|
3152
3473
|
symbol: props.action.trade.asset.symbol !== undefined ? props.action.trade.asset.symbol : undefined,
|
3153
3474
|
name: props.action.trade.asset.name !== undefined ? props.action.trade.asset.name : undefined,
|
3154
3475
|
},
|
@@ -3229,7 +3550,15 @@ exports.Order = {
|
|
3229
3550
|
}
|
3230
3551
|
: { connectOrCreate: {
|
3231
3552
|
where: {
|
3232
|
-
id: props.action.trade.id !== undefined ?
|
3553
|
+
id: props.action.trade.id !== undefined ? {
|
3554
|
+
equals: props.action.trade.id
|
3555
|
+
} : undefined,
|
3556
|
+
alpacaAccountId: props.action.trade.alpacaAccountId !== undefined ? {
|
3557
|
+
equals: props.action.trade.alpacaAccountId
|
3558
|
+
} : undefined,
|
3559
|
+
assetId: props.action.trade.assetId !== undefined ? {
|
3560
|
+
equals: props.action.trade.assetId
|
3561
|
+
} : undefined,
|
3233
3562
|
},
|
3234
3563
|
create: {
|
3235
3564
|
qty: props.action.trade.qty !== undefined ? props.action.trade.qty : undefined,
|
@@ -3251,7 +3580,12 @@ exports.Order = {
|
|
3251
3580
|
}
|
3252
3581
|
: { connectOrCreate: {
|
3253
3582
|
where: {
|
3254
|
-
id: props.action.trade.alpacaAccount.id !== undefined ?
|
3583
|
+
id: props.action.trade.alpacaAccount.id !== undefined ? {
|
3584
|
+
equals: props.action.trade.alpacaAccount.id
|
3585
|
+
} : undefined,
|
3586
|
+
userId: props.action.trade.alpacaAccount.userId !== undefined ? {
|
3587
|
+
equals: props.action.trade.alpacaAccount.userId
|
3588
|
+
} : undefined,
|
3255
3589
|
},
|
3256
3590
|
create: {
|
3257
3591
|
type: props.action.trade.alpacaAccount.type !== undefined ? props.action.trade.alpacaAccount.type : undefined,
|
@@ -3274,7 +3608,9 @@ exports.Order = {
|
|
3274
3608
|
}
|
3275
3609
|
: { connectOrCreate: {
|
3276
3610
|
where: {
|
3277
|
-
id: props.action.trade.asset.id !== undefined ?
|
3611
|
+
id: props.action.trade.asset.id !== undefined ? {
|
3612
|
+
equals: props.action.trade.asset.id
|
3613
|
+
} : undefined,
|
3278
3614
|
symbol: props.action.trade.asset.symbol !== undefined ? props.action.trade.asset.symbol : undefined,
|
3279
3615
|
name: props.action.trade.asset.name !== undefined ? props.action.trade.asset.name : undefined,
|
3280
3616
|
},
|
@@ -3528,7 +3864,15 @@ exports.Order = {
|
|
3528
3864
|
trades: props.asset.trades ? {
|
3529
3865
|
upsert: props.asset.trades.map((item) => ({
|
3530
3866
|
where: {
|
3531
|
-
id: item.id !== undefined ?
|
3867
|
+
id: item.id !== undefined ? {
|
3868
|
+
equals: item.id
|
3869
|
+
} : undefined,
|
3870
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3871
|
+
equals: item.alpacaAccountId
|
3872
|
+
} : undefined,
|
3873
|
+
assetId: item.assetId !== undefined ? {
|
3874
|
+
equals: item.assetId
|
3875
|
+
} : undefined,
|
3532
3876
|
},
|
3533
3877
|
update: {
|
3534
3878
|
id: item.id !== undefined ? {
|
@@ -3573,6 +3917,9 @@ exports.Order = {
|
|
3573
3917
|
id: item.alpacaAccount.id !== undefined ? {
|
3574
3918
|
equals: item.alpacaAccount.id
|
3575
3919
|
} : undefined,
|
3920
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
3921
|
+
equals: item.alpacaAccount.userId
|
3922
|
+
} : undefined,
|
3576
3923
|
},
|
3577
3924
|
update: {
|
3578
3925
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -3622,7 +3969,12 @@ exports.Order = {
|
|
3622
3969
|
actions: item.actions ? {
|
3623
3970
|
upsert: item.actions.map((item) => ({
|
3624
3971
|
where: {
|
3625
|
-
id: item.id !== undefined ?
|
3972
|
+
id: item.id !== undefined ? {
|
3973
|
+
equals: item.id
|
3974
|
+
} : undefined,
|
3975
|
+
tradeId: item.tradeId !== undefined ? {
|
3976
|
+
equals: item.tradeId
|
3977
|
+
} : undefined,
|
3626
3978
|
},
|
3627
3979
|
update: {
|
3628
3980
|
id: item.id !== undefined ? {
|
@@ -3674,7 +4026,12 @@ exports.Order = {
|
|
3674
4026
|
}
|
3675
4027
|
: { connectOrCreate: {
|
3676
4028
|
where: {
|
3677
|
-
id: item.alpacaAccount.id !== undefined ?
|
4029
|
+
id: item.alpacaAccount.id !== undefined ? {
|
4030
|
+
equals: item.alpacaAccount.id
|
4031
|
+
} : undefined,
|
4032
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4033
|
+
equals: item.alpacaAccount.userId
|
4034
|
+
} : undefined,
|
3678
4035
|
},
|
3679
4036
|
create: {
|
3680
4037
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -3697,7 +4054,12 @@ exports.Order = {
|
|
3697
4054
|
}
|
3698
4055
|
: { connectOrCreate: item.actions.map((item) => ({
|
3699
4056
|
where: {
|
3700
|
-
id: item.id !== undefined ?
|
4057
|
+
id: item.id !== undefined ? {
|
4058
|
+
equals: item.id
|
4059
|
+
} : undefined,
|
4060
|
+
tradeId: item.tradeId !== undefined ? {
|
4061
|
+
equals: item.tradeId
|
4062
|
+
} : undefined,
|
3701
4063
|
},
|
3702
4064
|
create: {
|
3703
4065
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -3714,7 +4076,15 @@ exports.Order = {
|
|
3714
4076
|
positions: props.asset.positions ? {
|
3715
4077
|
upsert: props.asset.positions.map((item) => ({
|
3716
4078
|
where: {
|
3717
|
-
id: item.id !== undefined ?
|
4079
|
+
id: item.id !== undefined ? {
|
4080
|
+
equals: item.id
|
4081
|
+
} : undefined,
|
4082
|
+
assetId: item.assetId !== undefined ? {
|
4083
|
+
equals: item.assetId
|
4084
|
+
} : undefined,
|
4085
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4086
|
+
equals: item.alpacaAccountId
|
4087
|
+
} : undefined,
|
3718
4088
|
},
|
3719
4089
|
update: {
|
3720
4090
|
id: item.id !== undefined ? {
|
@@ -3765,6 +4135,9 @@ exports.Order = {
|
|
3765
4135
|
id: item.alpacaAccount.id !== undefined ? {
|
3766
4136
|
equals: item.alpacaAccount.id
|
3767
4137
|
} : undefined,
|
4138
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4139
|
+
equals: item.alpacaAccount.userId
|
4140
|
+
} : undefined,
|
3768
4141
|
},
|
3769
4142
|
update: {
|
3770
4143
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -3834,7 +4207,12 @@ exports.Order = {
|
|
3834
4207
|
}
|
3835
4208
|
: { connectOrCreate: {
|
3836
4209
|
where: {
|
3837
|
-
id: item.alpacaAccount.id !== undefined ?
|
4210
|
+
id: item.alpacaAccount.id !== undefined ? {
|
4211
|
+
equals: item.alpacaAccount.id
|
4212
|
+
} : undefined,
|
4213
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4214
|
+
equals: item.alpacaAccount.userId
|
4215
|
+
} : undefined,
|
3838
4216
|
},
|
3839
4217
|
create: {
|
3840
4218
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -3855,8 +4233,16 @@ exports.Order = {
|
|
3855
4233
|
newsMentions: props.asset.newsMentions ? {
|
3856
4234
|
upsert: props.asset.newsMentions.map((item) => ({
|
3857
4235
|
where: {
|
3858
|
-
id: item.id !== undefined ?
|
4236
|
+
id: item.id !== undefined ? {
|
4237
|
+
equals: item.id
|
4238
|
+
} : undefined,
|
3859
4239
|
url: item.url !== undefined ? item.url : undefined,
|
4240
|
+
assetId: item.assetId !== undefined ? {
|
4241
|
+
equals: item.assetId
|
4242
|
+
} : undefined,
|
4243
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4244
|
+
equals: item.newsArticleId
|
4245
|
+
} : undefined,
|
3860
4246
|
},
|
3861
4247
|
update: {
|
3862
4248
|
id: item.id !== undefined ? {
|
@@ -3962,7 +4348,9 @@ exports.Order = {
|
|
3962
4348
|
}
|
3963
4349
|
: { connectOrCreate: {
|
3964
4350
|
where: {
|
3965
|
-
id: item.news.id !== undefined ?
|
4351
|
+
id: item.news.id !== undefined ? {
|
4352
|
+
equals: item.news.id
|
4353
|
+
} : undefined,
|
3966
4354
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
3967
4355
|
title: item.news.title !== undefined ? {
|
3968
4356
|
equals: item.news.title
|
@@ -4053,7 +4441,15 @@ exports.Order = {
|
|
4053
4441
|
}
|
4054
4442
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
4055
4443
|
where: {
|
4056
|
-
id: item.id !== undefined ?
|
4444
|
+
id: item.id !== undefined ? {
|
4445
|
+
equals: item.id
|
4446
|
+
} : undefined,
|
4447
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4448
|
+
equals: item.alpacaAccountId
|
4449
|
+
} : undefined,
|
4450
|
+
assetId: item.assetId !== undefined ? {
|
4451
|
+
equals: item.assetId
|
4452
|
+
} : undefined,
|
4057
4453
|
},
|
4058
4454
|
create: {
|
4059
4455
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -4075,7 +4471,12 @@ exports.Order = {
|
|
4075
4471
|
}
|
4076
4472
|
: { connectOrCreate: {
|
4077
4473
|
where: {
|
4078
|
-
id: item.alpacaAccount.id !== undefined ?
|
4474
|
+
id: item.alpacaAccount.id !== undefined ? {
|
4475
|
+
equals: item.alpacaAccount.id
|
4476
|
+
} : undefined,
|
4477
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4478
|
+
equals: item.alpacaAccount.userId
|
4479
|
+
} : undefined,
|
4079
4480
|
},
|
4080
4481
|
create: {
|
4081
4482
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -4098,7 +4499,12 @@ exports.Order = {
|
|
4098
4499
|
}
|
4099
4500
|
: { connectOrCreate: item.actions.map((item) => ({
|
4100
4501
|
where: {
|
4101
|
-
id: item.id !== undefined ?
|
4502
|
+
id: item.id !== undefined ? {
|
4503
|
+
equals: item.id
|
4504
|
+
} : undefined,
|
4505
|
+
tradeId: item.tradeId !== undefined ? {
|
4506
|
+
equals: item.tradeId
|
4507
|
+
} : undefined,
|
4102
4508
|
},
|
4103
4509
|
create: {
|
4104
4510
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -4120,7 +4526,15 @@ exports.Order = {
|
|
4120
4526
|
}
|
4121
4527
|
: { connectOrCreate: props.asset.positions.map((item) => ({
|
4122
4528
|
where: {
|
4123
|
-
id: item.id !== undefined ?
|
4529
|
+
id: item.id !== undefined ? {
|
4530
|
+
equals: item.id
|
4531
|
+
} : undefined,
|
4532
|
+
assetId: item.assetId !== undefined ? {
|
4533
|
+
equals: item.assetId
|
4534
|
+
} : undefined,
|
4535
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4536
|
+
equals: item.alpacaAccountId
|
4537
|
+
} : undefined,
|
4124
4538
|
},
|
4125
4539
|
create: {
|
4126
4540
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4144,7 +4558,12 @@ exports.Order = {
|
|
4144
4558
|
}
|
4145
4559
|
: { connectOrCreate: {
|
4146
4560
|
where: {
|
4147
|
-
id: item.alpacaAccount.id !== undefined ?
|
4561
|
+
id: item.alpacaAccount.id !== undefined ? {
|
4562
|
+
equals: item.alpacaAccount.id
|
4563
|
+
} : undefined,
|
4564
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4565
|
+
equals: item.alpacaAccount.userId
|
4566
|
+
} : undefined,
|
4148
4567
|
},
|
4149
4568
|
create: {
|
4150
4569
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -4170,8 +4589,16 @@ exports.Order = {
|
|
4170
4589
|
}
|
4171
4590
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
4172
4591
|
where: {
|
4173
|
-
id: item.id !== undefined ?
|
4592
|
+
id: item.id !== undefined ? {
|
4593
|
+
equals: item.id
|
4594
|
+
} : undefined,
|
4174
4595
|
url: item.url !== undefined ? item.url : undefined,
|
4596
|
+
assetId: item.assetId !== undefined ? {
|
4597
|
+
equals: item.assetId
|
4598
|
+
} : undefined,
|
4599
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4600
|
+
equals: item.newsArticleId
|
4601
|
+
} : undefined,
|
4175
4602
|
},
|
4176
4603
|
create: {
|
4177
4604
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4186,7 +4613,9 @@ exports.Order = {
|
|
4186
4613
|
}
|
4187
4614
|
: { connectOrCreate: {
|
4188
4615
|
where: {
|
4189
|
-
id: item.news.id !== undefined ?
|
4616
|
+
id: item.news.id !== undefined ? {
|
4617
|
+
equals: item.news.id
|
4618
|
+
} : undefined,
|
4190
4619
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
4191
4620
|
title: item.news.title !== undefined ? {
|
4192
4621
|
equals: item.news.title
|
@@ -4249,12 +4678,18 @@ exports.Order = {
|
|
4249
4678
|
}`;
|
4250
4679
|
const variables = props.map(prop => ({
|
4251
4680
|
where: {
|
4252
|
-
id: prop.id !== undefined ?
|
4681
|
+
id: prop.id !== undefined ? {
|
4682
|
+
equals: prop.id
|
4683
|
+
} : undefined,
|
4253
4684
|
clientOrderId: prop.clientOrderId !== undefined ? prop.clientOrderId : undefined,
|
4254
4685
|
actionId: prop.actionId !== undefined ? prop.actionId : undefined,
|
4255
4686
|
stopLossId: prop.stopLossId !== undefined ? prop.stopLossId : undefined,
|
4256
|
-
alpacaAccountId: prop.alpacaAccountId !== undefined ?
|
4257
|
-
|
4687
|
+
alpacaAccountId: prop.alpacaAccountId !== undefined ? {
|
4688
|
+
equals: prop.alpacaAccountId
|
4689
|
+
} : undefined,
|
4690
|
+
assetId: prop.assetId !== undefined ? {
|
4691
|
+
equals: prop.assetId
|
4692
|
+
} : undefined,
|
4258
4693
|
side: prop.side !== undefined ? prop.side : undefined,
|
4259
4694
|
type: prop.type !== undefined ? prop.type : undefined,
|
4260
4695
|
orderClass: prop.orderClass !== undefined ? prop.orderClass : undefined,
|
@@ -4349,6 +4784,9 @@ exports.Order = {
|
|
4349
4784
|
id: prop.stopLoss.id !== undefined ? {
|
4350
4785
|
equals: prop.stopLoss.id
|
4351
4786
|
} : undefined,
|
4787
|
+
orderId: prop.stopLoss.orderId !== undefined ? {
|
4788
|
+
equals: prop.stopLoss.orderId
|
4789
|
+
} : undefined,
|
4352
4790
|
},
|
4353
4791
|
update: {
|
4354
4792
|
id: prop.stopLoss.id !== undefined ? {
|
@@ -4373,6 +4811,9 @@ exports.Order = {
|
|
4373
4811
|
id: prop.takeProfit.id !== undefined ? {
|
4374
4812
|
equals: prop.takeProfit.id
|
4375
4813
|
} : undefined,
|
4814
|
+
orderId: prop.takeProfit.orderId !== undefined ? {
|
4815
|
+
equals: prop.takeProfit.orderId
|
4816
|
+
} : undefined,
|
4376
4817
|
},
|
4377
4818
|
update: {
|
4378
4819
|
id: prop.takeProfit.id !== undefined ? {
|
@@ -4397,6 +4838,9 @@ exports.Order = {
|
|
4397
4838
|
id: prop.alpacaAccount.id !== undefined ? {
|
4398
4839
|
equals: prop.alpacaAccount.id
|
4399
4840
|
} : undefined,
|
4841
|
+
userId: prop.alpacaAccount.userId !== undefined ? {
|
4842
|
+
equals: prop.alpacaAccount.userId
|
4843
|
+
} : undefined,
|
4400
4844
|
},
|
4401
4845
|
update: {
|
4402
4846
|
id: prop.alpacaAccount.id !== undefined ? {
|
@@ -4485,9 +4929,21 @@ exports.Order = {
|
|
4485
4929
|
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
4486
4930
|
equals: prop.alpacaAccount.user.customer.id
|
4487
4931
|
} : undefined,
|
4932
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
4933
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
4934
|
+
} : undefined,
|
4488
4935
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
4489
4936
|
equals: prop.alpacaAccount.user.customer.name
|
4490
4937
|
} : undefined,
|
4938
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
|
4939
|
+
equals: prop.alpacaAccount.user.customer.stripeCustomerId
|
4940
|
+
} : undefined,
|
4941
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
|
4942
|
+
equals: prop.alpacaAccount.user.customer.stripeSubscriptionId
|
4943
|
+
} : undefined,
|
4944
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
4945
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
4946
|
+
} : undefined,
|
4491
4947
|
},
|
4492
4948
|
update: {
|
4493
4949
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -4526,7 +4982,15 @@ exports.Order = {
|
|
4526
4982
|
accounts: prop.alpacaAccount.user.accounts ? {
|
4527
4983
|
upsert: prop.alpacaAccount.user.accounts.map((item) => ({
|
4528
4984
|
where: {
|
4529
|
-
id: item.id !== undefined ?
|
4985
|
+
id: item.id !== undefined ? {
|
4986
|
+
equals: item.id
|
4987
|
+
} : undefined,
|
4988
|
+
userId: item.userId !== undefined ? {
|
4989
|
+
equals: item.userId
|
4990
|
+
} : undefined,
|
4991
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
4992
|
+
equals: item.providerAccountId
|
4993
|
+
} : undefined,
|
4530
4994
|
},
|
4531
4995
|
update: {
|
4532
4996
|
id: item.id !== undefined ? {
|
@@ -4580,7 +5044,12 @@ exports.Order = {
|
|
4580
5044
|
sessions: prop.alpacaAccount.user.sessions ? {
|
4581
5045
|
upsert: prop.alpacaAccount.user.sessions.map((item) => ({
|
4582
5046
|
where: {
|
4583
|
-
id: item.id !== undefined ?
|
5047
|
+
id: item.id !== undefined ? {
|
5048
|
+
equals: item.id
|
5049
|
+
} : undefined,
|
5050
|
+
userId: item.userId !== undefined ? {
|
5051
|
+
equals: item.userId
|
5052
|
+
} : undefined,
|
4584
5053
|
},
|
4585
5054
|
update: {
|
4586
5055
|
id: item.id !== undefined ? {
|
@@ -4602,7 +5071,12 @@ exports.Order = {
|
|
4602
5071
|
authenticators: prop.alpacaAccount.user.authenticators ? {
|
4603
5072
|
upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
|
4604
5073
|
where: {
|
4605
|
-
id: item.id !== undefined ?
|
5074
|
+
id: item.id !== undefined ? {
|
5075
|
+
equals: item.id
|
5076
|
+
} : undefined,
|
5077
|
+
userId: item.userId !== undefined ? {
|
5078
|
+
equals: item.userId
|
5079
|
+
} : undefined,
|
4606
5080
|
},
|
4607
5081
|
update: {
|
4608
5082
|
id: item.id !== undefined ? {
|
@@ -4646,10 +5120,20 @@ exports.Order = {
|
|
4646
5120
|
}
|
4647
5121
|
: { connectOrCreate: {
|
4648
5122
|
where: {
|
4649
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
5123
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
5124
|
+
equals: prop.alpacaAccount.user.customer.id
|
5125
|
+
} : undefined,
|
5126
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
5127
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
5128
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
5129
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
5130
|
+
} : undefined,
|
4650
5131
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
4651
5132
|
equals: prop.alpacaAccount.user.customer.name
|
4652
5133
|
} : undefined,
|
5134
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
5135
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
5136
|
+
} : undefined,
|
4653
5137
|
},
|
4654
5138
|
create: {
|
4655
5139
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -4670,7 +5154,15 @@ exports.Order = {
|
|
4670
5154
|
}
|
4671
5155
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
4672
5156
|
where: {
|
4673
|
-
id: item.id !== undefined ?
|
5157
|
+
id: item.id !== undefined ? {
|
5158
|
+
equals: item.id
|
5159
|
+
} : undefined,
|
5160
|
+
userId: item.userId !== undefined ? {
|
5161
|
+
equals: item.userId
|
5162
|
+
} : undefined,
|
5163
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
5164
|
+
equals: item.providerAccountId
|
5165
|
+
} : undefined,
|
4674
5166
|
},
|
4675
5167
|
create: {
|
4676
5168
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -4694,7 +5186,12 @@ exports.Order = {
|
|
4694
5186
|
}
|
4695
5187
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
4696
5188
|
where: {
|
4697
|
-
id: item.id !== undefined ?
|
5189
|
+
id: item.id !== undefined ? {
|
5190
|
+
equals: item.id
|
5191
|
+
} : undefined,
|
5192
|
+
userId: item.userId !== undefined ? {
|
5193
|
+
equals: item.userId
|
5194
|
+
} : undefined,
|
4698
5195
|
},
|
4699
5196
|
create: {
|
4700
5197
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -4710,7 +5207,12 @@ exports.Order = {
|
|
4710
5207
|
}
|
4711
5208
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
4712
5209
|
where: {
|
4713
|
-
id: item.id !== undefined ?
|
5210
|
+
id: item.id !== undefined ? {
|
5211
|
+
equals: item.id
|
5212
|
+
} : undefined,
|
5213
|
+
userId: item.userId !== undefined ? {
|
5214
|
+
equals: item.userId
|
5215
|
+
} : undefined,
|
4714
5216
|
},
|
4715
5217
|
create: {
|
4716
5218
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -4725,7 +5227,15 @@ exports.Order = {
|
|
4725
5227
|
trades: prop.alpacaAccount.trades ? {
|
4726
5228
|
upsert: prop.alpacaAccount.trades.map((item) => ({
|
4727
5229
|
where: {
|
4728
|
-
id: item.id !== undefined ?
|
5230
|
+
id: item.id !== undefined ? {
|
5231
|
+
equals: item.id
|
5232
|
+
} : undefined,
|
5233
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5234
|
+
equals: item.alpacaAccountId
|
5235
|
+
} : undefined,
|
5236
|
+
assetId: item.assetId !== undefined ? {
|
5237
|
+
equals: item.assetId
|
5238
|
+
} : undefined,
|
4729
5239
|
},
|
4730
5240
|
update: {
|
4731
5241
|
id: item.id !== undefined ? {
|
@@ -5009,7 +5519,12 @@ exports.Order = {
|
|
5009
5519
|
actions: item.actions ? {
|
5010
5520
|
upsert: item.actions.map((item) => ({
|
5011
5521
|
where: {
|
5012
|
-
id: item.id !== undefined ?
|
5522
|
+
id: item.id !== undefined ? {
|
5523
|
+
equals: item.id
|
5524
|
+
} : undefined,
|
5525
|
+
tradeId: item.tradeId !== undefined ? {
|
5526
|
+
equals: item.tradeId
|
5527
|
+
} : undefined,
|
5013
5528
|
},
|
5014
5529
|
update: {
|
5015
5530
|
id: item.id !== undefined ? {
|
@@ -5061,7 +5576,9 @@ exports.Order = {
|
|
5061
5576
|
}
|
5062
5577
|
: { connectOrCreate: {
|
5063
5578
|
where: {
|
5064
|
-
id: item.asset.id !== undefined ?
|
5579
|
+
id: item.asset.id !== undefined ? {
|
5580
|
+
equals: item.asset.id
|
5581
|
+
} : undefined,
|
5065
5582
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
5066
5583
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
5067
5584
|
},
|
@@ -5132,7 +5649,12 @@ exports.Order = {
|
|
5132
5649
|
}
|
5133
5650
|
: { connectOrCreate: item.actions.map((item) => ({
|
5134
5651
|
where: {
|
5135
|
-
id: item.id !== undefined ?
|
5652
|
+
id: item.id !== undefined ? {
|
5653
|
+
equals: item.id
|
5654
|
+
} : undefined,
|
5655
|
+
tradeId: item.tradeId !== undefined ? {
|
5656
|
+
equals: item.tradeId
|
5657
|
+
} : undefined,
|
5136
5658
|
},
|
5137
5659
|
create: {
|
5138
5660
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -5149,7 +5671,15 @@ exports.Order = {
|
|
5149
5671
|
positions: prop.alpacaAccount.positions ? {
|
5150
5672
|
upsert: prop.alpacaAccount.positions.map((item) => ({
|
5151
5673
|
where: {
|
5152
|
-
id: item.id !== undefined ?
|
5674
|
+
id: item.id !== undefined ? {
|
5675
|
+
equals: item.id
|
5676
|
+
} : undefined,
|
5677
|
+
assetId: item.assetId !== undefined ? {
|
5678
|
+
equals: item.assetId
|
5679
|
+
} : undefined,
|
5680
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5681
|
+
equals: item.alpacaAccountId
|
5682
|
+
} : undefined,
|
5153
5683
|
},
|
5154
5684
|
update: {
|
5155
5685
|
id: item.id !== undefined ? {
|
@@ -5459,7 +5989,9 @@ exports.Order = {
|
|
5459
5989
|
}
|
5460
5990
|
: { connectOrCreate: {
|
5461
5991
|
where: {
|
5462
|
-
id: item.asset.id !== undefined ?
|
5992
|
+
id: item.asset.id !== undefined ? {
|
5993
|
+
equals: item.asset.id
|
5994
|
+
} : undefined,
|
5463
5995
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
5464
5996
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
5465
5997
|
},
|
@@ -5528,7 +6060,12 @@ exports.Order = {
|
|
5528
6060
|
alerts: prop.alpacaAccount.alerts ? {
|
5529
6061
|
upsert: prop.alpacaAccount.alerts.map((item) => ({
|
5530
6062
|
where: {
|
5531
|
-
id: item.id !== undefined ?
|
6063
|
+
id: item.id !== undefined ? {
|
6064
|
+
equals: item.id
|
6065
|
+
} : undefined,
|
6066
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6067
|
+
equals: item.alpacaAccountId
|
6068
|
+
} : undefined,
|
5532
6069
|
},
|
5533
6070
|
update: {
|
5534
6071
|
id: item.id !== undefined ? {
|
@@ -5570,7 +6107,9 @@ exports.Order = {
|
|
5570
6107
|
}
|
5571
6108
|
: { connectOrCreate: {
|
5572
6109
|
where: {
|
5573
|
-
id: prop.alpacaAccount.user.id !== undefined ?
|
6110
|
+
id: prop.alpacaAccount.user.id !== undefined ? {
|
6111
|
+
equals: prop.alpacaAccount.user.id
|
6112
|
+
} : undefined,
|
5574
6113
|
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
5575
6114
|
name: prop.alpacaAccount.user.name !== undefined ? {
|
5576
6115
|
equals: prop.alpacaAccount.user.name
|
@@ -5596,10 +6135,20 @@ exports.Order = {
|
|
5596
6135
|
}
|
5597
6136
|
: { connectOrCreate: {
|
5598
6137
|
where: {
|
5599
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
6138
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
6139
|
+
equals: prop.alpacaAccount.user.customer.id
|
6140
|
+
} : undefined,
|
6141
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
6142
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
6143
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
6144
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
6145
|
+
} : undefined,
|
5600
6146
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
5601
6147
|
equals: prop.alpacaAccount.user.customer.name
|
5602
6148
|
} : undefined,
|
6149
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
6150
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
6151
|
+
} : undefined,
|
5603
6152
|
},
|
5604
6153
|
create: {
|
5605
6154
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -5620,7 +6169,15 @@ exports.Order = {
|
|
5620
6169
|
}
|
5621
6170
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
5622
6171
|
where: {
|
5623
|
-
id: item.id !== undefined ?
|
6172
|
+
id: item.id !== undefined ? {
|
6173
|
+
equals: item.id
|
6174
|
+
} : undefined,
|
6175
|
+
userId: item.userId !== undefined ? {
|
6176
|
+
equals: item.userId
|
6177
|
+
} : undefined,
|
6178
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
6179
|
+
equals: item.providerAccountId
|
6180
|
+
} : undefined,
|
5624
6181
|
},
|
5625
6182
|
create: {
|
5626
6183
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -5644,7 +6201,12 @@ exports.Order = {
|
|
5644
6201
|
}
|
5645
6202
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
5646
6203
|
where: {
|
5647
|
-
id: item.id !== undefined ?
|
6204
|
+
id: item.id !== undefined ? {
|
6205
|
+
equals: item.id
|
6206
|
+
} : undefined,
|
6207
|
+
userId: item.userId !== undefined ? {
|
6208
|
+
equals: item.userId
|
6209
|
+
} : undefined,
|
5648
6210
|
},
|
5649
6211
|
create: {
|
5650
6212
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -5660,7 +6222,12 @@ exports.Order = {
|
|
5660
6222
|
}
|
5661
6223
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5662
6224
|
where: {
|
5663
|
-
id: item.id !== undefined ?
|
6225
|
+
id: item.id !== undefined ? {
|
6226
|
+
equals: item.id
|
6227
|
+
} : undefined,
|
6228
|
+
userId: item.userId !== undefined ? {
|
6229
|
+
equals: item.userId
|
6230
|
+
} : undefined,
|
5664
6231
|
},
|
5665
6232
|
create: {
|
5666
6233
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -5680,7 +6247,15 @@ exports.Order = {
|
|
5680
6247
|
}
|
5681
6248
|
: { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
|
5682
6249
|
where: {
|
5683
|
-
id: item.id !== undefined ?
|
6250
|
+
id: item.id !== undefined ? {
|
6251
|
+
equals: item.id
|
6252
|
+
} : undefined,
|
6253
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6254
|
+
equals: item.alpacaAccountId
|
6255
|
+
} : undefined,
|
6256
|
+
assetId: item.assetId !== undefined ? {
|
6257
|
+
equals: item.assetId
|
6258
|
+
} : undefined,
|
5684
6259
|
},
|
5685
6260
|
create: {
|
5686
6261
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5702,7 +6277,9 @@ exports.Order = {
|
|
5702
6277
|
}
|
5703
6278
|
: { connectOrCreate: {
|
5704
6279
|
where: {
|
5705
|
-
id: item.asset.id !== undefined ?
|
6280
|
+
id: item.asset.id !== undefined ? {
|
6281
|
+
equals: item.asset.id
|
6282
|
+
} : undefined,
|
5706
6283
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
5707
6284
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
5708
6285
|
},
|
@@ -5773,7 +6350,12 @@ exports.Order = {
|
|
5773
6350
|
}
|
5774
6351
|
: { connectOrCreate: item.actions.map((item) => ({
|
5775
6352
|
where: {
|
5776
|
-
id: item.id !== undefined ?
|
6353
|
+
id: item.id !== undefined ? {
|
6354
|
+
equals: item.id
|
6355
|
+
} : undefined,
|
6356
|
+
tradeId: item.tradeId !== undefined ? {
|
6357
|
+
equals: item.tradeId
|
6358
|
+
} : undefined,
|
5777
6359
|
},
|
5778
6360
|
create: {
|
5779
6361
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -5795,7 +6377,15 @@ exports.Order = {
|
|
5795
6377
|
}
|
5796
6378
|
: { connectOrCreate: prop.alpacaAccount.positions.map((item) => ({
|
5797
6379
|
where: {
|
5798
|
-
id: item.id !== undefined ?
|
6380
|
+
id: item.id !== undefined ? {
|
6381
|
+
equals: item.id
|
6382
|
+
} : undefined,
|
6383
|
+
assetId: item.assetId !== undefined ? {
|
6384
|
+
equals: item.assetId
|
6385
|
+
} : undefined,
|
6386
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6387
|
+
equals: item.alpacaAccountId
|
6388
|
+
} : undefined,
|
5799
6389
|
},
|
5800
6390
|
create: {
|
5801
6391
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5819,7 +6409,9 @@ exports.Order = {
|
|
5819
6409
|
}
|
5820
6410
|
: { connectOrCreate: {
|
5821
6411
|
where: {
|
5822
|
-
id: item.asset.id !== undefined ?
|
6412
|
+
id: item.asset.id !== undefined ? {
|
6413
|
+
equals: item.asset.id
|
6414
|
+
} : undefined,
|
5823
6415
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
5824
6416
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
5825
6417
|
},
|
@@ -5893,7 +6485,12 @@ exports.Order = {
|
|
5893
6485
|
}
|
5894
6486
|
: { connectOrCreate: prop.alpacaAccount.alerts.map((item) => ({
|
5895
6487
|
where: {
|
5896
|
-
id: item.id !== undefined ?
|
6488
|
+
id: item.id !== undefined ? {
|
6489
|
+
equals: item.id
|
6490
|
+
} : undefined,
|
6491
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6492
|
+
equals: item.alpacaAccountId
|
6493
|
+
} : undefined,
|
5897
6494
|
},
|
5898
6495
|
create: {
|
5899
6496
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -5911,6 +6508,9 @@ exports.Order = {
|
|
5911
6508
|
id: prop.action.id !== undefined ? {
|
5912
6509
|
equals: prop.action.id
|
5913
6510
|
} : undefined,
|
6511
|
+
tradeId: prop.action.tradeId !== undefined ? {
|
6512
|
+
equals: prop.action.tradeId
|
6513
|
+
} : undefined,
|
5914
6514
|
},
|
5915
6515
|
update: {
|
5916
6516
|
id: prop.action.id !== undefined ? {
|
@@ -5937,6 +6537,12 @@ exports.Order = {
|
|
5937
6537
|
id: prop.action.trade.id !== undefined ? {
|
5938
6538
|
equals: prop.action.trade.id
|
5939
6539
|
} : undefined,
|
6540
|
+
alpacaAccountId: prop.action.trade.alpacaAccountId !== undefined ? {
|
6541
|
+
equals: prop.action.trade.alpacaAccountId
|
6542
|
+
} : undefined,
|
6543
|
+
assetId: prop.action.trade.assetId !== undefined ? {
|
6544
|
+
equals: prop.action.trade.assetId
|
6545
|
+
} : undefined,
|
5940
6546
|
},
|
5941
6547
|
update: {
|
5942
6548
|
id: prop.action.trade.id !== undefined ? {
|
@@ -5981,6 +6587,9 @@ exports.Order = {
|
|
5981
6587
|
id: prop.action.trade.alpacaAccount.id !== undefined ? {
|
5982
6588
|
equals: prop.action.trade.alpacaAccount.id
|
5983
6589
|
} : undefined,
|
6590
|
+
userId: prop.action.trade.alpacaAccount.userId !== undefined ? {
|
6591
|
+
equals: prop.action.trade.alpacaAccount.userId
|
6592
|
+
} : undefined,
|
5984
6593
|
},
|
5985
6594
|
update: {
|
5986
6595
|
id: prop.action.trade.alpacaAccount.id !== undefined ? {
|
@@ -6290,7 +6899,12 @@ exports.Order = {
|
|
6290
6899
|
}
|
6291
6900
|
: { connectOrCreate: {
|
6292
6901
|
where: {
|
6293
|
-
id: prop.action.trade.alpacaAccount.id !== undefined ?
|
6902
|
+
id: prop.action.trade.alpacaAccount.id !== undefined ? {
|
6903
|
+
equals: prop.action.trade.alpacaAccount.id
|
6904
|
+
} : undefined,
|
6905
|
+
userId: prop.action.trade.alpacaAccount.userId !== undefined ? {
|
6906
|
+
equals: prop.action.trade.alpacaAccount.userId
|
6907
|
+
} : undefined,
|
6294
6908
|
},
|
6295
6909
|
create: {
|
6296
6910
|
type: prop.action.trade.alpacaAccount.type !== undefined ? prop.action.trade.alpacaAccount.type : undefined,
|
@@ -6313,7 +6927,9 @@ exports.Order = {
|
|
6313
6927
|
}
|
6314
6928
|
: { connectOrCreate: {
|
6315
6929
|
where: {
|
6316
|
-
id: prop.action.trade.asset.id !== undefined ?
|
6930
|
+
id: prop.action.trade.asset.id !== undefined ? {
|
6931
|
+
equals: prop.action.trade.asset.id
|
6932
|
+
} : undefined,
|
6317
6933
|
symbol: prop.action.trade.asset.symbol !== undefined ? prop.action.trade.asset.symbol : undefined,
|
6318
6934
|
name: prop.action.trade.asset.name !== undefined ? prop.action.trade.asset.name : undefined,
|
6319
6935
|
},
|
@@ -6394,7 +7010,15 @@ exports.Order = {
|
|
6394
7010
|
}
|
6395
7011
|
: { connectOrCreate: {
|
6396
7012
|
where: {
|
6397
|
-
id: prop.action.trade.id !== undefined ?
|
7013
|
+
id: prop.action.trade.id !== undefined ? {
|
7014
|
+
equals: prop.action.trade.id
|
7015
|
+
} : undefined,
|
7016
|
+
alpacaAccountId: prop.action.trade.alpacaAccountId !== undefined ? {
|
7017
|
+
equals: prop.action.trade.alpacaAccountId
|
7018
|
+
} : undefined,
|
7019
|
+
assetId: prop.action.trade.assetId !== undefined ? {
|
7020
|
+
equals: prop.action.trade.assetId
|
7021
|
+
} : undefined,
|
6398
7022
|
},
|
6399
7023
|
create: {
|
6400
7024
|
qty: prop.action.trade.qty !== undefined ? prop.action.trade.qty : undefined,
|
@@ -6416,7 +7040,12 @@ exports.Order = {
|
|
6416
7040
|
}
|
6417
7041
|
: { connectOrCreate: {
|
6418
7042
|
where: {
|
6419
|
-
id: prop.action.trade.alpacaAccount.id !== undefined ?
|
7043
|
+
id: prop.action.trade.alpacaAccount.id !== undefined ? {
|
7044
|
+
equals: prop.action.trade.alpacaAccount.id
|
7045
|
+
} : undefined,
|
7046
|
+
userId: prop.action.trade.alpacaAccount.userId !== undefined ? {
|
7047
|
+
equals: prop.action.trade.alpacaAccount.userId
|
7048
|
+
} : undefined,
|
6420
7049
|
},
|
6421
7050
|
create: {
|
6422
7051
|
type: prop.action.trade.alpacaAccount.type !== undefined ? prop.action.trade.alpacaAccount.type : undefined,
|
@@ -6439,7 +7068,9 @@ exports.Order = {
|
|
6439
7068
|
}
|
6440
7069
|
: { connectOrCreate: {
|
6441
7070
|
where: {
|
6442
|
-
id: prop.action.trade.asset.id !== undefined ?
|
7071
|
+
id: prop.action.trade.asset.id !== undefined ? {
|
7072
|
+
equals: prop.action.trade.asset.id
|
7073
|
+
} : undefined,
|
6443
7074
|
symbol: prop.action.trade.asset.symbol !== undefined ? prop.action.trade.asset.symbol : undefined,
|
6444
7075
|
name: prop.action.trade.asset.name !== undefined ? prop.action.trade.asset.name : undefined,
|
6445
7076
|
},
|
@@ -6693,7 +7324,15 @@ exports.Order = {
|
|
6693
7324
|
trades: prop.asset.trades ? {
|
6694
7325
|
upsert: prop.asset.trades.map((item) => ({
|
6695
7326
|
where: {
|
6696
|
-
id: item.id !== undefined ?
|
7327
|
+
id: item.id !== undefined ? {
|
7328
|
+
equals: item.id
|
7329
|
+
} : undefined,
|
7330
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7331
|
+
equals: item.alpacaAccountId
|
7332
|
+
} : undefined,
|
7333
|
+
assetId: item.assetId !== undefined ? {
|
7334
|
+
equals: item.assetId
|
7335
|
+
} : undefined,
|
6697
7336
|
},
|
6698
7337
|
update: {
|
6699
7338
|
id: item.id !== undefined ? {
|
@@ -6738,6 +7377,9 @@ exports.Order = {
|
|
6738
7377
|
id: item.alpacaAccount.id !== undefined ? {
|
6739
7378
|
equals: item.alpacaAccount.id
|
6740
7379
|
} : undefined,
|
7380
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
7381
|
+
equals: item.alpacaAccount.userId
|
7382
|
+
} : undefined,
|
6741
7383
|
},
|
6742
7384
|
update: {
|
6743
7385
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -6787,7 +7429,12 @@ exports.Order = {
|
|
6787
7429
|
actions: item.actions ? {
|
6788
7430
|
upsert: item.actions.map((item) => ({
|
6789
7431
|
where: {
|
6790
|
-
id: item.id !== undefined ?
|
7432
|
+
id: item.id !== undefined ? {
|
7433
|
+
equals: item.id
|
7434
|
+
} : undefined,
|
7435
|
+
tradeId: item.tradeId !== undefined ? {
|
7436
|
+
equals: item.tradeId
|
7437
|
+
} : undefined,
|
6791
7438
|
},
|
6792
7439
|
update: {
|
6793
7440
|
id: item.id !== undefined ? {
|
@@ -6839,7 +7486,12 @@ exports.Order = {
|
|
6839
7486
|
}
|
6840
7487
|
: { connectOrCreate: {
|
6841
7488
|
where: {
|
6842
|
-
id: item.alpacaAccount.id !== undefined ?
|
7489
|
+
id: item.alpacaAccount.id !== undefined ? {
|
7490
|
+
equals: item.alpacaAccount.id
|
7491
|
+
} : undefined,
|
7492
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
7493
|
+
equals: item.alpacaAccount.userId
|
7494
|
+
} : undefined,
|
6843
7495
|
},
|
6844
7496
|
create: {
|
6845
7497
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -6862,7 +7514,12 @@ exports.Order = {
|
|
6862
7514
|
}
|
6863
7515
|
: { connectOrCreate: item.actions.map((item) => ({
|
6864
7516
|
where: {
|
6865
|
-
id: item.id !== undefined ?
|
7517
|
+
id: item.id !== undefined ? {
|
7518
|
+
equals: item.id
|
7519
|
+
} : undefined,
|
7520
|
+
tradeId: item.tradeId !== undefined ? {
|
7521
|
+
equals: item.tradeId
|
7522
|
+
} : undefined,
|
6866
7523
|
},
|
6867
7524
|
create: {
|
6868
7525
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -6879,7 +7536,15 @@ exports.Order = {
|
|
6879
7536
|
positions: prop.asset.positions ? {
|
6880
7537
|
upsert: prop.asset.positions.map((item) => ({
|
6881
7538
|
where: {
|
6882
|
-
id: item.id !== undefined ?
|
7539
|
+
id: item.id !== undefined ? {
|
7540
|
+
equals: item.id
|
7541
|
+
} : undefined,
|
7542
|
+
assetId: item.assetId !== undefined ? {
|
7543
|
+
equals: item.assetId
|
7544
|
+
} : undefined,
|
7545
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7546
|
+
equals: item.alpacaAccountId
|
7547
|
+
} : undefined,
|
6883
7548
|
},
|
6884
7549
|
update: {
|
6885
7550
|
id: item.id !== undefined ? {
|
@@ -6930,6 +7595,9 @@ exports.Order = {
|
|
6930
7595
|
id: item.alpacaAccount.id !== undefined ? {
|
6931
7596
|
equals: item.alpacaAccount.id
|
6932
7597
|
} : undefined,
|
7598
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
7599
|
+
equals: item.alpacaAccount.userId
|
7600
|
+
} : undefined,
|
6933
7601
|
},
|
6934
7602
|
update: {
|
6935
7603
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -6999,7 +7667,12 @@ exports.Order = {
|
|
6999
7667
|
}
|
7000
7668
|
: { connectOrCreate: {
|
7001
7669
|
where: {
|
7002
|
-
id: item.alpacaAccount.id !== undefined ?
|
7670
|
+
id: item.alpacaAccount.id !== undefined ? {
|
7671
|
+
equals: item.alpacaAccount.id
|
7672
|
+
} : undefined,
|
7673
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
7674
|
+
equals: item.alpacaAccount.userId
|
7675
|
+
} : undefined,
|
7003
7676
|
},
|
7004
7677
|
create: {
|
7005
7678
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -7020,8 +7693,16 @@ exports.Order = {
|
|
7020
7693
|
newsMentions: prop.asset.newsMentions ? {
|
7021
7694
|
upsert: prop.asset.newsMentions.map((item) => ({
|
7022
7695
|
where: {
|
7023
|
-
id: item.id !== undefined ?
|
7696
|
+
id: item.id !== undefined ? {
|
7697
|
+
equals: item.id
|
7698
|
+
} : undefined,
|
7024
7699
|
url: item.url !== undefined ? item.url : undefined,
|
7700
|
+
assetId: item.assetId !== undefined ? {
|
7701
|
+
equals: item.assetId
|
7702
|
+
} : undefined,
|
7703
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
7704
|
+
equals: item.newsArticleId
|
7705
|
+
} : undefined,
|
7025
7706
|
},
|
7026
7707
|
update: {
|
7027
7708
|
id: item.id !== undefined ? {
|
@@ -7127,7 +7808,9 @@ exports.Order = {
|
|
7127
7808
|
}
|
7128
7809
|
: { connectOrCreate: {
|
7129
7810
|
where: {
|
7130
|
-
id: item.news.id !== undefined ?
|
7811
|
+
id: item.news.id !== undefined ? {
|
7812
|
+
equals: item.news.id
|
7813
|
+
} : undefined,
|
7131
7814
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
7132
7815
|
title: item.news.title !== undefined ? {
|
7133
7816
|
equals: item.news.title
|
@@ -7218,7 +7901,15 @@ exports.Order = {
|
|
7218
7901
|
}
|
7219
7902
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
7220
7903
|
where: {
|
7221
|
-
id: item.id !== undefined ?
|
7904
|
+
id: item.id !== undefined ? {
|
7905
|
+
equals: item.id
|
7906
|
+
} : undefined,
|
7907
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7908
|
+
equals: item.alpacaAccountId
|
7909
|
+
} : undefined,
|
7910
|
+
assetId: item.assetId !== undefined ? {
|
7911
|
+
equals: item.assetId
|
7912
|
+
} : undefined,
|
7222
7913
|
},
|
7223
7914
|
create: {
|
7224
7915
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -7240,7 +7931,12 @@ exports.Order = {
|
|
7240
7931
|
}
|
7241
7932
|
: { connectOrCreate: {
|
7242
7933
|
where: {
|
7243
|
-
id: item.alpacaAccount.id !== undefined ?
|
7934
|
+
id: item.alpacaAccount.id !== undefined ? {
|
7935
|
+
equals: item.alpacaAccount.id
|
7936
|
+
} : undefined,
|
7937
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
7938
|
+
equals: item.alpacaAccount.userId
|
7939
|
+
} : undefined,
|
7244
7940
|
},
|
7245
7941
|
create: {
|
7246
7942
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -7263,7 +7959,12 @@ exports.Order = {
|
|
7263
7959
|
}
|
7264
7960
|
: { connectOrCreate: item.actions.map((item) => ({
|
7265
7961
|
where: {
|
7266
|
-
id: item.id !== undefined ?
|
7962
|
+
id: item.id !== undefined ? {
|
7963
|
+
equals: item.id
|
7964
|
+
} : undefined,
|
7965
|
+
tradeId: item.tradeId !== undefined ? {
|
7966
|
+
equals: item.tradeId
|
7967
|
+
} : undefined,
|
7267
7968
|
},
|
7268
7969
|
create: {
|
7269
7970
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -7285,7 +7986,15 @@ exports.Order = {
|
|
7285
7986
|
}
|
7286
7987
|
: { connectOrCreate: prop.asset.positions.map((item) => ({
|
7287
7988
|
where: {
|
7288
|
-
id: item.id !== undefined ?
|
7989
|
+
id: item.id !== undefined ? {
|
7990
|
+
equals: item.id
|
7991
|
+
} : undefined,
|
7992
|
+
assetId: item.assetId !== undefined ? {
|
7993
|
+
equals: item.assetId
|
7994
|
+
} : undefined,
|
7995
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7996
|
+
equals: item.alpacaAccountId
|
7997
|
+
} : undefined,
|
7289
7998
|
},
|
7290
7999
|
create: {
|
7291
8000
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -7309,7 +8018,12 @@ exports.Order = {
|
|
7309
8018
|
}
|
7310
8019
|
: { connectOrCreate: {
|
7311
8020
|
where: {
|
7312
|
-
id: item.alpacaAccount.id !== undefined ?
|
8021
|
+
id: item.alpacaAccount.id !== undefined ? {
|
8022
|
+
equals: item.alpacaAccount.id
|
8023
|
+
} : undefined,
|
8024
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
8025
|
+
equals: item.alpacaAccount.userId
|
8026
|
+
} : undefined,
|
7313
8027
|
},
|
7314
8028
|
create: {
|
7315
8029
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -7335,8 +8049,16 @@ exports.Order = {
|
|
7335
8049
|
}
|
7336
8050
|
: { connectOrCreate: prop.asset.newsMentions.map((item) => ({
|
7337
8051
|
where: {
|
7338
|
-
id: item.id !== undefined ?
|
8052
|
+
id: item.id !== undefined ? {
|
8053
|
+
equals: item.id
|
8054
|
+
} : undefined,
|
7339
8055
|
url: item.url !== undefined ? item.url : undefined,
|
8056
|
+
assetId: item.assetId !== undefined ? {
|
8057
|
+
equals: item.assetId
|
8058
|
+
} : undefined,
|
8059
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
8060
|
+
equals: item.newsArticleId
|
8061
|
+
} : undefined,
|
7340
8062
|
},
|
7341
8063
|
create: {
|
7342
8064
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -7351,7 +8073,9 @@ exports.Order = {
|
|
7351
8073
|
}
|
7352
8074
|
: { connectOrCreate: {
|
7353
8075
|
where: {
|
7354
|
-
id: item.news.id !== undefined ?
|
8076
|
+
id: item.news.id !== undefined ? {
|
8077
|
+
equals: item.news.id
|
8078
|
+
} : undefined,
|
7355
8079
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
7356
8080
|
title: item.news.title !== undefined ? {
|
7357
8081
|
equals: item.news.title
|
@@ -7450,12 +8174,18 @@ exports.Order = {
|
|
7450
8174
|
}`;
|
7451
8175
|
const variables = {
|
7452
8176
|
where: {
|
7453
|
-
id: props.id !== undefined ?
|
8177
|
+
id: props.id !== undefined ? {
|
8178
|
+
equals: props.id
|
8179
|
+
} : undefined,
|
7454
8180
|
clientOrderId: props.clientOrderId !== undefined ? props.clientOrderId : undefined,
|
7455
8181
|
actionId: props.actionId !== undefined ? props.actionId : undefined,
|
7456
8182
|
stopLossId: props.stopLossId !== undefined ? props.stopLossId : undefined,
|
7457
|
-
alpacaAccountId: props.alpacaAccountId !== undefined ?
|
7458
|
-
|
8183
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
8184
|
+
equals: props.alpacaAccountId
|
8185
|
+
} : undefined,
|
8186
|
+
assetId: props.assetId !== undefined ? {
|
8187
|
+
equals: props.assetId
|
8188
|
+
} : undefined,
|
7459
8189
|
side: props.side !== undefined ? props.side : undefined,
|
7460
8190
|
type: props.type !== undefined ? props.type : undefined,
|
7461
8191
|
orderClass: props.orderClass !== undefined ? props.orderClass : undefined,
|
@@ -7533,9 +8263,15 @@ exports.Order = {
|
|
7533
8263
|
id: props.id !== undefined ? {
|
7534
8264
|
equals: props.id
|
7535
8265
|
} : undefined,
|
7536
|
-
clientOrderId: props.clientOrderId !== undefined ?
|
7537
|
-
|
7538
|
-
|
8266
|
+
clientOrderId: props.clientOrderId !== undefined ? {
|
8267
|
+
equals: props.clientOrderId
|
8268
|
+
} : undefined,
|
8269
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
8270
|
+
equals: props.alpacaAccountId
|
8271
|
+
} : undefined,
|
8272
|
+
assetId: props.assetId !== undefined ? {
|
8273
|
+
equals: props.assetId
|
8274
|
+
} : undefined,
|
7539
8275
|
side: props.side !== undefined ? props.side : undefined,
|
7540
8276
|
type: props.type !== undefined ? props.type : undefined,
|
7541
8277
|
orderClass: props.orderClass !== undefined ? props.orderClass : undefined,
|
@@ -7545,7 +8281,9 @@ exports.Order = {
|
|
7545
8281
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|
7546
8282
|
submittedAt: props.submittedAt !== undefined ? props.submittedAt : undefined,
|
7547
8283
|
filledAt: props.filledAt !== undefined ? props.filledAt : undefined,
|
7548
|
-
actionId: props.actionId !== undefined ?
|
8284
|
+
actionId: props.actionId !== undefined ? {
|
8285
|
+
equals: props.actionId
|
8286
|
+
} : undefined,
|
7549
8287
|
expirationDate: props.expirationDate !== undefined ? props.expirationDate : undefined,
|
7550
8288
|
optionType: props.optionType !== undefined ? props.optionType : undefined,
|
7551
8289
|
},
|