adaptic-backend 1.0.159 → 1.0.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Account.cjs +285 -8
- package/Action.cjs +615 -4
- package/Alert.cjs +338 -4
- package/AlpacaAccount.cjs +771 -4
- package/Asset.cjs +642 -0
- package/Authenticator.cjs +288 -4
- package/Customer.cjs +273 -10
- package/NewsArticle.cjs +165 -0
- package/NewsArticleAssetSentiment.cjs +256 -8
- package/Order.cjs +510 -10
- package/Position.cjs +546 -8
- package/Session.cjs +288 -4
- package/StopLoss.cjs +348 -1
- package/TakeProfit.cjs +348 -1
- package/Trade.cjs +607 -8
- package/User.cjs +261 -0
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +285 -8
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +615 -4
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +338 -4
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +771 -4
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +642 -0
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +288 -4
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +273 -10
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +165 -0
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +256 -8
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +510 -10
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +546 -8
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +288 -4
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +348 -1
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +348 -1
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +607 -8
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +261 -0
package/server/Action.mjs
CHANGED
@@ -195,6 +195,12 @@ export const Action = {
|
|
195
195
|
: { connectOrCreate: {
|
196
196
|
where: {
|
197
197
|
id: props.trade.id !== undefined ? props.trade.id : undefined,
|
198
|
+
alpacaAccountId: props.trade.alpacaAccountId !== undefined ? {
|
199
|
+
equals: props.trade.alpacaAccountId
|
200
|
+
} : undefined,
|
201
|
+
assetId: props.trade.assetId !== undefined ? {
|
202
|
+
equals: props.trade.assetId
|
203
|
+
} : undefined,
|
198
204
|
},
|
199
205
|
create: {
|
200
206
|
qty: props.trade.qty !== undefined ? props.trade.qty : undefined,
|
@@ -217,6 +223,9 @@ export const Action = {
|
|
217
223
|
: { connectOrCreate: {
|
218
224
|
where: {
|
219
225
|
id: props.trade.alpacaAccount.id !== undefined ? props.trade.alpacaAccount.id : undefined,
|
226
|
+
userId: props.trade.alpacaAccount.userId !== undefined ? {
|
227
|
+
equals: props.trade.alpacaAccount.userId
|
228
|
+
} : undefined,
|
220
229
|
},
|
221
230
|
create: {
|
222
231
|
type: props.trade.alpacaAccount.type !== undefined ? props.trade.alpacaAccount.type : undefined,
|
@@ -266,6 +275,15 @@ export const Action = {
|
|
266
275
|
: { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
|
267
276
|
where: {
|
268
277
|
id: item.id !== undefined ? item.id : undefined,
|
278
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
279
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
280
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
281
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
282
|
+
equals: item.alpacaAccountId
|
283
|
+
} : undefined,
|
284
|
+
assetId: item.assetId !== undefined ? {
|
285
|
+
equals: item.assetId
|
286
|
+
} : undefined,
|
269
287
|
},
|
270
288
|
create: {
|
271
289
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -302,6 +320,12 @@ export const Action = {
|
|
302
320
|
: { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
|
303
321
|
where: {
|
304
322
|
id: item.id !== undefined ? item.id : undefined,
|
323
|
+
assetId: item.assetId !== undefined ? {
|
324
|
+
equals: item.assetId
|
325
|
+
} : undefined,
|
326
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
327
|
+
equals: item.alpacaAccountId
|
328
|
+
} : undefined,
|
305
329
|
},
|
306
330
|
create: {
|
307
331
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -329,6 +353,9 @@ export const Action = {
|
|
329
353
|
: { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
|
330
354
|
where: {
|
331
355
|
id: item.id !== undefined ? item.id : undefined,
|
356
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
357
|
+
equals: item.alpacaAccountId
|
358
|
+
} : undefined,
|
332
359
|
},
|
333
360
|
create: {
|
334
361
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -417,6 +444,15 @@ export const Action = {
|
|
417
444
|
: { connectOrCreate: props.trade.asset.orders.map((item) => ({
|
418
445
|
where: {
|
419
446
|
id: item.id !== undefined ? item.id : undefined,
|
447
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
448
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
449
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
450
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
451
|
+
equals: item.alpacaAccountId
|
452
|
+
} : undefined,
|
453
|
+
assetId: item.assetId !== undefined ? {
|
454
|
+
equals: item.assetId
|
455
|
+
} : undefined,
|
420
456
|
},
|
421
457
|
create: {
|
422
458
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -453,6 +489,12 @@ export const Action = {
|
|
453
489
|
: { connectOrCreate: props.trade.asset.positions.map((item) => ({
|
454
490
|
where: {
|
455
491
|
id: item.id !== undefined ? item.id : undefined,
|
492
|
+
assetId: item.assetId !== undefined ? {
|
493
|
+
equals: item.assetId
|
494
|
+
} : undefined,
|
495
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
496
|
+
equals: item.alpacaAccountId
|
497
|
+
} : undefined,
|
456
498
|
},
|
457
499
|
create: {
|
458
500
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -481,6 +523,12 @@ export const Action = {
|
|
481
523
|
where: {
|
482
524
|
id: item.id !== undefined ? item.id : undefined,
|
483
525
|
url: item.url !== undefined ? item.url : undefined,
|
526
|
+
assetId: item.assetId !== undefined ? {
|
527
|
+
equals: item.assetId
|
528
|
+
} : undefined,
|
529
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
530
|
+
equals: item.newsArticleId
|
531
|
+
} : undefined,
|
484
532
|
},
|
485
533
|
create: {
|
486
534
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -505,6 +553,15 @@ export const Action = {
|
|
505
553
|
: { connectOrCreate: {
|
506
554
|
where: {
|
507
555
|
id: props.order.id !== undefined ? props.order.id : undefined,
|
556
|
+
clientOrderId: props.order.clientOrderId !== undefined ? props.order.clientOrderId : undefined,
|
557
|
+
actionId: props.order.actionId !== undefined ? props.order.actionId : undefined,
|
558
|
+
stopLossId: props.order.stopLossId !== undefined ? props.order.stopLossId : undefined,
|
559
|
+
alpacaAccountId: props.order.alpacaAccountId !== undefined ? {
|
560
|
+
equals: props.order.alpacaAccountId
|
561
|
+
} : undefined,
|
562
|
+
assetId: props.order.assetId !== undefined ? {
|
563
|
+
equals: props.order.assetId
|
564
|
+
} : undefined,
|
508
565
|
},
|
509
566
|
create: {
|
510
567
|
clientOrderId: props.order.clientOrderId !== undefined ? props.order.clientOrderId : undefined,
|
@@ -538,6 +595,7 @@ export const Action = {
|
|
538
595
|
: { connectOrCreate: {
|
539
596
|
where: {
|
540
597
|
id: props.order.stopLoss.id !== undefined ? props.order.stopLoss.id : undefined,
|
598
|
+
orderId: props.order.stopLoss.orderId !== undefined ? props.order.stopLoss.orderId : undefined,
|
541
599
|
},
|
542
600
|
create: {
|
543
601
|
stopPrice: props.order.stopLoss.stopPrice !== undefined ? props.order.stopLoss.stopPrice : undefined,
|
@@ -554,6 +612,7 @@ export const Action = {
|
|
554
612
|
: { connectOrCreate: {
|
555
613
|
where: {
|
556
614
|
id: props.order.takeProfit.id !== undefined ? props.order.takeProfit.id : undefined,
|
615
|
+
orderId: props.order.takeProfit.orderId !== undefined ? props.order.takeProfit.orderId : undefined,
|
557
616
|
},
|
558
617
|
create: {
|
559
618
|
limitPrice: props.order.takeProfit.limitPrice !== undefined ? props.order.takeProfit.limitPrice : undefined,
|
@@ -570,6 +629,9 @@ export const Action = {
|
|
570
629
|
: { connectOrCreate: {
|
571
630
|
where: {
|
572
631
|
id: props.order.alpacaAccount.id !== undefined ? props.order.alpacaAccount.id : undefined,
|
632
|
+
userId: props.order.alpacaAccount.userId !== undefined ? {
|
633
|
+
equals: props.order.alpacaAccount.userId
|
634
|
+
} : undefined,
|
573
635
|
},
|
574
636
|
create: {
|
575
637
|
type: props.order.alpacaAccount.type !== undefined ? props.order.alpacaAccount.type : undefined,
|
@@ -619,6 +681,12 @@ export const Action = {
|
|
619
681
|
: { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
|
620
682
|
where: {
|
621
683
|
id: item.id !== undefined ? item.id : undefined,
|
684
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
685
|
+
equals: item.alpacaAccountId
|
686
|
+
} : undefined,
|
687
|
+
assetId: item.assetId !== undefined ? {
|
688
|
+
equals: item.assetId
|
689
|
+
} : undefined,
|
622
690
|
},
|
623
691
|
create: {
|
624
692
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -644,6 +712,12 @@ export const Action = {
|
|
644
712
|
: { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
|
645
713
|
where: {
|
646
714
|
id: item.id !== undefined ? item.id : undefined,
|
715
|
+
assetId: item.assetId !== undefined ? {
|
716
|
+
equals: item.assetId
|
717
|
+
} : undefined,
|
718
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
719
|
+
equals: item.alpacaAccountId
|
720
|
+
} : undefined,
|
647
721
|
},
|
648
722
|
create: {
|
649
723
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -671,6 +745,9 @@ export const Action = {
|
|
671
745
|
: { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
|
672
746
|
where: {
|
673
747
|
id: item.id !== undefined ? item.id : undefined,
|
748
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
749
|
+
equals: item.alpacaAccountId
|
750
|
+
} : undefined,
|
674
751
|
},
|
675
752
|
create: {
|
676
753
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -759,6 +836,12 @@ export const Action = {
|
|
759
836
|
: { connectOrCreate: props.order.asset.trades.map((item) => ({
|
760
837
|
where: {
|
761
838
|
id: item.id !== undefined ? item.id : undefined,
|
839
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
840
|
+
equals: item.alpacaAccountId
|
841
|
+
} : undefined,
|
842
|
+
assetId: item.assetId !== undefined ? {
|
843
|
+
equals: item.assetId
|
844
|
+
} : undefined,
|
762
845
|
},
|
763
846
|
create: {
|
764
847
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -784,6 +867,12 @@ export const Action = {
|
|
784
867
|
: { connectOrCreate: props.order.asset.positions.map((item) => ({
|
785
868
|
where: {
|
786
869
|
id: item.id !== undefined ? item.id : undefined,
|
870
|
+
assetId: item.assetId !== undefined ? {
|
871
|
+
equals: item.assetId
|
872
|
+
} : undefined,
|
873
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
874
|
+
equals: item.alpacaAccountId
|
875
|
+
} : undefined,
|
787
876
|
},
|
788
877
|
create: {
|
789
878
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -812,6 +901,12 @@ export const Action = {
|
|
812
901
|
where: {
|
813
902
|
id: item.id !== undefined ? item.id : undefined,
|
814
903
|
url: item.url !== undefined ? item.url : undefined,
|
904
|
+
assetId: item.assetId !== undefined ? {
|
905
|
+
equals: item.assetId
|
906
|
+
} : undefined,
|
907
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
908
|
+
equals: item.newsArticleId
|
909
|
+
} : undefined,
|
815
910
|
},
|
816
911
|
create: {
|
817
912
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -903,7 +998,9 @@ export const Action = {
|
|
903
998
|
where: {
|
904
999
|
id: props.id !== undefined ? props.id : undefined,
|
905
1000
|
sequence: props.sequence !== undefined ? props.sequence : undefined,
|
906
|
-
tradeId: props.tradeId !== undefined ?
|
1001
|
+
tradeId: props.tradeId !== undefined ? {
|
1002
|
+
equals: props.tradeId
|
1003
|
+
} : undefined,
|
907
1004
|
type: props.type !== undefined ? props.type : undefined,
|
908
1005
|
note: props.note !== undefined ? props.note : undefined,
|
909
1006
|
status: props.status !== undefined ? props.status : undefined,
|
@@ -933,6 +1030,12 @@ export const Action = {
|
|
933
1030
|
id: props.trade.id !== undefined ? {
|
934
1031
|
equals: props.trade.id
|
935
1032
|
} : undefined,
|
1033
|
+
alpacaAccountId: props.trade.alpacaAccountId !== undefined ? {
|
1034
|
+
equals: props.trade.alpacaAccountId
|
1035
|
+
} : undefined,
|
1036
|
+
assetId: props.trade.assetId !== undefined ? {
|
1037
|
+
equals: props.trade.assetId
|
1038
|
+
} : undefined,
|
936
1039
|
},
|
937
1040
|
update: {
|
938
1041
|
id: props.trade.id !== undefined ? {
|
@@ -977,6 +1080,9 @@ export const Action = {
|
|
977
1080
|
id: props.trade.alpacaAccount.id !== undefined ? {
|
978
1081
|
equals: props.trade.alpacaAccount.id
|
979
1082
|
} : undefined,
|
1083
|
+
userId: props.trade.alpacaAccount.userId !== undefined ? {
|
1084
|
+
equals: props.trade.alpacaAccount.userId
|
1085
|
+
} : undefined,
|
980
1086
|
},
|
981
1087
|
update: {
|
982
1088
|
id: props.trade.alpacaAccount.id !== undefined ? {
|
@@ -1079,6 +1185,15 @@ export const Action = {
|
|
1079
1185
|
upsert: props.trade.alpacaAccount.orders.map((item) => ({
|
1080
1186
|
where: {
|
1081
1187
|
id: item.id !== undefined ? item.id : undefined,
|
1188
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1189
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1190
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1191
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1192
|
+
equals: item.alpacaAccountId
|
1193
|
+
} : undefined,
|
1194
|
+
assetId: item.assetId !== undefined ? {
|
1195
|
+
equals: item.assetId
|
1196
|
+
} : undefined,
|
1082
1197
|
},
|
1083
1198
|
update: {
|
1084
1199
|
id: item.id !== undefined ? {
|
@@ -1181,6 +1296,12 @@ export const Action = {
|
|
1181
1296
|
upsert: props.trade.alpacaAccount.positions.map((item) => ({
|
1182
1297
|
where: {
|
1183
1298
|
id: item.id !== undefined ? item.id : undefined,
|
1299
|
+
assetId: item.assetId !== undefined ? {
|
1300
|
+
equals: item.assetId
|
1301
|
+
} : undefined,
|
1302
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1303
|
+
equals: item.alpacaAccountId
|
1304
|
+
} : undefined,
|
1184
1305
|
},
|
1185
1306
|
update: {
|
1186
1307
|
id: item.id !== undefined ? {
|
@@ -1247,6 +1368,9 @@ export const Action = {
|
|
1247
1368
|
upsert: props.trade.alpacaAccount.alerts.map((item) => ({
|
1248
1369
|
where: {
|
1249
1370
|
id: item.id !== undefined ? item.id : undefined,
|
1371
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1372
|
+
equals: item.alpacaAccountId
|
1373
|
+
} : undefined,
|
1250
1374
|
},
|
1251
1375
|
update: {
|
1252
1376
|
id: item.id !== undefined ? {
|
@@ -1318,6 +1442,15 @@ export const Action = {
|
|
1318
1442
|
: { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
|
1319
1443
|
where: {
|
1320
1444
|
id: item.id !== undefined ? item.id : undefined,
|
1445
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1446
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1447
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1448
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1449
|
+
equals: item.alpacaAccountId
|
1450
|
+
} : undefined,
|
1451
|
+
assetId: item.assetId !== undefined ? {
|
1452
|
+
equals: item.assetId
|
1453
|
+
} : undefined,
|
1321
1454
|
},
|
1322
1455
|
create: {
|
1323
1456
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1354,6 +1487,12 @@ export const Action = {
|
|
1354
1487
|
: { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
|
1355
1488
|
where: {
|
1356
1489
|
id: item.id !== undefined ? item.id : undefined,
|
1490
|
+
assetId: item.assetId !== undefined ? {
|
1491
|
+
equals: item.assetId
|
1492
|
+
} : undefined,
|
1493
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1494
|
+
equals: item.alpacaAccountId
|
1495
|
+
} : undefined,
|
1357
1496
|
},
|
1358
1497
|
create: {
|
1359
1498
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1381,6 +1520,9 @@ export const Action = {
|
|
1381
1520
|
: { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
|
1382
1521
|
where: {
|
1383
1522
|
id: item.id !== undefined ? item.id : undefined,
|
1523
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1524
|
+
equals: item.alpacaAccountId
|
1525
|
+
} : undefined,
|
1384
1526
|
},
|
1385
1527
|
create: {
|
1386
1528
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1578,6 +1720,15 @@ export const Action = {
|
|
1578
1720
|
upsert: props.trade.asset.orders.map((item) => ({
|
1579
1721
|
where: {
|
1580
1722
|
id: item.id !== undefined ? item.id : undefined,
|
1723
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1724
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1725
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1726
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1727
|
+
equals: item.alpacaAccountId
|
1728
|
+
} : undefined,
|
1729
|
+
assetId: item.assetId !== undefined ? {
|
1730
|
+
equals: item.assetId
|
1731
|
+
} : undefined,
|
1581
1732
|
},
|
1582
1733
|
update: {
|
1583
1734
|
id: item.id !== undefined ? {
|
@@ -1680,6 +1831,12 @@ export const Action = {
|
|
1680
1831
|
upsert: props.trade.asset.positions.map((item) => ({
|
1681
1832
|
where: {
|
1682
1833
|
id: item.id !== undefined ? item.id : undefined,
|
1834
|
+
assetId: item.assetId !== undefined ? {
|
1835
|
+
equals: item.assetId
|
1836
|
+
} : undefined,
|
1837
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1838
|
+
equals: item.alpacaAccountId
|
1839
|
+
} : undefined,
|
1683
1840
|
},
|
1684
1841
|
update: {
|
1685
1842
|
id: item.id !== undefined ? {
|
@@ -1747,6 +1904,12 @@ export const Action = {
|
|
1747
1904
|
where: {
|
1748
1905
|
id: item.id !== undefined ? item.id : undefined,
|
1749
1906
|
url: item.url !== undefined ? item.url : undefined,
|
1907
|
+
assetId: item.assetId !== undefined ? {
|
1908
|
+
equals: item.assetId
|
1909
|
+
} : undefined,
|
1910
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1911
|
+
equals: item.newsArticleId
|
1912
|
+
} : undefined,
|
1750
1913
|
},
|
1751
1914
|
update: {
|
1752
1915
|
id: item.id !== undefined ? {
|
@@ -1839,6 +2002,15 @@ export const Action = {
|
|
1839
2002
|
: { connectOrCreate: props.trade.asset.orders.map((item) => ({
|
1840
2003
|
where: {
|
1841
2004
|
id: item.id !== undefined ? item.id : undefined,
|
2005
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2006
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2007
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2008
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2009
|
+
equals: item.alpacaAccountId
|
2010
|
+
} : undefined,
|
2011
|
+
assetId: item.assetId !== undefined ? {
|
2012
|
+
equals: item.assetId
|
2013
|
+
} : undefined,
|
1842
2014
|
},
|
1843
2015
|
create: {
|
1844
2016
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1875,6 +2047,12 @@ export const Action = {
|
|
1875
2047
|
: { connectOrCreate: props.trade.asset.positions.map((item) => ({
|
1876
2048
|
where: {
|
1877
2049
|
id: item.id !== undefined ? item.id : undefined,
|
2050
|
+
assetId: item.assetId !== undefined ? {
|
2051
|
+
equals: item.assetId
|
2052
|
+
} : undefined,
|
2053
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2054
|
+
equals: item.alpacaAccountId
|
2055
|
+
} : undefined,
|
1878
2056
|
},
|
1879
2057
|
create: {
|
1880
2058
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1903,6 +2081,12 @@ export const Action = {
|
|
1903
2081
|
where: {
|
1904
2082
|
id: item.id !== undefined ? item.id : undefined,
|
1905
2083
|
url: item.url !== undefined ? item.url : undefined,
|
2084
|
+
assetId: item.assetId !== undefined ? {
|
2085
|
+
equals: item.assetId
|
2086
|
+
} : undefined,
|
2087
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2088
|
+
equals: item.newsArticleId
|
2089
|
+
} : undefined,
|
1906
2090
|
},
|
1907
2091
|
create: {
|
1908
2092
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -1937,6 +2121,9 @@ export const Action = {
|
|
1937
2121
|
: { connectOrCreate: {
|
1938
2122
|
where: {
|
1939
2123
|
id: props.trade.alpacaAccount.id !== undefined ? props.trade.alpacaAccount.id : undefined,
|
2124
|
+
userId: props.trade.alpacaAccount.userId !== undefined ? {
|
2125
|
+
equals: props.trade.alpacaAccount.userId
|
2126
|
+
} : undefined,
|
1940
2127
|
},
|
1941
2128
|
create: {
|
1942
2129
|
type: props.trade.alpacaAccount.type !== undefined ? props.trade.alpacaAccount.type : undefined,
|
@@ -1986,6 +2173,15 @@ export const Action = {
|
|
1986
2173
|
: { connectOrCreate: props.trade.alpacaAccount.orders.map((item) => ({
|
1987
2174
|
where: {
|
1988
2175
|
id: item.id !== undefined ? item.id : undefined,
|
2176
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2177
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2178
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2179
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2180
|
+
equals: item.alpacaAccountId
|
2181
|
+
} : undefined,
|
2182
|
+
assetId: item.assetId !== undefined ? {
|
2183
|
+
equals: item.assetId
|
2184
|
+
} : undefined,
|
1989
2185
|
},
|
1990
2186
|
create: {
|
1991
2187
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2022,6 +2218,12 @@ export const Action = {
|
|
2022
2218
|
: { connectOrCreate: props.trade.alpacaAccount.positions.map((item) => ({
|
2023
2219
|
where: {
|
2024
2220
|
id: item.id !== undefined ? item.id : undefined,
|
2221
|
+
assetId: item.assetId !== undefined ? {
|
2222
|
+
equals: item.assetId
|
2223
|
+
} : undefined,
|
2224
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2225
|
+
equals: item.alpacaAccountId
|
2226
|
+
} : undefined,
|
2025
2227
|
},
|
2026
2228
|
create: {
|
2027
2229
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2049,6 +2251,9 @@ export const Action = {
|
|
2049
2251
|
: { connectOrCreate: props.trade.alpacaAccount.alerts.map((item) => ({
|
2050
2252
|
where: {
|
2051
2253
|
id: item.id !== undefined ? item.id : undefined,
|
2254
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2255
|
+
equals: item.alpacaAccountId
|
2256
|
+
} : undefined,
|
2052
2257
|
},
|
2053
2258
|
create: {
|
2054
2259
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2137,6 +2342,15 @@ export const Action = {
|
|
2137
2342
|
: { connectOrCreate: props.trade.asset.orders.map((item) => ({
|
2138
2343
|
where: {
|
2139
2344
|
id: item.id !== undefined ? item.id : undefined,
|
2345
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2346
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2347
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2348
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2349
|
+
equals: item.alpacaAccountId
|
2350
|
+
} : undefined,
|
2351
|
+
assetId: item.assetId !== undefined ? {
|
2352
|
+
equals: item.assetId
|
2353
|
+
} : undefined,
|
2140
2354
|
},
|
2141
2355
|
create: {
|
2142
2356
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2173,6 +2387,12 @@ export const Action = {
|
|
2173
2387
|
: { connectOrCreate: props.trade.asset.positions.map((item) => ({
|
2174
2388
|
where: {
|
2175
2389
|
id: item.id !== undefined ? item.id : undefined,
|
2390
|
+
assetId: item.assetId !== undefined ? {
|
2391
|
+
equals: item.assetId
|
2392
|
+
} : undefined,
|
2393
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2394
|
+
equals: item.alpacaAccountId
|
2395
|
+
} : undefined,
|
2176
2396
|
},
|
2177
2397
|
create: {
|
2178
2398
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2201,6 +2421,12 @@ export const Action = {
|
|
2201
2421
|
where: {
|
2202
2422
|
id: item.id !== undefined ? item.id : undefined,
|
2203
2423
|
url: item.url !== undefined ? item.url : undefined,
|
2424
|
+
assetId: item.assetId !== undefined ? {
|
2425
|
+
equals: item.assetId
|
2426
|
+
} : undefined,
|
2427
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2428
|
+
equals: item.newsArticleId
|
2429
|
+
} : undefined,
|
2204
2430
|
},
|
2205
2431
|
create: {
|
2206
2432
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -2222,6 +2448,18 @@ export const Action = {
|
|
2222
2448
|
id: props.order.id !== undefined ? {
|
2223
2449
|
equals: props.order.id
|
2224
2450
|
} : undefined,
|
2451
|
+
clientOrderId: props.order.clientOrderId !== undefined ? {
|
2452
|
+
equals: props.order.clientOrderId
|
2453
|
+
} : undefined,
|
2454
|
+
alpacaAccountId: props.order.alpacaAccountId !== undefined ? {
|
2455
|
+
equals: props.order.alpacaAccountId
|
2456
|
+
} : undefined,
|
2457
|
+
assetId: props.order.assetId !== undefined ? {
|
2458
|
+
equals: props.order.assetId
|
2459
|
+
} : undefined,
|
2460
|
+
actionId: props.order.actionId !== undefined ? {
|
2461
|
+
equals: props.order.actionId
|
2462
|
+
} : undefined,
|
2225
2463
|
},
|
2226
2464
|
update: {
|
2227
2465
|
id: props.order.id !== undefined ? {
|
@@ -2299,6 +2537,9 @@ export const Action = {
|
|
2299
2537
|
id: props.order.stopLoss.id !== undefined ? {
|
2300
2538
|
equals: props.order.stopLoss.id
|
2301
2539
|
} : undefined,
|
2540
|
+
orderId: props.order.stopLoss.orderId !== undefined ? {
|
2541
|
+
equals: props.order.stopLoss.orderId
|
2542
|
+
} : undefined,
|
2302
2543
|
},
|
2303
2544
|
update: {
|
2304
2545
|
id: props.order.stopLoss.id !== undefined ? {
|
@@ -2323,6 +2564,9 @@ export const Action = {
|
|
2323
2564
|
id: props.order.takeProfit.id !== undefined ? {
|
2324
2565
|
equals: props.order.takeProfit.id
|
2325
2566
|
} : undefined,
|
2567
|
+
orderId: props.order.takeProfit.orderId !== undefined ? {
|
2568
|
+
equals: props.order.takeProfit.orderId
|
2569
|
+
} : undefined,
|
2326
2570
|
},
|
2327
2571
|
update: {
|
2328
2572
|
id: props.order.takeProfit.id !== undefined ? {
|
@@ -2347,6 +2591,9 @@ export const Action = {
|
|
2347
2591
|
id: props.order.alpacaAccount.id !== undefined ? {
|
2348
2592
|
equals: props.order.alpacaAccount.id
|
2349
2593
|
} : undefined,
|
2594
|
+
userId: props.order.alpacaAccount.userId !== undefined ? {
|
2595
|
+
equals: props.order.alpacaAccount.userId
|
2596
|
+
} : undefined,
|
2350
2597
|
},
|
2351
2598
|
update: {
|
2352
2599
|
id: props.order.alpacaAccount.id !== undefined ? {
|
@@ -2449,6 +2696,12 @@ export const Action = {
|
|
2449
2696
|
upsert: props.order.alpacaAccount.trades.map((item) => ({
|
2450
2697
|
where: {
|
2451
2698
|
id: item.id !== undefined ? item.id : undefined,
|
2699
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2700
|
+
equals: item.alpacaAccountId
|
2701
|
+
} : undefined,
|
2702
|
+
assetId: item.assetId !== undefined ? {
|
2703
|
+
equals: item.assetId
|
2704
|
+
} : undefined,
|
2452
2705
|
},
|
2453
2706
|
update: {
|
2454
2707
|
id: item.id !== undefined ? {
|
@@ -2507,6 +2760,12 @@ export const Action = {
|
|
2507
2760
|
upsert: props.order.alpacaAccount.positions.map((item) => ({
|
2508
2761
|
where: {
|
2509
2762
|
id: item.id !== undefined ? item.id : undefined,
|
2763
|
+
assetId: item.assetId !== undefined ? {
|
2764
|
+
equals: item.assetId
|
2765
|
+
} : undefined,
|
2766
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2767
|
+
equals: item.alpacaAccountId
|
2768
|
+
} : undefined,
|
2510
2769
|
},
|
2511
2770
|
update: {
|
2512
2771
|
id: item.id !== undefined ? {
|
@@ -2573,6 +2832,9 @@ export const Action = {
|
|
2573
2832
|
upsert: props.order.alpacaAccount.alerts.map((item) => ({
|
2574
2833
|
where: {
|
2575
2834
|
id: item.id !== undefined ? item.id : undefined,
|
2835
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2836
|
+
equals: item.alpacaAccountId
|
2837
|
+
} : undefined,
|
2576
2838
|
},
|
2577
2839
|
update: {
|
2578
2840
|
id: item.id !== undefined ? {
|
@@ -2644,6 +2906,12 @@ export const Action = {
|
|
2644
2906
|
: { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
|
2645
2907
|
where: {
|
2646
2908
|
id: item.id !== undefined ? item.id : undefined,
|
2909
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2910
|
+
equals: item.alpacaAccountId
|
2911
|
+
} : undefined,
|
2912
|
+
assetId: item.assetId !== undefined ? {
|
2913
|
+
equals: item.assetId
|
2914
|
+
} : undefined,
|
2647
2915
|
},
|
2648
2916
|
create: {
|
2649
2917
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2669,6 +2937,12 @@ export const Action = {
|
|
2669
2937
|
: { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
|
2670
2938
|
where: {
|
2671
2939
|
id: item.id !== undefined ? item.id : undefined,
|
2940
|
+
assetId: item.assetId !== undefined ? {
|
2941
|
+
equals: item.assetId
|
2942
|
+
} : undefined,
|
2943
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2944
|
+
equals: item.alpacaAccountId
|
2945
|
+
} : undefined,
|
2672
2946
|
},
|
2673
2947
|
create: {
|
2674
2948
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2696,6 +2970,9 @@ export const Action = {
|
|
2696
2970
|
: { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
|
2697
2971
|
where: {
|
2698
2972
|
id: item.id !== undefined ? item.id : undefined,
|
2973
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2974
|
+
equals: item.alpacaAccountId
|
2975
|
+
} : undefined,
|
2699
2976
|
},
|
2700
2977
|
create: {
|
2701
2978
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2893,6 +3170,12 @@ export const Action = {
|
|
2893
3170
|
upsert: props.order.asset.trades.map((item) => ({
|
2894
3171
|
where: {
|
2895
3172
|
id: item.id !== undefined ? item.id : undefined,
|
3173
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3174
|
+
equals: item.alpacaAccountId
|
3175
|
+
} : undefined,
|
3176
|
+
assetId: item.assetId !== undefined ? {
|
3177
|
+
equals: item.assetId
|
3178
|
+
} : undefined,
|
2896
3179
|
},
|
2897
3180
|
update: {
|
2898
3181
|
id: item.id !== undefined ? {
|
@@ -2951,6 +3234,12 @@ export const Action = {
|
|
2951
3234
|
upsert: props.order.asset.positions.map((item) => ({
|
2952
3235
|
where: {
|
2953
3236
|
id: item.id !== undefined ? item.id : undefined,
|
3237
|
+
assetId: item.assetId !== undefined ? {
|
3238
|
+
equals: item.assetId
|
3239
|
+
} : undefined,
|
3240
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3241
|
+
equals: item.alpacaAccountId
|
3242
|
+
} : undefined,
|
2954
3243
|
},
|
2955
3244
|
update: {
|
2956
3245
|
id: item.id !== undefined ? {
|
@@ -3018,6 +3307,12 @@ export const Action = {
|
|
3018
3307
|
where: {
|
3019
3308
|
id: item.id !== undefined ? item.id : undefined,
|
3020
3309
|
url: item.url !== undefined ? item.url : undefined,
|
3310
|
+
assetId: item.assetId !== undefined ? {
|
3311
|
+
equals: item.assetId
|
3312
|
+
} : undefined,
|
3313
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3314
|
+
equals: item.newsArticleId
|
3315
|
+
} : undefined,
|
3021
3316
|
},
|
3022
3317
|
update: {
|
3023
3318
|
id: item.id !== undefined ? {
|
@@ -3110,6 +3405,12 @@ export const Action = {
|
|
3110
3405
|
: { connectOrCreate: props.order.asset.trades.map((item) => ({
|
3111
3406
|
where: {
|
3112
3407
|
id: item.id !== undefined ? item.id : undefined,
|
3408
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3409
|
+
equals: item.alpacaAccountId
|
3410
|
+
} : undefined,
|
3411
|
+
assetId: item.assetId !== undefined ? {
|
3412
|
+
equals: item.assetId
|
3413
|
+
} : undefined,
|
3113
3414
|
},
|
3114
3415
|
create: {
|
3115
3416
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3135,6 +3436,12 @@ export const Action = {
|
|
3135
3436
|
: { connectOrCreate: props.order.asset.positions.map((item) => ({
|
3136
3437
|
where: {
|
3137
3438
|
id: item.id !== undefined ? item.id : undefined,
|
3439
|
+
assetId: item.assetId !== undefined ? {
|
3440
|
+
equals: item.assetId
|
3441
|
+
} : undefined,
|
3442
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3443
|
+
equals: item.alpacaAccountId
|
3444
|
+
} : undefined,
|
3138
3445
|
},
|
3139
3446
|
create: {
|
3140
3447
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3163,6 +3470,12 @@ export const Action = {
|
|
3163
3470
|
where: {
|
3164
3471
|
id: item.id !== undefined ? item.id : undefined,
|
3165
3472
|
url: item.url !== undefined ? item.url : undefined,
|
3473
|
+
assetId: item.assetId !== undefined ? {
|
3474
|
+
equals: item.assetId
|
3475
|
+
} : undefined,
|
3476
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3477
|
+
equals: item.newsArticleId
|
3478
|
+
} : undefined,
|
3166
3479
|
},
|
3167
3480
|
create: {
|
3168
3481
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3208,6 +3521,7 @@ export const Action = {
|
|
3208
3521
|
: { connectOrCreate: {
|
3209
3522
|
where: {
|
3210
3523
|
id: props.order.stopLoss.id !== undefined ? props.order.stopLoss.id : undefined,
|
3524
|
+
orderId: props.order.stopLoss.orderId !== undefined ? props.order.stopLoss.orderId : undefined,
|
3211
3525
|
},
|
3212
3526
|
create: {
|
3213
3527
|
stopPrice: props.order.stopLoss.stopPrice !== undefined ? props.order.stopLoss.stopPrice : undefined,
|
@@ -3224,6 +3538,7 @@ export const Action = {
|
|
3224
3538
|
: { connectOrCreate: {
|
3225
3539
|
where: {
|
3226
3540
|
id: props.order.takeProfit.id !== undefined ? props.order.takeProfit.id : undefined,
|
3541
|
+
orderId: props.order.takeProfit.orderId !== undefined ? props.order.takeProfit.orderId : undefined,
|
3227
3542
|
},
|
3228
3543
|
create: {
|
3229
3544
|
limitPrice: props.order.takeProfit.limitPrice !== undefined ? props.order.takeProfit.limitPrice : undefined,
|
@@ -3240,6 +3555,9 @@ export const Action = {
|
|
3240
3555
|
: { connectOrCreate: {
|
3241
3556
|
where: {
|
3242
3557
|
id: props.order.alpacaAccount.id !== undefined ? props.order.alpacaAccount.id : undefined,
|
3558
|
+
userId: props.order.alpacaAccount.userId !== undefined ? {
|
3559
|
+
equals: props.order.alpacaAccount.userId
|
3560
|
+
} : undefined,
|
3243
3561
|
},
|
3244
3562
|
create: {
|
3245
3563
|
type: props.order.alpacaAccount.type !== undefined ? props.order.alpacaAccount.type : undefined,
|
@@ -3289,6 +3607,12 @@ export const Action = {
|
|
3289
3607
|
: { connectOrCreate: props.order.alpacaAccount.trades.map((item) => ({
|
3290
3608
|
where: {
|
3291
3609
|
id: item.id !== undefined ? item.id : undefined,
|
3610
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3611
|
+
equals: item.alpacaAccountId
|
3612
|
+
} : undefined,
|
3613
|
+
assetId: item.assetId !== undefined ? {
|
3614
|
+
equals: item.assetId
|
3615
|
+
} : undefined,
|
3292
3616
|
},
|
3293
3617
|
create: {
|
3294
3618
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3314,6 +3638,12 @@ export const Action = {
|
|
3314
3638
|
: { connectOrCreate: props.order.alpacaAccount.positions.map((item) => ({
|
3315
3639
|
where: {
|
3316
3640
|
id: item.id !== undefined ? item.id : undefined,
|
3641
|
+
assetId: item.assetId !== undefined ? {
|
3642
|
+
equals: item.assetId
|
3643
|
+
} : undefined,
|
3644
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3645
|
+
equals: item.alpacaAccountId
|
3646
|
+
} : undefined,
|
3317
3647
|
},
|
3318
3648
|
create: {
|
3319
3649
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3341,6 +3671,9 @@ export const Action = {
|
|
3341
3671
|
: { connectOrCreate: props.order.alpacaAccount.alerts.map((item) => ({
|
3342
3672
|
where: {
|
3343
3673
|
id: item.id !== undefined ? item.id : undefined,
|
3674
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3675
|
+
equals: item.alpacaAccountId
|
3676
|
+
} : undefined,
|
3344
3677
|
},
|
3345
3678
|
create: {
|
3346
3679
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -3429,6 +3762,12 @@ export const Action = {
|
|
3429
3762
|
: { connectOrCreate: props.order.asset.trades.map((item) => ({
|
3430
3763
|
where: {
|
3431
3764
|
id: item.id !== undefined ? item.id : undefined,
|
3765
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3766
|
+
equals: item.alpacaAccountId
|
3767
|
+
} : undefined,
|
3768
|
+
assetId: item.assetId !== undefined ? {
|
3769
|
+
equals: item.assetId
|
3770
|
+
} : undefined,
|
3432
3771
|
},
|
3433
3772
|
create: {
|
3434
3773
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3454,6 +3793,12 @@ export const Action = {
|
|
3454
3793
|
: { connectOrCreate: props.order.asset.positions.map((item) => ({
|
3455
3794
|
where: {
|
3456
3795
|
id: item.id !== undefined ? item.id : undefined,
|
3796
|
+
assetId: item.assetId !== undefined ? {
|
3797
|
+
equals: item.assetId
|
3798
|
+
} : undefined,
|
3799
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3800
|
+
equals: item.alpacaAccountId
|
3801
|
+
} : undefined,
|
3457
3802
|
},
|
3458
3803
|
create: {
|
3459
3804
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3482,6 +3827,12 @@ export const Action = {
|
|
3482
3827
|
where: {
|
3483
3828
|
id: item.id !== undefined ? item.id : undefined,
|
3484
3829
|
url: item.url !== undefined ? item.url : undefined,
|
3830
|
+
assetId: item.assetId !== undefined ? {
|
3831
|
+
equals: item.assetId
|
3832
|
+
} : undefined,
|
3833
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3834
|
+
equals: item.newsArticleId
|
3835
|
+
} : undefined,
|
3485
3836
|
},
|
3486
3837
|
create: {
|
3487
3838
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3533,7 +3884,9 @@ export const Action = {
|
|
3533
3884
|
where: {
|
3534
3885
|
id: prop.id !== undefined ? prop.id : undefined,
|
3535
3886
|
sequence: prop.sequence !== undefined ? prop.sequence : undefined,
|
3536
|
-
tradeId: prop.tradeId !== undefined ?
|
3887
|
+
tradeId: prop.tradeId !== undefined ? {
|
3888
|
+
equals: prop.tradeId
|
3889
|
+
} : undefined,
|
3537
3890
|
type: prop.type !== undefined ? prop.type : undefined,
|
3538
3891
|
note: prop.note !== undefined ? prop.note : undefined,
|
3539
3892
|
status: prop.status !== undefined ? prop.status : undefined,
|
@@ -3563,6 +3916,12 @@ export const Action = {
|
|
3563
3916
|
id: prop.trade.id !== undefined ? {
|
3564
3917
|
equals: prop.trade.id
|
3565
3918
|
} : undefined,
|
3919
|
+
alpacaAccountId: prop.trade.alpacaAccountId !== undefined ? {
|
3920
|
+
equals: prop.trade.alpacaAccountId
|
3921
|
+
} : undefined,
|
3922
|
+
assetId: prop.trade.assetId !== undefined ? {
|
3923
|
+
equals: prop.trade.assetId
|
3924
|
+
} : undefined,
|
3566
3925
|
},
|
3567
3926
|
update: {
|
3568
3927
|
id: prop.trade.id !== undefined ? {
|
@@ -3607,6 +3966,9 @@ export const Action = {
|
|
3607
3966
|
id: prop.trade.alpacaAccount.id !== undefined ? {
|
3608
3967
|
equals: prop.trade.alpacaAccount.id
|
3609
3968
|
} : undefined,
|
3969
|
+
userId: prop.trade.alpacaAccount.userId !== undefined ? {
|
3970
|
+
equals: prop.trade.alpacaAccount.userId
|
3971
|
+
} : undefined,
|
3610
3972
|
},
|
3611
3973
|
update: {
|
3612
3974
|
id: prop.trade.alpacaAccount.id !== undefined ? {
|
@@ -3709,6 +4071,15 @@ export const Action = {
|
|
3709
4071
|
upsert: prop.trade.alpacaAccount.orders.map((item) => ({
|
3710
4072
|
where: {
|
3711
4073
|
id: item.id !== undefined ? item.id : undefined,
|
4074
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4075
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4076
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4077
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4078
|
+
equals: item.alpacaAccountId
|
4079
|
+
} : undefined,
|
4080
|
+
assetId: item.assetId !== undefined ? {
|
4081
|
+
equals: item.assetId
|
4082
|
+
} : undefined,
|
3712
4083
|
},
|
3713
4084
|
update: {
|
3714
4085
|
id: item.id !== undefined ? {
|
@@ -3811,6 +4182,12 @@ export const Action = {
|
|
3811
4182
|
upsert: prop.trade.alpacaAccount.positions.map((item) => ({
|
3812
4183
|
where: {
|
3813
4184
|
id: item.id !== undefined ? item.id : undefined,
|
4185
|
+
assetId: item.assetId !== undefined ? {
|
4186
|
+
equals: item.assetId
|
4187
|
+
} : undefined,
|
4188
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4189
|
+
equals: item.alpacaAccountId
|
4190
|
+
} : undefined,
|
3814
4191
|
},
|
3815
4192
|
update: {
|
3816
4193
|
id: item.id !== undefined ? {
|
@@ -3877,6 +4254,9 @@ export const Action = {
|
|
3877
4254
|
upsert: prop.trade.alpacaAccount.alerts.map((item) => ({
|
3878
4255
|
where: {
|
3879
4256
|
id: item.id !== undefined ? item.id : undefined,
|
4257
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4258
|
+
equals: item.alpacaAccountId
|
4259
|
+
} : undefined,
|
3880
4260
|
},
|
3881
4261
|
update: {
|
3882
4262
|
id: item.id !== undefined ? {
|
@@ -3948,6 +4328,15 @@ export const Action = {
|
|
3948
4328
|
: { connectOrCreate: prop.trade.alpacaAccount.orders.map((item) => ({
|
3949
4329
|
where: {
|
3950
4330
|
id: item.id !== undefined ? item.id : undefined,
|
4331
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4332
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4333
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4334
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4335
|
+
equals: item.alpacaAccountId
|
4336
|
+
} : undefined,
|
4337
|
+
assetId: item.assetId !== undefined ? {
|
4338
|
+
equals: item.assetId
|
4339
|
+
} : undefined,
|
3951
4340
|
},
|
3952
4341
|
create: {
|
3953
4342
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -3984,6 +4373,12 @@ export const Action = {
|
|
3984
4373
|
: { connectOrCreate: prop.trade.alpacaAccount.positions.map((item) => ({
|
3985
4374
|
where: {
|
3986
4375
|
id: item.id !== undefined ? item.id : undefined,
|
4376
|
+
assetId: item.assetId !== undefined ? {
|
4377
|
+
equals: item.assetId
|
4378
|
+
} : undefined,
|
4379
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4380
|
+
equals: item.alpacaAccountId
|
4381
|
+
} : undefined,
|
3987
4382
|
},
|
3988
4383
|
create: {
|
3989
4384
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4011,6 +4406,9 @@ export const Action = {
|
|
4011
4406
|
: { connectOrCreate: prop.trade.alpacaAccount.alerts.map((item) => ({
|
4012
4407
|
where: {
|
4013
4408
|
id: item.id !== undefined ? item.id : undefined,
|
4409
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4410
|
+
equals: item.alpacaAccountId
|
4411
|
+
} : undefined,
|
4014
4412
|
},
|
4015
4413
|
create: {
|
4016
4414
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -4208,6 +4606,15 @@ export const Action = {
|
|
4208
4606
|
upsert: prop.trade.asset.orders.map((item) => ({
|
4209
4607
|
where: {
|
4210
4608
|
id: item.id !== undefined ? item.id : undefined,
|
4609
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4610
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4611
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4612
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4613
|
+
equals: item.alpacaAccountId
|
4614
|
+
} : undefined,
|
4615
|
+
assetId: item.assetId !== undefined ? {
|
4616
|
+
equals: item.assetId
|
4617
|
+
} : undefined,
|
4211
4618
|
},
|
4212
4619
|
update: {
|
4213
4620
|
id: item.id !== undefined ? {
|
@@ -4310,6 +4717,12 @@ export const Action = {
|
|
4310
4717
|
upsert: prop.trade.asset.positions.map((item) => ({
|
4311
4718
|
where: {
|
4312
4719
|
id: item.id !== undefined ? item.id : undefined,
|
4720
|
+
assetId: item.assetId !== undefined ? {
|
4721
|
+
equals: item.assetId
|
4722
|
+
} : undefined,
|
4723
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4724
|
+
equals: item.alpacaAccountId
|
4725
|
+
} : undefined,
|
4313
4726
|
},
|
4314
4727
|
update: {
|
4315
4728
|
id: item.id !== undefined ? {
|
@@ -4377,6 +4790,12 @@ export const Action = {
|
|
4377
4790
|
where: {
|
4378
4791
|
id: item.id !== undefined ? item.id : undefined,
|
4379
4792
|
url: item.url !== undefined ? item.url : undefined,
|
4793
|
+
assetId: item.assetId !== undefined ? {
|
4794
|
+
equals: item.assetId
|
4795
|
+
} : undefined,
|
4796
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4797
|
+
equals: item.newsArticleId
|
4798
|
+
} : undefined,
|
4380
4799
|
},
|
4381
4800
|
update: {
|
4382
4801
|
id: item.id !== undefined ? {
|
@@ -4469,6 +4888,15 @@ export const Action = {
|
|
4469
4888
|
: { connectOrCreate: prop.trade.asset.orders.map((item) => ({
|
4470
4889
|
where: {
|
4471
4890
|
id: item.id !== undefined ? item.id : undefined,
|
4891
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4892
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4893
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4894
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4895
|
+
equals: item.alpacaAccountId
|
4896
|
+
} : undefined,
|
4897
|
+
assetId: item.assetId !== undefined ? {
|
4898
|
+
equals: item.assetId
|
4899
|
+
} : undefined,
|
4472
4900
|
},
|
4473
4901
|
create: {
|
4474
4902
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4505,6 +4933,12 @@ export const Action = {
|
|
4505
4933
|
: { connectOrCreate: prop.trade.asset.positions.map((item) => ({
|
4506
4934
|
where: {
|
4507
4935
|
id: item.id !== undefined ? item.id : undefined,
|
4936
|
+
assetId: item.assetId !== undefined ? {
|
4937
|
+
equals: item.assetId
|
4938
|
+
} : undefined,
|
4939
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4940
|
+
equals: item.alpacaAccountId
|
4941
|
+
} : undefined,
|
4508
4942
|
},
|
4509
4943
|
create: {
|
4510
4944
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4533,6 +4967,12 @@ export const Action = {
|
|
4533
4967
|
where: {
|
4534
4968
|
id: item.id !== undefined ? item.id : undefined,
|
4535
4969
|
url: item.url !== undefined ? item.url : undefined,
|
4970
|
+
assetId: item.assetId !== undefined ? {
|
4971
|
+
equals: item.assetId
|
4972
|
+
} : undefined,
|
4973
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4974
|
+
equals: item.newsArticleId
|
4975
|
+
} : undefined,
|
4536
4976
|
},
|
4537
4977
|
create: {
|
4538
4978
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4567,6 +5007,9 @@ export const Action = {
|
|
4567
5007
|
: { connectOrCreate: {
|
4568
5008
|
where: {
|
4569
5009
|
id: prop.trade.alpacaAccount.id !== undefined ? prop.trade.alpacaAccount.id : undefined,
|
5010
|
+
userId: prop.trade.alpacaAccount.userId !== undefined ? {
|
5011
|
+
equals: prop.trade.alpacaAccount.userId
|
5012
|
+
} : undefined,
|
4570
5013
|
},
|
4571
5014
|
create: {
|
4572
5015
|
type: prop.trade.alpacaAccount.type !== undefined ? prop.trade.alpacaAccount.type : undefined,
|
@@ -4616,6 +5059,15 @@ export const Action = {
|
|
4616
5059
|
: { connectOrCreate: prop.trade.alpacaAccount.orders.map((item) => ({
|
4617
5060
|
where: {
|
4618
5061
|
id: item.id !== undefined ? item.id : undefined,
|
5062
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5063
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5064
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5065
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5066
|
+
equals: item.alpacaAccountId
|
5067
|
+
} : undefined,
|
5068
|
+
assetId: item.assetId !== undefined ? {
|
5069
|
+
equals: item.assetId
|
5070
|
+
} : undefined,
|
4619
5071
|
},
|
4620
5072
|
create: {
|
4621
5073
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4652,6 +5104,12 @@ export const Action = {
|
|
4652
5104
|
: { connectOrCreate: prop.trade.alpacaAccount.positions.map((item) => ({
|
4653
5105
|
where: {
|
4654
5106
|
id: item.id !== undefined ? item.id : undefined,
|
5107
|
+
assetId: item.assetId !== undefined ? {
|
5108
|
+
equals: item.assetId
|
5109
|
+
} : undefined,
|
5110
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5111
|
+
equals: item.alpacaAccountId
|
5112
|
+
} : undefined,
|
4655
5113
|
},
|
4656
5114
|
create: {
|
4657
5115
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4679,6 +5137,9 @@ export const Action = {
|
|
4679
5137
|
: { connectOrCreate: prop.trade.alpacaAccount.alerts.map((item) => ({
|
4680
5138
|
where: {
|
4681
5139
|
id: item.id !== undefined ? item.id : undefined,
|
5140
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5141
|
+
equals: item.alpacaAccountId
|
5142
|
+
} : undefined,
|
4682
5143
|
},
|
4683
5144
|
create: {
|
4684
5145
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -4767,6 +5228,15 @@ export const Action = {
|
|
4767
5228
|
: { connectOrCreate: prop.trade.asset.orders.map((item) => ({
|
4768
5229
|
where: {
|
4769
5230
|
id: item.id !== undefined ? item.id : undefined,
|
5231
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5232
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5233
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5234
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5235
|
+
equals: item.alpacaAccountId
|
5236
|
+
} : undefined,
|
5237
|
+
assetId: item.assetId !== undefined ? {
|
5238
|
+
equals: item.assetId
|
5239
|
+
} : undefined,
|
4770
5240
|
},
|
4771
5241
|
create: {
|
4772
5242
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4803,6 +5273,12 @@ export const Action = {
|
|
4803
5273
|
: { connectOrCreate: prop.trade.asset.positions.map((item) => ({
|
4804
5274
|
where: {
|
4805
5275
|
id: item.id !== undefined ? item.id : undefined,
|
5276
|
+
assetId: item.assetId !== undefined ? {
|
5277
|
+
equals: item.assetId
|
5278
|
+
} : undefined,
|
5279
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5280
|
+
equals: item.alpacaAccountId
|
5281
|
+
} : undefined,
|
4806
5282
|
},
|
4807
5283
|
create: {
|
4808
5284
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4831,6 +5307,12 @@ export const Action = {
|
|
4831
5307
|
where: {
|
4832
5308
|
id: item.id !== undefined ? item.id : undefined,
|
4833
5309
|
url: item.url !== undefined ? item.url : undefined,
|
5310
|
+
assetId: item.assetId !== undefined ? {
|
5311
|
+
equals: item.assetId
|
5312
|
+
} : undefined,
|
5313
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5314
|
+
equals: item.newsArticleId
|
5315
|
+
} : undefined,
|
4834
5316
|
},
|
4835
5317
|
create: {
|
4836
5318
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4852,6 +5334,18 @@ export const Action = {
|
|
4852
5334
|
id: prop.order.id !== undefined ? {
|
4853
5335
|
equals: prop.order.id
|
4854
5336
|
} : undefined,
|
5337
|
+
clientOrderId: prop.order.clientOrderId !== undefined ? {
|
5338
|
+
equals: prop.order.clientOrderId
|
5339
|
+
} : undefined,
|
5340
|
+
alpacaAccountId: prop.order.alpacaAccountId !== undefined ? {
|
5341
|
+
equals: prop.order.alpacaAccountId
|
5342
|
+
} : undefined,
|
5343
|
+
assetId: prop.order.assetId !== undefined ? {
|
5344
|
+
equals: prop.order.assetId
|
5345
|
+
} : undefined,
|
5346
|
+
actionId: prop.order.actionId !== undefined ? {
|
5347
|
+
equals: prop.order.actionId
|
5348
|
+
} : undefined,
|
4855
5349
|
},
|
4856
5350
|
update: {
|
4857
5351
|
id: prop.order.id !== undefined ? {
|
@@ -4929,6 +5423,9 @@ export const Action = {
|
|
4929
5423
|
id: prop.order.stopLoss.id !== undefined ? {
|
4930
5424
|
equals: prop.order.stopLoss.id
|
4931
5425
|
} : undefined,
|
5426
|
+
orderId: prop.order.stopLoss.orderId !== undefined ? {
|
5427
|
+
equals: prop.order.stopLoss.orderId
|
5428
|
+
} : undefined,
|
4932
5429
|
},
|
4933
5430
|
update: {
|
4934
5431
|
id: prop.order.stopLoss.id !== undefined ? {
|
@@ -4953,6 +5450,9 @@ export const Action = {
|
|
4953
5450
|
id: prop.order.takeProfit.id !== undefined ? {
|
4954
5451
|
equals: prop.order.takeProfit.id
|
4955
5452
|
} : undefined,
|
5453
|
+
orderId: prop.order.takeProfit.orderId !== undefined ? {
|
5454
|
+
equals: prop.order.takeProfit.orderId
|
5455
|
+
} : undefined,
|
4956
5456
|
},
|
4957
5457
|
update: {
|
4958
5458
|
id: prop.order.takeProfit.id !== undefined ? {
|
@@ -4977,6 +5477,9 @@ export const Action = {
|
|
4977
5477
|
id: prop.order.alpacaAccount.id !== undefined ? {
|
4978
5478
|
equals: prop.order.alpacaAccount.id
|
4979
5479
|
} : undefined,
|
5480
|
+
userId: prop.order.alpacaAccount.userId !== undefined ? {
|
5481
|
+
equals: prop.order.alpacaAccount.userId
|
5482
|
+
} : undefined,
|
4980
5483
|
},
|
4981
5484
|
update: {
|
4982
5485
|
id: prop.order.alpacaAccount.id !== undefined ? {
|
@@ -5079,6 +5582,12 @@ export const Action = {
|
|
5079
5582
|
upsert: prop.order.alpacaAccount.trades.map((item) => ({
|
5080
5583
|
where: {
|
5081
5584
|
id: item.id !== undefined ? item.id : undefined,
|
5585
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5586
|
+
equals: item.alpacaAccountId
|
5587
|
+
} : undefined,
|
5588
|
+
assetId: item.assetId !== undefined ? {
|
5589
|
+
equals: item.assetId
|
5590
|
+
} : undefined,
|
5082
5591
|
},
|
5083
5592
|
update: {
|
5084
5593
|
id: item.id !== undefined ? {
|
@@ -5137,6 +5646,12 @@ export const Action = {
|
|
5137
5646
|
upsert: prop.order.alpacaAccount.positions.map((item) => ({
|
5138
5647
|
where: {
|
5139
5648
|
id: item.id !== undefined ? item.id : undefined,
|
5649
|
+
assetId: item.assetId !== undefined ? {
|
5650
|
+
equals: item.assetId
|
5651
|
+
} : undefined,
|
5652
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5653
|
+
equals: item.alpacaAccountId
|
5654
|
+
} : undefined,
|
5140
5655
|
},
|
5141
5656
|
update: {
|
5142
5657
|
id: item.id !== undefined ? {
|
@@ -5203,6 +5718,9 @@ export const Action = {
|
|
5203
5718
|
upsert: prop.order.alpacaAccount.alerts.map((item) => ({
|
5204
5719
|
where: {
|
5205
5720
|
id: item.id !== undefined ? item.id : undefined,
|
5721
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5722
|
+
equals: item.alpacaAccountId
|
5723
|
+
} : undefined,
|
5206
5724
|
},
|
5207
5725
|
update: {
|
5208
5726
|
id: item.id !== undefined ? {
|
@@ -5274,6 +5792,12 @@ export const Action = {
|
|
5274
5792
|
: { connectOrCreate: prop.order.alpacaAccount.trades.map((item) => ({
|
5275
5793
|
where: {
|
5276
5794
|
id: item.id !== undefined ? item.id : undefined,
|
5795
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5796
|
+
equals: item.alpacaAccountId
|
5797
|
+
} : undefined,
|
5798
|
+
assetId: item.assetId !== undefined ? {
|
5799
|
+
equals: item.assetId
|
5800
|
+
} : undefined,
|
5277
5801
|
},
|
5278
5802
|
create: {
|
5279
5803
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5299,6 +5823,12 @@ export const Action = {
|
|
5299
5823
|
: { connectOrCreate: prop.order.alpacaAccount.positions.map((item) => ({
|
5300
5824
|
where: {
|
5301
5825
|
id: item.id !== undefined ? item.id : undefined,
|
5826
|
+
assetId: item.assetId !== undefined ? {
|
5827
|
+
equals: item.assetId
|
5828
|
+
} : undefined,
|
5829
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5830
|
+
equals: item.alpacaAccountId
|
5831
|
+
} : undefined,
|
5302
5832
|
},
|
5303
5833
|
create: {
|
5304
5834
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5326,6 +5856,9 @@ export const Action = {
|
|
5326
5856
|
: { connectOrCreate: prop.order.alpacaAccount.alerts.map((item) => ({
|
5327
5857
|
where: {
|
5328
5858
|
id: item.id !== undefined ? item.id : undefined,
|
5859
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5860
|
+
equals: item.alpacaAccountId
|
5861
|
+
} : undefined,
|
5329
5862
|
},
|
5330
5863
|
create: {
|
5331
5864
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -5523,6 +6056,12 @@ export const Action = {
|
|
5523
6056
|
upsert: prop.order.asset.trades.map((item) => ({
|
5524
6057
|
where: {
|
5525
6058
|
id: item.id !== undefined ? item.id : undefined,
|
6059
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6060
|
+
equals: item.alpacaAccountId
|
6061
|
+
} : undefined,
|
6062
|
+
assetId: item.assetId !== undefined ? {
|
6063
|
+
equals: item.assetId
|
6064
|
+
} : undefined,
|
5526
6065
|
},
|
5527
6066
|
update: {
|
5528
6067
|
id: item.id !== undefined ? {
|
@@ -5581,6 +6120,12 @@ export const Action = {
|
|
5581
6120
|
upsert: prop.order.asset.positions.map((item) => ({
|
5582
6121
|
where: {
|
5583
6122
|
id: item.id !== undefined ? item.id : undefined,
|
6123
|
+
assetId: item.assetId !== undefined ? {
|
6124
|
+
equals: item.assetId
|
6125
|
+
} : undefined,
|
6126
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6127
|
+
equals: item.alpacaAccountId
|
6128
|
+
} : undefined,
|
5584
6129
|
},
|
5585
6130
|
update: {
|
5586
6131
|
id: item.id !== undefined ? {
|
@@ -5648,6 +6193,12 @@ export const Action = {
|
|
5648
6193
|
where: {
|
5649
6194
|
id: item.id !== undefined ? item.id : undefined,
|
5650
6195
|
url: item.url !== undefined ? item.url : undefined,
|
6196
|
+
assetId: item.assetId !== undefined ? {
|
6197
|
+
equals: item.assetId
|
6198
|
+
} : undefined,
|
6199
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6200
|
+
equals: item.newsArticleId
|
6201
|
+
} : undefined,
|
5651
6202
|
},
|
5652
6203
|
update: {
|
5653
6204
|
id: item.id !== undefined ? {
|
@@ -5740,6 +6291,12 @@ export const Action = {
|
|
5740
6291
|
: { connectOrCreate: prop.order.asset.trades.map((item) => ({
|
5741
6292
|
where: {
|
5742
6293
|
id: item.id !== undefined ? item.id : undefined,
|
6294
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6295
|
+
equals: item.alpacaAccountId
|
6296
|
+
} : undefined,
|
6297
|
+
assetId: item.assetId !== undefined ? {
|
6298
|
+
equals: item.assetId
|
6299
|
+
} : undefined,
|
5743
6300
|
},
|
5744
6301
|
create: {
|
5745
6302
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5765,6 +6322,12 @@ export const Action = {
|
|
5765
6322
|
: { connectOrCreate: prop.order.asset.positions.map((item) => ({
|
5766
6323
|
where: {
|
5767
6324
|
id: item.id !== undefined ? item.id : undefined,
|
6325
|
+
assetId: item.assetId !== undefined ? {
|
6326
|
+
equals: item.assetId
|
6327
|
+
} : undefined,
|
6328
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6329
|
+
equals: item.alpacaAccountId
|
6330
|
+
} : undefined,
|
5768
6331
|
},
|
5769
6332
|
create: {
|
5770
6333
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5793,6 +6356,12 @@ export const Action = {
|
|
5793
6356
|
where: {
|
5794
6357
|
id: item.id !== undefined ? item.id : undefined,
|
5795
6358
|
url: item.url !== undefined ? item.url : undefined,
|
6359
|
+
assetId: item.assetId !== undefined ? {
|
6360
|
+
equals: item.assetId
|
6361
|
+
} : undefined,
|
6362
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6363
|
+
equals: item.newsArticleId
|
6364
|
+
} : undefined,
|
5796
6365
|
},
|
5797
6366
|
create: {
|
5798
6367
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -5838,6 +6407,7 @@ export const Action = {
|
|
5838
6407
|
: { connectOrCreate: {
|
5839
6408
|
where: {
|
5840
6409
|
id: prop.order.stopLoss.id !== undefined ? prop.order.stopLoss.id : undefined,
|
6410
|
+
orderId: prop.order.stopLoss.orderId !== undefined ? prop.order.stopLoss.orderId : undefined,
|
5841
6411
|
},
|
5842
6412
|
create: {
|
5843
6413
|
stopPrice: prop.order.stopLoss.stopPrice !== undefined ? prop.order.stopLoss.stopPrice : undefined,
|
@@ -5854,6 +6424,7 @@ export const Action = {
|
|
5854
6424
|
: { connectOrCreate: {
|
5855
6425
|
where: {
|
5856
6426
|
id: prop.order.takeProfit.id !== undefined ? prop.order.takeProfit.id : undefined,
|
6427
|
+
orderId: prop.order.takeProfit.orderId !== undefined ? prop.order.takeProfit.orderId : undefined,
|
5857
6428
|
},
|
5858
6429
|
create: {
|
5859
6430
|
limitPrice: prop.order.takeProfit.limitPrice !== undefined ? prop.order.takeProfit.limitPrice : undefined,
|
@@ -5870,6 +6441,9 @@ export const Action = {
|
|
5870
6441
|
: { connectOrCreate: {
|
5871
6442
|
where: {
|
5872
6443
|
id: prop.order.alpacaAccount.id !== undefined ? prop.order.alpacaAccount.id : undefined,
|
6444
|
+
userId: prop.order.alpacaAccount.userId !== undefined ? {
|
6445
|
+
equals: prop.order.alpacaAccount.userId
|
6446
|
+
} : undefined,
|
5873
6447
|
},
|
5874
6448
|
create: {
|
5875
6449
|
type: prop.order.alpacaAccount.type !== undefined ? prop.order.alpacaAccount.type : undefined,
|
@@ -5919,6 +6493,12 @@ export const Action = {
|
|
5919
6493
|
: { connectOrCreate: prop.order.alpacaAccount.trades.map((item) => ({
|
5920
6494
|
where: {
|
5921
6495
|
id: item.id !== undefined ? item.id : undefined,
|
6496
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6497
|
+
equals: item.alpacaAccountId
|
6498
|
+
} : undefined,
|
6499
|
+
assetId: item.assetId !== undefined ? {
|
6500
|
+
equals: item.assetId
|
6501
|
+
} : undefined,
|
5922
6502
|
},
|
5923
6503
|
create: {
|
5924
6504
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -5944,6 +6524,12 @@ export const Action = {
|
|
5944
6524
|
: { connectOrCreate: prop.order.alpacaAccount.positions.map((item) => ({
|
5945
6525
|
where: {
|
5946
6526
|
id: item.id !== undefined ? item.id : undefined,
|
6527
|
+
assetId: item.assetId !== undefined ? {
|
6528
|
+
equals: item.assetId
|
6529
|
+
} : undefined,
|
6530
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6531
|
+
equals: item.alpacaAccountId
|
6532
|
+
} : undefined,
|
5947
6533
|
},
|
5948
6534
|
create: {
|
5949
6535
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5971,6 +6557,9 @@ export const Action = {
|
|
5971
6557
|
: { connectOrCreate: prop.order.alpacaAccount.alerts.map((item) => ({
|
5972
6558
|
where: {
|
5973
6559
|
id: item.id !== undefined ? item.id : undefined,
|
6560
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6561
|
+
equals: item.alpacaAccountId
|
6562
|
+
} : undefined,
|
5974
6563
|
},
|
5975
6564
|
create: {
|
5976
6565
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -6059,6 +6648,12 @@ export const Action = {
|
|
6059
6648
|
: { connectOrCreate: prop.order.asset.trades.map((item) => ({
|
6060
6649
|
where: {
|
6061
6650
|
id: item.id !== undefined ? item.id : undefined,
|
6651
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6652
|
+
equals: item.alpacaAccountId
|
6653
|
+
} : undefined,
|
6654
|
+
assetId: item.assetId !== undefined ? {
|
6655
|
+
equals: item.assetId
|
6656
|
+
} : undefined,
|
6062
6657
|
},
|
6063
6658
|
create: {
|
6064
6659
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -6084,6 +6679,12 @@ export const Action = {
|
|
6084
6679
|
: { connectOrCreate: prop.order.asset.positions.map((item) => ({
|
6085
6680
|
where: {
|
6086
6681
|
id: item.id !== undefined ? item.id : undefined,
|
6682
|
+
assetId: item.assetId !== undefined ? {
|
6683
|
+
equals: item.assetId
|
6684
|
+
} : undefined,
|
6685
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6686
|
+
equals: item.alpacaAccountId
|
6687
|
+
} : undefined,
|
6087
6688
|
},
|
6088
6689
|
create: {
|
6089
6690
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -6112,6 +6713,12 @@ export const Action = {
|
|
6112
6713
|
where: {
|
6113
6714
|
id: item.id !== undefined ? item.id : undefined,
|
6114
6715
|
url: item.url !== undefined ? item.url : undefined,
|
6716
|
+
assetId: item.assetId !== undefined ? {
|
6717
|
+
equals: item.assetId
|
6718
|
+
} : undefined,
|
6719
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6720
|
+
equals: item.newsArticleId
|
6721
|
+
} : undefined,
|
6115
6722
|
},
|
6116
6723
|
create: {
|
6117
6724
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -6198,7 +6805,9 @@ export const Action = {
|
|
6198
6805
|
where: {
|
6199
6806
|
id: props.id !== undefined ? props.id : undefined,
|
6200
6807
|
sequence: props.sequence !== undefined ? props.sequence : undefined,
|
6201
|
-
tradeId: props.tradeId !== undefined ?
|
6808
|
+
tradeId: props.tradeId !== undefined ? {
|
6809
|
+
equals: props.tradeId
|
6810
|
+
} : undefined,
|
6202
6811
|
type: props.type !== undefined ? props.type : undefined,
|
6203
6812
|
note: props.note !== undefined ? props.note : undefined,
|
6204
6813
|
status: props.status !== undefined ? props.status : undefined,
|
@@ -6268,7 +6877,9 @@ export const Action = {
|
|
6268
6877
|
equals: props.id
|
6269
6878
|
} : undefined,
|
6270
6879
|
sequence: props.sequence !== undefined ? props.sequence : undefined,
|
6271
|
-
tradeId: props.tradeId !== undefined ?
|
6880
|
+
tradeId: props.tradeId !== undefined ? {
|
6881
|
+
equals: props.tradeId
|
6882
|
+
} : undefined,
|
6272
6883
|
type: props.type !== undefined ? props.type : undefined,
|
6273
6884
|
note: props.note !== undefined ? props.note : undefined,
|
6274
6885
|
status: props.status !== undefined ? props.status : undefined,
|