From a8b50f976ed1c91bd7258d5c31c0061fb73a9c54 Mon Sep 17 00:00:00 2001 From: AdonaiJehosua Date: Tue, 24 Sep 2024 21:25:40 +0500 Subject: [PATCH 1/5] =?UTF-8?q?=D0=A3=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=B8=D1=82=20=D0=B8=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B8=D1=82=20nodemon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodemon.json | 7 + package-lock.json | 352 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 3 files changed, 361 insertions(+), 1 deletion(-) create mode 100644 nodemon.json diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..bddbd78 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,7 @@ +{ + "watch": [ + "src" + ], + "ext": "ts, json", + "exec": "npm run ts ./src/main.rest.ts | pino-pretty --colorize --translateTime SYS:standard" +} diff --git a/package-lock.json b/package-lock.json index f209439..971b26d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "eslint": "8.49.0", "eslint-config-htmlacademy": "9.1.1", "json-server": "0.17.3", + "nodemon": "3.0.1", "pino-pretty": "10.2.0", "rimraf": "5.0.1", "ts-node": "10.9.1", @@ -1172,6 +1173,20 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -1397,6 +1412,19 @@ "node": ">= 0.8" } }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -1598,6 +1626,44 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -3989,6 +4055,13 @@ "node": ">= 4" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true, + "license": "ISC" + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -4118,6 +4191,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -5143,6 +5229,68 @@ "node": ">= 0.6" } }, + "node_modules/nodemon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", + "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -5164,6 +5312,16 @@ "semver": "bin/semver" } }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/normalize-url": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", @@ -5769,6 +5927,13 @@ "node": ">= 0.10" } }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true, + "license": "MIT" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -5992,6 +6157,19 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/real-require": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", @@ -6449,6 +6627,19 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -6921,6 +7112,16 @@ "node": ">=0.6" } }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "license": "ISC", + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, "node_modules/tr46": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", @@ -7169,6 +7370,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true, + "license": "MIT" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -8217,6 +8425,16 @@ "color-convert": "^2.0.1" } }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -8366,6 +8584,12 @@ "safe-buffer": "5.1.2" } }, + "binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true + }, "body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -8505,6 +8729,33 @@ "supports-color": "^7.1.0" } }, + "chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, "ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -10177,6 +10428,12 @@ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -10271,6 +10528,15 @@ "has-bigints": "^1.0.1" } }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-boolean-object": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", @@ -10966,6 +11232,50 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, + "nodemon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.1.tgz", + "integrity": "sha512-g9AZ7HmkhQkqXkRc20w+ZfQ73cHLbE8hnPbtaFbFtCumZsjyMhKk9LajQ07U5Ux28lvFjZ5X7HvWR1xzU8jHVw==", + "dev": true, + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -10986,6 +11296,12 @@ } } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "normalize-url": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", @@ -11408,6 +11724,12 @@ "ipaddr.js": "1.9.1" } }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -11560,6 +11882,15 @@ "string_decoder": "^1.3.0" } }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, "real-require": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", @@ -11879,6 +12210,15 @@ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true }, + "simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -12197,6 +12537,12 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true }, + "touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true + }, "tr46": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", @@ -12356,6 +12702,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/package.json b/package.json index 75372da..559db0d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "main": "main.js", "scripts": { "start": "npm run build && node ./dist/main.rest.js", - "start:dev": "npm run ts ./src/main.rest.ts | pino-pretty --colorize --translateTime SYS:standard", + "start:dev": "nodemon", "build": "npm run clean && npm run compile", "lint": "eslint src/ --ext .ts", "compile": "tsc -p tsconfig.json", @@ -28,6 +28,7 @@ "eslint": "8.49.0", "eslint-config-htmlacademy": "9.1.1", "json-server": "0.17.3", + "nodemon": "3.0.1", "pino-pretty": "10.2.0", "rimraf": "5.0.1", "ts-node": "10.9.1", From 870783a9fdabeba8aff8578f28fb9c1dc0d42f3f Mon Sep 17 00:00:00 2001 From: AdonaiJehosua Date: Wed, 25 Sep 2024 00:26:00 +0500 Subject: [PATCH 2/5] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rest.ts | 2 ++ .../comment/comment-service.interface.ts | 7 +++++ .../modules/comment/comment.container.ts | 14 ++++++++++ src/shared/modules/comment/comment.entity.ts | 28 +++++++++++++++++++ .../comment/default-comment.service.ts | 23 +++++++++++++++ .../modules/comment/dto/create-comment.dto.ts | 5 ++++ src/shared/modules/comment/index.ts | 5 ++++ src/shared/types/component.enum.ts | 2 ++ 8 files changed, 86 insertions(+) create mode 100644 src/shared/modules/comment/comment-service.interface.ts create mode 100644 src/shared/modules/comment/comment.container.ts create mode 100644 src/shared/modules/comment/comment.entity.ts create mode 100644 src/shared/modules/comment/default-comment.service.ts create mode 100644 src/shared/modules/comment/dto/create-comment.dto.ts create mode 100644 src/shared/modules/comment/index.ts diff --git a/src/main.rest.ts b/src/main.rest.ts index cc139d0..98cb124 100644 --- a/src/main.rest.ts +++ b/src/main.rest.ts @@ -5,12 +5,14 @@ import {Component} from './shared/types/index.js'; import {createRestApplicationContainer} from './rest/rest.container.js'; import {createUserContainer} from './shared/modules/user/index.js'; import {createOfferContainer} from './shared/modules/offer/index.js'; +import {createCommentContainer} from './shared/modules/comment/index.js'; async function bootstrap() { const appContainer = Container.merge( createRestApplicationContainer(), createOfferContainer(), createUserContainer(), + createCommentContainer(), ); const application = appContainer.get(Component.RestApplication); diff --git a/src/shared/modules/comment/comment-service.interface.ts b/src/shared/modules/comment/comment-service.interface.ts new file mode 100644 index 0000000..191c142 --- /dev/null +++ b/src/shared/modules/comment/comment-service.interface.ts @@ -0,0 +1,7 @@ +import {CreateCommentDto} from './dto/create-comment.dto.js'; +import {DocumentType} from '@typegoose/typegoose'; +import {CommentEntity} from './comment.entity.js'; + +export interface CommentService { + create(dto: CreateCommentDto): Promise | null>; +} diff --git a/src/shared/modules/comment/comment.container.ts b/src/shared/modules/comment/comment.container.ts new file mode 100644 index 0000000..de988fd --- /dev/null +++ b/src/shared/modules/comment/comment.container.ts @@ -0,0 +1,14 @@ +import {Container} from 'inversify'; +import {types} from '@typegoose/typegoose'; +import {Component} from '../../types/index.js'; +import {CommentService} from './comment-service.interface.js'; +import {DefaultCommentService} from './default-comment.service.js'; +import {CommentEntity, CommentModel} from './comment.entity.js'; + +export function createCommentContainer() { + const offerContainer = new Container(); + offerContainer.bind(Component.OfferService).to(DefaultCommentService).inSingletonScope(); + offerContainer.bind>(Component.OfferModel).toConstantValue(CommentModel); + + return offerContainer; +} diff --git a/src/shared/modules/comment/comment.entity.ts b/src/shared/modules/comment/comment.entity.ts new file mode 100644 index 0000000..4c1bbcb --- /dev/null +++ b/src/shared/modules/comment/comment.entity.ts @@ -0,0 +1,28 @@ +import {defaultClasses, getModelForClass, modelOptions, prop, Ref} from '@typegoose/typegoose'; +import {UserEntity} from '../user/index.js'; + +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +export interface CommentEntity extends defaultClasses.Base { +} + +@modelOptions({ + schemaOptions: { + collection: 'comments', + timestamps: true, + } +}) + +// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging +export class CommentEntity extends defaultClasses.TimeStamps { + + @prop({required: true, type: String}) + public text: string; + + @prop({required: true, type: Number}) + public rating: string; + + @prop({required: true, ref: () => UserEntity, type: String}) + public authorId: Ref; +} + +export const CommentModel = getModelForClass(CommentEntity); diff --git a/src/shared/modules/comment/default-comment.service.ts b/src/shared/modules/comment/default-comment.service.ts new file mode 100644 index 0000000..74ade6b --- /dev/null +++ b/src/shared/modules/comment/default-comment.service.ts @@ -0,0 +1,23 @@ +import {inject, injectable} from 'inversify'; +import {CommentService} from './comment-service.interface.js'; +import {Component} from '../../types/index.js'; +import {Logger} from '../../libs/logger/index.js'; +import {CommentEntity} from './comment.entity.js'; +import {DocumentType, types} from '@typegoose/typegoose'; +import {CreateCommentDto} from './dto/create-comment.dto.js'; + +@injectable() +export class DefaultCommentService implements CommentService { + constructor( + @inject(Component.Logger) private readonly logger: Logger, + @inject(Component.CommentModel) private readonly commentModel: types.ModelType + ) { + } + + public async create(dto: CreateCommentDto): Promise> { + const result = await this.commentModel.create(dto); + this.logger.info(`New comment created: ${dto.text}`); + + return result; + } +} diff --git a/src/shared/modules/comment/dto/create-comment.dto.ts b/src/shared/modules/comment/dto/create-comment.dto.ts new file mode 100644 index 0000000..25f1680 --- /dev/null +++ b/src/shared/modules/comment/dto/create-comment.dto.ts @@ -0,0 +1,5 @@ +export class CreateCommentDto { + public text: string; + public rating: number; + public authorId: string; +} diff --git a/src/shared/modules/comment/index.ts b/src/shared/modules/comment/index.ts new file mode 100644 index 0000000..99fd40e --- /dev/null +++ b/src/shared/modules/comment/index.ts @@ -0,0 +1,5 @@ +export * from './dto/create-comment.dto.js'; +export * from './comment.entity.js'; +export * from './comment.container.js'; +export * from './default-comment.service.js'; +export * from './comment-service.interface.js'; diff --git a/src/shared/types/component.enum.ts b/src/shared/types/component.enum.ts index fa27dfd..09d6c3b 100644 --- a/src/shared/types/component.enum.ts +++ b/src/shared/types/component.enum.ts @@ -7,4 +7,6 @@ export const Component = { UserModel: Symbol.for('UserModel'), OfferService: Symbol.for('OfferService'), OfferModel: Symbol.for('OfferModel'), + CommentService: Symbol.for('CommentService'), + CommentModel: Symbol.for('CommentModel'), } as const; From d4d30484c88bf3bb3d69d2fe33794145c7bf5b8a Mon Sep 17 00:00:00 2001 From: AdonaiJehosua Date: Wed, 25 Sep 2024 20:12:06 +0500 Subject: [PATCH 3/5] =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B8?= =?UTF-8?q?=D1=82=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/modules/comment/comment-service.interface.ts | 1 + src/shared/modules/comment/comment.entity.ts | 4 ++++ src/shared/modules/comment/default-comment.service.ts | 6 ++++++ src/shared/modules/comment/dto/create-comment.dto.ts | 1 + 4 files changed, 12 insertions(+) diff --git a/src/shared/modules/comment/comment-service.interface.ts b/src/shared/modules/comment/comment-service.interface.ts index 191c142..119beef 100644 --- a/src/shared/modules/comment/comment-service.interface.ts +++ b/src/shared/modules/comment/comment-service.interface.ts @@ -4,4 +4,5 @@ import {CommentEntity} from './comment.entity.js'; export interface CommentService { create(dto: CreateCommentDto): Promise | null>; + findByOfferId(offerId: string): Promise[]>; } diff --git a/src/shared/modules/comment/comment.entity.ts b/src/shared/modules/comment/comment.entity.ts index 4c1bbcb..3317c47 100644 --- a/src/shared/modules/comment/comment.entity.ts +++ b/src/shared/modules/comment/comment.entity.ts @@ -1,5 +1,6 @@ import {defaultClasses, getModelForClass, modelOptions, prop, Ref} from '@typegoose/typegoose'; import {UserEntity} from '../user/index.js'; +import {OfferEntity} from '../offer/index.js'; // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging export interface CommentEntity extends defaultClasses.Base { @@ -23,6 +24,9 @@ export class CommentEntity extends defaultClasses.TimeStamps { @prop({required: true, ref: () => UserEntity, type: String}) public authorId: Ref; + + @prop({required: true, ref: () => OfferEntity, type: String}) + public offerId: Ref; } export const CommentModel = getModelForClass(CommentEntity); diff --git a/src/shared/modules/comment/default-comment.service.ts b/src/shared/modules/comment/default-comment.service.ts index 74ade6b..1752dd2 100644 --- a/src/shared/modules/comment/default-comment.service.ts +++ b/src/shared/modules/comment/default-comment.service.ts @@ -20,4 +20,10 @@ export class DefaultCommentService implements CommentService { return result; } + + public async findByOfferId(offerId: string): Promise[]> { + return this.commentModel + .find({offerId}) + .populate('authorId'); + } } diff --git a/src/shared/modules/comment/dto/create-comment.dto.ts b/src/shared/modules/comment/dto/create-comment.dto.ts index 25f1680..7edbb4c 100644 --- a/src/shared/modules/comment/dto/create-comment.dto.ts +++ b/src/shared/modules/comment/dto/create-comment.dto.ts @@ -2,4 +2,5 @@ export class CreateCommentDto { public text: string; public rating: number; public authorId: string; + public offerId: string; } From 16589465182aec02db92b83f1f2fd540b26534ad Mon Sep 17 00:00:00 2001 From: AdonaiJehosua Date: Wed, 25 Sep 2024 23:20:16 +0500 Subject: [PATCH 4/5] =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B8?= =?UTF-8?q?=D1=82=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20=D0=BE=D1=84?= =?UTF-8?q?=D1=84=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/offer/default-offer.service.ts | 44 ++++++++++++++++++- .../modules/offer/offer-service.interface.ts | 7 ++- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/shared/modules/offer/default-offer.service.ts b/src/shared/modules/offer/default-offer.service.ts index f449e03..f91207e 100644 --- a/src/shared/modules/offer/default-offer.service.ts +++ b/src/shared/modules/offer/default-offer.service.ts @@ -15,13 +15,53 @@ export class DefaultOfferService implements OfferService { } public async create(dto: CreateOfferDto): Promise> { - const result = await this.offerModel.create(dto); + const result = await this.offerModel + .create(dto); this.logger.info(`New offer created: ${dto.title}`); return result; } + public async findAll(): Promise[]> { + return this.offerModel.find(); + } + public async findById(offerId: string): Promise | null> { - return this.offerModel.findById(offerId).exec(); + return this.offerModel + .findById(offerId) + .populate('hostId') + .exec(); + } + + public async updateById(offerId: string, dto: CreateOfferDto): Promise | null> { + const result = await this.offerModel + .findByIdAndUpdate(offerId, dto, {new: true}) + .populate('hostId') + .exec(); + this.logger.info(`Offer updated: ${offerId}`); + + return result; + } + + public async deleteById(offerId: string): Promise | null> { + return this.offerModel.findByIdAndDelete(offerId); + } + + public async findPremium(): Promise[]> { + return this.offerModel.find({isPremium: true}); + } + + public async findFavorites(): Promise[]> { + return this.offerModel.find({isFavorite: true}); + } + + public async changeFavoritesStatus(offerId: string, favoriteStatus: boolean): Promise | null> { + const result = await this.offerModel + .findByIdAndUpdate(offerId, {isFavorite: favoriteStatus}) + .populate('hostId') + .exec(); + this.logger.info(`Favorite status changed: ${favoriteStatus}`); + + return result; } } diff --git a/src/shared/modules/offer/offer-service.interface.ts b/src/shared/modules/offer/offer-service.interface.ts index 24ee1f4..f699a6c 100644 --- a/src/shared/modules/offer/offer-service.interface.ts +++ b/src/shared/modules/offer/offer-service.interface.ts @@ -4,6 +4,11 @@ import {CreateOfferDto} from './dto/create-offer.dto.js'; export interface OfferService { create(dto: CreateOfferDto): Promise>; - + findAll(): Promise[]>; findById(offerId: string): Promise | null>; + updateById(offerId: string, dto: CreateOfferDto): Promise | null>; + deleteById(offerId: string): Promise | null>; + findPremium(): Promise[]>; + findFavorites(): Promise[]>; + changeFavoritesStatus(offerId: string, favoriteStatus: boolean): Promise | null>; } From 3a37eb608eedea7d7510d0af64a2fcc5ffbc5003 Mon Sep 17 00:00:00 2001 From: AdonaiJehosua Date: Sun, 29 Sep 2024 10:43:51 +0500 Subject: [PATCH 5/5] =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B8?= =?UTF-8?q?=D1=82=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/import.command.ts | 3 +- src/rest/rest.application.ts | 10 ++++++ .../modules/comment/comment.container.ts | 2 +- .../comment/default-comment.service.ts | 22 +++++++++++- .../modules/offer/default-offer.service.ts | 34 ++++++++++++++----- .../modules/offer/dto/create-offer.dto.ts | 1 + .../modules/offer/dto/update-offer.dto.ts | 18 ++++++++++ .../modules/offer/offer-service.interface.ts | 4 ++- src/shared/types/offer.type.ts | 1 + 9 files changed, 83 insertions(+), 12 deletions(-) create mode 100644 src/shared/modules/offer/dto/update-offer.dto.ts diff --git a/src/cli/commands/import.command.ts b/src/cli/commands/import.command.ts index 6c845d3..176033c 100644 --- a/src/cli/commands/import.command.ts +++ b/src/cli/commands/import.command.ts @@ -58,7 +58,8 @@ export class ImportCommand implements Command { goods: offer.goods, hostId: user.id, bedrooms: offer.bedrooms, - maxAdults: offer.maxAdults + maxAdults: offer.maxAdults, + commentCount: offer.commentCount }); } diff --git a/src/rest/rest.application.ts b/src/rest/rest.application.ts index d0d16e7..ac074d9 100644 --- a/src/rest/rest.application.ts +++ b/src/rest/rest.application.ts @@ -5,6 +5,7 @@ import {Config, RestSchema} from '../shared/libs/config/index.js'; import {Component} from '../shared/types/index.js'; import {DatabaseClient} from '../shared/libs/database-client/index.js'; import {getMongoURI} from '../shared/helpers/index.js'; +import {CommentService} from '../shared/modules/comment/index.js'; @injectable() export class RestApplication { @@ -12,6 +13,7 @@ export class RestApplication { @inject(Component.Logger) private readonly logger: Logger, @inject(Component.Config) private readonly config: Config, @inject(Component.DatabaseClient) private readonly databaseClient: DatabaseClient, + @inject(Component.CommentService) private readonly commentService: CommentService, ) { } @@ -34,5 +36,13 @@ export class RestApplication { this.logger.info('Init database...'); await this._initDb(); this.logger.info('Init database completed'); + + const rrr = await this.commentService.create({ + text: 'fdfdfd', + rating: 3, + offerId: '66e554ee0c19a0f76db1b955', + authorId: '66e554ee0c19a0f76db1b953' + }); + console.log(rrr); } } diff --git a/src/shared/modules/comment/comment.container.ts b/src/shared/modules/comment/comment.container.ts index de988fd..f400381 100644 --- a/src/shared/modules/comment/comment.container.ts +++ b/src/shared/modules/comment/comment.container.ts @@ -8,7 +8,7 @@ import {CommentEntity, CommentModel} from './comment.entity.js'; export function createCommentContainer() { const offerContainer = new Container(); offerContainer.bind(Component.OfferService).to(DefaultCommentService).inSingletonScope(); - offerContainer.bind>(Component.OfferModel).toConstantValue(CommentModel); + offerContainer.bind>(Component.CommentService).toConstantValue(CommentModel); return offerContainer; } diff --git a/src/shared/modules/comment/default-comment.service.ts b/src/shared/modules/comment/default-comment.service.ts index 1752dd2..3631098 100644 --- a/src/shared/modules/comment/default-comment.service.ts +++ b/src/shared/modules/comment/default-comment.service.ts @@ -16,6 +16,26 @@ export class DefaultCommentService implements CommentService { public async create(dto: CreateCommentDto): Promise> { const result = await this.commentModel.create(dto); + + await this.commentModel + .aggregate([ + { + $group: { + _id: null, + averageRating: {$avg: '$rating'}, + }, + $lookup: { + from: 'offers', + pipeline: [ + {$match: {_id: '$offerId'}}, + {$project: {rating: '$averageRating'}} + ], + as: 'offer', + }, + $unset: 'averageRating', + } + ]); + this.logger.info(`New comment created: ${dto.text}`); return result; @@ -24,6 +44,6 @@ export class DefaultCommentService implements CommentService { public async findByOfferId(offerId: string): Promise[]> { return this.commentModel .find({offerId}) - .populate('authorId'); + .populate(['authorId']); } } diff --git a/src/shared/modules/offer/default-offer.service.ts b/src/shared/modules/offer/default-offer.service.ts index f91207e..6d87e05 100644 --- a/src/shared/modules/offer/default-offer.service.ts +++ b/src/shared/modules/offer/default-offer.service.ts @@ -5,6 +5,7 @@ import {OfferEntity} from './offer.entity.js'; import {CreateOfferDto} from './dto/create-offer.dto.js'; import {Component} from '../../types/index.js'; import {Logger} from '../../libs/logger/index.js'; +import {UpdateOfferDto} from './dto/update-offer.dto.js'; @injectable() export class DefaultOfferService implements OfferService { @@ -23,20 +24,22 @@ export class DefaultOfferService implements OfferService { } public async findAll(): Promise[]> { - return this.offerModel.find(); + return this.offerModel + .find() + .exec(); } public async findById(offerId: string): Promise | null> { return this.offerModel .findById(offerId) - .populate('hostId') + .populate(['hostId']) .exec(); } - public async updateById(offerId: string, dto: CreateOfferDto): Promise | null> { + public async updateById(offerId: string, dto: UpdateOfferDto): Promise | null> { const result = await this.offerModel .findByIdAndUpdate(offerId, dto, {new: true}) - .populate('hostId') + .populate(['hostId']) .exec(); this.logger.info(`Offer updated: ${offerId}`); @@ -44,24 +47,39 @@ export class DefaultOfferService implements OfferService { } public async deleteById(offerId: string): Promise | null> { - return this.offerModel.findByIdAndDelete(offerId); + return this.offerModel + .findByIdAndDelete(offerId) + .exec(); } public async findPremium(): Promise[]> { - return this.offerModel.find({isPremium: true}); + return this.offerModel + .find({isPremium: true}) + .exec(); } public async findFavorites(): Promise[]> { - return this.offerModel.find({isFavorite: true}); + return this.offerModel + .find({isFavorite: true}) + .exec(); } public async changeFavoritesStatus(offerId: string, favoriteStatus: boolean): Promise | null> { const result = await this.offerModel .findByIdAndUpdate(offerId, {isFavorite: favoriteStatus}) - .populate('hostId') + .populate(['hostId']) .exec(); this.logger.info(`Favorite status changed: ${favoriteStatus}`); return result; } + + public async incCommentsCount(offerId: string): Promise | null> { + return this.offerModel + .findByIdAndUpdate(offerId, { + '$inc': { + commentCount: 1, + } + }).exec(); + } } diff --git a/src/shared/modules/offer/dto/create-offer.dto.ts b/src/shared/modules/offer/dto/create-offer.dto.ts index b9663c0..3f22b01 100644 --- a/src/shared/modules/offer/dto/create-offer.dto.ts +++ b/src/shared/modules/offer/dto/create-offer.dto.ts @@ -16,4 +16,5 @@ export class CreateOfferDto { public hostId: string; public bedrooms: number; public maxAdults: number; + public commentCount: number; } diff --git a/src/shared/modules/offer/dto/update-offer.dto.ts b/src/shared/modules/offer/dto/update-offer.dto.ts new file mode 100644 index 0000000..43c5910 --- /dev/null +++ b/src/shared/modules/offer/dto/update-offer.dto.ts @@ -0,0 +1,18 @@ +import {City, Location, OfferGood, OfferType} from '../../../types/index.js'; + +export class UpdateOfferDto { + public title?: string; + public type?: OfferType; + public price?: number; + public city?: City; + public location?: Location; + public isFavorite?: boolean; + public isPremium?: boolean; + public rating?: number; + public description?: string; + public images?: string[]; + public previewImage?: string; + public goods?: OfferGood[]; + public bedrooms?: number; + public maxAdults?: number; +} diff --git a/src/shared/modules/offer/offer-service.interface.ts b/src/shared/modules/offer/offer-service.interface.ts index f699a6c..a437603 100644 --- a/src/shared/modules/offer/offer-service.interface.ts +++ b/src/shared/modules/offer/offer-service.interface.ts @@ -1,14 +1,16 @@ import {DocumentType} from '@typegoose/typegoose'; import {OfferEntity} from './offer.entity.js'; import {CreateOfferDto} from './dto/create-offer.dto.js'; +import {UpdateOfferDto} from './dto/update-offer.dto.js'; export interface OfferService { create(dto: CreateOfferDto): Promise>; findAll(): Promise[]>; findById(offerId: string): Promise | null>; - updateById(offerId: string, dto: CreateOfferDto): Promise | null>; + updateById(offerId: string, dto: UpdateOfferDto): Promise | null>; deleteById(offerId: string): Promise | null>; findPremium(): Promise[]>; findFavorites(): Promise[]>; changeFavoritesStatus(offerId: string, favoriteStatus: boolean): Promise | null>; + incCommentsCount(offerId: string): Promise | null>; } diff --git a/src/shared/types/offer.type.ts b/src/shared/types/offer.type.ts index b5fd1be..17096ae 100644 --- a/src/shared/types/offer.type.ts +++ b/src/shared/types/offer.type.ts @@ -20,4 +20,5 @@ export type Offer = { host: User; bedrooms: number; maxAdults: number; + commentCount: number; }