adaptic-backend 1.0.159 → 1.0.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Account.cjs +435 -58
- package/Action.cjs +966 -121
- package/Alert.cjs +593 -89
- package/AlpacaAccount.cjs +1161 -134
- package/Asset.cjs +1029 -129
- package/Authenticator.cjs +438 -54
- package/Customer.cjs +435 -64
- package/EconomicEvent.cjs +9 -3
- package/NewsArticle.cjs +255 -30
- package/NewsArticleAssetSentiment.cjs +427 -65
- package/Order.cjs +867 -129
- package/Position.cjs +945 -141
- package/Session.cjs +438 -54
- package/StopLoss.cjs +552 -69
- package/TakeProfit.cjs +552 -69
- package/Trade.cjs +1042 -153
- package/User.cjs +480 -73
- package/VerificationToken.cjs +9 -3
- package/package.json +1 -1
- package/server/Account.d.ts.map +1 -1
- package/server/Account.js.map +1 -1
- package/server/Account.mjs +435 -58
- package/server/Action.d.ts.map +1 -1
- package/server/Action.js.map +1 -1
- package/server/Action.mjs +966 -121
- package/server/Alert.d.ts.map +1 -1
- package/server/Alert.js.map +1 -1
- package/server/Alert.mjs +593 -89
- package/server/AlpacaAccount.d.ts.map +1 -1
- package/server/AlpacaAccount.js.map +1 -1
- package/server/AlpacaAccount.mjs +1161 -134
- package/server/Asset.d.ts.map +1 -1
- package/server/Asset.js.map +1 -1
- package/server/Asset.mjs +1029 -129
- package/server/Authenticator.d.ts.map +1 -1
- package/server/Authenticator.js.map +1 -1
- package/server/Authenticator.mjs +438 -54
- package/server/Customer.d.ts.map +1 -1
- package/server/Customer.js.map +1 -1
- package/server/Customer.mjs +435 -64
- package/server/EconomicEvent.d.ts.map +1 -1
- package/server/EconomicEvent.js.map +1 -1
- package/server/EconomicEvent.mjs +9 -3
- package/server/NewsArticle.d.ts.map +1 -1
- package/server/NewsArticle.js.map +1 -1
- package/server/NewsArticle.mjs +255 -30
- package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/NewsArticleAssetSentiment.js.map +1 -1
- package/server/NewsArticleAssetSentiment.mjs +427 -65
- package/server/Order.d.ts.map +1 -1
- package/server/Order.js.map +1 -1
- package/server/Order.mjs +867 -129
- package/server/Position.d.ts.map +1 -1
- package/server/Position.js.map +1 -1
- package/server/Position.mjs +945 -141
- package/server/Session.d.ts.map +1 -1
- package/server/Session.js.map +1 -1
- package/server/Session.mjs +438 -54
- package/server/StopLoss.d.ts.map +1 -1
- package/server/StopLoss.js.map +1 -1
- package/server/StopLoss.mjs +552 -69
- package/server/TakeProfit.d.ts.map +1 -1
- package/server/TakeProfit.js.map +1 -1
- package/server/TakeProfit.mjs +552 -69
- package/server/Trade.d.ts.map +1 -1
- package/server/Trade.js.map +1 -1
- package/server/Trade.mjs +1042 -153
- package/server/User.d.ts.map +1 -1
- package/server/User.js.map +1 -1
- package/server/User.mjs +480 -73
- package/server/VerificationToken.d.ts.map +1 -1
- package/server/VerificationToken.js.map +1 -1
- package/server/VerificationToken.mjs +9 -3
package/server/Alert.mjs
CHANGED
@@ -44,7 +44,12 @@ export const Alert = {
|
|
44
44
|
}
|
45
45
|
: { connectOrCreate: {
|
46
46
|
where: {
|
47
|
-
id: props.alpacaAccount.id !== undefined ?
|
47
|
+
id: props.alpacaAccount.id !== undefined ? {
|
48
|
+
equals: props.alpacaAccount.id
|
49
|
+
} : undefined,
|
50
|
+
userId: props.alpacaAccount.userId !== undefined ? {
|
51
|
+
equals: props.alpacaAccount.userId
|
52
|
+
} : undefined,
|
48
53
|
},
|
49
54
|
create: {
|
50
55
|
type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
|
@@ -64,7 +69,9 @@ export const Alert = {
|
|
64
69
|
}
|
65
70
|
: { connectOrCreate: {
|
66
71
|
where: {
|
67
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
72
|
+
id: props.alpacaAccount.user.id !== undefined ? {
|
73
|
+
equals: props.alpacaAccount.user.id
|
74
|
+
} : undefined,
|
68
75
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
69
76
|
name: props.alpacaAccount.user.name !== undefined ? {
|
70
77
|
equals: props.alpacaAccount.user.name
|
@@ -90,10 +97,20 @@ export const Alert = {
|
|
90
97
|
}
|
91
98
|
: { connectOrCreate: {
|
92
99
|
where: {
|
93
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
100
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
101
|
+
equals: props.alpacaAccount.user.customer.id
|
102
|
+
} : undefined,
|
103
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
104
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
105
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
106
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
107
|
+
} : undefined,
|
94
108
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
95
109
|
equals: props.alpacaAccount.user.customer.name
|
96
110
|
} : undefined,
|
111
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
112
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
113
|
+
} : undefined,
|
97
114
|
},
|
98
115
|
create: {
|
99
116
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -114,7 +131,15 @@ export const Alert = {
|
|
114
131
|
}
|
115
132
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
116
133
|
where: {
|
117
|
-
id: item.id !== undefined ?
|
134
|
+
id: item.id !== undefined ? {
|
135
|
+
equals: item.id
|
136
|
+
} : undefined,
|
137
|
+
userId: item.userId !== undefined ? {
|
138
|
+
equals: item.userId
|
139
|
+
} : undefined,
|
140
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
141
|
+
equals: item.providerAccountId
|
142
|
+
} : undefined,
|
118
143
|
},
|
119
144
|
create: {
|
120
145
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -138,7 +163,12 @@ export const Alert = {
|
|
138
163
|
}
|
139
164
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
140
165
|
where: {
|
141
|
-
id: item.id !== undefined ?
|
166
|
+
id: item.id !== undefined ? {
|
167
|
+
equals: item.id
|
168
|
+
} : undefined,
|
169
|
+
userId: item.userId !== undefined ? {
|
170
|
+
equals: item.userId
|
171
|
+
} : undefined,
|
142
172
|
},
|
143
173
|
create: {
|
144
174
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -154,7 +184,12 @@ export const Alert = {
|
|
154
184
|
}
|
155
185
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
156
186
|
where: {
|
157
|
-
id: item.id !== undefined ?
|
187
|
+
id: item.id !== undefined ? {
|
188
|
+
equals: item.id
|
189
|
+
} : undefined,
|
190
|
+
userId: item.userId !== undefined ? {
|
191
|
+
equals: item.userId
|
192
|
+
} : undefined,
|
158
193
|
},
|
159
194
|
create: {
|
160
195
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -174,7 +209,15 @@ export const Alert = {
|
|
174
209
|
}
|
175
210
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
176
211
|
where: {
|
177
|
-
id: item.id !== undefined ?
|
212
|
+
id: item.id !== undefined ? {
|
213
|
+
equals: item.id
|
214
|
+
} : undefined,
|
215
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
216
|
+
equals: item.alpacaAccountId
|
217
|
+
} : undefined,
|
218
|
+
assetId: item.assetId !== undefined ? {
|
219
|
+
equals: item.assetId
|
220
|
+
} : undefined,
|
178
221
|
},
|
179
222
|
create: {
|
180
223
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -196,7 +239,9 @@ export const Alert = {
|
|
196
239
|
}
|
197
240
|
: { connectOrCreate: {
|
198
241
|
where: {
|
199
|
-
id: item.asset.id !== undefined ?
|
242
|
+
id: item.asset.id !== undefined ? {
|
243
|
+
equals: item.asset.id
|
244
|
+
} : undefined,
|
200
245
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
201
246
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
202
247
|
},
|
@@ -267,7 +312,12 @@ export const Alert = {
|
|
267
312
|
}
|
268
313
|
: { connectOrCreate: item.actions.map((item) => ({
|
269
314
|
where: {
|
270
|
-
id: item.id !== undefined ?
|
315
|
+
id: item.id !== undefined ? {
|
316
|
+
equals: item.id
|
317
|
+
} : undefined,
|
318
|
+
tradeId: item.tradeId !== undefined ? {
|
319
|
+
equals: item.tradeId
|
320
|
+
} : undefined,
|
271
321
|
},
|
272
322
|
create: {
|
273
323
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -289,7 +339,18 @@ export const Alert = {
|
|
289
339
|
}
|
290
340
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
291
341
|
where: {
|
292
|
-
id: item.id !== undefined ?
|
342
|
+
id: item.id !== undefined ? {
|
343
|
+
equals: item.id
|
344
|
+
} : undefined,
|
345
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
346
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
347
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
348
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
349
|
+
equals: item.alpacaAccountId
|
350
|
+
} : undefined,
|
351
|
+
assetId: item.assetId !== undefined ? {
|
352
|
+
equals: item.assetId
|
353
|
+
} : undefined,
|
293
354
|
},
|
294
355
|
create: {
|
295
356
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -322,7 +383,10 @@ export const Alert = {
|
|
322
383
|
}
|
323
384
|
: { connectOrCreate: {
|
324
385
|
where: {
|
325
|
-
id: item.stopLoss.id !== undefined ?
|
386
|
+
id: item.stopLoss.id !== undefined ? {
|
387
|
+
equals: item.stopLoss.id
|
388
|
+
} : undefined,
|
389
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
326
390
|
},
|
327
391
|
create: {
|
328
392
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -338,7 +402,10 @@ export const Alert = {
|
|
338
402
|
}
|
339
403
|
: { connectOrCreate: {
|
340
404
|
where: {
|
341
|
-
id: item.takeProfit.id !== undefined ?
|
405
|
+
id: item.takeProfit.id !== undefined ? {
|
406
|
+
equals: item.takeProfit.id
|
407
|
+
} : undefined,
|
408
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
342
409
|
},
|
343
410
|
create: {
|
344
411
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -354,7 +421,12 @@ export const Alert = {
|
|
354
421
|
}
|
355
422
|
: { connectOrCreate: {
|
356
423
|
where: {
|
357
|
-
id: item.action.id !== undefined ?
|
424
|
+
id: item.action.id !== undefined ? {
|
425
|
+
equals: item.action.id
|
426
|
+
} : undefined,
|
427
|
+
tradeId: item.action.tradeId !== undefined ? {
|
428
|
+
equals: item.action.tradeId
|
429
|
+
} : undefined,
|
358
430
|
},
|
359
431
|
create: {
|
360
432
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -373,7 +445,9 @@ export const Alert = {
|
|
373
445
|
}
|
374
446
|
: { connectOrCreate: {
|
375
447
|
where: {
|
376
|
-
id: item.asset.id !== undefined ?
|
448
|
+
id: item.asset.id !== undefined ? {
|
449
|
+
equals: item.asset.id
|
450
|
+
} : undefined,
|
377
451
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
378
452
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
379
453
|
},
|
@@ -447,7 +521,15 @@ export const Alert = {
|
|
447
521
|
}
|
448
522
|
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
449
523
|
where: {
|
450
|
-
id: item.id !== undefined ?
|
524
|
+
id: item.id !== undefined ? {
|
525
|
+
equals: item.id
|
526
|
+
} : undefined,
|
527
|
+
assetId: item.assetId !== undefined ? {
|
528
|
+
equals: item.assetId
|
529
|
+
} : undefined,
|
530
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
531
|
+
equals: item.alpacaAccountId
|
532
|
+
} : undefined,
|
451
533
|
},
|
452
534
|
create: {
|
453
535
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -471,7 +553,9 @@ export const Alert = {
|
|
471
553
|
}
|
472
554
|
: { connectOrCreate: {
|
473
555
|
where: {
|
474
|
-
id: item.asset.id !== undefined ?
|
556
|
+
id: item.asset.id !== undefined ? {
|
557
|
+
equals: item.asset.id
|
558
|
+
} : undefined,
|
475
559
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
476
560
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
477
561
|
},
|
@@ -612,8 +696,12 @@ export const Alert = {
|
|
612
696
|
}`;
|
613
697
|
const variables = {
|
614
698
|
where: {
|
615
|
-
id: props.id !== undefined ?
|
616
|
-
|
699
|
+
id: props.id !== undefined ? {
|
700
|
+
equals: props.id
|
701
|
+
} : undefined,
|
702
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
703
|
+
equals: props.alpacaAccountId
|
704
|
+
} : undefined,
|
617
705
|
message: props.message !== undefined ? props.message : undefined,
|
618
706
|
type: props.type !== undefined ? props.type : undefined,
|
619
707
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
@@ -644,6 +732,9 @@ export const Alert = {
|
|
644
732
|
id: props.alpacaAccount.id !== undefined ? {
|
645
733
|
equals: props.alpacaAccount.id
|
646
734
|
} : undefined,
|
735
|
+
userId: props.alpacaAccount.userId !== undefined ? {
|
736
|
+
equals: props.alpacaAccount.userId
|
737
|
+
} : undefined,
|
647
738
|
},
|
648
739
|
update: {
|
649
740
|
id: props.alpacaAccount.id !== undefined ? {
|
@@ -732,9 +823,21 @@ export const Alert = {
|
|
732
823
|
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
733
824
|
equals: props.alpacaAccount.user.customer.id
|
734
825
|
} : undefined,
|
826
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
827
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
828
|
+
} : undefined,
|
735
829
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
736
830
|
equals: props.alpacaAccount.user.customer.name
|
737
831
|
} : undefined,
|
832
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
|
833
|
+
equals: props.alpacaAccount.user.customer.stripeCustomerId
|
834
|
+
} : undefined,
|
835
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
|
836
|
+
equals: props.alpacaAccount.user.customer.stripeSubscriptionId
|
837
|
+
} : undefined,
|
838
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
839
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
840
|
+
} : undefined,
|
738
841
|
},
|
739
842
|
update: {
|
740
843
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -773,7 +876,15 @@ export const Alert = {
|
|
773
876
|
accounts: props.alpacaAccount.user.accounts ? {
|
774
877
|
upsert: props.alpacaAccount.user.accounts.map((item) => ({
|
775
878
|
where: {
|
776
|
-
id: item.id !== undefined ?
|
879
|
+
id: item.id !== undefined ? {
|
880
|
+
equals: item.id
|
881
|
+
} : undefined,
|
882
|
+
userId: item.userId !== undefined ? {
|
883
|
+
equals: item.userId
|
884
|
+
} : undefined,
|
885
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
886
|
+
equals: item.providerAccountId
|
887
|
+
} : undefined,
|
777
888
|
},
|
778
889
|
update: {
|
779
890
|
id: item.id !== undefined ? {
|
@@ -827,7 +938,12 @@ export const Alert = {
|
|
827
938
|
sessions: props.alpacaAccount.user.sessions ? {
|
828
939
|
upsert: props.alpacaAccount.user.sessions.map((item) => ({
|
829
940
|
where: {
|
830
|
-
id: item.id !== undefined ?
|
941
|
+
id: item.id !== undefined ? {
|
942
|
+
equals: item.id
|
943
|
+
} : undefined,
|
944
|
+
userId: item.userId !== undefined ? {
|
945
|
+
equals: item.userId
|
946
|
+
} : undefined,
|
831
947
|
},
|
832
948
|
update: {
|
833
949
|
id: item.id !== undefined ? {
|
@@ -849,7 +965,12 @@ export const Alert = {
|
|
849
965
|
authenticators: props.alpacaAccount.user.authenticators ? {
|
850
966
|
upsert: props.alpacaAccount.user.authenticators.map((item) => ({
|
851
967
|
where: {
|
852
|
-
id: item.id !== undefined ?
|
968
|
+
id: item.id !== undefined ? {
|
969
|
+
equals: item.id
|
970
|
+
} : undefined,
|
971
|
+
userId: item.userId !== undefined ? {
|
972
|
+
equals: item.userId
|
973
|
+
} : undefined,
|
853
974
|
},
|
854
975
|
update: {
|
855
976
|
id: item.id !== undefined ? {
|
@@ -893,10 +1014,20 @@ export const Alert = {
|
|
893
1014
|
}
|
894
1015
|
: { connectOrCreate: {
|
895
1016
|
where: {
|
896
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
1017
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
1018
|
+
equals: props.alpacaAccount.user.customer.id
|
1019
|
+
} : undefined,
|
1020
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
1021
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
1022
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
1023
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
1024
|
+
} : undefined,
|
897
1025
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
898
1026
|
equals: props.alpacaAccount.user.customer.name
|
899
1027
|
} : undefined,
|
1028
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
1029
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
1030
|
+
} : undefined,
|
900
1031
|
},
|
901
1032
|
create: {
|
902
1033
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -917,7 +1048,15 @@ export const Alert = {
|
|
917
1048
|
}
|
918
1049
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
919
1050
|
where: {
|
920
|
-
id: item.id !== undefined ?
|
1051
|
+
id: item.id !== undefined ? {
|
1052
|
+
equals: item.id
|
1053
|
+
} : undefined,
|
1054
|
+
userId: item.userId !== undefined ? {
|
1055
|
+
equals: item.userId
|
1056
|
+
} : undefined,
|
1057
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
1058
|
+
equals: item.providerAccountId
|
1059
|
+
} : undefined,
|
921
1060
|
},
|
922
1061
|
create: {
|
923
1062
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -941,7 +1080,12 @@ export const Alert = {
|
|
941
1080
|
}
|
942
1081
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
943
1082
|
where: {
|
944
|
-
id: item.id !== undefined ?
|
1083
|
+
id: item.id !== undefined ? {
|
1084
|
+
equals: item.id
|
1085
|
+
} : undefined,
|
1086
|
+
userId: item.userId !== undefined ? {
|
1087
|
+
equals: item.userId
|
1088
|
+
} : undefined,
|
945
1089
|
},
|
946
1090
|
create: {
|
947
1091
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -957,7 +1101,12 @@ export const Alert = {
|
|
957
1101
|
}
|
958
1102
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
959
1103
|
where: {
|
960
|
-
id: item.id !== undefined ?
|
1104
|
+
id: item.id !== undefined ? {
|
1105
|
+
equals: item.id
|
1106
|
+
} : undefined,
|
1107
|
+
userId: item.userId !== undefined ? {
|
1108
|
+
equals: item.userId
|
1109
|
+
} : undefined,
|
961
1110
|
},
|
962
1111
|
create: {
|
963
1112
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -972,7 +1121,15 @@ export const Alert = {
|
|
972
1121
|
trades: props.alpacaAccount.trades ? {
|
973
1122
|
upsert: props.alpacaAccount.trades.map((item) => ({
|
974
1123
|
where: {
|
975
|
-
id: item.id !== undefined ?
|
1124
|
+
id: item.id !== undefined ? {
|
1125
|
+
equals: item.id
|
1126
|
+
} : undefined,
|
1127
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1128
|
+
equals: item.alpacaAccountId
|
1129
|
+
} : undefined,
|
1130
|
+
assetId: item.assetId !== undefined ? {
|
1131
|
+
equals: item.assetId
|
1132
|
+
} : undefined,
|
976
1133
|
},
|
977
1134
|
update: {
|
978
1135
|
id: item.id !== undefined ? {
|
@@ -1256,7 +1413,12 @@ export const Alert = {
|
|
1256
1413
|
actions: item.actions ? {
|
1257
1414
|
upsert: item.actions.map((item) => ({
|
1258
1415
|
where: {
|
1259
|
-
id: item.id !== undefined ?
|
1416
|
+
id: item.id !== undefined ? {
|
1417
|
+
equals: item.id
|
1418
|
+
} : undefined,
|
1419
|
+
tradeId: item.tradeId !== undefined ? {
|
1420
|
+
equals: item.tradeId
|
1421
|
+
} : undefined,
|
1260
1422
|
},
|
1261
1423
|
update: {
|
1262
1424
|
id: item.id !== undefined ? {
|
@@ -1308,7 +1470,9 @@ export const Alert = {
|
|
1308
1470
|
}
|
1309
1471
|
: { connectOrCreate: {
|
1310
1472
|
where: {
|
1311
|
-
id: item.asset.id !== undefined ?
|
1473
|
+
id: item.asset.id !== undefined ? {
|
1474
|
+
equals: item.asset.id
|
1475
|
+
} : undefined,
|
1312
1476
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
1313
1477
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
1314
1478
|
},
|
@@ -1379,7 +1543,12 @@ export const Alert = {
|
|
1379
1543
|
}
|
1380
1544
|
: { connectOrCreate: item.actions.map((item) => ({
|
1381
1545
|
where: {
|
1382
|
-
id: item.id !== undefined ?
|
1546
|
+
id: item.id !== undefined ? {
|
1547
|
+
equals: item.id
|
1548
|
+
} : undefined,
|
1549
|
+
tradeId: item.tradeId !== undefined ? {
|
1550
|
+
equals: item.tradeId
|
1551
|
+
} : undefined,
|
1383
1552
|
},
|
1384
1553
|
create: {
|
1385
1554
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -1396,7 +1565,18 @@ export const Alert = {
|
|
1396
1565
|
orders: props.alpacaAccount.orders ? {
|
1397
1566
|
upsert: props.alpacaAccount.orders.map((item) => ({
|
1398
1567
|
where: {
|
1399
|
-
id: item.id !== undefined ?
|
1568
|
+
id: item.id !== undefined ? {
|
1569
|
+
equals: item.id
|
1570
|
+
} : undefined,
|
1571
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
1572
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
1573
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
1574
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
1575
|
+
equals: item.alpacaAccountId
|
1576
|
+
} : undefined,
|
1577
|
+
assetId: item.assetId !== undefined ? {
|
1578
|
+
equals: item.assetId
|
1579
|
+
} : undefined,
|
1400
1580
|
},
|
1401
1581
|
update: {
|
1402
1582
|
id: item.id !== undefined ? {
|
@@ -1474,6 +1654,9 @@ export const Alert = {
|
|
1474
1654
|
id: item.stopLoss.id !== undefined ? {
|
1475
1655
|
equals: item.stopLoss.id
|
1476
1656
|
} : undefined,
|
1657
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
1658
|
+
equals: item.stopLoss.orderId
|
1659
|
+
} : undefined,
|
1477
1660
|
},
|
1478
1661
|
update: {
|
1479
1662
|
id: item.stopLoss.id !== undefined ? {
|
@@ -1498,6 +1681,9 @@ export const Alert = {
|
|
1498
1681
|
id: item.takeProfit.id !== undefined ? {
|
1499
1682
|
equals: item.takeProfit.id
|
1500
1683
|
} : undefined,
|
1684
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
1685
|
+
equals: item.takeProfit.orderId
|
1686
|
+
} : undefined,
|
1501
1687
|
},
|
1502
1688
|
update: {
|
1503
1689
|
id: item.takeProfit.id !== undefined ? {
|
@@ -1522,6 +1708,9 @@ export const Alert = {
|
|
1522
1708
|
id: item.action.id !== undefined ? {
|
1523
1709
|
equals: item.action.id
|
1524
1710
|
} : undefined,
|
1711
|
+
tradeId: item.action.tradeId !== undefined ? {
|
1712
|
+
equals: item.action.tradeId
|
1713
|
+
} : undefined,
|
1525
1714
|
},
|
1526
1715
|
update: {
|
1527
1716
|
id: item.action.id !== undefined ? {
|
@@ -1826,7 +2015,10 @@ export const Alert = {
|
|
1826
2015
|
}
|
1827
2016
|
: { connectOrCreate: {
|
1828
2017
|
where: {
|
1829
|
-
id: item.stopLoss.id !== undefined ?
|
2018
|
+
id: item.stopLoss.id !== undefined ? {
|
2019
|
+
equals: item.stopLoss.id
|
2020
|
+
} : undefined,
|
2021
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
1830
2022
|
},
|
1831
2023
|
create: {
|
1832
2024
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -1842,7 +2034,10 @@ export const Alert = {
|
|
1842
2034
|
}
|
1843
2035
|
: { connectOrCreate: {
|
1844
2036
|
where: {
|
1845
|
-
id: item.takeProfit.id !== undefined ?
|
2037
|
+
id: item.takeProfit.id !== undefined ? {
|
2038
|
+
equals: item.takeProfit.id
|
2039
|
+
} : undefined,
|
2040
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
1846
2041
|
},
|
1847
2042
|
create: {
|
1848
2043
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -1858,7 +2053,12 @@ export const Alert = {
|
|
1858
2053
|
}
|
1859
2054
|
: { connectOrCreate: {
|
1860
2055
|
where: {
|
1861
|
-
id: item.action.id !== undefined ?
|
2056
|
+
id: item.action.id !== undefined ? {
|
2057
|
+
equals: item.action.id
|
2058
|
+
} : undefined,
|
2059
|
+
tradeId: item.action.tradeId !== undefined ? {
|
2060
|
+
equals: item.action.tradeId
|
2061
|
+
} : undefined,
|
1862
2062
|
},
|
1863
2063
|
create: {
|
1864
2064
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -1877,7 +2077,9 @@ export const Alert = {
|
|
1877
2077
|
}
|
1878
2078
|
: { connectOrCreate: {
|
1879
2079
|
where: {
|
1880
|
-
id: item.asset.id !== undefined ?
|
2080
|
+
id: item.asset.id !== undefined ? {
|
2081
|
+
equals: item.asset.id
|
2082
|
+
} : undefined,
|
1881
2083
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
1882
2084
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
1883
2085
|
},
|
@@ -1946,7 +2148,15 @@ export const Alert = {
|
|
1946
2148
|
positions: props.alpacaAccount.positions ? {
|
1947
2149
|
upsert: props.alpacaAccount.positions.map((item) => ({
|
1948
2150
|
where: {
|
1949
|
-
id: item.id !== undefined ?
|
2151
|
+
id: item.id !== undefined ? {
|
2152
|
+
equals: item.id
|
2153
|
+
} : undefined,
|
2154
|
+
assetId: item.assetId !== undefined ? {
|
2155
|
+
equals: item.assetId
|
2156
|
+
} : undefined,
|
2157
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2158
|
+
equals: item.alpacaAccountId
|
2159
|
+
} : undefined,
|
1950
2160
|
},
|
1951
2161
|
update: {
|
1952
2162
|
id: item.id !== undefined ? {
|
@@ -2256,7 +2466,9 @@ export const Alert = {
|
|
2256
2466
|
}
|
2257
2467
|
: { connectOrCreate: {
|
2258
2468
|
where: {
|
2259
|
-
id: item.asset.id !== undefined ?
|
2469
|
+
id: item.asset.id !== undefined ? {
|
2470
|
+
equals: item.asset.id
|
2471
|
+
} : undefined,
|
2260
2472
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2261
2473
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2262
2474
|
},
|
@@ -2341,7 +2553,9 @@ export const Alert = {
|
|
2341
2553
|
}
|
2342
2554
|
: { connectOrCreate: {
|
2343
2555
|
where: {
|
2344
|
-
id: props.alpacaAccount.user.id !== undefined ?
|
2556
|
+
id: props.alpacaAccount.user.id !== undefined ? {
|
2557
|
+
equals: props.alpacaAccount.user.id
|
2558
|
+
} : undefined,
|
2345
2559
|
email: props.alpacaAccount.user.email !== undefined ? props.alpacaAccount.user.email : undefined,
|
2346
2560
|
name: props.alpacaAccount.user.name !== undefined ? {
|
2347
2561
|
equals: props.alpacaAccount.user.name
|
@@ -2367,10 +2581,20 @@ export const Alert = {
|
|
2367
2581
|
}
|
2368
2582
|
: { connectOrCreate: {
|
2369
2583
|
where: {
|
2370
|
-
id: props.alpacaAccount.user.customer.id !== undefined ?
|
2584
|
+
id: props.alpacaAccount.user.customer.id !== undefined ? {
|
2585
|
+
equals: props.alpacaAccount.user.customer.id
|
2586
|
+
} : undefined,
|
2587
|
+
stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
2588
|
+
stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
2589
|
+
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
|
2590
|
+
equals: props.alpacaAccount.user.customer.authUserId
|
2591
|
+
} : undefined,
|
2371
2592
|
name: props.alpacaAccount.user.customer.name !== undefined ? {
|
2372
2593
|
equals: props.alpacaAccount.user.customer.name
|
2373
2594
|
} : undefined,
|
2595
|
+
stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
2596
|
+
equals: props.alpacaAccount.user.customer.stripePriceId
|
2597
|
+
} : undefined,
|
2374
2598
|
},
|
2375
2599
|
create: {
|
2376
2600
|
authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -2391,7 +2615,15 @@ export const Alert = {
|
|
2391
2615
|
}
|
2392
2616
|
: { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
|
2393
2617
|
where: {
|
2394
|
-
id: item.id !== undefined ?
|
2618
|
+
id: item.id !== undefined ? {
|
2619
|
+
equals: item.id
|
2620
|
+
} : undefined,
|
2621
|
+
userId: item.userId !== undefined ? {
|
2622
|
+
equals: item.userId
|
2623
|
+
} : undefined,
|
2624
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
2625
|
+
equals: item.providerAccountId
|
2626
|
+
} : undefined,
|
2395
2627
|
},
|
2396
2628
|
create: {
|
2397
2629
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -2415,7 +2647,12 @@ export const Alert = {
|
|
2415
2647
|
}
|
2416
2648
|
: { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
|
2417
2649
|
where: {
|
2418
|
-
id: item.id !== undefined ?
|
2650
|
+
id: item.id !== undefined ? {
|
2651
|
+
equals: item.id
|
2652
|
+
} : undefined,
|
2653
|
+
userId: item.userId !== undefined ? {
|
2654
|
+
equals: item.userId
|
2655
|
+
} : undefined,
|
2419
2656
|
},
|
2420
2657
|
create: {
|
2421
2658
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -2431,7 +2668,12 @@ export const Alert = {
|
|
2431
2668
|
}
|
2432
2669
|
: { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
|
2433
2670
|
where: {
|
2434
|
-
id: item.id !== undefined ?
|
2671
|
+
id: item.id !== undefined ? {
|
2672
|
+
equals: item.id
|
2673
|
+
} : undefined,
|
2674
|
+
userId: item.userId !== undefined ? {
|
2675
|
+
equals: item.userId
|
2676
|
+
} : undefined,
|
2435
2677
|
},
|
2436
2678
|
create: {
|
2437
2679
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -2451,7 +2693,15 @@ export const Alert = {
|
|
2451
2693
|
}
|
2452
2694
|
: { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
|
2453
2695
|
where: {
|
2454
|
-
id: item.id !== undefined ?
|
2696
|
+
id: item.id !== undefined ? {
|
2697
|
+
equals: item.id
|
2698
|
+
} : undefined,
|
2699
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2700
|
+
equals: item.alpacaAccountId
|
2701
|
+
} : undefined,
|
2702
|
+
assetId: item.assetId !== undefined ? {
|
2703
|
+
equals: item.assetId
|
2704
|
+
} : undefined,
|
2455
2705
|
},
|
2456
2706
|
create: {
|
2457
2707
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -2473,7 +2723,9 @@ export const Alert = {
|
|
2473
2723
|
}
|
2474
2724
|
: { connectOrCreate: {
|
2475
2725
|
where: {
|
2476
|
-
id: item.asset.id !== undefined ?
|
2726
|
+
id: item.asset.id !== undefined ? {
|
2727
|
+
equals: item.asset.id
|
2728
|
+
} : undefined,
|
2477
2729
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2478
2730
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2479
2731
|
},
|
@@ -2544,7 +2796,12 @@ export const Alert = {
|
|
2544
2796
|
}
|
2545
2797
|
: { connectOrCreate: item.actions.map((item) => ({
|
2546
2798
|
where: {
|
2547
|
-
id: item.id !== undefined ?
|
2799
|
+
id: item.id !== undefined ? {
|
2800
|
+
equals: item.id
|
2801
|
+
} : undefined,
|
2802
|
+
tradeId: item.tradeId !== undefined ? {
|
2803
|
+
equals: item.tradeId
|
2804
|
+
} : undefined,
|
2548
2805
|
},
|
2549
2806
|
create: {
|
2550
2807
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -2566,7 +2823,18 @@ export const Alert = {
|
|
2566
2823
|
}
|
2567
2824
|
: { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
|
2568
2825
|
where: {
|
2569
|
-
id: item.id !== undefined ?
|
2826
|
+
id: item.id !== undefined ? {
|
2827
|
+
equals: item.id
|
2828
|
+
} : undefined,
|
2829
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
2830
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
2831
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
2832
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
2833
|
+
equals: item.alpacaAccountId
|
2834
|
+
} : undefined,
|
2835
|
+
assetId: item.assetId !== undefined ? {
|
2836
|
+
equals: item.assetId
|
2837
|
+
} : undefined,
|
2570
2838
|
},
|
2571
2839
|
create: {
|
2572
2840
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -2599,7 +2867,10 @@ export const Alert = {
|
|
2599
2867
|
}
|
2600
2868
|
: { connectOrCreate: {
|
2601
2869
|
where: {
|
2602
|
-
id: item.stopLoss.id !== undefined ?
|
2870
|
+
id: item.stopLoss.id !== undefined ? {
|
2871
|
+
equals: item.stopLoss.id
|
2872
|
+
} : undefined,
|
2873
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
2603
2874
|
},
|
2604
2875
|
create: {
|
2605
2876
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -2615,7 +2886,10 @@ export const Alert = {
|
|
2615
2886
|
}
|
2616
2887
|
: { connectOrCreate: {
|
2617
2888
|
where: {
|
2618
|
-
id: item.takeProfit.id !== undefined ?
|
2889
|
+
id: item.takeProfit.id !== undefined ? {
|
2890
|
+
equals: item.takeProfit.id
|
2891
|
+
} : undefined,
|
2892
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
2619
2893
|
},
|
2620
2894
|
create: {
|
2621
2895
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -2631,7 +2905,12 @@ export const Alert = {
|
|
2631
2905
|
}
|
2632
2906
|
: { connectOrCreate: {
|
2633
2907
|
where: {
|
2634
|
-
id: item.action.id !== undefined ?
|
2908
|
+
id: item.action.id !== undefined ? {
|
2909
|
+
equals: item.action.id
|
2910
|
+
} : undefined,
|
2911
|
+
tradeId: item.action.tradeId !== undefined ? {
|
2912
|
+
equals: item.action.tradeId
|
2913
|
+
} : undefined,
|
2635
2914
|
},
|
2636
2915
|
create: {
|
2637
2916
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -2650,7 +2929,9 @@ export const Alert = {
|
|
2650
2929
|
}
|
2651
2930
|
: { connectOrCreate: {
|
2652
2931
|
where: {
|
2653
|
-
id: item.asset.id !== undefined ?
|
2932
|
+
id: item.asset.id !== undefined ? {
|
2933
|
+
equals: item.asset.id
|
2934
|
+
} : undefined,
|
2654
2935
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2655
2936
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2656
2937
|
},
|
@@ -2724,7 +3005,15 @@ export const Alert = {
|
|
2724
3005
|
}
|
2725
3006
|
: { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
|
2726
3007
|
where: {
|
2727
|
-
id: item.id !== undefined ?
|
3008
|
+
id: item.id !== undefined ? {
|
3009
|
+
equals: item.id
|
3010
|
+
} : undefined,
|
3011
|
+
assetId: item.assetId !== undefined ? {
|
3012
|
+
equals: item.assetId
|
3013
|
+
} : undefined,
|
3014
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3015
|
+
equals: item.alpacaAccountId
|
3016
|
+
} : undefined,
|
2728
3017
|
},
|
2729
3018
|
create: {
|
2730
3019
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -2748,7 +3037,9 @@ export const Alert = {
|
|
2748
3037
|
}
|
2749
3038
|
: { connectOrCreate: {
|
2750
3039
|
where: {
|
2751
|
-
id: item.asset.id !== undefined ?
|
3040
|
+
id: item.asset.id !== undefined ? {
|
3041
|
+
equals: item.asset.id
|
3042
|
+
} : undefined,
|
2752
3043
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
2753
3044
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
2754
3045
|
},
|
@@ -2851,8 +3142,12 @@ export const Alert = {
|
|
2851
3142
|
}`;
|
2852
3143
|
const variables = props.map(prop => ({
|
2853
3144
|
where: {
|
2854
|
-
id: prop.id !== undefined ?
|
2855
|
-
|
3145
|
+
id: prop.id !== undefined ? {
|
3146
|
+
equals: prop.id
|
3147
|
+
} : undefined,
|
3148
|
+
alpacaAccountId: prop.alpacaAccountId !== undefined ? {
|
3149
|
+
equals: prop.alpacaAccountId
|
3150
|
+
} : undefined,
|
2856
3151
|
message: prop.message !== undefined ? prop.message : undefined,
|
2857
3152
|
type: prop.type !== undefined ? prop.type : undefined,
|
2858
3153
|
createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
|
@@ -2883,6 +3178,9 @@ export const Alert = {
|
|
2883
3178
|
id: prop.alpacaAccount.id !== undefined ? {
|
2884
3179
|
equals: prop.alpacaAccount.id
|
2885
3180
|
} : undefined,
|
3181
|
+
userId: prop.alpacaAccount.userId !== undefined ? {
|
3182
|
+
equals: prop.alpacaAccount.userId
|
3183
|
+
} : undefined,
|
2886
3184
|
},
|
2887
3185
|
update: {
|
2888
3186
|
id: prop.alpacaAccount.id !== undefined ? {
|
@@ -2971,9 +3269,21 @@ export const Alert = {
|
|
2971
3269
|
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
2972
3270
|
equals: prop.alpacaAccount.user.customer.id
|
2973
3271
|
} : undefined,
|
3272
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
3273
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
3274
|
+
} : undefined,
|
2974
3275
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
2975
3276
|
equals: prop.alpacaAccount.user.customer.name
|
2976
3277
|
} : undefined,
|
3278
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
|
3279
|
+
equals: prop.alpacaAccount.user.customer.stripeCustomerId
|
3280
|
+
} : undefined,
|
3281
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
|
3282
|
+
equals: prop.alpacaAccount.user.customer.stripeSubscriptionId
|
3283
|
+
} : undefined,
|
3284
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
3285
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
3286
|
+
} : undefined,
|
2977
3287
|
},
|
2978
3288
|
update: {
|
2979
3289
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
@@ -3012,7 +3322,15 @@ export const Alert = {
|
|
3012
3322
|
accounts: prop.alpacaAccount.user.accounts ? {
|
3013
3323
|
upsert: prop.alpacaAccount.user.accounts.map((item) => ({
|
3014
3324
|
where: {
|
3015
|
-
id: item.id !== undefined ?
|
3325
|
+
id: item.id !== undefined ? {
|
3326
|
+
equals: item.id
|
3327
|
+
} : undefined,
|
3328
|
+
userId: item.userId !== undefined ? {
|
3329
|
+
equals: item.userId
|
3330
|
+
} : undefined,
|
3331
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
3332
|
+
equals: item.providerAccountId
|
3333
|
+
} : undefined,
|
3016
3334
|
},
|
3017
3335
|
update: {
|
3018
3336
|
id: item.id !== undefined ? {
|
@@ -3066,7 +3384,12 @@ export const Alert = {
|
|
3066
3384
|
sessions: prop.alpacaAccount.user.sessions ? {
|
3067
3385
|
upsert: prop.alpacaAccount.user.sessions.map((item) => ({
|
3068
3386
|
where: {
|
3069
|
-
id: item.id !== undefined ?
|
3387
|
+
id: item.id !== undefined ? {
|
3388
|
+
equals: item.id
|
3389
|
+
} : undefined,
|
3390
|
+
userId: item.userId !== undefined ? {
|
3391
|
+
equals: item.userId
|
3392
|
+
} : undefined,
|
3070
3393
|
},
|
3071
3394
|
update: {
|
3072
3395
|
id: item.id !== undefined ? {
|
@@ -3088,7 +3411,12 @@ export const Alert = {
|
|
3088
3411
|
authenticators: prop.alpacaAccount.user.authenticators ? {
|
3089
3412
|
upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
|
3090
3413
|
where: {
|
3091
|
-
id: item.id !== undefined ?
|
3414
|
+
id: item.id !== undefined ? {
|
3415
|
+
equals: item.id
|
3416
|
+
} : undefined,
|
3417
|
+
userId: item.userId !== undefined ? {
|
3418
|
+
equals: item.userId
|
3419
|
+
} : undefined,
|
3092
3420
|
},
|
3093
3421
|
update: {
|
3094
3422
|
id: item.id !== undefined ? {
|
@@ -3132,10 +3460,20 @@ export const Alert = {
|
|
3132
3460
|
}
|
3133
3461
|
: { connectOrCreate: {
|
3134
3462
|
where: {
|
3135
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
3463
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
3464
|
+
equals: prop.alpacaAccount.user.customer.id
|
3465
|
+
} : undefined,
|
3466
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
3467
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
3468
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
3469
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
3470
|
+
} : undefined,
|
3136
3471
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
3137
3472
|
equals: prop.alpacaAccount.user.customer.name
|
3138
3473
|
} : undefined,
|
3474
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
3475
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
3476
|
+
} : undefined,
|
3139
3477
|
},
|
3140
3478
|
create: {
|
3141
3479
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -3156,7 +3494,15 @@ export const Alert = {
|
|
3156
3494
|
}
|
3157
3495
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
3158
3496
|
where: {
|
3159
|
-
id: item.id !== undefined ?
|
3497
|
+
id: item.id !== undefined ? {
|
3498
|
+
equals: item.id
|
3499
|
+
} : undefined,
|
3500
|
+
userId: item.userId !== undefined ? {
|
3501
|
+
equals: item.userId
|
3502
|
+
} : undefined,
|
3503
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
3504
|
+
equals: item.providerAccountId
|
3505
|
+
} : undefined,
|
3160
3506
|
},
|
3161
3507
|
create: {
|
3162
3508
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -3180,7 +3526,12 @@ export const Alert = {
|
|
3180
3526
|
}
|
3181
3527
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
3182
3528
|
where: {
|
3183
|
-
id: item.id !== undefined ?
|
3529
|
+
id: item.id !== undefined ? {
|
3530
|
+
equals: item.id
|
3531
|
+
} : undefined,
|
3532
|
+
userId: item.userId !== undefined ? {
|
3533
|
+
equals: item.userId
|
3534
|
+
} : undefined,
|
3184
3535
|
},
|
3185
3536
|
create: {
|
3186
3537
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -3196,7 +3547,12 @@ export const Alert = {
|
|
3196
3547
|
}
|
3197
3548
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
3198
3549
|
where: {
|
3199
|
-
id: item.id !== undefined ?
|
3550
|
+
id: item.id !== undefined ? {
|
3551
|
+
equals: item.id
|
3552
|
+
} : undefined,
|
3553
|
+
userId: item.userId !== undefined ? {
|
3554
|
+
equals: item.userId
|
3555
|
+
} : undefined,
|
3200
3556
|
},
|
3201
3557
|
create: {
|
3202
3558
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -3211,7 +3567,15 @@ export const Alert = {
|
|
3211
3567
|
trades: prop.alpacaAccount.trades ? {
|
3212
3568
|
upsert: prop.alpacaAccount.trades.map((item) => ({
|
3213
3569
|
where: {
|
3214
|
-
id: item.id !== undefined ?
|
3570
|
+
id: item.id !== undefined ? {
|
3571
|
+
equals: item.id
|
3572
|
+
} : undefined,
|
3573
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
3574
|
+
equals: item.alpacaAccountId
|
3575
|
+
} : undefined,
|
3576
|
+
assetId: item.assetId !== undefined ? {
|
3577
|
+
equals: item.assetId
|
3578
|
+
} : undefined,
|
3215
3579
|
},
|
3216
3580
|
update: {
|
3217
3581
|
id: item.id !== undefined ? {
|
@@ -3495,7 +3859,12 @@ export const Alert = {
|
|
3495
3859
|
actions: item.actions ? {
|
3496
3860
|
upsert: item.actions.map((item) => ({
|
3497
3861
|
where: {
|
3498
|
-
id: item.id !== undefined ?
|
3862
|
+
id: item.id !== undefined ? {
|
3863
|
+
equals: item.id
|
3864
|
+
} : undefined,
|
3865
|
+
tradeId: item.tradeId !== undefined ? {
|
3866
|
+
equals: item.tradeId
|
3867
|
+
} : undefined,
|
3499
3868
|
},
|
3500
3869
|
update: {
|
3501
3870
|
id: item.id !== undefined ? {
|
@@ -3547,7 +3916,9 @@ export const Alert = {
|
|
3547
3916
|
}
|
3548
3917
|
: { connectOrCreate: {
|
3549
3918
|
where: {
|
3550
|
-
id: item.asset.id !== undefined ?
|
3919
|
+
id: item.asset.id !== undefined ? {
|
3920
|
+
equals: item.asset.id
|
3921
|
+
} : undefined,
|
3551
3922
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
3552
3923
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
3553
3924
|
},
|
@@ -3618,7 +3989,12 @@ export const Alert = {
|
|
3618
3989
|
}
|
3619
3990
|
: { connectOrCreate: item.actions.map((item) => ({
|
3620
3991
|
where: {
|
3621
|
-
id: item.id !== undefined ?
|
3992
|
+
id: item.id !== undefined ? {
|
3993
|
+
equals: item.id
|
3994
|
+
} : undefined,
|
3995
|
+
tradeId: item.tradeId !== undefined ? {
|
3996
|
+
equals: item.tradeId
|
3997
|
+
} : undefined,
|
3622
3998
|
},
|
3623
3999
|
create: {
|
3624
4000
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -3635,7 +4011,18 @@ export const Alert = {
|
|
3635
4011
|
orders: prop.alpacaAccount.orders ? {
|
3636
4012
|
upsert: prop.alpacaAccount.orders.map((item) => ({
|
3637
4013
|
where: {
|
3638
|
-
id: item.id !== undefined ?
|
4014
|
+
id: item.id !== undefined ? {
|
4015
|
+
equals: item.id
|
4016
|
+
} : undefined,
|
4017
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
4018
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
4019
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
4020
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4021
|
+
equals: item.alpacaAccountId
|
4022
|
+
} : undefined,
|
4023
|
+
assetId: item.assetId !== undefined ? {
|
4024
|
+
equals: item.assetId
|
4025
|
+
} : undefined,
|
3639
4026
|
},
|
3640
4027
|
update: {
|
3641
4028
|
id: item.id !== undefined ? {
|
@@ -3713,6 +4100,9 @@ export const Alert = {
|
|
3713
4100
|
id: item.stopLoss.id !== undefined ? {
|
3714
4101
|
equals: item.stopLoss.id
|
3715
4102
|
} : undefined,
|
4103
|
+
orderId: item.stopLoss.orderId !== undefined ? {
|
4104
|
+
equals: item.stopLoss.orderId
|
4105
|
+
} : undefined,
|
3716
4106
|
},
|
3717
4107
|
update: {
|
3718
4108
|
id: item.stopLoss.id !== undefined ? {
|
@@ -3737,6 +4127,9 @@ export const Alert = {
|
|
3737
4127
|
id: item.takeProfit.id !== undefined ? {
|
3738
4128
|
equals: item.takeProfit.id
|
3739
4129
|
} : undefined,
|
4130
|
+
orderId: item.takeProfit.orderId !== undefined ? {
|
4131
|
+
equals: item.takeProfit.orderId
|
4132
|
+
} : undefined,
|
3740
4133
|
},
|
3741
4134
|
update: {
|
3742
4135
|
id: item.takeProfit.id !== undefined ? {
|
@@ -3761,6 +4154,9 @@ export const Alert = {
|
|
3761
4154
|
id: item.action.id !== undefined ? {
|
3762
4155
|
equals: item.action.id
|
3763
4156
|
} : undefined,
|
4157
|
+
tradeId: item.action.tradeId !== undefined ? {
|
4158
|
+
equals: item.action.tradeId
|
4159
|
+
} : undefined,
|
3764
4160
|
},
|
3765
4161
|
update: {
|
3766
4162
|
id: item.action.id !== undefined ? {
|
@@ -4065,7 +4461,10 @@ export const Alert = {
|
|
4065
4461
|
}
|
4066
4462
|
: { connectOrCreate: {
|
4067
4463
|
where: {
|
4068
|
-
id: item.stopLoss.id !== undefined ?
|
4464
|
+
id: item.stopLoss.id !== undefined ? {
|
4465
|
+
equals: item.stopLoss.id
|
4466
|
+
} : undefined,
|
4467
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
4069
4468
|
},
|
4070
4469
|
create: {
|
4071
4470
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -4081,7 +4480,10 @@ export const Alert = {
|
|
4081
4480
|
}
|
4082
4481
|
: { connectOrCreate: {
|
4083
4482
|
where: {
|
4084
|
-
id: item.takeProfit.id !== undefined ?
|
4483
|
+
id: item.takeProfit.id !== undefined ? {
|
4484
|
+
equals: item.takeProfit.id
|
4485
|
+
} : undefined,
|
4486
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
4085
4487
|
},
|
4086
4488
|
create: {
|
4087
4489
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -4097,7 +4499,12 @@ export const Alert = {
|
|
4097
4499
|
}
|
4098
4500
|
: { connectOrCreate: {
|
4099
4501
|
where: {
|
4100
|
-
id: item.action.id !== undefined ?
|
4502
|
+
id: item.action.id !== undefined ? {
|
4503
|
+
equals: item.action.id
|
4504
|
+
} : undefined,
|
4505
|
+
tradeId: item.action.tradeId !== undefined ? {
|
4506
|
+
equals: item.action.tradeId
|
4507
|
+
} : undefined,
|
4101
4508
|
},
|
4102
4509
|
create: {
|
4103
4510
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -4116,7 +4523,9 @@ export const Alert = {
|
|
4116
4523
|
}
|
4117
4524
|
: { connectOrCreate: {
|
4118
4525
|
where: {
|
4119
|
-
id: item.asset.id !== undefined ?
|
4526
|
+
id: item.asset.id !== undefined ? {
|
4527
|
+
equals: item.asset.id
|
4528
|
+
} : undefined,
|
4120
4529
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4121
4530
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4122
4531
|
},
|
@@ -4185,7 +4594,15 @@ export const Alert = {
|
|
4185
4594
|
positions: prop.alpacaAccount.positions ? {
|
4186
4595
|
upsert: prop.alpacaAccount.positions.map((item) => ({
|
4187
4596
|
where: {
|
4188
|
-
id: item.id !== undefined ?
|
4597
|
+
id: item.id !== undefined ? {
|
4598
|
+
equals: item.id
|
4599
|
+
} : undefined,
|
4600
|
+
assetId: item.assetId !== undefined ? {
|
4601
|
+
equals: item.assetId
|
4602
|
+
} : undefined,
|
4603
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
4604
|
+
equals: item.alpacaAccountId
|
4605
|
+
} : undefined,
|
4189
4606
|
},
|
4190
4607
|
update: {
|
4191
4608
|
id: item.id !== undefined ? {
|
@@ -4495,7 +4912,9 @@ export const Alert = {
|
|
4495
4912
|
}
|
4496
4913
|
: { connectOrCreate: {
|
4497
4914
|
where: {
|
4498
|
-
id: item.asset.id !== undefined ?
|
4915
|
+
id: item.asset.id !== undefined ? {
|
4916
|
+
equals: item.asset.id
|
4917
|
+
} : undefined,
|
4499
4918
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4500
4919
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4501
4920
|
},
|
@@ -4580,7 +4999,9 @@ export const Alert = {
|
|
4580
4999
|
}
|
4581
5000
|
: { connectOrCreate: {
|
4582
5001
|
where: {
|
4583
|
-
id: prop.alpacaAccount.user.id !== undefined ?
|
5002
|
+
id: prop.alpacaAccount.user.id !== undefined ? {
|
5003
|
+
equals: prop.alpacaAccount.user.id
|
5004
|
+
} : undefined,
|
4584
5005
|
email: prop.alpacaAccount.user.email !== undefined ? prop.alpacaAccount.user.email : undefined,
|
4585
5006
|
name: prop.alpacaAccount.user.name !== undefined ? {
|
4586
5007
|
equals: prop.alpacaAccount.user.name
|
@@ -4606,10 +5027,20 @@ export const Alert = {
|
|
4606
5027
|
}
|
4607
5028
|
: { connectOrCreate: {
|
4608
5029
|
where: {
|
4609
|
-
id: prop.alpacaAccount.user.customer.id !== undefined ?
|
5030
|
+
id: prop.alpacaAccount.user.customer.id !== undefined ? {
|
5031
|
+
equals: prop.alpacaAccount.user.customer.id
|
5032
|
+
} : undefined,
|
5033
|
+
stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
|
5034
|
+
stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
|
5035
|
+
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
|
5036
|
+
equals: prop.alpacaAccount.user.customer.authUserId
|
5037
|
+
} : undefined,
|
4610
5038
|
name: prop.alpacaAccount.user.customer.name !== undefined ? {
|
4611
5039
|
equals: prop.alpacaAccount.user.customer.name
|
4612
5040
|
} : undefined,
|
5041
|
+
stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
|
5042
|
+
equals: prop.alpacaAccount.user.customer.stripePriceId
|
5043
|
+
} : undefined,
|
4613
5044
|
},
|
4614
5045
|
create: {
|
4615
5046
|
authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
|
@@ -4630,7 +5061,15 @@ export const Alert = {
|
|
4630
5061
|
}
|
4631
5062
|
: { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
|
4632
5063
|
where: {
|
4633
|
-
id: item.id !== undefined ?
|
5064
|
+
id: item.id !== undefined ? {
|
5065
|
+
equals: item.id
|
5066
|
+
} : undefined,
|
5067
|
+
userId: item.userId !== undefined ? {
|
5068
|
+
equals: item.userId
|
5069
|
+
} : undefined,
|
5070
|
+
providerAccountId: item.providerAccountId !== undefined ? {
|
5071
|
+
equals: item.providerAccountId
|
5072
|
+
} : undefined,
|
4634
5073
|
},
|
4635
5074
|
create: {
|
4636
5075
|
type: item.type !== undefined ? item.type : undefined,
|
@@ -4654,7 +5093,12 @@ export const Alert = {
|
|
4654
5093
|
}
|
4655
5094
|
: { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
|
4656
5095
|
where: {
|
4657
|
-
id: item.id !== undefined ?
|
5096
|
+
id: item.id !== undefined ? {
|
5097
|
+
equals: item.id
|
5098
|
+
} : undefined,
|
5099
|
+
userId: item.userId !== undefined ? {
|
5100
|
+
equals: item.userId
|
5101
|
+
} : undefined,
|
4658
5102
|
},
|
4659
5103
|
create: {
|
4660
5104
|
sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
|
@@ -4670,7 +5114,12 @@ export const Alert = {
|
|
4670
5114
|
}
|
4671
5115
|
: { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
|
4672
5116
|
where: {
|
4673
|
-
id: item.id !== undefined ?
|
5117
|
+
id: item.id !== undefined ? {
|
5118
|
+
equals: item.id
|
5119
|
+
} : undefined,
|
5120
|
+
userId: item.userId !== undefined ? {
|
5121
|
+
equals: item.userId
|
5122
|
+
} : undefined,
|
4674
5123
|
},
|
4675
5124
|
create: {
|
4676
5125
|
credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
|
@@ -4690,7 +5139,15 @@ export const Alert = {
|
|
4690
5139
|
}
|
4691
5140
|
: { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
|
4692
5141
|
where: {
|
4693
|
-
id: item.id !== undefined ?
|
5142
|
+
id: item.id !== undefined ? {
|
5143
|
+
equals: item.id
|
5144
|
+
} : undefined,
|
5145
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5146
|
+
equals: item.alpacaAccountId
|
5147
|
+
} : undefined,
|
5148
|
+
assetId: item.assetId !== undefined ? {
|
5149
|
+
equals: item.assetId
|
5150
|
+
} : undefined,
|
4694
5151
|
},
|
4695
5152
|
create: {
|
4696
5153
|
qty: item.qty !== undefined ? item.qty : undefined,
|
@@ -4712,7 +5169,9 @@ export const Alert = {
|
|
4712
5169
|
}
|
4713
5170
|
: { connectOrCreate: {
|
4714
5171
|
where: {
|
4715
|
-
id: item.asset.id !== undefined ?
|
5172
|
+
id: item.asset.id !== undefined ? {
|
5173
|
+
equals: item.asset.id
|
5174
|
+
} : undefined,
|
4716
5175
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4717
5176
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4718
5177
|
},
|
@@ -4783,7 +5242,12 @@ export const Alert = {
|
|
4783
5242
|
}
|
4784
5243
|
: { connectOrCreate: item.actions.map((item) => ({
|
4785
5244
|
where: {
|
4786
|
-
id: item.id !== undefined ?
|
5245
|
+
id: item.id !== undefined ? {
|
5246
|
+
equals: item.id
|
5247
|
+
} : undefined,
|
5248
|
+
tradeId: item.tradeId !== undefined ? {
|
5249
|
+
equals: item.tradeId
|
5250
|
+
} : undefined,
|
4787
5251
|
},
|
4788
5252
|
create: {
|
4789
5253
|
sequence: item.sequence !== undefined ? item.sequence : undefined,
|
@@ -4805,7 +5269,18 @@ export const Alert = {
|
|
4805
5269
|
}
|
4806
5270
|
: { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
|
4807
5271
|
where: {
|
4808
|
-
id: item.id !== undefined ?
|
5272
|
+
id: item.id !== undefined ? {
|
5273
|
+
equals: item.id
|
5274
|
+
} : undefined,
|
5275
|
+
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
5276
|
+
actionId: item.actionId !== undefined ? item.actionId : undefined,
|
5277
|
+
stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
|
5278
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5279
|
+
equals: item.alpacaAccountId
|
5280
|
+
} : undefined,
|
5281
|
+
assetId: item.assetId !== undefined ? {
|
5282
|
+
equals: item.assetId
|
5283
|
+
} : undefined,
|
4809
5284
|
},
|
4810
5285
|
create: {
|
4811
5286
|
clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
|
@@ -4838,7 +5313,10 @@ export const Alert = {
|
|
4838
5313
|
}
|
4839
5314
|
: { connectOrCreate: {
|
4840
5315
|
where: {
|
4841
|
-
id: item.stopLoss.id !== undefined ?
|
5316
|
+
id: item.stopLoss.id !== undefined ? {
|
5317
|
+
equals: item.stopLoss.id
|
5318
|
+
} : undefined,
|
5319
|
+
orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
|
4842
5320
|
},
|
4843
5321
|
create: {
|
4844
5322
|
stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
|
@@ -4854,7 +5332,10 @@ export const Alert = {
|
|
4854
5332
|
}
|
4855
5333
|
: { connectOrCreate: {
|
4856
5334
|
where: {
|
4857
|
-
id: item.takeProfit.id !== undefined ?
|
5335
|
+
id: item.takeProfit.id !== undefined ? {
|
5336
|
+
equals: item.takeProfit.id
|
5337
|
+
} : undefined,
|
5338
|
+
orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
|
4858
5339
|
},
|
4859
5340
|
create: {
|
4860
5341
|
limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
|
@@ -4870,7 +5351,12 @@ export const Alert = {
|
|
4870
5351
|
}
|
4871
5352
|
: { connectOrCreate: {
|
4872
5353
|
where: {
|
4873
|
-
id: item.action.id !== undefined ?
|
5354
|
+
id: item.action.id !== undefined ? {
|
5355
|
+
equals: item.action.id
|
5356
|
+
} : undefined,
|
5357
|
+
tradeId: item.action.tradeId !== undefined ? {
|
5358
|
+
equals: item.action.tradeId
|
5359
|
+
} : undefined,
|
4874
5360
|
},
|
4875
5361
|
create: {
|
4876
5362
|
sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
|
@@ -4889,7 +5375,9 @@ export const Alert = {
|
|
4889
5375
|
}
|
4890
5376
|
: { connectOrCreate: {
|
4891
5377
|
where: {
|
4892
|
-
id: item.asset.id !== undefined ?
|
5378
|
+
id: item.asset.id !== undefined ? {
|
5379
|
+
equals: item.asset.id
|
5380
|
+
} : undefined,
|
4893
5381
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4894
5382
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4895
5383
|
},
|
@@ -4963,7 +5451,15 @@ export const Alert = {
|
|
4963
5451
|
}
|
4964
5452
|
: { connectOrCreate: prop.alpacaAccount.positions.map((item) => ({
|
4965
5453
|
where: {
|
4966
|
-
id: item.id !== undefined ?
|
5454
|
+
id: item.id !== undefined ? {
|
5455
|
+
equals: item.id
|
5456
|
+
} : undefined,
|
5457
|
+
assetId: item.assetId !== undefined ? {
|
5458
|
+
equals: item.assetId
|
5459
|
+
} : undefined,
|
5460
|
+
alpacaAccountId: item.alpacaAccountId !== undefined ? {
|
5461
|
+
equals: item.alpacaAccountId
|
5462
|
+
} : undefined,
|
4967
5463
|
},
|
4968
5464
|
create: {
|
4969
5465
|
averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
|
@@ -4987,7 +5483,9 @@ export const Alert = {
|
|
4987
5483
|
}
|
4988
5484
|
: { connectOrCreate: {
|
4989
5485
|
where: {
|
4990
|
-
id: item.asset.id !== undefined ?
|
5486
|
+
id: item.asset.id !== undefined ? {
|
5487
|
+
equals: item.asset.id
|
5488
|
+
} : undefined,
|
4991
5489
|
symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
|
4992
5490
|
name: item.asset.name !== undefined ? item.asset.name : undefined,
|
4993
5491
|
},
|
@@ -5125,8 +5623,12 @@ export const Alert = {
|
|
5125
5623
|
}`;
|
5126
5624
|
const variables = {
|
5127
5625
|
where: {
|
5128
|
-
id: props.id !== undefined ?
|
5129
|
-
|
5626
|
+
id: props.id !== undefined ? {
|
5627
|
+
equals: props.id
|
5628
|
+
} : undefined,
|
5629
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
5630
|
+
equals: props.alpacaAccountId
|
5631
|
+
} : undefined,
|
5130
5632
|
message: props.message !== undefined ? props.message : undefined,
|
5131
5633
|
type: props.type !== undefined ? props.type : undefined,
|
5132
5634
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|
@@ -5196,7 +5698,9 @@ export const Alert = {
|
|
5196
5698
|
id: props.id !== undefined ? {
|
5197
5699
|
equals: props.id
|
5198
5700
|
} : undefined,
|
5199
|
-
alpacaAccountId: props.alpacaAccountId !== undefined ?
|
5701
|
+
alpacaAccountId: props.alpacaAccountId !== undefined ? {
|
5702
|
+
equals: props.alpacaAccountId
|
5703
|
+
} : undefined,
|
5200
5704
|
message: props.message !== undefined ? props.message : undefined,
|
5201
5705
|
type: props.type !== undefined ? props.type : undefined,
|
5202
5706
|
createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
|