adaptic-backend 1.0.159 → 1.0.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/Account.cjs +285 -8
  2. package/Action.cjs +615 -4
  3. package/Alert.cjs +338 -4
  4. package/AlpacaAccount.cjs +771 -4
  5. package/Asset.cjs +642 -0
  6. package/Authenticator.cjs +288 -4
  7. package/Customer.cjs +273 -10
  8. package/NewsArticle.cjs +165 -0
  9. package/NewsArticleAssetSentiment.cjs +256 -8
  10. package/Order.cjs +510 -10
  11. package/Position.cjs +546 -8
  12. package/Session.cjs +288 -4
  13. package/StopLoss.cjs +348 -1
  14. package/TakeProfit.cjs +348 -1
  15. package/Trade.cjs +607 -8
  16. package/User.cjs +261 -0
  17. package/package.json +1 -1
  18. package/server/Account.d.ts.map +1 -1
  19. package/server/Account.js.map +1 -1
  20. package/server/Account.mjs +285 -8
  21. package/server/Action.d.ts.map +1 -1
  22. package/server/Action.js.map +1 -1
  23. package/server/Action.mjs +615 -4
  24. package/server/Alert.d.ts.map +1 -1
  25. package/server/Alert.js.map +1 -1
  26. package/server/Alert.mjs +338 -4
  27. package/server/AlpacaAccount.d.ts.map +1 -1
  28. package/server/AlpacaAccount.js.map +1 -1
  29. package/server/AlpacaAccount.mjs +771 -4
  30. package/server/Asset.d.ts.map +1 -1
  31. package/server/Asset.js.map +1 -1
  32. package/server/Asset.mjs +642 -0
  33. package/server/Authenticator.d.ts.map +1 -1
  34. package/server/Authenticator.js.map +1 -1
  35. package/server/Authenticator.mjs +288 -4
  36. package/server/Customer.d.ts.map +1 -1
  37. package/server/Customer.js.map +1 -1
  38. package/server/Customer.mjs +273 -10
  39. package/server/NewsArticle.d.ts.map +1 -1
  40. package/server/NewsArticle.js.map +1 -1
  41. package/server/NewsArticle.mjs +165 -0
  42. package/server/NewsArticleAssetSentiment.d.ts.map +1 -1
  43. package/server/NewsArticleAssetSentiment.js.map +1 -1
  44. package/server/NewsArticleAssetSentiment.mjs +256 -8
  45. package/server/Order.d.ts.map +1 -1
  46. package/server/Order.js.map +1 -1
  47. package/server/Order.mjs +510 -10
  48. package/server/Position.d.ts.map +1 -1
  49. package/server/Position.js.map +1 -1
  50. package/server/Position.mjs +546 -8
  51. package/server/Session.d.ts.map +1 -1
  52. package/server/Session.js.map +1 -1
  53. package/server/Session.mjs +288 -4
  54. package/server/StopLoss.d.ts.map +1 -1
  55. package/server/StopLoss.js.map +1 -1
  56. package/server/StopLoss.mjs +348 -1
  57. package/server/TakeProfit.d.ts.map +1 -1
  58. package/server/TakeProfit.js.map +1 -1
  59. package/server/TakeProfit.mjs +348 -1
  60. package/server/Trade.d.ts.map +1 -1
  61. package/server/Trade.js.map +1 -1
  62. package/server/Trade.mjs +607 -8
  63. package/server/User.d.ts.map +1 -1
  64. package/server/User.js.map +1 -1
  65. package/server/User.mjs +261 -0
