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/AlpacaAccount.mjs
CHANGED
@@ -578,9 +578,17 @@ export const AlpacaAccount = {
|
|
578
578
|
: { connectOrCreate: {
|
579
579
|
where: {
|
580
580
|
id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
|
581
|
+
stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
|
582
|
+
stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
|
583
|
+
authUserId: props.user.customer.authUserId !== undefined ? {
|
584
|
+
equals: props.user.customer.authUserId
|
585
|
+
} : undefined,
|
581
586
|
name: props.user.customer.name !== undefined ? {
|
582
587
|
equals: props.user.customer.name
|
583
588
|
} : undefined,
|
589
|
+
stripePriceId: props.user.customer.stripePriceId !== undefined ? {
|
590
|
+
equals: props.user.customer.stripePriceId
|
591
|
+
} : undefined,
|
584
592
|
},
|
585
593
|
create: {
|
586
594
|
authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
|
@@ -602,6 +610,12 @@ export const AlpacaAccount = {
|
|
602
610
|
: { connectOrCreate: props.user.accounts.map((item) => ({
|
603
611
|
where: {
|
604
612
|
id: item.id !== undefined ? item.id : undefined,
|
613
|
+
userId: item.userId !== undefined ? {
|
614
|
+
equals: item.userId
|
615
|
+
} : undefined,
|
616
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
617
|
+
equals: item.providerAccountId
|
618
|
+
} : undefined,
|
605
619
|
},
|
606
620
|
create: {
|
607
621
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -626,6 +640,9 @@ export const AlpacaAccount = {
|
|
626
640
|
: { connectOrCreate: props.user.sessions.map((item) => ({
|
627
641
|
where: {
|
628
642
|
id: item.id !== undefined ? item.id : undefined,
|
643
|
+
userId: item.userId !== undefined ? {
|
644
|
+
equals: item.userId
|
645
|
+
} : undefined,
|
629
646
|
},
|
630
647
|
create: {
|
631
648
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -642,6 +659,9 @@ export const AlpacaAccount = {
|
|
642
659
|
: { connectOrCreate: props.user.authenticators.map((item) => ({
|
643
660
|
where: {
|
644
661
|
id: item.id !== undefined ? item.id : undefined,
|
662
|
+
userId: item.userId !== undefined ? {
|
663
|
+
equals: item.userId
|
664
|
+
} : undefined,
|
645
665
|
},
|
646
666
|
create: {
|
647
667
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -662,6 +682,12 @@ export const AlpacaAccount = {
|
|
662
682
|
: { connectOrCreate: props.trades.map((item) => ({
|
663
683
|
where: {
|
664
684
|
id: item.id !== undefined ? item.id : undefined,
|
685
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
686
|
+
equals: item.alpacaAccountId
|
687
|
+
} : undefined,
|
688
|
+
assetId: item.assetId !== undefined ? {
|
689
|
+
equals: item.assetId
|
690
|
+
} : undefined,
|
665
691
|
},
|
666
692
|
create: {
|
667
693
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -752,6 +778,15 @@ export const AlpacaAccount = {
|
|
752
778
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
753
779
|
where: {
|
754
780
|
id: item.id !== undefined ? item.id : undefined,
|
781
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
782
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
783
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
784
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
785
|
+
equals: item.alpacaAccountId
|
786
|
+
} : undefined,
|
787
|
+
assetId: item.assetId !== undefined ? {
|
788
|
+
equals: item.assetId
|
789
|
+
} : undefined,
|
755
790
|
},
|
756
791
|
create: {
|
757
792
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -788,6 +823,12 @@ export const AlpacaAccount = {
|
|
788
823
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
789
824
|
where: {
|
790
825
|
id: item.id !== undefined ? item.id : undefined,
|
826
|
+
assetId: item.assetId !== undefined ? {
|
827
|
+
equals: item.assetId
|
828
|
+
} : undefined,
|
829
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
830
|
+
equals: item.alpacaAccountId
|
831
|
+
} : undefined,
|
791
832
|
},
|
792
833
|
create: {
|
793
834
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -816,6 +857,12 @@ export const AlpacaAccount = {
|
|
816
857
|
where: {
|
817
858
|
id: item.id !== undefined ? item.id : undefined,
|
818
859
|
url: item.url !== undefined ? item.url : undefined,
|
860
|
+
assetId: item.assetId !== undefined ? {
|
861
|
+
equals: item.assetId
|
862
|
+
} : undefined,
|
863
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
864
|
+
equals: item.newsArticleId
|
865
|
+
} : undefined,
|
819
866
|
},
|
820
867
|
create: {
|
821
868
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -837,6 +884,9 @@ export const AlpacaAccount = {
|
|
837
884
|
: { connectOrCreate: item.actions.map((item) => ({
|
838
885
|
where: {
|
839
886
|
id: item.id !== undefined ? item.id : undefined,
|
887
|
+
tradeId: item.tradeId !== undefined ? {
|
888
|
+
equals: item.tradeId
|
889
|
+
} : undefined,
|
840
890
|
},
|
841
891
|
create: {
|
842
892
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -853,6 +903,15 @@ export const AlpacaAccount = {
|
|
853
903
|
: { connectOrCreate: {
|
854
904
|
where: {
|
855
905
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
906
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
907
|
+
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
908
|
+
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
909
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
910
|
+
equals: item.order.alpacaAccountId
|
911
|
+
} : undefined,
|
912
|
+
assetId: item.order.assetId !== undefined ? {
|
913
|
+
equals: item.order.assetId
|
914
|
+
} : undefined,
|
856
915
|
},
|
857
916
|
create: {
|
858
917
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
@@ -895,6 +954,15 @@ export const AlpacaAccount = {
|
|
895
954
|
: { connectOrCreate: props.orders.map((item) => ({
|
896
955
|
where: {
|
897
956
|
id: item.id !== undefined ? item.id : undefined,
|
957
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
958
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
959
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
960
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
961
|
+
equals: item.alpacaAccountId
|
962
|
+
} : undefined,
|
963
|
+
assetId: item.assetId !== undefined ? {
|
964
|
+
equals: item.assetId
|
965
|
+
} : undefined,
|
898
966
|
},
|
899
967
|
create: {
|
900
968
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -928,6 +996,7 @@ export const AlpacaAccount = {
|
|
928
996
|
: { connectOrCreate: {
|
929
997
|
where: {
|
930
998
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
999
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
931
1000
|
},
|
932
1001
|
create: {
|
933
1002
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -944,6 +1013,7 @@ export const AlpacaAccount = {
|
|
944
1013
|
: { connectOrCreate: {
|
945
1014
|
where: {
|
946
1015
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
1016
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
947
1017
|
},
|
948
1018
|
create: {
|
949
1019
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -960,6 +1030,9 @@ export const AlpacaAccount = {
|
|
960
1030
|
: { connectOrCreate: {
|
961
1031
|
where: {
|
962
1032
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
1033
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1034
|
+
equals: item.action.tradeId
|
1035
|
+
} : undefined,
|
963
1036
|
},
|
964
1037
|
create: {
|
965
1038
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -976,6 +1049,12 @@ export const AlpacaAccount = {
|
|
976
1049
|
: { connectOrCreate: {
|
977
1050
|
where: {
|
978
1051
|
id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
|
1052
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
1053
|
+
equals: item.action.trade.alpacaAccountId
|
1054
|
+
} : undefined,
|
1055
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
1056
|
+
equals: item.action.trade.assetId
|
1057
|
+
} : undefined,
|
979
1058
|
},
|
980
1059
|
create: {
|
981
1060
|
qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
|
@@ -1072,6 +1151,12 @@ export const AlpacaAccount = {
|
|
1072
1151
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
1073
1152
|
where: {
|
1074
1153
|
id: item.id !== undefined ? item.id : undefined,
|
1154
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1155
|
+
equals: item.alpacaAccountId
|
1156
|
+
} : undefined,
|
1157
|
+
assetId: item.assetId !== undefined ? {
|
1158
|
+
equals: item.assetId
|
1159
|
+
} : undefined,
|
1075
1160
|
},
|
1076
1161
|
create: {
|
1077
1162
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1097,6 +1182,12 @@ export const AlpacaAccount = {
|
|
1097
1182
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
1098
1183
|
where: {
|
1099
1184
|
id: item.id !== undefined ? item.id : undefined,
|
1185
|
+
assetId: item.assetId !== undefined ? {
|
1186
|
+
equals: item.assetId
|
1187
|
+
} : undefined,
|
1188
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1189
|
+
equals: item.alpacaAccountId
|
1190
|
+
} : undefined,
|
1100
1191
|
},
|
1101
1192
|
create: {
|
1102
1193
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1125,6 +1216,12 @@ export const AlpacaAccount = {
|
|
1125
1216
|
where: {
|
1126
1217
|
id: item.id !== undefined ? item.id : undefined,
|
1127
1218
|
url: item.url !== undefined ? item.url : undefined,
|
1219
|
+
assetId: item.assetId !== undefined ? {
|
1220
|
+
equals: item.assetId
|
1221
|
+
} : undefined,
|
1222
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1223
|
+
equals: item.newsArticleId
|
1224
|
+
} : undefined,
|
1128
1225
|
},
|
1129
1226
|
create: {
|
1130
1227
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -1149,6 +1246,12 @@ export const AlpacaAccount = {
|
|
1149
1246
|
: { connectOrCreate: props.positions.map((item) => ({
|
1150
1247
|
where: {
|
1151
1248
|
id: item.id !== undefined ? item.id : undefined,
|
1249
|
+
assetId: item.assetId !== undefined ? {
|
1250
|
+
equals: item.assetId
|
1251
|
+
} : undefined,
|
1252
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1253
|
+
equals: item.alpacaAccountId
|
1254
|
+
} : undefined,
|
1152
1255
|
},
|
1153
1256
|
create: {
|
1154
1257
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -1241,6 +1344,12 @@ export const AlpacaAccount = {
|
|
1241
1344
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
1242
1345
|
where: {
|
1243
1346
|
id: item.id !== undefined ? item.id : undefined,
|
1347
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1348
|
+
equals: item.alpacaAccountId
|
1349
|
+
} : undefined,
|
1350
|
+
assetId: item.assetId !== undefined ? {
|
1351
|
+
equals: item.assetId
|
1352
|
+
} : undefined,
|
1244
1353
|
},
|
1245
1354
|
create: {
|
1246
1355
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -1266,6 +1375,15 @@ export const AlpacaAccount = {
|
|
1266
1375
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
1267
1376
|
where: {
|
1268
1377
|
id: item.id !== undefined ? item.id : undefined,
|
1378
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1379
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1380
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1381
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1382
|
+
equals: item.alpacaAccountId
|
1383
|
+
} : undefined,
|
1384
|
+
assetId: item.assetId !== undefined ? {
|
1385
|
+
equals: item.assetId
|
1386
|
+
} : undefined,
|
1269
1387
|
},
|
1270
1388
|
create: {
|
1271
1389
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -1303,6 +1421,12 @@ export const AlpacaAccount = {
|
|
1303
1421
|
where: {
|
1304
1422
|
id: item.id !== undefined ? item.id : undefined,
|
1305
1423
|
url: item.url !== undefined ? item.url : undefined,
|
1424
|
+
assetId: item.assetId !== undefined ? {
|
1425
|
+
equals: item.assetId
|
1426
|
+
} : undefined,
|
1427
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
1428
|
+
equals: item.newsArticleId
|
1429
|
+
} : undefined,
|
1306
1430
|
},
|
1307
1431
|
create: {
|
1308
1432
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -1327,6 +1451,9 @@ export const AlpacaAccount = {
|
|
1327
1451
|
: { connectOrCreate: props.alerts.map((item) => ({
|
1328
1452
|
where: {
|
1329
1453
|
id: item.id !== undefined ? item.id : undefined,
|
1454
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1455
|
+
equals: item.alpacaAccountId
|
1456
|
+
} : undefined,
|
1330
1457
|
},
|
1331
1458
|
create: {
|
1332
1459
|
message: item.message !== undefined ? item.message : undefined,
|
@@ -1422,7 +1549,9 @@ export const AlpacaAccount = {
|
|
1422
1549
|
maxOrderSize: props.maxOrderSize !== undefined ? props.maxOrderSize : undefined,
|
1423
1550
|
minPercentageChange: props.minPercentageChange !== undefined ? props.minPercentageChange : undefined,
|
1424
1551
|
volumeThreshold: props.volumeThreshold !== undefined ? props.volumeThreshold : undefined,
|
1425
|
-
userId: props.userId !== undefined ?
|
1552
|
+
userId: props.userId !== undefined ? {
|
1553
|
+
equals: props.userId
|
1554
|
+
} : undefined,
|
1426
1555
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
1427
1556
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|
1428
1557
|
},
|
@@ -1519,9 +1648,21 @@ export const AlpacaAccount = {
|
|
1519
1648
|
id: props.user.customer.id !== undefined ? {
|
1520
1649
|
equals: props.user.customer.id
|
1521
1650
|
} : undefined,
|
1651
|
+
authUserId: props.user.customer.authUserId !== undefined ? {
|
1652
|
+
equals: props.user.customer.authUserId
|
1653
|
+
} : undefined,
|
1522
1654
|
name: props.user.customer.name !== undefined ? {
|
1523
1655
|
equals: props.user.customer.name
|
1524
1656
|
} : undefined,
|
1657
|
+
stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? {
|
1658
|
+
equals: props.user.customer.stripeCustomerId
|
1659
|
+
} : undefined,
|
1660
|
+
stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? {
|
1661
|
+
equals: props.user.customer.stripeSubscriptionId
|
1662
|
+
} : undefined,
|
1663
|
+
stripePriceId: props.user.customer.stripePriceId !== undefined ? {
|
1664
|
+
equals: props.user.customer.stripePriceId
|
1665
|
+
} : undefined,
|
1525
1666
|
},
|
1526
1667
|
update: {
|
1527
1668
|
authUserId: props.user.customer.authUserId !== undefined ? {
|
@@ -1561,6 +1702,12 @@ export const AlpacaAccount = {
|
|
1561
1702
|
upsert: props.user.accounts.map((item) => ({
|
1562
1703
|
where: {
|
1563
1704
|
id: item.id !== undefined ? item.id : undefined,
|
1705
|
+
userId: item.userId !== undefined ? {
|
1706
|
+
equals: item.userId
|
1707
|
+
} : undefined,
|
1708
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1709
|
+
equals: item.providerAccountId
|
1710
|
+
} : undefined,
|
1564
1711
|
},
|
1565
1712
|
update: {
|
1566
1713
|
id: item.id !== undefined ? {
|
@@ -1615,6 +1762,9 @@ export const AlpacaAccount = {
|
|
1615
1762
|
upsert: props.user.sessions.map((item) => ({
|
1616
1763
|
where: {
|
1617
1764
|
id: item.id !== undefined ? item.id : undefined,
|
1765
|
+
userId: item.userId !== undefined ? {
|
1766
|
+
equals: item.userId
|
1767
|
+
} : undefined,
|
1618
1768
|
},
|
1619
1769
|
update: {
|
1620
1770
|
id: item.id !== undefined ? {
|
@@ -1637,6 +1787,9 @@ export const AlpacaAccount = {
|
|
1637
1787
|
upsert: props.user.authenticators.map((item) => ({
|
1638
1788
|
where: {
|
1639
1789
|
id: item.id !== undefined ? item.id : undefined,
|
1790
|
+
userId: item.userId !== undefined ? {
|
1791
|
+
equals: item.userId
|
1792
|
+
} : undefined,
|
1640
1793
|
},
|
1641
1794
|
update: {
|
1642
1795
|
id: item.id !== undefined ? {
|
@@ -1681,9 +1834,17 @@ export const AlpacaAccount = {
|
|
1681
1834
|
: { connectOrCreate: {
|
1682
1835
|
where: {
|
1683
1836
|
id: props.user.customer.id !== undefined ? props.user.customer.id : undefined,
|
1837
|
+
stripeCustomerId: props.user.customer.stripeCustomerId !== undefined ? props.user.customer.stripeCustomerId : undefined,
|
1838
|
+
stripeSubscriptionId: props.user.customer.stripeSubscriptionId !== undefined ? props.user.customer.stripeSubscriptionId : undefined,
|
1839
|
+
authUserId: props.user.customer.authUserId !== undefined ? {
|
1840
|
+
equals: props.user.customer.authUserId
|
1841
|
+
} : undefined,
|
1684
1842
|
name: props.user.customer.name !== undefined ? {
|
1685
1843
|
equals: props.user.customer.name
|
1686
1844
|
} : undefined,
|
1845
|
+
stripePriceId: props.user.customer.stripePriceId !== undefined ? {
|
1846
|
+
equals: props.user.customer.stripePriceId
|
1847
|
+
} : undefined,
|
1687
1848
|
},
|
1688
1849
|
create: {
|
1689
1850
|
authUserId: props.user.customer.authUserId !== undefined ? props.user.customer.authUserId : undefined,
|
@@ -1705,6 +1866,12 @@ export const AlpacaAccount = {
|
|
1705
1866
|
: { connectOrCreate: props.user.accounts.map((item) => ({
|
1706
1867
|
where: {
|
1707
1868
|
id: item.id !== undefined ? item.id : undefined,
|
1869
|
+
userId: item.userId !== undefined ? {
|
1870
|
+
equals: item.userId
|
1871
|
+
} : undefined,
|
1872
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1873
|
+
equals: item.providerAccountId
|
1874
|
+
} : undefined,
|
1708
1875
|
},
|
1709
1876
|
create: {
|
1710
1877
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -1729,6 +1896,9 @@ export const AlpacaAccount = {
|
|
1729
1896
|
: { connectOrCreate: props.user.sessions.map((item) => ({
|
1730
1897
|
where: {
|
1731
1898
|
id: item.id !== undefined ? item.id : undefined,
|
1899
|
+
userId: item.userId !== undefined ? {
|
1900
|
+
equals: item.userId
|
1901
|
+
} : undefined,
|
1732
1902
|
},
|
1733
1903
|
create: {
|
1734
1904
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -1745,6 +1915,9 @@ export const AlpacaAccount = {
|
|
1745
1915
|
: { connectOrCreate: props.user.authenticators.map((item) => ({
|
1746
1916
|
where: {
|
1747
1917
|
id: item.id !== undefined ? item.id : undefined,
|
1918
|
+
userId: item.userId !== undefined ? {
|
1919
|
+
equals: item.userId
|
1920
|
+
} : undefined,
|
1748
1921
|
},
|
1749
1922
|
create: {
|
1750
1923
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -1760,6 +1933,12 @@ export const AlpacaAccount = {
|
|
1760
1933
|
upsert: props.trades.map((item) => ({
|
1761
1934
|
where: {
|
1762
1935
|
id: item.id !== undefined ? item.id : undefined,
|
1936
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1937
|
+
equals: item.alpacaAccountId
|
1938
|
+
} : undefined,
|
1939
|
+
assetId: item.assetId !== undefined ? {
|
1940
|
+
equals: item.assetId
|
1941
|
+
} : undefined,
|
1763
1942
|
},
|
1764
1943
|
update: {
|
1765
1944
|
id: item.id !== undefined ? {
|
@@ -1984,6 +2163,15 @@ export const AlpacaAccount = {
|
|
1984
2163
|
upsert: item.asset.orders.map((item) => ({
|
1985
2164
|
where: {
|
1986
2165
|
id: item.id !== undefined ? item.id : undefined,
|
2166
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2167
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2168
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2169
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2170
|
+
equals: item.alpacaAccountId
|
2171
|
+
} : undefined,
|
2172
|
+
assetId: item.assetId !== undefined ? {
|
2173
|
+
equals: item.assetId
|
2174
|
+
} : undefined,
|
1987
2175
|
},
|
1988
2176
|
update: {
|
1989
2177
|
id: item.id !== undefined ? {
|
@@ -2086,6 +2274,12 @@ export const AlpacaAccount = {
|
|
2086
2274
|
upsert: item.asset.positions.map((item) => ({
|
2087
2275
|
where: {
|
2088
2276
|
id: item.id !== undefined ? item.id : undefined,
|
2277
|
+
assetId: item.assetId !== undefined ? {
|
2278
|
+
equals: item.assetId
|
2279
|
+
} : undefined,
|
2280
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2281
|
+
equals: item.alpacaAccountId
|
2282
|
+
} : undefined,
|
2089
2283
|
},
|
2090
2284
|
update: {
|
2091
2285
|
id: item.id !== undefined ? {
|
@@ -2153,6 +2347,12 @@ export const AlpacaAccount = {
|
|
2153
2347
|
where: {
|
2154
2348
|
id: item.id !== undefined ? item.id : undefined,
|
2155
2349
|
url: item.url !== undefined ? item.url : undefined,
|
2350
|
+
assetId: item.assetId !== undefined ? {
|
2351
|
+
equals: item.assetId
|
2352
|
+
} : undefined,
|
2353
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2354
|
+
equals: item.newsArticleId
|
2355
|
+
} : undefined,
|
2156
2356
|
},
|
2157
2357
|
update: {
|
2158
2358
|
id: item.id !== undefined ? {
|
@@ -2245,6 +2445,15 @@ export const AlpacaAccount = {
|
|
2245
2445
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
2246
2446
|
where: {
|
2247
2447
|
id: item.id !== undefined ? item.id : undefined,
|
2448
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2449
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2450
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2451
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2452
|
+
equals: item.alpacaAccountId
|
2453
|
+
} : undefined,
|
2454
|
+
assetId: item.assetId !== undefined ? {
|
2455
|
+
equals: item.assetId
|
2456
|
+
} : undefined,
|
2248
2457
|
},
|
2249
2458
|
create: {
|
2250
2459
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2281,6 +2490,12 @@ export const AlpacaAccount = {
|
|
2281
2490
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
2282
2491
|
where: {
|
2283
2492
|
id: item.id !== undefined ? item.id : undefined,
|
2493
|
+
assetId: item.assetId !== undefined ? {
|
2494
|
+
equals: item.assetId
|
2495
|
+
} : undefined,
|
2496
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2497
|
+
equals: item.alpacaAccountId
|
2498
|
+
} : undefined,
|
2284
2499
|
},
|
2285
2500
|
create: {
|
2286
2501
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2309,6 +2524,12 @@ export const AlpacaAccount = {
|
|
2309
2524
|
where: {
|
2310
2525
|
id: item.id !== undefined ? item.id : undefined,
|
2311
2526
|
url: item.url !== undefined ? item.url : undefined,
|
2527
|
+
assetId: item.assetId !== undefined ? {
|
2528
|
+
equals: item.assetId
|
2529
|
+
} : undefined,
|
2530
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2531
|
+
equals: item.newsArticleId
|
2532
|
+
} : undefined,
|
2312
2533
|
},
|
2313
2534
|
create: {
|
2314
2535
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -2325,6 +2546,9 @@ export const AlpacaAccount = {
|
|
2325
2546
|
upsert: item.actions.map((item) => ({
|
2326
2547
|
where: {
|
2327
2548
|
id: item.id !== undefined ? item.id : undefined,
|
2549
|
+
tradeId: item.tradeId !== undefined ? {
|
2550
|
+
equals: item.tradeId
|
2551
|
+
} : undefined,
|
2328
2552
|
},
|
2329
2553
|
update: {
|
2330
2554
|
id: item.id !== undefined ? {
|
@@ -2351,6 +2575,18 @@ export const AlpacaAccount = {
|
|
2351
2575
|
id: item.order.id !== undefined ? {
|
2352
2576
|
equals: item.order.id
|
2353
2577
|
} : undefined,
|
2578
|
+
clientOrderId: item.order.clientOrderId !== undefined ? {
|
2579
|
+
equals: item.order.clientOrderId
|
2580
|
+
} : undefined,
|
2581
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
2582
|
+
equals: item.order.alpacaAccountId
|
2583
|
+
} : undefined,
|
2584
|
+
assetId: item.order.assetId !== undefined ? {
|
2585
|
+
equals: item.order.assetId
|
2586
|
+
} : undefined,
|
2587
|
+
actionId: item.order.actionId !== undefined ? {
|
2588
|
+
equals: item.order.actionId
|
2589
|
+
} : undefined,
|
2354
2590
|
},
|
2355
2591
|
update: {
|
2356
2592
|
id: item.order.id !== undefined ? {
|
@@ -2465,6 +2701,15 @@ export const AlpacaAccount = {
|
|
2465
2701
|
: { connectOrCreate: {
|
2466
2702
|
where: {
|
2467
2703
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
2704
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
2705
|
+
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
2706
|
+
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
2707
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
2708
|
+
equals: item.order.alpacaAccountId
|
2709
|
+
} : undefined,
|
2710
|
+
assetId: item.order.assetId !== undefined ? {
|
2711
|
+
equals: item.order.assetId
|
2712
|
+
} : undefined,
|
2468
2713
|
},
|
2469
2714
|
create: {
|
2470
2715
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
@@ -2585,6 +2830,15 @@ export const AlpacaAccount = {
|
|
2585
2830
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
2586
2831
|
where: {
|
2587
2832
|
id: item.id !== undefined ? item.id : undefined,
|
2833
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2834
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2835
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2836
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2837
|
+
equals: item.alpacaAccountId
|
2838
|
+
} : undefined,
|
2839
|
+
assetId: item.assetId !== undefined ? {
|
2840
|
+
equals: item.assetId
|
2841
|
+
} : undefined,
|
2588
2842
|
},
|
2589
2843
|
create: {
|
2590
2844
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2621,6 +2875,12 @@ export const AlpacaAccount = {
|
|
2621
2875
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
2622
2876
|
where: {
|
2623
2877
|
id: item.id !== undefined ? item.id : undefined,
|
2878
|
+
assetId: item.assetId !== undefined ? {
|
2879
|
+
equals: item.assetId
|
2880
|
+
} : undefined,
|
2881
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2882
|
+
equals: item.alpacaAccountId
|
2883
|
+
} : undefined,
|
2624
2884
|
},
|
2625
2885
|
create: {
|
2626
2886
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2649,6 +2909,12 @@ export const AlpacaAccount = {
|
|
2649
2909
|
where: {
|
2650
2910
|
id: item.id !== undefined ? item.id : undefined,
|
2651
2911
|
url: item.url !== undefined ? item.url : undefined,
|
2912
|
+
assetId: item.assetId !== undefined ? {
|
2913
|
+
equals: item.assetId
|
2914
|
+
} : undefined,
|
2915
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
2916
|
+
equals: item.newsArticleId
|
2917
|
+
} : undefined,
|
2652
2918
|
},
|
2653
2919
|
create: {
|
2654
2920
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -2670,6 +2936,9 @@ export const AlpacaAccount = {
|
|
2670
2936
|
: { connectOrCreate: item.actions.map((item) => ({
|
2671
2937
|
where: {
|
2672
2938
|
id: item.id !== undefined ? item.id : undefined,
|
2939
|
+
tradeId: item.tradeId !== undefined ? {
|
2940
|
+
equals: item.tradeId
|
2941
|
+
} : undefined,
|
2673
2942
|
},
|
2674
2943
|
create: {
|
2675
2944
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2686,6 +2955,15 @@ export const AlpacaAccount = {
|
|
2686
2955
|
: { connectOrCreate: {
|
2687
2956
|
where: {
|
2688
2957
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
2958
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
2959
|
+
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
2960
|
+
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
2961
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
2962
|
+
equals: item.order.alpacaAccountId
|
2963
|
+
} : undefined,
|
2964
|
+
assetId: item.order.assetId !== undefined ? {
|
2965
|
+
equals: item.order.assetId
|
2966
|
+
} : undefined,
|
2689
2967
|
},
|
2690
2968
|
create: {
|
2691
2969
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
@@ -2723,6 +3001,15 @@ export const AlpacaAccount = {
|
|
2723
3001
|
upsert: props.orders.map((item) => ({
|
2724
3002
|
where: {
|
2725
3003
|
id: item.id !== undefined ? item.id : undefined,
|
3004
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
3005
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
3006
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
3007
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3008
|
+
equals: item.alpacaAccountId
|
3009
|
+
} : undefined,
|
3010
|
+
assetId: item.assetId !== undefined ? {
|
3011
|
+
equals: item.assetId
|
3012
|
+
} : undefined,
|
2726
3013
|
},
|
2727
3014
|
update: {
|
2728
3015
|
id: item.id !== undefined ? {
|
@@ -2800,6 +3087,9 @@ export const AlpacaAccount = {
|
|
2800
3087
|
id: item.stopLoss.id !== undefined ? {
|
2801
3088
|
equals: item.stopLoss.id
|
2802
3089
|
} : undefined,
|
3090
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
3091
|
+
equals: item.stopLoss.orderId
|
3092
|
+
} : undefined,
|
2803
3093
|
},
|
2804
3094
|
update: {
|
2805
3095
|
id: item.stopLoss.id !== undefined ? {
|
@@ -2824,6 +3114,9 @@ export const AlpacaAccount = {
|
|
2824
3114
|
id: item.takeProfit.id !== undefined ? {
|
2825
3115
|
equals: item.takeProfit.id
|
2826
3116
|
} : undefined,
|
3117
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
3118
|
+
equals: item.takeProfit.orderId
|
3119
|
+
} : undefined,
|
2827
3120
|
},
|
2828
3121
|
update: {
|
2829
3122
|
id: item.takeProfit.id !== undefined ? {
|
@@ -2848,6 +3141,9 @@ export const AlpacaAccount = {
|
|
2848
3141
|
id: item.action.id !== undefined ? {
|
2849
3142
|
equals: item.action.id
|
2850
3143
|
} : undefined,
|
3144
|
+
tradeId: item.action.tradeId !== undefined ? {
|
3145
|
+
equals: item.action.tradeId
|
3146
|
+
} : undefined,
|
2851
3147
|
},
|
2852
3148
|
update: {
|
2853
3149
|
id: item.action.id !== undefined ? {
|
@@ -2874,6 +3170,12 @@ export const AlpacaAccount = {
|
|
2874
3170
|
id: item.action.trade.id !== undefined ? {
|
2875
3171
|
equals: item.action.trade.id
|
2876
3172
|
} : undefined,
|
3173
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
3174
|
+
equals: item.action.trade.alpacaAccountId
|
3175
|
+
} : undefined,
|
3176
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
3177
|
+
equals: item.action.trade.assetId
|
3178
|
+
} : undefined,
|
2877
3179
|
},
|
2878
3180
|
update: {
|
2879
3181
|
id: item.action.trade.id !== undefined ? {
|
@@ -2944,6 +3246,12 @@ export const AlpacaAccount = {
|
|
2944
3246
|
: { connectOrCreate: {
|
2945
3247
|
where: {
|
2946
3248
|
id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
|
3249
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
3250
|
+
equals: item.action.trade.alpacaAccountId
|
3251
|
+
} : undefined,
|
3252
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
3253
|
+
equals: item.action.trade.assetId
|
3254
|
+
} : undefined,
|
2947
3255
|
},
|
2948
3256
|
create: {
|
2949
3257
|
qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
|
@@ -3149,6 +3457,12 @@ export const AlpacaAccount = {
|
|
3149
3457
|
upsert: item.asset.trades.map((item) => ({
|
3150
3458
|
where: {
|
3151
3459
|
id: item.id !== undefined ? item.id : undefined,
|
3460
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3461
|
+
equals: item.alpacaAccountId
|
3462
|
+
} : undefined,
|
3463
|
+
assetId: item.assetId !== undefined ? {
|
3464
|
+
equals: item.assetId
|
3465
|
+
} : undefined,
|
3152
3466
|
},
|
3153
3467
|
update: {
|
3154
3468
|
id: item.id !== undefined ? {
|
@@ -3207,6 +3521,12 @@ export const AlpacaAccount = {
|
|
3207
3521
|
upsert: item.asset.positions.map((item) => ({
|
3208
3522
|
where: {
|
3209
3523
|
id: item.id !== undefined ? item.id : undefined,
|
3524
|
+
assetId: item.assetId !== undefined ? {
|
3525
|
+
equals: item.assetId
|
3526
|
+
} : undefined,
|
3527
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3528
|
+
equals: item.alpacaAccountId
|
3529
|
+
} : undefined,
|
3210
3530
|
},
|
3211
3531
|
update: {
|
3212
3532
|
id: item.id !== undefined ? {
|
@@ -3274,6 +3594,12 @@ export const AlpacaAccount = {
|
|
3274
3594
|
where: {
|
3275
3595
|
id: item.id !== undefined ? item.id : undefined,
|
3276
3596
|
url: item.url !== undefined ? item.url : undefined,
|
3597
|
+
assetId: item.assetId !== undefined ? {
|
3598
|
+
equals: item.assetId
|
3599
|
+
} : undefined,
|
3600
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3601
|
+
equals: item.newsArticleId
|
3602
|
+
} : undefined,
|
3277
3603
|
},
|
3278
3604
|
update: {
|
3279
3605
|
id: item.id !== undefined ? {
|
@@ -3366,6 +3692,12 @@ export const AlpacaAccount = {
|
|
3366
3692
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
3367
3693
|
where: {
|
3368
3694
|
id: item.id !== undefined ? item.id : undefined,
|
3695
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3696
|
+
equals: item.alpacaAccountId
|
3697
|
+
} : undefined,
|
3698
|
+
assetId: item.assetId !== undefined ? {
|
3699
|
+
equals: item.assetId
|
3700
|
+
} : undefined,
|
3369
3701
|
},
|
3370
3702
|
create: {
|
3371
3703
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3391,6 +3723,12 @@ export const AlpacaAccount = {
|
|
3391
3723
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
3392
3724
|
where: {
|
3393
3725
|
id: item.id !== undefined ? item.id : undefined,
|
3726
|
+
assetId: item.assetId !== undefined ? {
|
3727
|
+
equals: item.assetId
|
3728
|
+
} : undefined,
|
3729
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3730
|
+
equals: item.alpacaAccountId
|
3731
|
+
} : undefined,
|
3394
3732
|
},
|
3395
3733
|
create: {
|
3396
3734
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3419,6 +3757,12 @@ export const AlpacaAccount = {
|
|
3419
3757
|
where: {
|
3420
3758
|
id: item.id !== undefined ? item.id : undefined,
|
3421
3759
|
url: item.url !== undefined ? item.url : undefined,
|
3760
|
+
assetId: item.assetId !== undefined ? {
|
3761
|
+
equals: item.assetId
|
3762
|
+
} : undefined,
|
3763
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
3764
|
+
equals: item.newsArticleId
|
3765
|
+
} : undefined,
|
3422
3766
|
},
|
3423
3767
|
create: {
|
3424
3768
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3464,6 +3808,7 @@ export const AlpacaAccount = {
|
|
3464
3808
|
: { connectOrCreate: {
|
3465
3809
|
where: {
|
3466
3810
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
3811
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
3467
3812
|
},
|
3468
3813
|
create: {
|
3469
3814
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -3480,6 +3825,7 @@ export const AlpacaAccount = {
|
|
3480
3825
|
: { connectOrCreate: {
|
3481
3826
|
where: {
|
3482
3827
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
3828
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
3483
3829
|
},
|
3484
3830
|
create: {
|
3485
3831
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -3496,6 +3842,9 @@ export const AlpacaAccount = {
|
|
3496
3842
|
: { connectOrCreate: {
|
3497
3843
|
where: {
|
3498
3844
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
3845
|
+
tradeId: item.action.tradeId !== undefined ? {
|
3846
|
+
equals: item.action.tradeId
|
3847
|
+
} : undefined,
|
3499
3848
|
},
|
3500
3849
|
create: {
|
3501
3850
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -3512,6 +3861,12 @@ export const AlpacaAccount = {
|
|
3512
3861
|
: { connectOrCreate: {
|
3513
3862
|
where: {
|
3514
3863
|
id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
|
3864
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
3865
|
+
equals: item.action.trade.alpacaAccountId
|
3866
|
+
} : undefined,
|
3867
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
3868
|
+
equals: item.action.trade.assetId
|
3869
|
+
} : undefined,
|
3515
3870
|
},
|
3516
3871
|
create: {
|
3517
3872
|
qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
|
@@ -3608,6 +3963,12 @@ export const AlpacaAccount = {
|
|
3608
3963
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
3609
3964
|
where: {
|
3610
3965
|
id: item.id !== undefined ? item.id : undefined,
|
3966
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3967
|
+
equals: item.alpacaAccountId
|
3968
|
+
} : undefined,
|
3969
|
+
assetId: item.assetId !== undefined ? {
|
3970
|
+
equals: item.assetId
|
3971
|
+
} : undefined,
|
3611
3972
|
},
|
3612
3973
|
create: {
|
3613
3974
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -3633,6 +3994,12 @@ export const AlpacaAccount = {
|
|
3633
3994
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
3634
3995
|
where: {
|
3635
3996
|
id: item.id !== undefined ? item.id : undefined,
|
3997
|
+
assetId: item.assetId !== undefined ? {
|
3998
|
+
equals: item.assetId
|
3999
|
+
} : undefined,
|
4000
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4001
|
+
equals: item.alpacaAccountId
|
4002
|
+
} : undefined,
|
3636
4003
|
},
|
3637
4004
|
create: {
|
3638
4005
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -3661,6 +4028,12 @@ export const AlpacaAccount = {
|
|
3661
4028
|
where: {
|
3662
4029
|
id: item.id !== undefined ? item.id : undefined,
|
3663
4030
|
url: item.url !== undefined ? item.url : undefined,
|
4031
|
+
assetId: item.assetId !== undefined ? {
|
4032
|
+
equals: item.assetId
|
4033
|
+
} : undefined,
|
4034
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4035
|
+
equals: item.newsArticleId
|
4036
|
+
} : undefined,
|
3664
4037
|
},
|
3665
4038
|
create: {
|
3666
4039
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -3680,6 +4053,12 @@ export const AlpacaAccount = {
|
|
3680
4053
|
upsert: props.positions.map((item) => ({
|
3681
4054
|
where: {
|
3682
4055
|
id: item.id !== undefined ? item.id : undefined,
|
4056
|
+
assetId: item.assetId !== undefined ? {
|
4057
|
+
equals: item.assetId
|
4058
|
+
} : undefined,
|
4059
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4060
|
+
equals: item.alpacaAccountId
|
4061
|
+
} : undefined,
|
3683
4062
|
},
|
3684
4063
|
update: {
|
3685
4064
|
id: item.id !== undefined ? {
|
@@ -3910,6 +4289,12 @@ export const AlpacaAccount = {
|
|
3910
4289
|
upsert: item.asset.trades.map((item) => ({
|
3911
4290
|
where: {
|
3912
4291
|
id: item.id !== undefined ? item.id : undefined,
|
4292
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4293
|
+
equals: item.alpacaAccountId
|
4294
|
+
} : undefined,
|
4295
|
+
assetId: item.assetId !== undefined ? {
|
4296
|
+
equals: item.assetId
|
4297
|
+
} : undefined,
|
3913
4298
|
},
|
3914
4299
|
update: {
|
3915
4300
|
id: item.id !== undefined ? {
|
@@ -3968,6 +4353,15 @@ export const AlpacaAccount = {
|
|
3968
4353
|
upsert: item.asset.orders.map((item) => ({
|
3969
4354
|
where: {
|
3970
4355
|
id: item.id !== undefined ? item.id : undefined,
|
4356
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4357
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4358
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4359
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4360
|
+
equals: item.alpacaAccountId
|
4361
|
+
} : undefined,
|
4362
|
+
assetId: item.assetId !== undefined ? {
|
4363
|
+
equals: item.assetId
|
4364
|
+
} : undefined,
|
3971
4365
|
},
|
3972
4366
|
update: {
|
3973
4367
|
id: item.id !== undefined ? {
|
@@ -4071,6 +4465,12 @@ export const AlpacaAccount = {
|
|
4071
4465
|
where: {
|
4072
4466
|
id: item.id !== undefined ? item.id : undefined,
|
4073
4467
|
url: item.url !== undefined ? item.url : undefined,
|
4468
|
+
assetId: item.assetId !== undefined ? {
|
4469
|
+
equals: item.assetId
|
4470
|
+
} : undefined,
|
4471
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4472
|
+
equals: item.newsArticleId
|
4473
|
+
} : undefined,
|
4074
4474
|
},
|
4075
4475
|
update: {
|
4076
4476
|
id: item.id !== undefined ? {
|
@@ -4163,6 +4563,12 @@ export const AlpacaAccount = {
|
|
4163
4563
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
4164
4564
|
where: {
|
4165
4565
|
id: item.id !== undefined ? item.id : undefined,
|
4566
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4567
|
+
equals: item.alpacaAccountId
|
4568
|
+
} : undefined,
|
4569
|
+
assetId: item.assetId !== undefined ? {
|
4570
|
+
equals: item.assetId
|
4571
|
+
} : undefined,
|
4166
4572
|
},
|
4167
4573
|
create: {
|
4168
4574
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -4188,6 +4594,15 @@ export const AlpacaAccount = {
|
|
4188
4594
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
4189
4595
|
where: {
|
4190
4596
|
id: item.id !== undefined ? item.id : undefined,
|
4597
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4598
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4599
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4600
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4601
|
+
equals: item.alpacaAccountId
|
4602
|
+
} : undefined,
|
4603
|
+
assetId: item.assetId !== undefined ? {
|
4604
|
+
equals: item.assetId
|
4605
|
+
} : undefined,
|
4191
4606
|
},
|
4192
4607
|
create: {
|
4193
4608
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4225,6 +4640,12 @@ export const AlpacaAccount = {
|
|
4225
4640
|
where: {
|
4226
4641
|
id: item.id !== undefined ? item.id : undefined,
|
4227
4642
|
url: item.url !== undefined ? item.url : undefined,
|
4643
|
+
assetId: item.assetId !== undefined ? {
|
4644
|
+
equals: item.assetId
|
4645
|
+
} : undefined,
|
4646
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4647
|
+
equals: item.newsArticleId
|
4648
|
+
} : undefined,
|
4228
4649
|
},
|
4229
4650
|
create: {
|
4230
4651
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4329,6 +4750,12 @@ export const AlpacaAccount = {
|
|
4329
4750
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
4330
4751
|
where: {
|
4331
4752
|
id: item.id !== undefined ? item.id : undefined,
|
4753
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4754
|
+
equals: item.alpacaAccountId
|
4755
|
+
} : undefined,
|
4756
|
+
assetId: item.assetId !== undefined ? {
|
4757
|
+
equals: item.assetId
|
4758
|
+
} : undefined,
|
4332
4759
|
},
|
4333
4760
|
create: {
|
4334
4761
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -4354,6 +4781,15 @@ export const AlpacaAccount = {
|
|
4354
4781
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
4355
4782
|
where: {
|
4356
4783
|
id: item.id !== undefined ? item.id : undefined,
|
4784
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4785
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4786
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4787
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4788
|
+
equals: item.alpacaAccountId
|
4789
|
+
} : undefined,
|
4790
|
+
assetId: item.assetId !== undefined ? {
|
4791
|
+
equals: item.assetId
|
4792
|
+
} : undefined,
|
4357
4793
|
},
|
4358
4794
|
create: {
|
4359
4795
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4391,6 +4827,12 @@ export const AlpacaAccount = {
|
|
4391
4827
|
where: {
|
4392
4828
|
id: item.id !== undefined ? item.id : undefined,
|
4393
4829
|
url: item.url !== undefined ? item.url : undefined,
|
4830
|
+
assetId: item.assetId !== undefined ? {
|
4831
|
+
equals: item.assetId
|
4832
|
+
} : undefined,
|
4833
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
4834
|
+
equals: item.newsArticleId
|
4835
|
+
} : undefined,
|
4394
4836
|
},
|
4395
4837
|
create: {
|
4396
4838
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -4410,6 +4852,9 @@ export const AlpacaAccount = {
|
|
4410
4852
|
upsert: props.alerts.map((item) => ({
|
4411
4853
|
where: {
|
4412
4854
|
id: item.id !== undefined ? item.id : undefined,
|
4855
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4856
|
+
equals: item.alpacaAccountId
|
4857
|
+
} : undefined,
|
4413
4858
|
},
|
4414
4859
|
update: {
|
4415
4860
|
id: item.id !== undefined ? {
|
@@ -4475,7 +4920,9 @@ export const AlpacaAccount = {
|
|
4475
4920
|
maxOrderSize: prop.maxOrderSize !== undefined ? prop.maxOrderSize : undefined,
|
4476
4921
|
minPercentageChange: prop.minPercentageChange !== undefined ? prop.minPercentageChange : undefined,
|
4477
4922
|
volumeThreshold: prop.volumeThreshold !== undefined ? prop.volumeThreshold : undefined,
|
4478
|
-
userId: prop.userId !== undefined ?
|
4923
|
+
userId: prop.userId !== undefined ? {
|
4924
|
+
equals: prop.userId
|
4925
|
+
} : undefined,
|
4479
4926
|
createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
|
4480
4927
|
updatedAt: prop.updatedAt !== undefined ? prop.updatedAt : undefined,
|
4481
4928
|
},
|
@@ -4572,9 +5019,21 @@ export const AlpacaAccount = {
|
|
4572
5019
|
id: prop.user.customer.id !== undefined ? {
|
4573
5020
|
equals: prop.user.customer.id
|
4574
5021
|
} : undefined,
|
5022
|
+
authUserId: prop.user.customer.authUserId !== undefined ? {
|
5023
|
+
equals: prop.user.customer.authUserId
|
5024
|
+
} : undefined,
|
4575
5025
|
name: prop.user.customer.name !== undefined ? {
|
4576
5026
|
equals: prop.user.customer.name
|
4577
5027
|
} : undefined,
|
5028
|
+
stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? {
|
5029
|
+
equals: prop.user.customer.stripeCustomerId
|
5030
|
+
} : undefined,
|
5031
|
+
stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? {
|
5032
|
+
equals: prop.user.customer.stripeSubscriptionId
|
5033
|
+
} : undefined,
|
5034
|
+
stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
|
5035
|
+
equals: prop.user.customer.stripePriceId
|
5036
|
+
} : undefined,
|
4578
5037
|
},
|
4579
5038
|
update: {
|
4580
5039
|
authUserId: prop.user.customer.authUserId !== undefined ? {
|
@@ -4614,6 +5073,12 @@ export const AlpacaAccount = {
|
|
4614
5073
|
upsert: prop.user.accounts.map((item) => ({
|
4615
5074
|
where: {
|
4616
5075
|
id: item.id !== undefined ? item.id : undefined,
|
5076
|
+
userId: item.userId !== undefined ? {
|
5077
|
+
equals: item.userId
|
5078
|
+
} : undefined,
|
5079
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
5080
|
+
equals: item.providerAccountId
|
5081
|
+
} : undefined,
|
4617
5082
|
},
|
4618
5083
|
update: {
|
4619
5084
|
id: item.id !== undefined ? {
|
@@ -4668,6 +5133,9 @@ export const AlpacaAccount = {
|
|
4668
5133
|
upsert: prop.user.sessions.map((item) => ({
|
4669
5134
|
where: {
|
4670
5135
|
id: item.id !== undefined ? item.id : undefined,
|
5136
|
+
userId: item.userId !== undefined ? {
|
5137
|
+
equals: item.userId
|
5138
|
+
} : undefined,
|
4671
5139
|
},
|
4672
5140
|
update: {
|
4673
5141
|
id: item.id !== undefined ? {
|
@@ -4690,6 +5158,9 @@ export const AlpacaAccount = {
|
|
4690
5158
|
upsert: prop.user.authenticators.map((item) => ({
|
4691
5159
|
where: {
|
4692
5160
|
id: item.id !== undefined ? item.id : undefined,
|
5161
|
+
userId: item.userId !== undefined ? {
|
5162
|
+
equals: item.userId
|
5163
|
+
} : undefined,
|
4693
5164
|
},
|
4694
5165
|
update: {
|
4695
5166
|
id: item.id !== undefined ? {
|
@@ -4734,9 +5205,17 @@ export const AlpacaAccount = {
|
|
4734
5205
|
: { connectOrCreate: {
|
4735
5206
|
where: {
|
4736
5207
|
id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
|
5208
|
+
stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
|
5209
|
+
stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
|
5210
|
+
authUserId: prop.user.customer.authUserId !== undefined ? {
|
5211
|
+
equals: prop.user.customer.authUserId
|
5212
|
+
} : undefined,
|
4737
5213
|
name: prop.user.customer.name !== undefined ? {
|
4738
5214
|
equals: prop.user.customer.name
|
4739
5215
|
} : undefined,
|
5216
|
+
stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
|
5217
|
+
equals: prop.user.customer.stripePriceId
|
5218
|
+
} : undefined,
|
4740
5219
|
},
|
4741
5220
|
create: {
|
4742
5221
|
authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
|
@@ -4758,6 +5237,12 @@ export const AlpacaAccount = {
|
|
4758
5237
|
: { connectOrCreate: prop.user.accounts.map((item) => ({
|
4759
5238
|
where: {
|
4760
5239
|
id: item.id !== undefined ? item.id : undefined,
|
5240
|
+
userId: item.userId !== undefined ? {
|
5241
|
+
equals: item.userId
|
5242
|
+
} : undefined,
|
5243
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
5244
|
+
equals: item.providerAccountId
|
5245
|
+
} : undefined,
|
4761
5246
|
},
|
4762
5247
|
create: {
|
4763
5248
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -4782,6 +5267,9 @@ export const AlpacaAccount = {
|
|
4782
5267
|
: { connectOrCreate: prop.user.sessions.map((item) => ({
|
4783
5268
|
where: {
|
4784
5269
|
id: item.id !== undefined ? item.id : undefined,
|
5270
|
+
userId: item.userId !== undefined ? {
|
5271
|
+
equals: item.userId
|
5272
|
+
} : undefined,
|
4785
5273
|
},
|
4786
5274
|
create: {
|
4787
5275
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -4798,6 +5286,9 @@ export const AlpacaAccount = {
|
|
4798
5286
|
: { connectOrCreate: prop.user.authenticators.map((item) => ({
|
4799
5287
|
where: {
|
4800
5288
|
id: item.id !== undefined ? item.id : undefined,
|
5289
|
+
userId: item.userId !== undefined ? {
|
5290
|
+
equals: item.userId
|
5291
|
+
} : undefined,
|
4801
5292
|
},
|
4802
5293
|
create: {
|
4803
5294
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -4813,6 +5304,12 @@ export const AlpacaAccount = {
|
|
4813
5304
|
upsert: prop.trades.map((item) => ({
|
4814
5305
|
where: {
|
4815
5306
|
id: item.id !== undefined ? item.id : undefined,
|
5307
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5308
|
+
equals: item.alpacaAccountId
|
5309
|
+
} : undefined,
|
5310
|
+
assetId: item.assetId !== undefined ? {
|
5311
|
+
equals: item.assetId
|
5312
|
+
} : undefined,
|
4816
5313
|
},
|
4817
5314
|
update: {
|
4818
5315
|
id: item.id !== undefined ? {
|
@@ -5037,6 +5534,15 @@ export const AlpacaAccount = {
|
|
5037
5534
|
upsert: item.asset.orders.map((item) => ({
|
5038
5535
|
where: {
|
5039
5536
|
id: item.id !== undefined ? item.id : undefined,
|
5537
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5538
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5539
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5540
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5541
|
+
equals: item.alpacaAccountId
|
5542
|
+
} : undefined,
|
5543
|
+
assetId: item.assetId !== undefined ? {
|
5544
|
+
equals: item.assetId
|
5545
|
+
} : undefined,
|
5040
5546
|
},
|
5041
5547
|
update: {
|
5042
5548
|
id: item.id !== undefined ? {
|
@@ -5139,6 +5645,12 @@ export const AlpacaAccount = {
|
|
5139
5645
|
upsert: item.asset.positions.map((item) => ({
|
5140
5646
|
where: {
|
5141
5647
|
id: item.id !== undefined ? item.id : undefined,
|
5648
|
+
assetId: item.assetId !== undefined ? {
|
5649
|
+
equals: item.assetId
|
5650
|
+
} : undefined,
|
5651
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5652
|
+
equals: item.alpacaAccountId
|
5653
|
+
} : undefined,
|
5142
5654
|
},
|
5143
5655
|
update: {
|
5144
5656
|
id: item.id !== undefined ? {
|
@@ -5206,6 +5718,12 @@ export const AlpacaAccount = {
|
|
5206
5718
|
where: {
|
5207
5719
|
id: item.id !== undefined ? item.id : undefined,
|
5208
5720
|
url: item.url !== undefined ? item.url : undefined,
|
5721
|
+
assetId: item.assetId !== undefined ? {
|
5722
|
+
equals: item.assetId
|
5723
|
+
} : undefined,
|
5724
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5725
|
+
equals: item.newsArticleId
|
5726
|
+
} : undefined,
|
5209
5727
|
},
|
5210
5728
|
update: {
|
5211
5729
|
id: item.id !== undefined ? {
|
@@ -5298,6 +5816,15 @@ export const AlpacaAccount = {
|
|
5298
5816
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
5299
5817
|
where: {
|
5300
5818
|
id: item.id !== undefined ? item.id : undefined,
|
5819
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5820
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5821
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5822
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5823
|
+
equals: item.alpacaAccountId
|
5824
|
+
} : undefined,
|
5825
|
+
assetId: item.assetId !== undefined ? {
|
5826
|
+
equals: item.assetId
|
5827
|
+
} : undefined,
|
5301
5828
|
},
|
5302
5829
|
create: {
|
5303
5830
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -5334,6 +5861,12 @@ export const AlpacaAccount = {
|
|
5334
5861
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
5335
5862
|
where: {
|
5336
5863
|
id: item.id !== undefined ? item.id : undefined,
|
5864
|
+
assetId: item.assetId !== undefined ? {
|
5865
|
+
equals: item.assetId
|
5866
|
+
} : undefined,
|
5867
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5868
|
+
equals: item.alpacaAccountId
|
5869
|
+
} : undefined,
|
5337
5870
|
},
|
5338
5871
|
create: {
|
5339
5872
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5362,6 +5895,12 @@ export const AlpacaAccount = {
|
|
5362
5895
|
where: {
|
5363
5896
|
id: item.id !== undefined ? item.id : undefined,
|
5364
5897
|
url: item.url !== undefined ? item.url : undefined,
|
5898
|
+
assetId: item.assetId !== undefined ? {
|
5899
|
+
equals: item.assetId
|
5900
|
+
} : undefined,
|
5901
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
5902
|
+
equals: item.newsArticleId
|
5903
|
+
} : undefined,
|
5365
5904
|
},
|
5366
5905
|
create: {
|
5367
5906
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -5378,6 +5917,9 @@ export const AlpacaAccount = {
|
|
5378
5917
|
upsert: item.actions.map((item) => ({
|
5379
5918
|
where: {
|
5380
5919
|
id: item.id !== undefined ? item.id : undefined,
|
5920
|
+
tradeId: item.tradeId !== undefined ? {
|
5921
|
+
equals: item.tradeId
|
5922
|
+
} : undefined,
|
5381
5923
|
},
|
5382
5924
|
update: {
|
5383
5925
|
id: item.id !== undefined ? {
|
@@ -5404,6 +5946,18 @@ export const AlpacaAccount = {
|
|
5404
5946
|
id: item.order.id !== undefined ? {
|
5405
5947
|
equals: item.order.id
|
5406
5948
|
} : undefined,
|
5949
|
+
clientOrderId: item.order.clientOrderId !== undefined ? {
|
5950
|
+
equals: item.order.clientOrderId
|
5951
|
+
} : undefined,
|
5952
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
5953
|
+
equals: item.order.alpacaAccountId
|
5954
|
+
} : undefined,
|
5955
|
+
assetId: item.order.assetId !== undefined ? {
|
5956
|
+
equals: item.order.assetId
|
5957
|
+
} : undefined,
|
5958
|
+
actionId: item.order.actionId !== undefined ? {
|
5959
|
+
equals: item.order.actionId
|
5960
|
+
} : undefined,
|
5407
5961
|
},
|
5408
5962
|
update: {
|
5409
5963
|
id: item.order.id !== undefined ? {
|
@@ -5518,6 +6072,15 @@ export const AlpacaAccount = {
|
|
5518
6072
|
: { connectOrCreate: {
|
5519
6073
|
where: {
|
5520
6074
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
6075
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
6076
|
+
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
6077
|
+
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
6078
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
6079
|
+
equals: item.order.alpacaAccountId
|
6080
|
+
} : undefined,
|
6081
|
+
assetId: item.order.assetId !== undefined ? {
|
6082
|
+
equals: item.order.assetId
|
6083
|
+
} : undefined,
|
5521
6084
|
},
|
5522
6085
|
create: {
|
5523
6086
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
@@ -5638,6 +6201,15 @@ export const AlpacaAccount = {
|
|
5638
6201
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
5639
6202
|
where: {
|
5640
6203
|
id: item.id !== undefined ? item.id : undefined,
|
6204
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6205
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6206
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
6207
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6208
|
+
equals: item.alpacaAccountId
|
6209
|
+
} : undefined,
|
6210
|
+
assetId: item.assetId !== undefined ? {
|
6211
|
+
equals: item.assetId
|
6212
|
+
} : undefined,
|
5641
6213
|
},
|
5642
6214
|
create: {
|
5643
6215
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -5674,6 +6246,12 @@ export const AlpacaAccount = {
|
|
5674
6246
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
5675
6247
|
where: {
|
5676
6248
|
id: item.id !== undefined ? item.id : undefined,
|
6249
|
+
assetId: item.assetId !== undefined ? {
|
6250
|
+
equals: item.assetId
|
6251
|
+
} : undefined,
|
6252
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6253
|
+
equals: item.alpacaAccountId
|
6254
|
+
} : undefined,
|
5677
6255
|
},
|
5678
6256
|
create: {
|
5679
6257
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -5702,6 +6280,12 @@ export const AlpacaAccount = {
|
|
5702
6280
|
where: {
|
5703
6281
|
id: item.id !== undefined ? item.id : undefined,
|
5704
6282
|
url: item.url !== undefined ? item.url : undefined,
|
6283
|
+
assetId: item.assetId !== undefined ? {
|
6284
|
+
equals: item.assetId
|
6285
|
+
} : undefined,
|
6286
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6287
|
+
equals: item.newsArticleId
|
6288
|
+
} : undefined,
|
5705
6289
|
},
|
5706
6290
|
create: {
|
5707
6291
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -5723,6 +6307,9 @@ export const AlpacaAccount = {
|
|
5723
6307
|
: { connectOrCreate: item.actions.map((item) => ({
|
5724
6308
|
where: {
|
5725
6309
|
id: item.id !== undefined ? item.id : undefined,
|
6310
|
+
tradeId: item.tradeId !== undefined ? {
|
6311
|
+
equals: item.tradeId
|
6312
|
+
} : undefined,
|
5726
6313
|
},
|
5727
6314
|
create: {
|
5728
6315
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -5739,6 +6326,15 @@ export const AlpacaAccount = {
|
|
5739
6326
|
: { connectOrCreate: {
|
5740
6327
|
where: {
|
5741
6328
|
id: item.order.id !== undefined ? item.order.id : undefined,
|
6329
|
+
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
6330
|
+
actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
|
6331
|
+
stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
|
6332
|
+
alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
|
6333
|
+
equals: item.order.alpacaAccountId
|
6334
|
+
} : undefined,
|
6335
|
+
assetId: item.order.assetId !== undefined ? {
|
6336
|
+
equals: item.order.assetId
|
6337
|
+
} : undefined,
|
5742
6338
|
},
|
5743
6339
|
create: {
|
5744
6340
|
clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
|
@@ -5776,6 +6372,15 @@ export const AlpacaAccount = {
|
|
5776
6372
|
upsert: prop.orders.map((item) => ({
|
5777
6373
|
where: {
|
5778
6374
|
id: item.id !== undefined ? item.id : undefined,
|
6375
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
6376
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
6377
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
6378
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6379
|
+
equals: item.alpacaAccountId
|
6380
|
+
} : undefined,
|
6381
|
+
assetId: item.assetId !== undefined ? {
|
6382
|
+
equals: item.assetId
|
6383
|
+
} : undefined,
|
5779
6384
|
},
|
5780
6385
|
update: {
|
5781
6386
|
id: item.id !== undefined ? {
|
@@ -5853,6 +6458,9 @@ export const AlpacaAccount = {
|
|
5853
6458
|
id: item.stopLoss.id !== undefined ? {
|
5854
6459
|
equals: item.stopLoss.id
|
5855
6460
|
} : undefined,
|
6461
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
6462
|
+
equals: item.stopLoss.orderId
|
6463
|
+
} : undefined,
|
5856
6464
|
},
|
5857
6465
|
update: {
|
5858
6466
|
id: item.stopLoss.id !== undefined ? {
|
@@ -5877,6 +6485,9 @@ export const AlpacaAccount = {
|
|
5877
6485
|
id: item.takeProfit.id !== undefined ? {
|
5878
6486
|
equals: item.takeProfit.id
|
5879
6487
|
} : undefined,
|
6488
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
6489
|
+
equals: item.takeProfit.orderId
|
6490
|
+
} : undefined,
|
5880
6491
|
},
|
5881
6492
|
update: {
|
5882
6493
|
id: item.takeProfit.id !== undefined ? {
|
@@ -5901,6 +6512,9 @@ export const AlpacaAccount = {
|
|
5901
6512
|
id: item.action.id !== undefined ? {
|
5902
6513
|
equals: item.action.id
|
5903
6514
|
} : undefined,
|
6515
|
+
tradeId: item.action.tradeId !== undefined ? {
|
6516
|
+
equals: item.action.tradeId
|
6517
|
+
} : undefined,
|
5904
6518
|
},
|
5905
6519
|
update: {
|
5906
6520
|
id: item.action.id !== undefined ? {
|
@@ -5927,6 +6541,12 @@ export const AlpacaAccount = {
|
|
5927
6541
|
id: item.action.trade.id !== undefined ? {
|
5928
6542
|
equals: item.action.trade.id
|
5929
6543
|
} : undefined,
|
6544
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
6545
|
+
equals: item.action.trade.alpacaAccountId
|
6546
|
+
} : undefined,
|
6547
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
6548
|
+
equals: item.action.trade.assetId
|
6549
|
+
} : undefined,
|
5930
6550
|
},
|
5931
6551
|
update: {
|
5932
6552
|
id: item.action.trade.id !== undefined ? {
|
@@ -5997,6 +6617,12 @@ export const AlpacaAccount = {
|
|
5997
6617
|
: { connectOrCreate: {
|
5998
6618
|
where: {
|
5999
6619
|
id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
|
6620
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
6621
|
+
equals: item.action.trade.alpacaAccountId
|
6622
|
+
} : undefined,
|
6623
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
6624
|
+
equals: item.action.trade.assetId
|
6625
|
+
} : undefined,
|
6000
6626
|
},
|
6001
6627
|
create: {
|
6002
6628
|
qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
|
@@ -6202,6 +6828,12 @@ export const AlpacaAccount = {
|
|
6202
6828
|
upsert: item.asset.trades.map((item) => ({
|
6203
6829
|
where: {
|
6204
6830
|
id: item.id !== undefined ? item.id : undefined,
|
6831
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6832
|
+
equals: item.alpacaAccountId
|
6833
|
+
} : undefined,
|
6834
|
+
assetId: item.assetId !== undefined ? {
|
6835
|
+
equals: item.assetId
|
6836
|
+
} : undefined,
|
6205
6837
|
},
|
6206
6838
|
update: {
|
6207
6839
|
id: item.id !== undefined ? {
|
@@ -6260,6 +6892,12 @@ export const AlpacaAccount = {
|
|
6260
6892
|
upsert: item.asset.positions.map((item) => ({
|
6261
6893
|
where: {
|
6262
6894
|
id: item.id !== undefined ? item.id : undefined,
|
6895
|
+
assetId: item.assetId !== undefined ? {
|
6896
|
+
equals: item.assetId
|
6897
|
+
} : undefined,
|
6898
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
6899
|
+
equals: item.alpacaAccountId
|
6900
|
+
} : undefined,
|
6263
6901
|
},
|
6264
6902
|
update: {
|
6265
6903
|
id: item.id !== undefined ? {
|
@@ -6327,6 +6965,12 @@ export const AlpacaAccount = {
|
|
6327
6965
|
where: {
|
6328
6966
|
id: item.id !== undefined ? item.id : undefined,
|
6329
6967
|
url: item.url !== undefined ? item.url : undefined,
|
6968
|
+
assetId: item.assetId !== undefined ? {
|
6969
|
+
equals: item.assetId
|
6970
|
+
} : undefined,
|
6971
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
6972
|
+
equals: item.newsArticleId
|
6973
|
+
} : undefined,
|
6330
6974
|
},
|
6331
6975
|
update: {
|
6332
6976
|
id: item.id !== undefined ? {
|
@@ -6419,6 +7063,12 @@ export const AlpacaAccount = {
|
|
6419
7063
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
6420
7064
|
where: {
|
6421
7065
|
id: item.id !== undefined ? item.id : undefined,
|
7066
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7067
|
+
equals: item.alpacaAccountId
|
7068
|
+
} : undefined,
|
7069
|
+
assetId: item.assetId !== undefined ? {
|
7070
|
+
equals: item.assetId
|
7071
|
+
} : undefined,
|
6422
7072
|
},
|
6423
7073
|
create: {
|
6424
7074
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -6444,6 +7094,12 @@ export const AlpacaAccount = {
|
|
6444
7094
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
6445
7095
|
where: {
|
6446
7096
|
id: item.id !== undefined ? item.id : undefined,
|
7097
|
+
assetId: item.assetId !== undefined ? {
|
7098
|
+
equals: item.assetId
|
7099
|
+
} : undefined,
|
7100
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7101
|
+
equals: item.alpacaAccountId
|
7102
|
+
} : undefined,
|
6447
7103
|
},
|
6448
7104
|
create: {
|
6449
7105
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -6472,6 +7128,12 @@ export const AlpacaAccount = {
|
|
6472
7128
|
where: {
|
6473
7129
|
id: item.id !== undefined ? item.id : undefined,
|
6474
7130
|
url: item.url !== undefined ? item.url : undefined,
|
7131
|
+
assetId: item.assetId !== undefined ? {
|
7132
|
+
equals: item.assetId
|
7133
|
+
} : undefined,
|
7134
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
7135
|
+
equals: item.newsArticleId
|
7136
|
+
} : undefined,
|
6475
7137
|
},
|
6476
7138
|
create: {
|
6477
7139
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -6517,6 +7179,7 @@ export const AlpacaAccount = {
|
|
6517
7179
|
: { connectOrCreate: {
|
6518
7180
|
where: {
|
6519
7181
|
id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
|
7182
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
6520
7183
|
},
|
6521
7184
|
create: {
|
6522
7185
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -6533,6 +7196,7 @@ export const AlpacaAccount = {
|
|
6533
7196
|
: { connectOrCreate: {
|
6534
7197
|
where: {
|
6535
7198
|
id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
|
7199
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
6536
7200
|
},
|
6537
7201
|
create: {
|
6538
7202
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -6549,6 +7213,9 @@ export const AlpacaAccount = {
|
|
6549
7213
|
: { connectOrCreate: {
|
6550
7214
|
where: {
|
6551
7215
|
id: item.action.id !== undefined ? item.action.id : undefined,
|
7216
|
+
tradeId: item.action.tradeId !== undefined ? {
|
7217
|
+
equals: item.action.tradeId
|
7218
|
+
} : undefined,
|
6552
7219
|
},
|
6553
7220
|
create: {
|
6554
7221
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -6565,6 +7232,12 @@ export const AlpacaAccount = {
|
|
6565
7232
|
: { connectOrCreate: {
|
6566
7233
|
where: {
|
6567
7234
|
id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
|
7235
|
+
alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
|
7236
|
+
equals: item.action.trade.alpacaAccountId
|
7237
|
+
} : undefined,
|
7238
|
+
assetId: item.action.trade.assetId !== undefined ? {
|
7239
|
+
equals: item.action.trade.assetId
|
7240
|
+
} : undefined,
|
6568
7241
|
},
|
6569
7242
|
create: {
|
6570
7243
|
qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
|
@@ -6661,6 +7334,12 @@ export const AlpacaAccount = {
|
|
6661
7334
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
6662
7335
|
where: {
|
6663
7336
|
id: item.id !== undefined ? item.id : undefined,
|
7337
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7338
|
+
equals: item.alpacaAccountId
|
7339
|
+
} : undefined,
|
7340
|
+
assetId: item.assetId !== undefined ? {
|
7341
|
+
equals: item.assetId
|
7342
|
+
} : undefined,
|
6664
7343
|
},
|
6665
7344
|
create: {
|
6666
7345
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -6686,6 +7365,12 @@ export const AlpacaAccount = {
|
|
6686
7365
|
: { connectOrCreate: item.asset.positions.map((item) => ({
|
6687
7366
|
where: {
|
6688
7367
|
id: item.id !== undefined ? item.id : undefined,
|
7368
|
+
assetId: item.assetId !== undefined ? {
|
7369
|
+
equals: item.assetId
|
7370
|
+
} : undefined,
|
7371
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7372
|
+
equals: item.alpacaAccountId
|
7373
|
+
} : undefined,
|
6689
7374
|
},
|
6690
7375
|
create: {
|
6691
7376
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -6714,6 +7399,12 @@ export const AlpacaAccount = {
|
|
6714
7399
|
where: {
|
6715
7400
|
id: item.id !== undefined ? item.id : undefined,
|
6716
7401
|
url: item.url !== undefined ? item.url : undefined,
|
7402
|
+
assetId: item.assetId !== undefined ? {
|
7403
|
+
equals: item.assetId
|
7404
|
+
} : undefined,
|
7405
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
7406
|
+
equals: item.newsArticleId
|
7407
|
+
} : undefined,
|
6717
7408
|
},
|
6718
7409
|
create: {
|
6719
7410
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -6733,6 +7424,12 @@ export const AlpacaAccount = {
|
|
6733
7424
|
upsert: prop.positions.map((item) => ({
|
6734
7425
|
where: {
|
6735
7426
|
id: item.id !== undefined ? item.id : undefined,
|
7427
|
+
assetId: item.assetId !== undefined ? {
|
7428
|
+
equals: item.assetId
|
7429
|
+
} : undefined,
|
7430
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7431
|
+
equals: item.alpacaAccountId
|
7432
|
+
} : undefined,
|
6736
7433
|
},
|
6737
7434
|
update: {
|
6738
7435
|
id: item.id !== undefined ? {
|
@@ -6963,6 +7660,12 @@ export const AlpacaAccount = {
|
|
6963
7660
|
upsert: item.asset.trades.map((item) => ({
|
6964
7661
|
where: {
|
6965
7662
|
id: item.id !== undefined ? item.id : undefined,
|
7663
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7664
|
+
equals: item.alpacaAccountId
|
7665
|
+
} : undefined,
|
7666
|
+
assetId: item.assetId !== undefined ? {
|
7667
|
+
equals: item.assetId
|
7668
|
+
} : undefined,
|
6966
7669
|
},
|
6967
7670
|
update: {
|
6968
7671
|
id: item.id !== undefined ? {
|
@@ -7021,6 +7724,15 @@ export const AlpacaAccount = {
|
|
7021
7724
|
upsert: item.asset.orders.map((item) => ({
|
7022
7725
|
where: {
|
7023
7726
|
id: item.id !== undefined ? item.id : undefined,
|
7727
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7728
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7729
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
7730
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7731
|
+
equals: item.alpacaAccountId
|
7732
|
+
} : undefined,
|
7733
|
+
assetId: item.assetId !== undefined ? {
|
7734
|
+
equals: item.assetId
|
7735
|
+
} : undefined,
|
7024
7736
|
},
|
7025
7737
|
update: {
|
7026
7738
|
id: item.id !== undefined ? {
|
@@ -7124,6 +7836,12 @@ export const AlpacaAccount = {
|
|
7124
7836
|
where: {
|
7125
7837
|
id: item.id !== undefined ? item.id : undefined,
|
7126
7838
|
url: item.url !== undefined ? item.url : undefined,
|
7839
|
+
assetId: item.assetId !== undefined ? {
|
7840
|
+
equals: item.assetId
|
7841
|
+
} : undefined,
|
7842
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
7843
|
+
equals: item.newsArticleId
|
7844
|
+
} : undefined,
|
7127
7845
|
},
|
7128
7846
|
update: {
|
7129
7847
|
id: item.id !== undefined ? {
|
@@ -7216,6 +7934,12 @@ export const AlpacaAccount = {
|
|
7216
7934
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
7217
7935
|
where: {
|
7218
7936
|
id: item.id !== undefined ? item.id : undefined,
|
7937
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7938
|
+
equals: item.alpacaAccountId
|
7939
|
+
} : undefined,
|
7940
|
+
assetId: item.assetId !== undefined ? {
|
7941
|
+
equals: item.assetId
|
7942
|
+
} : undefined,
|
7219
7943
|
},
|
7220
7944
|
create: {
|
7221
7945
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -7241,6 +7965,15 @@ export const AlpacaAccount = {
|
|
7241
7965
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
7242
7966
|
where: {
|
7243
7967
|
id: item.id !== undefined ? item.id : undefined,
|
7968
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
7969
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
7970
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
7971
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
7972
|
+
equals: item.alpacaAccountId
|
7973
|
+
} : undefined,
|
7974
|
+
assetId: item.assetId !== undefined ? {
|
7975
|
+
equals: item.assetId
|
7976
|
+
} : undefined,
|
7244
7977
|
},
|
7245
7978
|
create: {
|
7246
7979
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -7278,6 +8011,12 @@ export const AlpacaAccount = {
|
|
7278
8011
|
where: {
|
7279
8012
|
id: item.id !== undefined ? item.id : undefined,
|
7280
8013
|
url: item.url !== undefined ? item.url : undefined,
|
8014
|
+
assetId: item.assetId !== undefined ? {
|
8015
|
+
equals: item.assetId
|
8016
|
+
} : undefined,
|
8017
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
8018
|
+
equals: item.newsArticleId
|
8019
|
+
} : undefined,
|
7281
8020
|
},
|
7282
8021
|
create: {
|
7283
8022
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -7382,6 +8121,12 @@ export const AlpacaAccount = {
|
|
7382
8121
|
: { connectOrCreate: item.asset.trades.map((item) => ({
|
7383
8122
|
where: {
|
7384
8123
|
id: item.id !== undefined ? item.id : undefined,
|
8124
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
8125
|
+
equals: item.alpacaAccountId
|
8126
|
+
} : undefined,
|
8127
|
+
assetId: item.assetId !== undefined ? {
|
8128
|
+
equals: item.assetId
|
8129
|
+
} : undefined,
|
7385
8130
|
},
|
7386
8131
|
create: {
|
7387
8132
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -7407,6 +8152,15 @@ export const AlpacaAccount = {
|
|
7407
8152
|
: { connectOrCreate: item.asset.orders.map((item) => ({
|
7408
8153
|
where: {
|
7409
8154
|
id: item.id !== undefined ? item.id : undefined,
|
8155
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
8156
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
8157
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
8158
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
8159
|
+
equals: item.alpacaAccountId
|
8160
|
+
} : undefined,
|
8161
|
+
assetId: item.assetId !== undefined ? {
|
8162
|
+
equals: item.assetId
|
8163
|
+
} : undefined,
|
7410
8164
|
},
|
7411
8165
|
create: {
|
7412
8166
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -7444,6 +8198,12 @@ export const AlpacaAccount = {
|
|
7444
8198
|
where: {
|
7445
8199
|
id: item.id !== undefined ? item.id : undefined,
|
7446
8200
|
url: item.url !== undefined ? item.url : undefined,
|
8201
|
+
assetId: item.assetId !== undefined ? {
|
8202
|
+
equals: item.assetId
|
8203
|
+
} : undefined,
|
8204
|
+
newsArticleId: item.newsArticleId !== undefined ? {
|
8205
|
+
equals: item.newsArticleId
|
8206
|
+
} : undefined,
|
7447
8207
|
},
|
7448
8208
|
create: {
|
7449
8209
|
url: item.url !== undefined ? item.url : undefined,
|
@@ -7463,6 +8223,9 @@ export const AlpacaAccount = {
|
|
7463
8223
|
upsert: prop.alerts.map((item) => ({
|
7464
8224
|
where: {
|
7465
8225
|
id: item.id !== undefined ? item.id : undefined,
|
8226
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
8227
|
+
equals: item.alpacaAccountId
|
8228
|
+
} : undefined,
|
7466
8229
|
},
|
7467
8230
|
update: {
|
7468
8231
|
id: item.id !== undefined ? {
|
@@ -7563,7 +8326,9 @@ export const AlpacaAccount = {
|
|
7563
8326
|
maxOrderSize: props.maxOrderSize !== undefined ? props.maxOrderSize : undefined,
|
7564
8327
|
minPercentageChange: props.minPercentageChange !== undefined ? props.minPercentageChange : undefined,
|
7565
8328
|
volumeThreshold: props.volumeThreshold !== undefined ? props.volumeThreshold : undefined,
|
7566
|
-
userId: props.userId !== undefined ?
|
8329
|
+
userId: props.userId !== undefined ? {
|
8330
|
+
equals: props.userId
|
8331
|
+
} : undefined,
|
7567
8332
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
7568
8333
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|
7569
8334
|
},
|
@@ -7639,7 +8404,9 @@ export const AlpacaAccount = {
|
|
7639
8404
|
maxOrderSize: props.maxOrderSize !== undefined ? props.maxOrderSize : undefined,
|
7640
8405
|
minPercentageChange: props.minPercentageChange !== undefined ? props.minPercentageChange : undefined,
|
7641
8406
|
volumeThreshold: props.volumeThreshold !== undefined ? props.volumeThreshold : undefined,
|
7642
|
-
userId: props.userId !== undefined ?
|
8407
|
+
userId: props.userId !== undefined ? {
|
8408
|
+
equals: props.userId
|
8409
|
+
} : undefined,
|
7643
8410
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
7644
8411
|
updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
|
7645
8412
|
},
|