adaptic-backend 1.0.158 → 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.
Files changed (283) hide show
  1. package/Account.cjs +435 -58
  2. package/Action.cjs +966 -121
  3. package/Alert.cjs +593 -89
  4. package/AlpacaAccount.cjs +1161 -134
  5. package/Asset.cjs +1029 -137
  6. package/Authenticator.cjs +438 -54
  7. package/Customer.cjs +435 -64
  8. package/EconomicEvent.cjs +9 -3
  9. package/NewsArticle.cjs +255 -30
  10. package/NewsArticleAssetSentiment.cjs +427 -65
  11. package/Order.cjs +867 -129
  12. package/Position.cjs +945 -141
  13. package/Session.cjs +438 -54
  14. package/StopLoss.cjs +552 -69
  15. package/TakeProfit.cjs +552 -69
  16. package/Trade.cjs +1042 -153
  17. package/User.cjs +480 -73
  18. package/VerificationToken.cjs +9 -3
  19. package/generated/typegraphql-prisma/enhance.cjs +11 -7
  20. package/generated/typegraphql-prisma/enhance.d.ts.map +1 -1
  21. package/generated/typegraphql-prisma/enhance.js.map +1 -1
  22. package/generated/typegraphql-prisma/models/Asset.cjs +2 -2
  23. package/generated/typegraphql-prisma/models/Asset.d.ts +2 -2
  24. package/generated/typegraphql-prisma/models/Asset.js.map +1 -1
  25. package/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.cjs +56 -0
  26. package/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.d.ts +5 -0
  27. package/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.d.ts.map +1 -0
  28. package/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.js.map +1 -0
  29. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateInput.cjs +2 -2
  30. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateInput.d.ts +2 -2
  31. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateInput.js.map +1 -1
  32. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateManyInput.cjs +2 -2
  33. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateManyInput.d.ts +2 -2
  34. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateManyInput.js.map +1 -1
  35. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutNewsMentionsInput.cjs +2 -2
  36. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutNewsMentionsInput.d.ts +2 -2
  37. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutNewsMentionsInput.js.map +1 -1
  38. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutOrdersInput.cjs +2 -2
  39. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutOrdersInput.d.ts +2 -2
  40. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutOrdersInput.js.map +1 -1
  41. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutPositionsInput.cjs +2 -2
  42. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutPositionsInput.d.ts +2 -2
  43. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutPositionsInput.js.map +1 -1
  44. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutTradesInput.cjs +2 -2
  45. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutTradesInput.d.ts +2 -2
  46. package/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutTradesInput.js.map +1 -1
  47. package/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.cjs +14 -0
  48. package/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.d.ts +4 -0
  49. package/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.d.ts.map +1 -1
  50. package/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.js.map +1 -1
  51. package/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.cjs +3 -2
  52. package/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.d.ts +3 -2
  53. package/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.d.ts.map +1 -1
  54. package/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.js.map +1 -1
  55. package/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.cjs +56 -0
  56. package/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.d.ts +5 -0
  57. package/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.d.ts.map +1 -0
  58. package/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.js.map +1 -0
  59. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.cjs +3 -2
  60. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.d.ts +3 -2
  61. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.d.ts.map +1 -1
  62. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.js.map +1 -1
  63. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.cjs +3 -2
  64. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.d.ts +3 -2
  65. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.d.ts.map +1 -1
  66. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.js.map +1 -1
  67. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.cjs +3 -2
  68. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.d.ts +3 -2
  69. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.d.ts.map +1 -1
  70. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.js.map +1 -1
  71. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.cjs +3 -2
  72. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.d.ts +3 -2
  73. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.d.ts.map +1 -1
  74. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.js.map +1 -1
  75. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.cjs +3 -2
  76. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.d.ts +3 -2
  77. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.d.ts.map +1 -1
  78. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.js.map +1 -1
  79. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.cjs +3 -2
  80. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.d.ts +3 -2
  81. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.d.ts.map +1 -1
  82. package/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.js.map +1 -1
  83. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.cjs +3 -2
  84. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.d.ts +3 -2
  85. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.d.ts.map +1 -1
  86. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.js.map +1 -1
  87. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.cjs +3 -2
  88. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.d.ts +3 -2
  89. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.d.ts.map +1 -1
  90. package/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.js.map +1 -1
  91. package/generated/typegraphql-prisma/resolvers/inputs/index.cjs +17 -13
  92. package/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +2 -0
  93. package/generated/typegraphql-prisma/resolvers/inputs/index.d.ts.map +1 -1
  94. package/generated/typegraphql-prisma/resolvers/inputs/index.js.map +1 -1
  95. package/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.cjs +14 -0
  96. package/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.d.ts +4 -0
  97. package/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.d.ts.map +1 -1
  98. package/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.js.map +1 -1
  99. package/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.cjs +55 -0
  100. package/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.d.ts +5 -0
  101. package/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.d.ts.map +1 -0
  102. package/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.js.map +1 -0
  103. package/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.cjs +16 -2
  104. package/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.d.ts +6 -2
  105. package/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.d.ts.map +1 -1
  106. package/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.js.map +1 -1
  107. package/generated/typegraphql-prisma/resolvers/outputs/AssetMaxAggregate.cjs +2 -2
  108. package/generated/typegraphql-prisma/resolvers/outputs/AssetMaxAggregate.d.ts +2 -2
  109. package/generated/typegraphql-prisma/resolvers/outputs/AssetMaxAggregate.js.map +1 -1
  110. package/generated/typegraphql-prisma/resolvers/outputs/AssetMinAggregate.cjs +2 -2
  111. package/generated/typegraphql-prisma/resolvers/outputs/AssetMinAggregate.d.ts +2 -2
  112. package/generated/typegraphql-prisma/resolvers/outputs/AssetMinAggregate.js.map +1 -1
  113. package/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.cjs +55 -0
  114. package/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.d.ts +5 -0
  115. package/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.d.ts.map +1 -0
  116. package/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.js.map +1 -0
  117. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAssetAndReturnOutputType.cjs +2 -2
  118. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAssetAndReturnOutputType.d.ts +2 -2
  119. package/generated/typegraphql-prisma/resolvers/outputs/CreateManyAssetAndReturnOutputType.js.map +1 -1
  120. package/generated/typegraphql-prisma/resolvers/outputs/index.cjs +7 -3
  121. package/generated/typegraphql-prisma/resolvers/outputs/index.d.ts +2 -0
  122. package/generated/typegraphql-prisma/resolvers/outputs/index.d.ts.map +1 -1
  123. package/generated/typegraphql-prisma/resolvers/outputs/index.js.map +1 -1
  124. package/package.json +1 -1
  125. package/server/Account.d.ts.map +1 -1
  126. package/server/Account.js.map +1 -1
  127. package/server/Account.mjs +435 -58
  128. package/server/Action.d.ts.map +1 -1
  129. package/server/Action.js.map +1 -1
  130. package/server/Action.mjs +966 -121
  131. package/server/Alert.d.ts.map +1 -1
  132. package/server/Alert.js.map +1 -1
  133. package/server/Alert.mjs +593 -89
  134. package/server/AlpacaAccount.d.ts.map +1 -1
  135. package/server/AlpacaAccount.js.map +1 -1
  136. package/server/AlpacaAccount.mjs +1161 -134
  137. package/server/Asset.d.ts.map +1 -1
  138. package/server/Asset.js.map +1 -1
  139. package/server/Asset.mjs +1029 -137
  140. package/server/Authenticator.d.ts.map +1 -1
  141. package/server/Authenticator.js.map +1 -1
  142. package/server/Authenticator.mjs +438 -54
  143. package/server/Customer.d.ts.map +1 -1
  144. package/server/Customer.js.map +1 -1
  145. package/server/Customer.mjs +435 -64
  146. package/server/EconomicEvent.d.ts.map +1 -1
  147. package/server/EconomicEvent.js.map +1 -1
  148. package/server/EconomicEvent.mjs +9 -3
  149. package/server/NewsArticle.d.ts.map +1 -1
  150. package/server/NewsArticle.js.map +1 -1
  151. package/server/NewsArticle.mjs +255 -30
  152. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  153. package/server/NewsArticleAssetSentiment.js.map +1 -1
  154. package/server/NewsArticleAssetSentiment.mjs +427 -65
  155. package/server/Order.d.ts.map +1 -1
  156. package/server/Order.js.map +1 -1
  157. package/server/Order.mjs +867 -129
  158. package/server/Position.d.ts.map +1 -1
  159. package/server/Position.js.map +1 -1
  160. package/server/Position.mjs +945 -141
  161. package/server/Session.d.ts.map +1 -1
  162. package/server/Session.js.map +1 -1
  163. package/server/Session.mjs +438 -54
  164. package/server/StopLoss.d.ts.map +1 -1
  165. package/server/StopLoss.js.map +1 -1
  166. package/server/StopLoss.mjs +552 -69
  167. package/server/TakeProfit.d.ts.map +1 -1
  168. package/server/TakeProfit.js.map +1 -1
  169. package/server/TakeProfit.mjs +552 -69
  170. package/server/Trade.d.ts.map +1 -1
  171. package/server/Trade.js.map +1 -1
  172. package/server/Trade.mjs +1042 -153
  173. package/server/User.d.ts.map +1 -1
  174. package/server/User.js.map +1 -1
  175. package/server/User.mjs +480 -73
  176. package/server/VerificationToken.d.ts.map +1 -1
  177. package/server/VerificationToken.js.map +1 -1
  178. package/server/VerificationToken.mjs +9 -3
  179. package/server/generated/typegraphql-prisma/enhance.d.ts.map +1 -1
  180. package/server/generated/typegraphql-prisma/enhance.js.map +1 -1
  181. package/server/generated/typegraphql-prisma/enhance.mjs +11 -7
  182. package/server/generated/typegraphql-prisma/models/Asset.d.ts +2 -2
  183. package/server/generated/typegraphql-prisma/models/Asset.js.map +1 -1
  184. package/server/generated/typegraphql-prisma/models/Asset.mjs +2 -2
  185. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.d.ts +5 -0
  186. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.d.ts.map +1 -0
  187. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.js.map +1 -0
  188. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetAvgOrderByAggregateInput.mjs +32 -0
  189. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateInput.d.ts +2 -2
  190. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateInput.js.map +1 -1
  191. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateInput.mjs +2 -2
  192. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateManyInput.d.ts +2 -2
  193. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateManyInput.js.map +1 -1
  194. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateManyInput.mjs +2 -2
  195. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutNewsMentionsInput.d.ts +2 -2
  196. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutNewsMentionsInput.js.map +1 -1
  197. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutNewsMentionsInput.mjs +2 -2
  198. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutOrdersInput.d.ts +2 -2
  199. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutOrdersInput.js.map +1 -1
  200. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutOrdersInput.mjs +2 -2
  201. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutPositionsInput.d.ts +2 -2
  202. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutPositionsInput.js.map +1 -1
  203. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutPositionsInput.mjs +2 -2
  204. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutTradesInput.d.ts +2 -2
  205. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutTradesInput.js.map +1 -1
  206. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetCreateWithoutTradesInput.mjs +2 -2
  207. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.d.ts +4 -0
  208. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.d.ts.map +1 -1
  209. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.js.map +1 -1
  210. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetOrderByWithAggregationInput.mjs +16 -0
  211. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.d.ts +3 -2
  212. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.d.ts.map +1 -1
  213. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.js.map +1 -1
  214. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetScalarWhereWithAggregatesInput.mjs +3 -2
  215. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.d.ts +5 -0
  216. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.d.ts.map +1 -0
  217. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.js.map +1 -0
  218. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetSumOrderByAggregateInput.mjs +32 -0
  219. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.d.ts +3 -2
  220. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.d.ts.map +1 -1
  221. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.js.map +1 -1
  222. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateInput.mjs +3 -2
  223. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.d.ts +3 -2
  224. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.d.ts.map +1 -1
  225. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.js.map +1 -1
  226. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateManyMutationInput.mjs +3 -2
  227. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.d.ts +3 -2
  228. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.d.ts.map +1 -1
  229. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.js.map +1 -1
  230. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutNewsMentionsInput.mjs +3 -2
  231. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.d.ts +3 -2
  232. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.d.ts.map +1 -1
  233. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.js.map +1 -1
  234. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutOrdersInput.mjs +3 -2
  235. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.d.ts +3 -2
  236. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.d.ts.map +1 -1
  237. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.js.map +1 -1
  238. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutPositionsInput.mjs +3 -2
  239. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.d.ts +3 -2
  240. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.d.ts.map +1 -1
  241. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.js.map +1 -1
  242. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetUpdateWithoutTradesInput.mjs +3 -2
  243. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.d.ts +3 -2
  244. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.d.ts.map +1 -1
  245. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.js.map +1 -1
  246. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereInput.mjs +3 -2
  247. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.d.ts +3 -2
  248. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.d.ts.map +1 -1
  249. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.js.map +1 -1
  250. package/server/generated/typegraphql-prisma/resolvers/inputs/AssetWhereUniqueInput.mjs +3 -2
  251. package/server/generated/typegraphql-prisma/resolvers/inputs/index.d.ts +2 -0
  252. package/server/generated/typegraphql-prisma/resolvers/inputs/index.d.ts.map +1 -1
  253. package/server/generated/typegraphql-prisma/resolvers/inputs/index.js.map +1 -1
  254. package/server/generated/typegraphql-prisma/resolvers/inputs/index.mjs +2 -0
  255. package/server/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.d.ts +4 -0
  256. package/server/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.d.ts.map +1 -1
  257. package/server/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.js.map +1 -1
  258. package/server/generated/typegraphql-prisma/resolvers/outputs/AggregateAsset.mjs +16 -0
  259. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.d.ts +5 -0
  260. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.d.ts.map +1 -0
  261. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.js.map +1 -0
  262. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetAvgAggregate.mjs +31 -0
  263. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.d.ts +6 -2
  264. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.d.ts.map +1 -1
  265. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.js.map +1 -1
  266. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetGroupBy.mjs +18 -2
  267. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetMaxAggregate.d.ts +2 -2
  268. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetMaxAggregate.js.map +1 -1
  269. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetMaxAggregate.mjs +2 -2
  270. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetMinAggregate.d.ts +2 -2
  271. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetMinAggregate.js.map +1 -1
  272. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetMinAggregate.mjs +2 -2
  273. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.d.ts +5 -0
  274. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.d.ts.map +1 -0
  275. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.js.map +1 -0
  276. package/server/generated/typegraphql-prisma/resolvers/outputs/AssetSumAggregate.mjs +31 -0
  277. package/server/generated/typegraphql-prisma/resolvers/outputs/CreateManyAssetAndReturnOutputType.d.ts +2 -2
  278. package/server/generated/typegraphql-prisma/resolvers/outputs/CreateManyAssetAndReturnOutputType.js.map +1 -1
  279. package/server/generated/typegraphql-prisma/resolvers/outputs/CreateManyAssetAndReturnOutputType.mjs +2 -2
  280. package/server/generated/typegraphql-prisma/resolvers/outputs/index.d.ts +2 -0
  281. package/server/generated/typegraphql-prisma/resolvers/outputs/index.d.ts.map +1 -1
  282. package/server/generated/typegraphql-prisma/resolvers/outputs/index.js.map +1 -1
  283. package/server/generated/typegraphql-prisma/resolvers/outputs/index.mjs +2 -0
