Преглед на файлове

feat: update project dependencies and live price controller

- Fixed API endpoints and tested all GET APIs
- Resolved issues in live price controller for better data handling
- Updated package dependencies for improved stability
uzairrizwan1 преди 3 месеца
родител
ревизия
82c01cac5c
променени са 3 файла, в които са добавени 226 реда и са изтрити 4 реда
  1. 221 0
      package-lock.json
  2. 1 0
      package.json
  3. 4 4
      src/controllers/livePriceController.js

+ 221 - 0
package-lock.json

@@ -23,6 +23,7 @@
23 23
         "@jest/globals": "^30.2.0",
24 24
         "axios-mock-adapter": "^2.1.0",
25 25
         "jest": "^30.2.0",
26
+        "nodemon": "^3.0.0",
26 27
         "sequelize-cli": "^6.6.3",
27 28
         "supertest": "^7.1.4"
28 29
       }
@@ -1914,6 +1915,19 @@
1914 1915
       "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
1915 1916
       "license": "MIT"
1916 1917
     },
1918
+    "node_modules/binary-extensions": {
1919
+      "version": "2.3.0",
1920
+      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
1921
+      "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
1922
+      "dev": true,
1923
+      "license": "MIT",
1924
+      "engines": {
1925
+        "node": ">=8"
1926
+      },
1927
+      "funding": {
1928
+        "url": "https://github.com/sponsors/sindresorhus"
1929
+      }
1930
+    },
1917 1931
     "node_modules/bluebird": {
1918 1932
       "version": "3.7.2",
1919 1933
       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -2121,6 +2135,31 @@
2121 2135
         "node": ">=10"
2122 2136
       }
2123 2137
     },
2138
+    "node_modules/chokidar": {
2139
+      "version": "3.6.0",
2140
+      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
2141
+      "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
2142
+      "dev": true,
2143
+      "license": "MIT",
2144
+      "dependencies": {
2145
+        "anymatch": "~3.1.2",
2146
+        "braces": "~3.0.2",
2147
+        "glob-parent": "~5.1.2",
2148
+        "is-binary-path": "~2.1.0",
2149
+        "is-glob": "~4.0.1",
2150
+        "normalize-path": "~3.0.0",
2151
+        "readdirp": "~3.6.0"
2152
+      },
2153
+      "engines": {
2154
+        "node": ">= 8.10.0"
2155
+      },
2156
+      "funding": {
2157
+        "url": "https://paulmillr.com/funding/"
2158
+      },
2159
+      "optionalDependencies": {
2160
+        "fsevents": "~2.3.2"
2161
+      }
2162
+    },
2124 2163
     "node_modules/ci-info": {
2125 2164
       "version": "4.3.1",
2126 2165
       "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz",
@@ -3178,6 +3217,19 @@
3178 3217
         "url": "https://github.com/sponsors/isaacs"
3179 3218
       }
3180 3219
     },
3220
+    "node_modules/glob-parent": {
3221
+      "version": "5.1.2",
3222
+      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
3223
+      "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
3224
+      "dev": true,
3225
+      "license": "ISC",
3226
+      "dependencies": {
3227
+        "is-glob": "^4.0.1"
3228
+      },
3229
+      "engines": {
3230
+        "node": ">= 6"
3231
+      }
3232
+    },
3181 3233
     "node_modules/gopd": {
3182 3234
       "version": "1.2.0",
3183 3235
       "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
@@ -3310,6 +3362,13 @@
3310 3362
         "node": ">=0.10.0"
3311 3363
       }
3312 3364
     },
3365
+    "node_modules/ignore-by-default": {
3366
+      "version": "1.0.1",
3367
+      "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz",
3368
+      "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==",
3369
+      "dev": true,
3370
+      "license": "ISC"
3371
+    },
3313 3372
     "node_modules/import-local": {
3314 3373
       "version": "3.2.0",
3315 3374
       "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz",
@@ -3390,6 +3449,19 @@
3390 3449
       "dev": true,
3391 3450
       "license": "MIT"
3392 3451
     },
3452
+    "node_modules/is-binary-path": {
3453
+      "version": "2.1.0",
3454
+      "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
3455
+      "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
3456
+      "dev": true,
3457
+      "license": "MIT",
3458
+      "dependencies": {
3459
+        "binary-extensions": "^2.0.0"
3460
+      },
3461
+      "engines": {
3462
+        "node": ">=8"
3463
+      }
3464
+    },
3393 3465
     "node_modules/is-buffer": {
3394 3466
       "version": "2.0.5",
3395 3467
       "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz",
@@ -3430,6 +3502,16 @@
3430 3502
         "url": "https://github.com/sponsors/ljharb"
3431 3503
       }
