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/Position.cjs
CHANGED
@@ -228,7 +228,9 @@ exports.Position = {
|
|
228
228
|
}
|
229
229
|
: { connectOrCreate: {
|
230
230
|
where: {
|
231
|
-
id: props.asset.id !== undefined ?
|
231
|
+
id: props.asset.id !== undefined ? {
|
232
|
+
equals: props.asset.id
|
233
|
+
} : undefined,
|
232
234
|
symbol: props.asset.symbol !== undefined ? props.asset.symbol : undefined,
|
233
235
|
name: props.asset.name !== undefined ? props.asset.name : undefined,
|
234
236
|
},
|
@@ -296,7 +298,15 @@ exports.Position = {
|
|
296
298
|
}
|
297
299
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
298
300
|
where: {
|
299
|
-
id: item.id !== undefined ?
|
301
|
+
id: item.id !== undefined ? {
|
302
|
+
equals: item.id
|
303
|
+
} : undefined,
|
304
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
305
|
+
equals: item.alpacaAccountId
|
306
|
+
} : undefined,
|
307
|
+
assetId: item.assetId !== undefined ? {
|
308
|
+
equals: item.assetId
|
309
|
+
} : undefined,
|
300
310
|
},
|
301
311
|
create: {
|
302
312
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -318,7 +328,12 @@ exports.Position = {
|
|
318
328
|
}
|
319
329
|
: { connectOrCreate: {
|
320
330
|
where: {
|
321
|
-
id: item.alpacaAccount.id !== undefined ?
|
331
|
+
id: item.alpacaAccount.id !== undefined ? {
|
332
|
+
equals: item.alpacaAccount.id
|
333
|
+
} : undefined,
|
334
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
335
|
+
equals: item.alpacaAccount.userId
|
336
|
+
} : undefined,
|
322
337
|
},
|
323
338
|
create: {
|
324
339
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -341,7 +356,12 @@ exports.Position = {
|
|
341
356
|
}
|
342
357
|
: { connectOrCreate: item.actions.map((item) => ({
|
343
358
|
where: {
|
344
|
-
id: item.id !== undefined ?
|
359
|
+
id: item.id !== undefined ? {
|
360
|
+
equals: item.id
|
361
|
+
} : undefined,
|
362
|
+
tradeId: item.tradeId !== undefined ? {
|
363
|
+
equals: item.tradeId
|
364
|
+
} : undefined,
|
345
365
|
},
|
346
366
|
create: {
|
347
367
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -363,7 +383,18 @@ exports.Position = {
|
|
363
383
|
}
|
364
384
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
365
385
|
where: {
|
366
|
-
id: item.id !== undefined ?
|
386
|
+
id: item.id !== undefined ? {
|
387
|
+
equals: item.id
|
388
|
+
} : undefined,
|
389
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
390
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
391
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
392
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
393
|
+
equals: item.alpacaAccountId
|
394
|
+
} : undefined,
|
395
|
+
assetId: item.assetId !== undefined ? {
|
396
|
+
equals: item.assetId
|
397
|
+
} : undefined,
|
367
398
|
},
|
368
399
|
create: {
|
369
400
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -396,7 +427,10 @@ exports.Position = {
|
|
396
427
|
}
|
397
428
|
: { connectOrCreate: {
|
398
429
|
where: {
|
399
|
-
id: item.stopLoss.id !== undefined ?
|
430
|
+
id: item.stopLoss.id !== undefined ? {
|
431
|
+
equals: item.stopLoss.id
|
432
|
+
} : undefined,
|
433
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
400
434
|
},
|
401
435
|
create: {
|
402
436
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -412,7 +446,10 @@ exports.Position = {
|
|
412
446
|
}
|
413
447
|
: { connectOrCreate: {
|
414
448
|
where: {
|
415
|
-
id: item.takeProfit.id !== undefined ?
|
449
|
+
id: item.takeProfit.id !== undefined ? {
|
450
|
+
equals: item.takeProfit.id
|
451
|
+
} : undefined,
|
452
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
416
453
|
},
|
417
454
|
create: {
|
418
455
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -428,7 +465,12 @@ exports.Position = {
|
|
428
465
|
}
|
429
466
|
: { connectOrCreate: {
|
430
467
|
where: {
|
431
|
-
id: item.alpacaAccount.id !== undefined ?
|
468
|
+
id: item.alpacaAccount.id !== undefined ? {
|
469
|
+
equals: item.alpacaAccount.id
|
470
|
+
} : undefined,
|
471
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
472
|
+
equals: item.alpacaAccount.userId
|
473
|
+
} : undefined,
|
432
474
|
},
|
433
475
|
create: {
|
434
476
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -451,7 +493,12 @@ exports.Position = {
|
|
451
493
|
}
|
452
494
|
: { connectOrCreate: {
|
453
495
|
where: {
|
454
|
-
id: item.action.id !== undefined ?
|
496
|
+
id: item.action.id !== undefined ? {
|
497
|
+
equals: item.action.id
|
498
|
+
} : undefined,
|
499
|
+
tradeId: item.action.tradeId !== undefined ? {
|
500
|
+
equals: item.action.tradeId
|
501
|
+
} : undefined,
|
455
502
|
},
|
456
503
|
create: {
|
457
504
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -473,8 +520,16 @@ exports.Position = {
|
|
473
520
|
}
|
474
521
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
475
522
|
where: {
|
476
|
-
id: item.id !== undefined ?
|
523
|
+
id: item.id !== undefined ? {
|
524
|
+
equals: item.id
|
525
|
+
} : undefined,
|
477
526
|
url: item.url !== undefined ? item.url : undefined,
|
527
|
+
assetId: item.assetId !== undefined ? {
|
528
|
+
equals: item.assetId
|
529
|
+
} : undefined,
|
530
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
531
|
+
equals: item.newsArticleId
|
532
|
+
} : undefined,
|
478
533
|
},
|
479
534
|
create: {
|
480
535
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -489,7 +544,9 @@ exports.Position = {
|
|
489
544
|
}
|
490
545
|
: { connectOrCreate: {
|
491
546
|
where: {
|
492
|
-
id: item.news.id !== undefined ?
|
547
|
+
id: item.news.id !== undefined ? {
|
548
|
+
equals: item.news.id
|
549
|
+
} : undefined,
|
493
550
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
494
551
|
title: item.news.title !== undefined ? {
|
495
552
|
equals: item.news.title
|
@@ -526,7 +583,12 @@ exports.Position = {
|
|
526
583
|
}
|
527
584
|
: { connectOrCreate: {
|
528
585
|
where: {
|
529
|
-
id: props.alpacaAccount.id !== undefined ?
|
586
|
+
id: props.alpacaAccount.id !== undefined ? {
|
587
|
+
equals: props.alpacaAccount.id
|
588
|
+
} : undefined,
|
589
|
+
userId: props.alpacaAccount.userId !== undefined ? {
|
590
|
+
equals: props.alpacaAccount.userId
|
591
|
+
} : undefined,
|
530
592
|
},
|
531
593
|
create: {
|
532
594
|
type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
|
@@ -546,7 +608,9 @@ exports.Position = {
|
|
546
608
|
}
|
547
609
|
: { connectOrCreate: {
|
548
610
|
where: {
|
549
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
611
|
+
id: props.alpacaAccount.user.id !== undefined ? {
|
612
|
+
equals: props.alpacaAccount.user.id
|
613
|
+
} : undefined,
|
550
614
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
551
615
|
name: props.alpacaAccount.user.name !== undefined ? {
|
552
616
|
equals: props.alpacaAccount.user.name
|
@@ -572,10 +636,20 @@ exports.Position = {
|
|
572
636
|
}
|
573
637
|
: { connectOrCreate: {
|
574
638
|
where: {
|
575
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
639
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
640
|
+
equals: props.alpacaAccount.user.customer.id
|
641
|
+
} : undefined,
|
642
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
643
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
644
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
645
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
646
|
+
} : undefined,
|
576
647
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
577
648
|
equals: props.alpacaAccount.user.customer.name
|
578
649
|
} : undefined,
|
650
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
651
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
652
|
+
} : undefined,
|
579
653
|
},
|
580
654
|
create: {
|
581
655
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -596,7 +670,15 @@ exports.Position = {
|
|
596
670
|
}
|
597
671
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
598
672
|
where: {
|
599
|
-
id: item.id !== undefined ?
|
673
|
+
id: item.id !== undefined ? {
|
674
|
+
equals: item.id
|
675
|
+
} : undefined,
|
676
|
+
userId: item.userId !== undefined ? {
|
677
|
+
equals: item.userId
|
678
|
+
} : undefined,
|
679
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
680
|
+
equals: item.providerAccountId
|
681
|
+
} : undefined,
|
600
682
|
},
|
601
683
|
create: {
|
602
684
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -620,7 +702,12 @@ exports.Position = {
|
|
620
702
|
}
|
621
703
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
622
704
|
where: {
|
623
|
-
id: item.id !== undefined ?
|
705
|
+
id: item.id !== undefined ? {
|
706
|
+
equals: item.id
|
707
|
+
} : undefined,
|
708
|
+
userId: item.userId !== undefined ? {
|
709
|
+
equals: item.userId
|
710
|
+
} : undefined,
|
624
711
|
},
|
625
712
|
create: {
|
626
713
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -636,7 +723,12 @@ exports.Position = {
|
|
636
723
|
}
|
637
724
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
638
725
|
where: {
|
639
|
-
id: item.id !== undefined ?
|
726
|
+
id: item.id !== undefined ? {
|
727
|
+
equals: item.id
|
728
|
+
} : undefined,
|
729
|
+
userId: item.userId !== undefined ? {
|
730
|
+
equals: item.userId
|
731
|
+
} : undefined,
|
640
732
|
},
|
641
733
|
create: {
|
642
734
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -656,7 +748,15 @@ exports.Position = {
|
|
656
748
|
}
|
657
749
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
658
750
|
where: {
|
659
|
-
id: item.id !== undefined ?
|
751
|
+
id: item.id !== undefined ? {
|
752
|
+
equals: item.id
|
753
|
+
} : undefined,
|
754
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
755
|
+
equals: item.alpacaAccountId
|
756
|
+
} : undefined,
|
757
|
+
assetId: item.assetId !== undefined ? {
|
758
|
+
equals: item.assetId
|
759
|
+
} : undefined,
|
660
760
|
},
|
661
761
|
create: {
|
662
762
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -678,7 +778,9 @@ exports.Position = {
|
|
678
778
|
}
|
679
779
|
: { connectOrCreate: {
|
680
780
|
where: {
|
681
|
-
id: item.asset.id !== undefined ?
|
781
|
+
id: item.asset.id !== undefined ? {
|
782
|
+
equals: item.asset.id
|
783
|
+
} : undefined,
|
682
784
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
683
785
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
684
786
|
},
|
@@ -749,7 +851,12 @@ exports.Position = {
|
|
749
851
|
}
|
750
852
|
: { connectOrCreate: item.actions.map((item) => ({
|
751
853
|
where: {
|
752
|
-
id: item.id !== undefined ?
|
854
|
+
id: item.id !== undefined ? {
|
855
|
+
equals: item.id
|
856
|
+
} : undefined,
|
857
|
+
tradeId: item.tradeId !== undefined ? {
|
858
|
+
equals: item.tradeId
|
859
|
+
} : undefined,
|
753
860
|
},
|
754
861
|
create: {
|
755
862
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -771,7 +878,18 @@ exports.Position = {
|
|
771
878
|
}
|
772
879
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
773
880
|
where: {
|
774
|
-
id: item.id !== undefined ?
|
881
|
+
id: item.id !== undefined ? {
|
882
|
+
equals: item.id
|
883
|
+
} : undefined,
|
884
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
885
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
886
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
887
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
888
|
+
equals: item.alpacaAccountId
|
889
|
+
} : undefined,
|
890
|
+
assetId: item.assetId !== undefined ? {
|
891
|
+
equals: item.assetId
|
892
|
+
} : undefined,
|
775
893
|
},
|
776
894
|
create: {
|
777
895
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -804,7 +922,10 @@ exports.Position = {
|
|
804
922
|
}
|
805
923
|
: { connectOrCreate: {
|
806
924
|
where: {
|
807
|
-
id: item.stopLoss.id !== undefined ?
|
925
|
+
id: item.stopLoss.id !== undefined ? {
|
926
|
+
equals: item.stopLoss.id
|
927
|
+
} : undefined,
|
928
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
808
929
|
},
|
809
930
|
create: {
|
810
931
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -820,7 +941,10 @@ exports.Position = {
|
|
820
941
|
}
|
821
942
|
: { connectOrCreate: {
|
822
943
|
where: {
|
823
|
-
id: item.takeProfit.id !== undefined ?
|
944
|
+
id: item.takeProfit.id !== undefined ? {
|
945
|
+
equals: item.takeProfit.id
|
946
|
+
} : undefined,
|
947
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
824
948
|
},
|
825
949
|
create: {
|
826
950
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -836,7 +960,12 @@ exports.Position = {
|
|
836
960
|
}
|
837
961
|
: { connectOrCreate: {
|
838
962
|
where: {
|
839
|
-
id: item.action.id !== undefined ?
|
963
|
+
id: item.action.id !== undefined ? {
|
964
|
+
equals: item.action.id
|
965
|
+
} : undefined,
|
966
|
+
tradeId: item.action.tradeId !== undefined ? {
|
967
|
+
equals: item.action.tradeId
|
968
|
+
} : undefined,
|
840
969
|
},
|
841
970
|
create: {
|
842
971
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -855,7 +984,9 @@ exports.Position = {
|
|
855
984
|
}
|
856
985
|
: { connectOrCreate: {
|
857
986
|
where: {
|
858
|
-
id: item.asset.id !== undefined ?
|
987
|
+
id: item.asset.id !== undefined ? {
|
988
|
+
equals: item.asset.id
|
989
|
+
} : undefined,
|
859
990
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
860
991
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
861
992
|
},
|
@@ -929,7 +1060,12 @@ exports.Position = {
|
|
929
1060
|
}
|
930
1061
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
931
1062
|
where: {
|
932
|
-
id: item.id !== undefined ?
|
1063
|
+
id: item.id !== undefined ? {
|
1064
|
+
equals: item.id
|
1065
|
+
} : undefined,
|
1066
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1067
|
+
equals: item.alpacaAccountId
|
1068
|
+
} : undefined,
|
933
1069
|
},
|
934
1070
|
create: {
|
935
1071
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1024,8 +1160,12 @@ exports.Position = {
|
|
1024
1160
|
}`;
|
1025
1161
|
const variables = {
|
1026
1162
|
where: {
|
1027
|
-
id: props.id !== undefined ?
|
1028
|
-
|
1163
|
+
id: props.id !== undefined ? {
|
1164
|
+
equals: props.id
|
1165
|
+
} : undefined,
|
1166
|
+
assetId: props.assetId !== undefined ? {
|
1167
|
+
equals: props.assetId
|
1168
|
+
} : undefined,
|
1029
1169
|
averageEntryPrice: props.averageEntryPrice !== undefined ? props.averageEntryPrice : undefined,
|
1030
1170
|
qty: props.qty !== undefined ? props.qty : undefined,
|
1031
1171
|
qtyAvailable: props.qtyAvailable !== undefined ? props.qtyAvailable : undefined,
|
@@ -1038,7 +1178,9 @@ exports.Position = {
|
|
1038
1178
|
currentPrice: props.currentPrice !== undefined ? props.currentPrice : undefined,
|
1039
1179
|
lastTradePrice: props.lastTradePrice !== undefined ? props.lastTradePrice : undefined,
|
1040
1180
|
changeToday: props.changeToday !== undefined ? props.changeToday : undefined,
|
1041
|
-
alpacaAccountId: props.alpacaAccountId !== undefined ?
|
1181
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
1182
|
+
equals: props.alpacaAccountId
|
1183
|
+
} : undefined,
|
1042
1184
|
},
|
1043
1185
|
data: {
|
1044
1186
|
id: props.id !== undefined ? {
|
@@ -1268,7 +1410,15 @@ exports.Position = {
|
|
1268
1410
|
trades: props.asset.trades ? {
|
1269
1411
|
upsert: props.asset.trades.map((item) => ({
|
1270
1412
|
where: {
|
1271
|
-
id: item.id !== undefined ?
|
1413
|
+
id: item.id !== undefined ? {
|
1414
|
+
equals: item.id
|
1415
|
+
} : undefined,
|
1416
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1417
|
+
equals: item.alpacaAccountId
|
1418
|
+
} : undefined,
|
1419
|
+
assetId: item.assetId !== undefined ? {
|
1420
|
+
equals: item.assetId
|
1421
|
+
} : undefined,
|
1272
1422
|
},
|
1273
1423
|
update: {
|
1274
1424
|
id: item.id !== undefined ? {
|
@@ -1313,6 +1463,9 @@ exports.Position = {
|
|
1313
1463
|
id: item.alpacaAccount.id !== undefined ? {
|
1314
1464
|
equals: item.alpacaAccount.id
|
1315
1465
|
} : undefined,
|
1466
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1467
|
+
equals: item.alpacaAccount.userId
|
1468
|
+
} : undefined,
|
1316
1469
|
},
|
1317
1470
|
update: {
|
1318
1471
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -1362,7 +1515,12 @@ exports.Position = {
|
|
1362
1515
|
actions: item.actions ? {
|
1363
1516
|
upsert: item.actions.map((item) => ({
|
1364
1517
|
where: {
|
1365
|
-
id: item.id !== undefined ?
|
1518
|
+
id: item.id !== undefined ? {
|
1519
|
+
equals: item.id
|
1520
|
+
} : undefined,
|
1521
|
+
tradeId: item.tradeId !== undefined ? {
|
1522
|
+
equals: item.tradeId
|
1523
|
+
} : undefined,
|
1366
1524
|
},
|
1367
1525
|
update: {
|
1368
1526
|
id: item.id !== undefined ? {
|
@@ -1414,7 +1572,12 @@ exports.Position = {
|
|
1414
1572
|
}
|
1415
1573
|
: { connectOrCreate: {
|
1416
1574
|
where: {
|
1417
|
-
id: item.alpacaAccount.id !== undefined ?
|
1575
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1576
|
+
equals: item.alpacaAccount.id
|
1577
|
+
} : undefined,
|
1578
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1579
|
+
equals: item.alpacaAccount.userId
|
1580
|
+
} : undefined,
|
1418
1581
|
},
|
1419
1582
|
create: {
|
1420
1583
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1437,7 +1600,12 @@ exports.Position = {
|
|
1437
1600
|
}
|
1438
1601
|
: { connectOrCreate: item.actions.map((item) => ({
|
1439
1602
|
where: {
|
1440
|
-
id: item.id !== undefined ?
|
1603
|
+
id: item.id !== undefined ? {
|
1604
|
+
equals: item.id
|
1605
|
+
} : undefined,
|
1606
|
+
tradeId: item.tradeId !== undefined ? {
|
1607
|
+
equals: item.tradeId
|
1608
|
+
} : undefined,
|
1441
1609
|
},
|
1442
1610
|
create: {
|
1443
1611
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -1454,7 +1622,18 @@ exports.Position = {
|
|
1454
1622
|
orders: props.asset.orders ? {
|
1455
1623
|
upsert: props.asset.orders.map((item) => ({
|
1456
1624
|
where: {
|
1457
|
-
id: item.id !== undefined ?
|
1625
|
+
id: item.id !== undefined ? {
|
1626
|
+
equals: item.id
|
1627
|
+
} : undefined,
|
1628
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1629
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1630
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1631
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1632
|
+
equals: item.alpacaAccountId
|
1633
|
+
} : undefined,
|
1634
|
+
assetId: item.assetId !== undefined ? {
|
1635
|
+
equals: item.assetId
|
1636
|
+
} : undefined,
|
1458
1637
|
},
|
1459
1638
|
update: {
|
1460
1639
|
id: item.id !== undefined ? {
|
@@ -1532,6 +1711,9 @@ exports.Position = {
|
|
1532
1711
|
id: item.stopLoss.id !== undefined ? {
|
1533
1712
|
equals: item.stopLoss.id
|
1534
1713
|
} : undefined,
|
1714
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
1715
|
+
equals: item.stopLoss.orderId
|
1716
|
+
} : undefined,
|
1535
1717
|
},
|
1536
1718
|
update: {
|
1537
1719
|
id: item.stopLoss.id !== undefined ? {
|
@@ -1556,6 +1738,9 @@ exports.Position = {
|
|
1556
1738
|
id: item.takeProfit.id !== undefined ? {
|
1557
1739
|
equals: item.takeProfit.id
|
1558
1740
|
} : undefined,
|
1741
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
1742
|
+
equals: item.takeProfit.orderId
|
1743
|
+
} : undefined,
|
1559
1744
|
},
|
1560
1745
|
update: {
|
1561
1746
|
id: item.takeProfit.id !== undefined ? {
|
@@ -1580,6 +1765,9 @@ exports.Position = {
|
|
1580
1765
|
id: item.alpacaAccount.id !== undefined ? {
|
1581
1766
|
equals: item.alpacaAccount.id
|
1582
1767
|
} : undefined,
|
1768
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1769
|
+
equals: item.alpacaAccount.userId
|
1770
|
+
} : undefined,
|
1583
1771
|
},
|
1584
1772
|
update: {
|
1585
1773
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -1632,6 +1820,9 @@ exports.Position = {
|
|
1632
1820
|
id: item.action.id !== undefined ? {
|
1633
1821
|
equals: item.action.id
|
1634
1822
|
} : undefined,
|
1823
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1824
|
+
equals: item.action.tradeId
|
1825
|
+
} : undefined,
|
1635
1826
|
},
|
1636
1827
|
update: {
|
1637
1828
|
id: item.action.id !== undefined ? {
|
@@ -1694,7 +1885,10 @@ exports.Position = {
|
|
1694
1885
|
}
|
1695
1886
|
: { connectOrCreate: {
|
1696
1887
|
where: {
|
1697
|
-
id: item.stopLoss.id !== undefined ?
|
1888
|
+
id: item.stopLoss.id !== undefined ? {
|
1889
|
+
equals: item.stopLoss.id
|
1890
|
+
} : undefined,
|
1891
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
1698
1892
|
},
|
1699
1893
|
create: {
|
1700
1894
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -1710,7 +1904,10 @@ exports.Position = {
|
|
1710
1904
|
}
|
1711
1905
|
: { connectOrCreate: {
|
1712
1906
|
where: {
|
1713
|
-
id: item.takeProfit.id !== undefined ?
|
1907
|
+
id: item.takeProfit.id !== undefined ? {
|
1908
|
+
equals: item.takeProfit.id
|
1909
|
+
} : undefined,
|
1910
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
1714
1911
|
},
|
1715
1912
|
create: {
|
1716
1913
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -1726,7 +1923,12 @@ exports.Position = {
|
|
1726
1923
|
}
|
1727
1924
|
: { connectOrCreate: {
|
1728
1925
|
where: {
|
1729
|
-
id: item.alpacaAccount.id !== undefined ?
|
1926
|
+
id: item.alpacaAccount.id !== undefined ? {
|
1927
|
+
equals: item.alpacaAccount.id
|
1928
|
+
} : undefined,
|
1929
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
1930
|
+
equals: item.alpacaAccount.userId
|
1931
|
+
} : undefined,
|
1730
1932
|
},
|
1731
1933
|
create: {
|
1732
1934
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -1749,7 +1951,12 @@ exports.Position = {
|
|
1749
1951
|
}
|
1750
1952
|
: { connectOrCreate: {
|
1751
1953
|
where: {
|
1752
|
-
id: item.action.id !== undefined ?
|
1954
|
+
id: item.action.id !== undefined ? {
|
1955
|
+
equals: item.action.id
|
1956
|
+
} : undefined,
|
1957
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1958
|
+
equals: item.action.tradeId
|
1959
|
+
} : undefined,
|
1753
1960
|
},
|
1754
1961
|
create: {
|
1755
1962
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -1766,8 +1973,16 @@ exports.Position = {
|
|
1766
1973
|
newsMentions: props.asset.newsMentions ? {
|
1767
1974
|
upsert: props.asset.newsMentions.map((item) => ({
|
1768
1975
|
where: {
|
1769
|
-
id: item.id !== undefined ?
|
1976
|
+
id: item.id !== undefined ? {
|
1977
|
+
equals: item.id
|
1978
|
+
} : undefined,
|
1770
1979
|
url: item.url !== undefined ? item.url : undefined,
|
1980
|
+
assetId: item.assetId !== undefined ? {
|
1981
|
+
equals: item.assetId
|
1982
|
+
} : undefined,
|
1983
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1984
|
+
equals: item.newsArticleId
|
1985
|
+
} : undefined,
|
1771
1986
|
},
|
1772
1987
|
update: {
|
1773
1988
|
id: item.id !== undefined ? {
|
@@ -1873,7 +2088,9 @@ exports.Position = {
|
|
1873
2088
|
}
|
1874
2089
|
: { connectOrCreate: {
|
1875
2090
|
where: {
|
1876
|
-
id: item.news.id !== undefined ?
|
2091
|
+
id: item.news.id !== undefined ? {
|
2092
|
+
equals: item.news.id
|
2093
|
+
} : undefined,
|
1877
2094
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
1878
2095
|
title: item.news.title !== undefined ? {
|
1879
2096
|
equals: item.news.title
|
@@ -1964,7 +2181,15 @@ exports.Position = {
|
|
1964
2181
|
}
|
1965
2182
|
: { connectOrCreate: props.asset.trades.map((item) => ({
|
1966
2183
|
where: {
|
1967
|
-
id: item.id !== undefined ?
|
2184
|
+
id: item.id !== undefined ? {
|
2185
|
+
equals: item.id
|
2186
|
+
} : undefined,
|
2187
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2188
|
+
equals: item.alpacaAccountId
|
2189
|
+
} : undefined,
|
2190
|
+
assetId: item.assetId !== undefined ? {
|
2191
|
+
equals: item.assetId
|
2192
|
+
} : undefined,
|
1968
2193
|
},
|
1969
2194
|
create: {
|
1970
2195
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1986,7 +2211,12 @@ exports.Position = {
|
|
1986
2211
|
}
|
1987
2212
|
: { connectOrCreate: {
|
1988
2213
|
where: {
|
1989
|
-
id: item.alpacaAccount.id !== undefined ?
|
2214
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2215
|
+
equals: item.alpacaAccount.id
|
2216
|
+
} : undefined,
|
2217
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2218
|
+
equals: item.alpacaAccount.userId
|
2219
|
+
} : undefined,
|
1990
2220
|
},
|
1991
2221
|
create: {
|
1992
2222
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2009,7 +2239,12 @@ exports.Position = {
|
|
2009
2239
|
}
|
2010
2240
|
: { connectOrCreate: item.actions.map((item) => ({
|
2011
2241
|
where: {
|
2012
|
-
id: item.id !== undefined ?
|
2242
|
+
id: item.id !== undefined ? {
|
2243
|
+
equals: item.id
|
2244
|
+
} : undefined,
|
2245
|
+
tradeId: item.tradeId !== undefined ? {
|
2246
|
+
equals: item.tradeId
|
2247
|
+
} : undefined,
|
2013
2248
|
},
|
2014
2249
|
create: {
|
2015
2250
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2031,7 +2266,18 @@ exports.Position = {
|
|
2031
2266
|
}
|
2032
2267
|
: { connectOrCreate: props.asset.orders.map((item) => ({
|
2033
2268
|
where: {
|
2034
|
-
id: item.id !== undefined ?
|
2269
|
+
id: item.id !== undefined ? {
|
2270
|
+
equals: item.id
|
2271
|
+
} : undefined,
|
2272
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2273
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2274
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2275
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2276
|
+
equals: item.alpacaAccountId
|
2277
|
+
} : undefined,
|
2278
|
+
assetId: item.assetId !== undefined ? {
|
2279
|
+
equals: item.assetId
|
2280
|
+
} : undefined,
|
2035
2281
|
},
|
2036
2282
|
create: {
|
2037
2283
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2064,7 +2310,10 @@ exports.Position = {
|
|
2064
2310
|
}
|
2065
2311
|
: { connectOrCreate: {
|
2066
2312
|
where: {
|
2067
|
-
id: item.stopLoss.id !== undefined ?
|
2313
|
+
id: item.stopLoss.id !== undefined ? {
|
2314
|
+
equals: item.stopLoss.id
|
2315
|
+
} : undefined,
|
2316
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2068
2317
|
},
|
2069
2318
|
create: {
|
2070
2319
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -2080,7 +2329,10 @@ exports.Position = {
|
|
2080
2329
|
}
|
2081
2330
|
: { connectOrCreate: {
|
2082
2331
|
where: {
|
2083
|
-
id: item.takeProfit.id !== undefined ?
|
2332
|
+
id: item.takeProfit.id !== undefined ? {
|
2333
|
+
equals: item.takeProfit.id
|
2334
|
+
} : undefined,
|
2335
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2084
2336
|
},
|
2085
2337
|
create: {
|
2086
2338
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -2096,7 +2348,12 @@ exports.Position = {
|
|
2096
2348
|
}
|
2097
2349
|
: { connectOrCreate: {
|
2098
2350
|
where: {
|
2099
|
-
id: item.alpacaAccount.id !== undefined ?
|
2351
|
+
id: item.alpacaAccount.id !== undefined ? {
|
2352
|
+
equals: item.alpacaAccount.id
|
2353
|
+
} : undefined,
|
2354
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
2355
|
+
equals: item.alpacaAccount.userId
|
2356
|
+
} : undefined,
|
2100
2357
|
},
|
2101
2358
|
create: {
|
2102
2359
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -2119,7 +2376,12 @@ exports.Position = {
|
|
2119
2376
|
}
|
2120
2377
|
: { connectOrCreate: {
|
2121
2378
|
where: {
|
2122
|
-
id: item.action.id !== undefined ?
|
2379
|
+
id: item.action.id !== undefined ? {
|
2380
|
+
equals: item.action.id
|
2381
|
+
} : undefined,
|
2382
|
+
tradeId: item.action.tradeId !== undefined ? {
|
2383
|
+
equals: item.action.tradeId
|
2384
|
+
} : undefined,
|
2123
2385
|
},
|
2124
2386
|
create: {
|
2125
2387
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -2141,8 +2403,16 @@ exports.Position = {
|
|
2141
2403
|
}
|
2142
2404
|
: { connectOrCreate: props.asset.newsMentions.map((item) => ({
|
2143
2405
|
where: {
|
2144
|
-
id: item.id !== undefined ?
|
2406
|
+
id: item.id !== undefined ? {
|
2407
|
+
equals: item.id
|
2408
|
+
} : undefined,
|
2145
2409
|
url: item.url !== undefined ? item.url : undefined,
|
2410
|
+
assetId: item.assetId !== undefined ? {
|
2411
|
+
equals: item.assetId
|
2412
|
+
} : undefined,
|
2413
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2414
|
+
equals: item.newsArticleId
|
2415
|
+
} : undefined,
|
2146
2416
|
},
|
2147
2417
|
create: {
|
2148
2418
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -2157,7 +2427,9 @@ exports.Position = {
|
|
2157
2427
|
}
|
2158
2428
|
: { connectOrCreate: {
|
2159
2429
|
where: {
|
2160
|
-
id: item.news.id !== undefined ?
|
2430
|
+
id: item.news.id !== undefined ? {
|
2431
|
+
equals: item.news.id
|
2432
|
+
} : undefined,
|
2161
2433
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
2162
2434
|
title: item.news.title !== undefined ? {
|
2163
2435
|
equals: item.news.title
|
@@ -2192,6 +2464,9 @@ exports.Position = {
|
|
2192
2464
|
id: props.alpacaAccount.id !== undefined ? {
|
2193
2465
|
equals: props.alpacaAccount.id
|
2194
2466
|
} : undefined,
|
2467
|
+
userId: props.alpacaAccount.userId !== undefined ? {
|
2468
|
+
equals: props.alpacaAccount.userId
|
2469
|
+
} : undefined,
|
2195
2470
|
},
|
2196
2471
|
update: {
|
2197
2472
|
id: props.alpacaAccount.id !== undefined ? {
|
@@ -2280,9 +2555,21 @@ exports.Position = {
|
|
2280
2555
|
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
2281
2556
|
equals: props.alpacaAccount.user.customer.id
|
2282
2557
|
} : undefined,
|
2558
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
2559
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
2560
|
+
} : undefined,
|
2283
2561
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
2284
2562
|
equals: props.alpacaAccount.user.customer.name
|
2285
2563
|
} : undefined,
|
2564
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
|
2565
|
+
equals: props.alpacaAccount.user.customer.stripeCustomerId
|
2566
|
+
} : undefined,
|
2567
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
|
2568
|
+
equals: props.alpacaAccount.user.customer.stripeSubscriptionId
|
2569
|
+
} : undefined,
|
2570
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
2571
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
2572
|
+
} : undefined,
|
2286
2573
|
},
|
2287
2574
|
update: {
|
2288
2575
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -2321,7 +2608,15 @@ exports.Position = {
|
|
2321
2608
|
accounts: props.alpacaAccount.user.accounts ? {
|
2322
2609
|
upsert: props.alpacaAccount.user.accounts.map((item) => ({
|
2323
2610
|
where: {
|
2324
|
-
id: item.id !== undefined ?
|
2611
|
+
id: item.id !== undefined ? {
|
2612
|
+
equals: item.id
|
2613
|
+
} : undefined,
|
2614
|
+
userId: item.userId !== undefined ? {
|
2615
|
+
equals: item.userId
|
2616
|
+
} : undefined,
|
2617
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
2618
|
+
equals: item.providerAccountId
|
2619
|
+
} : undefined,
|
2325
2620
|
},
|
2326
2621
|
update: {
|
2327
2622
|
id: item.id !== undefined ? {
|
@@ -2375,7 +2670,12 @@ exports.Position = {
|
|
2375
2670
|
sessions: props.alpacaAccount.user.sessions ? {
|
2376
2671
|
upsert: props.alpacaAccount.user.sessions.map((item) => ({
|
2377
2672
|
where: {
|
2378
|
-
id: item.id !== undefined ?
|
2673
|
+
id: item.id !== undefined ? {
|
2674
|
+
equals: item.id
|
2675
|
+
} : undefined,
|
2676
|
+
userId: item.userId !== undefined ? {
|
2677
|
+
equals: item.userId
|
2678
|
+
} : undefined,
|
2379
2679
|
},
|
2380
2680
|
update: {
|
2381
2681
|
id: item.id !== undefined ? {
|
@@ -2397,7 +2697,12 @@ exports.Position = {
|
|
2397
2697
|
authenticators: props.alpacaAccount.user.authenticators ? {
|
2398
2698
|
upsert: props.alpacaAccount.user.authenticators.map((item) => ({
|
2399
2699
|
where: {
|
2400
|
-
id: item.id !== undefined ?
|
2700
|
+
id: item.id !== undefined ? {
|
2701
|
+
equals: item.id
|
2702
|
+
} : undefined,
|
2703
|
+
userId: item.userId !== undefined ? {
|
2704
|
+
equals: item.userId
|
2705
|
+
} : undefined,
|
2401
2706
|
},
|
2402
2707
|
update: {
|
2403
2708
|
id: item.id !== undefined ? {
|
@@ -2441,10 +2746,20 @@ exports.Position = {
|
|
2441
2746
|
}
|
2442
2747
|
: { connectOrCreate: {
|
2443
2748
|
where: {
|
2444
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
2749
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
2750
|
+
equals: props.alpacaAccount.user.customer.id
|
2751
|
+
} : undefined,
|
2752
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
2753
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
2754
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
2755
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
2756
|
+
} : undefined,
|
2445
2757
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
2446
2758
|
equals: props.alpacaAccount.user.customer.name
|
2447
2759
|
} : undefined,
|
2760
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
2761
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
2762
|
+
} : undefined,
|
2448
2763
|
},
|
2449
2764
|
create: {
|
2450
2765
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -2465,7 +2780,15 @@ exports.Position = {
|
|
2465
2780
|
}
|
2466
2781
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
2467
2782
|
where: {
|
2468
|
-
id: item.id !== undefined ?
|
2783
|
+
id: item.id !== undefined ? {
|
2784
|
+
equals: item.id
|
2785
|
+
} : undefined,
|
2786
|
+
userId: item.userId !== undefined ? {
|
2787
|
+
equals: item.userId
|
2788
|
+
} : undefined,
|
2789
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
2790
|
+
equals: item.providerAccountId
|
2791
|
+
} : undefined,
|
2469
2792
|
},
|
2470
2793
|
create: {
|
2471
2794
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -2489,7 +2812,12 @@ exports.Position = {
|
|
2489
2812
|
}
|
2490
2813
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
2491
2814
|
where: {
|
2492
|
-
id: item.id !== undefined ?
|
2815
|
+
id: item.id !== undefined ? {
|
2816
|
+
equals: item.id
|
2817
|
+
} : undefined,
|
2818
|
+
userId: item.userId !== undefined ? {
|
2819
|
+
equals: item.userId
|
2820
|
+
} : undefined,
|
2493
2821
|
},
|
2494
2822
|
create: {
|
2495
2823
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -2505,7 +2833,12 @@ exports.Position = {
|
|
2505
2833
|
}
|
2506
2834
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
2507
2835
|
where: {
|
2508
|
-
id: item.id !== undefined ?
|
2836
|
+
id: item.id !== undefined ? {
|
2837
|
+
equals: item.id
|
2838
|
+
} : undefined,
|
2839
|
+
userId: item.userId !== undefined ? {
|
2840
|
+
equals: item.userId
|
2841
|
+
} : undefined,
|
2509
2842
|
},
|
2510
2843
|
create: {
|
2511
2844
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -2520,7 +2853,15 @@ exports.Position = {
|
|
2520
2853
|
trades: props.alpacaAccount.trades ? {
|
2521
2854
|
upsert: props.alpacaAccount.trades.map((item) => ({
|
2522
2855
|
where: {
|
2523
|
-
id: item.id !== undefined ?
|
2856
|
+
id: item.id !== undefined ? {
|
2857
|
+
equals: item.id
|
2858
|
+
} : undefined,
|
2859
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2860
|
+
equals: item.alpacaAccountId
|
2861
|
+
} : undefined,
|
2862
|
+
assetId: item.assetId !== undefined ? {
|
2863
|
+
equals: item.assetId
|
2864
|
+
} : undefined,
|
2524
2865
|
},
|
2525
2866
|
update: {
|
2526
2867
|
id: item.id !== undefined ? {
|
@@ -2804,7 +3145,12 @@ exports.Position = {
|
|
2804
3145
|
actions: item.actions ? {
|
2805
3146
|
upsert: item.actions.map((item) => ({
|
2806
3147
|
where: {
|
2807
|
-
id: item.id !== undefined ?
|
3148
|
+
id: item.id !== undefined ? {
|
3149
|
+
equals: item.id
|
3150
|
+
} : undefined,
|
3151
|
+
tradeId: item.tradeId !== undefined ? {
|
3152
|
+
equals: item.tradeId
|
3153
|
+
} : undefined,
|
2808
3154
|
},
|
2809
3155
|
update: {
|
2810
3156
|
id: item.id !== undefined ? {
|
@@ -2856,7 +3202,9 @@ exports.Position = {
|
|
2856
3202
|
}
|
2857
3203
|
: { connectOrCreate: {
|
2858
3204
|
where: {
|
2859
|
-
id: item.asset.id !== undefined ?
|
3205
|
+
id: item.asset.id !== undefined ? {
|
3206
|
+
equals: item.asset.id
|
3207
|
+
} : undefined,
|
2860
3208
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2861
3209
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2862
3210
|
},
|
@@ -2927,7 +3275,12 @@ exports.Position = {
|
|
2927
3275
|
}
|
2928
3276
|
: { connectOrCreate: item.actions.map((item) => ({
|
2929
3277
|
where: {
|
2930
|
-
id: item.id !== undefined ?
|
3278
|
+
id: item.id !== undefined ? {
|
3279
|
+
equals: item.id
|
3280
|
+
} : undefined,
|
3281
|
+
tradeId: item.tradeId !== undefined ? {
|
3282
|
+
equals: item.tradeId
|
3283
|
+
} : undefined,
|
2931
3284
|
},
|
2932
3285
|
create: {
|
2933
3286
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2944,7 +3297,18 @@ exports.Position = {
|
|
2944
3297
|
orders: props.alpacaAccount.orders ? {
|
2945
3298
|
upsert: props.alpacaAccount.orders.map((item) => ({
|
2946
3299
|
where: {
|
2947
|
-
id: item.id !== undefined ?
|
3300
|
+
id: item.id !== undefined ? {
|
3301
|
+
equals: item.id
|
3302
|
+
} : undefined,
|
3303
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3304
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3305
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
3306
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3307
|
+
equals: item.alpacaAccountId
|
3308
|
+
} : undefined,
|
3309
|
+
assetId: item.assetId !== undefined ? {
|
3310
|
+
equals: item.assetId
|
3311
|
+
} : undefined,
|
2948
3312
|
},
|
2949
3313
|
update: {
|
2950
3314
|
id: item.id !== undefined ? {
|
@@ -3022,6 +3386,9 @@ exports.Position = {
|
|
3022
3386
|
id: item.stopLoss.id !== undefined ? {
|
3023
3387
|
equals: item.stopLoss.id
|
3024
3388
|
} : undefined,
|
3389
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
3390
|
+
equals: item.stopLoss.orderId
|
3391
|
+
} : undefined,
|
3025
3392
|
},
|
3026
3393
|
update: {
|
3027
3394
|
id: item.stopLoss.id !== undefined ? {
|
@@ -3046,6 +3413,9 @@ exports.Position = {
|
|
3046
3413
|
id: item.takeProfit.id !== undefined ? {
|
3047
3414
|
equals: item.takeProfit.id
|
3048
3415
|
} : undefined,
|
3416
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
3417
|
+
equals: item.takeProfit.orderId
|
3418
|
+
} : undefined,
|
3049
3419
|
},
|
3050
3420
|
update: {
|
3051
3421
|
id: item.takeProfit.id !== undefined ? {
|
@@ -3070,6 +3440,9 @@ exports.Position = {
|
|
3070
3440
|
id: item.action.id !== undefined ? {
|
3071
3441
|
equals: item.action.id
|
3072
3442
|
} : undefined,
|
3443
|
+
tradeId: item.action.tradeId !== undefined ? {
|
3444
|
+
equals: item.action.tradeId
|
3445
|
+
} : undefined,
|
3073
3446
|
},
|
3074
3447
|
update: {
|
3075
3448
|
id: item.action.id !== undefined ? {
|
@@ -3374,7 +3747,10 @@ exports.Position = {
|
|
3374
3747
|
}
|
3375
3748
|
: { connectOrCreate: {
|
3376
3749
|
where: {
|
3377
|
-
id: item.stopLoss.id !== undefined ?
|
3750
|
+
id: item.stopLoss.id !== undefined ? {
|
3751
|
+
equals: item.stopLoss.id
|
3752
|
+
} : undefined,
|
3753
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3378
3754
|
},
|
3379
3755
|
create: {
|
3380
3756
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -3390,7 +3766,10 @@ exports.Position = {
|
|
3390
3766
|
}
|
3391
3767
|
: { connectOrCreate: {
|
3392
3768
|
where: {
|
3393
|
-
id: item.takeProfit.id !== undefined ?
|
3769
|
+
id: item.takeProfit.id !== undefined ? {
|
3770
|
+
equals: item.takeProfit.id
|
3771
|
+
} : undefined,
|
3772
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3394
3773
|
},
|
3395
3774
|
create: {
|
3396
3775
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -3406,7 +3785,12 @@ exports.Position = {
|
|
3406
3785
|
}
|
3407
3786
|
: { connectOrCreate: {
|
3408
3787
|
where: {
|
3409
|
-
id: item.action.id !== undefined ?
|
3788
|
+
id: item.action.id !== undefined ? {
|
3789
|
+
equals: item.action.id
|
3790
|
+
} : undefined,
|
3791
|
+
tradeId: item.action.tradeId !== undefined ? {
|
3792
|
+
equals: item.action.tradeId
|
3793
|
+
} : undefined,
|
3410
3794
|
},
|
3411
3795
|
create: {
|
3412
3796
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -3425,7 +3809,9 @@ exports.Position = {
|
|
3425
3809
|
}
|
3426
3810
|
: { connectOrCreate: {
|
3427
3811
|
where: {
|
3428
|
-
id: item.asset.id !== undefined ?
|
3812
|
+
id: item.asset.id !== undefined ? {
|
3813
|
+
equals: item.asset.id
|
3814
|
+
} : undefined,
|
3429
3815
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3430
3816
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3431
3817
|
},
|
@@ -3494,7 +3880,12 @@ exports.Position = {
|
|
3494
3880
|
alerts: props.alpacaAccount.alerts ? {
|
3495
3881
|
upsert: props.alpacaAccount.alerts.map((item) => ({
|
3496
3882
|
where: {
|
3497
|
-
id: item.id !== undefined ?
|
3883
|
+
id: item.id !== undefined ? {
|
3884
|
+
equals: item.id
|
3885
|
+
} : undefined,
|
3886
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3887
|
+
equals: item.alpacaAccountId
|
3888
|
+
} : undefined,
|
3498
3889
|
},
|
3499
3890
|
update: {
|
3500
3891
|
id: item.id !== undefined ? {
|
@@ -3536,7 +3927,9 @@ exports.Position = {
|
|
3536
3927
|
}
|
3537
3928
|
: { connectOrCreate: {
|
3538
3929
|
where: {
|
3539
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
3930
|
+
id: props.alpacaAccount.user.id !== undefined ? {
|
3931
|
+
equals: props.alpacaAccount.user.id
|
3932
|
+
} : undefined,
|
3540
3933
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
3541
3934
|
name: props.alpacaAccount.user.name !== undefined ? {
|
3542
3935
|
equals: props.alpacaAccount.user.name
|
@@ -3562,10 +3955,20 @@ exports.Position = {
|
|
3562
3955
|
}
|
3563
3956
|
: { connectOrCreate: {
|
3564
3957
|
where: {
|
3565
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
3958
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
3959
|
+
equals: props.alpacaAccount.user.customer.id
|
3960
|
+
} : undefined,
|
3961
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
3962
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
3963
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
3964
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
3965
|
+
} : undefined,
|
3566
3966
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
3567
3967
|
equals: props.alpacaAccount.user.customer.name
|
3568
3968
|
} : undefined,
|
3969
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
3970
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
3971
|
+
} : undefined,
|
3569
3972
|
},
|
3570
3973
|
create: {
|
3571
3974
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -3586,7 +3989,15 @@ exports.Position = {
|
|
3586
3989
|
}
|
3587
3990
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
3588
3991
|
where: {
|
3589
|
-
id: item.id !== undefined ?
|
3992
|
+
id: item.id !== undefined ? {
|
3993
|
+
equals: item.id
|
3994
|
+
} : undefined,
|
3995
|
+
userId: item.userId !== undefined ? {
|
3996
|
+
equals: item.userId
|
3997
|
+
} : undefined,
|
3998
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
3999
|
+
equals: item.providerAccountId
|
4000
|
+
} : undefined,
|
3590
4001
|
},
|
3591
4002
|
create: {
|
3592
4003
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -3610,7 +4021,12 @@ exports.Position = {
|
|
3610
4021
|
}
|
3611
4022
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
3612
4023
|
where: {
|
3613
|
-
id: item.id !== undefined ?
|
4024
|
+
id: item.id !== undefined ? {
|
4025
|
+
equals: item.id
|
4026
|
+
} : undefined,
|
4027
|
+
userId: item.userId !== undefined ? {
|
4028
|
+
equals: item.userId
|
4029
|
+
} : undefined,
|
3614
4030
|
},
|
3615
4031
|
create: {
|
3616
4032
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -3626,7 +4042,12 @@ exports.Position = {
|
|
3626
4042
|
}
|
3627
4043
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
3628
4044
|
where: {
|
3629
|
-
id: item.id !== undefined ?
|
4045
|
+
id: item.id !== undefined ? {
|
4046
|
+
equals: item.id
|
4047
|
+
} : undefined,
|
4048
|
+
userId: item.userId !== undefined ? {
|
4049
|
+
equals: item.userId
|
4050
|
+
} : undefined,
|
3630
4051
|
},
|
3631
4052
|
create: {
|
3632
4053
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -3646,7 +4067,15 @@ exports.Position = {
|
|
3646
4067
|
}
|
3647
4068
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
3648
4069
|
where: {
|
3649
|
-
id: item.id !== undefined ?
|
4070
|
+
id: item.id !== undefined ? {
|
4071
|
+
equals: item.id
|
4072
|
+
} : undefined,
|
4073
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4074
|
+
equals: item.alpacaAccountId
|
4075
|
+
} : undefined,
|
4076
|
+
assetId: item.assetId !== undefined ? {
|
4077
|
+
equals: item.assetId
|
4078
|
+
} : undefined,
|
3650
4079
|
},
|
3651
4080
|
create: {
|
3652
4081
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3668,7 +4097,9 @@ exports.Position = {
|
|
3668
4097
|
}
|
3669
4098
|
: { connectOrCreate: {
|
3670
4099
|
where: {
|
3671
|
-
id: item.asset.id !== undefined ?
|
4100
|
+
id: item.asset.id !== undefined ? {
|
4101
|
+
equals: item.asset.id
|
4102
|
+
} : undefined,
|
3672
4103
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3673
4104
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3674
4105
|
},
|
@@ -3739,7 +4170,12 @@ exports.Position = {
|
|
3739
4170
|
}
|
3740
4171
|
: { connectOrCreate: item.actions.map((item) => ({
|
3741
4172
|
where: {
|
3742
|
-
id: item.id !== undefined ?
|
4173
|
+
id: item.id !== undefined ? {
|
4174
|
+
equals: item.id
|
4175
|
+
} : undefined,
|
4176
|
+
tradeId: item.tradeId !== undefined ? {
|
4177
|
+
equals: item.tradeId
|
4178
|
+
} : undefined,
|
3743
4179
|
},
|
3744
4180
|
create: {
|
3745
4181
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -3761,7 +4197,18 @@ exports.Position = {
|
|
3761
4197
|
}
|
3762
4198
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
3763
4199
|
where: {
|
3764
|
-
id: item.id !== undefined ?
|
4200
|
+
id: item.id !== undefined ? {
|
4201
|
+
equals: item.id
|
4202
|
+
} : undefined,
|
4203
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4204
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4205
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4206
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4207
|
+
equals: item.alpacaAccountId
|
4208
|
+
} : undefined,
|
4209
|
+
assetId: item.assetId !== undefined ? {
|
4210
|
+
equals: item.assetId
|
4211
|
+
} : undefined,
|
3765
4212
|
},
|
3766
4213
|
create: {
|
3767
4214
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -3794,7 +4241,10 @@ exports.Position = {
|
|
3794
4241
|
}
|
3795
4242
|
: { connectOrCreate: {
|
3796
4243
|
where: {
|
3797
|
-
id: item.stopLoss.id !== undefined ?
|
4244
|
+
id: item.stopLoss.id !== undefined ? {
|
4245
|
+
equals: item.stopLoss.id
|
4246
|
+
} : undefined,
|
4247
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3798
4248
|
},
|
3799
4249
|
create: {
|
3800
4250
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -3810,7 +4260,10 @@ exports.Position = {
|
|
3810
4260
|
}
|
3811
4261
|
: { connectOrCreate: {
|
3812
4262
|
where: {
|
3813
|
-
id: item.takeProfit.id !== undefined ?
|
4263
|
+
id: item.takeProfit.id !== undefined ? {
|
4264
|
+
equals: item.takeProfit.id
|
4265
|
+
} : undefined,
|
4266
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3814
4267
|
},
|
3815
4268
|
create: {
|
3816
4269
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -3826,7 +4279,12 @@ exports.Position = {
|
|
3826
4279
|
}
|
3827
4280
|
: { connectOrCreate: {
|
3828
4281
|
where: {
|
3829
|
-
id: item.action.id !== undefined ?
|
4282
|
+
id: item.action.id !== undefined ? {
|
4283
|
+
equals: item.action.id
|
4284
|
+
} : undefined,
|
4285
|
+
tradeId: item.action.tradeId !== undefined ? {
|
4286
|
+
equals: item.action.tradeId
|
4287
|
+
} : undefined,
|
3830
4288
|
},
|
3831
4289
|
create: {
|
3832
4290
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -3845,7 +4303,9 @@ exports.Position = {
|
|
3845
4303
|
}
|
3846
4304
|
: { connectOrCreate: {
|
3847
4305
|
where: {
|
3848
|
-
id: item.asset.id !== undefined ?
|
4306
|
+
id: item.asset.id !== undefined ? {
|
4307
|
+
equals: item.asset.id
|
4308
|
+
} : undefined,
|
3849
4309
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3850
4310
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3851
4311
|
},
|
@@ -3919,7 +4379,12 @@ exports.Position = {
|
|
3919
4379
|
}
|
3920
4380
|
: { connectOrCreate: props.alpacaAccount.alerts.map((item) => ({
|
3921
4381
|
where: {
|
3922
|
-
id: item.id !== undefined ?
|
4382
|
+
id: item.id !== undefined ? {
|
4383
|
+
equals: item.id
|
4384
|
+
} : undefined,
|
4385
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4386
|
+
equals: item.alpacaAccountId
|
4387
|
+
} : undefined,
|
3923
4388
|
},
|
3924
4389
|
create: {
|
3925
4390
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -3965,8 +4430,12 @@ exports.Position = {
|
|
3965
4430
|
}`;
|
3966
4431
|
const variables = props.map(prop => ({
|
3967
4432
|
where: {
|
3968
|
-
id: prop.id !== undefined ?
|
3969
|
-
|
4433
|
+
id: prop.id !== undefined ? {
|
4434
|
+
equals: prop.id
|
4435
|
+
} : undefined,
|
4436
|
+
assetId: prop.assetId !== undefined ? {
|
4437
|
+
equals: prop.assetId
|
4438
|
+
} : undefined,
|
3970
4439
|
averageEntryPrice: prop.averageEntryPrice !== undefined ? prop.averageEntryPrice : undefined,
|
3971
4440
|
qty: prop.qty !== undefined ? prop.qty : undefined,
|
3972
4441
|
qtyAvailable: prop.qtyAvailable !== undefined ? prop.qtyAvailable : undefined,
|
@@ -3979,7 +4448,9 @@ exports.Position = {
|
|
3979
4448
|
currentPrice: prop.currentPrice !== undefined ? prop.currentPrice : undefined,
|
3980
4449
|
lastTradePrice: prop.lastTradePrice !== undefined ? prop.lastTradePrice : undefined,
|
3981
4450
|
changeToday: prop.changeToday !== undefined ? prop.changeToday : undefined,
|
3982
|
-
alpacaAccountId: prop.alpacaAccountId !== undefined ?
|
4451
|
+
alpacaAccountId: prop.alpacaAccountId !== undefined ? {
|
4452
|
+
equals: prop.alpacaAccountId
|
4453
|
+
} : undefined,
|
3983
4454
|
},
|
3984
4455
|
data: {
|
3985
4456
|
id: prop.id !== undefined ? {
|
@@ -4209,7 +4680,15 @@ exports.Position = {
|
|
4209
4680
|
trades: prop.asset.trades ? {
|
4210
4681
|
upsert: prop.asset.trades.map((item) => ({
|
4211
4682
|
where: {
|
4212
|
-
id: item.id !== undefined ?
|
4683
|
+
id: item.id !== undefined ? {
|
4684
|
+
equals: item.id
|
4685
|
+
} : undefined,
|
4686
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4687
|
+
equals: item.alpacaAccountId
|
4688
|
+
} : undefined,
|
4689
|
+
assetId: item.assetId !== undefined ? {
|
4690
|
+
equals: item.assetId
|
4691
|
+
} : undefined,
|
4213
4692
|
},
|
4214
4693
|
update: {
|
4215
4694
|
id: item.id !== undefined ? {
|
@@ -4254,6 +4733,9 @@ exports.Position = {
|
|
4254
4733
|
id: item.alpacaAccount.id !== undefined ? {
|
4255
4734
|
equals: item.alpacaAccount.id
|
4256
4735
|
} : undefined,
|
4736
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4737
|
+
equals: item.alpacaAccount.userId
|
4738
|
+
} : undefined,
|
4257
4739
|
},
|
4258
4740
|
update: {
|
4259
4741
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -4303,7 +4785,12 @@ exports.Position = {
|
|
4303
4785
|
actions: item.actions ? {
|
4304
4786
|
upsert: item.actions.map((item) => ({
|
4305
4787
|
where: {
|
4306
|
-
id: item.id !== undefined ?
|
4788
|
+
id: item.id !== undefined ? {
|
4789
|
+
equals: item.id
|
4790
|
+
} : undefined,
|
4791
|
+
tradeId: item.tradeId !== undefined ? {
|
4792
|
+
equals: item.tradeId
|
4793
|
+
} : undefined,
|
4307
4794
|
},
|
4308
4795
|
update: {
|
4309
4796
|
id: item.id !== undefined ? {
|
@@ -4355,7 +4842,12 @@ exports.Position = {
|
|
4355
4842
|
}
|
4356
4843
|
: { connectOrCreate: {
|
4357
4844
|
where: {
|
4358
|
-
id: item.alpacaAccount.id !== undefined ?
|
4845
|
+
id: item.alpacaAccount.id !== undefined ? {
|
4846
|
+
equals: item.alpacaAccount.id
|
4847
|
+
} : undefined,
|
4848
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
4849
|
+
equals: item.alpacaAccount.userId
|
4850
|
+
} : undefined,
|
4359
4851
|
},
|
4360
4852
|
create: {
|
4361
4853
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -4378,7 +4870,12 @@ exports.Position = {
|
|
4378
4870
|
}
|
4379
4871
|
: { connectOrCreate: item.actions.map((item) => ({
|
4380
4872
|
where: {
|
4381
|
-
id: item.id !== undefined ?
|
4873
|
+
id: item.id !== undefined ? {
|
4874
|
+
equals: item.id
|
4875
|
+
} : undefined,
|
4876
|
+
tradeId: item.tradeId !== undefined ? {
|
4877
|
+
equals: item.tradeId
|
4878
|
+
} : undefined,
|
4382
4879
|
},
|
4383
4880
|
create: {
|
4384
4881
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -4395,7 +4892,18 @@ exports.Position = {
|
|
4395
4892
|
orders: prop.asset.orders ? {
|
4396
4893
|
upsert: prop.asset.orders.map((item) => ({
|
4397
4894
|
where: {
|
4398
|
-
id: item.id !== undefined ?
|
4895
|
+
id: item.id !== undefined ? {
|
4896
|
+
equals: item.id
|
4897
|
+
} : undefined,
|
4898
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4899
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4900
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4901
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4902
|
+
equals: item.alpacaAccountId
|
4903
|
+
} : undefined,
|
4904
|
+
assetId: item.assetId !== undefined ? {
|
4905
|
+
equals: item.assetId
|
4906
|
+
} : undefined,
|
4399
4907
|
},
|
4400
4908
|
update: {
|
4401
4909
|
id: item.id !== undefined ? {
|
@@ -4473,6 +4981,9 @@ exports.Position = {
|
|
4473
4981
|
id: item.stopLoss.id !== undefined ? {
|
4474
4982
|
equals: item.stopLoss.id
|
4475
4983
|
} : undefined,
|
4984
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
4985
|
+
equals: item.stopLoss.orderId
|
4986
|
+
} : undefined,
|
4476
4987
|
},
|
4477
4988
|
update: {
|
4478
4989
|
id: item.stopLoss.id !== undefined ? {
|
@@ -4497,6 +5008,9 @@ exports.Position = {
|
|
4497
5008
|
id: item.takeProfit.id !== undefined ? {
|
4498
5009
|
equals: item.takeProfit.id
|
4499
5010
|
} : undefined,
|
5011
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
5012
|
+
equals: item.takeProfit.orderId
|
5013
|
+
} : undefined,
|
4500
5014
|
},
|
4501
5015
|
update: {
|
4502
5016
|
id: item.takeProfit.id !== undefined ? {
|
@@ -4521,6 +5035,9 @@ exports.Position = {
|
|
4521
5035
|
id: item.alpacaAccount.id !== undefined ? {
|
4522
5036
|
equals: item.alpacaAccount.id
|
4523
5037
|
} : undefined,
|
5038
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
5039
|
+
equals: item.alpacaAccount.userId
|
5040
|
+
} : undefined,
|
4524
5041
|
},
|
4525
5042
|
update: {
|
4526
5043
|
id: item.alpacaAccount.id !== undefined ? {
|
@@ -4573,6 +5090,9 @@ exports.Position = {
|
|
4573
5090
|
id: item.action.id !== undefined ? {
|
4574
5091
|
equals: item.action.id
|
4575
5092
|
} : undefined,
|
5093
|
+
tradeId: item.action.tradeId !== undefined ? {
|
5094
|
+
equals: item.action.tradeId
|
5095
|
+
} : undefined,
|
4576
5096
|
},
|
4577
5097
|
update: {
|
4578
5098
|
id: item.action.id !== undefined ? {
|
@@ -4635,7 +5155,10 @@ exports.Position = {
|
|
4635
5155
|
}
|
4636
5156
|
: { connectOrCreate: {
|
4637
5157
|
where: {
|
4638
|
-
id: item.stopLoss.id !== undefined ?
|
5158
|
+
id: item.stopLoss.id !== undefined ? {
|
5159
|
+
equals: item.stopLoss.id
|
5160
|
+
} : undefined,
|
5161
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
4639
5162
|
},
|
4640
5163
|
create: {
|
4641
5164
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -4651,7 +5174,10 @@ exports.Position = {
|
|
4651
5174
|
}
|
4652
5175
|
: { connectOrCreate: {
|
4653
5176
|
where: {
|
4654
|
-
id: item.takeProfit.id !== undefined ?
|
5177
|
+
id: item.takeProfit.id !== undefined ? {
|
5178
|
+
equals: item.takeProfit.id
|
5179
|
+
} : undefined,
|
5180
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
4655
5181
|
},
|
4656
5182
|
create: {
|
4657
5183
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -4667,7 +5193,12 @@ exports.Position = {
|
|
4667
5193
|
}
|
4668
5194
|
: { connectOrCreate: {
|
4669
5195
|
where: {
|
4670
|
-
id: item.alpacaAccount.id !== undefined ?
|
5196
|
+
id: item.alpacaAccount.id !== undefined ? {
|
5197
|
+
equals: item.alpacaAccount.id
|
5198
|
+
} : undefined,
|
5199
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
5200
|
+
equals: item.alpacaAccount.userId
|
5201
|
+
} : undefined,
|
4671
5202
|
},
|
4672
5203
|
create: {
|
4673
5204
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -4690,7 +5221,12 @@ exports.Position = {
|
|
4690
5221
|
}
|
4691
5222
|
: { connectOrCreate: {
|
4692
5223
|
where: {
|
4693
|
-
id: item.action.id !== undefined ?
|
5224
|
+
id: item.action.id !== undefined ? {
|
5225
|
+
equals: item.action.id
|
5226
|
+
} : undefined,
|
5227
|
+
tradeId: item.action.tradeId !== undefined ? {
|
5228
|
+
equals: item.action.tradeId
|
5229
|
+
} : undefined,
|
4694
5230
|
},
|
4695
5231
|
create: {
|
4696
5232
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -4707,8 +5243,16 @@ exports.Position = {
|
|
4707
5243
|
newsMentions: prop.asset.newsMentions ? {
|
4708
5244
|
upsert: prop.asset.newsMentions.map((item) => ({
|
4709
5245
|
where: {
|
4710
|
-
id: item.id !== undefined ?
|
5246
|
+
id: item.id !== undefined ? {
|
5247
|
+
equals: item.id
|
5248
|
+
} : undefined,
|
4711
5249
|
url: item.url !== undefined ? item.url : undefined,
|
5250
|
+
assetId: item.assetId !== undefined ? {
|
5251
|
+
equals: item.assetId
|
5252
|
+
} : undefined,
|
5253
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5254
|
+
equals: item.newsArticleId
|
5255
|
+
} : undefined,
|
4712
5256
|
},
|
4713
5257
|
update: {
|
4714
5258
|
id: item.id !== undefined ? {
|
@@ -4814,7 +5358,9 @@ exports.Position = {
|
|
4814
5358
|
}
|
4815
5359
|
: { connectOrCreate: {
|
4816
5360
|
where: {
|
4817
|
-
id: item.news.id !== undefined ?
|
5361
|
+
id: item.news.id !== undefined ? {
|
5362
|
+
equals: item.news.id
|
5363
|
+
} : undefined,
|
4818
5364
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
4819
5365
|
title: item.news.title !== undefined ? {
|
4820
5366
|
equals: item.news.title
|
@@ -4905,7 +5451,15 @@ exports.Position = {
|
|
4905
5451
|
}
|
4906
5452
|
: { connectOrCreate: prop.asset.trades.map((item) => ({
|
4907
5453
|
where: {
|
4908
|
-
id: item.id !== undefined ?
|
5454
|
+
id: item.id !== undefined ? {
|
5455
|
+
equals: item.id
|
5456
|
+
} : undefined,
|
5457
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5458
|
+
equals: item.alpacaAccountId
|
5459
|
+
} : undefined,
|
5460
|
+
assetId: item.assetId !== undefined ? {
|
5461
|
+
equals: item.assetId
|
5462
|
+
} : undefined,
|
4909
5463
|
},
|
4910
5464
|
create: {
|
4911
5465
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -4927,7 +5481,12 @@ exports.Position = {
|
|
4927
5481
|
}
|
4928
5482
|
: { connectOrCreate: {
|
4929
5483
|
where: {
|
4930
|
-
id: item.alpacaAccount.id !== undefined ?
|
5484
|
+
id: item.alpacaAccount.id !== undefined ? {
|
5485
|
+
equals: item.alpacaAccount.id
|
5486
|
+
} : undefined,
|
5487
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
5488
|
+
equals: item.alpacaAccount.userId
|
5489
|
+
} : undefined,
|
4931
5490
|
},
|
4932
5491
|
create: {
|
4933
5492
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -4950,7 +5509,12 @@ exports.Position = {
|
|
4950
5509
|
}
|
4951
5510
|
: { connectOrCreate: item.actions.map((item) => ({
|
4952
5511
|
where: {
|
4953
|
-
id: item.id !== undefined ?
|
5512
|
+
id: item.id !== undefined ? {
|
5513
|
+
equals: item.id
|
5514
|
+
} : undefined,
|
5515
|
+
tradeId: item.tradeId !== undefined ? {
|
5516
|
+
equals: item.tradeId
|
5517
|
+
} : undefined,
|
4954
5518
|
},
|
4955
5519
|
create: {
|
4956
5520
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -4972,7 +5536,18 @@ exports.Position = {
|
|
4972
5536
|
}
|
4973
5537
|
: { connectOrCreate: prop.asset.orders.map((item) => ({
|
4974
5538
|
where: {
|
4975
|
-
id: item.id !== undefined ?
|
5539
|
+
id: item.id !== undefined ? {
|
5540
|
+
equals: item.id
|
5541
|
+
} : undefined,
|
5542
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5543
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5544
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5545
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5546
|
+
equals: item.alpacaAccountId
|
5547
|
+
} : undefined,
|
5548
|
+
assetId: item.assetId !== undefined ? {
|
5549
|
+
equals: item.assetId
|
5550
|
+
} : undefined,
|
4976
5551
|
},
|
4977
5552
|
create: {
|
4978
5553
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -5005,7 +5580,10 @@ exports.Position = {
|
|
5005
5580
|
}
|
5006
5581
|
: { connectOrCreate: {
|
5007
5582
|
where: {
|
5008
|
-
id: item.stopLoss.id !== undefined ?
|
5583
|
+
id: item.stopLoss.id !== undefined ? {
|
5584
|
+
equals: item.stopLoss.id
|
5585
|
+
} : undefined,
|
5586
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
5009
5587
|
},
|
5010
5588
|
create: {
|
5011
5589
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -5021,7 +5599,10 @@ exports.Position = {
|
|
5021
5599
|
}
|
5022
5600
|
: { connectOrCreate: {
|
5023
5601
|
where: {
|
5024
|
-
id: item.takeProfit.id !== undefined ?
|
5602
|
+
id: item.takeProfit.id !== undefined ? {
|
5603
|
+
equals: item.takeProfit.id
|
5604
|
+
} : undefined,
|
5605
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
5025
5606
|
},
|
5026
5607
|
create: {
|
5027
5608
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -5037,7 +5618,12 @@ exports.Position = {
|
|
5037
5618
|
}
|
5038
5619
|
: { connectOrCreate: {
|
5039
5620
|
where: {
|
5040
|
-
id: item.alpacaAccount.id !== undefined ?
|
5621
|
+
id: item.alpacaAccount.id !== undefined ? {
|
5622
|
+
equals: item.alpacaAccount.id
|
5623
|
+
} : undefined,
|
5624
|
+
userId: item.alpacaAccount.userId !== undefined ? {
|
5625
|
+
equals: item.alpacaAccount.userId
|
5626
|
+
} : undefined,
|
5041
5627
|
},
|
5042
5628
|
create: {
|
5043
5629
|
type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
|
@@ -5060,7 +5646,12 @@ exports.Position = {
|
|
5060
5646
|
}
|
5061
5647
|
: { connectOrCreate: {
|
5062
5648
|
where: {
|
5063
|
-
id: item.action.id !== undefined ?
|
5649
|
+
id: item.action.id !== undefined ? {
|
5650
|
+
equals: item.action.id
|
5651
|
+
} : undefined,
|
5652
|
+
tradeId: item.action.tradeId !== undefined ? {
|
5653
|
+
equals: item.action.tradeId
|
5654
|
+
} : undefined,
|
5064
5655
|
},
|
5065
5656
|
create: {
|
5066
5657
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -5082,8 +5673,16 @@ exports.Position = {
|
|
5082
5673
|
}
|
5083
5674
|
: { connectOrCreate: prop.asset.newsMentions.map((item) => ({
|
5084
5675
|
where: {
|
5085
|
-
id: item.id !== undefined ?
|
5676
|
+
id: item.id !== undefined ? {
|
5677
|
+
equals: item.id
|
5678
|
+
} : undefined,
|
5086
5679
|
url: item.url !== undefined ? item.url : undefined,
|
5680
|
+
assetId: item.assetId !== undefined ? {
|
5681
|
+
equals: item.assetId
|
5682
|
+
} : undefined,
|
5683
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5684
|
+
equals: item.newsArticleId
|
5685
|
+
} : undefined,
|
5087
5686
|
},
|
5088
5687
|
create: {
|
5089
5688
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -5098,7 +5697,9 @@ exports.Position = {
|
|
5098
5697
|
}
|
5099
5698
|
: { connectOrCreate: {
|
5100
5699
|
where: {
|
5101
|
-
id: item.news.id !== undefined ?
|
5700
|
+
id: item.news.id !== undefined ? {
|
5701
|
+
equals: item.news.id
|
5702
|
+
} : undefined,
|
5102
5703
|
url: item.news.url !== undefined ? item.news.url : undefined,
|
5103
5704
|
title: item.news.title !== undefined ? {
|
5104
5705
|
equals: item.news.title
|
@@ -5133,6 +5734,9 @@ exports.Position = {
|
|
5133
5734
|
id: prop.alpacaAccount.id !== undefined ? {
|
5134
5735
|
equals: prop.alpacaAccount.id
|
5135
5736
|
} : undefined,
|
5737
|
+
userId: prop.alpacaAccount.userId !== undefined ? {
|
5738
|
+
equals: prop.alpacaAccount.userId
|
5739
|
+
} : undefined,
|
5136
5740
|
},
|
5137
5741
|
update: {
|
5138
5742
|
id: prop.alpacaAccount.id !== undefined ? {
|
@@ -5221,9 +5825,21 @@ exports.Position = {
|
|
5221
5825
|
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
5222
5826
|
equals: prop.alpacaAccount.user.customer.id
|
5223
5827
|
} : undefined,
|
5828
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
5829
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
5830
|
+
} : undefined,
|
5224
5831
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
5225
5832
|
equals: prop.alpacaAccount.user.customer.name
|
5226
5833
|
} : undefined,
|
5834
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
|
5835
|
+
equals: prop.alpacaAccount.user.customer.stripeCustomerId
|
5836
|
+
} : undefined,
|
5837
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
|
5838
|
+
equals: prop.alpacaAccount.user.customer.stripeSubscriptionId
|
5839
|
+
} : undefined,
|
5840
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
5841
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
5842
|
+
} : undefined,
|
5227
5843
|
},
|
5228
5844
|
update: {
|
5229
5845
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -5262,7 +5878,15 @@ exports.Position = {
|
|
5262
5878
|
accounts: prop.alpacaAccount.user.accounts ? {
|
5263
5879
|
upsert: prop.alpacaAccount.user.accounts.map((item) => ({
|
5264
5880
|
where: {
|
5265
|
-
id: item.id !== undefined ?
|
5881
|
+
id: item.id !== undefined ? {
|
5882
|
+
equals: item.id
|
5883
|
+
} : undefined,
|
5884
|
+
userId: item.userId !== undefined ? {
|
5885
|
+
equals: item.userId
|
5886
|
+
} : undefined,
|
5887
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
5888
|
+
equals: item.providerAccountId
|
5889
|
+
} : undefined,
|
5266
5890
|
},
|
5267
5891
|
update: {
|
5268
5892
|
id: item.id !== undefined ? {
|
@@ -5316,7 +5940,12 @@ exports.Position = {
|
|
5316
5940
|
sessions: prop.alpacaAccount.user.sessions ? {
|
5317
5941
|
upsert: prop.alpacaAccount.user.sessions.map((item) => ({
|
5318
5942
|
where: {
|
5319
|
-
id: item.id !== undefined ?
|
5943
|
+
id: item.id !== undefined ? {
|
5944
|
+
equals: item.id
|
5945
|
+
} : undefined,
|
5946
|
+
userId: item.userId !== undefined ? {
|
5947
|
+
equals: item.userId
|
5948
|
+
} : undefined,
|
5320
5949
|
},
|
5321
5950
|
update: {
|
5322
5951
|
id: item.id !== undefined ? {
|
@@ -5338,7 +5967,12 @@ exports.Position = {
|
|
5338
5967
|
authenticators: prop.alpacaAccount.user.authenticators ? {
|
5339
5968
|
upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5340
5969
|
where: {
|
5341
|
-
id: item.id !== undefined ?
|
5970
|
+
id: item.id !== undefined ? {
|
5971
|
+
equals: item.id
|
5972
|
+
} : undefined,
|
5973
|
+
userId: item.userId !== undefined ? {
|
5974
|
+
equals: item.userId
|
5975
|
+
} : undefined,
|
5342
5976
|
},
|
5343
5977
|
update: {
|
5344
5978
|
id: item.id !== undefined ? {
|
@@ -5382,10 +6016,20 @@ exports.Position = {
|
|
5382
6016
|
}
|
5383
6017
|
: { connectOrCreate: {
|
5384
6018
|
where: {
|
5385
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
6019
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
6020
|
+
equals: prop.alpacaAccount.user.customer.id
|
6021
|
+
} : undefined,
|
6022
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
6023
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
6024
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
6025
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
6026
|
+
} : undefined,
|
5386
6027
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
5387
6028
|
equals: prop.alpacaAccount.user.customer.name
|
5388
6029
|
} : undefined,
|
6030
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
6031
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
6032
|
+
} : undefined,
|
5389
6033
|
},
|
5390
6034
|
create: {
|
5391
6035
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -5406,7 +6050,15 @@ exports.Position = {
|
|
5406
6050
|
}
|
5407
6051
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
5408
6052
|
where: {
|
5409
|
-
id: item.id !== undefined ?
|
6053
|
+
id: item.id !== undefined ? {
|
6054
|
+
equals: item.id
|
6055
|
+
} : undefined,
|
6056
|
+
userId: item.userId !== undefined ? {
|
6057
|
+
equals: item.userId
|
6058
|
+
} : undefined,
|
6059
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
6060
|
+
equals: item.providerAccountId
|
6061
|
+
} : undefined,
|
5410
6062
|
},
|
5411
6063
|
create: {
|
5412
6064
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -5430,7 +6082,12 @@ exports.Position = {
|
|
5430
6082
|
}
|
5431
6083
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
5432
6084
|
where: {
|
5433
|
-
id: item.id !== undefined ?
|
6085
|
+
id: item.id !== undefined ? {
|
6086
|
+
equals: item.id
|
6087
|
+
} : undefined,
|
6088
|
+
userId: item.userId !== undefined ? {
|
6089
|
+
equals: item.userId
|
6090
|
+
} : undefined,
|
5434
6091
|
},
|
5435
6092
|
create: {
|
5436
6093
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -5446,7 +6103,12 @@ exports.Position = {
|
|
5446
6103
|
}
|
5447
6104
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
5448
6105
|
where: {
|
5449
|
-
id: item.id !== undefined ?
|
6106
|
+
id: item.id !== undefined ? {
|
6107
|
+
equals: item.id
|
6108
|
+
} : undefined,
|
6109
|
+
userId: item.userId !== undefined ? {
|
6110
|
+
equals: item.userId
|
6111
|
+
} : undefined,
|
5450
6112
|
},
|
5451
6113
|
create: {
|
5452
6114
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -5461,7 +6123,15 @@ exports.Position = {
|
|
5461
6123
|
trades: prop.alpacaAccount.trades ? {
|
5462
6124
|
upsert: prop.alpacaAccount.trades.map((item) => ({
|
5463
6125
|
where: {
|
5464
|
-
id: item.id !== undefined ?
|
6126
|
+
id: item.id !== undefined ? {
|
6127
|
+
equals: item.id
|
6128
|
+
} : undefined,
|
6129
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6130
|
+
equals: item.alpacaAccountId
|
6131
|
+
} : undefined,
|
6132
|
+
assetId: item.assetId !== undefined ? {
|
6133
|
+
equals: item.assetId
|
6134
|
+
} : undefined,
|
5465
6135
|
},
|
5466
6136
|
update: {
|
5467
6137
|
id: item.id !== undefined ? {
|
@@ -5745,7 +6415,12 @@ exports.Position = {
|
|
5745
6415
|
actions: item.actions ? {
|
5746
6416
|
upsert: item.actions.map((item) => ({
|
5747
6417
|
where: {
|
5748
|
-
id: item.id !== undefined ?
|
6418
|
+
id: item.id !== undefined ? {
|
6419
|
+
equals: item.id
|
6420
|
+
} : undefined,
|
6421
|
+
tradeId: item.tradeId !== undefined ? {
|
6422
|
+
equals: item.tradeId
|
6423
|
+
} : undefined,
|
5749
6424
|
},
|
5750
6425
|
update: {
|
5751
6426
|
id: item.id !== undefined ? {
|
@@ -5797,7 +6472,9 @@ exports.Position = {
|
|
5797
6472
|
}
|
5798
6473
|
: { connectOrCreate: {
|
5799
6474
|
where: {
|
5800
|
-
id: item.asset.id !== undefined ?
|
6475
|
+
id: item.asset.id !== undefined ? {
|
6476
|
+
equals: item.asset.id
|
6477
|
+
} : undefined,
|
5801
6478
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
5802
6479
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
5803
6480
|
},
|
@@ -5868,7 +6545,12 @@ exports.Position = {
|
|
5868
6545
|
}
|
5869
6546
|
: { connectOrCreate: item.actions.map((item) => ({
|
5870
6547
|
where: {
|
5871
|
-
id: item.id !== undefined ?
|
6548
|
+
id: item.id !== undefined ? {
|
6549
|
+
equals: item.id
|
6550
|
+
} : undefined,
|
6551
|
+
tradeId: item.tradeId !== undefined ? {
|
6552
|
+
equals: item.tradeId
|
6553
|
+
} : undefined,
|
5872
6554
|
},
|
5873
6555
|
create: {
|
5874
6556
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -5885,7 +6567,18 @@ exports.Position = {
|
|
5885
6567
|
orders: prop.alpacaAccount.orders ? {
|
5886
6568
|
upsert: prop.alpacaAccount.orders.map((item) => ({
|
5887
6569
|
where: {
|
5888
|
-
id: item.id !== undefined ?
|
6570
|
+
id: item.id !== undefined ? {
|
6571
|
+
equals: item.id
|
6572
|
+
} : undefined,
|
6573
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6574
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6575
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
6576
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6577
|
+
equals: item.alpacaAccountId
|
6578
|
+
} : undefined,
|
6579
|
+
assetId: item.assetId !== undefined ? {
|
6580
|
+
equals: item.assetId
|
6581
|
+
} : undefined,
|
5889
6582
|
},
|
5890
6583
|
update: {
|
5891
6584
|
id: item.id !== undefined ? {
|
@@ -5963,6 +6656,9 @@ exports.Position = {
|
|
5963
6656
|
id: item.stopLoss.id !== undefined ? {
|
5964
6657
|
equals: item.stopLoss.id
|
5965
6658
|
} : undefined,
|
6659
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
6660
|
+
equals: item.stopLoss.orderId
|
6661
|
+
} : undefined,
|
5966
6662
|
},
|
5967
6663
|
update: {
|
5968
6664
|
id: item.stopLoss.id !== undefined ? {
|
@@ -5987,6 +6683,9 @@ exports.Position = {
|
|
5987
6683
|
id: item.takeProfit.id !== undefined ? {
|
5988
6684
|
equals: item.takeProfit.id
|
5989
6685
|
} : undefined,
|
6686
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
6687
|
+
equals: item.takeProfit.orderId
|
6688
|
+
} : undefined,
|
5990
6689
|
},
|
5991
6690
|
update: {
|
5992
6691
|
id: item.takeProfit.id !== undefined ? {
|
@@ -6011,6 +6710,9 @@ exports.Position = {
|
|
6011
6710
|
id: item.action.id !== undefined ? {
|
6012
6711
|
equals: item.action.id
|
6013
6712
|
} : undefined,
|
6713
|
+
tradeId: item.action.tradeId !== undefined ? {
|
6714
|
+
equals: item.action.tradeId
|
6715
|
+
} : undefined,
|
6014
6716
|
},
|
6015
6717
|
update: {
|
6016
6718
|
id: item.action.id !== undefined ? {
|
@@ -6315,7 +7017,10 @@ exports.Position = {
|
|
6315
7017
|
}
|
6316
7018
|
: { connectOrCreate: {
|
6317
7019
|
where: {
|
6318
|
-
id: item.stopLoss.id !== undefined ?
|
7020
|
+
id: item.stopLoss.id !== undefined ? {
|
7021
|
+
equals: item.stopLoss.id
|
7022
|
+
} : undefined,
|
7023
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
6319
7024
|
},
|
6320
7025
|
create: {
|
6321
7026
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -6331,7 +7036,10 @@ exports.Position = {
|
|
6331
7036
|
}
|
6332
7037
|
: { connectOrCreate: {
|
6333
7038
|
where: {
|
6334
|
-
id: item.takeProfit.id !== undefined ?
|
7039
|
+
id: item.takeProfit.id !== undefined ? {
|
7040
|
+
equals: item.takeProfit.id
|
7041
|
+
} : undefined,
|
7042
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
6335
7043
|
},
|
6336
7044
|
create: {
|
6337
7045
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -6347,7 +7055,12 @@ exports.Position = {
|
|
6347
7055
|
}
|
6348
7056
|
: { connectOrCreate: {
|
6349
7057
|
where: {
|
6350
|
-
id: item.action.id !== undefined ?
|
7058
|
+
id: item.action.id !== undefined ? {
|
7059
|
+
equals: item.action.id
|
7060
|
+
} : undefined,
|
7061
|
+
tradeId: item.action.tradeId !== undefined ? {
|
7062
|
+
equals: item.action.tradeId
|
7063
|
+
} : undefined,
|
6351
7064
|
},
|
6352
7065
|
create: {
|
6353
7066
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -6366,7 +7079,9 @@ exports.Position = {
|
|
6366
7079
|
}
|
6367
7080
|
: { connectOrCreate: {
|
6368
7081
|
where: {
|
6369
|
-
id: item.asset.id !== undefined ?
|
7082
|
+
id: item.asset.id !== undefined ? {
|
7083
|
+
equals: item.asset.id
|
7084
|
+
} : undefined,
|
6370
7085
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6371
7086
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6372
7087
|
},
|
@@ -6435,7 +7150,12 @@ exports.Position = {
|
|
6435
7150
|
alerts: prop.alpacaAccount.alerts ? {
|
6436
7151
|
upsert: prop.alpacaAccount.alerts.map((item) => ({
|
6437
7152
|
where: {
|
6438
|
-
id: item.id !== undefined ?
|
7153
|
+
id: item.id !== undefined ? {
|
7154
|
+
equals: item.id
|
7155
|
+
} : undefined,
|
7156
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7157
|
+
equals: item.alpacaAccountId
|
7158
|
+
} : undefined,
|
6439
7159
|
},
|
6440
7160
|
update: {
|
6441
7161
|
id: item.id !== undefined ? {
|
@@ -6477,7 +7197,9 @@ exports.Position = {
|
|
6477
7197
|
}
|
6478
7198
|
: { connectOrCreate: {
|
6479
7199
|
where: {
|
6480
|
-
id: prop.alpacaAccount.user.id !== undefined ?
|
7200
|
+
id: prop.alpacaAccount.user.id !== undefined ? {
|
7201
|
+
equals: prop.alpacaAccount.user.id
|
7202
|
+
} : undefined,
|
6481
7203
|
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
6482
7204
|
name: prop.alpacaAccount.user.name !== undefined ? {
|
6483
7205
|
equals: prop.alpacaAccount.user.name
|
@@ -6503,10 +7225,20 @@ exports.Position = {
|
|
6503
7225
|
}
|
6504
7226
|
: { connectOrCreate: {
|
6505
7227
|
where: {
|
6506
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
7228
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
7229
|
+
equals: prop.alpacaAccount.user.customer.id
|
7230
|
+
} : undefined,
|
7231
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
7232
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
7233
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
7234
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
7235
|
+
} : undefined,
|
6507
7236
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
6508
7237
|
equals: prop.alpacaAccount.user.customer.name
|
6509
7238
|
} : undefined,
|
7239
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
7240
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
7241
|
+
} : undefined,
|
6510
7242
|
},
|
6511
7243
|
create: {
|
6512
7244
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -6527,7 +7259,15 @@ exports.Position = {
|
|
6527
7259
|
}
|
6528
7260
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
6529
7261
|
where: {
|
6530
|
-
id: item.id !== undefined ?
|
7262
|
+
id: item.id !== undefined ? {
|
7263
|
+
equals: item.id
|
7264
|
+
} : undefined,
|
7265
|
+
userId: item.userId !== undefined ? {
|
7266
|
+
equals: item.userId
|
7267
|
+
} : undefined,
|
7268
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
7269
|
+
equals: item.providerAccountId
|
7270
|
+
} : undefined,
|
6531
7271
|
},
|
6532
7272
|
create: {
|
6533
7273
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -6551,7 +7291,12 @@ exports.Position = {
|
|
6551
7291
|
}
|
6552
7292
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
6553
7293
|
where: {
|
6554
|
-
id: item.id !== undefined ?
|
7294
|
+
id: item.id !== undefined ? {
|
7295
|
+
equals: item.id
|
7296
|
+
} : undefined,
|
7297
|
+
userId: item.userId !== undefined ? {
|
7298
|
+
equals: item.userId
|
7299
|
+
} : undefined,
|
6555
7300
|
},
|
6556
7301
|
create: {
|
6557
7302
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -6567,7 +7312,12 @@ exports.Position = {
|
|
6567
7312
|
}
|
6568
7313
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
6569
7314
|
where: {
|
6570
|
-
id: item.id !== undefined ?
|
7315
|
+
id: item.id !== undefined ? {
|
7316
|
+
equals: item.id
|
7317
|
+
} : undefined,
|
7318
|
+
userId: item.userId !== undefined ? {
|
7319
|
+
equals: item.userId
|
7320
|
+
} : undefined,
|
6571
7321
|
},
|
6572
7322
|
create: {
|
6573
7323
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -6587,7 +7337,15 @@ exports.Position = {
|
|
6587
7337
|
}
|
6588
7338
|
: { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
|
6589
7339
|
where: {
|
6590
|
-
id: item.id !== undefined ?
|
7340
|
+
id: item.id !== undefined ? {
|
7341
|
+
equals: item.id
|
7342
|
+
} : undefined,
|
7343
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7344
|
+
equals: item.alpacaAccountId
|
7345
|
+
} : undefined,
|
7346
|
+
assetId: item.assetId !== undefined ? {
|
7347
|
+
equals: item.assetId
|
7348
|
+
} : undefined,
|
6591
7349
|
},
|
6592
7350
|
create: {
|
6593
7351
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -6609,7 +7367,9 @@ exports.Position = {
|
|
6609
7367
|
}
|
6610
7368
|
: { connectOrCreate: {
|
6611
7369
|
where: {
|
6612
|
-
id: item.asset.id !== undefined ?
|
7370
|
+
id: item.asset.id !== undefined ? {
|
7371
|
+
equals: item.asset.id
|
7372
|
+
} : undefined,
|
6613
7373
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6614
7374
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6615
7375
|
},
|
@@ -6680,7 +7440,12 @@ exports.Position = {
|
|
6680
7440
|
}
|
6681
7441
|
: { connectOrCreate: item.actions.map((item) => ({
|
6682
7442
|
where: {
|
6683
|
-
id: item.id !== undefined ?
|
7443
|
+
id: item.id !== undefined ? {
|
7444
|
+
equals: item.id
|
7445
|
+
} : undefined,
|
7446
|
+
tradeId: item.tradeId !== undefined ? {
|
7447
|
+
equals: item.tradeId
|
7448
|
+
} : undefined,
|
6684
7449
|
},
|
6685
7450
|
create: {
|
6686
7451
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -6702,7 +7467,18 @@ exports.Position = {
|
|
6702
7467
|
}
|
6703
7468
|
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
6704
7469
|
where: {
|
6705
|
-
id: item.id !== undefined ?
|
7470
|
+
id: item.id !== undefined ? {
|
7471
|
+
equals: item.id
|
7472
|
+
} : undefined,
|
7473
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7474
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7475
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
7476
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7477
|
+
equals: item.alpacaAccountId
|
7478
|
+
} : undefined,
|
7479
|
+
assetId: item.assetId !== undefined ? {
|
7480
|
+
equals: item.assetId
|
7481
|
+
} : undefined,
|
6706
7482
|
},
|
6707
7483
|
create: {
|
6708
7484
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -6735,7 +7511,10 @@ exports.Position = {
|
|
6735
7511
|
}
|
6736
7512
|
: { connectOrCreate: {
|
6737
7513
|
where: {
|
6738
|
-
id: item.stopLoss.id !== undefined ?
|
7514
|
+
id: item.stopLoss.id !== undefined ? {
|
7515
|
+
equals: item.stopLoss.id
|
7516
|
+
} : undefined,
|
7517
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
6739
7518
|
},
|
6740
7519
|
create: {
|
6741
7520
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -6751,7 +7530,10 @@ exports.Position = {
|
|
6751
7530
|
}
|
6752
7531
|
: { connectOrCreate: {
|
6753
7532
|
where: {
|
6754
|
-
id: item.takeProfit.id !== undefined ?
|
7533
|
+
id: item.takeProfit.id !== undefined ? {
|
7534
|
+
equals: item.takeProfit.id
|
7535
|
+
} : undefined,
|
7536
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
6755
7537
|
},
|
6756
7538
|
create: {
|
6757
7539
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -6767,7 +7549,12 @@ exports.Position = {
|
|
6767
7549
|
}
|
6768
7550
|
: { connectOrCreate: {
|
6769
7551
|
where: {
|
6770
|
-
id: item.action.id !== undefined ?
|
7552
|
+
id: item.action.id !== undefined ? {
|
7553
|
+
equals: item.action.id
|
7554
|
+
} : undefined,
|
7555
|
+
tradeId: item.action.tradeId !== undefined ? {
|
7556
|
+
equals: item.action.tradeId
|
7557
|
+
} : undefined,
|
6771
7558
|
},
|
6772
7559
|
create: {
|
6773
7560
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -6786,7 +7573,9 @@ exports.Position = {
|
|
6786
7573
|
}
|
6787
7574
|
: { connectOrCreate: {
|
6788
7575
|
where: {
|
6789
|
-
id: item.asset.id !== undefined ?
|
7576
|
+
id: item.asset.id !== undefined ? {
|
7577
|
+
equals: item.asset.id
|
7578
|
+
} : undefined,
|
6790
7579
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
6791
7580
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
6792
7581
|
},
|
@@ -6860,7 +7649,12 @@ exports.Position = {
|
|
6860
7649
|
}
|
6861
7650
|
: { connectOrCreate: prop.alpacaAccount.alerts.map((item) => ({
|
6862
7651
|
where: {
|
6863
|
-
id: item.id !== undefined ?
|
7652
|
+
id: item.id !== undefined ? {
|
7653
|
+
equals: item.id
|
7654
|
+
} : undefined,
|
7655
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7656
|
+
equals: item.alpacaAccountId
|
7657
|
+
} : undefined,
|
6864
7658
|
},
|
6865
7659
|
create: {
|
6866
7660
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -6942,8 +7736,12 @@ exports.Position = {
|
|
6942
7736
|
}`;
|
6943
7737
|
const variables = {
|
6944
7738
|
where: {
|
6945
|
-
id: props.id !== undefined ?
|
6946
|
-
|
7739
|
+
id: props.id !== undefined ? {
|
7740
|
+
equals: props.id
|
7741
|
+
} : undefined,
|
7742
|
+
assetId: props.assetId !== undefined ? {
|
7743
|
+
equals: props.assetId
|
7744
|
+
} : undefined,
|
6947
7745
|
averageEntryPrice: props.averageEntryPrice !== undefined ? props.averageEntryPrice : undefined,
|
6948
7746
|
qty: props.qty !== undefined ? props.qty : undefined,
|
6949
7747
|
qtyAvailable: props.qtyAvailable !== undefined ? props.qtyAvailable : undefined,
|
@@ -6956,7 +7754,9 @@ exports.Position = {
|
|
6956
7754
|
currentPrice: props.currentPrice !== undefined ? props.currentPrice : undefined,
|
6957
7755
|
lastTradePrice: props.lastTradePrice !== undefined ? props.lastTradePrice : undefined,
|
6958
7756
|
changeToday: props.changeToday !== undefined ? props.changeToday : undefined,
|
6959
|
-
alpacaAccountId: props.alpacaAccountId !== undefined ?
|
7757
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
7758
|
+
equals: props.alpacaAccountId
|
7759
|
+
} : undefined,
|
6960
7760
|
},
|
6961
7761
|
};
|
6962
7762
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|
@@ -7023,7 +7823,9 @@ exports.Position = {
|
|
7023
7823
|
id: props.id !== undefined ? {
|
7024
7824
|
equals: props.id
|
7025
7825
|
} : undefined,
|
7026
|
-
assetId: props.assetId !== undefined ?
|
7826
|
+
assetId: props.assetId !== undefined ? {
|
7827
|
+
equals: props.assetId
|
7828
|
+
} : undefined,
|
7027
7829
|
averageEntryPrice: props.averageEntryPrice !== undefined ? props.averageEntryPrice : undefined,
|
7028
7830
|
qty: props.qty !== undefined ? props.qty : undefined,
|
7029
7831
|
qtyAvailable: props.qtyAvailable !== undefined ? props.qtyAvailable : undefined,
|
@@ -7036,7 +7838,9 @@ exports.Position = {
|
|
7036
7838
|
currentPrice: props.currentPrice !== undefined ? props.currentPrice : undefined,
|
7037
7839
|
lastTradePrice: props.lastTradePrice !== undefined ? props.lastTradePrice : undefined,
|
7038
7840
|
changeToday: props.changeToday !== undefined ? props.changeToday : undefined,
|
7039
|
-
alpacaAccountId: props.alpacaAccountId !== undefined ?
|
7841
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
7842
|
+
equals: props.alpacaAccountId
|
7843
|
+
} : undefined,
|
7040
7844
|
},
|
7041
7845
|
};
|
7042
7846
|
const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
|