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/TakeProfit.mjs
CHANGED
@@ -43,6 +43,15 @@ export const TakeProfit = {
|
|
43
43
|
: { connectOrCreate: {
|
44
44
|
where: {
|
45
45
|
id: props.Order.id !== undefined ? props.Order.id : undefined,
|
46
|
+
clientOrderId: props.Order.clientOrderId !== undefined ? props.Order.clientOrderId : undefined,
|
47
|
+
actionId: props.Order.actionId !== undefined ? props.Order.actionId : undefined,
|
48
|
+
stopLossId: props.Order.stopLossId !== undefined ? props.Order.stopLossId : undefined,
|
49
|
+
alpacaAccountId: props.Order.alpacaAccountId !== undefined ? {
|
50
|
+
equals: props.Order.alpacaAccountId
|
51
|
+
} : undefined,
|
52
|
+
assetId: props.Order.assetId !== undefined ? {
|
53
|
+
equals: props.Order.assetId
|
54
|
+
} : undefined,
|
46
55
|
},
|
47
56
|
create: {
|
48
57
|
clientOrderId: props.Order.clientOrderId !== undefined ? props.Order.clientOrderId : undefined,
|
@@ -76,6 +85,7 @@ export const TakeProfit = {
|
|
76
85
|
: { connectOrCreate: {
|
77
86
|
where: {
|
78
87
|
id: props.Order.stopLoss.id !== undefined ? props.Order.stopLoss.id : undefined,
|
88
|
+
orderId: props.Order.stopLoss.orderId !== undefined ? props.Order.stopLoss.orderId : undefined,
|
79
89
|
},
|
80
90
|
create: {
|
81
91
|
stopPrice: props.Order.stopLoss.stopPrice !== undefined ? props.Order.stopLoss.stopPrice : undefined,
|
@@ -92,6 +102,9 @@ export const TakeProfit = {
|
|
92
102
|
: { connectOrCreate: {
|
93
103
|
where: {
|
94
104
|
id: props.Order.alpacaAccount.id !== undefined ? props.Order.alpacaAccount.id : undefined,
|
105
|
+
userId: props.Order.alpacaAccount.userId !== undefined ? {
|
106
|
+
equals: props.Order.alpacaAccount.userId
|
107
|
+
} : undefined,
|
95
108
|
},
|
96
109
|
create: {
|
97
110
|
type: props.Order.alpacaAccount.type !== undefined ? props.Order.alpacaAccount.type : undefined,
|
@@ -141,6 +154,12 @@ export const TakeProfit = {
|
|
141
154
|
: { connectOrCreate: props.Order.alpacaAccount.trades.map((item) => ({
|
142
155
|
where: {
|
143
156
|
id: item.id !== undefined ? item.id : undefined,
|
157
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
158
|
+
equals: item.alpacaAccountId
|
159
|
+
} : undefined,
|
160
|
+
assetId: item.assetId !== undefined ? {
|
161
|
+
equals: item.assetId
|
162
|
+
} : undefined,
|
144
163
|
},
|
145
164
|
create: {
|
146
165
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -166,6 +185,12 @@ export const TakeProfit = {
|
|
166
185
|
: { connectOrCreate: props.Order.alpacaAccount.positions.map((item) => ({
|
167
186
|
where: {
|
168
187
|
id: item.id !== undefined ? item.id : undefined,
|
188
|
+
assetId: item.assetId !== undefined ? {
|
189
|
+
equals: item.assetId
|
190
|
+
} : undefined,
|
191
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
192
|
+
equals: item.alpacaAccountId
|
193
|
+
} : undefined,
|
169
194
|
},
|
170
195
|
create: {
|
171
196
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -193,6 +218,9 @@ export const TakeProfit = {
|
|
193
218
|
: { connectOrCreate: props.Order.alpacaAccount.alerts.map((item) => ({
|
194
219
|
where: {
|
195
220
|
id: item.id !== undefined ? item.id : undefined,
|
221
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
222
|
+
equals: item.alpacaAccountId
|
223
|
+
} : undefined,
|
196
224
|
},
|
197
225
|
create: {
|
198
226
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -213,6 +241,9 @@ export const TakeProfit = {
|
|
213
241
|
: { connectOrCreate: {
|
214
242
|
where: {
|
215
243
|
id: props.Order.action.id !== undefined ? props.Order.action.id : undefined,
|
244
|
+
tradeId: props.Order.action.tradeId !== undefined ? {
|
245
|
+
equals: props.Order.action.tradeId
|
246
|
+
} : undefined,
|
216
247
|
},
|
217
248
|
create: {
|
218
249
|
sequence: props.Order.action.sequence !== undefined ? props.Order.action.sequence : undefined,
|
@@ -229,6 +260,12 @@ export const TakeProfit = {
|
|
229
260
|
: { connectOrCreate: {
|
230
261
|
where: {
|
231
262
|
id: props.Order.action.trade.id !== undefined ? props.Order.action.trade.id : undefined,
|
263
|
+
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
264
|
+
equals: props.Order.action.trade.alpacaAccountId
|
265
|
+
} : undefined,
|
266
|
+
assetId: props.Order.action.trade.assetId !== undefined ? {
|
267
|
+
equals: props.Order.action.trade.assetId
|
268
|
+
} : undefined,
|
232
269
|
},
|
233
270
|
create: {
|
234
271
|
qty: props.Order.action.trade.qty !== undefined ? props.Order.action.trade.qty : undefined,
|
@@ -325,6 +362,12 @@ export const TakeProfit = {
|
|
325
362
|
: { connectOrCreate: props.Order.asset.trades.map((item) => ({
|
326
363
|
where: {
|
327
364
|
id: item.id !== undefined ? item.id : undefined,
|
365
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
366
|
+
equals: item.alpacaAccountId
|
367
|
+
} : undefined,
|
368
|
+
assetId: item.assetId !== undefined ? {
|
369
|
+
equals: item.assetId
|
370
|
+
} : undefined,
|
328
371
|
},
|
329
372
|
create: {
|
330
373
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -350,6 +393,12 @@ export const TakeProfit = {
|
|
350
393
|
: { connectOrCreate: props.Order.asset.positions.map((item) => ({
|
351
394
|
where: {
|
352
395
|
id: item.id !== undefined ? item.id : undefined,
|
396
|
+
assetId: item.assetId !== undefined ? {
|
397
|
+
equals: item.assetId
|
398
|
+
} : undefined,
|
399
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
400
|
+
equals: item.alpacaAccountId
|
401
|
+
} : undefined,
|
353
402
|
},
|
354
403
|
create: {
|
355
404
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -378,6 +427,12 @@ export const TakeProfit = {
|
|
378
427
|
where: {
|
379
428
|
id: item.id !== undefined ? item.id : undefined,
|
380
429
|
url: item.url !== undefined ? item.url : undefined,
|
430
|
+
assetId: item.assetId !== undefined ? {
|
431
|
+
equals: item.assetId
|
432
|
+
} : undefined,
|
433
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
434
|
+
equals: item.newsArticleId
|
435
|
+
} : undefined,
|
381
436
|
},
|
382
437
|
create: {
|
383
438
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -491,6 +546,18 @@ export const TakeProfit = {
|
|
491
546
|
id: props.Order.id !== undefined ? {
|
492
547
|
equals: props.Order.id
|
493
548
|
} : undefined,
|
549
|
+
clientOrderId: props.Order.clientOrderId !== undefined ? {
|
550
|
+
equals: props.Order.clientOrderId
|
551
|
+
} : undefined,
|
552
|
+
alpacaAccountId: props.Order.alpacaAccountId !== undefined ? {
|
553
|
+
equals: props.Order.alpacaAccountId
|
554
|
+
} : undefined,
|
555
|
+
assetId: props.Order.assetId !== undefined ? {
|
556
|
+
equals: props.Order.assetId
|
557
|
+
} : undefined,
|
558
|
+
actionId: props.Order.actionId !== undefined ? {
|
559
|
+
equals: props.Order.actionId
|
560
|
+
} : undefined,
|
494
561
|
},
|
495
562
|
update: {
|
496
563
|
id: props.Order.id !== undefined ? {
|
@@ -568,6 +635,9 @@ export const TakeProfit = {
|
|
568
635
|
id: props.Order.stopLoss.id !== undefined ? {
|
569
636
|
equals: props.Order.stopLoss.id
|
570
637
|
} : undefined,
|
638
|
+
orderId: props.Order.stopLoss.orderId !== undefined ? {
|
639
|
+
equals: props.Order.stopLoss.orderId
|
640
|
+
} : undefined,
|
571
641
|
},
|
572
642
|
update: {
|
573
643
|
id: props.Order.stopLoss.id !== undefined ? {
|
@@ -592,6 +662,9 @@ export const TakeProfit = {
|
|
592
662
|
id: props.Order.alpacaAccount.id !== undefined ? {
|
593
663
|
equals: props.Order.alpacaAccount.id
|
594
664
|
} : undefined,
|
665
|
+
userId: props.Order.alpacaAccount.userId !== undefined ? {
|
666
|
+
equals: props.Order.alpacaAccount.userId
|
667
|
+
} : undefined,
|
595
668
|
},
|
596
669
|
update: {
|
597
670
|
id: props.Order.alpacaAccount.id !== undefined ? {
|
@@ -694,6 +767,12 @@ export const TakeProfit = {
|
|
694
767
|
upsert: props.Order.alpacaAccount.trades.map((item) => ({
|
695
768
|
where: {
|
696
769
|
id: item.id !== undefined ? item.id : undefined,
|
770
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
771
|
+
equals: item.alpacaAccountId
|
772
|
+
} : undefined,
|
773
|
+
assetId: item.assetId !== undefined ? {
|
774
|
+
equals: item.assetId
|
775
|
+
} : undefined,
|
697
776
|
},
|
698
777
|
update: {
|
699
778
|
id: item.id !== undefined ? {
|
@@ -752,6 +831,12 @@ export const TakeProfit = {
|
|
752
831
|
upsert: props.Order.alpacaAccount.positions.map((item) => ({
|
753
832
|
where: {
|
754
833
|
id: item.id !== undefined ? item.id : undefined,
|
834
|
+
assetId: item.assetId !== undefined ? {
|
835
|
+
equals: item.assetId
|
836
|
+
} : undefined,
|
837
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
838
|
+
equals: item.alpacaAccountId
|
839
|
+
} : undefined,
|
755
840
|
},
|
756
841
|
update: {
|
757
842
|
id: item.id !== undefined ? {
|
@@ -818,6 +903,9 @@ export const TakeProfit = {
|
|
818
903
|
upsert: props.Order.alpacaAccount.alerts.map((item) => ({
|
819
904
|
where: {
|
820
905
|
id: item.id !== undefined ? item.id : undefined,
|
906
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
907
|
+
equals: item.alpacaAccountId
|
908
|
+
} : undefined,
|
821
909
|
},
|
822
910
|
update: {
|
823
911
|
id: item.id !== undefined ? {
|
@@ -889,6 +977,12 @@ export const TakeProfit = {
|
|
889
977
|
: { connectOrCreate: props.Order.alpacaAccount.trades.map((item) => ({
|
890
978
|
where: {
|
891
979
|
id: item.id !== undefined ? item.id : undefined,
|
980
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
981
|
+
equals: item.alpacaAccountId
|
982
|
+
} : undefined,
|
983
|
+
assetId: item.assetId !== undefined ? {
|
984
|
+
equals: item.assetId
|
985
|
+
} : undefined,
|
892
986
|
},
|
893
987
|
create: {
|
894
988
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -914,6 +1008,12 @@ export const TakeProfit = {
|
|
914
1008
|
: { connectOrCreate: props.Order.alpacaAccount.positions.map((item) => ({
|
915
1009
|
where: {
|
916
1010
|
id: item.id !== undefined ? item.id : undefined,
|
1011
|
+
assetId: item.assetId !== undefined ? {
|
1012
|
+
equals: item.assetId
|
1013
|
+
} : undefined,
|
1014
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1015
|
+
equals: item.alpacaAccountId
|
1016
|
+
} : undefined,
|
917
1017
|
},
|
918
1018
|
create: {
|
919
1019
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -941,6 +1041,9 @@ export const TakeProfit = {
|
|
941
1041
|
: { connectOrCreate: props.Order.alpacaAccount.alerts.map((item) => ({
|
942
1042
|
where: {
|
943
1043
|
id: item.id !== undefined ? item.id : undefined,
|
1044
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1045
|
+
equals: item.alpacaAccountId
|
1046
|
+
} : undefined,
|
944
1047
|
},
|
945
1048
|
create: {
|
946
1049
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -958,6 +1061,9 @@ export const TakeProfit = {
|
|
958
1061
|
id: props.Order.action.id !== undefined ? {
|
959
1062
|
equals: props.Order.action.id
|
960
1063
|
} : undefined,
|
1064
|
+
tradeId: props.Order.action.tradeId !== undefined ? {
|
1065
|
+
equals: props.Order.action.tradeId
|
1066
|
+
} : undefined,
|
961
1067
|
},
|
962
1068
|
update: {
|
963
1069
|
id: props.Order.action.id !== undefined ? {
|
@@ -984,6 +1090,12 @@ export const TakeProfit = {
|
|
984
1090
|
id: props.Order.action.trade.id !== undefined ? {
|
985
1091
|
equals: props.Order.action.trade.id
|
986
1092
|
} : undefined,
|
1093
|
+
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
1094
|
+
equals: props.Order.action.trade.alpacaAccountId
|
1095
|
+
} : undefined,
|
1096
|
+
assetId: props.Order.action.trade.assetId !== undefined ? {
|
1097
|
+
equals: props.Order.action.trade.assetId
|
1098
|
+
} : undefined,
|
987
1099
|
},
|
988
1100
|
update: {
|
989
1101
|
id: props.Order.action.trade.id !== undefined ? {
|
@@ -1054,6 +1166,12 @@ export const TakeProfit = {
|
|
1054
1166
|
: { connectOrCreate: {
|
1055
1167
|
where: {
|
1056
1168
|
id: props.Order.action.trade.id !== undefined ? props.Order.action.trade.id : undefined,
|
1169
|
+
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
1170
|
+
equals: props.Order.action.trade.alpacaAccountId
|
1171
|
+
} : undefined,
|
1172
|
+
assetId: props.Order.action.trade.assetId !== undefined ? {
|
1173
|
+
equals: props.Order.action.trade.assetId
|
1174
|
+
} : undefined,
|
1057
1175
|
},
|
1058
1176
|
create: {
|
1059
1177
|
qty: props.Order.action.trade.qty !== undefined ? props.Order.action.trade.qty : undefined,
|
@@ -1259,6 +1377,12 @@ export const TakeProfit = {
|
|
1259
1377
|
upsert: props.Order.asset.trades.map((item) => ({
|
1260
1378
|
where: {
|
1261
1379
|
id: item.id !== undefined ? item.id : undefined,
|
1380
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1381
|
+
equals: item.alpacaAccountId
|
1382
|
+
} : undefined,
|
1383
|
+
assetId: item.assetId !== undefined ? {
|
1384
|
+
equals: item.assetId
|
1385
|
+
} : undefined,
|
1262
1386
|
},
|
1263
1387
|
update: {
|
1264
1388
|
id: item.id !== undefined ? {
|
@@ -1317,6 +1441,12 @@ export const TakeProfit = {
|
|
1317
1441
|
upsert: props.Order.asset.positions.map((item) => ({
|
1318
1442
|
where: {
|
1319
1443
|
id: item.id !== undefined ? item.id : undefined,
|
1444
|
+
assetId: item.assetId !== undefined ? {
|
1445
|
+
equals: item.assetId
|
1446
|
+
} : undefined,
|
1447
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1448
|
+
equals: item.alpacaAccountId
|
1449
|
+
} : undefined,
|
1320
1450
|
},
|
1321
1451
|
update: {
|
1322
1452
|
id: item.id !== undefined ? {
|
@@ -1384,6 +1514,12 @@ export const TakeProfit = {
|
|
1384
1514
|
where: {
|
1385
1515
|
id: item.id !== undefined ? item.id : undefined,
|
1386
1516
|
url: item.url !== undefined ? item.url : undefined,
|
1517
|
+
assetId: item.assetId !== undefined ? {
|
1518
|
+
equals: item.assetId
|
1519
|
+
} : undefined,
|
1520
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1521
|
+
equals: item.newsArticleId
|
1522
|
+
} : undefined,
|
1387
1523
|
},
|
1388
1524
|
update: {
|
1389
1525
|
id: item.id !== undefined ? {
|
@@ -1476,6 +1612,12 @@ export const TakeProfit = {
|
|
1476
1612
|
: { connectOrCreate: props.Order.asset.trades.map((item) => ({
|
1477
1613
|
where: {
|
1478
1614
|
id: item.id !== undefined ? item.id : undefined,
|
1615
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1616
|
+
equals: item.alpacaAccountId
|
1617
|
+
} : undefined,
|
1618
|
+
assetId: item.assetId !== undefined ? {
|
1619
|
+
equals: item.assetId
|
1620
|
+
} : undefined,
|
1479
1621
|
},
|
1480
1622
|
create: {
|
1481
1623
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1501,6 +1643,12 @@ export const TakeProfit = {
|
|
1501
1643
|
: { connectOrCreate: props.Order.asset.positions.map((item) => ({
|
1502
1644
|
where: {
|
1503
1645
|
id: item.id !== undefined ? item.id : undefined,
|
1646
|
+
assetId: item.assetId !== undefined ? {
|
1647
|
+
equals: item.assetId
|
1648
|
+
} : undefined,
|
1649
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1650
|
+
equals: item.alpacaAccountId
|
1651
|
+
} : undefined,
|
1504
1652
|
},
|
1505
1653
|
create: {
|
1506
1654
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1529,6 +1677,12 @@ export const TakeProfit = {
|
|
1529
1677
|
where: {
|
1530
1678
|
id: item.id !== undefined ? item.id : undefined,
|
1531
1679
|
url: item.url !== undefined ? item.url : undefined,
|
1680
|
+
assetId: item.assetId !== undefined ? {
|
1681
|
+
equals: item.assetId
|
1682
|
+
} : undefined,
|
1683
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1684
|
+
equals: item.newsArticleId
|
1685
|
+
} : undefined,
|
1532
1686
|
},
|
1533
1687
|
create: {
|
1534
1688
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -1574,6 +1728,7 @@ export const TakeProfit = {
|
|
1574
1728
|
: { connectOrCreate: {
|
1575
1729
|
where: {
|
1576
1730
|
id: props.Order.stopLoss.id !== undefined ? props.Order.stopLoss.id : undefined,
|
1731
|
+
orderId: props.Order.stopLoss.orderId !== undefined ? props.Order.stopLoss.orderId : undefined,
|
1577
1732
|
},
|
1578
1733
|
create: {
|
1579
1734
|
stopPrice: props.Order.stopLoss.stopPrice !== undefined ? props.Order.stopLoss.stopPrice : undefined,
|
@@ -1590,6 +1745,9 @@ export const TakeProfit = {
|
|
1590
1745
|
: { connectOrCreate: {
|
1591
1746
|
where: {
|
1592
1747
|
id: props.Order.alpacaAccount.id !== undefined ? props.Order.alpacaAccount.id : undefined,
|
1748
|
+
userId: props.Order.alpacaAccount.userId !== undefined ? {
|
1749
|
+
equals: props.Order.alpacaAccount.userId
|
1750
|
+
} : undefined,
|
1593
1751
|
},
|
1594
1752
|
create: {
|
1595
1753
|
type: props.Order.alpacaAccount.type !== undefined ? props.Order.alpacaAccount.type : undefined,
|
@@ -1639,6 +1797,12 @@ export const TakeProfit = {
|
|
1639
1797
|
: { connectOrCreate: props.Order.alpacaAccount.trades.map((item) => ({
|
1640
1798
|
where: {
|
1641
1799
|
id: item.id !== undefined ? item.id : undefined,
|
1800
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1801
|
+
equals: item.alpacaAccountId
|
1802
|
+
} : undefined,
|
1803
|
+
assetId: item.assetId !== undefined ? {
|
1804
|
+
equals: item.assetId
|
1805
|
+
} : undefined,
|
1642
1806
|
},
|
1643
1807
|
create: {
|
1644
1808
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1664,6 +1828,12 @@ export const TakeProfit = {
|
|
1664
1828
|
: { connectOrCreate: props.Order.alpacaAccount.positions.map((item) => ({
|
1665
1829
|
where: {
|
1666
1830
|
id: item.id !== undefined ? item.id : undefined,
|
1831
|
+
assetId: item.assetId !== undefined ? {
|
1832
|
+
equals: item.assetId
|
1833
|
+
} : undefined,
|
1834
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1835
|
+
equals: item.alpacaAccountId
|
1836
|
+
} : undefined,
|
1667
1837
|
},
|
1668
1838
|
create: {
|
1669
1839
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1691,6 +1861,9 @@ export const TakeProfit = {
|
|
1691
1861
|
: { connectOrCreate: props.Order.alpacaAccount.alerts.map((item) => ({
|
1692
1862
|
where: {
|
1693
1863
|
id: item.id !== undefined ? item.id : undefined,
|
1864
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1865
|
+
equals: item.alpacaAccountId
|
1866
|
+
} : undefined,
|
1694
1867
|
},
|
1695
1868
|
create: {
|
1696
1869
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1711,6 +1884,9 @@ export const TakeProfit = {
|
|
1711
1884
|
: { connectOrCreate: {
|
1712
1885
|
where: {
|
1713
1886
|
id: props.Order.action.id !== undefined ? props.Order.action.id : undefined,
|
1887
|
+
tradeId: props.Order.action.tradeId !== undefined ? {
|
1888
|
+
equals: props.Order.action.tradeId
|
1889
|
+
} : undefined,
|
1714
1890
|
},
|
1715
1891
|
create: {
|
1716
1892
|
sequence: props.Order.action.sequence !== undefined ? props.Order.action.sequence : undefined,
|
@@ -1727,6 +1903,12 @@ export const TakeProfit = {
|
|
1727
1903
|
: { connectOrCreate: {
|
1728
1904
|
where: {
|
1729
1905
|
id: props.Order.action.trade.id !== undefined ? props.Order.action.trade.id : undefined,
|
1906
|
+
alpacaAccountId: props.Order.action.trade.alpacaAccountId !== undefined ? {
|
1907
|
+
equals: props.Order.action.trade.alpacaAccountId
|
1908
|
+
} : undefined,
|
1909
|
+
assetId: props.Order.action.trade.assetId !== undefined ? {
|
1910
|
+
equals: props.Order.action.trade.assetId
|
1911
|
+
} : undefined,
|
1730
1912
|
},
|
1731
1913
|
create: {
|
1732
1914
|
qty: props.Order.action.trade.qty !== undefined ? props.Order.action.trade.qty : undefined,
|
@@ -1823,6 +2005,12 @@ export const TakeProfit = {
|
|
1823
2005
|
: { connectOrCreate: props.Order.asset.trades.map((item) => ({
|
1824
2006
|
where: {
|
1825
2007
|
id: item.id !== undefined ? item.id : undefined,
|
2008
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2009
|
+
equals: item.alpacaAccountId
|
2010
|
+
} : undefined,
|
2011
|
+
assetId: item.assetId !== undefined ? {
|
2012
|
+
equals: item.assetId
|
2013
|
+
} : undefined,
|
1826
2014
|
},
|
1827
2015
|
create: {
|
1828
2016
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1848,6 +2036,12 @@ export const TakeProfit = {
|
|
1848
2036
|
: { connectOrCreate: props.Order.asset.positions.map((item) => ({
|
1849
2037
|
where: {
|
1850
2038
|
id: item.id !== undefined ? item.id : undefined,
|
2039
|
+
assetId: item.assetId !== undefined ? {
|
2040
|
+
equals: item.assetId
|
2041
|
+
} : undefined,
|
2042
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2043
|
+
equals: item.alpacaAccountId
|
2044
|
+
} : undefined,
|
1851
2045
|
},
|
1852
2046
|
create: {
|
1853
2047
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1876,6 +2070,12 @@ export const TakeProfit = {
|
|
1876
2070
|
where: {
|
1877
2071
|
id: item.id !== undefined ? item.id : undefined,
|
1878
2072
|
url: item.url !== undefined ? item.url : undefined,
|
2073
|
+
assetId: item.assetId !== undefined ? {
|
2074
|
+
equals: item.assetId
|
2075
|
+
} : undefined,
|
2076
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2077
|
+
equals: item.newsArticleId
|
2078
|
+
} : undefined,
|
1879
2079
|
},
|
1880
2080
|
create: {
|
1881
2081
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -1952,6 +2152,18 @@ export const TakeProfit = {
|
|
1952
2152
|
id: prop.Order.id !== undefined ? {
|
1953
2153
|
equals: prop.Order.id
|
1954
2154
|
} : undefined,
|
2155
|
+
clientOrderId: prop.Order.clientOrderId !== undefined ? {
|
2156
|
+
equals: prop.Order.clientOrderId
|
2157
|
+
} : undefined,
|
2158
|
+
alpacaAccountId: prop.Order.alpacaAccountId !== undefined ? {
|
2159
|
+
equals: prop.Order.alpacaAccountId
|
2160
|
+
} : undefined,
|
2161
|
+
assetId: prop.Order.assetId !== undefined ? {
|
2162
|
+
equals: prop.Order.assetId
|
2163
|
+
} : undefined,
|
2164
|
+
actionId: prop.Order.actionId !== undefined ? {
|
2165
|
+
equals: prop.Order.actionId
|
2166
|
+
} : undefined,
|
1955
2167
|
},
|
1956
2168
|
update: {
|
1957
2169
|
id: prop.Order.id !== undefined ? {
|
@@ -2029,6 +2241,9 @@ export const TakeProfit = {
|
|
2029
2241
|
id: prop.Order.stopLoss.id !== undefined ? {
|
2030
2242
|
equals: prop.Order.stopLoss.id
|
2031
2243
|
} : undefined,
|
2244
|
+
orderId: prop.Order.stopLoss.orderId !== undefined ? {
|
2245
|
+
equals: prop.Order.stopLoss.orderId
|
2246
|
+
} : undefined,
|
2032
2247
|
},
|
2033
2248
|
update: {
|
2034
2249
|
id: prop.Order.stopLoss.id !== undefined ? {
|
@@ -2053,6 +2268,9 @@ export const TakeProfit = {
|
|
2053
2268
|
id: prop.Order.alpacaAccount.id !== undefined ? {
|
2054
2269
|
equals: prop.Order.alpacaAccount.id
|
2055
2270
|
} : undefined,
|
2271
|
+
userId: prop.Order.alpacaAccount.userId !== undefined ? {
|
2272
|
+
equals: prop.Order.alpacaAccount.userId
|
2273
|
+
} : undefined,
|
2056
2274
|
},
|
2057
2275
|
update: {
|
2058
2276
|
id: prop.Order.alpacaAccount.id !== undefined ? {
|
@@ -2155,6 +2373,12 @@ export const TakeProfit = {
|
|
2155
2373
|
upsert: prop.Order.alpacaAccount.trades.map((item) => ({
|
2156
2374
|
where: {
|
2157
2375
|
id: item.id !== undefined ? item.id : undefined,
|
2376
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2377
|
+
equals: item.alpacaAccountId
|
2378
|
+
} : undefined,
|
2379
|
+
assetId: item.assetId !== undefined ? {
|
2380
|
+
equals: item.assetId
|
2381
|
+
} : undefined,
|
2158
2382
|
},
|
2159
2383
|
update: {
|
2160
2384
|
id: item.id !== undefined ? {
|
@@ -2213,6 +2437,12 @@ export const TakeProfit = {
|
|
2213
2437
|
upsert: prop.Order.alpacaAccount.positions.map((item) => ({
|
2214
2438
|
where: {
|
2215
2439
|
id: item.id !== undefined ? item.id : undefined,
|
2440
|
+
assetId: item.assetId !== undefined ? {
|
2441
|
+
equals: item.assetId
|
2442
|
+
} : undefined,
|
2443
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2444
|
+
equals: item.alpacaAccountId
|
2445
|
+
} : undefined,
|
2216
2446
|
},
|
2217
2447
|
update: {
|
2218
2448
|
id: item.id !== undefined ? {
|
@@ -2279,6 +2509,9 @@ export const TakeProfit = {
|
|
2279
2509
|
upsert: prop.Order.alpacaAccount.alerts.map((item) => ({
|
2280
2510
|
where: {
|
2281
2511
|
id: item.id !== undefined ? item.id : undefined,
|
2512
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2513
|
+
equals: item.alpacaAccountId
|
2514
|
+
} : undefined,
|
2282
2515
|
},
|
2283
2516
|
update: {
|
2284
2517
|
id: item.id !== undefined ? {
|
@@ -2350,6 +2583,12 @@ export const TakeProfit = {
|
|
2350
2583
|
: { connectOrCreate: prop.Order.alpacaAccount.trades.map((item) => ({
|
2351
2584
|
where: {
|
2352
2585
|
id: item.id !== undefined ? item.id : undefined,
|
2586
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2587
|
+
equals: item.alpacaAccountId
|
2588
|
+
} : undefined,
|
2589
|
+
assetId: item.assetId !== undefined ? {
|
2590
|
+
equals: item.assetId
|
2591
|
+
} : undefined,
|
2353
2592
|
},
|
2354
2593
|
create: {
|
2355
2594
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2375,6 +2614,12 @@ export const TakeProfit = {
|
|
2375
2614
|
: { connectOrCreate: prop.Order.alpacaAccount.positions.map((item) => ({
|
2376
2615
|
where: {
|
2377
2616
|
id: item.id !== undefined ? item.id : undefined,
|
2617
|
+
assetId: item.assetId !== undefined ? {
|
2618
|
+
equals: item.assetId
|
2619
|
+
} : undefined,
|
2620
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2621
|
+
equals: item.alpacaAccountId
|
2622
|
+
} : undefined,
|
2378
2623
|
},
|
2379
2624
|
create: {
|
2380
2625
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2402,6 +2647,9 @@ export const TakeProfit = {
|
|
2402
2647
|
: { connectOrCreate: prop.Order.alpacaAccount.alerts.map((item) => ({
|
2403
2648
|
where: {
|
2404
2649
|
id: item.id !== undefined ? item.id : undefined,
|
2650
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2651
|
+
equals: item.alpacaAccountId
|
2652
|
+
} : undefined,
|
2405
2653
|
},
|
2406
2654
|
create: {
|
2407
2655
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -2419,6 +2667,9 @@ export const TakeProfit = {
|
|
2419
2667
|
id: prop.Order.action.id !== undefined ? {
|
2420
2668
|
equals: prop.Order.action.id
|
2421
2669
|
} : undefined,
|
2670
|
+
tradeId: prop.Order.action.tradeId !== undefined ? {
|
2671
|
+
equals: prop.Order.action.tradeId
|
2672
|
+
} : undefined,
|
2422
2673
|
},
|
2423
2674
|
update: {
|
2424
2675
|
id: prop.Order.action.id !== undefined ? {
|
@@ -2445,6 +2696,12 @@ export const TakeProfit = {
|
|
2445
2696
|
id: prop.Order.action.trade.id !== undefined ? {
|
2446
2697
|
equals: prop.Order.action.trade.id
|
2447
2698
|
} : undefined,
|
2699
|
+
alpacaAccountId: prop.Order.action.trade.alpacaAccountId !== undefined ? {
|
2700
|
+
equals: prop.Order.action.trade.alpacaAccountId
|
2701
|
+
} : undefined,
|
2702
|
+
assetId: prop.Order.action.trade.assetId !== undefined ? {
|
2703
|
+
equals: prop.Order.action.trade.assetId
|
2704
|
+
} : undefined,
|
2448
2705
|
},
|
2449
2706
|
update: {
|
2450
2707
|
id: prop.Order.action.trade.id !== undefined ? {
|
@@ -2515,6 +2772,12 @@ export const TakeProfit = {
|
|
2515
2772
|
: { connectOrCreate: {
|
2516
2773
|
where: {
|
2517
2774
|
id: prop.Order.action.trade.id !== undefined ? prop.Order.action.trade.id : undefined,
|
2775
|
+
alpacaAccountId: prop.Order.action.trade.alpacaAccountId !== undefined ? {
|
2776
|
+
equals: prop.Order.action.trade.alpacaAccountId
|
2777
|
+
} : undefined,
|
2778
|
+
assetId: prop.Order.action.trade.assetId !== undefined ? {
|
2779
|
+
equals: prop.Order.action.trade.assetId
|
2780
|
+
} : undefined,
|
2518
2781
|
},
|
2519
2782
|
create: {
|
2520
2783
|
qty: prop.Order.action.trade.qty !== undefined ? prop.Order.action.trade.qty : undefined,
|
@@ -2720,6 +2983,12 @@ export const TakeProfit = {
|
|
2720
2983
|
upsert: prop.Order.asset.trades.map((item) => ({
|
2721
2984
|
where: {
|
2722
2985
|
id: item.id !== undefined ? item.id : undefined,
|
2986
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2987
|
+
equals: item.alpacaAccountId
|
2988
|
+
} : undefined,
|
2989
|
+
assetId: item.assetId !== undefined ? {
|
2990
|
+
equals: item.assetId
|
2991
|
+
} : undefined,
|
2723
2992
|
},
|
2724
2993
|
update: {
|
2725
2994
|
id: item.id !== undefined ? {
|
@@ -2778,6 +3047,12 @@ export const TakeProfit = {
|
|
2778
3047
|
upsert: prop.Order.asset.positions.map((item) => ({
|
2779
3048
|
where: {
|
2780
3049
|
id: item.id !== undefined ? item.id : undefined,
|
3050
|
+
assetId: item.assetId !== undefined ? {
|
3051
|
+
equals: item.assetId
|
3052
|
+
} : undefined,
|
3053
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3054
|
+
equals: item.alpacaAccountId
|
3055
|
+
} : undefined,
|
2781
3056
|
},
|
2782
3057
|
update: {
|
2783
3058
|
id: item.id !== undefined ? {
|
@@ -2845,6 +3120,12 @@ export const TakeProfit = {
|
|
2845
3120
|
where: {
|
2846
3121
|
id: item.id !== undefined ? item.id : undefined,
|
2847
3122
|
url: item.url !== undefined ? item.url : undefined,
|
3123
|
+
assetId: item.assetId !== undefined ? {
|
3124
|
+
equals: item.assetId
|
3125
|
+
} : undefined,
|
3126
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3127
|
+
equals: item.newsArticleId
|
3128
|
+
} : undefined,
|
2848
3129
|
},
|
2849
3130
|
update: {
|
2850
3131
|
id: item.id !== undefined ? {
|
@@ -2937,6 +3218,12 @@ export const TakeProfit = {
|
|
2937
3218
|
: { connectOrCreate: prop.Order.asset.trades.map((item) => ({
|
2938
3219
|
where: {
|
2939
3220
|
id: item.id !== undefined ? item.id : undefined,
|
3221
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3222
|
+
equals: item.alpacaAccountId
|
3223
|
+
} : undefined,
|
3224
|
+
assetId: item.assetId !== undefined ? {
|
3225
|
+
equals: item.assetId
|
3226
|
+
} : undefined,
|
2940
3227
|
},
|
2941
3228
|
create: {
|
2942
3229
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2962,6 +3249,12 @@ export const TakeProfit = {
|
|
2962
3249
|
: { connectOrCreate: prop.Order.asset.positions.map((item) => ({
|
2963
3250
|
where: {
|
2964
3251
|
id: item.id !== undefined ? item.id : undefined,
|
3252
|
+
assetId: item.assetId !== undefined ? {
|
3253
|
+
equals: item.assetId
|
3254
|
+
} : undefined,
|
3255
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3256
|
+
equals: item.alpacaAccountId
|
3257
|
+
} : undefined,
|
2965
3258
|
},
|
2966
3259
|
create: {
|
2967
3260
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2990,6 +3283,12 @@ export const TakeProfit = {
|
|
2990
3283
|
where: {
|
2991
3284
|
id: item.id !== undefined ? item.id : undefined,
|
2992
3285
|
url: item.url !== undefined ? item.url : undefined,
|
3286
|
+
assetId: item.assetId !== undefined ? {
|
3287
|
+
equals: item.assetId
|
3288
|
+
} : undefined,
|
3289
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3290
|
+
equals: item.newsArticleId
|
3291
|
+
} : undefined,
|
2993
3292
|
},
|
2994
3293
|
create: {
|
2995
3294
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3035,6 +3334,7 @@ export const TakeProfit = {
|
|
3035
3334
|
: { connectOrCreate: {
|
3036
3335
|
where: {
|
3037
3336
|
id: prop.Order.stopLoss.id !== undefined ? prop.Order.stopLoss.id : undefined,
|
3337
|
+
orderId: prop.Order.stopLoss.orderId !== undefined ? prop.Order.stopLoss.orderId : undefined,
|
3038
3338
|
},
|
3039
3339
|
create: {
|
3040
3340
|
stopPrice: prop.Order.stopLoss.stopPrice !== undefined ? prop.Order.stopLoss.stopPrice : undefined,
|
@@ -3051,6 +3351,9 @@ export const TakeProfit = {
|
|
3051
3351
|
: { connectOrCreate: {
|
3052
3352
|
where: {
|
3053
3353
|
id: prop.Order.alpacaAccount.id !== undefined ? prop.Order.alpacaAccount.id : undefined,
|
3354
|
+
userId: prop.Order.alpacaAccount.userId !== undefined ? {
|
3355
|
+
equals: prop.Order.alpacaAccount.userId
|
3356
|
+
} : undefined,
|
3054
3357
|
},
|
3055
3358
|
create: {
|
3056
3359
|
type: prop.Order.alpacaAccount.type !== undefined ? prop.Order.alpacaAccount.type : undefined,
|
@@ -3100,6 +3403,12 @@ export const TakeProfit = {
|
|
3100
3403
|
: { connectOrCreate: prop.Order.alpacaAccount.trades.map((item) => ({
|
3101
3404
|
where: {
|
3102
3405
|
id: item.id !== undefined ? item.id : undefined,
|
3406
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3407
|
+
equals: item.alpacaAccountId
|
3408
|
+
} : undefined,
|
3409
|
+
assetId: item.assetId !== undefined ? {
|
3410
|
+
equals: item.assetId
|
3411
|
+
} : undefined,
|
3103
3412
|
},
|
3104
3413
|
create: {
|
3105
3414
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3125,6 +3434,12 @@ export const TakeProfit = {
|
|
3125
3434
|
: { connectOrCreate: prop.Order.alpacaAccount.positions.map((item) => ({
|
3126
3435
|
where: {
|
3127
3436
|
id: item.id !== undefined ? item.id : undefined,
|
3437
|
+
assetId: item.assetId !== undefined ? {
|
3438
|
+
equals: item.assetId
|
3439
|
+
} : undefined,
|
3440
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3441
|
+
equals: item.alpacaAccountId
|
3442
|
+
} : undefined,
|
3128
3443
|
},
|
3129
3444
|
create: {
|
3130
3445
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3152,6 +3467,9 @@ export const TakeProfit = {
|
|
3152
3467
|
: { connectOrCreate: prop.Order.alpacaAccount.alerts.map((item) => ({
|
3153
3468
|
where: {
|
3154
3469
|
id: item.id !== undefined ? item.id : undefined,
|
3470
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3471
|
+
equals: item.alpacaAccountId
|
3472
|
+
} : undefined,
|
3155
3473
|
},
|
3156
3474
|
create: {
|
3157
3475
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -3172,6 +3490,9 @@ export const TakeProfit = {
|
|
3172
3490
|
: { connectOrCreate: {
|
3173
3491
|
where: {
|
3174
3492
|
id: prop.Order.action.id !== undefined ? prop.Order.action.id : undefined,
|
3493
|
+
tradeId: prop.Order.action.tradeId !== undefined ? {
|
3494
|
+
equals: prop.Order.action.tradeId
|
3495
|
+
} : undefined,
|
3175
3496
|
},
|
3176
3497
|
create: {
|
3177
3498
|
sequence: prop.Order.action.sequence !== undefined ? prop.Order.action.sequence : undefined,
|
@@ -3188,6 +3509,12 @@ export const TakeProfit = {
|
|
3188
3509
|
: { connectOrCreate: {
|
3189
3510
|
where: {
|
3190
3511
|
id: prop.Order.action.trade.id !== undefined ? prop.Order.action.trade.id : undefined,
|
3512
|
+
alpacaAccountId: prop.Order.action.trade.alpacaAccountId !== undefined ? {
|
3513
|
+
equals: prop.Order.action.trade.alpacaAccountId
|
3514
|
+
} : undefined,
|
3515
|
+
assetId: prop.Order.action.trade.assetId !== undefined ? {
|
3516
|
+
equals: prop.Order.action.trade.assetId
|
3517
|
+
} : undefined,
|
3191
3518
|
},
|
3192
3519
|
create: {
|
3193
3520
|
qty: prop.Order.action.trade.qty !== undefined ? prop.Order.action.trade.qty : undefined,
|
@@ -3284,6 +3611,12 @@ export const TakeProfit = {
|
|
3284
3611
|
: { connectOrCreate: prop.Order.asset.trades.map((item) => ({
|
3285
3612
|
where: {
|
3286
3613
|
id: item.id !== undefined ? item.id : undefined,
|
3614
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3615
|
+
equals: item.alpacaAccountId
|
3616
|
+
} : undefined,
|
3617
|
+
assetId: item.assetId !== undefined ? {
|
3618
|
+
equals: item.assetId
|
3619
|
+
} : undefined,
|
3287
3620
|
},
|
3288
3621
|
create: {
|
3289
3622
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3309,6 +3642,12 @@ export const TakeProfit = {
|
|
3309
3642
|
: { connectOrCreate: prop.Order.asset.positions.map((item) => ({
|
3310
3643
|
where: {
|
3311
3644
|
id: item.id !== undefined ? item.id : undefined,
|
3645
|
+
assetId: item.assetId !== undefined ? {
|
3646
|
+
equals: item.assetId
|
3647
|
+
} : undefined,
|
3648
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3649
|
+
equals: item.alpacaAccountId
|
3650
|
+
} : undefined,
|
3312
3651
|
},
|
3313
3652
|
create: {
|
3314
3653
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3337,6 +3676,12 @@ export const TakeProfit = {
|
|
3337
3676
|
where: {
|
3338
3677
|
id: item.id !== undefined ? item.id : undefined,
|
3339
3678
|
url: item.url !== undefined ? item.url : undefined,
|
3679
|
+
assetId: item.assetId !== undefined ? {
|
3680
|
+
equals: item.assetId
|
3681
|
+
} : undefined,
|
3682
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3683
|
+
equals: item.newsArticleId
|
3684
|
+
} : undefined,
|
3340
3685
|
},
|
3341
3686
|
create: {
|
3342
3687
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3492,7 +3837,9 @@ export const TakeProfit = {
|
|
3492
3837
|
} : undefined,
|
3493
3838
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
3494
3839
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|
3495
|
-
orderId: props.orderId !== undefined ?
|
3840
|
+
orderId: props.orderId !== undefined ? {
|
3841
|
+
equals: props.orderId
|
3842
|
+
} : undefined,
|
3496
3843
|
},
|
3497
3844
|
};
|
3498
3845
|
const filteredVariables = removeUndefinedProps(variables);
|