adaptic-backend 1.0.52 → 1.0.54

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 (133) hide show
  1. package/AIRecommendation.cjs +1413 -1
  2. package/AIRecommendation.d.ts +10 -1
  3. package/Account.cjs +588 -1
  4. package/Account.d.ts +10 -1
  5. package/Alert.cjs +993 -1
  6. package/Alert.d.ts +10 -1
  7. package/AlpacaAccount.cjs +600 -1
  8. package/AlpacaAccount.d.ts +10 -1
  9. package/Asset.cjs +988 -1
  10. package/Asset.d.ts +10 -1
  11. package/Authenticator.cjs +602 -1
  12. package/Authenticator.d.ts +10 -1
  13. package/Customer.cjs +582 -1
  14. package/Customer.d.ts +10 -1
  15. package/EconomicEvent.cjs +54 -1
  16. package/EconomicEvent.d.ts +10 -1
  17. package/EnvironmentVariable.cjs +439 -1
  18. package/EnvironmentVariable.d.ts +10 -1
  19. package/Holding.cjs +851 -1
  20. package/Holding.d.ts +10 -1
  21. package/NewsArticle.cjs +408 -1
  22. package/NewsArticle.d.ts +10 -1
  23. package/NewsArticleAssetSentiment.cjs +530 -1
  24. package/NewsArticleAssetSentiment.d.ts +10 -1
  25. package/Order.cjs +1374 -1
  26. package/Order.d.ts +10 -1
  27. package/PerformanceMetric.cjs +1003 -1
  28. package/PerformanceMetric.d.ts +10 -1
  29. package/RiskAllocation.cjs +1000 -1
  30. package/RiskAllocation.d.ts +10 -1
  31. package/Session.cjs +604 -1
  32. package/Session.d.ts +10 -1
  33. package/Trade.cjs +1430 -1
  34. package/Trade.d.ts +10 -1
  35. package/TradeStep.cjs +528 -1
  36. package/TradeStep.d.ts +10 -1
  37. package/TradingAccount.cjs +2586 -1
  38. package/TradingAccount.d.ts +10 -1
  39. package/User.cjs +2044 -1
  40. package/User.d.ts +10 -1
  41. package/VerificationToken.cjs +48 -1
  42. package/VerificationToken.d.ts +10 -1
  43. package/client.cjs +2 -2
  44. package/index.d.ts +63 -0
  45. package/package.json +1 -1
  46. package/server/AIRecommendation.d.ts +10 -1
  47. package/server/AIRecommendation.d.ts.map +1 -1
  48. package/server/AIRecommendation.js.map +1 -1
  49. package/server/AIRecommendation.mjs +1413 -1
  50. package/server/Account.d.ts +10 -1
  51. package/server/Account.d.ts.map +1 -1
  52. package/server/Account.js.map +1 -1
  53. package/server/Account.mjs +588 -1
  54. package/server/Alert.d.ts +10 -1
  55. package/server/Alert.d.ts.map +1 -1
  56. package/server/Alert.js.map +1 -1
  57. package/server/Alert.mjs +993 -1
  58. package/server/AlpacaAccount.d.ts +10 -1
  59. package/server/AlpacaAccount.d.ts.map +1 -1
  60. package/server/AlpacaAccount.js.map +1 -1
  61. package/server/AlpacaAccount.mjs +600 -1
  62. package/server/Asset.d.ts +10 -1
  63. package/server/Asset.d.ts.map +1 -1
  64. package/server/Asset.js.map +1 -1
  65. package/server/Asset.mjs +988 -1
  66. package/server/Authenticator.d.ts +10 -1
  67. package/server/Authenticator.d.ts.map +1 -1
  68. package/server/Authenticator.js.map +1 -1
  69. package/server/Authenticator.mjs +602 -1
  70. package/server/Customer.d.ts +10 -1
  71. package/server/Customer.d.ts.map +1 -1
  72. package/server/Customer.js.map +1 -1
  73. package/server/Customer.mjs +582 -1
  74. package/server/EconomicEvent.d.ts +10 -1
  75. package/server/EconomicEvent.d.ts.map +1 -1
  76. package/server/EconomicEvent.js.map +1 -1
  77. package/server/EconomicEvent.mjs +54 -1
  78. package/server/EnvironmentVariable.d.ts +10 -1
  79. package/server/EnvironmentVariable.d.ts.map +1 -1
  80. package/server/EnvironmentVariable.js.map +1 -1
  81. package/server/EnvironmentVariable.mjs +439 -1
  82. package/server/Holding.d.ts +10 -1
  83. package/server/Holding.d.ts.map +1 -1
  84. package/server/Holding.js.map +1 -1
  85. package/server/Holding.mjs +851 -1
  86. package/server/NewsArticle.d.ts +10 -1
  87. package/server/NewsArticle.d.ts.map +1 -1
  88. package/server/NewsArticle.js.map +1 -1
  89. package/server/NewsArticle.mjs +408 -1
  90. package/server/NewsArticleAssetSentiment.d.ts +10 -1
  91. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  92. package/server/NewsArticleAssetSentiment.js.map +1 -1
  93. package/server/NewsArticleAssetSentiment.mjs +530 -1
  94. package/server/Order.d.ts +10 -1
  95. package/server/Order.d.ts.map +1 -1
  96. package/server/Order.js.map +1 -1
  97. package/server/Order.mjs +1374 -1
  98. package/server/PerformanceMetric.d.ts +10 -1
  99. package/server/PerformanceMetric.d.ts.map +1 -1
  100. package/server/PerformanceMetric.js.map +1 -1
  101. package/server/PerformanceMetric.mjs +1003 -1
  102. package/server/RiskAllocation.d.ts +10 -1
  103. package/server/RiskAllocation.d.ts.map +1 -1
  104. package/server/RiskAllocation.js.map +1 -1
  105. package/server/RiskAllocation.mjs +1000 -1
  106. package/server/Session.d.ts +10 -1
  107. package/server/Session.d.ts.map +1 -1
  108. package/server/Session.js.map +1 -1
  109. package/server/Session.mjs +604 -1
  110. package/server/Trade.d.ts +10 -1
  111. package/server/Trade.d.ts.map +1 -1
  112. package/server/Trade.js.map +1 -1
  113. package/server/Trade.mjs +1430 -1
  114. package/server/TradeStep.d.ts +10 -1
  115. package/server/TradeStep.d.ts.map +1 -1
  116. package/server/TradeStep.js.map +1 -1
  117. package/server/TradeStep.mjs +528 -1
  118. package/server/TradingAccount.d.ts +10 -1
  119. package/server/TradingAccount.d.ts.map +1 -1
  120. package/server/TradingAccount.js.map +1 -1
  121. package/server/TradingAccount.mjs +2586 -1
  122. package/server/User.d.ts +10 -1
  123. package/server/User.d.ts.map +1 -1
  124. package/server/User.js.map +1 -1
  125. package/server/User.mjs +2044 -1
  126. package/server/VerificationToken.d.ts +10 -1
  127. package/server/VerificationToken.d.ts.map +1 -1
  128. package/server/VerificationToken.js.map +1 -1
  129. package/server/VerificationToken.mjs +48 -1
  130. package/server/client.js.map +1 -1
  131. package/server/client.mjs +1 -1
  132. package/server/index.d.ts +63 -0
  133. package/server/index.d.ts.map +1 -1
@@ -1071,7 +1071,7 @@ exports.TradingAccount = {
1071
1071
  },
1072
1072
  /**
1073
1073
  * Create multiple TradingAccount records.
1074
- * @param props - Array of properties for the new records.
1074
+ * @param props - Array of TradingAccount objects for the new records.
1075
1075
  * @param client - Apollo Client instance.
1076
1076
  * @returns The count of created records or null.
1077
1077
  */
@@ -4033,6 +4033,2591 @@ exports.TradingAccount = {
4033
4033
  throw error;
4034
4034
  }
4035
4035
  },