3432 3504
     },
3505
+    "node_modules/is-extglob": {
3506
+      "version": "2.1.1",
3507
+      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
3508
+      "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
3509
+      "dev": true,
3510
+      "license": "MIT",
3511
+      "engines": {
3512
+        "node": ">=0.10.0"
3513
+      }
3514
+    },
3433 3515
     "node_modules/is-fullwidth-code-point": {
3434 3516
       "version": "3.0.0",
3435 3517
       "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
@@ -3450,6 +3532,19 @@
3450 3532
         "node": ">=6"
3451 3533
       }
3452 3534
     },
3535
+    "node_modules/is-glob": {
3536
+      "version": "4.0.3",
3537
+      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
3538
+      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
3539
+      "dev": true,
3540
+      "license": "MIT",
3541
+      "dependencies": {
3542
+        "is-extglob": "^2.1.1"
3543
+      },
3544
+      "engines": {
3545
+        "node": ">=0.10.0"
3546
+      }
3547
+    },
3453 3548
     "node_modules/is-number": {
3454 3549
       "version": "7.0.0",
3455 3550
       "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
@@ -4624,6 +4719,82 @@
4624 4719
       "dev": true,
4625 4720
       "license": "MIT"
4626 4721
     },
4722
+    "node_modules/nodemon": {
4723
+      "version": "3.1.10",
4724
+      "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz",
4725
+      "integrity": "sha512-WDjw3pJ0/0jMFmyNDp3gvY2YizjLmmOUQo6DEBY+JgdvW/yQ9mEeSw6H5ythl5Ny2ytb7f9C2nIbjSxMNzbJXw==",
4726
+      "dev": true,
4727
+      "license": "MIT",
4728
+      "dependencies": {
4729
+        "chokidar": "^3.5.2",
4730
+        "debug": "^4",
4731
+        "ignore-by-default": "^1.0.1",
4732
+        "minimatch": "^3.1.2",
4733
+        "pstree.remy": "^1.1.8",
4734
+        "semver": "^7.5.3",
4735
+        "simple-update-notifier": "^2.0.0",
4736
+        "supports-color": "^5.5.0",
4737
+        "touch": "^3.1.0",
4738
+        "undefsafe": "^2.0.5"
4739
+      },
4740
+      "bin": {
4741
+        "nodemon": "bin/nodemon.js"
4742
+      },
4743
+      "engines": {
4744
+        "node": ">=10"
4745
+      },
4746
+      "funding": {
4747
+        "type": "opencollective",
4748
+        "url": "https://opencollective.com/nodemon"
4749
+      }
4750
+    },
4751
+    "node_modules/nodemon/node_modules/brace-expansion": {
4752
+      "version": "1.1.12",
4753
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
4754
+      "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
4755
+      "dev": true,
4756
+      "license": "MIT",
4757
+      "dependencies": {
4758
+        "balanced-match": "^1.0.0",
4759
+        "concat-map": "0.0.1"
4760
+      }
4761
+    },
4762
+    "node_modules/nodemon/node_modules/has-flag": {
4763
+      "version": "3.0.0",
4764
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
4765
+      "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
4766
+      "dev": true,
4767
+      "license": "MIT",
4768
+      "engines": {
4769
+        "node": ">=4"
4770
+      }
4771
+    },
4772
+    "node_modules/nodemon/node_modules/minimatch": {
4773
+      "version": "3.1.2",
4774
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
4775
+      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
4776
+      "dev": true,
4777
+      "license": "ISC",
4778
+      "dependencies": {
4779
+        "brace-expansion": "^1.1.7"
4780
+      },
4781
+      "engines": {
4782
+        "node": "*"
4783
+      }
4784
+    },
4785
+    "node_modules/nodemon/node_modules/supports-color": {
4786
+      "version": "5.5.0",
4787
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
4788
+      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
4789
+      "dev": true,
4790
+      "license": "MIT",
4791
+      "dependencies": {
4792
+        "has-flag": "^3.0.0"
4793
+      },
4794
+      "engines": {
4795
+        "node": ">=4"
4796
+      }
4797
+    },
4627 4798
     "node_modules/nopt": {
4628 4799
       "version": "7.2.1",
4629 4800
       "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz",
@@ -5127,6 +5298,13 @@
5127 5298
       "license": "MIT",
5128 5299
       "peer": true
5129 5300
     },
