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/server/Action.mjs
CHANGED
@@ -194,7 +194,15 @@ export const Action = {
|
|
194
194
|
}
|
195
195
|
: { connectOrCreate: {
|
196
196
|
where: {
|
197
|
-
id: props.trade.id !== undefined ?
|
197
|
+
id: props.trade.id !== undefined ? {
|
198
|
+
equals: props.trade.id
|
199
|
+
} : undefined,
|
200
|
+
alpacaAccountId: props.trade.alpacaAccountId !== undefined ? {
|
201
|
+
equals: props.trade.alpacaAccountId
|
202
|
+
} : undefined,
|
203
|
+
assetId: props.trade.assetId !== undefined ? {
|
204
|
+
equals: props.trade.assetId
|
205
|
+
} : undefined,
|
198
206
|
},
|
199
207
|
create: {
|
200
208
|
qty: props.trade.qty !== undefined ? props.trade.qty : undefined,
|
@@ -216,7 +224,12 @@ export const Action = {
|
|
216
224
|
}
|
217
225
|
: { connectOrCreate: {
|
218
226
|
where: {
|
219
|
-
id: props.trade.alpacaAccount.id !== undefined ?
|
227
|
+
id: props.trade.alpacaAccount.id !== undefined ? {
|
228
|
+
equals: props.trade.alpacaAccount.id
|
229
|
+
} : undefined,
|
230
|
+
userId: props.trade.alpacaAccount.userId !== undefined ? {
|
231
|
+
equals: props.trade.alpacaAccount.userId
|
232
|
+
} : undefined,
|
220
233
|
},
|
221
234
|
create: {
|
222
235
|
type: props.trade.alpacaAccount.type !== undefined ? props.trade.alpacaAccount.type : undefined,
|
@@ -236,7 +249,9 @@ export const Action = {
|
|
236
249
|
}
|
237
250
|
: { connectOrCreate: {
|
238
251
|
where: {
|
239
|
-
id: props.trade.alpacaAccount.user.id !== undefined ?
|
252
|
+
id: props.trade.alpacaAccount.user.id !== undefined ? {
|
253
|
+
equals: props.trade.alpacaAccount.user.id
|
254
|
+
} : undefined,
|
240
255
|
email: props.trade.alpacaAccount.user.email !== undefined ? props.trade.alpacaAccount.user.email : undefined,
|
241
256
|
name: props.trade.alpacaAccount.user.name !== undefined ? {
|
242
257
|
equals: props.trade.alpacaAccount.user.name
|
@@ -265,7 +280,18 @@ export const Action = {
|
|
265
280
|
}
|
266
281
|
: { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
|
267
282
|
where: {
|
268
|
-
id: item.id !== undefined ?
|
283
|
+
id: item.id !== undefined ? {
|
284
|
+
equals: item.id
|
285
|
+
} : undefined,
|
286
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
287
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
288
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
289
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
290
|
+
equals: item.alpacaAccountId
|
291
|
+
} : undefined,
|
292
|
+
assetId: item.assetId !== undefined ? {
|
293
|
+
equals: item.assetId
|
294
|
+
} : undefined,
|
269
295
|
},
|
270
296
|
create: {
|
271
297
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -301,7 +327,15 @@ export const Action = {
|
|
301
327
|
}
|
302
328
|
: { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
|
303
329
|
where: {
|
304
|
-
id: item.id !== undefined ?
|
330
|
+
id: item.id !== undefined ? {
|
331
|
+
equals: item.id
|
332
|
+
} : undefined,
|
333
|
+
assetId: item.assetId !== undefined ? {
|
334
|
+
equals: item.assetId
|
335
|
+
} : undefined,
|
336
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
337
|
+
equals: item.alpacaAccountId
|
338
|
+
} : undefined,
|
305
339
|
},
|
306
340
|
create: {
|
307
341
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -328,7 +362,12 @@ export const Action = {
|
|
328
362
|
}
|
329
363
|
: { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
|
330
364
|
where: {
|
331
|
-
id: item.id !== undefined ?
|
365
|
+
id: item.id !== undefined ? {
|
366
|
+
equals: item.id
|
367
|
+
} : undefined,
|
368
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
369
|
+
equals: item.alpacaAccountId
|
370
|
+
} : undefined,
|
332
371
|
},
|
333
372
|
create: {
|
334
373
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -348,7 +387,9 @@ export const Action = {
|
|
348
387
|
}
|
349
388
|
: { connectOrCreate: {
|
350
389
|
where: {
|
351
|
-
id: props.trade.asset.id !== undefined ?
|
390
|
+
id: props.trade.asset.id !== undefined ? {
|
391
|
+
equals: props.trade.asset.id
|
392
|
+
} : undefined,
|
352
393
|
symbol: props.trade.asset.symbol !== undefined ? props.trade.asset.symbol : undefined,
|
353
394
|
name: props.trade.asset.name !== undefined ? props.trade.asset.name : undefined,
|
354
395
|
},
|
@@ -416,7 +457,18 @@ export const Action = {
|
|
416
457
|
}
|
417
458
|
: { connectOrCreate: props.trade.asset.orders.map((item) => ({
|
418
459
|
where: {
|
419
|
-
id: item.id !== undefined ?
|
460
|
+
id: item.id !== undefined ? {
|
461
|
+
equals: item.id
|
462
|
+
} : undefined,
|
463
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
464
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
465
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
466
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
467
|
+
equals: item.alpacaAccountId
|
468
|
+
} : undefined,
|
469
|
+
assetId: item.assetId !== undefined ? {
|
470
|
+
equals: item.assetId
|
471
|
+
} : undefined,
|
420
472
|
},
|
421
473
|
create: {
|
422
474
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -452,7 +504,15 @@ export const Action = {
|
|
452
504
|
}
|
453
505
|
: { connectOrCreate: props.trade.asset.positions.map((item) => ({
|
454
506
|
where: {
|
455
|
-
id: item.id !== undefined ?
|
507
|
+
id: item.id !== undefined ? {
|
508
|
+
equals: item.id
|
509
|
+
} : undefined,
|
510
|
+
assetId: item.assetId !== undefined ? {
|
511
|
+
equals: item.assetId
|
512
|
+
} : undefined,
|
513
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
514
|
+
equals: item.alpacaAccountId
|
515
|
+
} : undefined,
|
456
516
|
},
|
457
517
|
create: {
|
458
518
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -479,8 +539,16 @@ export const Action = {
|
|
479
539
|
}
|
480
540
|
: { connectOrCreate: props.trade.asset.newsMentions.map((item) => ({
|
481
541
|
where: {
|
482
|
-
id: item.id !== undefined ?
|
542
|
+
id: item.id !== undefined ? {
|
543
|
+
equals: item.id
|
544
|
+
} : undefined,
|
483
545
|
url: item.url !== undefined ? item.url : undefined,
|
546
|
+
assetId: item.assetId !== undefined ? {
|
547
|
+
equals: item.assetId
|
548
|
+
} : undefined,
|
549
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
550
|
+
equals: item.newsArticleId
|
551
|
+
} : undefined,
|
484
552
|
},
|
485
553
|
create: {
|
486
554
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -504,7 +572,18 @@ export const Action = {
|
|
504
572
|
}
|
505
573
|
: { connectOrCreate: {
|
506
574
|
where: {
|
507
|
-
id: props.order.id !== undefined ?
|
575
|
+
id: props.order.id !== undefined ? {
|
576
|
+
equals: props.order.id
|
577
|
+
} : undefined,
|
578
|
+
clientOrderId: props.order.clientOrderId !== undefined ? props.order.clientOrderId : undefined,
|
579
|
+
actionId: props.order.actionId !== undefined ? props.order.actionId : undefined,
|
580
|
+
stopLossId: props.order.stopLossId !== undefined ? props.order.stopLossId : undefined,
|
581
|
+
alpacaAccountId: props.order.alpacaAccountId !== undefined ? {
|
582
|
+
equals: props.order.alpacaAccountId
|
583
|
+
} : undefined,
|
584
|
+
assetId: props.order.assetId !== undefined ? {
|
585
|
+
equals: props.order.assetId
|
586
|
+
} : undefined,
|
508
587
|
},
|
509
588
|
create: {
|
510
589
|
clientOrderId: props.order.clientOrderId !== undefined ? props.order.clientOrderId : undefined,
|
@@ -537,7 +616,10 @@ export const Action = {
|
|
537
616
|
}
|
538
617
|
: { connectOrCreate: {
|
539
618
|
where: {
|
540
|
-
id: props.order.stopLoss.id !== undefined ?
|
619
|
+
id: props.order.stopLoss.id !== undefined ? {
|
620
|
+
equals: props.order.stopLoss.id
|
621
|
+
} : undefined,
|
622
|
+
orderId: props.order.stopLoss.orderId !== undefined ? props.order.stopLoss.orderId : undefined,
|
541
623
|
},
|
542
624
|
create: {
|
543
625
|
stopPrice: props.order.stopLoss.stopPrice !== undefined ? props.order.stopLoss.stopPrice : undefined,
|
@@ -553,7 +635,10 @@ export const Action = {
|
|
553
635
|
}
|
554
636
|
: { connectOrCreate: {
|
555
637
|
where: {
|
556
|
-
id: props.order.takeProfit.id !== undefined ?
|
638
|
+
id: props.order.takeProfit.id !== undefined ? {
|
639
|
+
equals: props.order.takeProfit.id
|
640
|
+
} : undefined,
|
641
|
+
orderId: props.order.takeProfit.orderId !== undefined ? props.order.takeProfit.orderId : undefined,
|
557
642
|
},
|
558
643
|
create: {
|
559
644
|
limitPrice: props.order.takeProfit.limitPrice !== undefined ? props.order.takeProfit.limitPrice : undefined,
|
@@ -569,7 +654,12 @@ export const Action = {
|
|
569
654
|
}
|
570
655
|
: { connectOrCreate: {
|
571
656
|
where: {
|
572
|
-
id: props.order.alpacaAccount.id !== undefined ?
|
657
|
+
id: props.order.alpacaAccount.id !== undefined ? {
|
658
|
+
equals: props.order.alpacaAccount.id
|
659
|
+
} : undefined,
|
660
|
+
userId: props.order.alpacaAccount.userId !== undefined ? {
|
661
|
+
equals: props.order.alpacaAccount.userId
|
662
|
+
} : undefined,
|
573
663
|
},
|
574
664
|
create: {
|
575
665
|
type: props.order.alpacaAccount.type !== undefined ? props.order.alpacaAccount.type : undefined,
|
@@ -589,7 +679,9 @@ export const Action = {
|
|
589
679
|
}
|
590
680
|
: { connectOrCreate: {
|
591
681
|
where: {
|
592
|
-
id: props.order.alpacaAccount.user.id !== undefined ?
|
682
|
+
id: props.order.alpacaAccount.user.id !== undefined ? {
|
683
|
+
equals: props.order.alpacaAccount.user.id
|
684
|
+
} : undefined,
|
593
685
|
email: props.order.alpacaAccount.user.email !== undefined ? props.order.alpacaAccount.user.email : undefined,
|
594
686
|
name: props.order.alpacaAccount.user.name !== undefined ? {
|
595
687
|
equals: props.order.alpacaAccount.user.name
|
@@ -618,7 +710,15 @@ export const Action = {
|
|
618
710
|
}
|
619
711
|
: { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
|
620
712
|
where: {
|
621
|
-
id: item.id !== undefined ?
|
713
|
+
id: item.id !== undefined ? {
|
714
|
+
equals: item.id
|
715
|
+
} : undefined,
|
716
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
717
|
+
equals: item.alpacaAccountId
|
718
|
+
} : undefined,
|
719
|
+
assetId: item.assetId !== undefined ? {
|
720
|
+
equals: item.assetId
|
721
|
+
} : undefined,
|
622
722
|
},
|
623
723
|
create: {
|
624
724
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -643,7 +743,15 @@ export const Action = {
|
|
643
743
|
}
|
644
744
|
: { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
|
645
745
|
where: {
|
646
|
-
id: item.id !== undefined ?
|
746
|
+
id: item.id !== undefined ? {
|
747
|
+
equals: item.id
|
748
|
+
} : undefined,
|
749
|
+
assetId: item.assetId !== undefined ? {
|
750
|
+
equals: item.assetId
|
751
|
+
} : undefined,
|
752
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
753
|
+
equals: item.alpacaAccountId
|
754
|
+
} : undefined,
|
647
755
|
},
|
648
756
|
create: {
|
649
757
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -670,7 +778,12 @@ export const Action = {
|
|
670
778
|
}
|
671
779
|
: { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
|
672
780
|
where: {
|
673
|
-
id: item.id !== undefined ?
|
781
|
+
id: item.id !== undefined ? {
|
782
|
+
equals: item.id
|
783
|
+
} : undefined,
|
784
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
785
|
+
equals: item.alpacaAccountId
|
786
|
+
} : undefined,
|
674
787
|
},
|
675
788
|
create: {
|
676
789
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -690,7 +803,9 @@ export const Action = {
|
|
690
803
|
}
|
691
804
|
: { connectOrCreate: {
|
692
805
|
where: {
|
693
|
-
id: props.order.asset.id !== undefined ?
|
806
|
+
id: props.order.asset.id !== undefined ? {
|
807
|
+
equals: props.order.asset.id
|
808
|
+
} : undefined,
|
694
809
|
symbol: props.order.asset.symbol !== undefined ? props.order.asset.symbol : undefined,
|
695
810
|
name: props.order.asset.name !== undefined ? props.order.asset.name : undefined,
|
696
811
|
},
|
@@ -758,7 +873,15 @@ export const Action = {
|
|
758
873
|
}
|
759
874
|
: { connectOrCreate: props.order.asset.trades.map((item) => ({
|
760
875
|
where: {
|
761
|
-
id: item.id !== undefined ?
|
876
|
+
id: item.id !== undefined ? {
|
877
|
+
equals: item.id
|
878
|
+
} : undefined,
|
879
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
880
|
+
equals: item.alpacaAccountId
|
881
|
+
} : undefined,
|
882
|
+
assetId: item.assetId !== undefined ? {
|
883
|
+
equals: item.assetId
|
884
|
+
} : undefined,
|
762
885
|
},
|
763
886
|
create: {
|
764
887
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -783,7 +906,15 @@ export const Action = {
|
|
783
906
|
}
|
784
907
|
: { connectOrCreate: props.order.asset.positions.map((item) => ({
|
785
908
|
where: {
|
786
|
-
id: item.id !== undefined ?
|
909
|
+
id: item.id !== undefined ? {
|
910
|
+
equals: item.id
|
911
|
+
} : undefined,
|
912
|
+
assetId: item.assetId !== undefined ? {
|
913
|
+
equals: item.assetId
|
914
|
+
} : undefined,
|
915
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
916
|
+
equals: item.alpacaAccountId
|
917
|
+
} : undefined,
|
787
918
|
},
|
788
919
|
create: {
|
789
920
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -810,8 +941,16 @@ export const Action = {
|
|
810
941
|
}
|
811
942
|
: { connectOrCreate: props.order.asset.newsMentions.map((item) => ({
|
812
943
|
where: {
|
813
|
-
id: item.id !== undefined ?
|
944
|
+
id: item.id !== undefined ? {
|
945
|
+
equals: item.id
|
946
|
+
} : undefined,
|
814
947
|
url: item.url !== undefined ? item.url : undefined,
|
948
|
+
assetId: item.assetId !== undefined ? {
|
949
|
+
equals: item.assetId
|
950
|
+
} : undefined,
|
951
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
952
|
+
equals: item.newsArticleId
|
953
|
+
} : undefined,
|
815
954
|
},
|
816
955
|
create: {
|
817
956
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -901,9 +1040,13 @@ export const Action = {
|
|
901
1040
|
}`;
|
902
1041
|
const variables = {
|
903
1042
|
where: {
|
904
|
-
id: props.id !== undefined ?
|
1043
|
+
id: props.id !== undefined ? {
|
1044
|
+
equals: props.id
|
1045
|
+
} : undefined,
|
905
1046
|
sequence: props.sequence !== undefined ? props.sequence : undefined,
|
906
|
-
tradeId: props.tradeId !== undefined ?
|
1047
|
+
tradeId: props.tradeId !== undefined ? {
|
1048
|
+
equals: props.tradeId
|
1049
|
+
} : undefined,
|
907
1050
|
type: props.type !== undefined ? props.type : undefined,
|
908
1051
|
note: props.note !== undefined ? props.note : undefined,
|
909
1052
|
status: props.status !== undefined ? props.status : undefined,
|
@@ -933,6 +1076,12 @@ export const Action = {
|
|
933
1076
|
id: props.trade.id !== undefined ? {
|
934
1077
|
equals: props.trade.id
|
935
1078
|
} : undefined,
|
1079
|
+
alpacaAccountId: props.trade.alpacaAccountId !== undefined ? {
|
1080
|
+
equals: props.trade.alpacaAccountId
|
1081
|
+
} : undefined,
|
1082
|
+
assetId: props.trade.assetId !== undefined ? {
|
1083
|
+
equals: props.trade.assetId
|
1084
|
+
} : undefined,
|
936
1085
|
},
|
937
1086
|
update: {
|
938
1087
|
id: props.trade.id !== undefined ? {
|
@@ -977,6 +1126,9 @@ export const Action = {
|
|
977
1126
|
id: props.trade.alpacaAccount.id !== undefined ? {
|
978
1127
|
equals: props.trade.alpacaAccount.id
|
979
1128
|
} : undefined,
|
1129
|
+
userId: props.trade.alpacaAccount.userId !== undefined ? {
|
1130
|
+
equals: props.trade.alpacaAccount.userId
|
1131
|
+
} : undefined,
|
980
1132
|
},
|
981
1133
|
update: {
|
982
1134
|
id: props.trade.alpacaAccount.id !== undefined ? {
|
@@ -1078,7 +1230,18 @@ export const Action = {
|
|
1078
1230
|
orders: props.trade.alpacaAccount.orders ? {
|
1079
1231
|
upsert: props.trade.alpacaAccount.orders.map((item) => ({
|
1080
1232
|
where: {
|
1081
|
-
id: item.id !== undefined ?
|
1233
|
+
id: item.id !== undefined ? {
|
1234
|
+
equals: item.id
|
1235
|
+
} : undefined,
|
1236
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1237
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1238
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1239
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1240
|
+
equals: item.alpacaAccountId
|
1241
|
+
} : undefined,
|
1242
|
+
assetId: item.assetId !== undefined ? {
|
1243
|
+
equals: item.assetId
|
1244
|
+
} : undefined,
|
1082
1245
|
},
|
1083
1246
|
update: {
|
1084
1247
|
id: item.id !== undefined ? {
|
@@ -1180,7 +1343,15 @@ export const Action = {
|
|
1180
1343
|
positions: props.trade.alpacaAccount.positions ? {
|
1181
1344
|
upsert: props.trade.alpacaAccount.positions.map((item) => ({
|
1182
1345
|
where: {
|
1183
|
-
id: item.id !== undefined ?
|
1346
|
+
id: item.id !== undefined ? {
|
1347
|
+
equals: item.id
|
1348
|
+
} : undefined,
|
1349
|
+
assetId: item.assetId !== undefined ? {
|
1350
|
+
equals: item.assetId
|
1351
|
+
} : undefined,
|
1352
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1353
|
+
equals: item.alpacaAccountId
|
1354
|
+
} : undefined,
|
1184
1355
|
},
|
1185
1356
|
update: {
|
1186
1357
|
id: item.id !== undefined ? {
|
@@ -1246,7 +1417,12 @@ export const Action = {
|
|
1246
1417
|
alerts: props.trade.alpacaAccount.alerts ? {
|
1247
1418
|
upsert: props.trade.alpacaAccount.alerts.map((item) => ({
|
1248
1419
|
where: {
|
1249
|
-
id: item.id !== undefined ?
|
1420
|
+
id: item.id !== undefined ? {
|
1421
|
+
equals: item.id
|
1422
|
+
} : undefined,
|
1423
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1424
|
+
equals: item.alpacaAccountId
|
1425
|
+
} : undefined,
|
1250
1426
|
},
|
1251
1427
|
update: {
|
1252
1428
|
id: item.id !== undefined ? {
|
@@ -1288,7 +1464,9 @@ export const Action = {
|
|
1288
1464
|
}
|
1289
1465
|
: { connectOrCreate: {
|
1290
1466
|
where: {
|
1291
|
-
id: props.trade.alpacaAccount.user.id !== undefined ?
|
1467
|
+
id: props.trade.alpacaAccount.user.id !== undefined ? {
|
1468
|
+
equals: props.trade.alpacaAccount.user.id
|
1469
|
+
} : undefined,
|
1292
1470
|
email: props.trade.alpacaAccount.user.email !== undefined ? props.trade.alpacaAccount.user.email : undefined,
|
1293
1471
|
name: props.trade.alpacaAccount.user.name !== undefined ? {
|
1294
1472
|
equals: props.trade.alpacaAccount.user.name
|
@@ -1317,7 +1495,18 @@ export const Action = {
|
|
1317
1495
|
}
|
1318
1496
|
: { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
|
1319
1497
|
where: {
|
1320
|
-
id: item.id !== undefined ?
|
1498
|
+
id: item.id !== undefined ? {
|
1499
|
+
equals: item.id
|
1500
|
+
} : undefined,
|
1501
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1502
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1503
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1504
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1505
|
+
equals: item.alpacaAccountId
|
1506
|
+
} : undefined,
|
1507
|
+
assetId: item.assetId !== undefined ? {
|
1508
|
+
equals: item.assetId
|
1509
|
+
} : undefined,
|
1321
1510
|
},
|
1322
1511
|
create: {
|
1323
1512
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1353,7 +1542,15 @@ export const Action = {
|
|
1353
1542
|
}
|
1354
1543
|
: { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
|
1355
1544
|
where: {
|
1356
|
-
id: item.id !== undefined ?
|
1545
|
+
id: item.id !== undefined ? {
|
1546
|
+
equals: item.id
|
1547
|
+
} : undefined,
|
1548
|
+
assetId: item.assetId !== undefined ? {
|
1549
|
+
equals: item.assetId
|
1550
|
+
} : undefined,
|
1551
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1552
|
+
equals: item.alpacaAccountId
|
1553
|
+
} : undefined,
|
1357
1554
|
},
|
1358
1555
|
create: {
|
1359
1556
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1380,7 +1577,12 @@ export const Action = {
|
|
1380
1577
|
}
|
1381
1578
|
: { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
|
1382
1579
|
where: {
|
1383
|
-
id: item.id !== undefined ?
|
1580
|
+
id: item.id !== undefined ? {
|
1581
|
+
equals: item.id
|
1582
|
+
} : undefined,
|
1583
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1584
|
+
equals: item.alpacaAccountId
|
1585
|
+
} : undefined,
|
1384
1586
|
},
|
1385
1587
|
create: {
|
1386
1588
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1577,7 +1779,18 @@ export const Action = {
|
|
1577
1779
|
orders: props.trade.asset.orders ? {
|
1578
1780
|
upsert: props.trade.asset.orders.map((item) => ({
|
1579
1781
|
where: {
|
1580
|
-
id: item.id !== undefined ?
|
1782
|
+
id: item.id !== undefined ? {
|
1783
|
+
equals: item.id
|
1784
|
+
} : undefined,
|
1785
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1786
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1787
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1788
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1789
|
+
equals: item.alpacaAccountId
|
1790
|
+
} : undefined,
|
1791
|
+
assetId: item.assetId !== undefined ? {
|
1792
|
+
equals: item.assetId
|
1793
|
+
} : undefined,
|
1581
1794
|
},
|
1582
1795
|
update: {
|
1583
1796
|
id: item.id !== undefined ? {
|
@@ -1679,7 +1892,15 @@ export const Action = {
|
|
1679
1892
|
positions: props.trade.asset.positions ? {
|
1680
1893
|
upsert: props.trade.asset.positions.map((item) => ({
|
1681
1894
|
where: {
|
1682
|
-
id: item.id !== undefined ?
|
1895
|
+
id: item.id !== undefined ? {
|
1896
|
+
equals: item.id
|
1897
|
+
} : undefined,
|
1898
|
+
assetId: item.assetId !== undefined ? {
|
1899
|
+
equals: item.assetId
|
1900
|
+
} : undefined,
|
1901
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1902
|
+
equals: item.alpacaAccountId
|
1903
|
+
} : undefined,
|
1683
1904
|
},
|
1684
1905
|
update: {
|
1685
1906
|
id: item.id !== undefined ? {
|
@@ -1745,8 +1966,16 @@ export const Action = {
|
|
1745
1966
|
newsMentions: props.trade.asset.newsMentions ? {
|
1746
1967
|
upsert: props.trade.asset.newsMentions.map((item) => ({
|
1747
1968
|
where: {
|
1748
|
-
id: item.id !== undefined ?
|
1969
|
+
id: item.id !== undefined ? {
|
1970
|
+
equals: item.id
|
1971
|
+
} : undefined,
|
1749
1972
|
url: item.url !== undefined ? item.url : undefined,
|
1973
|
+
assetId: item.assetId !== undefined ? {
|
1974
|
+
equals: item.assetId
|
1975
|
+
} : undefined,
|
1976
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1977
|
+
equals: item.newsArticleId
|
1978
|
+
} : undefined,
|
1750
1979
|
},
|
1751
1980
|
update: {
|
1752
1981
|
id: item.id !== undefined ? {
|
@@ -1838,7 +2067,18 @@ export const Action = {
|
|
1838
2067
|
}
|
1839
2068
|
: { connectOrCreate: props.trade.asset.orders.map((item) => ({
|
1840
2069
|
where: {
|
1841
|
-
id: item.id !== undefined ?
|
2070
|
+
id: item.id !== undefined ? {
|
2071
|
+
equals: item.id
|
2072
|
+
} : undefined,
|
2073
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2074
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2075
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2076
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2077
|
+
equals: item.alpacaAccountId
|
2078
|
+
} : undefined,
|
2079
|
+
assetId: item.assetId !== undefined ? {
|
2080
|
+
equals: item.assetId
|
2081
|
+
} : undefined,
|
1842
2082
|
},
|
1843
2083
|
create: {
|
1844
2084
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1874,7 +2114,15 @@ export const Action = {
|
|
1874
2114
|
}
|
1875
2115
|
: { connectOrCreate: props.trade.asset.positions.map((item) => ({
|
1876
2116
|
where: {
|
1877
|
-
id: item.id !== undefined ?
|
2117
|
+
id: item.id !== undefined ? {
|
2118
|
+
equals: item.id
|
2119
|
+
} : undefined,
|
2120
|
+
assetId: item.assetId !== undefined ? {
|
2121
|
+
equals: item.assetId
|
2122
|
+
} : undefined,
|
2123
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2124
|
+
equals: item.alpacaAccountId
|
2125
|
+
} : undefined,
|
1878
2126
|
},
|
1879
2127
|
create: {
|
1880
2128
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1901,8 +2149,16 @@ export const Action = {
|
|
1901
2149
|
}
|
1902
2150
|
: { connectOrCreate: props.trade.asset.newsMentions.map((item) => ({
|
1903
2151
|
where: {
|
1904
|
-
id: item.id !== undefined ?
|
2152
|
+
id: item.id !== undefined ? {
|
2153
|
+
equals: item.id
|
2154
|
+
} : undefined,
|
1905
2155
|
url: item.url !== undefined ? item.url : undefined,
|
2156
|
+
assetId: item.assetId !== undefined ? {
|
2157
|
+
equals: item.assetId
|
2158
|
+
} : undefined,
|
2159
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2160
|
+
equals: item.newsArticleId
|
2161
|
+
} : undefined,
|
1906
2162
|
},
|
1907
2163
|
create: {
|
1908
2164
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -1936,7 +2192,12 @@ export const Action = {
|
|
1936
2192
|
}
|
1937
2193
|
: { connectOrCreate: {
|
1938
2194
|
where: {
|
1939
|
-
id: props.trade.alpacaAccount.id !== undefined ?
|
2195
|
+
id: props.trade.alpacaAccount.id !== undefined ? {
|
2196
|
+
equals: props.trade.alpacaAccount.id
|
2197
|
+
} : undefined,
|
2198
|
+
userId: props.trade.alpacaAccount.userId !== undefined ? {
|
2199
|
+
equals: props.trade.alpacaAccount.userId
|
2200
|
+
} : undefined,
|
1940
2201
|
},
|
1941
2202
|
create: {
|
1942
2203
|
type: props.trade.alpacaAccount.type !== undefined ? props.trade.alpacaAccount.type : undefined,
|
@@ -1956,7 +2217,9 @@ export const Action = {
|
|
1956
2217
|
}
|
1957
2218
|
: { connectOrCreate: {
|
1958
2219
|
where: {
|
1959
|
-
id: props.trade.alpacaAccount.user.id !== undefined ?
|
2220
|
+
id: props.trade.alpacaAccount.user.id !== undefined ? {
|
2221
|
+
equals: props.trade.alpacaAccount.user.id
|
2222
|
+
} : undefined,
|
1960
2223
|
email: props.trade.alpacaAccount.user.email !== undefined ? props.trade.alpacaAccount.user.email : undefined,
|
1961
2224
|
name: props.trade.alpacaAccount.user.name !== undefined ? {
|
1962
2225
|
equals: props.trade.alpacaAccount.user.name
|
@@ -1985,7 +2248,18 @@ export const Action = {
|
|
1985
2248
|
}
|
1986
2249
|
: { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
|
1987
2250
|
where: {
|
1988
|
-
id: item.id !== undefined ?
|
2251
|
+
id: item.id !== undefined ? {
|
2252
|
+
equals: item.id
|
2253
|
+
} : undefined,
|
2254
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2255
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2256
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2257
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2258
|
+
equals: item.alpacaAccountId
|
2259
|
+
} : undefined,
|
2260
|
+
assetId: item.assetId !== undefined ? {
|
2261
|
+
equals: item.assetId
|
2262
|
+
} : undefined,
|
1989
2263
|
},
|
1990
2264
|
create: {
|
1991
2265
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2021,7 +2295,15 @@ export const Action = {
|
|
2021
2295
|
}
|
2022
2296
|
: { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
|
2023
2297
|
where: {
|
2024
|
-
id: item.id !== undefined ?
|
2298
|
+
id: item.id !== undefined ? {
|
2299
|
+
equals: item.id
|
2300
|
+
} : undefined,
|
2301
|
+
assetId: item.assetId !== undefined ? {
|
2302
|
+
equals: item.assetId
|
2303
|
+
} : undefined,
|
2304
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2305
|
+
equals: item.alpacaAccountId
|
2306
|
+
} : undefined,
|
2025
2307
|
},
|
2026
2308
|
create: {
|
2027
2309
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2048,7 +2330,12 @@ export const Action = {
|
|
2048
2330
|
}
|
2049
2331
|
: { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
|
2050
2332
|
where: {
|
2051
|
-
id: item.id !== undefined ?
|
2333
|
+
id: item.id !== undefined ? {
|
2334
|
+
equals: item.id
|
2335
|
+
} : undefined,
|
2336
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2337
|
+
equals: item.alpacaAccountId
|
2338
|
+
} : undefined,
|
2052
2339
|
},
|
2053
2340
|
create: {
|
2054
2341
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2068,7 +2355,9 @@ export const Action = {
|
|
2068
2355
|
}
|
2069
2356
|
: { connectOrCreate: {
|
2070
2357
|
where: {
|
2071
|
-
id: props.trade.asset.id !== undefined ?
|
2358
|
+
id: props.trade.asset.id !== undefined ? {
|
2359
|
+
equals: props.trade.asset.id
|
2360
|
+
} : undefined,
|
2072
2361
|
symbol: props.trade.asset.symbol !== undefined ? props.trade.asset.symbol : undefined,
|
2073
2362
|
name: props.trade.asset.name !== undefined ? props.trade.asset.name : undefined,
|
2074
2363
|
},
|
@@ -2136,7 +2425,18 @@ export const Action = {
|
|
2136
2425
|
}
|
2137
2426
|
: { connectOrCreate: props.trade.asset.orders.map((item) => ({
|
2138
2427
|
where: {
|
2139
|
-
id: item.id !== undefined ?
|
2428
|
+
id: item.id !== undefined ? {
|
2429
|
+
equals: item.id
|
2430
|
+
} : undefined,
|
2431
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2432
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2433
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2434
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2435
|
+
equals: item.alpacaAccountId
|
2436
|
+
} : undefined,
|
2437
|
+
assetId: item.assetId !== undefined ? {
|
2438
|
+
equals: item.assetId
|
2439
|
+
} : undefined,
|
2140
2440
|
},
|
2141
2441
|
create: {
|
2142
2442
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2172,7 +2472,15 @@ export const Action = {
|
|
2172
2472
|
}
|
2173
2473
|
: { connectOrCreate: props.trade.asset.positions.map((item) => ({
|
2174
2474
|
where: {
|
2175
|
-
id: item.id !== undefined ?
|
2475
|
+
id: item.id !== undefined ? {
|
2476
|
+
equals: item.id
|
2477
|
+
} : undefined,
|
2478
|
+
assetId: item.assetId !== undefined ? {
|
2479
|
+
equals: item.assetId
|
2480
|
+
} : undefined,
|
2481
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2482
|
+
equals: item.alpacaAccountId
|
2483
|
+
} : undefined,
|
2176
2484
|
},
|
2177
2485
|
create: {
|
2178
2486
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2199,8 +2507,16 @@ export const Action = {
|
|
2199
2507
|
}
|
2200
2508
|
: { connectOrCreate: props.trade.asset.newsMentions.map((item) => ({
|
2201
2509
|
where: {
|
2202
|
-
id: item.id !== undefined ?
|
2510
|
+
id: item.id !== undefined ? {
|
2511
|
+
equals: item.id
|
2512
|
+
} : undefined,
|
2203
2513
|
url: item.url !== undefined ? item.url : undefined,
|
2514
|
+
assetId: item.assetId !== undefined ? {
|
2515
|
+
equals: item.assetId
|
2516
|
+
} : undefined,
|
2517
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2518
|
+
equals: item.newsArticleId
|
2519
|
+
} : undefined,
|
2204
2520
|
},
|
2205
2521
|
create: {
|
2206
2522
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -2222,6 +2538,18 @@ export const Action = {
|
|
2222
2538
|
id: props.order.id !== undefined ? {
|
2223
2539
|
equals: props.order.id
|
2224
2540
|
} : undefined,
|
2541
|
+
clientOrderId: props.order.clientOrderId !== undefined ? {
|
2542
|
+
equals: props.order.clientOrderId
|
2543
|
+
} : undefined,
|
2544
|
+
alpacaAccountId: props.order.alpacaAccountId !== undefined ? {
|
2545
|
+
equals: props.order.alpacaAccountId
|
2546
|
+
} : undefined,
|
2547
|
+
assetId: props.order.assetId !== undefined ? {
|
2548
|
+
equals: props.order.assetId
|
2549
|
+
} : undefined,
|
2550
|
+
actionId: props.order.actionId !== undefined ? {
|
2551
|
+
equals: props.order.actionId
|
2552
|
+
} : undefined,
|
2225
2553
|
},
|
2226
2554
|
update: {
|
2227
2555
|
id: props.order.id !== undefined ? {
|
@@ -2299,6 +2627,9 @@ export const Action = {
|
|
2299
2627
|
id: props.order.stopLoss.id !== undefined ? {
|
2300
2628
|
equals: props.order.stopLoss.id
|
2301
2629
|
} : undefined,
|
2630
|
+
orderId: props.order.stopLoss.orderId !== undefined ? {
|
2631
|
+
equals: props.order.stopLoss.orderId
|
2632
|
+
} : undefined,
|
2302
2633
|
},
|
2303
2634
|
update: {
|
2304
2635
|
id: props.order.stopLoss.id !== undefined ? {
|
@@ -2323,6 +2654,9 @@ export const Action = {
|
|
2323
2654
|
id: props.order.takeProfit.id !== undefined ? {
|
2324
2655
|
equals: props.order.takeProfit.id
|
2325
2656
|
} : undefined,
|
2657
|
+
orderId: props.order.takeProfit.orderId !== undefined ? {
|
2658
|
+
equals: props.order.takeProfit.orderId
|
2659
|
+
} : undefined,
|
2326
2660
|
},
|
2327
2661
|
update: {
|
2328
2662
|
id: props.order.takeProfit.id !== undefined ? {
|
@@ -2347,6 +2681,9 @@ export const Action = {
|
|
2347
2681
|
id: props.order.alpacaAccount.id !== undefined ? {
|
2348
2682
|
equals: props.order.alpacaAccount.id
|
2349
2683
|
} : undefined,
|
2684
|
+
userId: props.order.alpacaAccount.userId !== undefined ? {
|
2685
|
+
equals: props.order.alpacaAccount.userId
|
2686
|
+
} : undefined,
|
2350
2687
|
},
|
2351
2688
|
update: {
|
2352
2689
|
id: props.order.alpacaAccount.id !== undefined ? {
|
@@ -2448,7 +2785,15 @@ export const Action = {
|
|
2448
2785
|
trades: props.order.alpacaAccount.trades ? {
|
2449
2786
|
upsert: props.order.alpacaAccount.trades.map((item) => ({
|
2450
2787
|
where: {
|
2451
|
-
id: item.id !== undefined ?
|
2788
|
+
id: item.id !== undefined ? {
|
2789
|
+
equals: item.id
|
2790
|
+
} : undefined,
|
2791
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2792
|
+
equals: item.alpacaAccountId
|
2793
|
+
} : undefined,
|
2794
|
+
assetId: item.assetId !== undefined ? {
|
2795
|
+
equals: item.assetId
|
2796
|
+
} : undefined,
|
2452
2797
|
},
|
2453
2798
|
update: {
|
2454
2799
|
id: item.id !== undefined ? {
|
@@ -2506,7 +2851,15 @@ export const Action = {
|
|
2506
2851
|
positions: props.order.alpacaAccount.positions ? {
|
2507
2852
|
upsert: props.order.alpacaAccount.positions.map((item) => ({
|
2508
2853
|
where: {
|
2509
|
-
id: item.id !== undefined ?
|
2854
|
+
id: item.id !== undefined ? {
|
2855
|
+
equals: item.id
|
2856
|
+
} : undefined,
|
2857
|
+
assetId: item.assetId !== undefined ? {
|
2858
|
+
equals: item.assetId
|
2859
|
+
} : undefined,
|
2860
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2861
|
+
equals: item.alpacaAccountId
|
2862
|
+
} : undefined,
|
2510
2863
|
},
|
2511
2864
|
update: {
|
2512
2865
|
id: item.id !== undefined ? {
|
@@ -2572,7 +2925,12 @@ export const Action = {
|
|
2572
2925
|
alerts: props.order.alpacaAccount.alerts ? {
|
2573
2926
|
upsert: props.order.alpacaAccount.alerts.map((item) => ({
|
2574
2927
|
where: {
|
2575
|
-
id: item.id !== undefined ?
|
2928
|
+
id: item.id !== undefined ? {
|
2929
|
+
equals: item.id
|
2930
|
+
} : undefined,
|
2931
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2932
|
+
equals: item.alpacaAccountId
|
2933
|
+
} : undefined,
|
2576
2934
|
},
|
2577
2935
|
update: {
|
2578
2936
|
id: item.id !== undefined ? {
|
@@ -2614,7 +2972,9 @@ export const Action = {
|
|
2614
2972
|
}
|
2615
2973
|
: { connectOrCreate: {
|
2616
2974
|
where: {
|
2617
|
-
id: props.order.alpacaAccount.user.id !== undefined ?
|
2975
|
+
id: props.order.alpacaAccount.user.id !== undefined ? {
|
2976
|
+
equals: props.order.alpacaAccount.user.id
|
2977
|
+
} : undefined,
|
2618
2978
|
email: props.order.alpacaAccount.user.email !== undefined ? props.order.alpacaAccount.user.email : undefined,
|
2619
2979
|
name: props.order.alpacaAccount.user.name !== undefined ? {
|
2620
2980
|
equals: props.order.alpacaAccount.user.name
|
@@ -2643,7 +3003,15 @@ export const Action = {
|
|
2643
3003
|
}
|
2644
3004
|
: { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
|
2645
3005
|
where: {
|
2646
|
-
id: item.id !== undefined ?
|
3006
|
+
id: item.id !== undefined ? {
|
3007
|
+
equals: item.id
|
3008
|
+
} : undefined,
|
3009
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3010
|
+
equals: item.alpacaAccountId
|
3011
|
+
} : undefined,
|
3012
|
+
assetId: item.assetId !== undefined ? {
|
3013
|
+
equals: item.assetId
|
3014
|
+
} : undefined,
|
2647
3015
|
},
|
2648
3016
|
create: {
|
2649
3017
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2668,7 +3036,15 @@ export const Action = {
|
|
2668
3036
|
}
|
2669
3037
|
: { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
|
2670
3038
|
where: {
|
2671
|
-
id: item.id !== undefined ?
|
3039
|
+
id: item.id !== undefined ? {
|
3040
|
+
equals: item.id
|
3041
|
+
} : undefined,
|
3042
|
+
assetId: item.assetId !== undefined ? {
|
3043
|
+
equals: item.assetId
|
3044
|
+
} : undefined,
|
3045
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3046
|
+
equals: item.alpacaAccountId
|
3047
|
+
} : undefined,
|
2672
3048
|
},
|
2673
3049
|
create: {
|
2674
3050
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2695,7 +3071,12 @@ export const Action = {
|
|
2695
3071
|
}
|
2696
3072
|
: { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
|
2697
3073
|
where: {
|
2698
|
-
id: item.id !== undefined ?
|
3074
|
+
id: item.id !== undefined ? {
|
3075
|
+
equals: item.id
|
3076
|
+
} : undefined,
|
3077
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3078
|
+
equals: item.alpacaAccountId
|
3079
|
+
} : undefined,
|
2699
3080
|
},
|
2700
3081
|
create: {
|
2701
3082
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2892,7 +3273,15 @@ export const Action = {
|
|
2892
3273
|
trades: props.order.asset.trades ? {
|
2893
3274
|
upsert: props.order.asset.trades.map((item) => ({
|
2894
3275
|
where: {
|
2895
|
-
id: item.id !== undefined ?
|
3276
|
+
id: item.id !== undefined ? {
|
3277
|
+
equals: item.id
|
3278
|
+
} : undefined,
|
3279
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3280
|
+
equals: item.alpacaAccountId
|
3281
|
+
} : undefined,
|
3282
|
+
assetId: item.assetId !== undefined ? {
|
3283
|
+
equals: item.assetId
|
3284
|
+
} : undefined,
|
2896
3285
|
},
|
2897
3286
|
update: {
|
2898
3287
|
id: item.id !== undefined ? {
|
@@ -2950,7 +3339,15 @@ export const Action = {
|
|
2950
3339
|
positions: props.order.asset.positions ? {
|
2951
3340
|
upsert: props.order.asset.positions.map((item) => ({
|
2952
3341
|
where: {
|
2953
|
-
id: item.id !== undefined ?
|
3342
|
+
id: item.id !== undefined ? {
|
3343
|
+
equals: item.id
|
3344
|
+
} : undefined,
|
3345
|
+
assetId: item.assetId !== undefined ? {
|
3346
|
+
equals: item.assetId
|
3347
|
+
} : undefined,
|
3348
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3349
|
+
equals: item.alpacaAccountId
|
3350
|
+
} : undefined,
|
2954
3351
|
},
|
2955
3352
|
update: {
|
2956
3353
|
id: item.id !== undefined ? {
|
@@ -3016,8 +3413,16 @@ export const Action = {
|
|
3016
3413
|
newsMentions: props.order.asset.newsMentions ? {
|
3017
3414
|
upsert: props.order.asset.newsMentions.map((item) => ({
|
3018
3415
|
where: {
|
3019
|
-
id: item.id !== undefined ?
|
3416
|
+
id: item.id !== undefined ? {
|
3417
|
+
equals: item.id
|
3418
|
+
} : undefined,
|
3020
3419
|
url: item.url !== undefined ? item.url : undefined,
|
3420
|
+
assetId: item.assetId !== undefined ? {
|
3421
|
+
equals: item.assetId
|
3422
|
+
} : undefined,
|
3423
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3424
|
+
equals: item.newsArticleId
|
3425
|
+
} : undefined,
|
3021
3426
|
},
|
3022
3427
|
update: {
|
3023
3428
|
id: item.id !== undefined ? {
|
@@ -3109,7 +3514,15 @@ export const Action = {
|
|
3109
3514
|
}
|
3110
3515
|
: { connectOrCreate: props.order.asset.trades.map((item) => ({
|
3111
3516
|
where: {
|
3112
|
-
id: item.id !== undefined ?
|
3517
|
+
id: item.id !== undefined ? {
|
3518
|
+
equals: item.id
|
3519
|
+
} : undefined,
|
3520
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3521
|
+
equals: item.alpacaAccountId
|
3522
|
+
} : undefined,
|
3523
|
+
assetId: item.assetId !== undefined ? {
|
3524
|
+
equals: item.assetId
|
3525
|
+
} : undefined,
|
3113
3526
|
},
|
3114
3527
|
create: {
|
3115
3528
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3134,7 +3547,15 @@ export const Action = {
|
|
3134
3547
|
}
|
3135
3548
|
: { connectOrCreate: props.order.asset.positions.map((item) => ({
|
3136
3549
|
where: {
|
3137
|
-
id: item.id !== undefined ?
|
3550
|
+
id: item.id !== undefined ? {
|
3551
|
+
equals: item.id
|
3552
|
+
} : undefined,
|
3553
|
+
assetId: item.assetId !== undefined ? {
|
3554
|
+
equals: item.assetId
|
3555
|
+
} : undefined,
|
3556
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3557
|
+
equals: item.alpacaAccountId
|
3558
|
+
} : undefined,
|
3138
3559
|
},
|
3139
3560
|
create: {
|
3140
3561
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3161,8 +3582,16 @@ export const Action = {
|
|
3161
3582
|
}
|
3162
3583
|
: { connectOrCreate: props.order.asset.newsMentions.map((item) => ({
|
3163
3584
|
where: {
|
3164
|
-
id: item.id !== undefined ?
|
3585
|
+
id: item.id !== undefined ? {
|
3586
|
+
equals: item.id
|
3587
|
+
} : undefined,
|
3165
3588
|
url: item.url !== undefined ? item.url : undefined,
|
3589
|
+
assetId: item.assetId !== undefined ? {
|
3590
|
+
equals: item.assetId
|
3591
|
+
} : undefined,
|
3592
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3593
|
+
equals: item.newsArticleId
|
3594
|
+
} : undefined,
|
3166
3595
|
},
|
3167
3596
|
create: {
|
3168
3597
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3207,7 +3636,10 @@ export const Action = {
|
|
3207
3636
|
}
|
3208
3637
|
: { connectOrCreate: {
|
3209
3638
|
where: {
|
3210
|
-
id: props.order.stopLoss.id !== undefined ?
|
3639
|
+
id: props.order.stopLoss.id !== undefined ? {
|
3640
|
+
equals: props.order.stopLoss.id
|
3641
|
+
} : undefined,
|
3642
|
+
orderId: props.order.stopLoss.orderId !== undefined ? props.order.stopLoss.orderId : undefined,
|
3211
3643
|
},
|
3212
3644
|
create: {
|
3213
3645
|
stopPrice: props.order.stopLoss.stopPrice !== undefined ? props.order.stopLoss.stopPrice : undefined,
|
@@ -3223,7 +3655,10 @@ export const Action = {
|
|
3223
3655
|
}
|
3224
3656
|
: { connectOrCreate: {
|
3225
3657
|
where: {
|
3226
|
-
id: props.order.takeProfit.id !== undefined ?
|
3658
|
+
id: props.order.takeProfit.id !== undefined ? {
|
3659
|
+
equals: props.order.takeProfit.id
|
3660
|
+
} : undefined,
|
3661
|
+
orderId: props.order.takeProfit.orderId !== undefined ? props.order.takeProfit.orderId : undefined,
|
3227
3662
|
},
|
3228
3663
|
create: {
|
3229
3664
|
limitPrice: props.order.takeProfit.limitPrice !== undefined ? props.order.takeProfit.limitPrice : undefined,
|
@@ -3239,7 +3674,12 @@ export const Action = {
|
|
3239
3674
|
}
|
3240
3675
|
: { connectOrCreate: {
|
3241
3676
|
where: {
|
3242
|
-
id: props.order.alpacaAccount.id !== undefined ?
|
3677
|
+
id: props.order.alpacaAccount.id !== undefined ? {
|
3678
|
+
equals: props.order.alpacaAccount.id
|
3679
|
+
} : undefined,
|
3680
|
+
userId: props.order.alpacaAccount.userId !== undefined ? {
|
3681
|
+
equals: props.order.alpacaAccount.userId
|
3682
|
+
} : undefined,
|
3243
3683
|
},
|
3244
3684
|
create: {
|
3245
3685
|
type: props.order.alpacaAccount.type !== undefined ? props.order.alpacaAccount.type : undefined,
|
@@ -3259,7 +3699,9 @@ export const Action = {
|
|
3259
3699
|
}
|
3260
3700
|
: { connectOrCreate: {
|
3261
3701
|
where: {
|
3262
|
-
id: props.order.alpacaAccount.user.id !== undefined ?
|
3702
|
+
id: props.order.alpacaAccount.user.id !== undefined ? {
|
3703
|
+
equals: props.order.alpacaAccount.user.id
|
3704
|
+
} : undefined,
|
3263
3705
|
email: props.order.alpacaAccount.user.email !== undefined ? props.order.alpacaAccount.user.email : undefined,
|
3264
3706
|
name: props.order.alpacaAccount.user.name !== undefined ? {
|
3265
3707
|
equals: props.order.alpacaAccount.user.name
|
@@ -3288,7 +3730,15 @@ export const Action = {
|
|
3288
3730
|
}
|
3289
3731
|
: { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
|
3290
3732
|
where: {
|
3291
|
-
id: item.id !== undefined ?
|
3733
|
+
id: item.id !== undefined ? {
|
3734
|
+
equals: item.id
|
3735
|
+
} : undefined,
|
3736
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3737
|
+
equals: item.alpacaAccountId
|
3738
|
+
} : undefined,
|
3739
|
+
assetId: item.assetId !== undefined ? {
|
3740
|
+
equals: item.assetId
|
3741
|
+
} : undefined,
|
3292
3742
|
},
|
3293
3743
|
create: {
|
3294
3744
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3313,7 +3763,15 @@ export const Action = {
|
|
3313
3763
|
}
|
3314
3764
|
: { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
|
3315
3765
|
where: {
|
3316
|
-
id: item.id !== undefined ?
|
3766
|
+
id: item.id !== undefined ? {
|
3767
|
+
equals: item.id
|
3768
|
+
} : undefined,
|
3769
|
+
assetId: item.assetId !== undefined ? {
|
3770
|
+
equals: item.assetId
|
3771
|
+
} : undefined,
|
3772
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3773
|
+
equals: item.alpacaAccountId
|
3774
|
+
} : undefined,
|
3317
3775
|
},
|
3318
3776
|
create: {
|
3319
3777
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3340,7 +3798,12 @@ export const Action = {
|
|
3340
3798
|
}
|
3341
3799
|
: { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
|
3342
3800
|
where: {
|
3343
|
-
id: item.id !== undefined ?
|
3801
|
+
id: item.id !== undefined ? {
|
3802
|
+
equals: item.id
|
3803
|
+
} : undefined,
|
3804
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3805
|
+
equals: item.alpacaAccountId
|
3806
|
+
} : undefined,
|
3344
3807
|
},
|
3345
3808
|
create: {
|
3346
3809
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -3360,7 +3823,9 @@ export const Action = {
|
|
3360
3823
|
}
|
3361
3824
|
: { connectOrCreate: {
|
3362
3825
|
where: {
|
3363
|
-
id: props.order.asset.id !== undefined ?
|
3826
|
+
id: props.order.asset.id !== undefined ? {
|
3827
|
+
equals: props.order.asset.id
|
3828
|
+
} : undefined,
|
3364
3829
|
symbol: props.order.asset.symbol !== undefined ? props.order.asset.symbol : undefined,
|
3365
3830
|
name: props.order.asset.name !== undefined ? props.order.asset.name : undefined,
|
3366
3831
|
},
|
@@ -3428,7 +3893,15 @@ export const Action = {
|
|
3428
3893
|
}
|
3429
3894
|
: { connectOrCreate: props.order.asset.trades.map((item) => ({
|
3430
3895
|
where: {
|
3431
|
-
id: item.id !== undefined ?
|
3896
|
+
id: item.id !== undefined ? {
|
3897
|
+
equals: item.id
|
3898
|
+
} : undefined,
|
3899
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3900
|
+
equals: item.alpacaAccountId
|
3901
|
+
} : undefined,
|
3902
|
+
assetId: item.assetId !== undefined ? {
|
3903
|
+
equals: item.assetId
|
3904
|
+
} : undefined,
|
3432
3905
|
},
|
3433
3906
|
create: {
|
3434
3907
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3453,7 +3926,15 @@ export const Action = {
|
|
3453
3926
|
}
|
3454
3927
|
: { connectOrCreate: props.order.asset.positions.map((item) => ({
|
3455
3928
|
where: {
|
3456
|
-
id: item.id !== undefined ?
|
3929
|
+
id: item.id !== undefined ? {
|
3930
|
+
equals: item.id
|
3931
|
+
} : undefined,
|
3932
|
+
assetId: item.assetId !== undefined ? {
|
3933
|
+
equals: item.assetId
|
3934
|
+
} : undefined,
|
3935
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3936
|
+
equals: item.alpacaAccountId
|
3937
|
+
} : undefined,
|
3457
3938
|
},
|
3458
3939
|
create: {
|
3459
3940
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3480,8 +3961,16 @@ export const Action = {
|
|
3480
3961
|
}
|
3481
3962
|
: { connectOrCreate: props.order.asset.newsMentions.map((item) => ({
|
3482
3963
|
where: {
|
3483
|
-
id: item.id !== undefined ?
|
3964
|
+
id: item.id !== undefined ? {
|
3965
|
+
equals: item.id
|
3966
|
+
} : undefined,
|
3484
3967
|
url: item.url !== undefined ? item.url : undefined,
|
3968
|
+
assetId: item.assetId !== undefined ? {
|
3969
|
+
equals: item.assetId
|
3970
|
+
} : undefined,
|
3971
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3972
|
+
equals: item.newsArticleId
|
3973
|
+
} : undefined,
|
3485
3974
|
},
|
3486
3975
|
create: {
|
3487
3976
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3531,9 +4020,13 @@ export const Action = {
|
|
3531
4020
|
}`;
|
3532
4021
|
const variables = props.map(prop => ({
|
3533
4022
|
where: {
|
3534
|
-
id: prop.id !== undefined ?
|
4023
|
+
id: prop.id !== undefined ? {
|
4024
|
+
equals: prop.id
|
4025
|
+
} : undefined,
|
3535
4026
|
sequence: prop.sequence !== undefined ? prop.sequence : undefined,
|
3536
|
-
tradeId: prop.tradeId !== undefined ?
|
4027
|
+
tradeId: prop.tradeId !== undefined ? {
|
4028
|
+
equals: prop.tradeId
|
4029
|
+
} : undefined,
|
3537
4030
|
type: prop.type !== undefined ? prop.type : undefined,
|
3538
4031
|
note: prop.note !== undefined ? prop.note : undefined,
|
3539
4032
|
status: prop.status !== undefined ? prop.status : undefined,
|
@@ -3563,6 +4056,12 @@ export const Action = {
|
|
3563
4056
|
id: prop.trade.id !== undefined ? {
|
3564
4057
|
equals: prop.trade.id
|
3565
4058
|
} : undefined,
|
4059
|
+
alpacaAccountId: prop.trade.alpacaAccountId !== undefined ? {
|
4060
|
+
equals: prop.trade.alpacaAccountId
|
4061
|
+
} : undefined,
|
4062
|
+
assetId: prop.trade.assetId !== undefined ? {
|
4063
|
+
equals: prop.trade.assetId
|
4064
|
+
} : undefined,
|
3566
4065
|
},
|
3567
4066
|
update: {
|
3568
4067
|
id: prop.trade.id !== undefined ? {
|
@@ -3607,6 +4106,9 @@ export const Action = {
|
|
3607
4106
|
id: prop.trade.alpacaAccount.id !== undefined ? {
|
3608
4107
|
equals: prop.trade.alpacaAccount.id
|
3609
4108
|
} : undefined,
|
4109
|
+
userId: prop.trade.alpacaAccount.userId !== undefined ? {
|
4110
|
+
equals: prop.trade.alpacaAccount.userId
|
4111
|
+
} : undefined,
|
3610
4112
|
},
|
3611
4113
|
update: {
|
3612
4114
|
id: prop.trade.alpacaAccount.id !== undefined ? {
|
@@ -3708,7 +4210,18 @@ export const Action = {
|
|
3708
4210
|
orders: prop.trade.alpacaAccount.orders ? {
|
3709
4211
|
upsert: prop.trade.alpacaAccount.orders.map((item) => ({
|
3710
4212
|
where: {
|
3711
|
-
id: item.id !== undefined ?
|
4213
|
+
id: item.id !== undefined ? {
|
4214
|
+
equals: item.id
|
4215
|
+
} : undefined,
|
4216
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4217
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4218
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4219
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4220
|
+
equals: item.alpacaAccountId
|
4221
|
+
} : undefined,
|
4222
|
+
assetId: item.assetId !== undefined ? {
|
4223
|
+
equals: item.assetId
|
4224
|
+
} : undefined,
|
3712
4225
|
},
|
3713
4226
|
update: {
|
3714
4227
|
id: item.id !== undefined ? {
|
@@ -3810,7 +4323,15 @@ export const Action = {
|
|
3810
4323
|
positions: prop.trade.alpacaAccount.positions ? {
|
3811
4324
|
upsert: prop.trade.alpacaAccount.positions.map((item) => ({
|
3812
4325
|
where: {
|
3813
|
-
id: item.id !== undefined ?
|
4326
|
+
id: item.id !== undefined ? {
|
4327
|
+
equals: item.id
|
4328
|
+
} : undefined,
|
4329
|
+
assetId: item.assetId !== undefined ? {
|
4330
|
+
equals: item.assetId
|
4331
|
+
} : undefined,
|
4332
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4333
|
+
equals: item.alpacaAccountId
|
4334
|
+
} : undefined,
|
3814
4335
|
},
|
3815
4336
|
update: {
|
3816
4337
|
id: item.id !== undefined ? {
|
@@ -3876,7 +4397,12 @@ export const Action = {
|
|
3876
4397
|
alerts: prop.trade.alpacaAccount.alerts ? {
|
3877
4398
|
upsert: prop.trade.alpacaAccount.alerts.map((item) => ({
|
3878
4399
|
where: {
|
3879
|
-
id: item.id !== undefined ?
|
4400
|
+
id: item.id !== undefined ? {
|
4401
|
+
equals: item.id
|
4402
|
+
} : undefined,
|
4403
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4404
|
+
equals: item.alpacaAccountId
|
4405
|
+
} : undefined,
|
3880
4406
|
},
|
3881
4407
|
update: {
|
3882
4408
|
id: item.id !== undefined ? {
|
@@ -3918,7 +4444,9 @@ export const Action = {
|
|
3918
4444
|
}
|
3919
4445
|
: { connectOrCreate: {
|
3920
4446
|
where: {
|
3921
|
-
id: prop.trade.alpacaAccount.user.id !== undefined ?
|
4447
|
+
id: prop.trade.alpacaAccount.user.id !== undefined ? {
|
4448
|
+
equals: prop.trade.alpacaAccount.user.id
|
4449
|
+
} : undefined,
|
3922
4450
|
email: prop.trade.alpacaAccount.user.email !== undefined ? prop.trade.alpacaAccount.user.email : undefined,
|
3923
4451
|
name: prop.trade.alpacaAccount.user.name !== undefined ? {
|
3924
4452
|
equals: prop.trade.alpacaAccount.user.name
|
@@ -3947,7 +4475,18 @@ export const Action = {
|
|
3947
4475
|
}
|
3948
4476
|
: { connectOrCreate: prop.trade.alpacaAccount.orders.map((item) => ({
|
3949
4477
|
where: {
|
3950
|
-
id: item.id !== undefined ?
|
4478
|
+
id: item.id !== undefined ? {
|
4479
|
+
equals: item.id
|
4480
|
+
} : undefined,
|
4481
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4482
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4483
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4484
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4485
|
+
equals: item.alpacaAccountId
|
4486
|
+
} : undefined,
|
4487
|
+
assetId: item.assetId !== undefined ? {
|
4488
|
+
equals: item.assetId
|
4489
|
+
} : undefined,
|
3951
4490
|
},
|
3952
4491
|
create: {
|
3953
4492
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -3983,7 +4522,15 @@ export const Action = {
|
|
3983
4522
|
}
|
3984
4523
|
: { connectOrCreate: prop.trade.alpacaAccount.positions.map((item) => ({
|
3985
4524
|
where: {
|
3986
|
-
id: item.id !== undefined ?
|
4525
|
+
id: item.id !== undefined ? {
|
4526
|
+
equals: item.id
|
4527
|
+
} : undefined,
|
4528
|
+
assetId: item.assetId !== undefined ? {
|
4529
|
+
equals: item.assetId
|
4530
|
+
} : undefined,
|
4531
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4532
|
+
equals: item.alpacaAccountId
|
4533
|
+
} : undefined,
|
3987
4534
|
},
|
3988
4535
|
create: {
|
3989
4536
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4010,7 +4557,12 @@ export const Action = {
|
|
4010
4557
|
}
|
4011
4558
|
: { connectOrCreate: prop.trade.alpacaAccount.alerts.map((item) => ({
|
4012
4559
|
where: {
|
4013
|
-
id: item.id !== undefined ?
|
4560
|
+
id: item.id !== undefined ? {
|
4561
|
+
equals: item.id
|
4562
|
+
} : undefined,
|
4563
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4564
|
+
equals: item.alpacaAccountId
|
4565
|
+
} : undefined,
|
4014
4566
|
},
|
4015
4567
|
create: {
|
4016
4568
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -4207,7 +4759,18 @@ export const Action = {
|
|
4207
4759
|
orders: prop.trade.asset.orders ? {
|
4208
4760
|
upsert: prop.trade.asset.orders.map((item) => ({
|
4209
4761
|
where: {
|
4210
|
-
id: item.id !== undefined ?
|
4762
|
+
id: item.id !== undefined ? {
|
4763
|
+
equals: item.id
|
4764
|
+
} : undefined,
|
4765
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4766
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4767
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4768
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4769
|
+
equals: item.alpacaAccountId
|
4770
|
+
} : undefined,
|
4771
|
+
assetId: item.assetId !== undefined ? {
|
4772
|
+
equals: item.assetId
|
4773
|
+
} : undefined,
|
4211
4774
|
},
|
4212
4775
|
update: {
|
4213
4776
|
id: item.id !== undefined ? {
|
@@ -4309,7 +4872,15 @@ export const Action = {
|
|
4309
4872
|
positions: prop.trade.asset.positions ? {
|
4310
4873
|
upsert: prop.trade.asset.positions.map((item) => ({
|
4311
4874
|
where: {
|
4312
|
-
id: item.id !== undefined ?
|
4875
|
+
id: item.id !== undefined ? {
|
4876
|
+
equals: item.id
|
4877
|
+
} : undefined,
|
4878
|
+
assetId: item.assetId !== undefined ? {
|
4879
|
+
equals: item.assetId
|
4880
|
+
} : undefined,
|
4881
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4882
|
+
equals: item.alpacaAccountId
|
4883
|
+
} : undefined,
|
4313
4884
|
},
|
4314
4885
|
update: {
|
4315
4886
|
id: item.id !== undefined ? {
|
@@ -4375,8 +4946,16 @@ export const Action = {
|
|
4375
4946
|
newsMentions: prop.trade.asset.newsMentions ? {
|
4376
4947
|
upsert: prop.trade.asset.newsMentions.map((item) => ({
|
4377
4948
|
where: {
|
4378
|
-
id: item.id !== undefined ?
|
4949
|
+
id: item.id !== undefined ? {
|
4950
|
+
equals: item.id
|
4951
|
+
} : undefined,
|
4379
4952
|
url: item.url !== undefined ? item.url : undefined,
|
4953
|
+
assetId: item.assetId !== undefined ? {
|
4954
|
+
equals: item.assetId
|
4955
|
+
} : undefined,
|
4956
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4957
|
+
equals: item.newsArticleId
|
4958
|
+
} : undefined,
|
4380
4959
|
},
|
4381
4960
|
update: {
|
4382
4961
|
id: item.id !== undefined ? {
|
@@ -4468,7 +5047,18 @@ export const Action = {
|
|
4468
5047
|
}
|
4469
5048
|
: { connectOrCreate: prop.trade.asset.orders.map((item) => ({
|
4470
5049
|
where: {
|
4471
|
-
id: item.id !== undefined ?
|
5050
|
+
id: item.id !== undefined ? {
|
5051
|
+
equals: item.id
|
5052
|
+
} : undefined,
|
5053
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5054
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5055
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5056
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5057
|
+
equals: item.alpacaAccountId
|
5058
|
+
} : undefined,
|
5059
|
+
assetId: item.assetId !== undefined ? {
|
5060
|
+
equals: item.assetId
|
5061
|
+
} : undefined,
|
4472
5062
|
},
|
4473
5063
|
create: {
|
4474
5064
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4504,7 +5094,15 @@ export const Action = {
|
|
4504
5094
|
}
|
4505
5095
|
: { connectOrCreate: prop.trade.asset.positions.map((item) => ({
|
4506
5096
|
where: {
|
4507
|
-
id: item.id !== undefined ?
|
5097
|
+
id: item.id !== undefined ? {
|
5098
|
+
equals: item.id
|
5099
|
+
} : undefined,
|
5100
|
+
assetId: item.assetId !== undefined ? {
|
5101
|
+
equals: item.assetId
|
5102
|
+
} : undefined,
|
5103
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5104
|
+
equals: item.alpacaAccountId
|
5105
|
+
} : undefined,
|
4508
5106
|
},
|
4509
5107
|
create: {
|
4510
5108
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4531,8 +5129,16 @@ export const Action = {
|
|
4531
5129
|
}
|
4532
5130
|
: { connectOrCreate: prop.trade.asset.newsMentions.map((item) => ({
|
4533
5131
|
where: {
|
4534
|
-
id: item.id !== undefined ?
|
5132
|
+
id: item.id !== undefined ? {
|
5133
|
+
equals: item.id
|
5134
|
+
} : undefined,
|
4535
5135
|
url: item.url !== undefined ? item.url : undefined,
|
5136
|
+
assetId: item.assetId !== undefined ? {
|
5137
|
+
equals: item.assetId
|
5138
|
+
} : undefined,
|
5139
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5140
|
+
equals: item.newsArticleId
|
5141
|
+
} : undefined,
|
4536
5142
|
},
|
4537
5143
|
create: {
|
4538
5144
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4566,7 +5172,12 @@ export const Action = {
|
|
4566
5172
|
}
|
4567
5173
|
: { connectOrCreate: {
|
4568
5174
|
where: {
|
4569
|
-
id: prop.trade.alpacaAccount.id !== undefined ?
|
5175
|
+
id: prop.trade.alpacaAccount.id !== undefined ? {
|
5176
|
+
equals: prop.trade.alpacaAccount.id
|
5177
|
+
} : undefined,
|
5178
|
+
userId: prop.trade.alpacaAccount.userId !== undefined ? {
|
5179
|
+
equals: prop.trade.alpacaAccount.userId
|
5180
|
+
} : undefined,
|
4570
5181
|
},
|
4571
5182
|
create: {
|
4572
5183
|
type: prop.trade.alpacaAccount.type !== undefined ? prop.trade.alpacaAccount.type : undefined,
|
@@ -4586,7 +5197,9 @@ export const Action = {
|
|
4586
5197
|
}
|
4587
5198
|
: { connectOrCreate: {
|
4588
5199
|
where: {
|
4589
|
-
id: prop.trade.alpacaAccount.user.id !== undefined ?
|
5200
|
+
id: prop.trade.alpacaAccount.user.id !== undefined ? {
|
5201
|
+
equals: prop.trade.alpacaAccount.user.id
|
5202
|
+
} : undefined,
|
4590
5203
|
email: prop.trade.alpacaAccount.user.email !== undefined ? prop.trade.alpacaAccount.user.email : undefined,
|
4591
5204
|
name: prop.trade.alpacaAccount.user.name !== undefined ? {
|
4592
5205
|
equals: prop.trade.alpacaAccount.user.name
|
@@ -4615,7 +5228,18 @@ export const Action = {
|
|
4615
5228
|
}
|
4616
5229
|
: { connectOrCreate: prop.trade.alpacaAccount.orders.map((item) => ({
|
4617
5230
|
where: {
|
4618
|
-
id: item.id !== undefined ?
|
5231
|
+
id: item.id !== undefined ? {
|
5232
|
+
equals: item.id
|
5233
|
+
} : undefined,
|
5234
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5235
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5236
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5237
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5238
|
+
equals: item.alpacaAccountId
|
5239
|
+
} : undefined,
|
5240
|
+
assetId: item.assetId !== undefined ? {
|
5241
|
+
equals: item.assetId
|
5242
|
+
} : undefined,
|
4619
5243
|
},
|
4620
5244
|
create: {
|
4621
5245
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4651,7 +5275,15 @@ export const Action = {
|
|
4651
5275
|
}
|
4652
5276
|
: { connectOrCreate: prop.trade.alpacaAccount.positions.map((item) => ({
|
4653
5277
|
where: {
|
4654
|
-
id: item.id !== undefined ?
|
5278
|
+
id: item.id !== undefined ? {
|
5279
|
+
equals: item.id
|
5280
|
+
} : undefined,
|
5281
|
+
assetId: item.assetId !== undefined ? {
|
5282
|
+
equals: item.assetId
|
5283
|
+
} : undefined,
|
5284
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5285
|
+
equals: item.alpacaAccountId
|
5286
|
+
} : undefined,
|
4655
5287
|
},
|
4656
5288
|
create: {
|
4657
5289
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4678,7 +5310,12 @@ export const Action = {
|
|
4678
5310
|
}
|
4679
5311
|
: { connectOrCreate: prop.trade.alpacaAccount.alerts.map((item) => ({
|
4680
5312
|
where: {
|
4681
|
-
id: item.id !== undefined ?
|
5313
|
+
id: item.id !== undefined ? {
|
5314
|
+
equals: item.id
|
5315
|
+
} : undefined,
|
5316
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5317
|
+
equals: item.alpacaAccountId
|
5318
|
+
} : undefined,
|
4682
5319
|
},
|
4683
5320
|
create: {
|
4684
5321
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -4698,7 +5335,9 @@ export const Action = {
|
|
4698
5335
|
}
|
4699
5336
|
: { connectOrCreate: {
|
4700
5337
|
where: {
|
4701
|
-
id: prop.trade.asset.id !== undefined ?
|
5338
|
+
id: prop.trade.asset.id !== undefined ? {
|
5339
|
+
equals: prop.trade.asset.id
|
5340
|
+
} : undefined,
|
4702
5341
|
symbol: prop.trade.asset.symbol !== undefined ? prop.trade.asset.symbol : undefined,
|
4703
5342
|
name: prop.trade.asset.name !== undefined ? prop.trade.asset.name : undefined,
|
4704
5343
|
},
|
@@ -4766,7 +5405,18 @@ export const Action = {
|
|
4766
5405
|
}
|
4767
5406
|
: { connectOrCreate: prop.trade.asset.orders.map((item) => ({
|
4768
5407
|
where: {
|
4769
|
-
id: item.id !== undefined ?
|
5408
|
+
id: item.id !== undefined ? {
|
5409
|
+
equals: item.id
|
5410
|
+
} : undefined,
|
5411
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5412
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5413
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5414
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5415
|
+
equals: item.alpacaAccountId
|
5416
|
+
} : undefined,
|
5417
|
+
assetId: item.assetId !== undefined ? {
|
5418
|
+
equals: item.assetId
|
5419
|
+
} : undefined,
|
4770
5420
|
},
|
4771
5421
|
create: {
|
4772
5422
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4802,7 +5452,15 @@ export const Action = {
|
|
4802
5452
|
}
|
4803
5453
|
: { connectOrCreate: prop.trade.asset.positions.map((item) => ({
|
4804
5454
|
where: {
|
4805
|
-
id: item.id !== undefined ?
|
5455
|
+
id: item.id !== undefined ? {
|
5456
|
+
equals: item.id
|
5457
|
+
} : undefined,
|
5458
|
+
assetId: item.assetId !== undefined ? {
|
5459
|
+
equals: item.assetId
|
5460
|
+
} : undefined,
|
5461
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5462
|
+
equals: item.alpacaAccountId
|
5463
|
+
} : undefined,
|
4806
5464
|
},
|
4807
5465
|
create: {
|
4808
5466
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4829,8 +5487,16 @@ export const Action = {
|
|
4829
5487
|
}
|
4830
5488
|
: { connectOrCreate: prop.trade.asset.newsMentions.map((item) => ({
|
4831
5489
|
where: {
|
4832
|
-
id: item.id !== undefined ?
|
5490
|
+
id: item.id !== undefined ? {
|
5491
|
+
equals: item.id
|
5492
|
+
} : undefined,
|
4833
5493
|
url: item.url !== undefined ? item.url : undefined,
|
5494
|
+
assetId: item.assetId !== undefined ? {
|
5495
|
+
equals: item.assetId
|
5496
|
+
} : undefined,
|
5497
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5498
|
+
equals: item.newsArticleId
|
5499
|
+
} : undefined,
|
4834
5500
|
},
|
4835
5501
|
create: {
|
4836
5502
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4852,6 +5518,18 @@ export const Action = {
|
|
4852
5518
|
id: prop.order.id !== undefined ? {
|
4853
5519
|
equals: prop.order.id
|
4854
5520
|
} : undefined,
|
5521
|
+
clientOrderId: prop.order.clientOrderId !== undefined ? {
|
5522
|
+
equals: prop.order.clientOrderId
|
5523
|
+
} : undefined,
|
5524
|
+
alpacaAccountId: prop.order.alpacaAccountId !== undefined ? {
|
5525
|
+
equals: prop.order.alpacaAccountId
|
5526
|
+
} : undefined,
|
5527
|
+
assetId: prop.order.assetId !== undefined ? {
|
5528
|
+
equals: prop.order.assetId
|
5529
|
+
} : undefined,
|
5530
|
+
actionId: prop.order.actionId !== undefined ? {
|
5531
|
+
equals: prop.order.actionId
|
5532
|
+
} : undefined,
|
4855
5533
|
},
|
4856
5534
|
update: {
|
4857
5535
|
id: prop.order.id !== undefined ? {
|
@@ -4929,6 +5607,9 @@ export const Action = {
|
|
4929
5607
|
id: prop.order.stopLoss.id !== undefined ? {
|
4930
5608
|
equals: prop.order.stopLoss.id
|
4931
5609
|
} : undefined,
|
5610
|
+
orderId: prop.order.stopLoss.orderId !== undefined ? {
|
5611
|
+
equals: prop.order.stopLoss.orderId
|
5612
|
+
} : undefined,
|
4932
5613
|
},
|
4933
5614
|
update: {
|
4934
5615
|
id: prop.order.stopLoss.id !== undefined ? {
|
@@ -4953,6 +5634,9 @@ export const Action = {
|
|
4953
5634
|
id: prop.order.takeProfit.id !== undefined ? {
|
4954
5635
|
equals: prop.order.takeProfit.id
|
4955
5636
|
} : undefined,
|
5637
|
+
orderId: prop.order.takeProfit.orderId !== undefined ? {
|
5638
|
+
equals: prop.order.takeProfit.orderId
|
5639
|
+
} : undefined,
|
4956
5640
|
},
|
4957
5641
|
update: {
|
4958
5642
|
id: prop.order.takeProfit.id !== undefined ? {
|
@@ -4977,6 +5661,9 @@ export const Action = {
|
|
4977
5661
|
id: prop.order.alpacaAccount.id !== undefined ? {
|
4978
5662
|
equals: prop.order.alpacaAccount.id
|
4979
5663
|
} : undefined,
|
5664
|
+
userId: prop.order.alpacaAccount.userId !== undefined ? {
|
5665
|
+
equals: prop.order.alpacaAccount.userId
|
5666
|
+
} : undefined,
|
4980
5667
|
},
|
4981
5668
|
update: {
|
4982
5669
|
id: prop.order.alpacaAccount.id !== undefined ? {
|
@@ -5078,7 +5765,15 @@ export const Action = {
|
|
5078
5765
|
trades: prop.order.alpacaAccount.trades ? {
|
5079
5766
|
upsert: prop.order.alpacaAccount.trades.map((item) => ({
|
5080
5767
|
where: {
|
5081
|
-
id: item.id !== undefined ?
|
5768
|
+
id: item.id !== undefined ? {
|
5769
|
+
equals: item.id
|
5770
|
+
} : undefined,
|
5771
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5772
|
+
equals: item.alpacaAccountId
|
5773
|
+
} : undefined,
|
5774
|
+
assetId: item.assetId !== undefined ? {
|
5775
|
+
equals: item.assetId
|
5776
|
+
} : undefined,
|
5082
5777
|
},
|
5083
5778
|
update: {
|
5084
5779
|
id: item.id !== undefined ? {
|
@@ -5136,7 +5831,15 @@ export const Action = {
|
|
5136
5831
|
positions: prop.order.alpacaAccount.positions ? {
|
5137
5832
|
upsert: prop.order.alpacaAccount.positions.map((item) => ({
|
5138
5833
|
where: {
|
5139
|
-
id: item.id !== undefined ?
|
5834
|
+
id: item.id !== undefined ? {
|
5835
|
+
equals: item.id
|
5836
|
+
} : undefined,
|
5837
|
+
assetId: item.assetId !== undefined ? {
|
5838
|
+
equals: item.assetId
|
5839
|
+
} : undefined,
|
5840
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5841
|
+
equals: item.alpacaAccountId
|
5842
|
+
} : undefined,
|
5140
5843
|
},
|
5141
5844
|
update: {
|
5142
5845
|
id: item.id !== undefined ? {
|
@@ -5202,7 +5905,12 @@ export const Action = {
|
|
5202
5905
|
alerts: prop.order.alpacaAccount.alerts ? {
|
5203
5906
|
upsert: prop.order.alpacaAccount.alerts.map((item) => ({
|
5204
5907
|
where: {
|
5205
|
-
id: item.id !== undefined ?
|
5908
|
+
id: item.id !== undefined ? {
|
5909
|
+
equals: item.id
|
5910
|
+
} : undefined,
|
5911
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5912
|
+
equals: item.alpacaAccountId
|
5913
|
+
} : undefined,
|
5206
5914
|
},
|
5207
5915
|
update: {
|
5208
5916
|
id: item.id !== undefined ? {
|
@@ -5244,7 +5952,9 @@ export const Action = {
|
|
5244
5952
|
}
|
5245
5953
|
: { connectOrCreate: {
|
5246
5954
|
where: {
|
5247
|
-
id: prop.order.alpacaAccount.user.id !== undefined ?
|
5955
|
+
id: prop.order.alpacaAccount.user.id !== undefined ? {
|
5956
|
+
equals: prop.order.alpacaAccount.user.id
|
5957
|
+
} : undefined,
|
5248
5958
|
email: prop.order.alpacaAccount.user.email !== undefined ? prop.order.alpacaAccount.user.email : undefined,
|
5249
5959
|
name: prop.order.alpacaAccount.user.name !== undefined ? {
|
5250
5960
|
equals: prop.order.alpacaAccount.user.name
|
@@ -5273,7 +5983,15 @@ export const Action = {
|
|
5273
5983
|
}
|
5274
5984
|
: { connectOrCreate: prop.order.alpacaAccount.trades.map((item) => ({
|
5275
5985
|
where: {
|
5276
|
-
id: item.id !== undefined ?
|
5986
|
+
id: item.id !== undefined ? {
|
5987
|
+
equals: item.id
|
5988
|
+
} : undefined,
|
5989
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5990
|
+
equals: item.alpacaAccountId
|
5991
|
+
} : undefined,
|
5992
|
+
assetId: item.assetId !== undefined ? {
|
5993
|
+
equals: item.assetId
|
5994
|
+
} : undefined,
|
5277
5995
|
},
|
5278
5996
|
create: {
|
5279
5997
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5298,7 +6016,15 @@ export const Action = {
|
|
5298
6016
|
}
|
5299
6017
|
: { connectOrCreate: prop.order.alpacaAccount.positions.map((item) => ({
|
5300
6018
|
where: {
|
5301
|
-
id: item.id !== undefined ?
|
6019
|
+
id: item.id !== undefined ? {
|
6020
|
+
equals: item.id
|
6021
|
+
} : undefined,
|
6022
|
+
assetId: item.assetId !== undefined ? {
|
6023
|
+
equals: item.assetId
|
6024
|
+
} : undefined,
|
6025
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6026
|
+
equals: item.alpacaAccountId
|
6027
|
+
} : undefined,
|
5302
6028
|
},
|
5303
6029
|
create: {
|
5304
6030
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5325,7 +6051,12 @@ export const Action = {
|
|
5325
6051
|
}
|
5326
6052
|
: { connectOrCreate: prop.order.alpacaAccount.alerts.map((item) => ({
|
5327
6053
|
where: {
|
5328
|
-
id: item.id !== undefined ?
|
6054
|
+
id: item.id !== undefined ? {
|
6055
|
+
equals: item.id
|
6056
|
+
} : undefined,
|
6057
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6058
|
+
equals: item.alpacaAccountId
|
6059
|
+
} : undefined,
|
5329
6060
|
},
|
5330
6061
|
create: {
|
5331
6062
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -5522,7 +6253,15 @@ export const Action = {
|
|
5522
6253
|
trades: prop.order.asset.trades ? {
|
5523
6254
|
upsert: prop.order.asset.trades.map((item) => ({
|
5524
6255
|
where: {
|
5525
|
-
id: item.id !== undefined ?
|
6256
|
+
id: item.id !== undefined ? {
|
6257
|
+
equals: item.id
|
6258
|
+
} : undefined,
|
6259
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6260
|
+
equals: item.alpacaAccountId
|
6261
|
+
} : undefined,
|
6262
|
+
assetId: item.assetId !== undefined ? {
|
6263
|
+
equals: item.assetId
|
6264
|
+
} : undefined,
|
5526
6265
|
},
|
5527
6266
|
update: {
|
5528
6267
|
id: item.id !== undefined ? {
|
@@ -5580,7 +6319,15 @@ export const Action = {
|
|
5580
6319
|
positions: prop.order.asset.positions ? {
|
5581
6320
|
upsert: prop.order.asset.positions.map((item) => ({
|
5582
6321
|
where: {
|
5583
|
-
id: item.id !== undefined ?
|
6322
|
+
id: item.id !== undefined ? {
|
6323
|
+
equals: item.id
|
6324
|
+
} : undefined,
|
6325
|
+
assetId: item.assetId !== undefined ? {
|
6326
|
+
equals: item.assetId
|
6327
|
+
} : undefined,
|
6328
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6329
|
+
equals: item.alpacaAccountId
|
6330
|
+
} : undefined,
|
5584
6331
|
},
|
5585
6332
|
update: {
|
5586
6333
|
id: item.id !== undefined ? {
|
@@ -5646,8 +6393,16 @@ export const Action = {
|
|
5646
6393
|
newsMentions: prop.order.asset.newsMentions ? {
|
5647
6394
|
upsert: prop.order.asset.newsMentions.map((item) => ({
|
5648
6395
|
where: {
|
5649
|
-
id: item.id !== undefined ?
|
6396
|
+
id: item.id !== undefined ? {
|
6397
|
+
equals: item.id
|
6398
|
+
} : undefined,
|
5650
6399
|
url: item.url !== undefined ? item.url : undefined,
|
6400
|
+
assetId: item.assetId !== undefined ? {
|
6401
|
+
equals: item.assetId
|
6402
|
+
} : undefined,
|
6403
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6404
|
+
equals: item.newsArticleId
|
6405
|
+
} : undefined,
|
5651
6406
|
},
|
5652
6407
|
update: {
|
5653
6408
|
id: item.id !== undefined ? {
|
@@ -5739,7 +6494,15 @@ export const Action = {
|
|
5739
6494
|
}
|
5740
6495
|
: { connectOrCreate: prop.order.asset.trades.map((item) => ({
|
5741
6496
|
where: {
|
5742
|
-
id: item.id !== undefined ?
|
6497
|
+
id: item.id !== undefined ? {
|
6498
|
+
equals: item.id
|
6499
|
+
} : undefined,
|
6500
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6501
|
+
equals: item.alpacaAccountId
|
6502
|
+
} : undefined,
|
6503
|
+
assetId: item.assetId !== undefined ? {
|
6504
|
+
equals: item.assetId
|
6505
|
+
} : undefined,
|
5743
6506
|
},
|
5744
6507
|
create: {
|
5745
6508
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5764,7 +6527,15 @@ export const Action = {
|
|
5764
6527
|
}
|
5765
6528
|
: { connectOrCreate: prop.order.asset.positions.map((item) => ({
|
5766
6529
|
where: {
|
5767
|
-
id: item.id !== undefined ?
|
6530
|
+
id: item.id !== undefined ? {
|
6531
|
+
equals: item.id
|
6532
|
+
} : undefined,
|
6533
|
+
assetId: item.assetId !== undefined ? {
|
6534
|
+
equals: item.assetId
|
6535
|
+
} : undefined,
|
6536
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6537
|
+
equals: item.alpacaAccountId
|
6538
|
+
} : undefined,
|
5768
6539
|
},
|
5769
6540
|
create: {
|
5770
6541
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5791,8 +6562,16 @@ export const Action = {
|
|
5791
6562
|
}
|
5792
6563
|
: { connectOrCreate: prop.order.asset.newsMentions.map((item) => ({
|
5793
6564
|
where: {
|
5794
|
-
id: item.id !== undefined ?
|
6565
|
+
id: item.id !== undefined ? {
|
6566
|
+
equals: item.id
|
6567
|
+
} : undefined,
|
5795
6568
|
url: item.url !== undefined ? item.url : undefined,
|
6569
|
+
assetId: item.assetId !== undefined ? {
|
6570
|
+
equals: item.assetId
|
6571
|
+
} : undefined,
|
6572
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6573
|
+
equals: item.newsArticleId
|
6574
|
+
} : undefined,
|
5796
6575
|
},
|
5797
6576
|
create: {
|
5798
6577
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -5837,7 +6616,10 @@ export const Action = {
|
|
5837
6616
|
}
|
5838
6617
|
: { connectOrCreate: {
|
5839
6618
|
where: {
|
5840
|
-
id: prop.order.stopLoss.id !== undefined ?
|
6619
|
+
id: prop.order.stopLoss.id !== undefined ? {
|
6620
|
+
equals: prop.order.stopLoss.id
|
6621
|
+
} : undefined,
|
6622
|
+
orderId: prop.order.stopLoss.orderId !== undefined ? prop.order.stopLoss.orderId : undefined,
|
5841
6623
|
},
|
5842
6624
|
create: {
|
5843
6625
|
stopPrice: prop.order.stopLoss.stopPrice !== undefined ? prop.order.stopLoss.stopPrice : undefined,
|
@@ -5853,7 +6635,10 @@ export const Action = {
|
|
5853
6635
|
}
|
5854
6636
|
: { connectOrCreate: {
|
5855
6637
|
where: {
|
5856
|
-
id: prop.order.takeProfit.id !== undefined ?
|
6638
|
+
id: prop.order.takeProfit.id !== undefined ? {
|
6639
|
+
equals: prop.order.takeProfit.id
|
6640
|
+
} : undefined,
|
6641
|
+
orderId: prop.order.takeProfit.orderId !== undefined ? prop.order.takeProfit.orderId : undefined,
|
5857
6642
|
},
|
5858
6643
|
create: {
|
5859
6644
|
limitPrice: prop.order.takeProfit.limitPrice !== undefined ? prop.order.takeProfit.limitPrice : undefined,
|
@@ -5869,7 +6654,12 @@ export const Action = {
|
|
5869
6654
|
}
|
5870
6655
|
: { connectOrCreate: {
|
5871
6656
|
where: {
|
5872
|
-
id: prop.order.alpacaAccount.id !== undefined ?
|
6657
|
+
id: prop.order.alpacaAccount.id !== undefined ? {
|
6658
|
+
equals: prop.order.alpacaAccount.id
|
6659
|
+
} : undefined,
|
6660
|
+
userId: prop.order.alpacaAccount.userId !== undefined ? {
|
6661
|
+
equals: prop.order.alpacaAccount.userId
|
6662
|
+
} : undefined,
|
5873
6663
|
},
|
5874
6664
|
create: {
|
5875
6665
|
type: prop.order.alpacaAccount.type !== undefined ? prop.order.alpacaAccount.type : undefined,
|
@@ -5889,7 +6679,9 @@ export const Action = {
|
|
5889
6679
|
}
|
5890
6680
|
: { connectOrCreate: {
|
5891
6681
|
where: {
|
5892
|
-
id: prop.order.alpacaAccount.user.id !== undefined ?
|
6682
|
+
id: prop.order.alpacaAccount.user.id !== undefined ? {
|
6683
|
+
equals: prop.order.alpacaAccount.user.id
|
6684
|
+
} : undefined,
|
5893
6685
|
email: prop.order.alpacaAccount.user.email !== undefined ? prop.order.alpacaAccount.user.email : undefined,
|
5894
6686
|
name: prop.order.alpacaAccount.user.name !== undefined ? {
|
5895
6687
|
equals: prop.order.alpacaAccount.user.name
|
@@ -5918,7 +6710,15 @@ export const Action = {
|
|
5918
6710
|
}
|
5919
6711
|
: { connectOrCreate: prop.order.alpacaAccount.trades.map((item) => ({
|
5920
6712
|
where: {
|
5921
|
-
id: item.id !== undefined ?
|
6713
|
+
id: item.id !== undefined ? {
|
6714
|
+
equals: item.id
|
6715
|
+
} : undefined,
|
6716
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6717
|
+
equals: item.alpacaAccountId
|
6718
|
+
} : undefined,
|
6719
|
+
assetId: item.assetId !== undefined ? {
|
6720
|
+
equals: item.assetId
|
6721
|
+
} : undefined,
|
5922
6722
|
},
|
5923
6723
|
create: {
|
5924
6724
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5943,7 +6743,15 @@ export const Action = {
|
|
5943
6743
|
}
|
5944
6744
|
: { connectOrCreate: prop.order.alpacaAccount.positions.map((item) => ({
|
5945
6745
|
where: {
|
5946
|
-
id: item.id !== undefined ?
|
6746
|
+
id: item.id !== undefined ? {
|
6747
|
+
equals: item.id
|
6748
|
+
} : undefined,
|
6749
|
+
assetId: item.assetId !== undefined ? {
|
6750
|
+
equals: item.assetId
|
6751
|
+
} : undefined,
|
6752
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6753
|
+
equals: item.alpacaAccountId
|
6754
|
+
} : undefined,
|
5947
6755
|
},
|
5948
6756
|
create: {
|
5949
6757
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5970,7 +6778,12 @@ export const Action = {
|
|
5970
6778
|
}
|
5971
6779
|
: { connectOrCreate: prop.order.alpacaAccount.alerts.map((item) => ({
|
5972
6780
|
where: {
|
5973
|
-
id: item.id !== undefined ?
|
6781
|
+
id: item.id !== undefined ? {
|
6782
|
+
equals: item.id
|
6783
|
+
} : undefined,
|
6784
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6785
|
+
equals: item.alpacaAccountId
|
6786
|
+
} : undefined,
|
5974
6787
|
},
|
5975
6788
|
create: {
|
5976
6789
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -5990,7 +6803,9 @@ export const Action = {
|
|
5990
6803
|
}
|
5991
6804
|
: { connectOrCreate: {
|
5992
6805
|
where: {
|
5993
|
-
id: prop.order.asset.id !== undefined ?
|
6806
|
+
id: prop.order.asset.id !== undefined ? {
|
6807
|
+
equals: prop.order.asset.id
|
6808
|
+
} : undefined,
|
5994
6809
|
symbol: prop.order.asset.symbol !== undefined ? prop.order.asset.symbol : undefined,
|
5995
6810
|
name: prop.order.asset.name !== undefined ? prop.order.asset.name : undefined,
|
5996
6811
|
},
|
@@ -6058,7 +6873,15 @@ export const Action = {
|
|
6058
6873
|
}
|
6059
6874
|
: { connectOrCreate: prop.order.asset.trades.map((item) => ({
|
6060
6875
|
where: {
|
6061
|
-
id: item.id !== undefined ?
|
6876
|
+
id: item.id !== undefined ? {
|
6877
|
+
equals: item.id
|
6878
|
+
} : undefined,
|
6879
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6880
|
+
equals: item.alpacaAccountId
|
6881
|
+
} : undefined,
|
6882
|
+
assetId: item.assetId !== undefined ? {
|
6883
|
+
equals: item.assetId
|
6884
|
+
} : undefined,
|
6062
6885
|
},
|
6063
6886
|
create: {
|
6064
6887
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -6083,7 +6906,15 @@ export const Action = {
|
|
6083
6906
|
}
|
6084
6907
|
: { connectOrCreate: prop.order.asset.positions.map((item) => ({
|
6085
6908
|
where: {
|
6086
|
-
id: item.id !== undefined ?
|
6909
|
+
id: item.id !== undefined ? {
|
6910
|
+
equals: item.id
|
6911
|
+
} : undefined,
|
6912
|
+
assetId: item.assetId !== undefined ? {
|
6913
|
+
equals: item.assetId
|
6914
|
+
} : undefined,
|
6915
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6916
|
+
equals: item.alpacaAccountId
|
6917
|
+
} : undefined,
|
6087
6918
|
},
|
6088
6919
|
create: {
|
6089
6920
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -6110,8 +6941,16 @@ export const Action = {
|
|
6110
6941
|
}
|
6111
6942
|
: { connectOrCreate: prop.order.asset.newsMentions.map((item) => ({
|
6112
6943
|
where: {
|
6113
|
-
id: item.id !== undefined ?
|
6944
|
+
id: item.id !== undefined ? {
|
6945
|
+
equals: item.id
|
6946
|
+
} : undefined,
|
6114
6947
|
url: item.url !== undefined ? item.url : undefined,
|
6948
|
+
assetId: item.assetId !== undefined ? {
|
6949
|
+
equals: item.assetId
|
6950
|
+
} : undefined,
|
6951
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6952
|
+
equals: item.newsArticleId
|
6953
|
+
} : undefined,
|
6115
6954
|
},
|
6116
6955
|
create: {
|
6117
6956
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -6196,9 +7035,13 @@ export const Action = {
|
|
6196
7035
|
}`;
|
6197
7036
|
const variables = {
|
6198
7037
|
where: {
|
6199
|
-
id: props.id !== undefined ?
|
7038
|
+
id: props.id !== undefined ? {
|
7039
|
+
equals: props.id
|
7040
|
+
} : undefined,
|
6200
7041
|
sequence: props.sequence !== undefined ? props.sequence : undefined,
|
6201
|
-
tradeId: props.tradeId !== undefined ?
|
7042
|
+
tradeId: props.tradeId !== undefined ? {
|
7043
|
+
equals: props.tradeId
|
7044
|
+
} : undefined,
|
6202
7045
|
type: props.type !== undefined ? props.type : undefined,
|
6203
7046
|
note: props.note !== undefined ? props.note : undefined,
|
6204
7047
|
status: props.status !== undefined ? props.status : undefined,
|
@@ -6268,7 +7111,9 @@ export const Action = {
|
|
6268
7111
|
equals: props.id
|
6269
7112
|
} : undefined,
|
6270
7113
|
sequence: props.sequence !== undefined ? props.sequence : undefined,
|
6271
|
-
tradeId: props.tradeId !== undefined ?
|
7114
|
+
tradeId: props.tradeId !== undefined ? {
|
7115
|
+
equals: props.tradeId
|
7116
|
+
} : undefined,
|
6272
7117
|
type: props.type !== undefined ? props.type : undefined,
|
6273
7118
|
note: props.note !== undefined ? props.note : undefined,
|
6274
7119
|
status: props.status !== undefined ? props.status : undefined,
|