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