5301
+    "node_modules/pstree.remy": {
5302
+      "version": "1.1.8",
5303
+      "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
5304
+      "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==",
5305
+      "dev": true,
5306
+      "license": "MIT"
5307
+    },
5130 5308
     "node_modules/pure-rand": {
5131 5309
       "version": "7.0.1",
5132 5310
       "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz",
@@ -5220,6 +5398,19 @@
5220 5398
         "node": ">= 6"
5221 5399
       }
5222 5400
     },
5401
+    "node_modules/readdirp": {
5402
+      "version": "3.6.0",
5403
+      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
5404
+      "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
5405
+      "dev": true,
5406
+      "license": "MIT",
5407
+      "dependencies": {
5408
+        "picomatch": "^2.2.1"
5409
+      },
5410
+      "engines": {
5411
+        "node": ">=8.10.0"
5412
+      }
5413
+    },
5223 5414
     "node_modules/require-directory": {
5224 5415
       "version": "2.1.1",
5225 5416
       "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
@@ -5692,6 +5883,19 @@
5692 5883
         "url": "https://github.com/sponsors/isaacs"
5693 5884
       }
5694 5885
     },
5886
+    "node_modules/simple-update-notifier": {
5887
+      "version": "2.0.0",
5888
+      "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz",
5889
+      "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==",
5890
+      "dev": true,
5891
+      "license": "MIT",
5892
+      "dependencies": {
5893
+        "semver": "^7.5.3"
5894
+      },
5895
+      "engines": {
5896
+        "node": ">=10"
5897
+      }
5898
+    },
5695 5899
     "node_modules/slash": {
5696 5900
       "version": "3.0.0",
5697 5901
       "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@@ -6132,6 +6336,16 @@
6132 6336
       "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==",
6133 6337
       "license": "MIT"
6134 6338
     },
6339
+    "node_modules/touch": {
6340
+      "version": "3.1.1",
6341
+      "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz",
6342
+      "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==",
6343
+      "dev": true,
6344
+      "license": "ISC",
6345
+      "bin": {
6346
+        "nodetouch": "bin/nodetouch.js"
6347
+      }
6348
+    },
6135 6349
     "node_modules/triple-beam": {
6136 6350
       "version": "1.4.1",
6137 6351
       "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
@@ -6199,6 +6413,13 @@
6199 6413
         "node": ">=6.0.0"
6200 6414
       }
6201 6415
     },
6416
+    "node_modules/undefsafe": {
6417
+      "version": "2.0.5",
6418
+      "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz",
6419
+      "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==",
6420
+      "dev": true,
6421
+      "license": "MIT"
6422
+    },
6202 6423
     "node_modules/undici-types": {
6203 6424
       "version": "7.14.0",
6204 6425
       "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.14.0.tgz",

+ 1 - 0
package.json

@@ -36,6 +36,7 @@
36 36
     "@jest/globals": "^30.2.0",
37 37
     "axios-mock-adapter": "^2.1.0",
38 38
     "jest": "^30.2.0",
39
+    "nodemon": "^3.0.0",
39 40
     "sequelize-cli": "^6.6.3",
40 41
     "supertest": "^7.1.4"
41 42
   }

+ 4 - 4
src/controllers/livePriceController.js

@@ -12,7 +12,7 @@ class LivePriceController {
12 12
         order: [['lastUpdated', 'DESC']],
13 13
         include: [{
14 14
           model: Symbol,
15
-          as: 'symbol',
15
+          as: 'livePriceSymbol',
16 16
           attributes: ['symbol', 'exchange', 'instrumentType', 'isActive']
17 17
         }]
18 18
       });
@@ -41,7 +41,7 @@ class LivePriceController {
41 41
         where: { symbolId: parseInt(symbolId) },
42 42
         include: [{
43 43
           model: Symbol,
44
-          as: 'symbol',
44
+          as: 'livePriceSymbol',
45 45
           attributes: ['symbol', 'exchange', 'instrumentType', 'isActive']
46 46
         }]
47 47
       });
@@ -169,7 +169,7 @@ class LivePriceController {
169 169
         order: [['lastUpdated', 'DESC']],
170 170
         include: [{
171 171
           model: Symbol,
172
-          as: 'symbol',
172
+          as: 'livePriceSymbol',
173 173
           where: { exchange, isActive: true },
174 174
           attributes: ['symbol', 'exchange', 'instrumentType']
175 175
         }]
@@ -202,7 +202,7 @@ class LivePriceController {
202 202
         order: [['lastUpdated', 'DESC']],
203 203
         include: [{
204 204
           model: Symbol,
205
-          as: 'symbol',
205
+          as: 'livePriceSymbol',
206 206
           where: { instrumentType: type, isActive: true },
207 207
           attributes: ['symbol', 'exchange', 'instrumentType']
208 208
         }]