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.
Files changed (65) hide show
  1. package/Account.cjs +285 -8
  2. package/Action.cjs +615 -4
  3. package/Alert.cjs +338 -4
  4. package/AlpacaAccount.cjs +771 -4
  5. package/Asset.cjs +642 -0
  6. package/Authenticator.cjs +288 -4
  7. package/Customer.cjs +273 -10
  8. package/NewsArticle.cjs +165 -0
  9. package/NewsArticleAssetSentiment.cjs +256 -8
  10. package/Order.cjs +510 -10
  11. package/Position.cjs +546 -8
  12. package/Session.cjs +288 -4
  13. package/StopLoss.cjs +348 -1
  14. package/TakeProfit.cjs +348 -1
  15. package/Trade.cjs +607 -8
  16. package/User.cjs +261 -0
  17. package/package.json +1 -1
  18. package/server/Account.d.ts.map +1 -1
  19. package/server/Account.js.map +1 -1
  20. package/server/Account.mjs +285 -8
  21. package/server/Action.d.ts.map +1 -1
  22. package/server/Action.js.map +1 -1
  23. package/server/Action.mjs +615 -4
  24. package/server/Alert.d.ts.map +1 -1
  25. package/server/Alert.js.map +1 -1
  26. package/server/Alert.mjs +338 -4
  27. package/server/AlpacaAccount.d.ts.map +1 -1
  28. package/server/AlpacaAccount.js.map +1 -1
  29. package/server/AlpacaAccount.mjs +771 -4
  30. package/server/Asset.d.ts.map +1 -1
  31. package/server/Asset.js.map +1 -1
  32. package/server/Asset.mjs +642 -0
  33. package/server/Authenticator.d.ts.map +1 -1
  34. package/server/Authenticator.js.map +1 -1
  35. package/server/Authenticator.mjs +288 -4
  36. package/server/Customer.d.ts.map +1 -1
  37. package/server/Customer.js.map +1 -1
  38. package/server/Customer.mjs +273 -10
  39. package/server/NewsArticle.d.ts.map +1 -1
  40. package/server/NewsArticle.js.map +1 -1
  41. package/server/NewsArticle.mjs +165 -0
  42. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  43. package/server/NewsArticleAssetSentiment.js.map +1 -1
  44. package/server/NewsArticleAssetSentiment.mjs +256 -8
  45. package/server/Order.d.ts.map +1 -1
  46. package/server/Order.js.map +1 -1
  47. package/server/Order.mjs +510 -10
  48. package/server/Position.d.ts.map +1 -1
  49. package/server/Position.js.map +1 -1
  50. package/server/Position.mjs +546 -8
  51. package/server/Session.d.ts.map +1 -1
  52. package/server/Session.js.map +1 -1
  53. package/server/Session.mjs +288 -4
  54. package/server/StopLoss.d.ts.map +1 -1
  55. package/server/StopLoss.js.map +1 -1
  56. package/server/StopLoss.mjs +348 -1
  57. package/server/TakeProfit.d.ts.map +1 -1
  58. package/server/TakeProfit.js.map +1 -1
  59. package/server/TakeProfit.mjs +348 -1
  60. package/server/Trade.d.ts.map +1 -1
  61. package/server/Trade.js.map +1 -1
  62. package/server/Trade.mjs +607 -8
  63. package/server/User.d.ts.map +1 -1
  64. package/server/User.js.map +1 -1
  65. package/server/User.mjs +261 -0