package/Asset.cjs CHANGED
@@ -306,7 +306,15 @@ exports.Asset = {
306
306
  }
307
307
  : { connectOrCreate: props.trades.map((item) => ({
308
308
  where: {
309
- id: item.id !== undefined ? item.id : undefined,
309
+ id: item.id !== undefined ? {
310
+ equals: item.id
311
+ } : undefined,
312
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
313
+ equals: item.alpacaAccountId
314
+ } : undefined,
315
+ assetId: item.assetId !== undefined ? {
316
+ equals: item.assetId
317
+ } : undefined,
310
318
  },
311
319
  create: {
312
320
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -328,7 +336,12 @@ exports.Asset = {
328
336
  }
329
337
  : { connectOrCreate: {
330
338
  where: {
331
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
339
+ id: item.alpacaAccount.id !== undefined ? {
340
+ equals: item.alpacaAccount.id
341
+ } : undefined,
342
+ userId: item.alpacaAccount.userId !== undefined ? {
343
+ equals: item.alpacaAccount.userId
344
+ } : undefined,
332
345
  },
333
346
  create: {
334
347
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -348,7 +361,9 @@ exports.Asset = {
348
361
  }
349
362
  : { connectOrCreate: {
350
363
  where: {
351
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
364
+ id: item.alpacaAccount.user.id !== undefined ? {
365
+ equals: item.alpacaAccount.user.id
366
+ } : undefined,
352
367
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
353
368
  name: item.alpacaAccount.user.name !== undefined ? {
354
369
  equals: item.alpacaAccount.user.name
@@ -377,7 +392,18 @@ exports.Asset = {
377
392
  }
378
393
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
379
394
  where: {
380
- id: item.id !== undefined ? item.id : undefined,
395
+ id: item.id !== undefined ? {
396
+ equals: item.id
397
+ } : undefined,
398
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
399
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
400
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
401
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
402
+ equals: item.alpacaAccountId
403
+ } : undefined,
404
+ assetId: item.assetId !== undefined ? {
405
+ equals: item.assetId
406
+ } : undefined,
381
407
  },
382
408
  create: {
383
409
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -413,7 +439,15 @@ exports.Asset = {
413
439
  }
414
440
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
415
441
  where: {
416
- id: item.id !== undefined ? item.id : undefined,
442
+ id: item.id !== undefined ? {
443
+ equals: item.id
444
+ } : undefined,
445
+ assetId: item.assetId !== undefined ? {
446
+ equals: item.assetId
447
+ } : undefined,
448
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
449
+ equals: item.alpacaAccountId
450
+ } : undefined,
417
451
  },
418
452
  create: {
419
453
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -440,7 +474,12 @@ exports.Asset = {
440
474
  }
441
475
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
442
476
  where: {
443
- id: item.id !== undefined ? item.id : undefined,
477
+ id: item.id !== undefined ? {
478
+ equals: item.id
479
+ } : undefined,
480
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
481
+ equals: item.alpacaAccountId
482
+ } : undefined,
444
483
  },
445
484
  create: {
446
485
  message: item.message !== undefined ? item.message : undefined,
@@ -460,7 +499,12 @@ exports.Asset = {
460
499
  }
461
500
  : { connectOrCreate: item.actions.map((item) => ({
462
501
  where: {
463
- id: item.id !== undefined ? item.id : undefined,
502
+ id: item.id !== undefined ? {
503
+ equals: item.id
504
+ } : undefined,
505
+ tradeId: item.tradeId !== undefined ? {
506
+ equals: item.tradeId
507
+ } : undefined,
464
508
  },
465
509
  create: {
466
510
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -476,7 +520,18 @@ exports.Asset = {
476
520
  }
477
521
  : { connectOrCreate: {
478
522
  where: {
479
- id: item.order.id !== undefined ? item.order.id : undefined,
523
+ id: item.order.id !== undefined ? {
524
+ equals: item.order.id
525
+ } : undefined,
526
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
527
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
528
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
529
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
530
+ equals: item.order.alpacaAccountId
531
+ } : undefined,
532
+ assetId: item.order.assetId !== undefined ? {
533
+ equals: item.order.assetId
534
+ } : undefined,
480
535
  },
481
536
  create: {
482
537
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -518,7 +573,18 @@ exports.Asset = {
518
573
  }
519
574
  : { connectOrCreate: props.orders.map((item) => ({
520
575
  where: {
521
- id: item.id !== undefined ? item.id : undefined,
576
+ id: item.id !== undefined ? {
577
+ equals: item.id
578
+ } : undefined,
579
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
580
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
581
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
582
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
583
+ equals: item.alpacaAccountId
584
+ } : undefined,
585
+ assetId: item.assetId !== undefined ? {
586
+ equals: item.assetId
587
+ } : undefined,
522
588
  },
523
589
  create: {
524
590
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -551,7 +617,10 @@ exports.Asset = {
551
617
  }
552
618
  : { connectOrCreate: {
553
619
  where: {
554
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
620
+ id: item.stopLoss.id !== undefined ? {
621
+ equals: item.stopLoss.id
622
+ } : undefined,
623
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
555
624
  },
556
625
  create: {
557
626
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -567,7 +636,10 @@ exports.Asset = {
567
636
  }
568
637
  : { connectOrCreate: {
569
638
  where: {
570
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
639
+ id: item.takeProfit.id !== undefined ? {
640
+ equals: item.takeProfit.id
641
+ } : undefined,
642
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
571
643
  },
572
644
  create: {
573
645
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -583,7 +655,12 @@ exports.Asset = {
583
655
  }
584
656
  : { connectOrCreate: {
585
657
  where: {
586
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
658
+ id: item.alpacaAccount.id !== undefined ? {
659
+ equals: item.alpacaAccount.id
660
+ } : undefined,
661
+ userId: item.alpacaAccount.userId !== undefined ? {
662
+ equals: item.alpacaAccount.userId
663
+ } : undefined,
587
664
  },
588
665
  create: {
589
666
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -603,7 +680,9 @@ exports.Asset = {
603
680
  }
604
681
  : { connectOrCreate: {
605
682
  where: {
606
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
683
+ id: item.alpacaAccount.user.id !== undefined ? {
684
+ equals: item.alpacaAccount.user.id
685
+ } : undefined,
607
686
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
608
687
  name: item.alpacaAccount.user.name !== undefined ? {
609
688
  equals: item.alpacaAccount.user.name
@@ -632,7 +711,15 @@ exports.Asset = {
632
711
  }
633
712
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
634
713
  where: {
635
- id: item.id !== undefined ? item.id : undefined,
714
+ id: item.id !== undefined ? {
715
+ equals: item.id
716
+ } : undefined,
717
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
718
+ equals: item.alpacaAccountId
719
+ } : undefined,
720
+ assetId: item.assetId !== undefined ? {
721
+ equals: item.assetId
722
+ } : undefined,
636
723
  },
637
724
  create: {
638
725
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -657,7 +744,15 @@ exports.Asset = {
657
744
  }
658
745
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
659
746
  where: {
660
- id: item.id !== undefined ? item.id : undefined,
747
+ id: item.id !== undefined ? {
748
+ equals: item.id
749
+ } : undefined,
750
+ assetId: item.assetId !== undefined ? {
751
+ equals: item.assetId
752
+ } : undefined,
753
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
754
+ equals: item.alpacaAccountId
755
+ } : undefined,
661
756
  },
662
757
  create: {
663
758
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -684,7 +779,12 @@ exports.Asset = {
684
779
  }
685
780
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
686
781
  where: {
687
- id: item.id !== undefined ? item.id : undefined,
782
+ id: item.id !== undefined ? {
783
+ equals: item.id
784
+ } : undefined,
785
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
786
+ equals: item.alpacaAccountId
787
+ } : undefined,
688
788
  },
689
789
  create: {
690
790
  message: item.message !== undefined ? item.message : undefined,
@@ -704,7 +804,12 @@ exports.Asset = {
704
804
  }
705
805
  : { connectOrCreate: {
706
806
  where: {
707
- id: item.action.id !== undefined ? item.action.id : undefined,
807
+ id: item.action.id !== undefined ? {
808
+ equals: item.action.id
809
+ } : undefined,
810
+ tradeId: item.action.tradeId !== undefined ? {
811
+ equals: item.action.tradeId
812
+ } : undefined,
708
813
  },
709
814
  create: {
710
815
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -720,7 +825,15 @@ exports.Asset = {
720
825
  }
721
826
  : { connectOrCreate: {
722
827
  where: {
723
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
828
+ id: item.action.trade.id !== undefined ? {
829
+ equals: item.action.trade.id
830
+ } : undefined,
831
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
832
+ equals: item.action.trade.alpacaAccountId
833
+ } : undefined,
834
+ assetId: item.action.trade.assetId !== undefined ? {
835
+ equals: item.action.trade.assetId
836
+ } : undefined,
724
837
  },
725
838
  create: {
726
839
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -751,7 +864,15 @@ exports.Asset = {
751
864
  }
752
865
  : { connectOrCreate: props.positions.map((item) => ({
753
866
  where: {
754
- id: item.id !== undefined ? item.id : undefined,
867
+ id: item.id !== undefined ? {
868
+ equals: item.id
869
+ } : undefined,
870
+ assetId: item.assetId !== undefined ? {
871
+ equals: item.assetId
872
+ } : undefined,
873
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
874
+ equals: item.alpacaAccountId
875
+ } : undefined,
755
876
  },
756
877
  create: {
757
878
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -775,7 +896,12 @@ exports.Asset = {
775
896
  }
776
897
  : { connectOrCreate: {
777
898
  where: {
778
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
899
+ id: item.alpacaAccount.id !== undefined ? {
900
+ equals: item.alpacaAccount.id
901
+ } : undefined,
902
+ userId: item.alpacaAccount.userId !== undefined ? {
903
+ equals: item.alpacaAccount.userId
904
+ } : undefined,
779
905
  },
780
906
  create: {
781
907
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -795,7 +921,9 @@ exports.Asset = {
795
921
  }
796
922
  : { connectOrCreate: {
797
923
  where: {
798
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
924
+ id: item.alpacaAccount.user.id !== undefined ? {
925
+ equals: item.alpacaAccount.user.id
926
+ } : undefined,
799
927
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
800
928
  name: item.alpacaAccount.user.name !== undefined ? {
801
929
  equals: item.alpacaAccount.user.name
@@ -824,7 +952,15 @@ exports.Asset = {
824
952
  }
825
953
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
826
954
  where: {
827
- id: item.id !== undefined ? item.id : undefined,
955
+ id: item.id !== undefined ? {
956
+ equals: item.id
957
+ } : undefined,
958
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
959
+ equals: item.alpacaAccountId
960
+ } : undefined,
961
+ assetId: item.assetId !== undefined ? {
962
+ equals: item.assetId
963
+ } : undefined,
828
964
  },
829
965
  create: {
830
966
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -849,7 +985,18 @@ exports.Asset = {
849
985
  }
850
986
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
851
987
  where: {
852
- id: item.id !== undefined ? item.id : undefined,
988
+ id: item.id !== undefined ? {
989
+ equals: item.id
990
+ } : undefined,
991
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
992
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
993
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
994
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
995
+ equals: item.alpacaAccountId
996
+ } : undefined,
997
+ assetId: item.assetId !== undefined ? {
998
+ equals: item.assetId
999
+ } : undefined,
853
1000
  },
854
1001
  create: {
855
1002
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -885,7 +1032,12 @@ exports.Asset = {
885
1032
  }
886
1033
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
887
1034
  where: {
888
- id: item.id !== undefined ? item.id : undefined,
1035
+ id: item.id !== undefined ? {
1036
+ equals: item.id
1037
+ } : undefined,
1038
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1039
+ equals: item.alpacaAccountId
1040
+ } : undefined,
889
1041
  },
890
1042
  create: {
891
1043
  message: item.message !== undefined ? item.message : undefined,
@@ -908,8 +1060,16 @@ exports.Asset = {
908
1060
  }
909
1061
  : { connectOrCreate: props.newsMentions.map((item) => ({
910
1062
  where: {
911
- id: item.id !== undefined ? item.id : undefined,
1063
+ id: item.id !== undefined ? {
1064
+ equals: item.id
1065
+ } : undefined,
912
1066
  url: item.url !== undefined ? item.url : undefined,
1067
+ assetId: item.assetId !== undefined ? {
1068
+ equals: item.assetId
1069
+ } : undefined,
1070
+ newsArticleId: item.newsArticleId !== undefined ? {
1071
+ equals: item.newsArticleId
1072
+ } : undefined,
913
1073
  },
914
1074
  create: {
915
1075
  url: item.url !== undefined ? item.url : undefined,
@@ -924,7 +1084,9 @@ exports.Asset = {
924
1084
  }
925
1085
  : { connectOrCreate: {
926
1086
  where: {
927
- id: item.news.id !== undefined ? item.news.id : undefined,
1087
+ id: item.news.id !== undefined ? {
1088
+ equals: item.news.id
1089
+ } : undefined,
928
1090
  url: item.news.url !== undefined ? item.news.url : undefined,
929
1091
  title: item.news.title !== undefined ? {
930
1092
  equals: item.news.title
@@ -1073,7 +1235,9 @@ exports.Asset = {
1073
1235
  }`;
1074
1236
  const variables = {
1075
1237
  where: {
1076
- id: props.id !== undefined ? props.id : undefined,
1238
+ id: props.id !== undefined ? {
1239
+ equals: props.id
1240
+ } : undefined,
1077
1241
  symbol: props.symbol !== undefined ? props.symbol : undefined,
1078
1242
  name: props.name !== undefined ? props.name : undefined,
1079
1243
  type: props.type !== undefined ? props.type : undefined,
@@ -1127,8 +1291,6 @@ exports.Asset = {
1127
1291
  sharesOutstanding: props.sharesOutstanding !== undefined ? props.sharesOutstanding : undefined,
1128
1292
  dividendDate: props.dividendDate !== undefined ? props.dividendDate : undefined,
1129
1293
  exDividendDate: props.exDividendDate !== undefined ? props.exDividendDate : undefined,
1130
- askPrice: props.askPrice !== undefined ? props.askPrice : undefined,
1131
- bidPrice: props.bidPrice !== undefined ? props.bidPrice : undefined,
1132
1294
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
1133
1295
  updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
1134
1296
  },
@@ -1310,7 +1472,15 @@ exports.Asset = {
1310
1472
  trades: props.trades ? {
1311
1473
  upsert: props.trades.map((item) => ({
1312
1474
  where: {
1313
- id: item.id !== undefined ? item.id : undefined,
1475
+ id: item.id !== undefined ? {
1476
+ equals: item.id
1477
+ } : undefined,
1478
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1479
+ equals: item.alpacaAccountId
1480
+ } : undefined,
1481
+ assetId: item.assetId !== undefined ? {
1482
+ equals: item.assetId
1483
+ } : undefined,
1314
1484
  },
1315
1485
  update: {
1316
1486
  id: item.id !== undefined ? {
@@ -1355,6 +1525,9 @@ exports.Asset = {
1355
1525
  id: item.alpacaAccount.id !== undefined ? {
1356
1526
  equals: item.alpacaAccount.id
1357
1527
  } : undefined,
1528
+ userId: item.alpacaAccount.userId !== undefined ? {
1529
+ equals: item.alpacaAccount.userId
1530
+ } : undefined,
1358
1531
  },
1359
1532
  update: {
1360
1533
  id: item.alpacaAccount.id !== undefined ? {
@@ -1456,7 +1629,18 @@ exports.Asset = {
1456
1629
  orders: item.alpacaAccount.orders ? {
1457
1630
  upsert: item.alpacaAccount.orders.map((item) => ({
1458
1631
  where: {
1459
- id: item.id !== undefined ? item.id : undefined,
1632
+ id: item.id !== undefined ? {
1633
+ equals: item.id
1634
+ } : undefined,
1635
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1636
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1637
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1638
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1639
+ equals: item.alpacaAccountId
1640
+ } : undefined,
1641
+ assetId: item.assetId !== undefined ? {
1642
+ equals: item.assetId
1643
+ } : undefined,
1460
1644
  },
1461
1645
  update: {
1462
1646
  id: item.id !== undefined ? {
@@ -1558,7 +1742,15 @@ exports.Asset = {
1558
1742
  positions: item.alpacaAccount.positions ? {
1559
1743
  upsert: item.alpacaAccount.positions.map((item) => ({
1560
1744
  where: {
1561
- id: item.id !== undefined ? item.id : undefined,
1745
+ id: item.id !== undefined ? {
1746
+ equals: item.id
1747
+ } : undefined,
1748
+ assetId: item.assetId !== undefined ? {
1749
+ equals: item.assetId
1750
+ } : undefined,
1751
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1752
+ equals: item.alpacaAccountId
1753
+ } : undefined,
1562
1754
  },
1563
1755
  update: {
1564
1756
  id: item.id !== undefined ? {
@@ -1624,7 +1816,12 @@ exports.Asset = {
1624
1816
  alerts: item.alpacaAccount.alerts ? {
1625
1817
  upsert: item.alpacaAccount.alerts.map((item) => ({
1626
1818
  where: {
1627
- id: item.id !== undefined ? item.id : undefined,
1819
+ id: item.id !== undefined ? {
1820
+ equals: item.id
1821
+ } : undefined,
1822
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1823
+ equals: item.alpacaAccountId
1824
+ } : undefined,
1628
1825
  },
1629
1826
  update: {
1630
1827
  id: item.id !== undefined ? {
@@ -1666,7 +1863,9 @@ exports.Asset = {
1666
1863
  }
1667
1864
  : { connectOrCreate: {
1668
1865
  where: {
1669
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
1866
+ id: item.alpacaAccount.user.id !== undefined ? {
1867
+ equals: item.alpacaAccount.user.id
1868
+ } : undefined,
1670
1869
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
1671
1870
  name: item.alpacaAccount.user.name !== undefined ? {
1672
1871
  equals: item.alpacaAccount.user.name
@@ -1695,7 +1894,18 @@ exports.Asset = {
1695
1894
  }
1696
1895
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
1697
1896
  where: {
1698
- id: item.id !== undefined ? item.id : undefined,
1897
+ id: item.id !== undefined ? {
1898
+ equals: item.id
1899
+ } : undefined,
1900
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1901
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1902
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1903
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1904
+ equals: item.alpacaAccountId
1905
+ } : undefined,
1906
+ assetId: item.assetId !== undefined ? {
1907
+ equals: item.assetId
1908
+ } : undefined,
1699
1909
  },
1700
1910
  create: {
1701
1911
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -1731,7 +1941,15 @@ exports.Asset = {
1731
1941
  }
1732
1942
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
1733
1943
  where: {
1734
- id: item.id !== undefined ? item.id : undefined,
1944
+ id: item.id !== undefined ? {
1945
+ equals: item.id
1946
+ } : undefined,
1947
+ assetId: item.assetId !== undefined ? {
1948
+ equals: item.assetId
1949
+ } : undefined,
1950
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1951
+ equals: item.alpacaAccountId
1952
+ } : undefined,
1735
1953
  },
1736
1954
  create: {
1737
1955
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -1758,7 +1976,12 @@ exports.Asset = {
1758
1976
  }
1759
1977
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
1760
1978
  where: {
1761
- id: item.id !== undefined ? item.id : undefined,
1979
+ id: item.id !== undefined ? {
1980
+ equals: item.id
1981
+ } : undefined,
1982
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1983
+ equals: item.alpacaAccountId
1984
+ } : undefined,
1762
1985
  },
1763
1986
  create: {
1764
1987
  message: item.message !== undefined ? item.message : undefined,
@@ -1773,7 +1996,12 @@ exports.Asset = {
1773
1996
  actions: item.actions ? {
1774
1997
  upsert: item.actions.map((item) => ({
1775
1998
  where: {
1776
- id: item.id !== undefined ? item.id : undefined,
1999
+ id: item.id !== undefined ? {
2000
+ equals: item.id
2001
+ } : undefined,
2002
+ tradeId: item.tradeId !== undefined ? {
2003
+ equals: item.tradeId
2004
+ } : undefined,
1777
2005
  },
1778
2006
  update: {
1779
2007
  id: item.id !== undefined ? {
@@ -1800,6 +2028,18 @@ exports.Asset = {
1800
2028
  id: item.order.id !== undefined ? {
1801
2029
  equals: item.order.id
1802
2030
  } : undefined,
2031
+ clientOrderId: item.order.clientOrderId !== undefined ? {
2032
+ equals: item.order.clientOrderId
2033
+ } : undefined,
2034
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2035
+ equals: item.order.alpacaAccountId
2036
+ } : undefined,
2037
+ assetId: item.order.assetId !== undefined ? {
2038
+ equals: item.order.assetId
2039
+ } : undefined,
2040
+ actionId: item.order.actionId !== undefined ? {
2041
+ equals: item.order.actionId
2042
+ } : undefined,
1803
2043
  },
1804
2044
  update: {
1805
2045
  id: item.order.id !== undefined ? {
@@ -1913,7 +2153,18 @@ exports.Asset = {
1913
2153
  }
1914
2154
  : { connectOrCreate: {
1915
2155
  where: {
1916
- id: item.order.id !== undefined ? item.order.id : undefined,
2156
+ id: item.order.id !== undefined ? {
2157
+ equals: item.order.id
2158
+ } : undefined,
2159
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2160
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2161
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2162
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2163
+ equals: item.order.alpacaAccountId
2164
+ } : undefined,
2165
+ assetId: item.order.assetId !== undefined ? {
2166
+ equals: item.order.assetId
2167
+ } : undefined,
1917
2168
  },
1918
2169
  create: {
1919
2170
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -1965,7 +2216,12 @@ exports.Asset = {
1965
2216
  }
1966
2217
  : { connectOrCreate: {
1967
2218
  where: {
1968
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
2219
+ id: item.alpacaAccount.id !== undefined ? {
2220
+ equals: item.alpacaAccount.id
2221
+ } : undefined,
2222
+ userId: item.alpacaAccount.userId !== undefined ? {
2223
+ equals: item.alpacaAccount.userId
2224
+ } : undefined,
1969
2225
  },
1970
2226
  create: {
1971
2227
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -1985,7 +2241,9 @@ exports.Asset = {
1985
2241
  }
1986
2242
  : { connectOrCreate: {
1987
2243
  where: {
1988
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
2244
+ id: item.alpacaAccount.user.id !== undefined ? {
2245
+ equals: item.alpacaAccount.user.id
2246
+ } : undefined,
1989
2247
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
1990
2248
  name: item.alpacaAccount.user.name !== undefined ? {
1991
2249
  equals: item.alpacaAccount.user.name
@@ -2014,7 +2272,18 @@ exports.Asset = {
2014
2272
  }
2015
2273
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
2016
2274
  where: {
2017
- id: item.id !== undefined ? item.id : undefined,
2275
+ id: item.id !== undefined ? {
2276
+ equals: item.id
2277
+ } : undefined,
2278
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2279
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2280
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2281
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2282
+ equals: item.alpacaAccountId
2283
+ } : undefined,
2284
+ assetId: item.assetId !== undefined ? {
2285
+ equals: item.assetId
2286
+ } : undefined,
2018
2287
  },
2019
2288
  create: {
2020
2289
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2050,7 +2319,15 @@ exports.Asset = {
2050
2319
  }
2051
2320
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2052
2321
  where: {
2053
- id: item.id !== undefined ? item.id : undefined,
2322
+ id: item.id !== undefined ? {
2323
+ equals: item.id
2324
+ } : undefined,
2325
+ assetId: item.assetId !== undefined ? {
2326
+ equals: item.assetId
2327
+ } : undefined,
2328
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2329
+ equals: item.alpacaAccountId
2330
+ } : undefined,
2054
2331
  },
2055
2332
  create: {
2056
2333
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2077,7 +2354,12 @@ exports.Asset = {
2077
2354
  }
2078
2355
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2079
2356
  where: {
2080
- id: item.id !== undefined ? item.id : undefined,
2357
+ id: item.id !== undefined ? {
2358
+ equals: item.id
2359
+ } : undefined,
2360
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2361
+ equals: item.alpacaAccountId
2362
+ } : undefined,
2081
2363
  },
2082
2364
  create: {
2083
2365
  message: item.message !== undefined ? item.message : undefined,
@@ -2097,7 +2379,12 @@ exports.Asset = {
2097
2379
  }
2098
2380
  : { connectOrCreate: item.actions.map((item) => ({
2099
2381
  where: {
2100
- id: item.id !== undefined ? item.id : undefined,
2382
+ id: item.id !== undefined ? {
2383
+ equals: item.id
2384
+ } : undefined,
2385
+ tradeId: item.tradeId !== undefined ? {
2386
+ equals: item.tradeId
2387
+ } : undefined,
2101
2388
  },
2102
2389
  create: {
2103
2390
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2113,7 +2400,18 @@ exports.Asset = {
2113
2400
  }
2114
2401
  : { connectOrCreate: {
2115
2402
  where: {
2116
- id: item.order.id !== undefined ? item.order.id : undefined,
2403
+ id: item.order.id !== undefined ? {
2404
+ equals: item.order.id
2405
+ } : undefined,
2406
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
2407
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
2408
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
2409
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
2410
+ equals: item.order.alpacaAccountId
2411
+ } : undefined,
2412
+ assetId: item.order.assetId !== undefined ? {
2413
+ equals: item.order.assetId
2414
+ } : undefined,
2117
2415
  },
2118
2416
  create: {
2119
2417
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -2150,7 +2448,18 @@ exports.Asset = {
2150
2448
  orders: props.orders ? {
2151
2449
  upsert: props.orders.map((item) => ({
2152
2450
  where: {
2153
- id: item.id !== undefined ? item.id : undefined,
2451
+ id: item.id !== undefined ? {
2452
+ equals: item.id
2453
+ } : undefined,
2454
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2455
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2456
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2457
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2458
+ equals: item.alpacaAccountId
2459
+ } : undefined,
2460
+ assetId: item.assetId !== undefined ? {
2461
+ equals: item.assetId
2462
+ } : undefined,
2154
2463
  },
2155
2464
  update: {
2156
2465
  id: item.id !== undefined ? {
@@ -2228,6 +2537,9 @@ exports.Asset = {
2228
2537
  id: item.stopLoss.id !== undefined ? {
2229
2538
  equals: item.stopLoss.id
2230
2539
  } : undefined,
2540
+ orderId: item.stopLoss.orderId !== undefined ? {
2541
+ equals: item.stopLoss.orderId
2542
+ } : undefined,
2231
2543
  },
2232
2544
  update: {
2233
2545
  id: item.stopLoss.id !== undefined ? {
@@ -2252,6 +2564,9 @@ exports.Asset = {
2252
2564
  id: item.takeProfit.id !== undefined ? {
2253
2565
  equals: item.takeProfit.id
2254
2566
  } : undefined,
2567
+ orderId: item.takeProfit.orderId !== undefined ? {
2568
+ equals: item.takeProfit.orderId
2569
+ } : undefined,
2255
2570
  },
2256
2571
  update: {
2257
2572
  id: item.takeProfit.id !== undefined ? {
@@ -2276,6 +2591,9 @@ exports.Asset = {
2276
2591
  id: item.alpacaAccount.id !== undefined ? {
2277
2592
  equals: item.alpacaAccount.id
2278
2593
  } : undefined,
2594
+ userId: item.alpacaAccount.userId !== undefined ? {
2595
+ equals: item.alpacaAccount.userId
2596
+ } : undefined,
2279
2597
  },
2280
2598
  update: {
2281
2599
  id: item.alpacaAccount.id !== undefined ? {
@@ -2377,7 +2695,15 @@ exports.Asset = {
2377
2695
  trades: item.alpacaAccount.trades ? {
2378
2696
  upsert: item.alpacaAccount.trades.map((item) => ({
2379
2697
  where: {
2380
- id: item.id !== undefined ? item.id : undefined,
2698
+ id: item.id !== undefined ? {
2699
+ equals: item.id
2700
+ } : undefined,
2701
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2702
+ equals: item.alpacaAccountId
2703
+ } : undefined,
2704
+ assetId: item.assetId !== undefined ? {
2705
+ equals: item.assetId
2706
+ } : undefined,
2381
2707
  },
2382
2708
  update: {
2383
2709
  id: item.id !== undefined ? {
@@ -2435,7 +2761,15 @@ exports.Asset = {
2435
2761
  positions: item.alpacaAccount.positions ? {
2436
2762
  upsert: item.alpacaAccount.positions.map((item) => ({
2437
2763
  where: {
2438
- id: item.id !== undefined ? item.id : undefined,
2764
+ id: item.id !== undefined ? {
2765
+ equals: item.id
2766
+ } : undefined,
2767
+ assetId: item.assetId !== undefined ? {
2768
+ equals: item.assetId
2769
+ } : undefined,
2770
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2771
+ equals: item.alpacaAccountId
2772
+ } : undefined,
2439
2773
  },
2440
2774
  update: {
2441
2775
  id: item.id !== undefined ? {
@@ -2501,7 +2835,12 @@ exports.Asset = {
2501
2835
  alerts: item.alpacaAccount.alerts ? {
2502
2836
  upsert: item.alpacaAccount.alerts.map((item) => ({
2503
2837
  where: {
2504
- id: item.id !== undefined ? item.id : undefined,
2838
+ id: item.id !== undefined ? {
2839
+ equals: item.id
2840
+ } : undefined,
2841
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2842
+ equals: item.alpacaAccountId
2843
+ } : undefined,
2505
2844
  },
2506
2845
  update: {
2507
2846
  id: item.id !== undefined ? {
@@ -2543,7 +2882,9 @@ exports.Asset = {
2543
2882
  }
2544
2883
  : { connectOrCreate: {
2545
2884
  where: {
2546
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
2885
+ id: item.alpacaAccount.user.id !== undefined ? {
2886
+ equals: item.alpacaAccount.user.id
2887
+ } : undefined,
2547
2888
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
2548
2889
  name: item.alpacaAccount.user.name !== undefined ? {
2549
2890
  equals: item.alpacaAccount.user.name
@@ -2572,7 +2913,15 @@ exports.Asset = {
2572
2913
  }
2573
2914
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2574
2915
  where: {
2575
- id: item.id !== undefined ? item.id : undefined,
2916
+ id: item.id !== undefined ? {
2917
+ equals: item.id
2918
+ } : undefined,
2919
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2920
+ equals: item.alpacaAccountId
2921
+ } : undefined,
2922
+ assetId: item.assetId !== undefined ? {
2923
+ equals: item.assetId
2924
+ } : undefined,
2576
2925
  },
2577
2926
  create: {
2578
2927
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2597,7 +2946,15 @@ exports.Asset = {
2597
2946
  }
2598
2947
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2599
2948
  where: {
2600
- id: item.id !== undefined ? item.id : undefined,
2949
+ id: item.id !== undefined ? {
2950
+ equals: item.id
2951
+ } : undefined,
2952
+ assetId: item.assetId !== undefined ? {
2953
+ equals: item.assetId
2954
+ } : undefined,
2955
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2956
+ equals: item.alpacaAccountId
2957
+ } : undefined,
2601
2958
  },
2602
2959
  create: {
2603
2960
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2624,7 +2981,12 @@ exports.Asset = {
2624
2981
  }
2625
2982
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2626
2983
  where: {
2627
- id: item.id !== undefined ? item.id : undefined,
2984
+ id: item.id !== undefined ? {
2985
+ equals: item.id
2986
+ } : undefined,
2987
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2988
+ equals: item.alpacaAccountId
2989
+ } : undefined,
2628
2990
  },
2629
2991
  create: {
2630
2992
  message: item.message !== undefined ? item.message : undefined,
@@ -2642,6 +3004,9 @@ exports.Asset = {
2642
3004
  id: item.action.id !== undefined ? {
2643
3005
  equals: item.action.id
2644
3006
  } : undefined,
3007
+ tradeId: item.action.tradeId !== undefined ? {
3008
+ equals: item.action.tradeId
3009
+ } : undefined,
2645
3010
  },
2646
3011
  update: {
2647
3012
  id: item.action.id !== undefined ? {
@@ -2668,6 +3033,12 @@ exports.Asset = {
2668
3033
  id: item.action.trade.id !== undefined ? {
2669
3034
  equals: item.action.trade.id
2670
3035
  } : undefined,
3036
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3037
+ equals: item.action.trade.alpacaAccountId
3038
+ } : undefined,
3039
+ assetId: item.action.trade.assetId !== undefined ? {
3040
+ equals: item.action.trade.assetId
3041
+ } : undefined,
2671
3042
  },
2672
3043
  update: {
2673
3044
  id: item.action.trade.id !== undefined ? {
@@ -2737,7 +3108,15 @@ exports.Asset = {
2737
3108
  }
2738
3109
  : { connectOrCreate: {
2739
3110
  where: {
2740
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3111
+ id: item.action.trade.id !== undefined ? {
3112
+ equals: item.action.trade.id
3113
+ } : undefined,
3114
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3115
+ equals: item.action.trade.alpacaAccountId
3116
+ } : undefined,
3117
+ assetId: item.action.trade.assetId !== undefined ? {
3118
+ equals: item.action.trade.assetId
3119
+ } : undefined,
2741
3120
  },
2742
3121
  create: {
2743
3122
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2789,7 +3168,10 @@ exports.Asset = {
2789
3168
  }
2790
3169
  : { connectOrCreate: {
2791
3170
  where: {
2792
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
3171
+ id: item.stopLoss.id !== undefined ? {
3172
+ equals: item.stopLoss.id
3173
+ } : undefined,
3174
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2793
3175
  },
2794
3176
  create: {
2795
3177
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2805,7 +3187,10 @@ exports.Asset = {
2805
3187
  }
2806
3188
  : { connectOrCreate: {
2807
3189
  where: {
2808
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
3190
+ id: item.takeProfit.id !== undefined ? {
3191
+ equals: item.takeProfit.id
3192
+ } : undefined,
3193
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2809
3194
  },
2810
3195
  create: {
2811
3196
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2821,7 +3206,12 @@ exports.Asset = {
2821
3206
  }
2822
3207
  : { connectOrCreate: {
2823
3208
  where: {
2824
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3209
+ id: item.alpacaAccount.id !== undefined ? {
3210
+ equals: item.alpacaAccount.id
3211
+ } : undefined,
3212
+ userId: item.alpacaAccount.userId !== undefined ? {
3213
+ equals: item.alpacaAccount.userId
3214
+ } : undefined,
2825
3215
  },
2826
3216
  create: {
2827
3217
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -2841,7 +3231,9 @@ exports.Asset = {
2841
3231
  }
2842
3232
  : { connectOrCreate: {
2843
3233
  where: {
2844
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
3234
+ id: item.alpacaAccount.user.id !== undefined ? {
3235
+ equals: item.alpacaAccount.user.id
3236
+ } : undefined,
2845
3237
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
2846
3238
  name: item.alpacaAccount.user.name !== undefined ? {
2847
3239
  equals: item.alpacaAccount.user.name
@@ -2870,7 +3262,15 @@ exports.Asset = {
2870
3262
  }
2871
3263
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
2872
3264
  where: {
2873
- id: item.id !== undefined ? item.id : undefined,
3265
+ id: item.id !== undefined ? {
3266
+ equals: item.id
3267
+ } : undefined,
3268
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3269
+ equals: item.alpacaAccountId
3270
+ } : undefined,
3271
+ assetId: item.assetId !== undefined ? {
3272
+ equals: item.assetId
3273
+ } : undefined,
2874
3274
  },
2875
3275
  create: {
2876
3276
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2895,7 +3295,15 @@ exports.Asset = {
2895
3295
  }
2896
3296
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
2897
3297
  where: {
2898
- id: item.id !== undefined ? item.id : undefined,
3298
+ id: item.id !== undefined ? {
3299
+ equals: item.id
3300
+ } : undefined,
3301
+ assetId: item.assetId !== undefined ? {
3302
+ equals: item.assetId
3303
+ } : undefined,
3304
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3305
+ equals: item.alpacaAccountId
3306
+ } : undefined,
2899
3307
  },
2900
3308
  create: {
2901
3309
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -2922,7 +3330,12 @@ exports.Asset = {
2922
3330
  }
2923
3331
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
2924
3332
  where: {
2925
- id: item.id !== undefined ? item.id : undefined,
3333
+ id: item.id !== undefined ? {
3334
+ equals: item.id
3335
+ } : undefined,
3336
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3337
+ equals: item.alpacaAccountId
3338
+ } : undefined,
2926
3339
  },
2927
3340
  create: {
2928
3341
  message: item.message !== undefined ? item.message : undefined,
@@ -2942,7 +3355,12 @@ exports.Asset = {
2942
3355
  }
2943
3356
  : { connectOrCreate: {
2944
3357
  where: {
2945
- id: item.action.id !== undefined ? item.action.id : undefined,
3358
+ id: item.action.id !== undefined ? {
3359
+ equals: item.action.id
3360
+ } : undefined,
3361
+ tradeId: item.action.tradeId !== undefined ? {
3362
+ equals: item.action.tradeId
3363
+ } : undefined,
2946
3364
  },
2947
3365
  create: {
2948
3366
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2958,7 +3376,15 @@ exports.Asset = {
2958
3376
  }
2959
3377
  : { connectOrCreate: {
2960
3378
  where: {
2961
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
3379
+ id: item.action.trade.id !== undefined ? {
3380
+ equals: item.action.trade.id
3381
+ } : undefined,
3382
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
3383
+ equals: item.action.trade.alpacaAccountId
3384
+ } : undefined,
3385
+ assetId: item.action.trade.assetId !== undefined ? {
3386
+ equals: item.action.trade.assetId
3387
+ } : undefined,
2962
3388
  },
2963
3389
  create: {
2964
3390
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -2984,7 +3410,15 @@ exports.Asset = {
2984
3410
  positions: props.positions ? {
2985
3411
  upsert: props.positions.map((item) => ({
2986
3412
  where: {
2987
- id: item.id !== undefined ? item.id : undefined,
3413
+ id: item.id !== undefined ? {
3414
+ equals: item.id
3415
+ } : undefined,
3416
+ assetId: item.assetId !== undefined ? {
3417
+ equals: item.assetId
3418
+ } : undefined,
3419
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3420
+ equals: item.alpacaAccountId
3421
+ } : undefined,
2988
3422
  },
2989
3423
  update: {
2990
3424
  id: item.id !== undefined ? {
@@ -3035,6 +3469,9 @@ exports.Asset = {
3035
3469
  id: item.alpacaAccount.id !== undefined ? {
3036
3470
  equals: item.alpacaAccount.id
3037
3471
  } : undefined,
3472
+ userId: item.alpacaAccount.userId !== undefined ? {
3473
+ equals: item.alpacaAccount.userId
3474
+ } : undefined,
3038
3475
  },
3039
3476
  update: {
3040
3477
  id: item.alpacaAccount.id !== undefined ? {
@@ -3136,7 +3573,15 @@ exports.Asset = {
3136
3573
  trades: item.alpacaAccount.trades ? {
3137
3574
  upsert: item.alpacaAccount.trades.map((item) => ({
3138
3575
  where: {
3139
- id: item.id !== undefined ? item.id : undefined,
3576
+ id: item.id !== undefined ? {
3577
+ equals: item.id
3578
+ } : undefined,
3579
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3580
+ equals: item.alpacaAccountId
3581
+ } : undefined,
3582
+ assetId: item.assetId !== undefined ? {
3583
+ equals: item.assetId
3584
+ } : undefined,
3140
3585
  },
3141
3586
  update: {
3142
3587
  id: item.id !== undefined ? {
@@ -3194,7 +3639,18 @@ exports.Asset = {
3194
3639
  orders: item.alpacaAccount.orders ? {
3195
3640
  upsert: item.alpacaAccount.orders.map((item) => ({
3196
3641
  where: {
3197
- id: item.id !== undefined ? item.id : undefined,
3642
+ id: item.id !== undefined ? {
3643
+ equals: item.id
3644
+ } : undefined,
3645
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3646
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3647
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3648
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3649
+ equals: item.alpacaAccountId
3650
+ } : undefined,
3651
+ assetId: item.assetId !== undefined ? {
3652
+ equals: item.assetId
3653
+ } : undefined,
3198
3654
  },
3199
3655
  update: {
3200
3656
  id: item.id !== undefined ? {
@@ -3296,7 +3752,12 @@ exports.Asset = {
3296
3752
  alerts: item.alpacaAccount.alerts ? {
3297
3753
  upsert: item.alpacaAccount.alerts.map((item) => ({
3298
3754
  where: {
3299
- id: item.id !== undefined ? item.id : undefined,
3755
+ id: item.id !== undefined ? {
3756
+ equals: item.id
3757
+ } : undefined,
3758
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3759
+ equals: item.alpacaAccountId
3760
+ } : undefined,
3300
3761
  },
3301
3762
  update: {
3302
3763
  id: item.id !== undefined ? {
@@ -3338,7 +3799,9 @@ exports.Asset = {
3338
3799
  }
3339
3800
  : { connectOrCreate: {
3340
3801
  where: {
3341
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
3802
+ id: item.alpacaAccount.user.id !== undefined ? {
3803
+ equals: item.alpacaAccount.user.id
3804
+ } : undefined,
3342
3805
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
3343
3806
  name: item.alpacaAccount.user.name !== undefined ? {
3344
3807
  equals: item.alpacaAccount.user.name
@@ -3367,7 +3830,15 @@ exports.Asset = {
3367
3830
  }
3368
3831
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3369
3832
  where: {
3370
- id: item.id !== undefined ? item.id : undefined,
3833
+ id: item.id !== undefined ? {
3834
+ equals: item.id
3835
+ } : undefined,
3836
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3837
+ equals: item.alpacaAccountId
3838
+ } : undefined,
3839
+ assetId: item.assetId !== undefined ? {
3840
+ equals: item.assetId
3841
+ } : undefined,
3371
3842
  },
3372
3843
  create: {
3373
3844
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3392,7 +3863,18 @@ exports.Asset = {
3392
3863
  }
3393
3864
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3394
3865
  where: {
3395
- id: item.id !== undefined ? item.id : undefined,
3866
+ id: item.id !== undefined ? {
3867
+ equals: item.id
3868
+ } : undefined,
3869
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3870
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3871
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3872
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3873
+ equals: item.alpacaAccountId
3874
+ } : undefined,
3875
+ assetId: item.assetId !== undefined ? {
3876
+ equals: item.assetId
3877
+ } : undefined,
3396
3878
  },
3397
3879
  create: {
3398
3880
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3428,7 +3910,12 @@ exports.Asset = {
3428
3910
  }
3429
3911
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3430
3912
  where: {
3431
- id: item.id !== undefined ? item.id : undefined,
3913
+ id: item.id !== undefined ? {
3914
+ equals: item.id
3915
+ } : undefined,
3916
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3917
+ equals: item.alpacaAccountId
3918
+ } : undefined,
3432
3919
  },
3433
3920
  create: {
3434
3921
  message: item.message !== undefined ? item.message : undefined,
@@ -3463,7 +3950,12 @@ exports.Asset = {
3463
3950
  }
3464
3951
  : { connectOrCreate: {
3465
3952
  where: {
3466
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
3953
+ id: item.alpacaAccount.id !== undefined ? {
3954
+ equals: item.alpacaAccount.id
3955
+ } : undefined,
3956
+ userId: item.alpacaAccount.userId !== undefined ? {
3957
+ equals: item.alpacaAccount.userId
3958
+ } : undefined,
3467
3959
  },
3468
3960
  create: {
3469
3961
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -3483,7 +3975,9 @@ exports.Asset = {
3483
3975
  }
3484
3976
  : { connectOrCreate: {
3485
3977
  where: {
3486
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
3978
+ id: item.alpacaAccount.user.id !== undefined ? {
3979
+ equals: item.alpacaAccount.user.id
3980
+ } : undefined,
3487
3981
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
3488
3982
  name: item.alpacaAccount.user.name !== undefined ? {
3489
3983
  equals: item.alpacaAccount.user.name
@@ -3512,7 +4006,15 @@ exports.Asset = {
3512
4006
  }
3513
4007
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
3514
4008
  where: {
3515
- id: item.id !== undefined ? item.id : undefined,
4009
+ id: item.id !== undefined ? {
4010
+ equals: item.id
4011
+ } : undefined,
4012
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4013
+ equals: item.alpacaAccountId
4014
+ } : undefined,
4015
+ assetId: item.assetId !== undefined ? {
4016
+ equals: item.assetId
4017
+ } : undefined,
3516
4018
  },
3517
4019
  create: {
3518
4020
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -3537,7 +4039,18 @@ exports.Asset = {
3537
4039
  }
3538
4040
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
3539
4041
  where: {
3540
- id: item.id !== undefined ? item.id : undefined,
4042
+ id: item.id !== undefined ? {
4043
+ equals: item.id
4044
+ } : undefined,
4045
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4046
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4047
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4048
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4049
+ equals: item.alpacaAccountId
4050
+ } : undefined,
4051
+ assetId: item.assetId !== undefined ? {
4052
+ equals: item.assetId
4053
+ } : undefined,
3541
4054
  },
3542
4055
  create: {
3543
4056
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -3573,7 +4086,12 @@ exports.Asset = {
3573
4086
  }
3574
4087
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
3575
4088
  where: {
3576
- id: item.id !== undefined ? item.id : undefined,
4089
+ id: item.id !== undefined ? {
4090
+ equals: item.id
4091
+ } : undefined,
4092
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4093
+ equals: item.alpacaAccountId
4094
+ } : undefined,
3577
4095
  },
3578
4096
  create: {
3579
4097
  message: item.message !== undefined ? item.message : undefined,
@@ -3591,8 +4109,16 @@ exports.Asset = {
3591
4109
  newsMentions: props.newsMentions ? {
3592
4110
  upsert: props.newsMentions.map((item) => ({
3593
4111
  where: {
3594
- id: item.id !== undefined ? item.id : undefined,
4112
+ id: item.id !== undefined ? {
4113
+ equals: item.id
4114
+ } : undefined,
3595
4115
  url: item.url !== undefined ? item.url : undefined,
4116
+ assetId: item.assetId !== undefined ? {
4117
+ equals: item.assetId
4118
+ } : undefined,
4119
+ newsArticleId: item.newsArticleId !== undefined ? {
4120
+ equals: item.newsArticleId
4121
+ } : undefined,
3596
4122
  },
3597
4123
  update: {
3598
4124
  id: item.id !== undefined ? {
@@ -3698,7 +4224,9 @@ exports.Asset = {
3698
4224
  }
3699
4225
  : { connectOrCreate: {
3700
4226
  where: {
3701
- id: item.news.id !== undefined ? item.news.id : undefined,
4227
+ id: item.news.id !== undefined ? {
4228
+ equals: item.news.id
4229
+ } : undefined,
3702
4230
  url: item.news.url !== undefined ? item.news.url : undefined,
3703
4231
  title: item.news.title !== undefined ? {
3704
4232
  equals: item.news.title
@@ -3758,7 +4286,9 @@ exports.Asset = {
3758
4286
  }`;
3759
4287
  const variables = props.map(prop => ({
3760
4288
  where: {
3761
- id: prop.id !== undefined ? prop.id : undefined,
4289
+ id: prop.id !== undefined ? {
4290
+ equals: prop.id
4291
+ } : undefined,
3762
4292
  symbol: prop.symbol !== undefined ? prop.symbol : undefined,
3763
4293
  name: prop.name !== undefined ? prop.name : undefined,
3764
4294
  type: prop.type !== undefined ? prop.type : undefined,
@@ -3812,8 +4342,6 @@ exports.Asset = {
3812
4342
  sharesOutstanding: prop.sharesOutstanding !== undefined ? prop.sharesOutstanding : undefined,
3813
4343
  dividendDate: prop.dividendDate !== undefined ? prop.dividendDate : undefined,
3814
4344
  exDividendDate: prop.exDividendDate !== undefined ? prop.exDividendDate : undefined,
3815
- askPrice: prop.askPrice !== undefined ? prop.askPrice : undefined,
3816
- bidPrice: prop.bidPrice !== undefined ? prop.bidPrice : undefined,
3817
4345
  createdAt: prop.createdAt !== undefined ? prop.createdAt : undefined,
3818
4346
  updatedAt: prop.updatedAt !== undefined ? prop.updatedAt : undefined,
3819
4347
  },
@@ -3995,7 +4523,15 @@ exports.Asset = {
3995
4523
  trades: prop.trades ? {
3996
4524
  upsert: prop.trades.map((item) => ({
3997
4525
  where: {
3998
- id: item.id !== undefined ? item.id : undefined,
4526
+ id: item.id !== undefined ? {
4527
+ equals: item.id
4528
+ } : undefined,
4529
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4530
+ equals: item.alpacaAccountId
4531
+ } : undefined,
4532
+ assetId: item.assetId !== undefined ? {
4533
+ equals: item.assetId
4534
+ } : undefined,
3999
4535
  },
4000
4536
  update: {
4001
4537
  id: item.id !== undefined ? {
@@ -4040,6 +4576,9 @@ exports.Asset = {
4040
4576
  id: item.alpacaAccount.id !== undefined ? {
4041
4577
  equals: item.alpacaAccount.id
4042
4578
  } : undefined,
4579
+ userId: item.alpacaAccount.userId !== undefined ? {
4580
+ equals: item.alpacaAccount.userId
4581
+ } : undefined,
4043
4582
  },
4044
4583
  update: {
4045
4584
  id: item.alpacaAccount.id !== undefined ? {
@@ -4141,7 +4680,18 @@ exports.Asset = {
4141
4680
  orders: item.alpacaAccount.orders ? {
4142
4681
  upsert: item.alpacaAccount.orders.map((item) => ({
4143
4682
  where: {
4144
- id: item.id !== undefined ? item.id : undefined,
4683
+ id: item.id !== undefined ? {
4684
+ equals: item.id
4685
+ } : undefined,
4686
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4687
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4688
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4689
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4690
+ equals: item.alpacaAccountId
4691
+ } : undefined,
4692
+ assetId: item.assetId !== undefined ? {
4693
+ equals: item.assetId
4694
+ } : undefined,
4145
4695
  },
4146
4696
  update: {
4147
4697
  id: item.id !== undefined ? {
@@ -4243,7 +4793,15 @@ exports.Asset = {
4243
4793
  positions: item.alpacaAccount.positions ? {
4244
4794
  upsert: item.alpacaAccount.positions.map((item) => ({
4245
4795
  where: {
4246
- id: item.id !== undefined ? item.id : undefined,
4796
+ id: item.id !== undefined ? {
4797
+ equals: item.id
4798
+ } : undefined,
4799
+ assetId: item.assetId !== undefined ? {
4800
+ equals: item.assetId
4801
+ } : undefined,
4802
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4803
+ equals: item.alpacaAccountId
4804
+ } : undefined,
4247
4805
  },
4248
4806
  update: {
4249
4807
  id: item.id !== undefined ? {
@@ -4309,7 +4867,12 @@ exports.Asset = {
4309
4867
  alerts: item.alpacaAccount.alerts ? {
4310
4868
  upsert: item.alpacaAccount.alerts.map((item) => ({
4311
4869
  where: {
4312
- id: item.id !== undefined ? item.id : undefined,
4870
+ id: item.id !== undefined ? {
4871
+ equals: item.id
4872
+ } : undefined,
4873
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4874
+ equals: item.alpacaAccountId
4875
+ } : undefined,
4313
4876
  },
4314
4877
  update: {
4315
4878
  id: item.id !== undefined ? {
@@ -4351,7 +4914,9 @@ exports.Asset = {
4351
4914
  }
4352
4915
  : { connectOrCreate: {
4353
4916
  where: {
4354
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
4917
+ id: item.alpacaAccount.user.id !== undefined ? {
4918
+ equals: item.alpacaAccount.user.id
4919
+ } : undefined,
4355
4920
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
4356
4921
  name: item.alpacaAccount.user.name !== undefined ? {
4357
4922
  equals: item.alpacaAccount.user.name
@@ -4380,7 +4945,18 @@ exports.Asset = {
4380
4945
  }
4381
4946
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4382
4947
  where: {
4383
- id: item.id !== undefined ? item.id : undefined,
4948
+ id: item.id !== undefined ? {
4949
+ equals: item.id
4950
+ } : undefined,
4951
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
4952
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
4953
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
4954
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4955
+ equals: item.alpacaAccountId
4956
+ } : undefined,
4957
+ assetId: item.assetId !== undefined ? {
4958
+ equals: item.assetId
4959
+ } : undefined,
4384
4960
  },
4385
4961
  create: {
4386
4962
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4416,7 +4992,15 @@ exports.Asset = {
4416
4992
  }
4417
4993
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4418
4994
  where: {
4419
- id: item.id !== undefined ? item.id : undefined,
4995
+ id: item.id !== undefined ? {
4996
+ equals: item.id
4997
+ } : undefined,
4998
+ assetId: item.assetId !== undefined ? {
4999
+ equals: item.assetId
5000
+ } : undefined,
5001
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5002
+ equals: item.alpacaAccountId
5003
+ } : undefined,
4420
5004
  },
4421
5005
  create: {
4422
5006
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4443,7 +5027,12 @@ exports.Asset = {
4443
5027
  }
4444
5028
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4445
5029
  where: {
4446
- id: item.id !== undefined ? item.id : undefined,
5030
+ id: item.id !== undefined ? {
5031
+ equals: item.id
5032
+ } : undefined,
5033
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5034
+ equals: item.alpacaAccountId
5035
+ } : undefined,
4447
5036
  },
4448
5037
  create: {
4449
5038
  message: item.message !== undefined ? item.message : undefined,
@@ -4458,7 +5047,12 @@ exports.Asset = {
4458
5047
  actions: item.actions ? {
4459
5048
  upsert: item.actions.map((item) => ({
4460
5049
  where: {
4461
- id: item.id !== undefined ? item.id : undefined,
5050
+ id: item.id !== undefined ? {
5051
+ equals: item.id
5052
+ } : undefined,
5053
+ tradeId: item.tradeId !== undefined ? {
5054
+ equals: item.tradeId
5055
+ } : undefined,
4462
5056
  },
4463
5057
  update: {
4464
5058
  id: item.id !== undefined ? {
@@ -4485,6 +5079,18 @@ exports.Asset = {
4485
5079
  id: item.order.id !== undefined ? {
4486
5080
  equals: item.order.id
4487
5081
  } : undefined,
5082
+ clientOrderId: item.order.clientOrderId !== undefined ? {
5083
+ equals: item.order.clientOrderId
5084
+ } : undefined,
5085
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5086
+ equals: item.order.alpacaAccountId
5087
+ } : undefined,
5088
+ assetId: item.order.assetId !== undefined ? {
5089
+ equals: item.order.assetId
5090
+ } : undefined,
5091
+ actionId: item.order.actionId !== undefined ? {
5092
+ equals: item.order.actionId
5093
+ } : undefined,
4488
5094
  },
4489
5095
  update: {
4490
5096
  id: item.order.id !== undefined ? {
@@ -4598,7 +5204,18 @@ exports.Asset = {
4598
5204
  }
4599
5205
  : { connectOrCreate: {
4600
5206
  where: {
4601
- id: item.order.id !== undefined ? item.order.id : undefined,
5207
+ id: item.order.id !== undefined ? {
5208
+ equals: item.order.id
5209
+ } : undefined,
5210
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5211
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5212
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5213
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5214
+ equals: item.order.alpacaAccountId
5215
+ } : undefined,
5216
+ assetId: item.order.assetId !== undefined ? {
5217
+ equals: item.order.assetId
5218
+ } : undefined,
4602
5219
  },
4603
5220
  create: {
4604
5221
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4650,7 +5267,12 @@ exports.Asset = {
4650
5267
  }
4651
5268
  : { connectOrCreate: {
4652
5269
  where: {
4653
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
5270
+ id: item.alpacaAccount.id !== undefined ? {
5271
+ equals: item.alpacaAccount.id
5272
+ } : undefined,
5273
+ userId: item.alpacaAccount.userId !== undefined ? {
5274
+ equals: item.alpacaAccount.userId
5275
+ } : undefined,
4654
5276
  },
4655
5277
  create: {
4656
5278
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -4670,7 +5292,9 @@ exports.Asset = {
4670
5292
  }
4671
5293
  : { connectOrCreate: {
4672
5294
  where: {
4673
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
5295
+ id: item.alpacaAccount.user.id !== undefined ? {
5296
+ equals: item.alpacaAccount.user.id
5297
+ } : undefined,
4674
5298
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
4675
5299
  name: item.alpacaAccount.user.name !== undefined ? {
4676
5300
  equals: item.alpacaAccount.user.name
@@ -4699,7 +5323,18 @@ exports.Asset = {
4699
5323
  }
4700
5324
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
4701
5325
  where: {
4702
- id: item.id !== undefined ? item.id : undefined,
5326
+ id: item.id !== undefined ? {
5327
+ equals: item.id
5328
+ } : undefined,
5329
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5330
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5331
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5332
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5333
+ equals: item.alpacaAccountId
5334
+ } : undefined,
5335
+ assetId: item.assetId !== undefined ? {
5336
+ equals: item.assetId
5337
+ } : undefined,
4703
5338
  },
4704
5339
  create: {
4705
5340
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4735,7 +5370,15 @@ exports.Asset = {
4735
5370
  }
4736
5371
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
4737
5372
  where: {
4738
- id: item.id !== undefined ? item.id : undefined,
5373
+ id: item.id !== undefined ? {
5374
+ equals: item.id
5375
+ } : undefined,
5376
+ assetId: item.assetId !== undefined ? {
5377
+ equals: item.assetId
5378
+ } : undefined,
5379
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5380
+ equals: item.alpacaAccountId
5381
+ } : undefined,
4739
5382
  },
4740
5383
  create: {
4741
5384
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -4762,7 +5405,12 @@ exports.Asset = {
4762
5405
  }
4763
5406
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
4764
5407
  where: {
4765
- id: item.id !== undefined ? item.id : undefined,
5408
+ id: item.id !== undefined ? {
5409
+ equals: item.id
5410
+ } : undefined,
5411
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5412
+ equals: item.alpacaAccountId
5413
+ } : undefined,
4766
5414
  },
4767
5415
  create: {
4768
5416
  message: item.message !== undefined ? item.message : undefined,
@@ -4782,7 +5430,12 @@ exports.Asset = {
4782
5430
  }
4783
5431
  : { connectOrCreate: item.actions.map((item) => ({
4784
5432
  where: {
4785
- id: item.id !== undefined ? item.id : undefined,
5433
+ id: item.id !== undefined ? {
5434
+ equals: item.id
5435
+ } : undefined,
5436
+ tradeId: item.tradeId !== undefined ? {
5437
+ equals: item.tradeId
5438
+ } : undefined,
4786
5439
  },
4787
5440
  create: {
4788
5441
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -4798,7 +5451,18 @@ exports.Asset = {
4798
5451
  }
4799
5452
  : { connectOrCreate: {
4800
5453
  where: {
4801
- id: item.order.id !== undefined ? item.order.id : undefined,
5454
+ id: item.order.id !== undefined ? {
5455
+ equals: item.order.id
5456
+ } : undefined,
5457
+ clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
5458
+ actionId: item.order.actionId !== undefined ? item.order.actionId : undefined,
5459
+ stopLossId: item.order.stopLossId !== undefined ? item.order.stopLossId : undefined,
5460
+ alpacaAccountId: item.order.alpacaAccountId !== undefined ? {
5461
+ equals: item.order.alpacaAccountId
5462
+ } : undefined,
5463
+ assetId: item.order.assetId !== undefined ? {
5464
+ equals: item.order.assetId
5465
+ } : undefined,
4802
5466
  },
4803
5467
  create: {
4804
5468
  clientOrderId: item.order.clientOrderId !== undefined ? item.order.clientOrderId : undefined,
@@ -4835,7 +5499,18 @@ exports.Asset = {
4835
5499
  orders: prop.orders ? {
4836
5500
  upsert: prop.orders.map((item) => ({
4837
5501
  where: {
4838
- id: item.id !== undefined ? item.id : undefined,
5502
+ id: item.id !== undefined ? {
5503
+ equals: item.id
5504
+ } : undefined,
5505
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5506
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5507
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5508
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5509
+ equals: item.alpacaAccountId
5510
+ } : undefined,
5511
+ assetId: item.assetId !== undefined ? {
5512
+ equals: item.assetId
5513
+ } : undefined,
4839
5514
  },
4840
5515
  update: {
4841
5516
  id: item.id !== undefined ? {
@@ -4913,6 +5588,9 @@ exports.Asset = {
4913
5588
  id: item.stopLoss.id !== undefined ? {
4914
5589
  equals: item.stopLoss.id
4915
5590
  } : undefined,
5591
+ orderId: item.stopLoss.orderId !== undefined ? {
5592
+ equals: item.stopLoss.orderId
5593
+ } : undefined,
4916
5594
  },
4917
5595
  update: {
4918
5596
  id: item.stopLoss.id !== undefined ? {
@@ -4937,6 +5615,9 @@ exports.Asset = {
4937
5615
  id: item.takeProfit.id !== undefined ? {
4938
5616
  equals: item.takeProfit.id
4939
5617
  } : undefined,
5618
+ orderId: item.takeProfit.orderId !== undefined ? {
5619
+ equals: item.takeProfit.orderId
5620
+ } : undefined,
4940
5621
  },
4941
5622
  update: {
4942
5623
  id: item.takeProfit.id !== undefined ? {
@@ -4961,6 +5642,9 @@ exports.Asset = {
4961
5642
  id: item.alpacaAccount.id !== undefined ? {
4962
5643
  equals: item.alpacaAccount.id
4963
5644
  } : undefined,
5645
+ userId: item.alpacaAccount.userId !== undefined ? {
5646
+ equals: item.alpacaAccount.userId
5647
+ } : undefined,
4964
5648
  },
4965
5649
  update: {
4966
5650
  id: item.alpacaAccount.id !== undefined ? {
@@ -5062,7 +5746,15 @@ exports.Asset = {
5062
5746
  trades: item.alpacaAccount.trades ? {
5063
5747
  upsert: item.alpacaAccount.trades.map((item) => ({
5064
5748
  where: {
5065
- id: item.id !== undefined ? item.id : undefined,
5749
+ id: item.id !== undefined ? {
5750
+ equals: item.id
5751
+ } : undefined,
5752
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5753
+ equals: item.alpacaAccountId
5754
+ } : undefined,
5755
+ assetId: item.assetId !== undefined ? {
5756
+ equals: item.assetId
5757
+ } : undefined,
5066
5758
  },
5067
5759
  update: {
5068
5760
  id: item.id !== undefined ? {
@@ -5120,7 +5812,15 @@ exports.Asset = {
5120
5812
  positions: item.alpacaAccount.positions ? {
5121
5813
  upsert: item.alpacaAccount.positions.map((item) => ({
5122
5814
  where: {
5123
- id: item.id !== undefined ? item.id : undefined,
5815
+ id: item.id !== undefined ? {
5816
+ equals: item.id
5817
+ } : undefined,
5818
+ assetId: item.assetId !== undefined ? {
5819
+ equals: item.assetId
5820
+ } : undefined,
5821
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5822
+ equals: item.alpacaAccountId
5823
+ } : undefined,
5124
5824
  },
5125
5825
  update: {
5126
5826
  id: item.id !== undefined ? {
@@ -5186,7 +5886,12 @@ exports.Asset = {
5186
5886
  alerts: item.alpacaAccount.alerts ? {
5187
5887
  upsert: item.alpacaAccount.alerts.map((item) => ({
5188
5888
  where: {
5189
- id: item.id !== undefined ? item.id : undefined,
5889
+ id: item.id !== undefined ? {
5890
+ equals: item.id
5891
+ } : undefined,
5892
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5893
+ equals: item.alpacaAccountId
5894
+ } : undefined,
5190
5895
  },
5191
5896
  update: {
5192
5897
  id: item.id !== undefined ? {
@@ -5228,7 +5933,9 @@ exports.Asset = {
5228
5933
  }
5229
5934
  : { connectOrCreate: {
5230
5935
  where: {
5231
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
5936
+ id: item.alpacaAccount.user.id !== undefined ? {
5937
+ equals: item.alpacaAccount.user.id
5938
+ } : undefined,
5232
5939
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
5233
5940
  name: item.alpacaAccount.user.name !== undefined ? {
5234
5941
  equals: item.alpacaAccount.user.name
@@ -5257,7 +5964,15 @@ exports.Asset = {
5257
5964
  }
5258
5965
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5259
5966
  where: {
5260
- id: item.id !== undefined ? item.id : undefined,
5967
+ id: item.id !== undefined ? {
5968
+ equals: item.id
5969
+ } : undefined,
5970
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5971
+ equals: item.alpacaAccountId
5972
+ } : undefined,
5973
+ assetId: item.assetId !== undefined ? {
5974
+ equals: item.assetId
5975
+ } : undefined,
5261
5976
  },
5262
5977
  create: {
5263
5978
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5282,7 +5997,15 @@ exports.Asset = {
5282
5997
  }
5283
5998
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5284
5999
  where: {
5285
- id: item.id !== undefined ? item.id : undefined,
6000
+ id: item.id !== undefined ? {
6001
+ equals: item.id
6002
+ } : undefined,
6003
+ assetId: item.assetId !== undefined ? {
6004
+ equals: item.assetId
6005
+ } : undefined,
6006
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6007
+ equals: item.alpacaAccountId
6008
+ } : undefined,
5286
6009
  },
5287
6010
  create: {
5288
6011
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5309,7 +6032,12 @@ exports.Asset = {
5309
6032
  }
5310
6033
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5311
6034
  where: {
5312
- id: item.id !== undefined ? item.id : undefined,
6035
+ id: item.id !== undefined ? {
6036
+ equals: item.id
6037
+ } : undefined,
6038
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6039
+ equals: item.alpacaAccountId
6040
+ } : undefined,
5313
6041
  },
5314
6042
  create: {
5315
6043
  message: item.message !== undefined ? item.message : undefined,
@@ -5327,6 +6055,9 @@ exports.Asset = {
5327
6055
  id: item.action.id !== undefined ? {
5328
6056
  equals: item.action.id
5329
6057
  } : undefined,
6058
+ tradeId: item.action.tradeId !== undefined ? {
6059
+ equals: item.action.tradeId
6060
+ } : undefined,
5330
6061
  },
5331
6062
  update: {
5332
6063
  id: item.action.id !== undefined ? {
@@ -5353,6 +6084,12 @@ exports.Asset = {
5353
6084
  id: item.action.trade.id !== undefined ? {
5354
6085
  equals: item.action.trade.id
5355
6086
  } : undefined,
6087
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6088
+ equals: item.action.trade.alpacaAccountId
6089
+ } : undefined,
6090
+ assetId: item.action.trade.assetId !== undefined ? {
6091
+ equals: item.action.trade.assetId
6092
+ } : undefined,
5356
6093
  },
5357
6094
  update: {
5358
6095
  id: item.action.trade.id !== undefined ? {
@@ -5422,7 +6159,15 @@ exports.Asset = {
5422
6159
  }
5423
6160
  : { connectOrCreate: {
5424
6161
  where: {
5425
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6162
+ id: item.action.trade.id !== undefined ? {
6163
+ equals: item.action.trade.id
6164
+ } : undefined,
6165
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6166
+ equals: item.action.trade.alpacaAccountId
6167
+ } : undefined,
6168
+ assetId: item.action.trade.assetId !== undefined ? {
6169
+ equals: item.action.trade.assetId
6170
+ } : undefined,
5426
6171
  },
5427
6172
  create: {
5428
6173
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5474,7 +6219,10 @@ exports.Asset = {
5474
6219
  }
5475
6220
  : { connectOrCreate: {
5476
6221
  where: {
5477
- id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
6222
+ id: item.stopLoss.id !== undefined ? {
6223
+ equals: item.stopLoss.id
6224
+ } : undefined,
6225
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
5478
6226
  },
5479
6227
  create: {
5480
6228
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -5490,7 +6238,10 @@ exports.Asset = {
5490
6238
  }
5491
6239
  : { connectOrCreate: {
5492
6240
  where: {
5493
- id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
6241
+ id: item.takeProfit.id !== undefined ? {
6242
+ equals: item.takeProfit.id
6243
+ } : undefined,
6244
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
5494
6245
  },
5495
6246
  create: {
5496
6247
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -5506,7 +6257,12 @@ exports.Asset = {
5506
6257
  }
5507
6258
  : { connectOrCreate: {
5508
6259
  where: {
5509
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
6260
+ id: item.alpacaAccount.id !== undefined ? {
6261
+ equals: item.alpacaAccount.id
6262
+ } : undefined,
6263
+ userId: item.alpacaAccount.userId !== undefined ? {
6264
+ equals: item.alpacaAccount.userId
6265
+ } : undefined,
5510
6266
  },
5511
6267
  create: {
5512
6268
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -5526,7 +6282,9 @@ exports.Asset = {
5526
6282
  }
5527
6283
  : { connectOrCreate: {
5528
6284
  where: {
5529
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
6285
+ id: item.alpacaAccount.user.id !== undefined ? {
6286
+ equals: item.alpacaAccount.user.id
6287
+ } : undefined,
5530
6288
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
5531
6289
  name: item.alpacaAccount.user.name !== undefined ? {
5532
6290
  equals: item.alpacaAccount.user.name
@@ -5555,7 +6313,15 @@ exports.Asset = {
5555
6313
  }
5556
6314
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
5557
6315
  where: {
5558
- id: item.id !== undefined ? item.id : undefined,
6316
+ id: item.id !== undefined ? {
6317
+ equals: item.id
6318
+ } : undefined,
6319
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6320
+ equals: item.alpacaAccountId
6321
+ } : undefined,
6322
+ assetId: item.assetId !== undefined ? {
6323
+ equals: item.assetId
6324
+ } : undefined,
5559
6325
  },
5560
6326
  create: {
5561
6327
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -5580,7 +6346,15 @@ exports.Asset = {
5580
6346
  }
5581
6347
  : { connectOrCreate: item.alpacaAccount.positions.map((item) => ({
5582
6348
  where: {
5583
- id: item.id !== undefined ? item.id : undefined,
6349
+ id: item.id !== undefined ? {
6350
+ equals: item.id
6351
+ } : undefined,
6352
+ assetId: item.assetId !== undefined ? {
6353
+ equals: item.assetId
6354
+ } : undefined,
6355
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6356
+ equals: item.alpacaAccountId
6357
+ } : undefined,
5584
6358
  },
5585
6359
  create: {
5586
6360
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5607,7 +6381,12 @@ exports.Asset = {
5607
6381
  }
5608
6382
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
5609
6383
  where: {
5610
- id: item.id !== undefined ? item.id : undefined,
6384
+ id: item.id !== undefined ? {
6385
+ equals: item.id
6386
+ } : undefined,
6387
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6388
+ equals: item.alpacaAccountId
6389
+ } : undefined,
5611
6390
  },
5612
6391
  create: {
5613
6392
  message: item.message !== undefined ? item.message : undefined,
@@ -5627,7 +6406,12 @@ exports.Asset = {
5627
6406
  }
5628
6407
  : { connectOrCreate: {
5629
6408
  where: {
5630
- id: item.action.id !== undefined ? item.action.id : undefined,
6409
+ id: item.action.id !== undefined ? {
6410
+ equals: item.action.id
6411
+ } : undefined,
6412
+ tradeId: item.action.tradeId !== undefined ? {
6413
+ equals: item.action.tradeId
6414
+ } : undefined,
5631
6415
  },
5632
6416
  create: {
5633
6417
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -5643,7 +6427,15 @@ exports.Asset = {
5643
6427
  }
5644
6428
  : { connectOrCreate: {
5645
6429
  where: {
5646
- id: item.action.trade.id !== undefined ? item.action.trade.id : undefined,
6430
+ id: item.action.trade.id !== undefined ? {
6431
+ equals: item.action.trade.id
6432
+ } : undefined,
6433
+ alpacaAccountId: item.action.trade.alpacaAccountId !== undefined ? {
6434
+ equals: item.action.trade.alpacaAccountId
6435
+ } : undefined,
6436
+ assetId: item.action.trade.assetId !== undefined ? {
6437
+ equals: item.action.trade.assetId
6438
+ } : undefined,
5647
6439
  },
5648
6440
  create: {
5649
6441
  qty: item.action.trade.qty !== undefined ? item.action.trade.qty : undefined,
@@ -5669,7 +6461,15 @@ exports.Asset = {
5669
6461
  positions: prop.positions ? {
5670
6462
  upsert: prop.positions.map((item) => ({
5671
6463
  where: {
5672
- id: item.id !== undefined ? item.id : undefined,
6464
+ id: item.id !== undefined ? {
6465
+ equals: item.id
6466
+ } : undefined,
6467
+ assetId: item.assetId !== undefined ? {
6468
+ equals: item.assetId
6469
+ } : undefined,
6470
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6471
+ equals: item.alpacaAccountId
6472
+ } : undefined,
5673
6473
  },
5674
6474
  update: {
5675
6475
  id: item.id !== undefined ? {
@@ -5720,6 +6520,9 @@ exports.Asset = {
5720
6520
  id: item.alpacaAccount.id !== undefined ? {
5721
6521
  equals: item.alpacaAccount.id
5722
6522
  } : undefined,
6523
+ userId: item.alpacaAccount.userId !== undefined ? {
6524
+ equals: item.alpacaAccount.userId
6525
+ } : undefined,
5723
6526
  },
5724
6527
  update: {
5725
6528
  id: item.alpacaAccount.id !== undefined ? {
@@ -5821,7 +6624,15 @@ exports.Asset = {
5821
6624
  trades: item.alpacaAccount.trades ? {
5822
6625
  upsert: item.alpacaAccount.trades.map((item) => ({
5823
6626
  where: {
5824
- id: item.id !== undefined ? item.id : undefined,
6627
+ id: item.id !== undefined ? {
6628
+ equals: item.id
6629
+ } : undefined,
6630
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6631
+ equals: item.alpacaAccountId
6632
+ } : undefined,
6633
+ assetId: item.assetId !== undefined ? {
6634
+ equals: item.assetId
6635
+ } : undefined,
5825
6636
  },
5826
6637
  update: {
5827
6638
  id: item.id !== undefined ? {
@@ -5879,7 +6690,18 @@ exports.Asset = {
5879
6690
  orders: item.alpacaAccount.orders ? {
5880
6691
  upsert: item.alpacaAccount.orders.map((item) => ({
5881
6692
  where: {
5882
- id: item.id !== undefined ? item.id : undefined,
6693
+ id: item.id !== undefined ? {
6694
+ equals: item.id
6695
+ } : undefined,
6696
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6697
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6698
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6699
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6700
+ equals: item.alpacaAccountId
6701
+ } : undefined,
6702
+ assetId: item.assetId !== undefined ? {
6703
+ equals: item.assetId
6704
+ } : undefined,
5883
6705
  },
5884
6706
  update: {
5885
6707
  id: item.id !== undefined ? {
@@ -5981,7 +6803,12 @@ exports.Asset = {
5981
6803
  alerts: item.alpacaAccount.alerts ? {
5982
6804
  upsert: item.alpacaAccount.alerts.map((item) => ({
5983
6805
  where: {
5984
- id: item.id !== undefined ? item.id : undefined,
6806
+ id: item.id !== undefined ? {
6807
+ equals: item.id
6808
+ } : undefined,
6809
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6810
+ equals: item.alpacaAccountId
6811
+ } : undefined,
5985
6812
  },
5986
6813
  update: {
5987
6814
  id: item.id !== undefined ? {
@@ -6023,7 +6850,9 @@ exports.Asset = {
6023
6850
  }
6024
6851
  : { connectOrCreate: {
6025
6852
  where: {
6026
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
6853
+ id: item.alpacaAccount.user.id !== undefined ? {
6854
+ equals: item.alpacaAccount.user.id
6855
+ } : undefined,
6027
6856
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
6028
6857
  name: item.alpacaAccount.user.name !== undefined ? {
6029
6858
  equals: item.alpacaAccount.user.name
@@ -6052,7 +6881,15 @@ exports.Asset = {
6052
6881
  }
6053
6882
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6054
6883
  where: {
6055
- id: item.id !== undefined ? item.id : undefined,
6884
+ id: item.id !== undefined ? {
6885
+ equals: item.id
6886
+ } : undefined,
6887
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6888
+ equals: item.alpacaAccountId
6889
+ } : undefined,
6890
+ assetId: item.assetId !== undefined ? {
6891
+ equals: item.assetId
6892
+ } : undefined,
6056
6893
  },
6057
6894
  create: {
6058
6895
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6077,7 +6914,18 @@ exports.Asset = {
6077
6914
  }
6078
6915
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6079
6916
  where: {
6080
- id: item.id !== undefined ? item.id : undefined,
6917
+ id: item.id !== undefined ? {
6918
+ equals: item.id
6919
+ } : undefined,
6920
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
6921
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
6922
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
6923
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6924
+ equals: item.alpacaAccountId
6925
+ } : undefined,
6926
+ assetId: item.assetId !== undefined ? {
6927
+ equals: item.assetId
6928
+ } : undefined,
6081
6929
  },
6082
6930
  create: {
6083
6931
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6113,7 +6961,12 @@ exports.Asset = {
6113
6961
  }
6114
6962
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6115
6963
  where: {
6116
- id: item.id !== undefined ? item.id : undefined,
6964
+ id: item.id !== undefined ? {
6965
+ equals: item.id
6966
+ } : undefined,
6967
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
6968
+ equals: item.alpacaAccountId
6969
+ } : undefined,
6117
6970
  },
6118
6971
  create: {
6119
6972
  message: item.message !== undefined ? item.message : undefined,
@@ -6148,7 +7001,12 @@ exports.Asset = {
6148
7001
  }
6149
7002
  : { connectOrCreate: {
6150
7003
  where: {
6151
- id: item.alpacaAccount.id !== undefined ? item.alpacaAccount.id : undefined,
7004
+ id: item.alpacaAccount.id !== undefined ? {
7005
+ equals: item.alpacaAccount.id
7006
+ } : undefined,
7007
+ userId: item.alpacaAccount.userId !== undefined ? {
7008
+ equals: item.alpacaAccount.userId
7009
+ } : undefined,
6152
7010
  },
6153
7011
  create: {
6154
7012
  type: item.alpacaAccount.type !== undefined ? item.alpacaAccount.type : undefined,
@@ -6168,7 +7026,9 @@ exports.Asset = {
6168
7026
  }
6169
7027
  : { connectOrCreate: {
6170
7028
  where: {
6171
- id: item.alpacaAccount.user.id !== undefined ? item.alpacaAccount.user.id : undefined,
7029
+ id: item.alpacaAccount.user.id !== undefined ? {
7030
+ equals: item.alpacaAccount.user.id
7031
+ } : undefined,
6172
7032
  email: item.alpacaAccount.user.email !== undefined ? item.alpacaAccount.user.email : undefined,
6173
7033
  name: item.alpacaAccount.user.name !== undefined ? {
6174
7034
  equals: item.alpacaAccount.user.name
@@ -6197,7 +7057,15 @@ exports.Asset = {
6197
7057
  }
6198
7058
  : { connectOrCreate: item.alpacaAccount.trades.map((item) => ({
6199
7059
  where: {
6200
- id: item.id !== undefined ? item.id : undefined,
7060
+ id: item.id !== undefined ? {
7061
+ equals: item.id
7062
+ } : undefined,
7063
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7064
+ equals: item.alpacaAccountId
7065
+ } : undefined,
7066
+ assetId: item.assetId !== undefined ? {
7067
+ equals: item.assetId
7068
+ } : undefined,
6201
7069
  },
6202
7070
  create: {
6203
7071
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -6222,7 +7090,18 @@ exports.Asset = {
6222
7090
  }
6223
7091
  : { connectOrCreate: item.alpacaAccount.orders.map((item) => ({
6224
7092
  where: {
6225
- id: item.id !== undefined ? item.id : undefined,
7093
+ id: item.id !== undefined ? {
7094
+ equals: item.id
7095
+ } : undefined,
7096
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
7097
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
7098
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
7099
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7100
+ equals: item.alpacaAccountId
7101
+ } : undefined,
7102
+ assetId: item.assetId !== undefined ? {
7103
+ equals: item.assetId
7104
+ } : undefined,
6226
7105
  },
6227
7106
  create: {
6228
7107
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -6258,7 +7137,12 @@ exports.Asset = {
6258
7137
  }
6259
7138
  : { connectOrCreate: item.alpacaAccount.alerts.map((item) => ({
6260
7139
  where: {
6261
- id: item.id !== undefined ? item.id : undefined,
7140
+ id: item.id !== undefined ? {
7141
+ equals: item.id
7142
+ } : undefined,
7143
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
7144
+ equals: item.alpacaAccountId
7145
+ } : undefined,
6262
7146
  },
6263
7147
  create: {
6264
7148
  message: item.message !== undefined ? item.message : undefined,
@@ -6276,8 +7160,16 @@ exports.Asset = {
6276
7160
  newsMentions: prop.newsMentions ? {
6277
7161
  upsert: prop.newsMentions.map((item) => ({
6278
7162
  where: {
6279
- id: item.id !== undefined ? item.id : undefined,
7163
+ id: item.id !== undefined ? {
7164
+ equals: item.id
7165
+ } : undefined,
6280
7166
  url: item.url !== undefined ? item.url : undefined,
7167
+ assetId: item.assetId !== undefined ? {
7168
+ equals: item.assetId
7169
+ } : undefined,
7170
+ newsArticleId: item.newsArticleId !== undefined ? {
7171
+ equals: item.newsArticleId
7172
+ } : undefined,
6281
7173
  },
6282
7174
  update: {
6283
7175
  id: item.id !== undefined ? {
@@ -6383,7 +7275,9 @@ exports.Asset = {
6383
7275
  }
6384
7276
  : { connectOrCreate: {
6385
7277
  where: {
6386
- id: item.news.id !== undefined ? item.news.id : undefined,
7278
+ id: item.news.id !== undefined ? {
7279
+ equals: item.news.id
7280
+ } : undefined,
6387
7281
  url: item.news.url !== undefined ? item.news.url : undefined,
6388
7282
  title: item.news.title !== undefined ? {
6389
7283
  equals: item.news.title
@@ -6479,7 +7373,9 @@ exports.Asset = {
6479
7373
  }`;
6480
7374
  const variables = {
6481
7375
  where: {
6482
- id: props.id !== undefined ? props.id : undefined,
7376
+ id: props.id !== undefined ? {
7377
+ equals: props.id
7378
+ } : undefined,
6483
7379
  symbol: props.symbol !== undefined ? props.symbol : undefined,
6484
7380
  name: props.name !== undefined ? props.name : undefined,
6485
7381
  type: props.type !== undefined ? props.type : undefined,
@@ -6533,8 +7429,6 @@ exports.Asset = {
6533
7429
  sharesOutstanding: props.sharesOutstanding !== undefined ? props.sharesOutstanding : undefined,
6534
7430
  dividendDate: props.dividendDate !== undefined ? props.dividendDate : undefined,
6535
7431
  exDividendDate: props.exDividendDate !== undefined ? props.exDividendDate : undefined,
6536
- askPrice: props.askPrice !== undefined ? props.askPrice : undefined,
6537
- bidPrice: props.bidPrice !== undefined ? props.bidPrice : undefined,
6538
7432
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
6539
7433
  updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
6540
7434
  },
@@ -6660,8 +7554,6 @@ exports.Asset = {
6660
7554
  sharesOutstanding: props.sharesOutstanding !== undefined ? props.sharesOutstanding : undefined,
6661
7555
  dividendDate: props.dividendDate !== undefined ? props.dividendDate : undefined,
6662
7556
  exDividendDate: props.exDividendDate !== undefined ? props.exDividendDate : undefined,
6663
- askPrice: props.askPrice !== undefined ? props.askPrice : undefined,
6664
- bidPrice: props.bidPrice !== undefined ? props.bidPrice : undefined,
6665
7557
  createdAt: props.createdAt !== undefined ? props.createdAt : undefined,
6666
7558
  updatedAt: props.updatedAt !== undefined ? props.updatedAt : undefined,
6667
7559
  },