4036
+ /**
4037
+ * Update multiple TradingAccount records.
4038
+ * @param props - Array of TradingAccount objects for the updated records.
4039
+ * @param client - Apollo Client instance.
4040
+ * @returns The count of created records or null.
4041
+ */
4042
+ async updateMany(props) {
4043
+ const client = (0, client_2.createApolloClient)();
4044
+ const UPDATE_MANY_TRADINGACCOUNT = (0, client_1.gql) `
4045
+ mutation updateManyTradingAccount($data: [TradingAccountCreateManyInput!]!) {
4046
+ updateManyTradingAccount(data: $data) {
4047
+ count
4048
+ }
4049
+ }`;
4050
+ const variables = props.map(prop => ({
4051
+ where: {
4052
+ id: prop.id !== undefined ? prop.id : undefined,
4053
+ slug: prop.slug !== undefined ? prop.slug : undefined,
4054
+ name: prop.name !== undefined ? {
4055
+ equals: prop.name
4056
+ } : undefined,
4057
+ },
4058
+ data: {
4059
+ id: prop.id !== undefined ? {
4060
+ set: prop.id
4061
+ } : undefined,
4062
+ name: prop.name !== undefined ? {
4063
+ set: prop.name
4064
+ } : undefined,
4065
+ slug: prop.slug !== undefined ? {
4066
+ set: prop.slug
4067
+ } : undefined,
4068
+ type: prop.type !== undefined ? {
4069
+ set: prop.type
4070
+ } : undefined,
4071
+ user: prop.user ? {
4072
+ upsert: {
4073
+ where: {
4074
+ id: prop.user.id !== undefined ? {
4075
+ equals: prop.user.id
4076
+ } : undefined,
4077
+ name: prop.user.name !== undefined ? {
4078
+ equals: prop.user.name
4079
+ } : undefined,
4080
+ email: prop.user.email !== undefined ? {
4081
+ equals: prop.user.email
4082
+ } : undefined,
4083
+ },
4084
+ update: {
4085
+ id: prop.user.id !== undefined ? {
4086
+ set: prop.user.id
4087
+ } : undefined,
4088
+ name: prop.user.name !== undefined ? {
4089
+ set: prop.user.name
4090
+ } : undefined,
4091
+ email: prop.user.email !== undefined ? {
4092
+ set: prop.user.email
4093
+ } : undefined,
4094
+ emailVerified: prop.user.emailVerified !== undefined ? {
4095
+ set: prop.user.emailVerified
4096
+ } : undefined,
4097
+ image: prop.user.image !== undefined ? {
4098
+ set: prop.user.image
4099
+ } : undefined,
4100
+ role: prop.user.role !== undefined ? {
4101
+ set: prop.user.role
4102
+ } : undefined,
4103
+ bio: prop.user.bio !== undefined ? {
4104
+ set: prop.user.bio
4105
+ } : undefined,
4106
+ jobTitle: prop.user.jobTitle !== undefined ? {
4107
+ set: prop.user.jobTitle
4108
+ } : undefined,
4109
+ currentAccount: prop.user.currentAccount !== undefined ? {
4110
+ set: prop.user.currentAccount
4111
+ } : undefined,
4112
+ plan: prop.user.plan !== undefined ? {
4113
+ set: prop.user.plan
4114
+ } : undefined,
4115
+ customer: prop.user.customer ? {
4116
+ upsert: {
4117
+ where: {
4118
+ id: prop.user.customer.id !== undefined ? {
4119
+ equals: prop.user.customer.id
4120
+ } : undefined,
4121
+ name: prop.user.customer.name !== undefined ? {
4122
+ equals: prop.user.customer.name
4123
+ } : undefined,
4124
+ },
4125
+ update: {
4126
+ authUserId: prop.user.customer.authUserId !== undefined ? {
4127
+ set: prop.user.customer.authUserId
4128
+ } : undefined,
4129
+ name: prop.user.customer.name !== undefined ? {
4130
+ set: prop.user.customer.name
4131
+ } : undefined,
4132
+ plan: prop.user.customer.plan !== undefined ? {
4133
+ set: prop.user.customer.plan
4134
+ } : undefined,
4135
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? {
4136
+ set: prop.user.customer.stripeCustomerId
4137
+ } : undefined,
4138
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? {
4139
+ set: prop.user.customer.stripeSubscriptionId
4140
+ } : undefined,
4141
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? {
4142
+ set: prop.user.customer.stripePriceId
4143
+ } : undefined,
4144
+ stripeCurrentPeriodEnd: prop.user.customer.stripeCurrentPeriodEnd !== undefined ? {
4145
+ set: prop.user.customer.stripeCurrentPeriodEnd
4146
+ } : undefined,
4147
+ },
4148
+ create: {
4149
+ authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
4150
+ name: prop.user.customer.name !== undefined ? prop.user.customer.name : undefined,
4151
+ plan: prop.user.customer.plan !== undefined ? prop.user.customer.plan : undefined,
4152
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
4153
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
4154
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? prop.user.customer.stripePriceId : undefined,
4155
+ stripeCurrentPeriodEnd: prop.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.user.customer.stripeCurrentPeriodEnd : undefined,
4156
+ },
4157
+ }
4158
+ } : undefined,
4159
+ accounts: prop.user.accounts ? {
4160
+ upsert: prop.user.accounts.map((item) => ({
4161
+ where: {
4162
+ id: item.id !== undefined ? item.id : undefined,
4163
+ },
4164
+ update: {
4165
+ id: item.id !== undefined ? {
4166
+ set: item.id
4167
+ } : undefined,
4168
+ type: item.type !== undefined ? {
4169
+ set: item.type
4170
+ } : undefined,
4171
+ provider: item.provider !== undefined ? {
4172
+ set: item.provider
4173
+ } : undefined,
4174
+ providerAccountId: item.providerAccountId !== undefined ? {
4175
+ set: item.providerAccountId
4176
+ } : undefined,
4177
+ refresh_token: item.refresh_token !== undefined ? {
4178
+ set: item.refresh_token
4179
+ } : undefined,
4180
+ access_token: item.access_token !== undefined ? {
4181
+ set: item.access_token
4182
+ } : undefined,
4183
+ expires_at: item.expires_at !== undefined ? {
4184
+ set: item.expires_at
4185
+ } : undefined,
4186
+ token_type: item.token_type !== undefined ? {
4187
+ set: item.token_type
4188
+ } : undefined,
4189
+ scope: item.scope !== undefined ? {
4190
+ set: item.scope
4191
+ } : undefined,
4192
+ id_token: item.id_token !== undefined ? {
4193
+ set: item.id_token
4194
+ } : undefined,
4195
+ session_state: item.session_state !== undefined ? {
4196
+ set: item.session_state
4197
+ } : undefined,
4198
+ },
4199
+ create: {
4200
+ type: item.type !== undefined ? item.type : undefined,
4201
+ provider: item.provider !== undefined ? item.provider : undefined,
4202
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
4203
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
4204
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
4205
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
4206
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
4207
+ scope: item.scope !== undefined ? item.scope : undefined,
4208
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
4209
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
4210
+ },
4211
+ }))
4212
+ } : undefined,
4213
+ sessions: prop.user.sessions ? {
4214
+ upsert: prop.user.sessions.map((item) => ({
4215
+ where: {
4216
+ id: item.id !== undefined ? item.id : undefined,
4217
+ },
4218
+ update: {
4219
+ id: item.id !== undefined ? {
4220
+ set: item.id
4221
+ } : undefined,
4222
+ sessionToken: item.sessionToken !== undefined ? {
4223
+ set: item.sessionToken
4224
+ } : undefined,
4225
+ expires: item.expires !== undefined ? {
4226
+ set: item.expires
4227
+ } : undefined,
4228
+ },
4229
+ create: {
4230
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
4231
+ expires: item.expires !== undefined ? item.expires : undefined,
4232
+ },
4233
+ }))
4234
+ } : undefined,
4235
+ authenticators: prop.user.authenticators ? {
4236
+ upsert: prop.user.authenticators.map((item) => ({
4237
+ where: {
4238
+ id: item.id !== undefined ? item.id : undefined,
4239
+ },
4240
+ update: {
4241
+ id: item.id !== undefined ? {
4242
+ set: item.id
4243
+ } : undefined,
4244
+ credentialID: item.credentialID !== undefined ? {
4245
+ set: item.credentialID
4246
+ } : undefined,
4247
+ publicKey: item.publicKey !== undefined ? {
4248
+ set: item.publicKey
4249
+ } : undefined,
4250
+ counter: item.counter !== undefined ? {
4251
+ set: item.counter
4252
+ } : undefined,
4253
+ },
4254
+ create: {
4255
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
4256
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
4257
+ counter: item.counter !== undefined ? item.counter : undefined,
4258
+ },
4259
+ }))
4260
+ } : undefined,
4261
+ trades: prop.user.trades ? {
4262
+ upsert: prop.user.trades.map((item) => ({
4263
+ where: {
4264
+ id: item.id !== undefined ? item.id : undefined,
4265
+ },
4266
+ update: {
4267
+ id: item.id !== undefined ? {
4268
+ set: item.id
4269
+ } : undefined,
4270
+ action: item.action !== undefined ? {
4271
+ set: item.action
4272
+ } : undefined,
4273
+ quantity: item.quantity !== undefined ? {
4274
+ set: item.quantity
4275
+ } : undefined,
4276
+ price: item.price !== undefined ? {
4277
+ set: item.price
4278
+ } : undefined,
4279
+ total: item.total !== undefined ? {
4280
+ set: item.total
4281
+ } : undefined,
4282
+ timestamp: item.timestamp !== undefined ? {
4283
+ set: item.timestamp
4284
+ } : undefined,
4285
+ status: item.status !== undefined ? {
4286
+ set: item.status
4287
+ } : undefined,
4288
+ },
4289
+ create: {
4290
+ action: item.action !== undefined ? item.action : undefined,
4291
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
4292
+ price: item.price !== undefined ? item.price : undefined,
4293
+ total: item.total !== undefined ? item.total : undefined,
4294
+ timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
4295
+ status: item.status !== undefined ? item.status : undefined,
4296
+ },
4297
+ }))
4298
+ } : undefined,
4299
+ orders: prop.user.orders ? {
4300
+ upsert: prop.user.orders.map((item) => ({
4301
+ where: {
4302
+ id: item.id !== undefined ? item.id : undefined,
4303
+ },
4304
+ update: {
4305
+ id: item.id !== undefined ? {
4306
+ set: item.id
4307
+ } : undefined,
4308
+ type: item.type !== undefined ? {
4309
+ set: item.type
4310
+ } : undefined,
4311
+ action: item.action !== undefined ? {
4312
+ set: item.action
4313
+ } : undefined,
4314
+ quantity: item.quantity !== undefined ? {
4315
+ set: item.quantity
4316
+ } : undefined,
4317
+ price: item.price !== undefined ? {
4318
+ set: item.price
4319
+ } : undefined,
4320
+ status: item.status !== undefined ? {
4321
+ set: item.status
4322
+ } : undefined,
4323
+ },
4324
+ create: {
4325
+ type: item.type !== undefined ? item.type : undefined,
4326
+ action: item.action !== undefined ? item.action : undefined,
4327
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
4328
+ price: item.price !== undefined ? item.price : undefined,
4329
+ status: item.status !== undefined ? item.status : undefined,
4330
+ },
4331
+ }))
4332
+ } : undefined,
4333
+ aiRecommendations: prop.user.aiRecommendations ? {
4334
+ upsert: prop.user.aiRecommendations.map((item) => ({
4335
+ where: {
4336
+ id: item.id !== undefined ? item.id : undefined,
4337
+ },
4338
+ update: {
4339
+ id: item.id !== undefined ? {
4340
+ set: item.id
4341
+ } : undefined,
4342
+ action: item.action !== undefined ? {
4343
+ set: item.action
4344
+ } : undefined,
4345
+ confidence: item.confidence !== undefined ? {
4346
+ set: item.confidence
4347
+ } : undefined,
4348
+ },
4349
+ create: {
4350
+ action: item.action !== undefined ? item.action : undefined,
4351
+ confidence: item.confidence !== undefined ? item.confidence : undefined,
4352
+ },
4353
+ }))
4354
+ } : undefined,
4355
+ riskAllocations: prop.user.riskAllocations ? {
4356
+ upsert: prop.user.riskAllocations.map((item) => ({
4357
+ where: {
4358
+ id: item.id !== undefined ? item.id : undefined,
4359
+ },
4360
+ update: {
4361
+ id: item.id !== undefined ? {
4362
+ set: item.id
4363
+ } : undefined,
4364
+ assetType: item.assetType !== undefined ? {
4365
+ set: item.assetType
4366
+ } : undefined,
4367
+ allocation: item.allocation !== undefined ? {
4368
+ set: item.allocation
4369
+ } : undefined,
4370
+ },
4371
+ create: {
4372
+ assetType: item.assetType !== undefined ? item.assetType : undefined,
4373
+ allocation: item.allocation !== undefined ? item.allocation : undefined,
4374
+ },
4375
+ }))
4376
+ } : undefined,
4377
+ alerts: prop.user.alerts ? {
4378
+ upsert: prop.user.alerts.map((item) => ({
4379
+ where: {
4380
+ id: item.id !== undefined ? item.id : undefined,
4381
+ },
4382
+ update: {
4383
+ id: item.id !== undefined ? {
4384
+ set: item.id
4385
+ } : undefined,
4386
+ message: item.message !== undefined ? {
4387
+ set: item.message
4388
+ } : undefined,
4389
+ type: item.type !== undefined ? {
4390
+ set: item.type
4391
+ } : undefined,
4392
+ isRead: item.isRead !== undefined ? {
4393
+ set: item.isRead
4394
+ } : undefined,
4395
+ },
4396
+ create: {
4397
+ message: item.message !== undefined ? item.message : undefined,
4398
+ type: item.type !== undefined ? item.type : undefined,
4399
+ isRead: item.isRead !== undefined ? item.isRead : undefined,
4400
+ },
4401
+ }))
4402
+ } : undefined,
4403
+ performanceMetrics: prop.user.performanceMetrics ? {
4404
+ upsert: prop.user.performanceMetrics.map((item) => ({
4405
+ where: {
4406
+ id: item.id !== undefined ? item.id : undefined,
4407
+ },
4408
+ update: {
4409
+ id: item.id !== undefined ? {
4410
+ set: item.id
4411
+ } : undefined,
4412
+ label: item.label !== undefined ? {
4413
+ set: item.label
4414
+ } : undefined,
4415
+ value: item.value !== undefined ? {
4416
+ set: item.value
4417
+ } : undefined,
4418
+ },
4419
+ create: {
4420
+ label: item.label !== undefined ? item.label : undefined,
4421
+ value: item.value !== undefined ? item.value : undefined,
4422
+ },
4423
+ }))
4424
+ } : undefined,
4425
+ alpacaAccounts: prop.user.alpacaAccounts ? {
4426
+ upsert: prop.user.alpacaAccounts.map((item) => ({
4427
+ where: {
4428
+ id: item.id !== undefined ? item.id : undefined,
4429
+ },
4430
+ update: {
4431
+ id: item.id !== undefined ? {
4432
+ set: item.id
4433
+ } : undefined,
4434
+ type: item.type !== undefined ? {
4435
+ set: item.type
4436
+ } : undefined,
4437
+ APIKey: item.APIKey !== undefined ? {
4438
+ set: item.APIKey
4439
+ } : undefined,
4440
+ APISecret: item.APISecret !== undefined ? {
4441
+ set: item.APISecret
4442
+ } : undefined,
4443
+ configuration: item.configuration !== undefined ? {
4444
+ set: item.configuration
4445
+ } : undefined,
4446
+ },
4447
+ create: {
4448
+ type: item.type !== undefined ? item.type : undefined,
4449
+ APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
4450
+ APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
4451
+ configuration: item.configuration !== undefined ? item.configuration : undefined,
4452
+ },
4453
+ }))
4454
+ } : undefined,
4455
+ },
4456
+ create: {
4457
+ name: prop.user.name !== undefined ? prop.user.name : undefined,
4458
+ email: prop.user.email !== undefined ? prop.user.email : undefined,
4459
+ emailVerified: prop.user.emailVerified !== undefined ? prop.user.emailVerified : undefined,
4460
+ image: prop.user.image !== undefined ? prop.user.image : undefined,
4461
+ role: prop.user.role !== undefined ? prop.user.role : undefined,
4462
+ bio: prop.user.bio !== undefined ? prop.user.bio : undefined,
4463
+ jobTitle: prop.user.jobTitle !== undefined ? prop.user.jobTitle : undefined,
4464
+ currentAccount: prop.user.currentAccount !== undefined ? prop.user.currentAccount : undefined,
4465
+ plan: prop.user.plan !== undefined ? prop.user.plan : undefined,
4466
+ customer: prop.user.customer ? {
4467
+ connectOrCreate: {
4468
+ where: {
4469
+ id: prop.user.customer.id !== undefined ? prop.user.customer.id : undefined,
4470
+ name: prop.user.customer.name !== undefined ? {
4471
+ equals: prop.user.customer.name
4472
+ } : undefined,
4473
+ },
4474
+ create: {
4475
+ authUserId: prop.user.customer.authUserId !== undefined ? prop.user.customer.authUserId : undefined,
4476
+ name: prop.user.customer.name !== undefined ? prop.user.customer.name : undefined,
4477
+ plan: prop.user.customer.plan !== undefined ? prop.user.customer.plan : undefined,
4478
+ stripeCustomerId: prop.user.customer.stripeCustomerId !== undefined ? prop.user.customer.stripeCustomerId : undefined,
4479
+ stripeSubscriptionId: prop.user.customer.stripeSubscriptionId !== undefined ? prop.user.customer.stripeSubscriptionId : undefined,
4480
+ stripePriceId: prop.user.customer.stripePriceId !== undefined ? prop.user.customer.stripePriceId : undefined,
4481
+ stripeCurrentPeriodEnd: prop.user.customer.stripeCurrentPeriodEnd !== undefined ? prop.user.customer.stripeCurrentPeriodEnd : undefined,
4482
+ },
4483
+ }
4484
+ } : undefined,
4485
+ accounts: prop.user.accounts ? {
4486
+ connectOrCreate: prop.user.accounts.map((item) => ({
4487
+ where: {
4488
+ id: item.id !== undefined ? item.id : undefined,
4489
+ },
4490
+ create: {
4491
+ type: item.type !== undefined ? item.type : undefined,
4492
+ provider: item.provider !== undefined ? item.provider : undefined,
4493
+ providerAccountId: item.providerAccountId !== undefined ? item.providerAccountId : undefined,
4494
+ refresh_token: item.refresh_token !== undefined ? item.refresh_token : undefined,
4495
+ access_token: item.access_token !== undefined ? item.access_token : undefined,
4496
+ expires_at: item.expires_at !== undefined ? item.expires_at : undefined,
4497
+ token_type: item.token_type !== undefined ? item.token_type : undefined,
4498
+ scope: item.scope !== undefined ? item.scope : undefined,
4499
+ id_token: item.id_token !== undefined ? item.id_token : undefined,
4500
+ session_state: item.session_state !== undefined ? item.session_state : undefined,
4501
+ },
4502
+ }))
4503
+ } : undefined,
4504
+ sessions: prop.user.sessions ? {
4505
+ connectOrCreate: prop.user.sessions.map((item) => ({
4506
+ where: {
4507
+ id: item.id !== undefined ? item.id : undefined,
4508
+ },
4509
+ create: {
4510
+ sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
4511
+ expires: item.expires !== undefined ? item.expires : undefined,
4512
+ },
4513
+ }))
4514
+ } : undefined,
4515
+ authenticators: prop.user.authenticators ? {
4516
+ connectOrCreate: prop.user.authenticators.map((item) => ({
4517
+ where: {
4518
+ id: item.id !== undefined ? item.id : undefined,
4519
+ },
4520
+ create: {
4521
+ credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
4522
+ publicKey: item.publicKey !== undefined ? item.publicKey : undefined,
4523
+ counter: item.counter !== undefined ? item.counter : undefined,
4524
+ },
4525
+ }))
4526
+ } : undefined,
4527
+ trades: prop.user.trades ? {
4528
+ connectOrCreate: prop.user.trades.map((item) => ({
4529
+ where: {
4530
+ id: item.id !== undefined ? item.id : undefined,
4531
+ },
4532
+ create: {
4533
+ action: item.action !== undefined ? item.action : undefined,
4534
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
4535
+ price: item.price !== undefined ? item.price : undefined,
4536
+ total: item.total !== undefined ? item.total : undefined,
4537
+ timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
4538
+ status: item.status !== undefined ? item.status : undefined,
4539
+ },
4540
+ }))
4541
+ } : undefined,
4542
+ orders: prop.user.orders ? {
4543
+ connectOrCreate: prop.user.orders.map((item) => ({
4544
+ where: {
4545
+ id: item.id !== undefined ? item.id : undefined,
4546
+ },
4547
+ create: {
4548
+ type: item.type !== undefined ? item.type : undefined,
4549
+ action: item.action !== undefined ? item.action : undefined,
4550
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
4551
+ price: item.price !== undefined ? item.price : undefined,
4552
+ status: item.status !== undefined ? item.status : undefined,
4553
+ },
4554
+ }))
4555
+ } : undefined,
4556
+ aiRecommendations: prop.user.aiRecommendations ? {
4557
+ connectOrCreate: prop.user.aiRecommendations.map((item) => ({
4558
+ where: {
4559
+ id: item.id !== undefined ? item.id : undefined,
4560
+ },
4561
+ create: {
4562
+ action: item.action !== undefined ? item.action : undefined,
4563
+ confidence: item.confidence !== undefined ? item.confidence : undefined,
4564
+ },
4565
+ }))
4566
+ } : undefined,
4567
+ riskAllocations: prop.user.riskAllocations ? {
4568
+ connectOrCreate: prop.user.riskAllocations.map((item) => ({
4569
+ where: {
4570
+ id: item.id !== undefined ? item.id : undefined,
4571
+ },
4572
+ create: {
4573
+ assetType: item.assetType !== undefined ? item.assetType : undefined,
4574
+ allocation: item.allocation !== undefined ? item.allocation : undefined,
4575
+ },
4576
+ }))
4577
+ } : undefined,
4578
+ alerts: prop.user.alerts ? {
4579
+ connectOrCreate: prop.user.alerts.map((item) => ({
4580
+ where: {
4581
+ id: item.id !== undefined ? item.id : undefined,
4582
+ },
4583
+ create: {
4584
+ message: item.message !== undefined ? item.message : undefined,
4585
+ type: item.type !== undefined ? item.type : undefined,
4586
+ isRead: item.isRead !== undefined ? item.isRead : undefined,
4587
+ },
4588
+ }))
4589
+ } : undefined,
4590
+ performanceMetrics: prop.user.performanceMetrics ? {
4591
+ connectOrCreate: prop.user.performanceMetrics.map((item) => ({
4592
+ where: {
4593
+ id: item.id !== undefined ? item.id : undefined,
4594
+ },
4595
+ create: {
4596
+ label: item.label !== undefined ? item.label : undefined,
4597
+ value: item.value !== undefined ? item.value : undefined,
4598
+ },
4599
+ }))
4600
+ } : undefined,
4601
+ alpacaAccounts: prop.user.alpacaAccounts ? {
4602
+ connectOrCreate: prop.user.alpacaAccounts.map((item) => ({
4603
+ where: {
4604
+ id: item.id !== undefined ? item.id : undefined,
4605
+ },
4606
+ create: {
4607
+ type: item.type !== undefined ? item.type : undefined,
4608
+ APIKey: item.APIKey !== undefined ? item.APIKey : undefined,
4609
+ APISecret: item.APISecret !== undefined ? item.APISecret : undefined,
4610
+ configuration: item.configuration !== undefined ? item.configuration : undefined,
4611
+ },
4612
+ }))
4613
+ } : undefined,
4614
+ },
4615
+ }
4616
+ } : undefined,
4617
+ holdings: prop.holdings ? {
4618
+ upsert: prop.holdings.map((item) => ({
4619
+ where: {
4620
+ id: item.id !== undefined ? item.id : undefined,
4621
+ },
4622
+ update: {
4623
+ id: item.id !== undefined ? {
4624
+ set: item.id
4625
+ } : undefined,
4626
+ quantity: item.quantity !== undefined ? {
4627
+ set: item.quantity
4628
+ } : undefined,
4629
+ averagePrice: item.averagePrice !== undefined ? {
4630
+ set: item.averagePrice
4631
+ } : undefined,
4632
+ asset: item.asset ? {
4633
+ upsert: {
4634
+ where: {
4635
+ id: item.asset.id !== undefined ? {
4636
+ equals: item.asset.id
4637
+ } : undefined,
4638
+ symbol: item.asset.symbol !== undefined ? {
4639
+ equals: item.asset.symbol
4640
+ } : undefined,
4641
+ name: item.asset.name !== undefined ? {
4642
+ equals: item.asset.name
4643
+ } : undefined,
4644
+ },
4645
+ update: {
4646
+ id: item.asset.id !== undefined ? {
4647
+ set: item.asset.id
4648
+ } : undefined,
4649
+ symbol: item.asset.symbol !== undefined ? {
4650
+ set: item.asset.symbol
4651
+ } : undefined,
4652
+ name: item.asset.name !== undefined ? {
4653
+ set: item.asset.name
4654
+ } : undefined,
4655
+ type: item.asset.type !== undefined ? {
4656
+ set: item.asset.type
4657
+ } : undefined,
4658
+ logoUrl: item.asset.logoUrl !== undefined ? {
4659
+ set: item.asset.logoUrl
4660
+ } : undefined,
4661
+ description: item.asset.description !== undefined ? {
4662
+ set: item.asset.description
4663
+ } : undefined,
4664
+ cik: item.asset.cik !== undefined ? {
4665
+ set: item.asset.cik
4666
+ } : undefined,
4667
+ exchange: item.asset.exchange !== undefined ? {
4668
+ set: item.asset.exchange
4669
+ } : undefined,
4670
+ currency: item.asset.currency !== undefined ? {
4671
+ set: item.asset.currency
4672
+ } : undefined,
4673
+ country: item.asset.country !== undefined ? {
4674
+ set: item.asset.country
4675
+ } : undefined,
4676
+ sector: item.asset.sector !== undefined ? {
4677
+ set: item.asset.sector
4678
+ } : undefined,
4679
+ industry: item.asset.industry !== undefined ? {
4680
+ set: item.asset.industry
4681
+ } : undefined,
4682
+ address: item.asset.address !== undefined ? {
4683
+ set: item.asset.address
4684
+ } : undefined,
4685
+ officialSite: item.asset.officialSite !== undefined ? {
4686
+ set: item.asset.officialSite
4687
+ } : undefined,
4688
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
4689
+ set: item.asset.fiscalYearEnd
4690
+ } : undefined,
4691
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
4692
+ set: item.asset.latestQuarter
4693
+ } : undefined,
4694
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
4695
+ set: item.asset.marketCapitalization
4696
+ } : undefined,
4697
+ ebitda: item.asset.ebitda !== undefined ? {
4698
+ set: item.asset.ebitda
4699
+ } : undefined,
4700
+ peRatio: item.asset.peRatio !== undefined ? {
4701
+ set: item.asset.peRatio
4702
+ } : undefined,
4703
+ pegRatio: item.asset.pegRatio !== undefined ? {
4704
+ set: item.asset.pegRatio
4705
+ } : undefined,
4706
+ bookValue: item.asset.bookValue !== undefined ? {
4707
+ set: item.asset.bookValue
4708
+ } : undefined,
4709
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
4710
+ set: item.asset.dividendPerShare
4711
+ } : undefined,
4712
+ dividendYield: item.asset.dividendYield !== undefined ? {
4713
+ set: item.asset.dividendYield
4714
+ } : undefined,
4715
+ eps: item.asset.eps !== undefined ? {
4716
+ set: item.asset.eps
4717
+ } : undefined,
4718
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
4719
+ set: item.asset.revenuePerShareTTM
4720
+ } : undefined,
4721
+ profitMargin: item.asset.profitMargin !== undefined ? {
4722
+ set: item.asset.profitMargin
4723
+ } : undefined,
4724
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
4725
+ set: item.asset.operatingMarginTTM
4726
+ } : undefined,
4727
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
4728
+ set: item.asset.returnOnAssetsTTM
4729
+ } : undefined,
4730
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
4731
+ set: item.asset.returnOnEquityTTM
4732
+ } : undefined,
4733
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
4734
+ set: item.asset.revenueTTM
4735
+ } : undefined,
4736
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
4737
+ set: item.asset.grossProfitTTM
4738
+ } : undefined,
4739
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
4740
+ set: item.asset.dilutedEPSTTM
4741
+ } : undefined,
4742
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
4743
+ set: item.asset.quarterlyEarningsGrowthYOY
4744
+ } : undefined,
4745
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
4746
+ set: item.asset.quarterlyRevenueGrowthYOY
4747
+ } : undefined,
4748
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
4749
+ set: item.asset.analystTargetPrice
4750
+ } : undefined,
4751
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
4752
+ set: item.asset.analystRatingStrongBuy
4753
+ } : undefined,
4754
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
4755
+ set: item.asset.analystRatingBuy
4756
+ } : undefined,
4757
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
4758
+ set: item.asset.analystRatingHold
4759
+ } : undefined,
4760
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
4761
+ set: item.asset.analystRatingSell
4762
+ } : undefined,
4763
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
4764
+ set: item.asset.analystRatingStrongSell
4765
+ } : undefined,
4766
+ trailingPE: item.asset.trailingPE !== undefined ? {
4767
+ set: item.asset.trailingPE
4768
+ } : undefined,
4769
+ forwardPE: item.asset.forwardPE !== undefined ? {
4770
+ set: item.asset.forwardPE
4771
+ } : undefined,
4772
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
4773
+ set: item.asset.priceToSalesRatioTTM
4774
+ } : undefined,
4775
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
4776
+ set: item.asset.priceToBookRatio
4777
+ } : undefined,
4778
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
4779
+ set: item.asset.evToRevenue
4780
+ } : undefined,
4781
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
4782
+ set: item.asset.evToEbitda
4783
+ } : undefined,
4784
+ beta: item.asset.beta !== undefined ? {
4785
+ set: item.asset.beta
4786
+ } : undefined,
4787
+ week52High: item.asset.week52High !== undefined ? {
4788
+ set: item.asset.week52High
4789
+ } : undefined,
4790
+ week52Low: item.asset.week52Low !== undefined ? {
4791
+ set: item.asset.week52Low
4792
+ } : undefined,
4793
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
4794
+ set: item.asset.day50MovingAverage
4795
+ } : undefined,
4796
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
4797
+ set: item.asset.day200MovingAverage
4798
+ } : undefined,
4799
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
4800
+ set: item.asset.sharesOutstanding
4801
+ } : undefined,
4802
+ dividendDate: item.asset.dividendDate !== undefined ? {
4803
+ set: item.asset.dividendDate
4804
+ } : undefined,
4805
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
4806
+ set: item.asset.exDividendDate
4807
+ } : undefined,
4808
+ },
4809
+ create: {
4810
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4811
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4812
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4813
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4814
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4815
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4816
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4817
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4818
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4819
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4820
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4821
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4822
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4823
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4824
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4825
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4826
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4827
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4828
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4829
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4830
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4831
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4832
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4833
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4834
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4835
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4836
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4837
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4838
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4839
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4840
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4841
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4842
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4843
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4844
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4845
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4846
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4847
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4848
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4849
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4850
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4851
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4852
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4853
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4854
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4855
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4856
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4857
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4858
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4859
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4860
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4861
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4862
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4863
+ },
4864
+ }
4865
+ } : undefined,
4866
+ },
4867
+ create: {
4868
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
4869
+ averagePrice: item.averagePrice !== undefined ? item.averagePrice : undefined,
4870
+ asset: item.asset ? {
4871
+ connectOrCreate: {
4872
+ where: {
4873
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
4874
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4875
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4876
+ },
4877
+ create: {
4878
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
4879
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
4880
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
4881
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
4882
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
4883
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
4884
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
4885
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
4886
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
4887
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
4888
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
4889
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
4890
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
4891
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
4892
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
4893
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
4894
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
4895
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
4896
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
4897
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
4898
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
4899
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
4900
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
4901
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
4902
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
4903
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
4904
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
4905
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
4906
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
4907
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
4908
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
4909
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
4910
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
4911
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
4912
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
4913
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
4914
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
4915
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
4916
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
4917
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
4918
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
4919
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
4920
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
4921
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
4922
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
4923
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
4924
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
4925
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
4926
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
4927
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
4928
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
4929
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
4930
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
4931
+ },
4932
+ }
4933
+ } : undefined,
4934
+ },
4935
+ }))
4936
+ } : undefined,
4937
+ trades: prop.trades ? {
4938
+ upsert: prop.trades.map((item) => ({
4939
+ where: {
4940
+ id: item.id !== undefined ? item.id : undefined,
4941
+ },
4942
+ update: {
4943
+ id: item.id !== undefined ? {
4944
+ set: item.id
4945
+ } : undefined,
4946
+ action: item.action !== undefined ? {
4947
+ set: item.action
4948
+ } : undefined,
4949
+ quantity: item.quantity !== undefined ? {
4950
+ set: item.quantity
4951
+ } : undefined,
4952
+ price: item.price !== undefined ? {
4953
+ set: item.price
4954
+ } : undefined,
4955
+ total: item.total !== undefined ? {
4956
+ set: item.total
4957
+ } : undefined,
4958
+ timestamp: item.timestamp !== undefined ? {
4959
+ set: item.timestamp
4960
+ } : undefined,
4961
+ status: item.status !== undefined ? {
4962
+ set: item.status
4963
+ } : undefined,
4964
+ user: item.user ? {
4965
+ upsert: {
4966
+ where: {
4967
+ id: item.user.id !== undefined ? {
4968
+ equals: item.user.id
4969
+ } : undefined,
4970
+ name: item.user.name !== undefined ? {
4971
+ equals: item.user.name
4972
+ } : undefined,
4973
+ email: item.user.email !== undefined ? {
4974
+ equals: item.user.email
4975
+ } : undefined,
4976
+ },
4977
+ update: {
4978
+ id: item.user.id !== undefined ? {
4979
+ set: item.user.id
4980
+ } : undefined,
4981
+ name: item.user.name !== undefined ? {
4982
+ set: item.user.name
4983
+ } : undefined,
4984
+ email: item.user.email !== undefined ? {
4985
+ set: item.user.email
4986
+ } : undefined,
4987
+ emailVerified: item.user.emailVerified !== undefined ? {
4988
+ set: item.user.emailVerified
4989
+ } : undefined,
4990
+ image: item.user.image !== undefined ? {
4991
+ set: item.user.image
4992
+ } : undefined,
4993
+ role: item.user.role !== undefined ? {
4994
+ set: item.user.role
4995
+ } : undefined,
4996
+ bio: item.user.bio !== undefined ? {
4997
+ set: item.user.bio
4998
+ } : undefined,
4999
+ jobTitle: item.user.jobTitle !== undefined ? {
5000
+ set: item.user.jobTitle
5001
+ } : undefined,
5002
+ currentAccount: item.user.currentAccount !== undefined ? {
5003
+ set: item.user.currentAccount
5004
+ } : undefined,
5005
+ plan: item.user.plan !== undefined ? {
5006
+ set: item.user.plan
5007
+ } : undefined,
5008
+ },
5009
+ create: {
5010
+ name: item.user.name !== undefined ? item.user.name : undefined,
5011
+ email: item.user.email !== undefined ? item.user.email : undefined,
5012
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
5013
+ image: item.user.image !== undefined ? item.user.image : undefined,
5014
+ role: item.user.role !== undefined ? item.user.role : undefined,
5015
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
5016
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
5017
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
5018
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
5019
+ },
5020
+ }
5021
+ } : undefined,
5022
+ asset: item.asset ? {
5023
+ upsert: {
5024
+ where: {
5025
+ id: item.asset.id !== undefined ? {
5026
+ equals: item.asset.id
5027
+ } : undefined,
5028
+ symbol: item.asset.symbol !== undefined ? {
5029
+ equals: item.asset.symbol
5030
+ } : undefined,
5031
+ name: item.asset.name !== undefined ? {
5032
+ equals: item.asset.name
5033
+ } : undefined,
5034
+ },
5035
+ update: {
5036
+ id: item.asset.id !== undefined ? {
5037
+ set: item.asset.id
5038
+ } : undefined,
5039
+ symbol: item.asset.symbol !== undefined ? {
5040
+ set: item.asset.symbol
5041
+ } : undefined,
5042
+ name: item.asset.name !== undefined ? {
5043
+ set: item.asset.name
5044
+ } : undefined,
5045
+ type: item.asset.type !== undefined ? {
5046
+ set: item.asset.type
5047
+ } : undefined,
5048
+ logoUrl: item.asset.logoUrl !== undefined ? {
5049
+ set: item.asset.logoUrl
5050
+ } : undefined,
5051
+ description: item.asset.description !== undefined ? {
5052
+ set: item.asset.description
5053
+ } : undefined,
5054
+ cik: item.asset.cik !== undefined ? {
5055
+ set: item.asset.cik
5056
+ } : undefined,
5057
+ exchange: item.asset.exchange !== undefined ? {
5058
+ set: item.asset.exchange
5059
+ } : undefined,
5060
+ currency: item.asset.currency !== undefined ? {
5061
+ set: item.asset.currency
5062
+ } : undefined,
5063
+ country: item.asset.country !== undefined ? {
5064
+ set: item.asset.country
5065
+ } : undefined,
5066
+ sector: item.asset.sector !== undefined ? {
5067
+ set: item.asset.sector
5068
+ } : undefined,
5069
+ industry: item.asset.industry !== undefined ? {
5070
+ set: item.asset.industry
5071
+ } : undefined,
5072
+ address: item.asset.address !== undefined ? {
5073
+ set: item.asset.address
5074
+ } : undefined,
5075
+ officialSite: item.asset.officialSite !== undefined ? {
5076
+ set: item.asset.officialSite
5077
+ } : undefined,
5078
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
5079
+ set: item.asset.fiscalYearEnd
5080
+ } : undefined,
5081
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
5082
+ set: item.asset.latestQuarter
5083
+ } : undefined,
5084
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
5085
+ set: item.asset.marketCapitalization
5086
+ } : undefined,
5087
+ ebitda: item.asset.ebitda !== undefined ? {
5088
+ set: item.asset.ebitda
5089
+ } : undefined,
5090
+ peRatio: item.asset.peRatio !== undefined ? {
5091
+ set: item.asset.peRatio
5092
+ } : undefined,
5093
+ pegRatio: item.asset.pegRatio !== undefined ? {
5094
+ set: item.asset.pegRatio
5095
+ } : undefined,
5096
+ bookValue: item.asset.bookValue !== undefined ? {
5097
+ set: item.asset.bookValue
5098
+ } : undefined,
5099
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
5100
+ set: item.asset.dividendPerShare
5101
+ } : undefined,
5102
+ dividendYield: item.asset.dividendYield !== undefined ? {
5103
+ set: item.asset.dividendYield
5104
+ } : undefined,
5105
+ eps: item.asset.eps !== undefined ? {
5106
+ set: item.asset.eps
5107
+ } : undefined,
5108
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
5109
+ set: item.asset.revenuePerShareTTM
5110
+ } : undefined,
5111
+ profitMargin: item.asset.profitMargin !== undefined ? {
5112
+ set: item.asset.profitMargin
5113
+ } : undefined,
5114
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
5115
+ set: item.asset.operatingMarginTTM
5116
+ } : undefined,
5117
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
5118
+ set: item.asset.returnOnAssetsTTM
5119
+ } : undefined,
5120
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
5121
+ set: item.asset.returnOnEquityTTM
5122
+ } : undefined,
5123
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
5124
+ set: item.asset.revenueTTM
5125
+ } : undefined,
5126
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
5127
+ set: item.asset.grossProfitTTM
5128
+ } : undefined,
5129
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
5130
+ set: item.asset.dilutedEPSTTM
5131
+ } : undefined,
5132
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
5133
+ set: item.asset.quarterlyEarningsGrowthYOY
5134
+ } : undefined,
5135
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
5136
+ set: item.asset.quarterlyRevenueGrowthYOY
5137
+ } : undefined,
5138
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
5139
+ set: item.asset.analystTargetPrice
5140
+ } : undefined,
5141
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
5142
+ set: item.asset.analystRatingStrongBuy
5143
+ } : undefined,
5144
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
5145
+ set: item.asset.analystRatingBuy
5146
+ } : undefined,
5147
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
5148
+ set: item.asset.analystRatingHold
5149
+ } : undefined,
5150
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
5151
+ set: item.asset.analystRatingSell
5152
+ } : undefined,
5153
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
5154
+ set: item.asset.analystRatingStrongSell
5155
+ } : undefined,
5156
+ trailingPE: item.asset.trailingPE !== undefined ? {
5157
+ set: item.asset.trailingPE
5158
+ } : undefined,
5159
+ forwardPE: item.asset.forwardPE !== undefined ? {
5160
+ set: item.asset.forwardPE
5161
+ } : undefined,
5162
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
5163
+ set: item.asset.priceToSalesRatioTTM
5164
+ } : undefined,
5165
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
5166
+ set: item.asset.priceToBookRatio
5167
+ } : undefined,
5168
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
5169
+ set: item.asset.evToRevenue
5170
+ } : undefined,
5171
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
5172
+ set: item.asset.evToEbitda
5173
+ } : undefined,
5174
+ beta: item.asset.beta !== undefined ? {
5175
+ set: item.asset.beta
5176
+ } : undefined,
5177
+ week52High: item.asset.week52High !== undefined ? {
5178
+ set: item.asset.week52High
5179
+ } : undefined,
5180
+ week52Low: item.asset.week52Low !== undefined ? {
5181
+ set: item.asset.week52Low
5182
+ } : undefined,
5183
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
5184
+ set: item.asset.day50MovingAverage
5185
+ } : undefined,
5186
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
5187
+ set: item.asset.day200MovingAverage
5188
+ } : undefined,
5189
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
5190
+ set: item.asset.sharesOutstanding
5191
+ } : undefined,
5192
+ dividendDate: item.asset.dividendDate !== undefined ? {
5193
+ set: item.asset.dividendDate
5194
+ } : undefined,
5195
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
5196
+ set: item.asset.exDividendDate
5197
+ } : undefined,
5198
+ },
5199
+ create: {
5200
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5201
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
5202
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
5203
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
5204
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
5205
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
5206
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
5207
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
5208
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
5209
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
5210
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
5211
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
5212
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
5213
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
5214
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
5215
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
5216
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
5217
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
5218
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
5219
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
5220
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
5221
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
5222
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
5223
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
5224
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
5225
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
5226
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
5227
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
5228
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
5229
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
5230
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
5231
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
5232
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
5233
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
5234
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
5235
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
5236
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
5237
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
5238
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
5239
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
5240
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
5241
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
5242
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
5243
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
5244
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
5245
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
5246
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
5247
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
5248
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
5249
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
5250
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
5251
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
5252
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
5253
+ },
5254
+ }
5255
+ } : undefined,
5256
+ steps: item.steps ? {
5257
+ upsert: item.steps.map((item) => ({
5258
+ where: {
5259
+ id: item.id !== undefined ? item.id : undefined,
5260
+ },
5261
+ update: {
5262
+ id: item.id !== undefined ? {
5263
+ set: item.id
5264
+ } : undefined,
5265
+ sequence: item.sequence !== undefined ? {
5266
+ set: item.sequence
5267
+ } : undefined,
5268
+ action: item.action !== undefined ? {
5269
+ set: item.action
5270
+ } : undefined,
5271
+ hedgeType: item.hedgeType !== undefined ? {
5272
+ set: item.hedgeType
5273
+ } : undefined,
5274
+ hedgePrice: item.hedgePrice !== undefined ? {
5275
+ set: item.hedgePrice
5276
+ } : undefined,
5277
+ buyPrice: item.buyPrice !== undefined ? {
5278
+ set: item.buyPrice
5279
+ } : undefined,
5280
+ sellPrice: item.sellPrice !== undefined ? {
5281
+ set: item.sellPrice
5282
+ } : undefined,
5283
+ qty: item.qty !== undefined ? {
5284
+ set: item.qty
5285
+ } : undefined,
5286
+ side: item.side !== undefined ? {
5287
+ set: item.side
5288
+ } : undefined,
5289
+ type: item.type !== undefined ? {
5290
+ set: item.type
5291
+ } : undefined,
5292
+ stopLoss: item.stopLoss !== undefined ? {
5293
+ set: item.stopLoss
5294
+ } : undefined,
5295
+ targetPrice: item.targetPrice !== undefined ? {
5296
+ set: item.targetPrice
5297
+ } : undefined,
5298
+ note: item.note !== undefined ? {
5299
+ set: item.note
5300
+ } : undefined,
5301
+ executionTime: item.executionTime !== undefined ? {
5302
+ set: item.executionTime
5303
+ } : undefined,
5304
+ status: item.status !== undefined ? {
5305
+ set: item.status
5306
+ } : undefined,
5307
+ fee: item.fee !== undefined ? {
5308
+ set: item.fee
5309
+ } : undefined,
5310
+ },
5311
+ create: {
5312
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
5313
+ action: item.action !== undefined ? item.action : undefined,
5314
+ hedgeType: item.hedgeType !== undefined ? item.hedgeType : undefined,
5315
+ hedgePrice: item.hedgePrice !== undefined ? item.hedgePrice : undefined,
5316
+ buyPrice: item.buyPrice !== undefined ? item.buyPrice : undefined,
5317
+ sellPrice: item.sellPrice !== undefined ? item.sellPrice : undefined,
5318
+ qty: item.qty !== undefined ? item.qty : undefined,
5319
+ side: item.side !== undefined ? item.side : undefined,
5320
+ type: item.type !== undefined ? item.type : undefined,
5321
+ stopLoss: item.stopLoss !== undefined ? item.stopLoss : undefined,
5322
+ targetPrice: item.targetPrice !== undefined ? item.targetPrice : undefined,
5323
+ note: item.note !== undefined ? item.note : undefined,
5324
+ executionTime: item.executionTime !== undefined ? item.executionTime : undefined,
5325
+ status: item.status !== undefined ? item.status : undefined,
5326
+ fee: item.fee !== undefined ? item.fee : undefined,
5327
+ },
5328
+ }))
5329
+ } : undefined,
5330
+ },
5331
+ create: {
5332
+ action: item.action !== undefined ? item.action : undefined,
5333
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
5334
+ price: item.price !== undefined ? item.price : undefined,
5335
+ total: item.total !== undefined ? item.total : undefined,
5336
+ timestamp: item.timestamp !== undefined ? item.timestamp : undefined,
5337
+ status: item.status !== undefined ? item.status : undefined,
5338
+ user: item.user ? {
5339
+ connectOrCreate: {
5340
+ where: {
5341
+ id: item.user.id !== undefined ? item.user.id : undefined,
5342
+ email: item.user.email !== undefined ? item.user.email : undefined,
5343
+ name: item.user.name !== undefined ? {
5344
+ equals: item.user.name
5345
+ } : undefined,
5346
+ },
5347
+ create: {
5348
+ name: item.user.name !== undefined ? item.user.name : undefined,
5349
+ email: item.user.email !== undefined ? item.user.email : undefined,
5350
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
5351
+ image: item.user.image !== undefined ? item.user.image : undefined,
5352
+ role: item.user.role !== undefined ? item.user.role : undefined,
5353
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
5354
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
5355
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
5356
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
5357
+ },
5358
+ }
5359
+ } : undefined,
5360
+ asset: item.asset ? {
5361
+ connectOrCreate: {
5362
+ where: {
5363
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
5364
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5365
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
5366
+ },
5367
+ create: {
5368
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5369
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
5370
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
5371
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
5372
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
5373
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
5374
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
5375
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
5376
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
5377
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
5378
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
5379
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
5380
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
5381
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
5382
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
5383
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
5384
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
5385
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
5386
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
5387
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
5388
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
5389
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
5390
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
5391
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
5392
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
5393
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
5394
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
5395
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
5396
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
5397
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
5398
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
5399
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
5400
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
5401
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
5402
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
5403
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
5404
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
5405
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
5406
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
5407
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
5408
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
5409
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
5410
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
5411
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
5412
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
5413
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
5414
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
5415
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
5416
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
5417
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
5418
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
5419
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
5420
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
5421
+ },
5422
+ }
5423
+ } : undefined,
5424
+ steps: item.steps ? {
5425
+ connectOrCreate: item.steps.map((item) => ({
5426
+ where: {
5427
+ id: item.id !== undefined ? item.id : undefined,
5428
+ },
5429
+ create: {
5430
+ sequence: item.sequence !== undefined ? item.sequence : undefined,
5431
+ action: item.action !== undefined ? item.action : undefined,
5432
+ hedgeType: item.hedgeType !== undefined ? item.hedgeType : undefined,
5433
+ hedgePrice: item.hedgePrice !== undefined ? item.hedgePrice : undefined,
5434
+ buyPrice: item.buyPrice !== undefined ? item.buyPrice : undefined,
5435
+ sellPrice: item.sellPrice !== undefined ? item.sellPrice : undefined,
5436
+ qty: item.qty !== undefined ? item.qty : undefined,
5437
+ side: item.side !== undefined ? item.side : undefined,
5438
+ type: item.type !== undefined ? item.type : undefined,
5439
+ stopLoss: item.stopLoss !== undefined ? item.stopLoss : undefined,
5440
+ targetPrice: item.targetPrice !== undefined ? item.targetPrice : undefined,
5441
+ note: item.note !== undefined ? item.note : undefined,
5442
+ executionTime: item.executionTime !== undefined ? item.executionTime : undefined,
5443
+ status: item.status !== undefined ? item.status : undefined,
5444
+ fee: item.fee !== undefined ? item.fee : undefined,
5445
+ },
5446
+ }))
5447
+ } : undefined,
5448
+ },
5449
+ }))
5450
+ } : undefined,
5451
+ orders: prop.orders ? {
5452
+ upsert: prop.orders.map((item) => ({
5453
+ where: {
5454
+ id: item.id !== undefined ? item.id : undefined,
5455
+ },
5456
+ update: {
5457
+ id: item.id !== undefined ? {
5458
+ set: item.id
5459
+ } : undefined,
5460
+ type: item.type !== undefined ? {
5461
+ set: item.type
5462
+ } : undefined,
5463
+ action: item.action !== undefined ? {
5464
+ set: item.action
5465
+ } : undefined,
5466
+ quantity: item.quantity !== undefined ? {
5467
+ set: item.quantity
5468
+ } : undefined,
5469
+ price: item.price !== undefined ? {
5470
+ set: item.price
5471
+ } : undefined,
5472
+ status: item.status !== undefined ? {
5473
+ set: item.status
5474
+ } : undefined,
5475
+ user: item.user ? {
5476
+ upsert: {
5477
+ where: {
5478
+ id: item.user.id !== undefined ? {
5479
+ equals: item.user.id
5480
+ } : undefined,
5481
+ name: item.user.name !== undefined ? {
5482
+ equals: item.user.name
5483
+ } : undefined,
5484
+ email: item.user.email !== undefined ? {
5485
+ equals: item.user.email
5486
+ } : undefined,
5487
+ },
5488
+ update: {
5489
+ id: item.user.id !== undefined ? {
5490
+ set: item.user.id
5491
+ } : undefined,
5492
+ name: item.user.name !== undefined ? {
5493
+ set: item.user.name
5494
+ } : undefined,
5495
+ email: item.user.email !== undefined ? {
5496
+ set: item.user.email
5497
+ } : undefined,
5498
+ emailVerified: item.user.emailVerified !== undefined ? {
5499
+ set: item.user.emailVerified
5500
+ } : undefined,
5501
+ image: item.user.image !== undefined ? {
5502
+ set: item.user.image
5503
+ } : undefined,
5504
+ role: item.user.role !== undefined ? {
5505
+ set: item.user.role
5506
+ } : undefined,
5507
+ bio: item.user.bio !== undefined ? {
5508
+ set: item.user.bio
5509
+ } : undefined,
5510
+ jobTitle: item.user.jobTitle !== undefined ? {
5511
+ set: item.user.jobTitle
5512
+ } : undefined,
5513
+ currentAccount: item.user.currentAccount !== undefined ? {
5514
+ set: item.user.currentAccount
5515
+ } : undefined,
5516
+ plan: item.user.plan !== undefined ? {
5517
+ set: item.user.plan
5518
+ } : undefined,
5519
+ },
5520
+ create: {
5521
+ name: item.user.name !== undefined ? item.user.name : undefined,
5522
+ email: item.user.email !== undefined ? item.user.email : undefined,
5523
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
5524
+ image: item.user.image !== undefined ? item.user.image : undefined,
5525
+ role: item.user.role !== undefined ? item.user.role : undefined,
5526
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
5527
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
5528
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
5529
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
5530
+ },
5531
+ }
5532
+ } : undefined,
5533
+ asset: item.asset ? {
5534
+ upsert: {
5535
+ where: {
5536
+ id: item.asset.id !== undefined ? {
5537
+ equals: item.asset.id
5538
+ } : undefined,
5539
+ symbol: item.asset.symbol !== undefined ? {
5540
+ equals: item.asset.symbol
5541
+ } : undefined,
5542
+ name: item.asset.name !== undefined ? {
5543
+ equals: item.asset.name
5544
+ } : undefined,
5545
+ },
5546
+ update: {
5547
+ id: item.asset.id !== undefined ? {
5548
+ set: item.asset.id
5549
+ } : undefined,
5550
+ symbol: item.asset.symbol !== undefined ? {
5551
+ set: item.asset.symbol
5552
+ } : undefined,
5553
+ name: item.asset.name !== undefined ? {
5554
+ set: item.asset.name
5555
+ } : undefined,
5556
+ type: item.asset.type !== undefined ? {
5557
+ set: item.asset.type
5558
+ } : undefined,
5559
+ logoUrl: item.asset.logoUrl !== undefined ? {
5560
+ set: item.asset.logoUrl
5561
+ } : undefined,
5562
+ description: item.asset.description !== undefined ? {
5563
+ set: item.asset.description
5564
+ } : undefined,
5565
+ cik: item.asset.cik !== undefined ? {
5566
+ set: item.asset.cik
5567
+ } : undefined,
5568
+ exchange: item.asset.exchange !== undefined ? {
5569
+ set: item.asset.exchange
5570
+ } : undefined,
5571
+ currency: item.asset.currency !== undefined ? {
5572
+ set: item.asset.currency
5573
+ } : undefined,
5574
+ country: item.asset.country !== undefined ? {
5575
+ set: item.asset.country
5576
+ } : undefined,
5577
+ sector: item.asset.sector !== undefined ? {
5578
+ set: item.asset.sector
5579
+ } : undefined,
5580
+ industry: item.asset.industry !== undefined ? {
5581
+ set: item.asset.industry
5582
+ } : undefined,
5583
+ address: item.asset.address !== undefined ? {
5584
+ set: item.asset.address
5585
+ } : undefined,
5586
+ officialSite: item.asset.officialSite !== undefined ? {
5587
+ set: item.asset.officialSite
5588
+ } : undefined,
5589
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
5590
+ set: item.asset.fiscalYearEnd
5591
+ } : undefined,
5592
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
5593
+ set: item.asset.latestQuarter
5594
+ } : undefined,
5595
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
5596
+ set: item.asset.marketCapitalization
5597
+ } : undefined,
5598
+ ebitda: item.asset.ebitda !== undefined ? {
5599
+ set: item.asset.ebitda
5600
+ } : undefined,
5601
+ peRatio: item.asset.peRatio !== undefined ? {
5602
+ set: item.asset.peRatio
5603
+ } : undefined,
5604
+ pegRatio: item.asset.pegRatio !== undefined ? {
5605
+ set: item.asset.pegRatio
5606
+ } : undefined,
5607
+ bookValue: item.asset.bookValue !== undefined ? {
5608
+ set: item.asset.bookValue
5609
+ } : undefined,
5610
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
5611
+ set: item.asset.dividendPerShare
5612
+ } : undefined,
5613
+ dividendYield: item.asset.dividendYield !== undefined ? {
5614
+ set: item.asset.dividendYield
5615
+ } : undefined,
5616
+ eps: item.asset.eps !== undefined ? {
5617
+ set: item.asset.eps
5618
+ } : undefined,
5619
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
5620
+ set: item.asset.revenuePerShareTTM
5621
+ } : undefined,
5622
+ profitMargin: item.asset.profitMargin !== undefined ? {
5623
+ set: item.asset.profitMargin
5624
+ } : undefined,
5625
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
5626
+ set: item.asset.operatingMarginTTM
5627
+ } : undefined,
5628
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
5629
+ set: item.asset.returnOnAssetsTTM
5630
+ } : undefined,
5631
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
5632
+ set: item.asset.returnOnEquityTTM
5633
+ } : undefined,
5634
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
5635
+ set: item.asset.revenueTTM
5636
+ } : undefined,
5637
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
5638
+ set: item.asset.grossProfitTTM
5639
+ } : undefined,
5640
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
5641
+ set: item.asset.dilutedEPSTTM
5642
+ } : undefined,
5643
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
5644
+ set: item.asset.quarterlyEarningsGrowthYOY
5645
+ } : undefined,
5646
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
5647
+ set: item.asset.quarterlyRevenueGrowthYOY
5648
+ } : undefined,
5649
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
5650
+ set: item.asset.analystTargetPrice
5651
+ } : undefined,
5652
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
5653
+ set: item.asset.analystRatingStrongBuy
5654
+ } : undefined,
5655
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
5656
+ set: item.asset.analystRatingBuy
5657
+ } : undefined,
5658
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
5659
+ set: item.asset.analystRatingHold
5660
+ } : undefined,
5661
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
5662
+ set: item.asset.analystRatingSell
5663
+ } : undefined,
5664
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
5665
+ set: item.asset.analystRatingStrongSell
5666
+ } : undefined,
5667
+ trailingPE: item.asset.trailingPE !== undefined ? {
5668
+ set: item.asset.trailingPE
5669
+ } : undefined,
5670
+ forwardPE: item.asset.forwardPE !== undefined ? {
5671
+ set: item.asset.forwardPE
5672
+ } : undefined,
5673
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
5674
+ set: item.asset.priceToSalesRatioTTM
5675
+ } : undefined,
5676
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
5677
+ set: item.asset.priceToBookRatio
5678
+ } : undefined,
5679
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
5680
+ set: item.asset.evToRevenue
5681
+ } : undefined,
5682
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
5683
+ set: item.asset.evToEbitda
5684
+ } : undefined,
5685
+ beta: item.asset.beta !== undefined ? {
5686
+ set: item.asset.beta
5687
+ } : undefined,
5688
+ week52High: item.asset.week52High !== undefined ? {
5689
+ set: item.asset.week52High
5690
+ } : undefined,
5691
+ week52Low: item.asset.week52Low !== undefined ? {
5692
+ set: item.asset.week52Low
5693
+ } : undefined,
5694
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
5695
+ set: item.asset.day50MovingAverage
5696
+ } : undefined,
5697
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
5698
+ set: item.asset.day200MovingAverage
5699
+ } : undefined,
5700
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
5701
+ set: item.asset.sharesOutstanding
5702
+ } : undefined,
5703
+ dividendDate: item.asset.dividendDate !== undefined ? {
5704
+ set: item.asset.dividendDate
5705
+ } : undefined,
5706
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
5707
+ set: item.asset.exDividendDate
5708
+ } : undefined,
5709
+ },
5710
+ create: {
5711
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5712
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
5713
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
5714
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
5715
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
5716
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
5717
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
5718
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
5719
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
5720
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
5721
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
5722
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
5723
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
5724
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
5725
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
5726
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
5727
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
5728
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
5729
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
5730
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
5731
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
5732
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
5733
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
5734
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
5735
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
5736
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
5737
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
5738
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
5739
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
5740
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
5741
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
5742
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
5743
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
5744
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
5745
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
5746
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
5747
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
5748
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
5749
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
5750
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
5751
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
5752
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
5753
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
5754
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
5755
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
5756
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
5757
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
5758
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
5759
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
5760
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
5761
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
5762
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
5763
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
5764
+ },
5765
+ }
5766
+ } : undefined,
5767
+ },
5768
+ create: {
5769
+ type: item.type !== undefined ? item.type : undefined,
5770
+ action: item.action !== undefined ? item.action : undefined,
5771
+ quantity: item.quantity !== undefined ? item.quantity : undefined,
5772
+ price: item.price !== undefined ? item.price : undefined,
5773
+ status: item.status !== undefined ? item.status : undefined,
5774
+ user: item.user ? {
5775
+ connectOrCreate: {
5776
+ where: {
5777
+ id: item.user.id !== undefined ? item.user.id : undefined,
5778
+ email: item.user.email !== undefined ? item.user.email : undefined,
5779
+ name: item.user.name !== undefined ? {
5780
+ equals: item.user.name
5781
+ } : undefined,
5782
+ },
5783
+ create: {
5784
+ name: item.user.name !== undefined ? item.user.name : undefined,
5785
+ email: item.user.email !== undefined ? item.user.email : undefined,
5786
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
5787
+ image: item.user.image !== undefined ? item.user.image : undefined,
5788
+ role: item.user.role !== undefined ? item.user.role : undefined,
5789
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
5790
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
5791
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
5792
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
5793
+ },
5794
+ }
5795
+ } : undefined,
5796
+ asset: item.asset ? {
5797
+ connectOrCreate: {
5798
+ where: {
5799
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
5800
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5801
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
5802
+ },
5803
+ create: {
5804
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
5805
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
5806
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
5807
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
5808
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
5809
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
5810
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
5811
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
5812
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
5813
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
5814
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
5815
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
5816
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
5817
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
5818
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
5819
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
5820
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
5821
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
5822
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
5823
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
5824
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
5825
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
5826
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
5827
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
5828
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
5829
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
5830
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
5831
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
5832
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
5833
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
5834
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
5835
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
5836
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
5837
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
5838
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
5839
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
5840
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
5841
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
5842
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
5843
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
5844
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
5845
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
5846
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
5847
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
5848
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
5849
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
5850
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
5851
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
5852
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
5853
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
5854
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
5855
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
5856
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
5857
+ },
5858
+ }
5859
+ } : undefined,
5860
+ },
5861
+ }))
5862
+ } : undefined,
5863
+ aiRecommendations: prop.aiRecommendations ? {
5864
+ upsert: prop.aiRecommendations.map((item) => ({
5865
+ where: {
5866
+ id: item.id !== undefined ? item.id : undefined,
5867
+ },
5868
+ update: {
5869
+ id: item.id !== undefined ? {
5870
+ set: item.id
5871
+ } : undefined,
5872
+ action: item.action !== undefined ? {
5873
+ set: item.action
5874
+ } : undefined,
5875
+ confidence: item.confidence !== undefined ? {
5876
+ set: item.confidence
5877
+ } : undefined,
5878
+ user: item.user ? {
5879
+ upsert: {
5880
+ where: {
5881
+ id: item.user.id !== undefined ? {
5882
+ equals: item.user.id
5883
+ } : undefined,
5884
+ name: item.user.name !== undefined ? {
5885
+ equals: item.user.name
5886
+ } : undefined,
5887
+ email: item.user.email !== undefined ? {
5888
+ equals: item.user.email
5889
+ } : undefined,
5890
+ },
5891
+ update: {
5892
+ id: item.user.id !== undefined ? {
5893
+ set: item.user.id
5894
+ } : undefined,
5895
+ name: item.user.name !== undefined ? {
5896
+ set: item.user.name
5897
+ } : undefined,
5898
+ email: item.user.email !== undefined ? {
5899
+ set: item.user.email
5900
+ } : undefined,
5901
+ emailVerified: item.user.emailVerified !== undefined ? {
5902
+ set: item.user.emailVerified
5903
+ } : undefined,
5904
+ image: item.user.image !== undefined ? {
5905
+ set: item.user.image
5906
+ } : undefined,
5907
+ role: item.user.role !== undefined ? {
5908
+ set: item.user.role
5909
+ } : undefined,
5910
+ bio: item.user.bio !== undefined ? {
5911
+ set: item.user.bio
5912
+ } : undefined,
5913
+ jobTitle: item.user.jobTitle !== undefined ? {
5914
+ set: item.user.jobTitle
5915
+ } : undefined,
5916
+ currentAccount: item.user.currentAccount !== undefined ? {
5917
+ set: item.user.currentAccount
5918
+ } : undefined,
5919
+ plan: item.user.plan !== undefined ? {
5920
+ set: item.user.plan
5921
+ } : undefined,
5922
+ },
5923
+ create: {
5924
+ name: item.user.name !== undefined ? item.user.name : undefined,
5925
+ email: item.user.email !== undefined ? item.user.email : undefined,
5926
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
5927
+ image: item.user.image !== undefined ? item.user.image : undefined,
5928
+ role: item.user.role !== undefined ? item.user.role : undefined,
5929
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
5930
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
5931
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
5932
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
5933
+ },
5934
+ }
5935
+ } : undefined,
5936
+ asset: item.asset ? {
5937
+ upsert: {
5938
+ where: {
5939
+ id: item.asset.id !== undefined ? {
5940
+ equals: item.asset.id
5941
+ } : undefined,
5942
+ symbol: item.asset.symbol !== undefined ? {
5943
+ equals: item.asset.symbol
5944
+ } : undefined,
5945
+ name: item.asset.name !== undefined ? {
5946
+ equals: item.asset.name
5947
+ } : undefined,
5948
+ },
5949
+ update: {
5950
+ id: item.asset.id !== undefined ? {
5951
+ set: item.asset.id
5952
+ } : undefined,
5953
+ symbol: item.asset.symbol !== undefined ? {
5954
+ set: item.asset.symbol
5955
+ } : undefined,
5956
+ name: item.asset.name !== undefined ? {
5957
+ set: item.asset.name
5958
+ } : undefined,
5959
+ type: item.asset.type !== undefined ? {
5960
+ set: item.asset.type
5961
+ } : undefined,
5962
+ logoUrl: item.asset.logoUrl !== undefined ? {
5963
+ set: item.asset.logoUrl
5964
+ } : undefined,
5965
+ description: item.asset.description !== undefined ? {
5966
+ set: item.asset.description
5967
+ } : undefined,
5968
+ cik: item.asset.cik !== undefined ? {
5969
+ set: item.asset.cik
5970
+ } : undefined,
5971
+ exchange: item.asset.exchange !== undefined ? {
5972
+ set: item.asset.exchange
5973
+ } : undefined,
5974
+ currency: item.asset.currency !== undefined ? {
5975
+ set: item.asset.currency
5976
+ } : undefined,
5977
+ country: item.asset.country !== undefined ? {
5978
+ set: item.asset.country
5979
+ } : undefined,
5980
+ sector: item.asset.sector !== undefined ? {
5981
+ set: item.asset.sector
5982
+ } : undefined,
5983
+ industry: item.asset.industry !== undefined ? {
5984
+ set: item.asset.industry
5985
+ } : undefined,
5986
+ address: item.asset.address !== undefined ? {
5987
+ set: item.asset.address
5988
+ } : undefined,
5989
+ officialSite: item.asset.officialSite !== undefined ? {
5990
+ set: item.asset.officialSite
5991
+ } : undefined,
5992
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? {
5993
+ set: item.asset.fiscalYearEnd
5994
+ } : undefined,
5995
+ latestQuarter: item.asset.latestQuarter !== undefined ? {
5996
+ set: item.asset.latestQuarter
5997
+ } : undefined,
5998
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? {
5999
+ set: item.asset.marketCapitalization
6000
+ } : undefined,
6001
+ ebitda: item.asset.ebitda !== undefined ? {
6002
+ set: item.asset.ebitda
6003
+ } : undefined,
6004
+ peRatio: item.asset.peRatio !== undefined ? {
6005
+ set: item.asset.peRatio
6006
+ } : undefined,
6007
+ pegRatio: item.asset.pegRatio !== undefined ? {
6008
+ set: item.asset.pegRatio
6009
+ } : undefined,
6010
+ bookValue: item.asset.bookValue !== undefined ? {
6011
+ set: item.asset.bookValue
6012
+ } : undefined,
6013
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? {
6014
+ set: item.asset.dividendPerShare
6015
+ } : undefined,
6016
+ dividendYield: item.asset.dividendYield !== undefined ? {
6017
+ set: item.asset.dividendYield
6018
+ } : undefined,
6019
+ eps: item.asset.eps !== undefined ? {
6020
+ set: item.asset.eps
6021
+ } : undefined,
6022
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? {
6023
+ set: item.asset.revenuePerShareTTM
6024
+ } : undefined,
6025
+ profitMargin: item.asset.profitMargin !== undefined ? {
6026
+ set: item.asset.profitMargin
6027
+ } : undefined,
6028
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? {
6029
+ set: item.asset.operatingMarginTTM
6030
+ } : undefined,
6031
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? {
6032
+ set: item.asset.returnOnAssetsTTM
6033
+ } : undefined,
6034
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? {
6035
+ set: item.asset.returnOnEquityTTM
6036
+ } : undefined,
6037
+ revenueTTM: item.asset.revenueTTM !== undefined ? {
6038
+ set: item.asset.revenueTTM
6039
+ } : undefined,
6040
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? {
6041
+ set: item.asset.grossProfitTTM
6042
+ } : undefined,
6043
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? {
6044
+ set: item.asset.dilutedEPSTTM
6045
+ } : undefined,
6046
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? {
6047
+ set: item.asset.quarterlyEarningsGrowthYOY
6048
+ } : undefined,
6049
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? {
6050
+ set: item.asset.quarterlyRevenueGrowthYOY
6051
+ } : undefined,
6052
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? {
6053
+ set: item.asset.analystTargetPrice
6054
+ } : undefined,
6055
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? {
6056
+ set: item.asset.analystRatingStrongBuy
6057
+ } : undefined,
6058
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? {
6059
+ set: item.asset.analystRatingBuy
6060
+ } : undefined,
6061
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? {
6062
+ set: item.asset.analystRatingHold
6063
+ } : undefined,
6064
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? {
6065
+ set: item.asset.analystRatingSell
6066
+ } : undefined,
6067
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? {
6068
+ set: item.asset.analystRatingStrongSell
6069
+ } : undefined,
6070
+ trailingPE: item.asset.trailingPE !== undefined ? {
6071
+ set: item.asset.trailingPE
6072
+ } : undefined,
6073
+ forwardPE: item.asset.forwardPE !== undefined ? {
6074
+ set: item.asset.forwardPE
6075
+ } : undefined,
6076
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? {
6077
+ set: item.asset.priceToSalesRatioTTM
6078
+ } : undefined,
6079
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? {
6080
+ set: item.asset.priceToBookRatio
6081
+ } : undefined,
6082
+ evToRevenue: item.asset.evToRevenue !== undefined ? {
6083
+ set: item.asset.evToRevenue
6084
+ } : undefined,
6085
+ evToEbitda: item.asset.evToEbitda !== undefined ? {
6086
+ set: item.asset.evToEbitda
6087
+ } : undefined,
6088
+ beta: item.asset.beta !== undefined ? {
6089
+ set: item.asset.beta
6090
+ } : undefined,
6091
+ week52High: item.asset.week52High !== undefined ? {
6092
+ set: item.asset.week52High
6093
+ } : undefined,
6094
+ week52Low: item.asset.week52Low !== undefined ? {
6095
+ set: item.asset.week52Low
6096
+ } : undefined,
6097
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? {
6098
+ set: item.asset.day50MovingAverage
6099
+ } : undefined,
6100
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? {
6101
+ set: item.asset.day200MovingAverage
6102
+ } : undefined,
6103
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? {
6104
+ set: item.asset.sharesOutstanding
6105
+ } : undefined,
6106
+ dividendDate: item.asset.dividendDate !== undefined ? {
6107
+ set: item.asset.dividendDate
6108
+ } : undefined,
6109
+ exDividendDate: item.asset.exDividendDate !== undefined ? {
6110
+ set: item.asset.exDividendDate
6111
+ } : undefined,
6112
+ },
6113
+ create: {
6114
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
6115
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
6116
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
6117
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
6118
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
6119
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
6120
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
6121
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
6122
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
6123
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
6124
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
6125
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
6126
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
6127
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
6128
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
6129
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
6130
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
6131
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
6132
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
6133
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
6134
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
6135
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
6136
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
6137
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
6138
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
6139
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
6140
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
6141
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
6142
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
6143
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
6144
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
6145
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
6146
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
6147
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
6148
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
6149
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
6150
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
6151
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
6152
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
6153
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
6154
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
6155
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
6156
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
6157
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
6158
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
6159
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
6160
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
6161
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
6162
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
6163
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
6164
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
6165
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
6166
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
6167
+ },
6168
+ }
6169
+ } : undefined,
6170
+ },
6171
+ create: {
6172
+ action: item.action !== undefined ? item.action : undefined,
6173
+ confidence: item.confidence !== undefined ? item.confidence : undefined,
6174
+ user: item.user ? {
6175
+ connectOrCreate: {
6176
+ where: {
6177
+ id: item.user.id !== undefined ? item.user.id : undefined,
6178
+ email: item.user.email !== undefined ? item.user.email : undefined,
6179
+ name: item.user.name !== undefined ? {
6180
+ equals: item.user.name
6181
+ } : undefined,
6182
+ },
6183
+ create: {
6184
+ name: item.user.name !== undefined ? item.user.name : undefined,
6185
+ email: item.user.email !== undefined ? item.user.email : undefined,
6186
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6187
+ image: item.user.image !== undefined ? item.user.image : undefined,
6188
+ role: item.user.role !== undefined ? item.user.role : undefined,
6189
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6190
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6191
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6192
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6193
+ },
6194
+ }
6195
+ } : undefined,
6196
+ asset: item.asset ? {
6197
+ connectOrCreate: {
6198
+ where: {
6199
+ id: item.asset.id !== undefined ? item.asset.id : undefined,
6200
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
6201
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
6202
+ },
6203
+ create: {
6204
+ symbol: item.asset.symbol !== undefined ? item.asset.symbol : undefined,
6205
+ name: item.asset.name !== undefined ? item.asset.name : undefined,
6206
+ type: item.asset.type !== undefined ? item.asset.type : undefined,
6207
+ logoUrl: item.asset.logoUrl !== undefined ? item.asset.logoUrl : undefined,
6208
+ description: item.asset.description !== undefined ? item.asset.description : undefined,
6209
+ cik: item.asset.cik !== undefined ? item.asset.cik : undefined,
6210
+ exchange: item.asset.exchange !== undefined ? item.asset.exchange : undefined,
6211
+ currency: item.asset.currency !== undefined ? item.asset.currency : undefined,
6212
+ country: item.asset.country !== undefined ? item.asset.country : undefined,
6213
+ sector: item.asset.sector !== undefined ? item.asset.sector : undefined,
6214
+ industry: item.asset.industry !== undefined ? item.asset.industry : undefined,
6215
+ address: item.asset.address !== undefined ? item.asset.address : undefined,
6216
+ officialSite: item.asset.officialSite !== undefined ? item.asset.officialSite : undefined,
6217
+ fiscalYearEnd: item.asset.fiscalYearEnd !== undefined ? item.asset.fiscalYearEnd : undefined,
6218
+ latestQuarter: item.asset.latestQuarter !== undefined ? item.asset.latestQuarter : undefined,
6219
+ marketCapitalization: item.asset.marketCapitalization !== undefined ? item.asset.marketCapitalization : undefined,
6220
+ ebitda: item.asset.ebitda !== undefined ? item.asset.ebitda : undefined,
6221
+ peRatio: item.asset.peRatio !== undefined ? item.asset.peRatio : undefined,
6222
+ pegRatio: item.asset.pegRatio !== undefined ? item.asset.pegRatio : undefined,
6223
+ bookValue: item.asset.bookValue !== undefined ? item.asset.bookValue : undefined,
6224
+ dividendPerShare: item.asset.dividendPerShare !== undefined ? item.asset.dividendPerShare : undefined,
6225
+ dividendYield: item.asset.dividendYield !== undefined ? item.asset.dividendYield : undefined,
6226
+ eps: item.asset.eps !== undefined ? item.asset.eps : undefined,
6227
+ revenuePerShareTTM: item.asset.revenuePerShareTTM !== undefined ? item.asset.revenuePerShareTTM : undefined,
6228
+ profitMargin: item.asset.profitMargin !== undefined ? item.asset.profitMargin : undefined,
6229
+ operatingMarginTTM: item.asset.operatingMarginTTM !== undefined ? item.asset.operatingMarginTTM : undefined,
6230
+ returnOnAssetsTTM: item.asset.returnOnAssetsTTM !== undefined ? item.asset.returnOnAssetsTTM : undefined,
6231
+ returnOnEquityTTM: item.asset.returnOnEquityTTM !== undefined ? item.asset.returnOnEquityTTM : undefined,
6232
+ revenueTTM: item.asset.revenueTTM !== undefined ? item.asset.revenueTTM : undefined,
6233
+ grossProfitTTM: item.asset.grossProfitTTM !== undefined ? item.asset.grossProfitTTM : undefined,
6234
+ dilutedEPSTTM: item.asset.dilutedEPSTTM !== undefined ? item.asset.dilutedEPSTTM : undefined,
6235
+ quarterlyEarningsGrowthYOY: item.asset.quarterlyEarningsGrowthYOY !== undefined ? item.asset.quarterlyEarningsGrowthYOY : undefined,
6236
+ quarterlyRevenueGrowthYOY: item.asset.quarterlyRevenueGrowthYOY !== undefined ? item.asset.quarterlyRevenueGrowthYOY : undefined,
6237
+ analystTargetPrice: item.asset.analystTargetPrice !== undefined ? item.asset.analystTargetPrice : undefined,
6238
+ analystRatingStrongBuy: item.asset.analystRatingStrongBuy !== undefined ? item.asset.analystRatingStrongBuy : undefined,
6239
+ analystRatingBuy: item.asset.analystRatingBuy !== undefined ? item.asset.analystRatingBuy : undefined,
6240
+ analystRatingHold: item.asset.analystRatingHold !== undefined ? item.asset.analystRatingHold : undefined,
6241
+ analystRatingSell: item.asset.analystRatingSell !== undefined ? item.asset.analystRatingSell : undefined,
6242
+ analystRatingStrongSell: item.asset.analystRatingStrongSell !== undefined ? item.asset.analystRatingStrongSell : undefined,
6243
+ trailingPE: item.asset.trailingPE !== undefined ? item.asset.trailingPE : undefined,
6244
+ forwardPE: item.asset.forwardPE !== undefined ? item.asset.forwardPE : undefined,
6245
+ priceToSalesRatioTTM: item.asset.priceToSalesRatioTTM !== undefined ? item.asset.priceToSalesRatioTTM : undefined,
6246
+ priceToBookRatio: item.asset.priceToBookRatio !== undefined ? item.asset.priceToBookRatio : undefined,
6247
+ evToRevenue: item.asset.evToRevenue !== undefined ? item.asset.evToRevenue : undefined,
6248
+ evToEbitda: item.asset.evToEbitda !== undefined ? item.asset.evToEbitda : undefined,
6249
+ beta: item.asset.beta !== undefined ? item.asset.beta : undefined,
6250
+ week52High: item.asset.week52High !== undefined ? item.asset.week52High : undefined,
6251
+ week52Low: item.asset.week52Low !== undefined ? item.asset.week52Low : undefined,
6252
+ day50MovingAverage: item.asset.day50MovingAverage !== undefined ? item.asset.day50MovingAverage : undefined,
6253
+ day200MovingAverage: item.asset.day200MovingAverage !== undefined ? item.asset.day200MovingAverage : undefined,
6254
+ sharesOutstanding: item.asset.sharesOutstanding !== undefined ? item.asset.sharesOutstanding : undefined,
6255
+ dividendDate: item.asset.dividendDate !== undefined ? item.asset.dividendDate : undefined,
6256
+ exDividendDate: item.asset.exDividendDate !== undefined ? item.asset.exDividendDate : undefined,
6257
+ },
6258
+ }
6259
+ } : undefined,
6260
+ },
6261
+ }))
6262
+ } : undefined,
6263
+ riskAllocations: prop.riskAllocations ? {
6264
+ upsert: prop.riskAllocations.map((item) => ({
6265
+ where: {
6266
+ id: item.id !== undefined ? item.id : undefined,
6267
+ },
6268
+ update: {
6269
+ id: item.id !== undefined ? {
6270
+ set: item.id
6271
+ } : undefined,
6272
+ assetType: item.assetType !== undefined ? {
6273
+ set: item.assetType
6274
+ } : undefined,
6275
+ allocation: item.allocation !== undefined ? {
6276
+ set: item.allocation
6277
+ } : undefined,
6278
+ user: item.user ? {
6279
+ upsert: {
6280
+ where: {
6281
+ id: item.user.id !== undefined ? {
6282
+ equals: item.user.id
6283
+ } : undefined,
6284
+ name: item.user.name !== undefined ? {
6285
+ equals: item.user.name
6286
+ } : undefined,
6287
+ email: item.user.email !== undefined ? {
6288
+ equals: item.user.email
6289
+ } : undefined,
6290
+ },
6291
+ update: {
6292
+ id: item.user.id !== undefined ? {
6293
+ set: item.user.id
6294
+ } : undefined,
6295
+ name: item.user.name !== undefined ? {
6296
+ set: item.user.name
6297
+ } : undefined,
6298
+ email: item.user.email !== undefined ? {
6299
+ set: item.user.email
6300
+ } : undefined,
6301
+ emailVerified: item.user.emailVerified !== undefined ? {
6302
+ set: item.user.emailVerified
6303
+ } : undefined,
6304
+ image: item.user.image !== undefined ? {
6305
+ set: item.user.image
6306
+ } : undefined,
6307
+ role: item.user.role !== undefined ? {
6308
+ set: item.user.role
6309
+ } : undefined,
6310
+ bio: item.user.bio !== undefined ? {
6311
+ set: item.user.bio
6312
+ } : undefined,
6313
+ jobTitle: item.user.jobTitle !== undefined ? {
6314
+ set: item.user.jobTitle
6315
+ } : undefined,
6316
+ currentAccount: item.user.currentAccount !== undefined ? {
6317
+ set: item.user.currentAccount
6318
+ } : undefined,
6319
+ plan: item.user.plan !== undefined ? {
6320
+ set: item.user.plan
6321
+ } : undefined,
6322
+ },
6323
+ create: {
6324
+ name: item.user.name !== undefined ? item.user.name : undefined,
6325
+ email: item.user.email !== undefined ? item.user.email : undefined,
6326
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6327
+ image: item.user.image !== undefined ? item.user.image : undefined,
6328
+ role: item.user.role !== undefined ? item.user.role : undefined,
6329
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6330
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6331
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6332
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6333
+ },
6334
+ }
6335
+ } : undefined,
6336
+ },
6337
+ create: {
6338
+ assetType: item.assetType !== undefined ? item.assetType : undefined,
6339
+ allocation: item.allocation !== undefined ? item.allocation : undefined,
6340
+ user: item.user ? {
6341
+ connectOrCreate: {
6342
+ where: {
6343
+ id: item.user.id !== undefined ? item.user.id : undefined,
6344
+ email: item.user.email !== undefined ? item.user.email : undefined,
6345
+ name: item.user.name !== undefined ? {
6346
+ equals: item.user.name
6347
+ } : undefined,
6348
+ },
6349
+ create: {
6350
+ name: item.user.name !== undefined ? item.user.name : undefined,
6351
+ email: item.user.email !== undefined ? item.user.email : undefined,
6352
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6353
+ image: item.user.image !== undefined ? item.user.image : undefined,
6354
+ role: item.user.role !== undefined ? item.user.role : undefined,
6355
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6356
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6357
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6358
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6359
+ },
6360
+ }
6361
+ } : undefined,
6362
+ },
6363
+ }))
6364
+ } : undefined,
6365
+ alerts: prop.alerts ? {
6366
+ upsert: prop.alerts.map((item) => ({
6367
+ where: {
6368
+ id: item.id !== undefined ? item.id : undefined,
6369
+ },
6370
+ update: {
6371
+ id: item.id !== undefined ? {
6372
+ set: item.id
6373
+ } : undefined,
6374
+ message: item.message !== undefined ? {
6375
+ set: item.message
6376
+ } : undefined,
6377
+ type: item.type !== undefined ? {
6378
+ set: item.type
6379
+ } : undefined,
6380
+ isRead: item.isRead !== undefined ? {
6381
+ set: item.isRead
6382
+ } : undefined,
6383
+ user: item.user ? {
6384
+ upsert: {
6385
+ where: {
6386
+ id: item.user.id !== undefined ? {
6387
+ equals: item.user.id
6388
+ } : undefined,
6389
+ name: item.user.name !== undefined ? {
6390
+ equals: item.user.name
6391
+ } : undefined,
6392
+ email: item.user.email !== undefined ? {
6393
+ equals: item.user.email
6394
+ } : undefined,
6395
+ },
6396
+ update: {
6397
+ id: item.user.id !== undefined ? {
6398
+ set: item.user.id
6399
+ } : undefined,
6400
+ name: item.user.name !== undefined ? {
6401
+ set: item.user.name
6402
+ } : undefined,
6403
+ email: item.user.email !== undefined ? {
6404
+ set: item.user.email
6405
+ } : undefined,
6406
+ emailVerified: item.user.emailVerified !== undefined ? {
6407
+ set: item.user.emailVerified
6408
+ } : undefined,
6409
+ image: item.user.image !== undefined ? {
6410
+ set: item.user.image
6411
+ } : undefined,
6412
+ role: item.user.role !== undefined ? {
6413
+ set: item.user.role
6414
+ } : undefined,
6415
+ bio: item.user.bio !== undefined ? {
6416
+ set: item.user.bio
6417
+ } : undefined,
6418
+ jobTitle: item.user.jobTitle !== undefined ? {
6419
+ set: item.user.jobTitle
6420
+ } : undefined,
6421
+ currentAccount: item.user.currentAccount !== undefined ? {
6422
+ set: item.user.currentAccount
6423
+ } : undefined,
6424
+ plan: item.user.plan !== undefined ? {
6425
+ set: item.user.plan
6426
+ } : undefined,
6427
+ },
6428
+ create: {
6429
+ name: item.user.name !== undefined ? item.user.name : undefined,
6430
+ email: item.user.email !== undefined ? item.user.email : undefined,
6431
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6432
+ image: item.user.image !== undefined ? item.user.image : undefined,
6433
+ role: item.user.role !== undefined ? item.user.role : undefined,
6434
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6435
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6436
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6437
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6438
+ },
6439
+ }
6440
+ } : undefined,
6441
+ },
6442
+ create: {
6443
+ message: item.message !== undefined ? item.message : undefined,
6444
+ type: item.type !== undefined ? item.type : undefined,
6445
+ isRead: item.isRead !== undefined ? item.isRead : undefined,
6446
+ user: item.user ? {
6447
+ connectOrCreate: {
6448
+ where: {
6449
+ id: item.user.id !== undefined ? item.user.id : undefined,
6450
+ email: item.user.email !== undefined ? item.user.email : undefined,
6451
+ name: item.user.name !== undefined ? {
6452
+ equals: item.user.name
6453
+ } : undefined,
6454
+ },
6455
+ create: {
6456
+ name: item.user.name !== undefined ? item.user.name : undefined,
6457
+ email: item.user.email !== undefined ? item.user.email : undefined,
6458
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6459
+ image: item.user.image !== undefined ? item.user.image : undefined,
6460
+ role: item.user.role !== undefined ? item.user.role : undefined,
6461
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6462
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6463
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6464
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6465
+ },
6466
+ }
6467
+ } : undefined,
6468
+ },
6469
+ }))
6470
+ } : undefined,
6471
+ performanceMetrics: prop.performanceMetrics ? {
6472
+ upsert: prop.performanceMetrics.map((item) => ({
6473
+ where: {
6474
+ id: item.id !== undefined ? item.id : undefined,
6475
+ },
6476
+ update: {
6477
+ id: item.id !== undefined ? {
6478
+ set: item.id
6479
+ } : undefined,
6480
+ label: item.label !== undefined ? {
6481
+ set: item.label
6482
+ } : undefined,
6483
+ value: item.value !== undefined ? {
6484
+ set: item.value
6485
+ } : undefined,
6486
+ user: item.user ? {
6487
+ upsert: {
6488
+ where: {
6489
+ id: item.user.id !== undefined ? {
6490
+ equals: item.user.id
6491
+ } : undefined,
6492
+ name: item.user.name !== undefined ? {
6493
+ equals: item.user.name
6494
+ } : undefined,
6495
+ email: item.user.email !== undefined ? {
6496
+ equals: item.user.email
6497
+ } : undefined,
6498
+ },
6499
+ update: {
6500
+ id: item.user.id !== undefined ? {
6501
+ set: item.user.id
6502
+ } : undefined,
6503
+ name: item.user.name !== undefined ? {
6504
+ set: item.user.name
6505
+ } : undefined,
6506
+ email: item.user.email !== undefined ? {
6507
+ set: item.user.email
6508
+ } : undefined,
6509
+ emailVerified: item.user.emailVerified !== undefined ? {
6510
+ set: item.user.emailVerified
6511
+ } : undefined,
6512
+ image: item.user.image !== undefined ? {
6513
+ set: item.user.image
6514
+ } : undefined,
6515
+ role: item.user.role !== undefined ? {
6516
+ set: item.user.role
6517
+ } : undefined,
6518
+ bio: item.user.bio !== undefined ? {
6519
+ set: item.user.bio
6520
+ } : undefined,
6521
+ jobTitle: item.user.jobTitle !== undefined ? {
6522
+ set: item.user.jobTitle
6523
+ } : undefined,
6524
+ currentAccount: item.user.currentAccount !== undefined ? {
6525
+ set: item.user.currentAccount
6526
+ } : undefined,
6527
+ plan: item.user.plan !== undefined ? {
6528
+ set: item.user.plan
6529
+ } : undefined,
6530
+ },
6531
+ create: {
6532
+ name: item.user.name !== undefined ? item.user.name : undefined,
6533
+ email: item.user.email !== undefined ? item.user.email : undefined,
6534
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6535
+ image: item.user.image !== undefined ? item.user.image : undefined,
6536
+ role: item.user.role !== undefined ? item.user.role : undefined,
6537
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6538
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6539
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6540
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6541
+ },
6542
+ }
6543
+ } : undefined,
6544
+ },
6545
+ create: {
6546
+ label: item.label !== undefined ? item.label : undefined,
6547
+ value: item.value !== undefined ? item.value : undefined,
6548
+ user: item.user ? {
6549
+ connectOrCreate: {
6550
+ where: {
6551
+ id: item.user.id !== undefined ? item.user.id : undefined,
6552
+ email: item.user.email !== undefined ? item.user.email : undefined,
6553
+ name: item.user.name !== undefined ? {
6554
+ equals: item.user.name
6555
+ } : undefined,
6556
+ },
6557
+ create: {
6558
+ name: item.user.name !== undefined ? item.user.name : undefined,
6559
+ email: item.user.email !== undefined ? item.user.email : undefined,
6560
+ emailVerified: item.user.emailVerified !== undefined ? item.user.emailVerified : undefined,
6561
+ image: item.user.image !== undefined ? item.user.image : undefined,
6562
+ role: item.user.role !== undefined ? item.user.role : undefined,
6563
+ bio: item.user.bio !== undefined ? item.user.bio : undefined,
6564
+ jobTitle: item.user.jobTitle !== undefined ? item.user.jobTitle : undefined,
6565
+ currentAccount: item.user.currentAccount !== undefined ? item.user.currentAccount : undefined,
6566
+ plan: item.user.plan !== undefined ? item.user.plan : undefined,
6567
+ },
6568
+ }
6569
+ } : undefined,
6570
+ },
6571
+ }))
6572
+ } : undefined,
6573
+ environmentVariables: prop.environmentVariables ? {
6574
+ upsert: prop.environmentVariables.map((item) => ({
6575
+ where: {
6576
+ id: item.id !== undefined ? item.id : undefined,
6577
+ key: item.key !== undefined ? {
6578
+ equals: item.key
6579
+ } : undefined,
6580
+ },
6581
+ update: {
6582
+ id: item.id !== undefined ? {
6583
+ set: item.id
6584
+ } : undefined,
6585
+ key: item.key !== undefined ? {
6586
+ set: item.key
6587
+ } : undefined,
6588
+ value: item.value !== undefined ? {
6589
+ set: item.value
6590
+ } : undefined,
6591
+ description: item.description !== undefined ? {
6592
+ set: item.description
6593
+ } : undefined,
6594
+ },
6595
+ create: {
6596
+ key: item.key !== undefined ? item.key : undefined,
6597
+ value: item.value !== undefined ? item.value : undefined,
6598
+ description: item.description !== undefined ? item.description : undefined,
6599
+ },
6600
+ }))
6601
+ } : undefined,
6602
+ },
6603
+ }));
6604
+ const filteredVariables = (0, utils_1.removeUndefinedProps)(variables);
6605
+ try {
6606
+ const response = await client.mutate({ mutation: UPDATE_MANY_TRADINGACCOUNT, variables: filteredVariables });
6607
+ if (response.errors && response.errors.length > 0)
6608
+ throw new Error(response.errors[0].message);
6609
+ if (response && response.data && response.data.updateManyTradingAccount) {
6610
+ return response.data.updateManyTradingAccount;
6611
+ }
6612
+ else {
6613
+ return null;
6614
+ }
6615
+ }
6616
+ catch (error) {
6617
+ console.error('Error in updateManyTradingAccount:', error);
6618
+ throw error;
6619
+ }
6620
+ },
4036
6621
  /**
4037
6622
  * Delete a single TradingAccount record.
4038
6623
  * @param props - Properties to update.