package/server/Alert.mjs CHANGED
@@ -45,6 +45,9 @@ export const Alert = {
45
45
  : { connectOrCreate: {
46
46
  where: {
47
47
  id: props.alpacaAccount.id !== undefined ? props.alpacaAccount.id : undefined,
48
+ userId: props.alpacaAccount.userId !== undefined ? {
49
+ equals: props.alpacaAccount.userId
50
+ } : undefined,
48
51
  },
49
52
  create: {
50
53
  type: props.alpacaAccount.type !== undefined ? props.alpacaAccount.type : undefined,
@@ -91,9 +94,17 @@ export const Alert = {
91
94
  : { connectOrCreate: {
92
95
  where: {
93
96
  id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
97
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
98
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
99
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
100
+ equals: props.alpacaAccount.user.customer.authUserId
101
+ } : undefined,
94
102
  name: props.alpacaAccount.user.customer.name !== undefined ? {
95
103
  equals: props.alpacaAccount.user.customer.name
96
104
  } : undefined,
105
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
106
+ equals: props.alpacaAccount.user.customer.stripePriceId
107
+ } : undefined,
97
108
  },
98
109
  create: {
99
110
  authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
@@ -115,6 +126,12 @@ export const Alert = {
115
126
  : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
116
127
  where: {
117
128
  id: item.id !== undefined ? item.id : undefined,
129
+ userId: item.userId !== undefined ? {
130
+ equals: item.userId
131
+ } : undefined,
132
+ providerAccountId: item.providerAccountId !== undefined ? {
133
+ equals: item.providerAccountId
134
+ } : undefined,
118
135
  },
119
136
  create: {
120
137
  type: item.type !== undefined ? item.type : undefined,
@@ -139,6 +156,9 @@ export const Alert = {
139
156
  : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
140
157
  where: {
141
158
  id: item.id !== undefined ? item.id : undefined,
159
+ userId: item.userId !== undefined ? {
160
+ equals: item.userId
161
+ } : undefined,
142
162
  },
143
163
  create: {
144
164
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -155,6 +175,9 @@ export const Alert = {
155
175
  : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
156
176
  where: {
157
177
  id: item.id !== undefined ? item.id : undefined,
178
+ userId: item.userId !== undefined ? {
179
+ equals: item.userId
180
+ } : undefined,
158
181
  },
159
182
  create: {
160
183
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -175,6 +198,12 @@ export const Alert = {
175
198
  : { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
176
199
  where: {
177
200
  id: item.id !== undefined ? item.id : undefined,
201
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
202
+ equals: item.alpacaAccountId
203
+ } : undefined,
204
+ assetId: item.assetId !== undefined ? {
205
+ equals: item.assetId
206
+ } : undefined,
178
207
  },
179
208
  create: {
180
209
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -268,6 +297,9 @@ export const Alert = {
268
297
  : { connectOrCreate: item.actions.map((item) => ({
269
298
  where: {
270
299
  id: item.id !== undefined ? item.id : undefined,
300
+ tradeId: item.tradeId !== undefined ? {
301
+ equals: item.tradeId
302
+ } : undefined,
271
303
  },
272
304
  create: {
273
305
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -290,6 +322,15 @@ export const Alert = {
290
322
  : { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
291
323
  where: {
292
324
  id: item.id !== undefined ? item.id : undefined,
325
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
326
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
327
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
328
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
329
+ equals: item.alpacaAccountId
330
+ } : undefined,
331
+ assetId: item.assetId !== undefined ? {
332
+ equals: item.assetId
333
+ } : undefined,
293
334
  },
294
335
  create: {
295
336
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -323,6 +364,7 @@ export const Alert = {
323
364
  : { connectOrCreate: {
324
365
  where: {
325
366
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
367
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
326
368
  },
327
369
  create: {
328
370
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -339,6 +381,7 @@ export const Alert = {
339
381
  : { connectOrCreate: {
340
382
  where: {
341
383
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
384
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
342
385
  },
343
386
  create: {
344
387
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -355,6 +398,9 @@ export const Alert = {
355
398
  : { connectOrCreate: {
356
399
  where: {
357
400
  id: item.action.id !== undefined ? item.action.id : undefined,
401
+ tradeId: item.action.tradeId !== undefined ? {
402
+ equals: item.action.tradeId
403
+ } : undefined,
358
404
  },
359
405
  create: {
360
406
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -448,6 +494,12 @@ export const Alert = {
448
494
  : { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
449
495
  where: {
450
496
  id: item.id !== undefined ? item.id : undefined,
497
+ assetId: item.assetId !== undefined ? {
498
+ equals: item.assetId
499
+ } : undefined,
500
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
501
+ equals: item.alpacaAccountId
502
+ } : undefined,
451
503
  },
452
504
  create: {
453
505
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -613,7 +665,9 @@ export const Alert = {
613
665
  const variables = {
614
666
  where: {
615
667
  id: props.id !== undefined ? props.id : undefined,
616
- alpacaAccountId: props.alpacaAccountId !== undefined ? props.alpacaAccountId : undefined,
668
+ alpacaAccountId: props.alpacaAccountId !== undefined ? {
669
+ equals: props.alpacaAccountId
670
+ } : undefined,
617
671
  message: props.message !== undefined ? props.message : undefined,
618
672
  type: props.type !== undefined ? props.type : undefined,
619
673
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
@@ -644,6 +698,9 @@ export const Alert = {
644
698
  id: props.alpacaAccount.id !== undefined ? {
645
699
  equals: props.alpacaAccount.id
646
700
  } : undefined,
701
+ userId: props.alpacaAccount.userId !== undefined ? {
702
+ equals: props.alpacaAccount.userId
703
+ } : undefined,
647
704
  },
648
705
  update: {
649
706
  id: props.alpacaAccount.id !== undefined ? {
@@ -732,9 +789,21 @@ export const Alert = {
732
789
  id: props.alpacaAccount.user.customer.id !== undefined ? {
733
790
  equals: props.alpacaAccount.user.customer.id
734
791
  } : undefined,
792
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
793
+ equals: props.alpacaAccount.user.customer.authUserId
794
+ } : undefined,
735
795
  name: props.alpacaAccount.user.customer.name !== undefined ? {
736
796
  equals: props.alpacaAccount.user.customer.name
737
797
  } : undefined,
798
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
799
+ equals: props.alpacaAccount.user.customer.stripeCustomerId
800
+ } : undefined,
801
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
802
+ equals: props.alpacaAccount.user.customer.stripeSubscriptionId
803
+ } : undefined,
804
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
805
+ equals: props.alpacaAccount.user.customer.stripePriceId
806
+ } : undefined,
738
807
  },
739
808
  update: {
740
809
  authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
@@ -774,6 +843,12 @@ export const Alert = {
774
843
  upsert: props.alpacaAccount.user.accounts.map((item) => ({
775
844
  where: {
776
845
  id: item.id !== undefined ? item.id : undefined,
846
+ userId: item.userId !== undefined ? {
847
+ equals: item.userId
848
+ } : undefined,
849
+ providerAccountId: item.providerAccountId !== undefined ? {
850
+ equals: item.providerAccountId
851
+ } : undefined,
777
852
  },
778
853
  update: {
779
854
  id: item.id !== undefined ? {
@@ -828,6 +903,9 @@ export const Alert = {
828
903
  upsert: props.alpacaAccount.user.sessions.map((item) => ({
829
904
  where: {
830
905
  id: item.id !== undefined ? item.id : undefined,
906
+ userId: item.userId !== undefined ? {
907
+ equals: item.userId
908
+ } : undefined,
831
909
  },
832
910
  update: {
833
911
  id: item.id !== undefined ? {
@@ -850,6 +928,9 @@ export const Alert = {
850
928
  upsert: props.alpacaAccount.user.authenticators.map((item) => ({
851
929
  where: {
852
930
  id: item.id !== undefined ? item.id : undefined,
931
+ userId: item.userId !== undefined ? {
932
+ equals: item.userId
933
+ } : undefined,
853
934
  },
854
935
  update: {
855
936
  id: item.id !== undefined ? {
@@ -894,9 +975,17 @@ export const Alert = {
894
975
  : { connectOrCreate: {
895
976
  where: {
896
977
  id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
978
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
979
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
980
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
981
+ equals: props.alpacaAccount.user.customer.authUserId
982
+ } : undefined,
897
983
  name: props.alpacaAccount.user.customer.name !== undefined ? {
898
984
  equals: props.alpacaAccount.user.customer.name
899
985
  } : undefined,
986
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
987
+ equals: props.alpacaAccount.user.customer.stripePriceId
988
+ } : undefined,
900
989
  },
901
990
  create: {
902
991
  authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
@@ -918,6 +1007,12 @@ export const Alert = {
918
1007
  : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
919
1008
  where: {
920
1009
  id: item.id !== undefined ? item.id : undefined,
1010
+ userId: item.userId !== undefined ? {
1011
+ equals: item.userId
1012
+ } : undefined,
1013
+ providerAccountId: item.providerAccountId !== undefined ? {
1014
+ equals: item.providerAccountId
1015
+ } : undefined,
921
1016
  },
922
1017
  create: {
923
1018
  type: item.type !== undefined ? item.type : undefined,
@@ -942,6 +1037,9 @@ export const Alert = {
942
1037
  : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
943
1038
  where: {
944
1039
  id: item.id !== undefined ? item.id : undefined,
1040
+ userId: item.userId !== undefined ? {
1041
+ equals: item.userId
1042
+ } : undefined,
945
1043
  },
946
1044
  create: {
947
1045
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -958,6 +1056,9 @@ export const Alert = {
958
1056
  : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
959
1057
  where: {
960
1058
  id: item.id !== undefined ? item.id : undefined,
1059
+ userId: item.userId !== undefined ? {
1060
+ equals: item.userId
1061
+ } : undefined,
961
1062
  },
962
1063
  create: {
963
1064
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -973,6 +1074,12 @@ export const Alert = {
973
1074
  upsert: props.alpacaAccount.trades.map((item) => ({
974
1075
  where: {
975
1076
  id: item.id !== undefined ? item.id : undefined,
1077
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1078
+ equals: item.alpacaAccountId
1079
+ } : undefined,
1080
+ assetId: item.assetId !== undefined ? {
1081
+ equals: item.assetId
1082
+ } : undefined,
976
1083
  },
977
1084
  update: {
978
1085
  id: item.id !== undefined ? {
@@ -1257,6 +1364,9 @@ export const Alert = {
1257
1364
  upsert: item.actions.map((item) => ({
1258
1365
  where: {
1259
1366
  id: item.id !== undefined ? item.id : undefined,
1367
+ tradeId: item.tradeId !== undefined ? {
1368
+ equals: item.tradeId
1369
+ } : undefined,
1260
1370
  },
1261
1371
  update: {
1262
1372
  id: item.id !== undefined ? {
@@ -1380,6 +1490,9 @@ export const Alert = {
1380
1490
  : { connectOrCreate: item.actions.map((item) => ({
1381
1491
  where: {
1382
1492
  id: item.id !== undefined ? item.id : undefined,
1493
+ tradeId: item.tradeId !== undefined ? {
1494
+ equals: item.tradeId
1495
+ } : undefined,
1383
1496
  },
1384
1497
  create: {
1385
1498
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -1397,6 +1510,15 @@ export const Alert = {
1397
1510
  upsert: props.alpacaAccount.orders.map((item) => ({
1398
1511
  where: {
1399
1512
  id: item.id !== undefined ? item.id : undefined,
1513
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1514
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1515
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1516
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1517
+ equals: item.alpacaAccountId
1518
+ } : undefined,
1519
+ assetId: item.assetId !== undefined ? {
1520
+ equals: item.assetId
1521
+ } : undefined,
1400
1522
  },
1401
1523
  update: {
1402
1524
  id: item.id !== undefined ? {
@@ -1474,6 +1596,9 @@ export const Alert = {
1474
1596
  id: item.stopLoss.id !== undefined ? {
1475
1597
  equals: item.stopLoss.id
1476
1598
  } : undefined,
1599
+ orderId: item.stopLoss.orderId !== undefined ? {
1600
+ equals: item.stopLoss.orderId
1601
+ } : undefined,
1477
1602
  },
1478
1603
  update: {
1479
1604
  id: item.stopLoss.id !== undefined ? {
@@ -1498,6 +1623,9 @@ export const Alert = {
1498
1623
  id: item.takeProfit.id !== undefined ? {
1499
1624
  equals: item.takeProfit.id
1500
1625
  } : undefined,
1626
+ orderId: item.takeProfit.orderId !== undefined ? {
1627
+ equals: item.takeProfit.orderId
1628
+ } : undefined,
1501
1629
  },
1502
1630
  update: {
1503
1631
  id: item.takeProfit.id !== undefined ? {
@@ -1522,6 +1650,9 @@ export const Alert = {
1522
1650
  id: item.action.id !== undefined ? {
1523
1651
  equals: item.action.id
1524
1652
  } : undefined,
1653
+ tradeId: item.action.tradeId !== undefined ? {
1654
+ equals: item.action.tradeId
1655
+ } : undefined,
1525
1656
  },
1526
1657
  update: {
1527
1658
  id: item.action.id !== undefined ? {
@@ -1827,6 +1958,7 @@ export const Alert = {
1827
1958
  : { connectOrCreate: {
1828
1959
  where: {
1829
1960
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
1961
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
1830
1962
  },
1831
1963
  create: {
1832
1964
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -1843,6 +1975,7 @@ export const Alert = {
1843
1975
  : { connectOrCreate: {
1844
1976
  where: {
1845
1977
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
1978
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
1846
1979
  },
1847
1980
  create: {
1848
1981
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -1859,6 +1992,9 @@ export const Alert = {
1859
1992
  : { connectOrCreate: {
1860
1993
  where: {
1861
1994
  id: item.action.id !== undefined ? item.action.id : undefined,
1995
+ tradeId: item.action.tradeId !== undefined ? {
1996
+ equals: item.action.tradeId
1997
+ } : undefined,
1862
1998
  },
1863
1999
  create: {
1864
2000
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -1947,6 +2083,12 @@ export const Alert = {
1947
2083
  upsert: props.alpacaAccount.positions.map((item) => ({
1948
2084
  where: {
1949
2085
  id: item.id !== undefined ? item.id : undefined,
2086
+ assetId: item.assetId !== undefined ? {
2087
+ equals: item.assetId
2088
+ } : undefined,
2089
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2090
+ equals: item.alpacaAccountId
2091
+ } : undefined,
1950
2092
  },
1951
2093
  update: {
1952
2094
  id: item.id !== undefined ? {
@@ -2368,9 +2510,17 @@ export const Alert = {
2368
2510
  : { connectOrCreate: {
2369
2511
  where: {
2370
2512
  id: props.alpacaAccount.user.customer.id !== undefined ? props.alpacaAccount.user.customer.id : undefined,
2513
+ stripeCustomerId: props.alpacaAccount.user.customer.stripeCustomerId !== undefined ? props.alpacaAccount.user.customer.stripeCustomerId : undefined,
2514
+ stripeSubscriptionId: props.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? props.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
2515
+ authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? {
2516
+ equals: props.alpacaAccount.user.customer.authUserId
2517
+ } : undefined,
2371
2518
  name: props.alpacaAccount.user.customer.name !== undefined ? {
2372
2519
  equals: props.alpacaAccount.user.customer.name
2373
2520
  } : undefined,
2521
+ stripePriceId: props.alpacaAccount.user.customer.stripePriceId !== undefined ? {
2522
+ equals: props.alpacaAccount.user.customer.stripePriceId
2523
+ } : undefined,
2374
2524
  },
2375
2525
  create: {
2376
2526
  authUserId: props.alpacaAccount.user.customer.authUserId !== undefined ? props.alpacaAccount.user.customer.authUserId : undefined,
@@ -2392,6 +2542,12 @@ export const Alert = {
2392
2542
  : { connectOrCreate: props.alpacaAccount.user.accounts.map((item) => ({
2393
2543
  where: {
2394
2544
  id: item.id !== undefined ? item.id : undefined,
2545
+ userId: item.userId !== undefined ? {
2546
+ equals: item.userId
2547
+ } : undefined,
2548
+ providerAccountId: item.providerAccountId !== undefined ? {
2549
+ equals: item.providerAccountId
2550
+ } : undefined,
2395
2551
  },
2396
2552
  create: {
2397
2553
  type: item.type !== undefined ? item.type : undefined,
@@ -2416,6 +2572,9 @@ export const Alert = {
2416
2572
  : { connectOrCreate: props.alpacaAccount.user.sessions.map((item) => ({
2417
2573
  where: {
2418
2574
  id: item.id !== undefined ? item.id : undefined,
2575
+ userId: item.userId !== undefined ? {
2576
+ equals: item.userId
2577
+ } : undefined,
2419
2578
  },
2420
2579
  create: {
2421
2580
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -2432,6 +2591,9 @@ export const Alert = {
2432
2591
  : { connectOrCreate: props.alpacaAccount.user.authenticators.map((item) => ({
2433
2592
  where: {
2434
2593
  id: item.id !== undefined ? item.id : undefined,
2594
+ userId: item.userId !== undefined ? {
2595
+ equals: item.userId
2596
+ } : undefined,
2435
2597
  },
2436
2598
  create: {
2437
2599
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -2452,6 +2614,12 @@ export const Alert = {
2452
2614
  : { connectOrCreate: props.alpacaAccount.trades.map((item) => ({
2453
2615
  where: {
2454
2616
  id: item.id !== undefined ? item.id : undefined,
2617
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2618
+ equals: item.alpacaAccountId
2619
+ } : undefined,
2620
+ assetId: item.assetId !== undefined ? {
2621
+ equals: item.assetId
2622
+ } : undefined,
2455
2623
  },
2456
2624
  create: {
2457
2625
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2545,6 +2713,9 @@ export const Alert = {
2545
2713
  : { connectOrCreate: item.actions.map((item) => ({
2546
2714
  where: {
2547
2715
  id: item.id !== undefined ? item.id : undefined,
2716
+ tradeId: item.tradeId !== undefined ? {
2717
+ equals: item.tradeId
2718
+ } : undefined,
2548
2719
  },
2549
2720
  create: {
2550
2721
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2567,6 +2738,15 @@ export const Alert = {
2567
2738
  : { connectOrCreate: props.alpacaAccount.orders.map((item) => ({
2568
2739
  where: {
2569
2740
  id: item.id !== undefined ? item.id : undefined,
2741
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2742
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2743
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2744
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2745
+ equals: item.alpacaAccountId
2746
+ } : undefined,
2747
+ assetId: item.assetId !== undefined ? {
2748
+ equals: item.assetId
2749
+ } : undefined,
2570
2750
  },
2571
2751
  create: {
2572
2752
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2600,6 +2780,7 @@ export const Alert = {
2600
2780
  : { connectOrCreate: {
2601
2781
  where: {
2602
2782
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
2783
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2603
2784
  },
2604
2785
  create: {
2605
2786
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2616,6 +2797,7 @@ export const Alert = {
2616
2797
  : { connectOrCreate: {
2617
2798
  where: {
2618
2799
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
2800
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2619
2801
  },
2620
2802
  create: {
2621
2803
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2632,6 +2814,9 @@ export const Alert = {
2632
2814
  : { connectOrCreate: {
2633
2815
  where: {
2634
2816
  id: item.action.id !== undefined ? item.action.id : undefined,
2817
+ tradeId: item.action.tradeId !== undefined ? {
2818
+ equals: item.action.tradeId
2819
+ } : undefined,
2635
2820
  },
2636
2821
  create: {
2637
2822
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2725,6 +2910,12 @@ export const Alert = {
2725
2910
  : { connectOrCreate: props.alpacaAccount.positions.map((item) => ({
2726
2911
  where: {
2727
2912
  id: item.id !== undefined ? item.id : undefined,
2913
+ assetId: item.assetId !== undefined ? {
2914
+ equals: item.assetId
2915
+ } : undefined,
2916
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2917
+ equals: item.alpacaAccountId
2918
+ } : undefined,
2728
2919
  },
2729
2920
  create: {
2730
2921
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2852,7 +3043,9 @@ export const Alert = {
2852
3043
  const variables = props.map(prop => ({
2853
3044
  where: {
2854
3045
  id: prop.id !== undefined ? prop.id : undefined,
2855
- alpacaAccountId: prop.alpacaAccountId !== undefined ? prop.alpacaAccountId : undefined,
3046
+ alpacaAccountId: prop.alpacaAccountId !== undefined ? {
3047
+ equals: prop.alpacaAccountId
3048
+ } : undefined,
2856
3049
  message: prop.message !== undefined ? prop.message : undefined,
2857
3050
  type: prop.type !== undefined ? prop.type : undefined,
2858
3051
  createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
@@ -2883,6 +3076,9 @@ export const Alert = {
2883
3076
  id: prop.alpacaAccount.id !== undefined ? {
2884
3077
  equals: prop.alpacaAccount.id
2885
3078
  } : undefined,
3079
+ userId: prop.alpacaAccount.userId !== undefined ? {
3080
+ equals: prop.alpacaAccount.userId
3081
+ } : undefined,
2886
3082
  },
2887
3083
  update: {
2888
3084
  id: prop.alpacaAccount.id !== undefined ? {
@@ -2971,9 +3167,21 @@ export const Alert = {
2971
3167
  id: prop.alpacaAccount.user.customer.id !== undefined ? {
2972
3168
  equals: prop.alpacaAccount.user.customer.id
2973
3169
  } : undefined,
3170
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
3171
+ equals: prop.alpacaAccount.user.customer.authUserId
3172
+ } : undefined,
2974
3173
  name: prop.alpacaAccount.user.customer.name !== undefined ? {
2975
3174
  equals: prop.alpacaAccount.user.customer.name
2976
3175
  } : undefined,
3176
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? {
3177
+ equals: prop.alpacaAccount.user.customer.stripeCustomerId
3178
+ } : undefined,
3179
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? {
3180
+ equals: prop.alpacaAccount.user.customer.stripeSubscriptionId
3181
+ } : undefined,
3182
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
3183
+ equals: prop.alpacaAccount.user.customer.stripePriceId
3184
+ } : undefined,
2977
3185
  },
2978
3186
  update: {
2979
3187
  authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
@@ -3013,6 +3221,12 @@ export const Alert = {
3013
3221
  upsert: prop.alpacaAccount.user.accounts.map((item) => ({
3014
3222
  where: {
3015
3223
  id: item.id !== undefined ? item.id : undefined,
3224
+ userId: item.userId !== undefined ? {
3225
+ equals: item.userId
3226
+ } : undefined,
3227
+ providerAccountId: item.providerAccountId !== undefined ? {
3228
+ equals: item.providerAccountId
3229
+ } : undefined,
3016
3230
  },
3017
3231
  update: {
3018
3232
  id: item.id !== undefined ? {
@@ -3067,6 +3281,9 @@ export const Alert = {
3067
3281
  upsert: prop.alpacaAccount.user.sessions.map((item) => ({
3068
3282
  where: {
3069
3283
  id: item.id !== undefined ? item.id : undefined,
3284
+ userId: item.userId !== undefined ? {
3285
+ equals: item.userId
3286
+ } : undefined,
3070
3287
  },
3071
3288
  update: {
3072
3289
  id: item.id !== undefined ? {
@@ -3089,6 +3306,9 @@ export const Alert = {
3089
3306
  upsert: prop.alpacaAccount.user.authenticators.map((item) => ({
3090
3307
  where: {
3091
3308
  id: item.id !== undefined ? item.id : undefined,
3309
+ userId: item.userId !== undefined ? {
3310
+ equals: item.userId
3311
+ } : undefined,
3092
3312
  },
3093
3313
  update: {
3094
3314
  id: item.id !== undefined ? {
@@ -3133,9 +3353,17 @@ export const Alert = {
3133
3353
  : { connectOrCreate: {
3134
3354
  where: {
3135
3355
  id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
3356
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
3357
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
3358
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
3359
+ equals: prop.alpacaAccount.user.customer.authUserId
3360
+ } : undefined,
3136
3361
  name: prop.alpacaAccount.user.customer.name !== undefined ? {
3137
3362
  equals: prop.alpacaAccount.user.customer.name
3138
3363
  } : undefined,
3364
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
3365
+ equals: prop.alpacaAccount.user.customer.stripePriceId
3366
+ } : undefined,
3139
3367
  },
3140
3368
  create: {
3141
3369
  authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
@@ -3157,6 +3385,12 @@ export const Alert = {
3157
3385
  : { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
3158
3386
  where: {
3159
3387
  id: item.id !== undefined ? item.id : undefined,
3388
+ userId: item.userId !== undefined ? {
3389
+ equals: item.userId
3390
+ } : undefined,
3391
+ providerAccountId: item.providerAccountId !== undefined ? {
3392
+ equals: item.providerAccountId
3393
+ } : undefined,
3160
3394
  },
3161
3395
  create: {
3162
3396
  type: item.type !== undefined ? item.type : undefined,
@@ -3181,6 +3415,9 @@ export const Alert = {
3181
3415
  : { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
3182
3416
  where: {
3183
3417
  id: item.id !== undefined ? item.id : undefined,
3418
+ userId: item.userId !== undefined ? {
3419
+ equals: item.userId
3420
+ } : undefined,
3184
3421
  },
3185
3422
  create: {
3186
3423
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -3197,6 +3434,9 @@ export const Alert = {
3197
3434
  : { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
3198
3435
  where: {
3199
3436
  id: item.id !== undefined ? item.id : undefined,
3437
+ userId: item.userId !== undefined ? {
3438
+ equals: item.userId
3439
+ } : undefined,
3200
3440
  },
3201
3441
  create: {
3202
3442
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -3212,6 +3452,12 @@ export const Alert = {
3212
3452
  upsert: prop.alpacaAccount.trades.map((item) => ({
3213
3453
  where: {
3214
3454
  id: item.id !== undefined ? item.id : undefined,
3455
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3456
+ equals: item.alpacaAccountId
3457
+ } : undefined,
3458
+ assetId: item.assetId !== undefined ? {
3459
+ equals: item.assetId
3460
+ } : undefined,
3215
3461
  },
3216
3462
  update: {
3217
3463
  id: item.id !== undefined ? {
@@ -3496,6 +3742,9 @@ export const Alert = {
3496
3742
  upsert: item.actions.map((item) => ({
3497
3743
  where: {
3498
3744
  id: item.id !== undefined ? item.id : undefined,
3745
+ tradeId: item.tradeId !== undefined ? {
3746
+ equals: item.tradeId
3747
+ } : undefined,
3499
3748
  },
3500
3749
  update: {
3501
3750
  id: item.id !== undefined ? {
@@ -3619,6 +3868,9 @@ export const Alert = {
3619
3868
  : { connectOrCreate: item.actions.map((item) => ({
3620
3869
  where: {
3621
3870
  id: item.id !== undefined ? item.id : undefined,
3871
+ tradeId: item.tradeId !== undefined ? {
3872
+ equals: item.tradeId
3873
+ } : undefined,
3622
3874
  },
3623
3875
  create: {
3624
3876
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -3636,6 +3888,15 @@ export const Alert = {
3636
3888
  upsert: prop.alpacaAccount.orders.map((item) => ({
3637
3889
  where: {
3638
3890
  id: item.id !== undefined ? item.id : undefined,
3891
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3892
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3893
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3894
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3895
+ equals: item.alpacaAccountId
3896
+ } : undefined,
3897
+ assetId: item.assetId !== undefined ? {
3898
+ equals: item.assetId
3899
+ } : undefined,
3639
3900
  },
3640
3901
  update: {
3641
3902
  id: item.id !== undefined ? {
@@ -3713,6 +3974,9 @@ export const Alert = {
3713
3974
  id: item.stopLoss.id !== undefined ? {
3714
3975
  equals: item.stopLoss.id
3715
3976
  } : undefined,
3977
+ orderId: item.stopLoss.orderId !== undefined ? {
3978
+ equals: item.stopLoss.orderId
3979
+ } : undefined,
3716
3980
  },
3717
3981
  update: {
3718
3982
  id: item.stopLoss.id !== undefined ? {
@@ -3737,6 +4001,9 @@ export const Alert = {
3737
4001
  id: item.takeProfit.id !== undefined ? {
3738
4002
  equals: item.takeProfit.id
3739
4003
  } : undefined,
4004
+ orderId: item.takeProfit.orderId !== undefined ? {
4005
+ equals: item.takeProfit.orderId
4006
+ } : undefined,
3740
4007
  },
3741
4008
  update: {
3742
4009
  id: item.takeProfit.id !== undefined ? {
@@ -3761,6 +4028,9 @@ export const Alert = {
3761
4028
  id: item.action.id !== undefined ? {
3762
4029
  equals: item.action.id
3763
4030
  } : undefined,
4031
+ tradeId: item.action.tradeId !== undefined ? {
4032
+ equals: item.action.tradeId
4033
+ } : undefined,
3764
4034
  },
3765
4035
  update: {
3766
4036
  id: item.action.id !== undefined ? {
@@ -4066,6 +4336,7 @@ export const Alert = {
4066
4336
  : { connectOrCreate: {
4067
4337
  where: {
4068
4338
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
4339
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
4069
4340
  },
4070
4341
  create: {
4071
4342
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -4082,6 +4353,7 @@ export const Alert = {
4082
4353
  : { connectOrCreate: {
4083
4354
  where: {
4084
4355
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
4356
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
4085
4357
  },
4086
4358
  create: {
4087
4359
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -4098,6 +4370,9 @@ export const Alert = {
4098
4370
  : { connectOrCreate: {
4099
4371
  where: {
4100
4372
  id: item.action.id !== undefined ? item.action.id : undefined,
4373
+ tradeId: item.action.tradeId !== undefined ? {
4374
+ equals: item.action.tradeId
4375
+ } : undefined,
4101
4376
  },
4102
4377
  create: {
4103
4378
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -4186,6 +4461,12 @@ export const Alert = {
4186
4461
  upsert: prop.alpacaAccount.positions.map((item) => ({
4187
4462
  where: {
4188
4463
  id: item.id !== undefined ? item.id : undefined,
4464
+ assetId: item.assetId !== undefined ? {
4465
+ equals: item.assetId
4466
+ } : undefined,
4467
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4468
+ equals: item.alpacaAccountId
4469
+ } : undefined,
4189
4470
  },
4190
4471
  update: {
4191
4472
  id: item.id !== undefined ? {
@@ -4607,9 +4888,17 @@ export const Alert = {
4607
4888
  : { connectOrCreate: {
4608
4889
  where: {
4609
4890
  id: prop.alpacaAccount.user.customer.id !== undefined ? prop.alpacaAccount.user.customer.id : undefined,
4891
+ stripeCustomerId: prop.alpacaAccount.user.customer.stripeCustomerId !== undefined ? prop.alpacaAccount.user.customer.stripeCustomerId : undefined,
4892
+ stripeSubscriptionId: prop.alpacaAccount.user.customer.stripeSubscriptionId !== undefined ? prop.alpacaAccount.user.customer.stripeSubscriptionId : undefined,
4893
+ authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? {
4894
+ equals: prop.alpacaAccount.user.customer.authUserId
4895
+ } : undefined,
4610
4896
  name: prop.alpacaAccount.user.customer.name !== undefined ? {
4611
4897
  equals: prop.alpacaAccount.user.customer.name
4612
4898
  } : undefined,
4899
+ stripePriceId: prop.alpacaAccount.user.customer.stripePriceId !== undefined ? {
4900
+ equals: prop.alpacaAccount.user.customer.stripePriceId
4901
+ } : undefined,
4613
4902
  },
4614
4903
  create: {
4615
4904
  authUserId: prop.alpacaAccount.user.customer.authUserId !== undefined ? prop.alpacaAccount.user.customer.authUserId : undefined,
@@ -4631,6 +4920,12 @@ export const Alert = {
4631
4920
  : { connectOrCreate: prop.alpacaAccount.user.accounts.map((item) => ({
4632
4921
  where: {
4633
4922
  id: item.id !== undefined ? item.id : undefined,
4923
+ userId: item.userId !== undefined ? {
4924
+ equals: item.userId
4925
+ } : undefined,
4926
+ providerAccountId: item.providerAccountId !== undefined ? {
4927
+ equals: item.providerAccountId
4928
+ } : undefined,
4634
4929
  },
4635
4930
  create: {
4636
4931
  type: item.type !== undefined ? item.type : undefined,
@@ -4655,6 +4950,9 @@ export const Alert = {
4655
4950
  : { connectOrCreate: prop.alpacaAccount.user.sessions.map((item) => ({
4656
4951
  where: {
4657
4952
  id: item.id !== undefined ? item.id : undefined,
4953
+ userId: item.userId !== undefined ? {
4954
+ equals: item.userId
4955
+ } : undefined,
4658
4956
  },
4659
4957
  create: {
4660
4958
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -4671,6 +4969,9 @@ export const Alert = {
4671
4969
  : { connectOrCreate: prop.alpacaAccount.user.authenticators.map((item) => ({
4672
4970
  where: {
4673
4971
  id: item.id !== undefined ? item.id : undefined,
4972
+ userId: item.userId !== undefined ? {
4973
+ equals: item.userId
4974
+ } : undefined,
4674
4975
  },
4675
4976
  create: {
4676
4977
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -4691,6 +4992,12 @@ export const Alert = {
4691
4992
  : { connectOrCreate: prop.alpacaAccount.trades.map((item) => ({
4692
4993
  where: {
4693
4994
  id: item.id !== undefined ? item.id : undefined,
4995
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4996
+ equals: item.alpacaAccountId
4997
+ } : undefined,
4998
+ assetId: item.assetId !== undefined ? {
4999
+ equals: item.assetId
5000
+ } : undefined,
4694
5001
  },
4695
5002
  create: {
4696
5003
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -4784,6 +5091,9 @@ export const Alert = {
4784
5091
  : { connectOrCreate: item.actions.map((item) => ({
4785
5092
  where: {
4786
5093
  id: item.id !== undefined ? item.id : undefined,
5094
+ tradeId: item.tradeId !== undefined ? {
5095
+ equals: item.tradeId
5096
+ } : undefined,
4787
5097
  },
4788
5098
  create: {
4789
5099
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -4806,6 +5116,15 @@ export const Alert = {
4806
5116
  : { connectOrCreate: prop.alpacaAccount.orders.map((item) => ({
4807
5117
  where: {
4808
5118
  id: item.id !== undefined ? item.id : undefined,
5119
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5120
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5121
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5122
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5123
+ equals: item.alpacaAccountId
5124
+ } : undefined,
5125
+ assetId: item.assetId !== undefined ? {
5126
+ equals: item.assetId
5127
+ } : undefined,
4809
5128
  },
4810
5129
  create: {
4811
5130
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4839,6 +5158,7 @@ export const Alert = {
4839
5158
  : { connectOrCreate: {
4840
5159
  where: {
4841
5160
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
5161
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
4842
5162
  },
4843
5163
  create: {
4844
5164
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -4855,6 +5175,7 @@ export const Alert = {
4855
5175
  : { connectOrCreate: {
4856
5176
  where: {
4857
5177
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
5178
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
4858
5179
  },
4859
5180
  create: {
4860
5181
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -4871,6 +5192,9 @@ export const Alert = {
4871
5192
  : { connectOrCreate: {
4872
5193
  where: {
4873
5194
  id: item.action.id !== undefined ? item.action.id : undefined,
5195
+ tradeId: item.action.tradeId !== undefined ? {
5196
+ equals: item.action.tradeId
5197
+ } : undefined,
4874
5198
  },
4875
5199
  create: {
4876
5200
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -4964,6 +5288,12 @@ export const Alert = {
4964
5288
  : { connectOrCreate: prop.alpacaAccount.positions.map((item) => ({
4965
5289
  where: {
4966
5290
  id: item.id !== undefined ? item.id : undefined,
5291
+ assetId: item.assetId !== undefined ? {
5292
+ equals: item.assetId
5293
+ } : undefined,
5294
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5295
+ equals: item.alpacaAccountId
5296
+ } : undefined,
4967
5297
  },
4968
5298
  create: {
4969
5299
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5126,7 +5456,9 @@ export const Alert = {
5126
5456
  const variables = {
5127
5457
  where: {
5128
5458
  id: props.id !== undefined ? props.id : undefined,
5129
- alpacaAccountId: props.alpacaAccountId !== undefined ? props.alpacaAccountId : undefined,
5459
+ alpacaAccountId: props.alpacaAccountId !== undefined ? {
5460
+ equals: props.alpacaAccountId
5461
+ } : undefined,
5130
5462
  message: props.message !== undefined ? props.message : undefined,
5131
5463
  type: props.type !== undefined ? props.type : undefined,
5132
5464
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
@@ -5196,7 +5528,9 @@ export const Alert = {
5196
5528
  id: props.id !== undefined ? {
5197
5529
  equals: props.id
5198
5530
  } : undefined,
5199
- alpacaAccountId: props.alpacaAccountId !== undefined ? props.alpacaAccountId : undefined,
5531
+ alpacaAccountId: props.alpacaAccountId !== undefined ? {
5532
+ equals: props.alpacaAccountId
5533
+ } : undefined,
5200
5534
  message: props.message !== undefined ? props.message : undefined,
5201
5535
  type: props.type !== undefined ? props.type : undefined,
5202
5536
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,