package/server/User.mjs CHANGED
@@ -431,9 +431,17 @@ export const User = {
431
431
  : { connectOrCreate: {
432
432
  where: {
433
433
  id: props.customer.id !== undefined ? props.customer.id : undefined,
434
+ stripeCustomerId: props.customer.stripeCustomerId !== undefined ? props.customer.stripeCustomerId : undefined,
435
+ stripeSubscriptionId: props.customer.stripeSubscriptionId !== undefined ? props.customer.stripeSubscriptionId : undefined,
436
+ authUserId: props.customer.authUserId !== undefined ? {
437
+ equals: props.customer.authUserId
438
+ } : undefined,
434
439
  name: props.customer.name !== undefined ? {
435
440
  equals: props.customer.name
436
441
  } : undefined,
442
+ stripePriceId: props.customer.stripePriceId !== undefined ? {
443
+ equals: props.customer.stripePriceId
444
+ } : undefined,
437
445
  },
438
446
  create: {
439
447
  authUserId: props.customer.authUserId !== undefined ? props.customer.authUserId : undefined,
@@ -455,6 +463,12 @@ export const User = {
455
463
  : { connectOrCreate: props.accounts.map((item) => ({
456
464
  where: {
457
465
  id: item.id !== undefined ? item.id : undefined,
466
+ userId: item.userId !== undefined ? {
467
+ equals: item.userId
468
+ } : undefined,
469
+ providerAccountId: item.providerAccountId !== undefined ? {
470
+ equals: item.providerAccountId
471
+ } : undefined,
458
472
  },
459
473
  create: {
460
474
  type: item.type !== undefined ? item.type : undefined,
@@ -479,6 +493,9 @@ export const User = {
479
493
  : { connectOrCreate: props.sessions.map((item) => ({
480
494
  where: {
481
495
  id: item.id !== undefined ? item.id : undefined,
496
+ userId: item.userId !== undefined ? {
497
+ equals: item.userId
498
+ } : undefined,
482
499
  },
483
500
  create: {
484
501
  sessionToken: item.sessionToken !== undefined ? item.sessionToken : undefined,
@@ -495,6 +512,9 @@ export const User = {
495
512
  : { connectOrCreate: props.authenticators.map((item) => ({
496
513
  where: {
497
514
  id: item.id !== undefined ? item.id : undefined,
515
+ userId: item.userId !== undefined ? {
516
+ equals: item.userId
517
+ } : undefined,
498
518
  },
499
519
  create: {
500
520
  credentialID: item.credentialID !== undefined ? item.credentialID : undefined,
@@ -512,6 +532,9 @@ export const User = {
512
532
  : { connectOrCreate: props.alpacaAccounts.map((item) => ({
513
533
  where: {
514
534
  id: item.id !== undefined ? item.id : undefined,
535
+ userId: item.userId !== undefined ? {
536
+ equals: item.userId
537
+ } : undefined,
515
538
  },
516
539
  create: {
517
540
  type: item.type !== undefined ? item.type : undefined,
@@ -532,6 +555,12 @@ export const User = {
532
555
  : { connectOrCreate: item.trades.map((item) => ({
533
556
  where: {
534
557
  id: item.id !== undefined ? item.id : undefined,
558
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
559
+ equals: item.alpacaAccountId
560
+ } : undefined,
561
+ assetId: item.assetId !== undefined ? {
562
+ equals: item.assetId
563
+ } : undefined,
535
564
  },
536
565
  create: {
537
566
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -625,6 +654,9 @@ export const User = {
625
654
  : { connectOrCreate: item.actions.map((item) => ({
626
655
  where: {
627
656
  id: item.id !== undefined ? item.id : undefined,
657
+ tradeId: item.tradeId !== undefined ? {
658
+ equals: item.tradeId
659
+ } : undefined,
628
660
  },
629
661
  create: {
630
662
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -647,6 +679,15 @@ export const User = {
647
679
  : { connectOrCreate: item.orders.map((item) => ({
648
680
  where: {
649
681
  id: item.id !== undefined ? item.id : undefined,
682
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
683
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
684
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
685
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
686
+ equals: item.alpacaAccountId
687
+ } : undefined,
688
+ assetId: item.assetId !== undefined ? {
689
+ equals: item.assetId
690
+ } : undefined,
650
691
  },
651
692
  create: {
652
693
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -680,6 +721,7 @@ export const User = {
680
721
  : { connectOrCreate: {
681
722
  where: {
682
723
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
724
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
683
725
  },
684
726
  create: {
685
727
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -696,6 +738,7 @@ export const User = {
696
738
  : { connectOrCreate: {
697
739
  where: {
698
740
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
741
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
699
742
  },
700
743
  create: {
701
744
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -712,6 +755,9 @@ export const User = {
712
755
  : { connectOrCreate: {
713
756
  where: {
714
757
  id: item.action.id !== undefined ? item.action.id : undefined,
758
+ tradeId: item.action.tradeId !== undefined ? {
759
+ equals: item.action.tradeId
760
+ } : undefined,
715
761
  },
716
762
  create: {
717
763
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -805,6 +851,12 @@ export const User = {
805
851
  : { connectOrCreate: item.positions.map((item) => ({
806
852
  where: {
807
853
  id: item.id !== undefined ? item.id : undefined,
854
+ assetId: item.assetId !== undefined ? {
855
+ equals: item.assetId
856
+ } : undefined,
857
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
858
+ equals: item.alpacaAccountId
859
+ } : undefined,
808
860
  },
809
861
  create: {
810
862
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -903,6 +955,9 @@ export const User = {
903
955
  : { connectOrCreate: item.alerts.map((item) => ({
904
956
  where: {
905
957
  id: item.id !== undefined ? item.id : undefined,
958
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
959
+ equals: item.alpacaAccountId
960
+ } : undefined,
906
961
  },
907
962
  create: {
908
963
  message: item.message !== undefined ? item.message : undefined,
@@ -1060,9 +1115,21 @@ export const User = {
1060
1115
  id: props.customer.id !== undefined ? {
1061
1116
  equals: props.customer.id
1062
1117
  } : undefined,
1118
+ authUserId: props.customer.authUserId !== undefined ? {
1119
+ equals: props.customer.authUserId
1120
+ } : undefined,
1063
1121
  name: props.customer.name !== undefined ? {
1064
1122
  equals: props.customer.name
1065
1123
  } : undefined,
1124
+ stripeCustomerId: props.customer.stripeCustomerId !== undefined ? {
1125
+ equals: props.customer.stripeCustomerId
1126
+ } : undefined,
1127
+ stripeSubscriptionId: props.customer.stripeSubscriptionId !== undefined ? {
1128
+ equals: props.customer.stripeSubscriptionId
1129
+ } : undefined,
1130
+ stripePriceId: props.customer.stripePriceId !== undefined ? {
1131
+ equals: props.customer.stripePriceId
1132
+ } : undefined,
1066
1133
  },
1067
1134
  update: {
1068
1135
  authUserId: props.customer.authUserId !== undefined ? {
@@ -1102,6 +1169,12 @@ export const User = {
1102
1169
  upsert: props.accounts.map((item) => ({
1103
1170
  where: {
1104
1171
  id: item.id !== undefined ? item.id : undefined,
1172
+ userId: item.userId !== undefined ? {
1173
+ equals: item.userId
1174
+ } : undefined,
1175
+ providerAccountId: item.providerAccountId !== undefined ? {
1176
+ equals: item.providerAccountId
1177
+ } : undefined,
1105
1178
  },
1106
1179
  update: {
1107
1180
  id: item.id !== undefined ? {
@@ -1156,6 +1229,9 @@ export const User = {
1156
1229
  upsert: props.sessions.map((item) => ({
1157
1230
  where: {
1158
1231
  id: item.id !== undefined ? item.id : undefined,
1232
+ userId: item.userId !== undefined ? {
1233
+ equals: item.userId
1234
+ } : undefined,
1159
1235
  },
1160
1236
  update: {
1161
1237
  id: item.id !== undefined ? {
@@ -1178,6 +1254,9 @@ export const User = {
1178
1254
  upsert: props.authenticators.map((item) => ({
1179
1255
  where: {
1180
1256
  id: item.id !== undefined ? item.id : undefined,
1257
+ userId: item.userId !== undefined ? {
1258
+ equals: item.userId
1259
+ } : undefined,
1181
1260
  },
1182
1261
  update: {
1183
1262
  id: item.id !== undefined ? {
@@ -1204,6 +1283,9 @@ export const User = {
1204
1283
  upsert: props.alpacaAccounts.map((item) => ({
1205
1284
  where: {
1206
1285
  id: item.id !== undefined ? item.id : undefined,
1286
+ userId: item.userId !== undefined ? {
1287
+ equals: item.userId
1288
+ } : undefined,
1207
1289
  },
1208
1290
  update: {
1209
1291
  id: item.id !== undefined ? {
@@ -1240,6 +1322,12 @@ export const User = {
1240
1322
  upsert: item.trades.map((item) => ({
1241
1323
  where: {
1242
1324
  id: item.id !== undefined ? item.id : undefined,
1325
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1326
+ equals: item.alpacaAccountId
1327
+ } : undefined,
1328
+ assetId: item.assetId !== undefined ? {
1329
+ equals: item.assetId
1330
+ } : undefined,
1243
1331
  },
1244
1332
  update: {
1245
1333
  id: item.id !== undefined ? {
@@ -1524,6 +1612,9 @@ export const User = {
1524
1612
  upsert: item.actions.map((item) => ({
1525
1613
  where: {
1526
1614
  id: item.id !== undefined ? item.id : undefined,
1615
+ tradeId: item.tradeId !== undefined ? {
1616
+ equals: item.tradeId
1617
+ } : undefined,
1527
1618
  },
1528
1619
  update: {
1529
1620
  id: item.id !== undefined ? {
@@ -1647,6 +1738,9 @@ export const User = {
1647
1738
  : { connectOrCreate: item.actions.map((item) => ({
1648
1739
  where: {
1649
1740
  id: item.id !== undefined ? item.id : undefined,
1741
+ tradeId: item.tradeId !== undefined ? {
1742
+ equals: item.tradeId
1743
+ } : undefined,
1650
1744
  },
1651
1745
  create: {
1652
1746
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -1664,6 +1758,15 @@ export const User = {
1664
1758
  upsert: item.orders.map((item) => ({
1665
1759
  where: {
1666
1760
  id: item.id !== undefined ? item.id : undefined,
1761
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
1762
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
1763
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
1764
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
1765
+ equals: item.alpacaAccountId
1766
+ } : undefined,
1767
+ assetId: item.assetId !== undefined ? {
1768
+ equals: item.assetId
1769
+ } : undefined,
1667
1770
  },
1668
1771
  update: {
1669
1772
  id: item.id !== undefined ? {
@@ -1741,6 +1844,9 @@ export const User = {
1741
1844
  id: item.stopLoss.id !== undefined ? {
1742
1845
  equals: item.stopLoss.id
1743
1846
  } : undefined,
1847
+ orderId: item.stopLoss.orderId !== undefined ? {
1848
+ equals: item.stopLoss.orderId
1849
+ } : undefined,
1744
1850
  },
1745
1851
  update: {
1746
1852
  id: item.stopLoss.id !== undefined ? {
@@ -1765,6 +1871,9 @@ export const User = {
1765
1871
  id: item.takeProfit.id !== undefined ? {
1766
1872
  equals: item.takeProfit.id
1767
1873
  } : undefined,
1874
+ orderId: item.takeProfit.orderId !== undefined ? {
1875
+ equals: item.takeProfit.orderId
1876
+ } : undefined,
1768
1877
  },
1769
1878
  update: {
1770
1879
  id: item.takeProfit.id !== undefined ? {
@@ -1789,6 +1898,9 @@ export const User = {
1789
1898
  id: item.action.id !== undefined ? {
1790
1899
  equals: item.action.id
1791
1900
  } : undefined,
1901
+ tradeId: item.action.tradeId !== undefined ? {
1902
+ equals: item.action.tradeId
1903
+ } : undefined,
1792
1904
  },
1793
1905
  update: {
1794
1906
  id: item.action.id !== undefined ? {
@@ -2094,6 +2206,7 @@ export const User = {
2094
2206
  : { connectOrCreate: {
2095
2207
  where: {
2096
2208
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
2209
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2097
2210
  },
2098
2211
  create: {
2099
2212
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2110,6 +2223,7 @@ export const User = {
2110
2223
  : { connectOrCreate: {
2111
2224
  where: {
2112
2225
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
2226
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2113
2227
  },
2114
2228
  create: {
2115
2229
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2126,6 +2240,9 @@ export const User = {
2126
2240
  : { connectOrCreate: {
2127
2241
  where: {
2128
2242
  id: item.action.id !== undefined ? item.action.id : undefined,
2243
+ tradeId: item.action.tradeId !== undefined ? {
2244
+ equals: item.action.tradeId
2245
+ } : undefined,
2129
2246
  },
2130
2247
  create: {
2131
2248
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2214,6 +2331,12 @@ export const User = {
2214
2331
  upsert: item.positions.map((item) => ({
2215
2332
  where: {
2216
2333
  id: item.id !== undefined ? item.id : undefined,
2334
+ assetId: item.assetId !== undefined ? {
2335
+ equals: item.assetId
2336
+ } : undefined,
2337
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2338
+ equals: item.alpacaAccountId
2339
+ } : undefined,
2217
2340
  },
2218
2341
  update: {
2219
2342
  id: item.id !== undefined ? {
@@ -2593,6 +2716,9 @@ export const User = {
2593
2716
  upsert: item.alerts.map((item) => ({
2594
2717
  where: {
2595
2718
  id: item.id !== undefined ? item.id : undefined,
2719
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2720
+ equals: item.alpacaAccountId
2721
+ } : undefined,
2596
2722
  },
2597
2723
  update: {
2598
2724
  id: item.id !== undefined ? {
@@ -2635,6 +2761,12 @@ export const User = {
2635
2761
  : { connectOrCreate: item.trades.map((item) => ({
2636
2762
  where: {
2637
2763
  id: item.id !== undefined ? item.id : undefined,
2764
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2765
+ equals: item.alpacaAccountId
2766
+ } : undefined,
2767
+ assetId: item.assetId !== undefined ? {
2768
+ equals: item.assetId
2769
+ } : undefined,
2638
2770
  },
2639
2771
  create: {
2640
2772
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -2728,6 +2860,9 @@ export const User = {
2728
2860
  : { connectOrCreate: item.actions.map((item) => ({
2729
2861
  where: {
2730
2862
  id: item.id !== undefined ? item.id : undefined,
2863
+ tradeId: item.tradeId !== undefined ? {
2864
+ equals: item.tradeId
2865
+ } : undefined,
2731
2866
  },
2732
2867
  create: {
2733
2868
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -2750,6 +2885,15 @@ export const User = {
2750
2885
  : { connectOrCreate: item.orders.map((item) => ({
2751
2886
  where: {
2752
2887
  id: item.id !== undefined ? item.id : undefined,
2888
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
2889
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
2890
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
2891
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
2892
+ equals: item.alpacaAccountId
2893
+ } : undefined,
2894
+ assetId: item.assetId !== undefined ? {
2895
+ equals: item.assetId
2896
+ } : undefined,
2753
2897
  },
2754
2898
  create: {
2755
2899
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -2783,6 +2927,7 @@ export const User = {
2783
2927
  : { connectOrCreate: {
2784
2928
  where: {
2785
2929
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
2930
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
2786
2931
  },
2787
2932
  create: {
2788
2933
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -2799,6 +2944,7 @@ export const User = {
2799
2944
  : { connectOrCreate: {
2800
2945
  where: {
2801
2946
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
2947
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
2802
2948
  },
2803
2949
  create: {
2804
2950
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -2815,6 +2961,9 @@ export const User = {
2815
2961
  : { connectOrCreate: {
2816
2962
  where: {
2817
2963
  id: item.action.id !== undefined ? item.action.id : undefined,
2964
+ tradeId: item.action.tradeId !== undefined ? {
2965
+ equals: item.action.tradeId
2966
+ } : undefined,
2818
2967
  },
2819
2968
  create: {
2820
2969
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -2908,6 +3057,12 @@ export const User = {
2908
3057
  : { connectOrCreate: item.positions.map((item) => ({
2909
3058
  where: {
2910
3059
  id: item.id !== undefined ? item.id : undefined,
3060
+ assetId: item.assetId !== undefined ? {
3061
+ equals: item.assetId
3062
+ } : undefined,
3063
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3064
+ equals: item.alpacaAccountId
3065
+ } : undefined,
2911
3066
  },
2912
3067
  create: {
2913
3068
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -3006,6 +3161,9 @@ export const User = {
3006
3161
  : { connectOrCreate: item.alerts.map((item) => ({
3007
3162
  where: {
3008
3163
  id: item.id !== undefined ? item.id : undefined,
3164
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3165
+ equals: item.alpacaAccountId
3166
+ } : undefined,
3009
3167
  },
3010
3168
  create: {
3011
3169
  message: item.message !== undefined ? item.message : undefined,
@@ -3117,9 +3275,21 @@ export const User = {
3117
3275
  id: prop.customer.id !== undefined ? {
3118
3276
  equals: prop.customer.id
3119
3277
  } : undefined,
3278
+ authUserId: prop.customer.authUserId !== undefined ? {
3279
+ equals: prop.customer.authUserId
3280
+ } : undefined,
3120
3281
  name: prop.customer.name !== undefined ? {
3121
3282
  equals: prop.customer.name
3122
3283
  } : undefined,
3284
+ stripeCustomerId: prop.customer.stripeCustomerId !== undefined ? {
3285
+ equals: prop.customer.stripeCustomerId
3286
+ } : undefined,
3287
+ stripeSubscriptionId: prop.customer.stripeSubscriptionId !== undefined ? {
3288
+ equals: prop.customer.stripeSubscriptionId
3289
+ } : undefined,
3290
+ stripePriceId: prop.customer.stripePriceId !== undefined ? {
3291
+ equals: prop.customer.stripePriceId
3292
+ } : undefined,
3123
3293
  },
3124
3294
  update: {
3125
3295
  authUserId: prop.customer.authUserId !== undefined ? {
@@ -3159,6 +3329,12 @@ export const User = {
3159
3329
  upsert: prop.accounts.map((item) => ({
3160
3330
  where: {
3161
3331
  id: item.id !== undefined ? item.id : undefined,
3332
+ userId: item.userId !== undefined ? {
3333
+ equals: item.userId
3334
+ } : undefined,
3335
+ providerAccountId: item.providerAccountId !== undefined ? {
3336
+ equals: item.providerAccountId
3337
+ } : undefined,
3162
3338
  },
3163
3339
  update: {
3164
3340
  id: item.id !== undefined ? {
@@ -3213,6 +3389,9 @@ export const User = {
3213
3389
  upsert: prop.sessions.map((item) => ({
3214
3390
  where: {
3215
3391
  id: item.id !== undefined ? item.id : undefined,
3392
+ userId: item.userId !== undefined ? {
3393
+ equals: item.userId
3394
+ } : undefined,
3216
3395
  },
3217
3396
  update: {
3218
3397
  id: item.id !== undefined ? {
@@ -3235,6 +3414,9 @@ export const User = {
3235
3414
  upsert: prop.authenticators.map((item) => ({
3236
3415
  where: {
3237
3416
  id: item.id !== undefined ? item.id : undefined,
3417
+ userId: item.userId !== undefined ? {
3418
+ equals: item.userId
3419
+ } : undefined,
3238
3420
  },
3239
3421
  update: {
3240
3422
  id: item.id !== undefined ? {
@@ -3261,6 +3443,9 @@ export const User = {
3261
3443
  upsert: prop.alpacaAccounts.map((item) => ({
3262
3444
  where: {
3263
3445
  id: item.id !== undefined ? item.id : undefined,
3446
+ userId: item.userId !== undefined ? {
3447
+ equals: item.userId
3448
+ } : undefined,
3264
3449
  },
3265
3450
  update: {
3266
3451
  id: item.id !== undefined ? {
@@ -3297,6 +3482,12 @@ export const User = {
3297
3482
  upsert: item.trades.map((item) => ({
3298
3483
  where: {
3299
3484
  id: item.id !== undefined ? item.id : undefined,
3485
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3486
+ equals: item.alpacaAccountId
3487
+ } : undefined,
3488
+ assetId: item.assetId !== undefined ? {
3489
+ equals: item.assetId
3490
+ } : undefined,
3300
3491
  },
3301
3492
  update: {
3302
3493
  id: item.id !== undefined ? {
@@ -3581,6 +3772,9 @@ export const User = {
3581
3772
  upsert: item.actions.map((item) => ({
3582
3773
  where: {
3583
3774
  id: item.id !== undefined ? item.id : undefined,
3775
+ tradeId: item.tradeId !== undefined ? {
3776
+ equals: item.tradeId
3777
+ } : undefined,
3584
3778
  },
3585
3779
  update: {
3586
3780
  id: item.id !== undefined ? {
@@ -3704,6 +3898,9 @@ export const User = {
3704
3898
  : { connectOrCreate: item.actions.map((item) => ({
3705
3899
  where: {
3706
3900
  id: item.id !== undefined ? item.id : undefined,
3901
+ tradeId: item.tradeId !== undefined ? {
3902
+ equals: item.tradeId
3903
+ } : undefined,
3707
3904
  },
3708
3905
  create: {
3709
3906
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -3721,6 +3918,15 @@ export const User = {
3721
3918
  upsert: item.orders.map((item) => ({
3722
3919
  where: {
3723
3920
  id: item.id !== undefined ? item.id : undefined,
3921
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
3922
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
3923
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
3924
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
3925
+ equals: item.alpacaAccountId
3926
+ } : undefined,
3927
+ assetId: item.assetId !== undefined ? {
3928
+ equals: item.assetId
3929
+ } : undefined,
3724
3930
  },
3725
3931
  update: {
3726
3932
  id: item.id !== undefined ? {
@@ -3798,6 +4004,9 @@ export const User = {
3798
4004
  id: item.stopLoss.id !== undefined ? {
3799
4005
  equals: item.stopLoss.id
3800
4006
  } : undefined,
4007
+ orderId: item.stopLoss.orderId !== undefined ? {
4008
+ equals: item.stopLoss.orderId
4009
+ } : undefined,
3801
4010
  },
3802
4011
  update: {
3803
4012
  id: item.stopLoss.id !== undefined ? {
@@ -3822,6 +4031,9 @@ export const User = {
3822
4031
  id: item.takeProfit.id !== undefined ? {
3823
4032
  equals: item.takeProfit.id
3824
4033
  } : undefined,
4034
+ orderId: item.takeProfit.orderId !== undefined ? {
4035
+ equals: item.takeProfit.orderId
4036
+ } : undefined,
3825
4037
  },
3826
4038
  update: {
3827
4039
  id: item.takeProfit.id !== undefined ? {
@@ -3846,6 +4058,9 @@ export const User = {
3846
4058
  id: item.action.id !== undefined ? {
3847
4059
  equals: item.action.id
3848
4060
  } : undefined,
4061
+ tradeId: item.action.tradeId !== undefined ? {
4062
+ equals: item.action.tradeId
4063
+ } : undefined,
3849
4064
  },
3850
4065
  update: {
3851
4066
  id: item.action.id !== undefined ? {
@@ -4151,6 +4366,7 @@ export const User = {
4151
4366
  : { connectOrCreate: {
4152
4367
  where: {
4153
4368
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
4369
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
4154
4370
  },
4155
4371
  create: {
4156
4372
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -4167,6 +4383,7 @@ export const User = {
4167
4383
  : { connectOrCreate: {
4168
4384
  where: {
4169
4385
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
4386
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
4170
4387
  },
4171
4388
  create: {
4172
4389
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -4183,6 +4400,9 @@ export const User = {
4183
4400
  : { connectOrCreate: {
4184
4401
  where: {
4185
4402
  id: item.action.id !== undefined ? item.action.id : undefined,
4403
+ tradeId: item.action.tradeId !== undefined ? {
4404
+ equals: item.action.tradeId
4405
+ } : undefined,
4186
4406
  },
4187
4407
  create: {
4188
4408
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -4271,6 +4491,12 @@ export const User = {
4271
4491
  upsert: item.positions.map((item) => ({
4272
4492
  where: {
4273
4493
  id: item.id !== undefined ? item.id : undefined,
4494
+ assetId: item.assetId !== undefined ? {
4495
+ equals: item.assetId
4496
+ } : undefined,
4497
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4498
+ equals: item.alpacaAccountId
4499
+ } : undefined,
4274
4500
  },
4275
4501
  update: {
4276
4502
  id: item.id !== undefined ? {
@@ -4650,6 +4876,9 @@ export const User = {
4650
4876
  upsert: item.alerts.map((item) => ({
4651
4877
  where: {
4652
4878
  id: item.id !== undefined ? item.id : undefined,
4879
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4880
+ equals: item.alpacaAccountId
4881
+ } : undefined,
4653
4882
  },
4654
4883
  update: {
4655
4884
  id: item.id !== undefined ? {
@@ -4692,6 +4921,12 @@ export const User = {
4692
4921
  : { connectOrCreate: item.trades.map((item) => ({
4693
4922
  where: {
4694
4923
  id: item.id !== undefined ? item.id : undefined,
4924
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
4925
+ equals: item.alpacaAccountId
4926
+ } : undefined,
4927
+ assetId: item.assetId !== undefined ? {
4928
+ equals: item.assetId
4929
+ } : undefined,
4695
4930
  },
4696
4931
  create: {
4697
4932
  qty: item.qty !== undefined ? item.qty : undefined,
@@ -4785,6 +5020,9 @@ export const User = {
4785
5020
  : { connectOrCreate: item.actions.map((item) => ({
4786
5021
  where: {
4787
5022
  id: item.id !== undefined ? item.id : undefined,
5023
+ tradeId: item.tradeId !== undefined ? {
5024
+ equals: item.tradeId
5025
+ } : undefined,
4788
5026
  },
4789
5027
  create: {
4790
5028
  sequence: item.sequence !== undefined ? item.sequence : undefined,
@@ -4807,6 +5045,15 @@ export const User = {
4807
5045
  : { connectOrCreate: item.orders.map((item) => ({
4808
5046
  where: {
4809
5047
  id: item.id !== undefined ? item.id : undefined,
5048
+ clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
5049
+ actionId: item.actionId !== undefined ? item.actionId : undefined,
5050
+ stopLossId: item.stopLossId !== undefined ? item.stopLossId : undefined,
5051
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5052
+ equals: item.alpacaAccountId
5053
+ } : undefined,
5054
+ assetId: item.assetId !== undefined ? {
5055
+ equals: item.assetId
5056
+ } : undefined,
4810
5057
  },
4811
5058
  create: {
4812
5059
  clientOrderId: item.clientOrderId !== undefined ? item.clientOrderId : undefined,
@@ -4840,6 +5087,7 @@ export const User = {
4840
5087
  : { connectOrCreate: {
4841
5088
  where: {
4842
5089
  id: item.stopLoss.id !== undefined ? item.stopLoss.id : undefined,
5090
+ orderId: item.stopLoss.orderId !== undefined ? item.stopLoss.orderId : undefined,
4843
5091
  },
4844
5092
  create: {
4845
5093
  stopPrice: item.stopLoss.stopPrice !== undefined ? item.stopLoss.stopPrice : undefined,
@@ -4856,6 +5104,7 @@ export const User = {
4856
5104
  : { connectOrCreate: {
4857
5105
  where: {
4858
5106
  id: item.takeProfit.id !== undefined ? item.takeProfit.id : undefined,
5107
+ orderId: item.takeProfit.orderId !== undefined ? item.takeProfit.orderId : undefined,
4859
5108
  },
4860
5109
  create: {
4861
5110
  limitPrice: item.takeProfit.limitPrice !== undefined ? item.takeProfit.limitPrice : undefined,
@@ -4872,6 +5121,9 @@ export const User = {
4872
5121
  : { connectOrCreate: {
4873
5122
  where: {
4874
5123
  id: item.action.id !== undefined ? item.action.id : undefined,
5124
+ tradeId: item.action.tradeId !== undefined ? {
5125
+ equals: item.action.tradeId
5126
+ } : undefined,
4875
5127
  },
4876
5128
  create: {
4877
5129
  sequence: item.action.sequence !== undefined ? item.action.sequence : undefined,
@@ -4965,6 +5217,12 @@ export const User = {
4965
5217
  : { connectOrCreate: item.positions.map((item) => ({
4966
5218
  where: {
4967
5219
  id: item.id !== undefined ? item.id : undefined,
5220
+ assetId: item.assetId !== undefined ? {
5221
+ equals: item.assetId
5222
+ } : undefined,
5223
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5224
+ equals: item.alpacaAccountId
5225
+ } : undefined,
4968
5226
  },
4969
5227
  create: {
4970
5228
  averageEntryPrice: item.averageEntryPrice !== undefined ? item.averageEntryPrice : undefined,
@@ -5063,6 +5321,9 @@ export const User = {
5063
5321
  : { connectOrCreate: item.alerts.map((item) => ({
5064
5322
  where: {
5065
5323
  id: item.id !== undefined ? item.id : undefined,
5324
+ alpacaAccountId: item.alpacaAccountId !== undefined ? {
5325
+ equals: item.alpacaAccountId
5326
+ } : undefined,
5066
5327
  },
5067
5328
  create: {
5068
5329
  message: item.message !== undefined ? item.message : undefined,