From 4b1ab17b14e10f181330273ea901130944b53917 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Wed, 17 May 2023 22:06:13 +0200 Subject: [PATCH 01/23] Adding first UML --- UML/Tournaments.drawio | 116 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 UML/Tournaments.drawio diff --git a/UML/Tournaments.drawio b/UML/Tournaments.drawio new file mode 100644 index 0000000..9215e0e --- /dev/null +++ b/UML/Tournaments.drawio @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f651fdce75775cda90300ad830c4598660471acc Mon Sep 17 00:00:00 2001 From: warydiaz <32112364+warydiaz@users.noreply.github.com> Date: Wed, 17 May 2023 22:25:12 +0200 Subject: [PATCH 02/23] Updating relationships --- UML/Tournaments.drawio | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/UML/Tournaments.drawio b/UML/Tournaments.drawio index 9215e0e..b98466c 100644 --- a/UML/Tournaments.drawio +++ b/UML/Tournaments.drawio @@ -1,6 +1,6 @@ - + - + @@ -104,12 +104,22 @@ - + + + + + + + + + + + From 76a17a920c911b100d73b70a0cd0ee2262ae2e90 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Wed, 17 May 2023 23:08:48 +0200 Subject: [PATCH 03/23] updating arrows --- UML/Tournaments.drawio | 251 ++++++++++++++++++++--------------------- 1 file changed, 125 insertions(+), 126 deletions(-) diff --git a/UML/Tournaments.drawio b/UML/Tournaments.drawio index b98466c..313b91e 100644 --- a/UML/Tournaments.drawio +++ b/UML/Tournaments.drawio @@ -1,126 +1,125 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From a0d7e323b927ee038e508d3df2b0beda588a523b Mon Sep 17 00:00:00 2001 From: warydiaz <32112364+warydiaz@users.noreply.github.com> Date: Thu, 18 May 2023 09:27:56 +0200 Subject: [PATCH 04/23] deleting webtableid --- UML/Tournaments.drawio | 247 ++++++++++++++++++++--------------------- 1 file changed, 122 insertions(+), 125 deletions(-) diff --git a/UML/Tournaments.drawio b/UML/Tournaments.drawio index 313b91e..c24a424 100644 --- a/UML/Tournaments.drawio +++ b/UML/Tournaments.drawio @@ -1,125 +1,122 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d53e723b8ea58b04938999827965c81bb71fcabb Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 20 May 2023 12:27:56 +0200 Subject: [PATCH 05/23] creating docker and two first tables --- .gitignore | 4 + docker-compose.yml | 19 + package-lock.json | 1198 ++++++++++++++++++++++++++++++++++++++++++ package.json | 23 + prisma/schema.prisma | 23 + 5 files changed, 1267 insertions(+) create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 prisma/schema.prisma diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3d0a039 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +# Keep environment variables out of version control +.env +node_modules diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9c74f06 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3' + +services: + tournamentsdb: + image: postgres + container_name: tournamentsdb + restart: always + environment: + - POSTGRES_USER=admin + - POSTGRES_PASSWORD=admin + - POSTGRES_DB=tournamentsdb + ports: + - "5432:5432" + volumes: + - dbdata:/var/lib/postgressql/data + + +volumes: + dbdata: \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..41634bb --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1198 @@ +{ + "name": "p3-backend-2023", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "p3-backend-2023", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@prisma/client": "^4.14.1", + "cors": "^2.8.5", + "express": "^4.18.2", + "morgan": "^1.10.0" + }, + "devDependencies": { + "@types/express": "^4.17.17", + "@types/node": "^20.2.1", + "nodemon": "^2.0.22", + "prisma": "^4.14.1", + "typescript": "^5.0.4" + } + }, + "node_modules/@prisma/client": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.14.1.tgz", + "integrity": "sha512-TZIswkeX1ccsHG/eN2kICzg/csXll0osK3EHu1QKd8VJ3XLcXozbNELKkCNfsCUvKJAwPdDtFCzF+O+raIVldw==", + "hasInstallScript": true, + "dependencies": { + "@prisma/engines-version": "4.14.0-67.d9a4c5988f480fa576d43970d5a23641aa77bc9c" + }, + "engines": { + "node": ">=14.17" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/engines": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.14.1.tgz", + "integrity": "sha512-APqFddPVHYmWNKqc+5J5SqrLFfOghKOLZxobmguDUacxOwdEutLsbXPVhNnpFDmuQWQFbXmrTTPoRrrF6B1MWA==", + "devOptional": true, + "hasInstallScript": true + }, + "node_modules/@prisma/engines-version": { + "version": "4.14.0-67.d9a4c5988f480fa576d43970d5a23641aa77bc9c", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.14.0-67.d9a4c5988f480fa576d43970d5a23641aa77bc9c.tgz", + "integrity": "sha512-3jum8/YSudeSN0zGW5qkpz+wAN2V/NYCQ+BPjvHYDfWatLWlQkqy99toX0GysDeaUoBIJg1vaz2yKqiA3CFcQw==" + }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.35", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", + "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.1.tgz", + "integrity": "sha512-DqJociPbZP1lbZ5SQPk4oag6W7AyaGMO6gSfRwq3PWl4PXTwJpRQJhDq4W0kzrg3w6tJ1SwlvGZ5uKFHY13LIg==", + "dev": true + }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true + }, + "node_modules/@types/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", + "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", + "dev": true, + "dependencies": { + "@types/mime": "*", + "@types/node": "*" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "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, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/basic-auth/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/body-parser": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.1", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "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" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.1", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "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, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "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 + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "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, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "dependencies": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemon": { + "version": "2.0.22", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz", + "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==", + "dev": true, + "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": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "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, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "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, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prisma": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-4.14.1.tgz", + "integrity": "sha512-z6hxzTMYqT9SIKlzD08dhzsLUpxjFKKsLpp5/kBDnSqiOjtUyyl/dC5tzxLcOa3jkEHQ8+RpB/fE3w8bgNP51g==", + "devOptional": true, + "hasInstallScript": true, + "dependencies": { + "@prisma/engines": "4.14.1" + }, + "bin": { + "prisma": "build/index.js", + "prisma2": "build/index.js" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "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 + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-update-notifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.1.0.tgz", + "integrity": "sha512-VpsrsJSUcJEseSbMHkrsrAVSdvVS5I96Qo1QAQ4FxQ9wXFcB+pjj7FB7/us9+GcgfW4ziHtYMc1J0PLczb55mg==", + "dev": true, + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "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, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=12.20" + } + }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..bdba168 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "p3-backend-2023", + "version": "1.0.0", + "description": "Se trata de hacer un _backend_ usando Typescript, Express y Prisma. El _backend_ implementado en clase es el modelo a seguir. Para alumnos que lo hacen por primera vez y sienten algo de incomodidad, lo ideal es usar el modelo de guía y hacer un _backend_ cercano al original de tal manera que la práctica sea un repaso a fondo. Para los que estén más cómodos, lo ideal es innovar en algun aspecto y salirse parcialmente del modelo en ciertos momentos o explorar algún interés personal.", + "main": "index.js", + "scripts": {}, + "keywords": [], + "author": "Angel Diaz", + "license": "ISC", + "dependencies": { + "@prisma/client": "^4.14.1", + "cors": "^2.8.5", + "express": "^4.18.2", + "morgan": "^1.10.0" + }, + "devDependencies": { + "@types/express": "^4.17.17", + "@types/node": "^20.2.1", + "nodemon": "^2.0.22", + "prisma": "^4.14.1", + "typescript": "^5.0.4" + } +} diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..2166cbe --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,23 @@ +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +generator client { + provider = "prisma-client-js" +} + +model Partner { + id Int @id @default(autoincrement()) + name String @unique + url String @unique + promotions Promotion[] +} + +model Promotion { + id Int @id @default(autoincrement()) + name String @unique + url String @unique + partnerId Int + partner Partner @relation(fields: [partnerId], references: [id]) +} From aa1f15437d53aeac59f0ec49a847dae6536bffcd Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 20 May 2023 14:05:13 +0200 Subject: [PATCH 06/23] adding seed.ts file and seed to package.json --- package.json | 6 +++++- src/seed.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/seed.ts diff --git a/package.json b/package.json index bdba168..0a805a4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "p3-backend-2023", "version": "1.0.0", "description": "Se trata de hacer un _backend_ usando Typescript, Express y Prisma. El _backend_ implementado en clase es el modelo a seguir. Para alumnos que lo hacen por primera vez y sienten algo de incomodidad, lo ideal es usar el modelo de guía y hacer un _backend_ cercano al original de tal manera que la práctica sea un repaso a fondo. Para los que estén más cómodos, lo ideal es innovar en algun aspecto y salirse parcialmente del modelo en ciertos momentos o explorar algún interés personal.", - "main": "index.js", + "main": "src/server.ts", + "type": "module", "scripts": {}, "keywords": [], "author": "Angel Diaz", @@ -19,5 +20,8 @@ "nodemon": "^2.0.22", "prisma": "^4.14.1", "typescript": "^5.0.4" + }, + "prisma":{ + "seed":"ts-node-esm src/seed.ts" } } diff --git a/src/seed.ts b/src/seed.ts new file mode 100644 index 0000000..047b705 --- /dev/null +++ b/src/seed.ts @@ -0,0 +1,41 @@ +import { PrismaClient } from "@prisma/client"; + +const prisma = new PrismaClient(); + +const cyberbingo = await prisma.partner.create({ + data: { + name: "Cyberbingo", + url: "www.cyberbingo.com", + }, +}); + +console.log(`created partner: ${cyberbingo.name}`); + +const vegascrest = await prisma.partner.create({ + data: { + name: "Vegascrest", + url: "www.vegascrest.ag", + }, +}); + +console.log(`created partner: ${vegascrest.name}`); + +const welcomeBonuses = await prisma.promotion.create({ + data: { + name: "Welcome Bonus", + url: "welcome-bonus", + partnerId: cyberbingo.id, + }, +}); + +console.log(`created promotion: ${welcomeBonuses.name}`); + +const animalKingdom = await prisma.promotion.create({ + data: { + name: "The Animal Kingdom Tourney", + url: "the-animal-kingdom-tourney", + partnerId: vegascrest.id, + }, +}); + +console.log(`created promotion: ${animalKingdom.name}`); From be559735d9031a4f9b092befc95fad3cfe342b6e Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 20 May 2023 17:58:05 +0200 Subject: [PATCH 07/23] adding tsconfig adding tables to schema --- prisma/schema.prisma | 47 +++++++++++++++++++++++++++++++++++++------- tsconfig.json | 7 +++++++ 2 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 tsconfig.json diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2166cbe..14c8aec 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -8,16 +8,49 @@ generator client { } model Partner { - id Int @id @default(autoincrement()) - name String @unique - url String @unique + id Int @id @default(autoincrement()) + name String @unique + url String @unique promotions Promotion[] + positions Position[] } model Promotion { - id Int @id @default(autoincrement()) - name String @unique - url String @unique + id Int @id @default(autoincrement()) + name String @unique + url String @unique + partnerId Int + partner Partner @relation(fields: [partnerId], references: [id]) + tournaments Tournament[] +} + +model Tournament { + id Int @id @default(autoincrement()) + promotionId Int + startDate DateTime + endDate DateTime + promotion Promotion @relation(fields: [promotionId], references: [id]) + rankings Ranking[] +} + +model Ranking { + id Int @id @default(autoincrement()) + tournamentId Int + startDate DateTime + endDate DateTime + tournament Tournament @relation(fields: [tournamentId], references: [id]) + Position Position[] +} + +model Position { + id Int @id @default(autoincrement()) + rankingId Int + position Int + userName String + gamesWon Int + prize Int partnerId Int - partner Partner @relation(fields: [partnerId], references: [id]) + + partner Partner @relation(fields: [partnerId], references: [id]) + ranking Ranking @relation(fields: [rankingId], references: [id]) } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..46706b3 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "module": "esnext", + "target": "esnext", + "moduleResolution": "nodenext" + } +} \ No newline at end of file From 95257b8c5c5f905886484b86782e84bdff5f3170 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 20 May 2023 19:10:28 +0200 Subject: [PATCH 08/23] fixing issue with seed file --- package-lock.json | 168 +++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + prisma/schema.prisma | 12 ++-- src/seed.ts | 11 +++ 4 files changed, 186 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41634bb..661453c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,9 +19,47 @@ "@types/node": "^20.2.1", "nodemon": "^2.0.22", "prisma": "^4.14.1", + "ts-node": "^10.9.1", "typescript": "^5.0.4" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@prisma/client": { "version": "4.14.1", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.14.1.tgz", @@ -54,6 +92,30 @@ "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.14.0-67.d9a4c5988f480fa576d43970d5a23641aa77bc9c.tgz", "integrity": "sha512-3jum8/YSudeSN0zGW5qkpz+wAN2V/NYCQ+BPjvHYDfWatLWlQkqy99toX0GysDeaUoBIJg1vaz2yKqiA3CFcQw==" }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, "node_modules/@types/body-parser": { "version": "1.19.2", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", @@ -159,6 +221,27 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -172,6 +255,12 @@ "node": ">= 8" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -350,6 +439,12 @@ "node": ">= 0.10" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -375,6 +470,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -661,6 +765,12 @@ "node": ">=0.12.0" } }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -1139,6 +1249,49 @@ "nodetouch": "bin/nodetouch.js" } }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -1186,6 +1339,12 @@ "node": ">= 0.4.0" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -1193,6 +1352,15 @@ "engines": { "node": ">= 0.8" } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } } } } diff --git a/package.json b/package.json index 0a805a4..a203d3c 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@types/node": "^20.2.1", "nodemon": "^2.0.22", "prisma": "^4.14.1", + "ts-node":"^10.9.1", "typescript": "^5.0.4" }, "prisma":{ diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 14c8aec..5e0d335 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -12,23 +12,23 @@ model Partner { name String @unique url String @unique promotions Promotion[] - positions Position[] + positions Position[] } model Promotion { id Int @id @default(autoincrement()) name String @unique url String @unique - partnerId Int + partnerId Int partner Partner @relation(fields: [partnerId], references: [id]) tournaments Tournament[] } model Tournament { id Int @id @default(autoincrement()) - promotionId Int - startDate DateTime - endDate DateTime + promotionId Int + startDate DateTime + endDate DateTime promotion Promotion @relation(fields: [promotionId], references: [id]) rankings Ranking[] } @@ -39,7 +39,7 @@ model Ranking { startDate DateTime endDate DateTime tournament Tournament @relation(fields: [tournamentId], references: [id]) - Position Position[] + positions Position[] } model Position { diff --git a/src/seed.ts b/src/seed.ts index 047b705..b3b6422 100644 --- a/src/seed.ts +++ b/src/seed.ts @@ -39,3 +39,14 @@ const animalKingdom = await prisma.promotion.create({ }); console.log(`created promotion: ${animalKingdom.name}`); + +const futureDate = new Date(); +futureDate.setMonth(futureDate.getMonth() + 1); + +const tournament = await prisma.tournament.create({ + data:{ + promotionId: animalKingdom.id, + startDate: new Date(), + endDate: futureDate + } +}) From 7798ffde897a6903b3dd008f812038d4a58d182e Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 20 May 2023 21:12:22 +0200 Subject: [PATCH 09/23] Adding: -utils -server -partner -prima-client --- nodemon.json | 5 ++++ package-lock.json | 9 +++++++ package.json | 7 ++--- src/partner.ts | 63 ++++++++++++++++++++++++++++++++++++++++++++ src/prisma-client.ts | 3 +++ src/seed.ts | 2 ++ src/server.ts | 18 +++++++++++++ src/utils.ts | 18 +++++++++++++ 8 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 nodemon.json create mode 100644 src/partner.ts create mode 100644 src/prisma-client.ts create mode 100644 src/server.ts create mode 100644 src/utils.ts diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..bb7586b --- /dev/null +++ b/nodemon.json @@ -0,0 +1,5 @@ +{ + "execMap": { + "ts": "ts-node-esm" + } +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 661453c..1e4a230 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@prisma/client": "^4.14.1", "cors": "^2.8.5", + "dotenv": "^16.0.3", "express": "^4.18.2", "morgan": "^1.10.0" }, @@ -479,6 +480,14 @@ "node": ">=0.3.1" } }, + "node_modules/dotenv": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", + "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", + "engines": { + "node": ">=12" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", diff --git a/package.json b/package.json index a203d3c..125a361 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@prisma/client": "^4.14.1", "cors": "^2.8.5", + "dotenv": "^16.0.3", "express": "^4.18.2", "morgan": "^1.10.0" }, @@ -19,10 +20,10 @@ "@types/node": "^20.2.1", "nodemon": "^2.0.22", "prisma": "^4.14.1", - "ts-node":"^10.9.1", + "ts-node": "^10.9.1", "typescript": "^5.0.4" }, - "prisma":{ - "seed":"ts-node-esm src/seed.ts" + "prisma": { + "seed": "ts-node-esm src/seed.ts" } } diff --git a/src/partner.ts b/src/partner.ts new file mode 100644 index 0000000..9a5fa96 --- /dev/null +++ b/src/partner.ts @@ -0,0 +1,63 @@ +import { Request, Router } from "express"; +import prisma from "./prisma-client.js"; +import { errorChecked } from "./utils.js"; + +const router = Router(); + +router.get( + "/", + errorChecked(async (req, res) => { + const result = await prisma.partner.findMany({}); + res.status(200).json({ partners: result, ok: true }); + }) +); + +router.post( + "/", + errorChecked(async (req, res) => { + const newPartner = await prisma.partner.create({ data: req.body }); + res.status(200).json({ newPartner, ok: true }); + }) +); + +export interface RequestWithPartnerId extends Request { + partnerId: number; +} +router.use("/:id", async (req: RequestWithPartnerId, res, next) => { + const { id } = req.params; + req.partnerId = Number(id); + next(); +}); + +router.get( + "/:id", + errorChecked(async (req: RequestWithPartnerId, res) => { + const forum = await prisma.partner.findUniqueOrThrow({ + where: { id: req.partnerId }, + }); + res.status(200).json(forum); + }) +); + +router.put( + "/:id", + errorChecked(async (req: RequestWithPartnerId, res) => { + const updatedForum = await prisma.partner.update({ + where: { id: req.partnerId }, + data: req.body, + }); + res.status(200).json(updatedForum); + }) +); + +router.delete( + "/:id", + errorChecked(async (req: RequestWithPartnerId, res) => { + const deletedForum = await prisma.partner.delete({ + where: { id: req.partnerId }, + }); + res.status(200).json(deletedForum); + }) +); + +export default router; diff --git a/src/prisma-client.ts b/src/prisma-client.ts new file mode 100644 index 0000000..6ca4370 --- /dev/null +++ b/src/prisma-client.ts @@ -0,0 +1,3 @@ +import { PrismaClient } from "@prisma/client"; +const prisma = new PrismaClient(); +export default prisma; \ No newline at end of file diff --git a/src/seed.ts b/src/seed.ts index b3b6422..4b48afe 100644 --- a/src/seed.ts +++ b/src/seed.ts @@ -50,3 +50,5 @@ const tournament = await prisma.tournament.create({ endDate: futureDate } }) + +console.log(`created tournament: ${tournament.id} of the promotion ${animalKingdom.name}`); \ No newline at end of file diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000..8fe0598 --- /dev/null +++ b/src/server.ts @@ -0,0 +1,18 @@ +import express from "express"; +import { ErrorRequestHandler } from "express"; +import cors from "cors"; +import morgan from "morgan"; +import dotenv from "dotenv"; +import partnerRouter from "./partner.js"; +import { defaultErrorHandler } from "./utils.js"; + +//for use the file .env +dotenv.config(); + +const app = express(); +app.use(cors()); +app.use(express.json()); +//to log request http +app.use(morgan("dev")); + +app.use("/partner", partnerRouter); diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..38d86b1 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,18 @@ +import { ErrorRequestHandler, RequestHandler } from "express"; + +export const defaultErrorHandler: ErrorRequestHandler = (err, req, res, next) => { + res.status(500).json({ + type: err.constructor.name, + message: err.toString(), + }); +} + +export const errorChecked = (handler: RequestHandler): RequestHandler => { + return async (req, res, next) => { + try { + await handler(req, res, next); + } catch (e) { + next(e); + } + } +} \ No newline at end of file From 4e908f70f9a888af97b050b31f3fd2167a3b4d72 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Wed, 24 May 2023 19:24:59 +0200 Subject: [PATCH 10/23] updating server. changing variables names over partner. creating promotion file --- src/partner.ts | 13 +++++----- src/promotion.ts | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ src/server.ts | 2 ++ 3 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 src/promotion.ts diff --git a/src/partner.ts b/src/partner.ts index 9a5fa96..582bb27 100644 --- a/src/partner.ts +++ b/src/partner.ts @@ -23,6 +23,7 @@ router.post( export interface RequestWithPartnerId extends Request { partnerId: number; } + router.use("/:id", async (req: RequestWithPartnerId, res, next) => { const { id } = req.params; req.partnerId = Number(id); @@ -32,31 +33,31 @@ router.use("/:id", async (req: RequestWithPartnerId, res, next) => { router.get( "/:id", errorChecked(async (req: RequestWithPartnerId, res) => { - const forum = await prisma.partner.findUniqueOrThrow({ + const partner = await prisma.partner.findUniqueOrThrow({ where: { id: req.partnerId }, }); - res.status(200).json(forum); + res.status(200).json(partner); }) ); router.put( "/:id", errorChecked(async (req: RequestWithPartnerId, res) => { - const updatedForum = await prisma.partner.update({ + const updatedPartner = await prisma.partner.update({ where: { id: req.partnerId }, data: req.body, }); - res.status(200).json(updatedForum); + res.status(200).json(updatedPartner); }) ); router.delete( "/:id", errorChecked(async (req: RequestWithPartnerId, res) => { - const deletedForum = await prisma.partner.delete({ + const deletedPartner = await prisma.partner.delete({ where: { id: req.partnerId }, }); - res.status(200).json(deletedForum); + res.status(200).json(deletedPartner); }) ); diff --git a/src/promotion.ts b/src/promotion.ts new file mode 100644 index 0000000..4fd17e7 --- /dev/null +++ b/src/promotion.ts @@ -0,0 +1,64 @@ +import { Request, Router } from "express"; +import prisma from "./prisma-client.js"; +import { errorChecked } from "./utils.js"; + +const router = Router(); + +router.get( + "/", + errorChecked(async (req, res) => { + const result = await prisma.promotion.findMany({}); + res.status(200).json({ partners: result, ok: true }); + }) +); + +router.post( + "/", + errorChecked(async (req, res) => { + const newPartner = await prisma.promotion.create({ data: req.body }); + res.status(200).json({ newPartner, ok: true }); + }) +); + +export interface RequestWithPromotionId extends Request { + promotionId: number; +} + +router.use("/:id", async (req: RequestWithPromotionId, res, next) => { + const { id } = req.params; + req.promotionId = Number(id); + next(); +}); + +router.get( + "/:id", + errorChecked(async (req: RequestWithPromotionId, res) => { + const partner = await prisma.partner.findUniqueOrThrow({ + where: { id: req.promotionId }, + }); + res.status(200).json(partner); + }) +); + +router.put( + "/:id", + errorChecked(async (req: RequestWithPromotionId, res) => { + const updatedPartner = await prisma.partner.update({ + where: { id: req.promotionId }, + data: req.body, + }); + res.status(200).json(updatedPartner); + }) +); + +router.delete( + "/:id", + errorChecked(async (req: RequestWithPromotionId, res) => { + const deletePartner = await prisma.partner.delete({ + where: { id: req.promotionId }, + }); + res.status(200).json(deletePartner); + }) +); + +export default router; \ No newline at end of file diff --git a/src/server.ts b/src/server.ts index 8fe0598..3f3bcde 100644 --- a/src/server.ts +++ b/src/server.ts @@ -4,6 +4,7 @@ import cors from "cors"; import morgan from "morgan"; import dotenv from "dotenv"; import partnerRouter from "./partner.js"; +import promotionRouter from "./promotion.js" import { defaultErrorHandler } from "./utils.js"; //for use the file .env @@ -16,3 +17,4 @@ app.use(express.json()); app.use(morgan("dev")); app.use("/partner", partnerRouter); +app.use("/promotion", promotionRouter); From 241a134bc5acf28b659da92cf5129e84daa6616b Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Wed, 24 May 2023 19:35:39 +0200 Subject: [PATCH 11/23] creating torunament --- src/tournament.ts | 64 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/tournament.ts diff --git a/src/tournament.ts b/src/tournament.ts new file mode 100644 index 0000000..c336fcd --- /dev/null +++ b/src/tournament.ts @@ -0,0 +1,64 @@ +import { Request, Router } from "express"; +import prisma from "./prisma-client.js"; +import { errorChecked } from "./utils.js"; + +const router = Router(); + +router.get( + "/", + errorChecked(async (req, res) => { + const result = await prisma.tournament.findMany({}); + res.status(200).json({ tournaments: result, ok: true }); + }) +); + +router.post( + "/", + errorChecked(async (req, res) => { + const newTournament = await prisma.tournament.create({ data: req.body }); + res.status(200).json({ newTournament, ok: true }); + }) +); + +export interface RequestWithTournamentId extends Request { + tournamentId: number; +} + +router.use("/:id", async (req: RequestWithTournamentId, res, next) => { + const { id } = req.params; + req.tournamentId = Number(id); + next(); +}); + +router.get( + "/:id", + errorChecked(async (req: RequestWithTournamentId, res) => { + const tournament = await prisma.tournament.findUniqueOrThrow({ + where: { id: req.tournamentId }, + }); + res.status(200).json(tournament); + }) +); + +router.put( + "/:id", + errorChecked(async (req: RequestWithTournamentId, res) => { + const updatedTournament = await prisma.tournament.update({ + where: { id: req.tournamentId }, + data: req.body, + }); + res.status(200).json(updatedTournament); + }) +); + +router.delete( + "/:id", + errorChecked(async (req: RequestWithTournamentId, res) => { + const deletedTournament = await prisma.tournament.delete({ + where: { id: req.tournamentId }, + }); + res.status(200).json(deletedTournament); + }) +); + +export default router; From 383cdd79d9881bb35d1ed13d6956037e33c550ba Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Wed, 24 May 2023 19:36:58 +0200 Subject: [PATCH 12/23] Updating UML --- UML/Tournaments.drawio | 250 +++++++++++++++++++++-------------------- 1 file changed, 128 insertions(+), 122 deletions(-) diff --git a/UML/Tournaments.drawio b/UML/Tournaments.drawio index c24a424..2f138d0 100644 --- a/UML/Tournaments.drawio +++ b/UML/Tournaments.drawio @@ -1,122 +1,128 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 70bbbc13c4c3097958dbbb4d5f37824d1ea6eef2 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 27 May 2023 12:47:46 +0200 Subject: [PATCH 13/23] adding nodemon script. fixing names over endpoints --- package.json | 4 +++- src/promotion.ts | 18 +++++++++--------- src/server.ts | 8 +++++++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 125a361..1d84b02 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "description": "Se trata de hacer un _backend_ usando Typescript, Express y Prisma. El _backend_ implementado en clase es el modelo a seguir. Para alumnos que lo hacen por primera vez y sienten algo de incomodidad, lo ideal es usar el modelo de guía y hacer un _backend_ cercano al original de tal manera que la práctica sea un repaso a fondo. Para los que estén más cómodos, lo ideal es innovar en algun aspecto y salirse parcialmente del modelo en ciertos momentos o explorar algún interés personal.", "main": "src/server.ts", "type": "module", - "scripts": {}, + "scripts": { + "dev": "nodemon src/server.ts" + }, "keywords": [], "author": "Angel Diaz", "license": "ISC", diff --git a/src/promotion.ts b/src/promotion.ts index 4fd17e7..dbe56d9 100644 --- a/src/promotion.ts +++ b/src/promotion.ts @@ -8,15 +8,15 @@ router.get( "/", errorChecked(async (req, res) => { const result = await prisma.promotion.findMany({}); - res.status(200).json({ partners: result, ok: true }); + res.status(200).json({ promotions: result, ok: true }); }) ); router.post( "/", errorChecked(async (req, res) => { - const newPartner = await prisma.promotion.create({ data: req.body }); - res.status(200).json({ newPartner, ok: true }); + const newPromotion = await prisma.promotion.create({ data: req.body }); + res.status(200).json({ newPromotion, ok: true }); }) ); @@ -33,31 +33,31 @@ router.use("/:id", async (req: RequestWithPromotionId, res, next) => { router.get( "/:id", errorChecked(async (req: RequestWithPromotionId, res) => { - const partner = await prisma.partner.findUniqueOrThrow({ + const promotion = await prisma.promotion.findUniqueOrThrow({ where: { id: req.promotionId }, }); - res.status(200).json(partner); + res.status(200).json(promotion); }) ); router.put( "/:id", errorChecked(async (req: RequestWithPromotionId, res) => { - const updatedPartner = await prisma.partner.update({ + const updatedPromotion = await prisma.promotion.update({ where: { id: req.promotionId }, data: req.body, }); - res.status(200).json(updatedPartner); + res.status(200).json(updatedPromotion); }) ); router.delete( "/:id", errorChecked(async (req: RequestWithPromotionId, res) => { - const deletePartner = await prisma.partner.delete({ + const deletePromotion = await prisma.promotion.delete({ where: { id: req.promotionId }, }); - res.status(200).json(deletePartner); + res.status(200).json(deletePromotion); }) ); diff --git a/src/server.ts b/src/server.ts index 3f3bcde..14c0ed6 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,9 +5,10 @@ import morgan from "morgan"; import dotenv from "dotenv"; import partnerRouter from "./partner.js"; import promotionRouter from "./promotion.js" +import tournamentRouter from "./tournament.js" import { defaultErrorHandler } from "./utils.js"; -//for use the file .env +//to use the file .env dotenv.config(); const app = express(); @@ -18,3 +19,8 @@ app.use(morgan("dev")); app.use("/partner", partnerRouter); app.use("/promotion", promotionRouter); +app.use("/tournament", tournamentRouter); + +app.listen(process.env.SERVER_PORT,()=>{ + console.log(`Tournament API listening on: ${process.env.SERVER_PORT}`); +}) \ No newline at end of file From d582bb4da3dc0642f526db4e7fcac1398a43d3c3 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 27 May 2023 12:57:20 +0200 Subject: [PATCH 14/23] Adding Insomnia json --- Insomnia/Endpoints_test.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 Insomnia/Endpoints_test.json diff --git a/Insomnia/Endpoints_test.json b/Insomnia/Endpoints_test.json new file mode 100644 index 0000000..7be782c --- /dev/null +++ b/Insomnia/Endpoints_test.json @@ -0,0 +1 @@ +{"_type":"export","__export_format":4,"__export_date":"2023-05-27T10:56:31.810Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184771710,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2023-01-01T00:00:00Z\", \n \"endDate\": \"2023-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184778252,"created":1685184586055,"url":"localhost:3000/tournament/1","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184823667,"created":1685184793932,"url":"localhost:3000/tournament/2","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file From 7ce463d024c052b2e109a89c1a78e0a2b61234af Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 27 May 2023 16:15:44 +0200 Subject: [PATCH 15/23] Adding new endpoints test. creating position endpoint. creating ranking endpoint updating server --- Insomnia/Endpoints_test.json | 2 +- src/position.ts | 64 ++++++++++++++++++++++++++++++++++++ src/ranking.ts | 64 ++++++++++++++++++++++++++++++++++++ src/server.ts | 5 +++ 4 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 src/position.ts create mode 100644 src/ranking.ts diff --git a/Insomnia/Endpoints_test.json b/Insomnia/Endpoints_test.json index 7be782c..55c0349 100644 --- a/Insomnia/Endpoints_test.json +++ b/Insomnia/Endpoints_test.json @@ -1 +1 @@ -{"_type":"export","__export_format":4,"__export_date":"2023-05-27T10:56:31.810Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184771710,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2023-01-01T00:00:00Z\", \n \"endDate\": \"2023-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184778252,"created":1685184586055,"url":"localhost:3000/tournament/1","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184823667,"created":1685184793932,"url":"localhost:3000/tournament/2","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file +{"_type":"export","__export_format":4,"__export_date":"2023-05-27T14:14:01.515Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_c415dab5014d4191bb4875d119d1f792","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685195922364,"created":1685195884107,"url":"localhost:3000/position","name":"Get all position","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884107,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_91f77097186b454baec9844098a12130","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685195876494,"created":1685195876494,"name":"Position","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685195876494,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_c5d94d77a32449aca6e7f1e97d5a848f","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196780407,"created":1685195927947,"url":"localhost:3000/position","name":"Create a new position","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"rankingId\":2,\n \"position\":1,\n \"userName\" :\"warydiaz\",\n \"gamesWon\" :129,\n \"prize\" : 50,\n \"partnerId\":3\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195884057,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ae4d1571ae7d4e5db5fc519a5a545dfb","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196520941,"created":1685196488045,"url":"localhost:3000/position/1","name":"Get position by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884007,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_d31768f6144f4effa994af118525ffe2","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196603457,"created":1685196525322,"url":"localhost:3000/position/1","name":"Update position by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"gamesWon\": 200,\n\t\"prize\": 10\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195883957,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_f06b0bf178c944468de39088f130ba0e","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196766104,"created":1685196626657,"url":"localhost:3000/position/2","name":"Delete Position by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195883907,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5019495e1cb04710884f348994327d9d","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685194989198,"created":1685194957591,"url":"localhost:3000/ranking","name":"Get all the rankings","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957591,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685194944148,"created":1685194944148,"name":"Ranking","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685194944148,"_type":"request_group"},{"_id":"req_8af2d58be9b34151bb8b983ffd23c62f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195270317,"created":1685195006526,"url":"localhost:3000/ranking","name":"Create a new Ranking","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"tournamentId\":1, \n \"startDate\": \"2023-05-01T00:00:00.000Z\",\n\t\"endDate\": \"2023-05-07T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957541,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_45ffd8b921a64933800891b7274fa048","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195335760,"created":1685195301241,"url":"localhost:3000/ranking/1","name":"Get ranking by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957491,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_7ee5427c82ab452cab39016a0633845f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195423240,"created":1685195345055,"url":"localhost:3000/ranking/1","name":"Update tounament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"endDate\": \"2023-05-10T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957441,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_10d0812099134acc82dac19f8dbc93fa","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195502443,"created":1685195442068,"url":"localhost:3000/ranking/1","name":"Delete Ranking by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957391,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184771710,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2023-01-01T00:00:00Z\", \n \"endDate\": \"2023-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184778252,"created":1685184586055,"url":"localhost:3000/tournament/1","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184823667,"created":1685184793932,"url":"localhost:3000/tournament/2","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file diff --git a/src/position.ts b/src/position.ts new file mode 100644 index 0000000..5c71031 --- /dev/null +++ b/src/position.ts @@ -0,0 +1,64 @@ +import { Request, Router } from "express"; +import prisma from "./prisma-client.js"; +import { errorChecked } from "./utils.js"; + +const router = Router(); + +router.get( + "/", + errorChecked(async (req, res) => { + const result = await prisma.position.findMany({}); + res.status(200).json({ positions: result, ok: true }); + }) +); + +router.post( + "/", + errorChecked(async (req, res) => { + const newPosition = await prisma.position.create({ data: req.body }); + res.status(200).json({ newPosition, ok: true }); + }) +); + +export interface RequestWithPositionId extends Request { + positionId: number; +} + +router.use("/:id", async (req: RequestWithPositionId, res, next) => { + const { id } = req.params; + req.positionId = Number(id); + next(); +}); + +router.get( + "/:id", + errorChecked(async (req: RequestWithPositionId, res) => { + const position = await prisma.position.findUniqueOrThrow({ + where: { id: req.positionId }, + }); + res.status(200).json(position); + }) +); + +router.put( + "/:id", + errorChecked(async (req: RequestWithPositionId, res) => { + const updatedPosition = await prisma.position.update({ + where: { id: req.positionId }, + data: req.body, + }); + res.status(200).json(updatedPosition); + }) +); + +router.delete( + "/:id", + errorChecked(async (req: RequestWithPositionId, res) => { + const deletedPosition = await prisma.position.delete({ + where: { id: req.positionId }, + }); + res.status(200).json(deletedPosition); + }) +); + +export default router; diff --git a/src/ranking.ts b/src/ranking.ts new file mode 100644 index 0000000..37fc92a --- /dev/null +++ b/src/ranking.ts @@ -0,0 +1,64 @@ +import { Request, Router } from "express"; +import prisma from "./prisma-client.js"; +import { errorChecked } from "./utils.js"; + +const router = Router(); + +router.get( + "/", + errorChecked(async (req, res) => { + const result = await prisma.ranking.findMany({}); + res.status(200).json({ rankings: result, ok: true }); + }) +); + +router.post( + "/", + errorChecked(async (req, res) => { + const newRanking = await prisma.ranking.create({ data: req.body }); + res.status(200).json({ newRanking, ok: true }); + }) +); + +export interface RequestWithRankingId extends Request { + rankingId: number; +} + +router.use("/:id", async (req: RequestWithRankingId, res, next) => { + const { id } = req.params; + req.rankingId = Number(id); + next(); +}); + +router.get( + "/:id", + errorChecked(async (req: RequestWithRankingId, res) => { + const ranking = await prisma.ranking.findUniqueOrThrow({ + where: { id: req.rankingId }, + }); + res.status(200).json(ranking); + }) +); + +router.put( + "/:id", + errorChecked(async (req: RequestWithRankingId, res) => { + const updatedRanking = await prisma.ranking.update({ + where: { id: req.rankingId }, + data: req.body, + }); + res.status(200).json(updatedRanking); + }) +); + +router.delete( + "/:id", + errorChecked(async (req: RequestWithRankingId, res) => { + const deletedRanking = await prisma.ranking.delete({ + where: { id: req.rankingId }, + }); + res.status(200).json(deletedRanking); + }) +); + +export default router; diff --git a/src/server.ts b/src/server.ts index 14c0ed6..506ca2a 100644 --- a/src/server.ts +++ b/src/server.ts @@ -6,6 +6,8 @@ import dotenv from "dotenv"; import partnerRouter from "./partner.js"; import promotionRouter from "./promotion.js" import tournamentRouter from "./tournament.js" +import rankingtRouter from "./ranking.js" +import positionRouter from "./position.js" import { defaultErrorHandler } from "./utils.js"; //to use the file .env @@ -20,6 +22,9 @@ app.use(morgan("dev")); app.use("/partner", partnerRouter); app.use("/promotion", promotionRouter); app.use("/tournament", tournamentRouter); +app.use("/ranking", rankingtRouter); +app.use("/position", positionRouter); + app.listen(process.env.SERVER_PORT,()=>{ console.log(`Tournament API listening on: ${process.env.SERVER_PORT}`); From 1f8b6c84fdd059718a51f4652883b097401fc0b6 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 27 May 2023 22:24:14 +0200 Subject: [PATCH 16/23] Adding more data to seed file. updating Tournament UML --- UML/Tournaments.drawio | 15 ++++---- src/seed.ts | 81 +++++++++++++++++++++++++++++++++++++----- 2 files changed, 79 insertions(+), 17 deletions(-) diff --git a/UML/Tournaments.drawio b/UML/Tournaments.drawio index 2f138d0..3628417 100644 --- a/UML/Tournaments.drawio +++ b/UML/Tournaments.drawio @@ -1,6 +1,6 @@ - + @@ -54,18 +54,12 @@ - + - + - - - - - - @@ -122,6 +116,9 @@ + + + diff --git a/src/seed.ts b/src/seed.ts index 4b48afe..46bfe69 100644 --- a/src/seed.ts +++ b/src/seed.ts @@ -1,6 +1,4 @@ -import { PrismaClient } from "@prisma/client"; - -const prisma = new PrismaClient(); +import prisma from "./prisma-client.js"; const cyberbingo = await prisma.partner.create({ data: { @@ -44,11 +42,78 @@ const futureDate = new Date(); futureDate.setMonth(futureDate.getMonth() + 1); const tournament = await prisma.tournament.create({ - data:{ + data: { promotionId: animalKingdom.id, startDate: new Date(), - endDate: futureDate - } -}) + endDate: futureDate, + }, +}); + +console.log( + `created tournament: ${tournament.id} of the promotion ${animalKingdom.name}` +); + +const tournamentWelcomeBonuses = await prisma.tournament.create({ + data: { + promotionId: welcomeBonuses.id, + startDate: new Date(), + endDate: futureDate, + }, +}); + +console.log( + `created tournament: ${tournamentWelcomeBonuses.id} of the promotion ${welcomeBonuses.name}` +); + +const ranking = await prisma.ranking.create({ + data: { + tournamentId: tournament.id, + startDate: new Date(), + endDate: futureDate, + }, +}); + +console.log(`created ranking: ${ranking.id} of the promotion ${tournament.id}`); + +const rankingWelcomeBonuses = await prisma.ranking.create({ + data: { + tournamentId: tournamentWelcomeBonuses.id, + startDate: new Date(), + endDate: futureDate, + }, +}); + +console.log( + `created ranking: ${rankingWelcomeBonuses.id} of the promotion ${tournamentWelcomeBonuses.id}` +); + +const position = await prisma.position.create({ + data: { + rankingId: ranking.id, + position: 1, + userName: "the_fisrt_one", + gamesWon: 150, + prize: 500, + partnerId: cyberbingo.id, + }, +}); + +console.log( + `created position: ${position.id} of the promotion ${ranking.id}` +); + +const secondPosition = await prisma.position.create({ + data: { + rankingId: ranking.id, + position: 2, + userName: "the_second", + gamesWon: 130, + prize: 50, + partnerId: cyberbingo.id, + }, +}); + +console.log( + `created position: ${secondPosition.id} of the promotion ${ranking.id}` +); -console.log(`created tournament: ${tournament.id} of the promotion ${animalKingdom.name}`); \ No newline at end of file From 6a9dcc0ab1593cb83c7023387368adf4c432a5b2 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 27 May 2023 22:41:45 +0200 Subject: [PATCH 17/23] updating description --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d84b02..f3d289e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "p3-backend-2023", "version": "1.0.0", - "description": "Se trata de hacer un _backend_ usando Typescript, Express y Prisma. El _backend_ implementado en clase es el modelo a seguir. Para alumnos que lo hacen por primera vez y sienten algo de incomodidad, lo ideal es usar el modelo de guía y hacer un _backend_ cercano al original de tal manera que la práctica sea un repaso a fondo. Para los que estén más cómodos, lo ideal es innovar en algun aspecto y salirse parcialmente del modelo en ciertos momentos o explorar algún interés personal.", + "description": "The following solution addresses a backend system that solves the following problem: An online casino and bingo company needs to have quick and easy access to data related to various tournaments organized for its promotions. The tournaments are associated with specific promotions, and each tournament can span multiple weeks. The positions are updated every week, and the rankings are published on Fridays. These rankings are displayed on the promotions pages.", "main": "src/server.ts", "type": "module", "scripts": { From 617bc24c1437f20f299b238e4e2fcec11f025bee Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sun, 28 May 2023 10:58:46 +0200 Subject: [PATCH 18/23] adding new features to endpoints --- .gitignore | 1 - package-lock.json | 12 ++++++++++++ package.json | 1 + src/position.ts | 22 ++++++++++++++++++++++ src/promotion.ts | 40 ++++++++++++++++++++++++++++++++++++++-- 5 files changed, 73 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3d0a039..11ddd8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules # Keep environment variables out of version control .env -node_modules diff --git a/package-lock.json b/package-lock.json index 1e4a230..74fe9c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "@types/node": "^20.2.1", "nodemon": "^2.0.22", "prisma": "^4.14.1", + "redis": "npm:@types/redis@^4.0.11", "ts-node": "^10.9.1", "typescript": "^5.0.4" } @@ -1092,6 +1093,17 @@ "node": ">=8.10.0" } }, + "node_modules/redis": { + "name": "@types/redis", + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/@types/redis/-/redis-4.0.11.tgz", + "integrity": "sha512-bI+gth8La8Wg/QCR1+V1fhrL9+LZUSWfcqpOj2Kc80ZQ4ffbdL173vQd5wovmoV9i071FU9oP2g6etLuEwb6Rg==", + "deprecated": "This is a stub types definition. redis provides its own type definitions, so you do not need this installed.", + "dev": true, + "dependencies": { + "redis": "*" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", diff --git a/package.json b/package.json index f3d289e..4870524 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@types/node": "^20.2.1", "nodemon": "^2.0.22", "prisma": "^4.14.1", + "redis": "npm:@types/redis@^4.0.11", "ts-node": "^10.9.1", "typescript": "^5.0.4" }, diff --git a/src/position.ts b/src/position.ts index 5c71031..e8aa8ec 100644 --- a/src/position.ts +++ b/src/position.ts @@ -12,6 +12,28 @@ router.get( }) ); +router.get( + "/top-winners", + errorChecked(async (req, res) => { + const usersWithGamesWon = await prisma.position.groupBy({ + by: ['userName'], + _sum: { + gamesWon: true, + prize: true + }, + orderBy: [ + { + _sum: { + gamesWon: 'desc' + } + } + ], + take: 20 + }); + res.status(200).json({ topWinners: usersWithGamesWon, ok: true }); + }) +); + router.post( "/", errorChecked(async (req, res) => { diff --git a/src/promotion.ts b/src/promotion.ts index dbe56d9..9d8adba 100644 --- a/src/promotion.ts +++ b/src/promotion.ts @@ -21,7 +21,7 @@ router.post( ); export interface RequestWithPromotionId extends Request { - promotionId: number; + promotionId: number; } router.use("/:id", async (req: RequestWithPromotionId, res, next) => { @@ -40,6 +40,42 @@ router.get( }) ); +router.get( + "/:id/listofwinners", + errorChecked(async (req: RequestWithPromotionId, res) => { + const currentDate = new Date(); + + const positions = await prisma.position.findMany({ + where: { + ranking: { + AND: [ + { + tournament: { + promotionId: req.promotionId, + }, + }, + { + startDate: { + lte: currentDate, + }, + }, + { + endDate: { + gte: currentDate, + }, + }, + ], + }, + }, + take: 20, + orderBy: { + position: "asc", + }, + }); + res.status(200).json({ listOfWinners: positions, ok: true }); + }) +); + router.put( "/:id", errorChecked(async (req: RequestWithPromotionId, res) => { @@ -61,4 +97,4 @@ router.delete( }) ); -export default router; \ No newline at end of file +export default router; From 725918a07a0dac2c74909b0ad16d979b51c6d842 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sun, 28 May 2023 11:00:22 +0200 Subject: [PATCH 19/23] adding new tests --- Insomnia/Endpoints_test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Insomnia/Endpoints_test.json b/Insomnia/Endpoints_test.json index 55c0349..b31884b 100644 --- a/Insomnia/Endpoints_test.json +++ b/Insomnia/Endpoints_test.json @@ -1 +1 @@ -{"_type":"export","__export_format":4,"__export_date":"2023-05-27T14:14:01.515Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_c415dab5014d4191bb4875d119d1f792","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685195922364,"created":1685195884107,"url":"localhost:3000/position","name":"Get all position","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884107,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_91f77097186b454baec9844098a12130","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685195876494,"created":1685195876494,"name":"Position","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685195876494,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_c5d94d77a32449aca6e7f1e97d5a848f","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196780407,"created":1685195927947,"url":"localhost:3000/position","name":"Create a new position","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"rankingId\":2,\n \"position\":1,\n \"userName\" :\"warydiaz\",\n \"gamesWon\" :129,\n \"prize\" : 50,\n \"partnerId\":3\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195884057,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ae4d1571ae7d4e5db5fc519a5a545dfb","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196520941,"created":1685196488045,"url":"localhost:3000/position/1","name":"Get position by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884007,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_d31768f6144f4effa994af118525ffe2","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196603457,"created":1685196525322,"url":"localhost:3000/position/1","name":"Update position by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"gamesWon\": 200,\n\t\"prize\": 10\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195883957,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_f06b0bf178c944468de39088f130ba0e","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196766104,"created":1685196626657,"url":"localhost:3000/position/2","name":"Delete Position by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195883907,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5019495e1cb04710884f348994327d9d","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685194989198,"created":1685194957591,"url":"localhost:3000/ranking","name":"Get all the rankings","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957591,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685194944148,"created":1685194944148,"name":"Ranking","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685194944148,"_type":"request_group"},{"_id":"req_8af2d58be9b34151bb8b983ffd23c62f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195270317,"created":1685195006526,"url":"localhost:3000/ranking","name":"Create a new Ranking","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"tournamentId\":1, \n \"startDate\": \"2023-05-01T00:00:00.000Z\",\n\t\"endDate\": \"2023-05-07T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957541,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_45ffd8b921a64933800891b7274fa048","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195335760,"created":1685195301241,"url":"localhost:3000/ranking/1","name":"Get ranking by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957491,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_7ee5427c82ab452cab39016a0633845f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195423240,"created":1685195345055,"url":"localhost:3000/ranking/1","name":"Update tounament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"endDate\": \"2023-05-10T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957441,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_10d0812099134acc82dac19f8dbc93fa","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195502443,"created":1685195442068,"url":"localhost:3000/ranking/1","name":"Delete Ranking by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957391,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184771710,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2023-01-01T00:00:00Z\", \n \"endDate\": \"2023-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184778252,"created":1685184586055,"url":"localhost:3000/tournament/1","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184823667,"created":1685184793932,"url":"localhost:3000/tournament/2","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file +{"_type":"export","__export_format":4,"__export_date":"2023-05-28T08:59:44.999Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_a758e1fc8b2f4e2da84b734e05ca4299","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685263508409,"created":1685263468558,"url":"localhost:3000/position/top-winners","name":"Get list of the top winners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685263468558,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_91f77097186b454baec9844098a12130","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685195876494,"created":1685195876494,"name":"Position","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685195876494,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_c415dab5014d4191bb4875d119d1f792","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685195922364,"created":1685195884107,"url":"localhost:3000/position","name":"Get all position","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884107,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c5d94d77a32449aca6e7f1e97d5a848f","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685263886266,"created":1685195927947,"url":"localhost:3000/position","name":"Create a new position","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\"rankingId\": 2,\n\t\"position\": 2,\n\t\"userName\": \"rolopez\",\n\t\"gamesWon\": 100,\n\t\"prize\": 50,\n\t\"partnerId\": 3\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195884057,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ae4d1571ae7d4e5db5fc519a5a545dfb","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196520941,"created":1685196488045,"url":"localhost:3000/position/1","name":"Get position by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884007,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_d31768f6144f4effa994af118525ffe2","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196603457,"created":1685196525322,"url":"localhost:3000/position/1","name":"Update position by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"gamesWon\": 200,\n\t\"prize\": 10\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195883957,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_f06b0bf178c944468de39088f130ba0e","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196766104,"created":1685196626657,"url":"localhost:3000/position/2","name":"Delete Position by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195883907,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5019495e1cb04710884f348994327d9d","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685194989198,"created":1685194957591,"url":"localhost:3000/ranking","name":"Get all the rankings","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957591,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685194944148,"created":1685194944148,"name":"Ranking","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685194944148,"_type":"request_group"},{"_id":"req_8af2d58be9b34151bb8b983ffd23c62f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195270317,"created":1685195006526,"url":"localhost:3000/ranking","name":"Create a new Ranking","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"tournamentId\":1, \n \"startDate\": \"2023-05-01T00:00:00.000Z\",\n\t\"endDate\": \"2023-05-07T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957541,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_45ffd8b921a64933800891b7274fa048","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195335760,"created":1685195301241,"url":"localhost:3000/ranking/1","name":"Get ranking by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957491,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_7ee5427c82ab452cab39016a0633845f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685262636332,"created":1685195345055,"url":"localhost:3000/ranking/2","name":"Update tounament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"endDate\": \"2023-05-31T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957441,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_10d0812099134acc82dac19f8dbc93fa","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195502443,"created":1685195442068,"url":"localhost:3000/ranking/1","name":"Delete Ranking by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957391,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184771710,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2023-01-01T00:00:00Z\", \n \"endDate\": \"2023-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184778252,"created":1685184586055,"url":"localhost:3000/tournament/1","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184823667,"created":1685184793932,"url":"localhost:3000/tournament/2","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b3d7783f07ee4f5eb87301c46a4023f5","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685262193557,"created":1685261186414,"url":"localhost:3000/promotion/1/listofwinners","name":"Get list of first 20th winners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685261186414,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file From 8e192a37daef8a6d58e92f4e1c9a2545d83d9c66 Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Mon, 29 May 2023 20:25:03 +0200 Subject: [PATCH 20/23] updating folder structure --- src/{ => db}/prisma-client.ts | 0 src/{ => routers}/partner.ts | 4 ++-- src/{ => routers}/position.ts | 4 ++-- src/{ => routers}/promotion.ts | 4 ++-- src/{ => routers}/ranking.ts | 4 ++-- src/{ => routers}/tournament.ts | 4 ++-- src/seed.ts | 2 +- src/server.ts | 13 +++++-------- 8 files changed, 16 insertions(+), 19 deletions(-) rename src/{ => db}/prisma-client.ts (100%) rename src/{ => routers}/partner.ts (94%) rename src/{ => routers}/position.ts (95%) rename src/{ => routers}/promotion.ts (96%) rename src/{ => routers}/ranking.ts (94%) rename src/{ => routers}/tournament.ts (94%) diff --git a/src/prisma-client.ts b/src/db/prisma-client.ts similarity index 100% rename from src/prisma-client.ts rename to src/db/prisma-client.ts diff --git a/src/partner.ts b/src/routers/partner.ts similarity index 94% rename from src/partner.ts rename to src/routers/partner.ts index 582bb27..e4b6923 100644 --- a/src/partner.ts +++ b/src/routers/partner.ts @@ -1,6 +1,6 @@ import { Request, Router } from "express"; -import prisma from "./prisma-client.js"; -import { errorChecked } from "./utils.js"; +import prisma from "../db/prisma-client.js"; +import { errorChecked } from "../utils.js"; const router = Router(); diff --git a/src/position.ts b/src/routers/position.ts similarity index 95% rename from src/position.ts rename to src/routers/position.ts index e8aa8ec..7f31a48 100644 --- a/src/position.ts +++ b/src/routers/position.ts @@ -1,6 +1,6 @@ import { Request, Router } from "express"; -import prisma from "./prisma-client.js"; -import { errorChecked } from "./utils.js"; +import prisma from "../db/prisma-client.js"; +import { errorChecked } from "../utils.js"; const router = Router(); diff --git a/src/promotion.ts b/src/routers/promotion.ts similarity index 96% rename from src/promotion.ts rename to src/routers/promotion.ts index 9d8adba..53b694e 100644 --- a/src/promotion.ts +++ b/src/routers/promotion.ts @@ -1,6 +1,6 @@ import { Request, Router } from "express"; -import prisma from "./prisma-client.js"; -import { errorChecked } from "./utils.js"; +import prisma from "../db/prisma-client.js"; +import { errorChecked } from "../utils.js"; const router = Router(); diff --git a/src/ranking.ts b/src/routers/ranking.ts similarity index 94% rename from src/ranking.ts rename to src/routers/ranking.ts index 37fc92a..36df79b 100644 --- a/src/ranking.ts +++ b/src/routers/ranking.ts @@ -1,6 +1,6 @@ import { Request, Router } from "express"; -import prisma from "./prisma-client.js"; -import { errorChecked } from "./utils.js"; +import prisma from "../db/prisma-client.js"; +import { errorChecked } from "../utils.js"; const router = Router(); diff --git a/src/tournament.ts b/src/routers/tournament.ts similarity index 94% rename from src/tournament.ts rename to src/routers/tournament.ts index c336fcd..022ad76 100644 --- a/src/tournament.ts +++ b/src/routers/tournament.ts @@ -1,6 +1,6 @@ import { Request, Router } from "express"; -import prisma from "./prisma-client.js"; -import { errorChecked } from "./utils.js"; +import prisma from "../db/prisma-client.js"; +import { errorChecked } from "../utils.js"; const router = Router(); diff --git a/src/seed.ts b/src/seed.ts index 46bfe69..543bcb4 100644 --- a/src/seed.ts +++ b/src/seed.ts @@ -1,4 +1,4 @@ -import prisma from "./prisma-client.js"; +import prisma from "./db/prisma-client.js"; const cyberbingo = await prisma.partner.create({ data: { diff --git a/src/server.ts b/src/server.ts index 506ca2a..abbabaf 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,14 +1,12 @@ import express from "express"; -import { ErrorRequestHandler } from "express"; import cors from "cors"; import morgan from "morgan"; import dotenv from "dotenv"; -import partnerRouter from "./partner.js"; -import promotionRouter from "./promotion.js" -import tournamentRouter from "./tournament.js" -import rankingtRouter from "./ranking.js" -import positionRouter from "./position.js" -import { defaultErrorHandler } from "./utils.js"; +import partnerRouter from "./routers/partner.js"; +import promotionRouter from "./routers/promotion.js" +import tournamentRouter from "./routers/tournament.js" +import rankingtRouter from "./routers/ranking.js" +import positionRouter from "./routers/position.js" //to use the file .env dotenv.config(); @@ -25,7 +23,6 @@ app.use("/tournament", tournamentRouter); app.use("/ranking", rankingtRouter); app.use("/position", positionRouter); - app.listen(process.env.SERVER_PORT,()=>{ console.log(`Tournament API listening on: ${process.env.SERVER_PORT}`); }) \ No newline at end of file From d7cf29030ca66cfc53258eb773805313e536db9c Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 3 Jun 2023 17:45:00 +0200 Subject: [PATCH 21/23] Adding new function that helps to format dates. Adding controls over ranking and tournament. --- src/routers/ranking.ts | 10 +++- src/routers/tournament.ts | 10 +++- src/utils.ts | 9 ++++ src/validators/date.ts | 102 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 4 deletions(-) create mode 100644 src/validators/date.ts diff --git a/src/routers/ranking.ts b/src/routers/ranking.ts index 36df79b..3fc9b14 100644 --- a/src/routers/ranking.ts +++ b/src/routers/ranking.ts @@ -1,6 +1,7 @@ import { Request, Router } from "express"; import prisma from "../db/prisma-client.js"; import { errorChecked } from "../utils.js"; +import {validateRankings} from "../validators/date.js" const router = Router(); @@ -15,8 +16,13 @@ router.get( router.post( "/", errorChecked(async (req, res) => { - const newRanking = await prisma.ranking.create({ data: req.body }); - res.status(200).json({ newRanking, ok: true }); + const isDataOk = await validateRankings(req); + if(isDataOk.ok){ + const newRanking = await prisma.ranking.create({ data: req.body }); + res.status(200).json({ newRanking, ok: true }); + }else{ + res.status(400).json({ error:isDataOk.error }); + } }) ); diff --git a/src/routers/tournament.ts b/src/routers/tournament.ts index 022ad76..39dd57b 100644 --- a/src/routers/tournament.ts +++ b/src/routers/tournament.ts @@ -1,6 +1,7 @@ import { Request, Router } from "express"; import prisma from "../db/prisma-client.js"; import { errorChecked } from "../utils.js"; +import {validateTournaments} from "../validators/date.js" const router = Router(); @@ -15,8 +16,13 @@ router.get( router.post( "/", errorChecked(async (req, res) => { - const newTournament = await prisma.tournament.create({ data: req.body }); - res.status(200).json({ newTournament, ok: true }); + const areDatesOK = validateTournaments(req); + if(areDatesOK.ok){ + const newTournament = await prisma.tournament.create({ data: req.body }); + res.status(200).json({ newTournament, ok: true }); + }else{ + res.status(400).json({ error:areDatesOK.error }); + } }) ); diff --git a/src/utils.ts b/src/utils.ts index 38d86b1..6e79007 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -15,4 +15,13 @@ export const errorChecked = (handler: RequestHandler): RequestHandler => { next(e); } } +} + +export const formaterDates = (date : Date) : string => { + const day = String(date.getDate()).padStart(2, '0'); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const year = date.getFullYear(); + const formattedDate = `${day}/${month}/${year}`; + + return formattedDate; } \ No newline at end of file diff --git a/src/validators/date.ts b/src/validators/date.ts new file mode 100644 index 0000000..06a624f --- /dev/null +++ b/src/validators/date.ts @@ -0,0 +1,102 @@ +import { Tournament } from "@prisma/client"; +import {formaterDates} from "../utils.js" +import prisma from "../db/prisma-client.js"; + +export const validateTournaments = (req: any): { ok: boolean, error?: string } => { + + const areEmpty = emptyDates(req); + + if(!areEmpty.ok){ + return areEmpty; + } + + const areGreaterThanToday = geraterThanToday(req); + + if(!areGreaterThanToday.ok){ + return areGreaterThanToday; + } + + return { + ok: true + }; + +}; + +export const validateRankings = async (req: any): Promise<{ ok: boolean, error?: string }> => { + const areEmpty = emptyDates(req); + + if(!areEmpty.ok){ + return areEmpty; + } + + const tournament = await getTournament(req.body.tournamentId); + + const areInBeteewn = validateDatesRankingInTournament(req, tournament); + + console.log(areInBeteewn); + + if(!areInBeteewn.ok){ + return areInBeteewn; + } + + return { + ok: true + }; +}; + +const emptyDates = (req: any): { ok: boolean, error?: string } => { + + if (req.body.startDate.length === 0 || req.body.endDate.length === 0) { + return { + ok: false, + error: "Date can not be empty" + }; + } + + return { + ok: true + }; +} + +const geraterThanToday = (req: any): { ok: boolean, error?: string } => { + const today = new Date(); + const startDate = new Date(req.body.startDate); + const endDate = new Date(req.body.endDate); + + if (startDate < today || endDate < today) { + return { + ok: false, + error: "Date must be greater or equal than today" + }; + } + + return { + ok: true + }; +} + +const getTournament = async (id: number) => { + const tournament = await prisma.tournament.findUnique({ + where: { id: id }, + }); + + return tournament; +} + +const validateDatesRankingInTournament = (req: any, tournament: any) : { ok: boolean, error?: string } => { + const startDateRanking = new Date(req.body.startDate); + const endDateRanking = new Date(req.body.endDate); + const startDateTournament = new Date(tournament.startDate); + const endDateTournament = new Date(tournament.endDate); + + if ((startDateRanking >= startDateTournament && startDateRanking <= endDateTournament) && (endDateRanking >= startDateTournament && endDateRanking <= endDateTournament)) { + return { + ok: true + }; + } + + return { + ok: false, + error: `The dates of the ranking must be in between ${formaterDates(startDateTournament)} and ${formaterDates(endDateTournament)}` + }; +} \ No newline at end of file From 2ca404184be58ce62ec184c88251922c6412b76b Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 3 Jun 2023 22:41:59 +0200 Subject: [PATCH 22/23] Adding .env file updating date files --- .env | 2 ++ .gitignore | 1 - src/validators/date.ts | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..9ea9548 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +DATABASE_URL="postgresql://admin:admin@localhost:5432/tournamentsdb?schema=public" +SERVER_PORT=3000 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 11ddd8d..2d238ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules # Keep environment variables out of version control -.env diff --git a/src/validators/date.ts b/src/validators/date.ts index 06a624f..09e92c1 100644 --- a/src/validators/date.ts +++ b/src/validators/date.ts @@ -1,4 +1,3 @@ -import { Tournament } from "@prisma/client"; import {formaterDates} from "../utils.js" import prisma from "../db/prisma-client.js"; @@ -33,8 +32,6 @@ export const validateRankings = async (req: any): Promise<{ ok: boolean, error?: const areInBeteewn = validateDatesRankingInTournament(req, tournament); - console.log(areInBeteewn); - if(!areInBeteewn.ok){ return areInBeteewn; } From f4d9c23445e952990e4c62ee4bfc9f90a94b177b Mon Sep 17 00:00:00 2001 From: Angel Diaz Date: Sat, 3 Jun 2023 22:45:39 +0200 Subject: [PATCH 23/23] adding more test --- Insomnia/Endpoints_test.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Insomnia/Endpoints_test.json b/Insomnia/Endpoints_test.json index b31884b..8464824 100644 --- a/Insomnia/Endpoints_test.json +++ b/Insomnia/Endpoints_test.json @@ -1 +1 @@ -{"_type":"export","__export_format":4,"__export_date":"2023-05-28T08:59:44.999Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_a758e1fc8b2f4e2da84b734e05ca4299","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685263508409,"created":1685263468558,"url":"localhost:3000/position/top-winners","name":"Get list of the top winners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685263468558,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_91f77097186b454baec9844098a12130","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685195876494,"created":1685195876494,"name":"Position","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685195876494,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_c415dab5014d4191bb4875d119d1f792","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685195922364,"created":1685195884107,"url":"localhost:3000/position","name":"Get all position","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884107,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c5d94d77a32449aca6e7f1e97d5a848f","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685263886266,"created":1685195927947,"url":"localhost:3000/position","name":"Create a new position","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\"rankingId\": 2,\n\t\"position\": 2,\n\t\"userName\": \"rolopez\",\n\t\"gamesWon\": 100,\n\t\"prize\": 50,\n\t\"partnerId\": 3\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195884057,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ae4d1571ae7d4e5db5fc519a5a545dfb","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196520941,"created":1685196488045,"url":"localhost:3000/position/1","name":"Get position by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884007,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_d31768f6144f4effa994af118525ffe2","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196603457,"created":1685196525322,"url":"localhost:3000/position/1","name":"Update position by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"gamesWon\": 200,\n\t\"prize\": 10\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195883957,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_f06b0bf178c944468de39088f130ba0e","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196766104,"created":1685196626657,"url":"localhost:3000/position/2","name":"Delete Position by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195883907,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5019495e1cb04710884f348994327d9d","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685194989198,"created":1685194957591,"url":"localhost:3000/ranking","name":"Get all the rankings","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957591,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685194944148,"created":1685194944148,"name":"Ranking","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685194944148,"_type":"request_group"},{"_id":"req_8af2d58be9b34151bb8b983ffd23c62f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195270317,"created":1685195006526,"url":"localhost:3000/ranking","name":"Create a new Ranking","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"tournamentId\":1, \n \"startDate\": \"2023-05-01T00:00:00.000Z\",\n\t\"endDate\": \"2023-05-07T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957541,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_45ffd8b921a64933800891b7274fa048","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195335760,"created":1685195301241,"url":"localhost:3000/ranking/1","name":"Get ranking by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957491,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_7ee5427c82ab452cab39016a0633845f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685262636332,"created":1685195345055,"url":"localhost:3000/ranking/2","name":"Update tounament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"endDate\": \"2023-05-31T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957441,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_10d0812099134acc82dac19f8dbc93fa","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195502443,"created":1685195442068,"url":"localhost:3000/ranking/1","name":"Delete Ranking by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957391,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184771710,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2023-01-01T00:00:00Z\", \n \"endDate\": \"2023-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184778252,"created":1685184586055,"url":"localhost:3000/tournament/1","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184823667,"created":1685184793932,"url":"localhost:3000/tournament/2","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b3d7783f07ee4f5eb87301c46a4023f5","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685262193557,"created":1685261186414,"url":"localhost:3000/promotion/1/listofwinners","name":"Get list of first 20th winners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685261186414,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file +{"_type":"export","__export_format":4,"__export_date":"2023-06-03T20:44:54.529Z","__export_source":"insomnia.desktop.app:v2023.2.0","resources":[{"_id":"req_a758e1fc8b2f4e2da84b734e05ca4299","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685263508409,"created":1685263468558,"url":"localhost:3000/position/top-winners","name":"Get list of the top winners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685263468558,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_91f77097186b454baec9844098a12130","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685195876494,"created":1685195876494,"name":"Position","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685195876494,"_type":"request_group"},{"_id":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","parentId":null,"modified":1683649833766,"created":1683649833766,"name":"New Document","description":"","scope":"design","_type":"workspace"},{"_id":"req_c415dab5014d4191bb4875d119d1f792","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685195922364,"created":1685195884107,"url":"localhost:3000/position","name":"Get all position","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884107,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c5d94d77a32449aca6e7f1e97d5a848f","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685263886266,"created":1685195927947,"url":"localhost:3000/position","name":"Create a new position","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\"rankingId\": 2,\n\t\"position\": 2,\n\t\"userName\": \"rolopez\",\n\t\"gamesWon\": 100,\n\t\"prize\": 50,\n\t\"partnerId\": 3\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195884057,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ae4d1571ae7d4e5db5fc519a5a545dfb","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196520941,"created":1685196488045,"url":"localhost:3000/position/1","name":"Get position by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195884007,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_d31768f6144f4effa994af118525ffe2","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196603457,"created":1685196525322,"url":"localhost:3000/position/1","name":"Update position by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"gamesWon\": 200,\n\t\"prize\": 10\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685195883957,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_f06b0bf178c944468de39088f130ba0e","parentId":"fld_91f77097186b454baec9844098a12130","modified":1685196766104,"created":1685196626657,"url":"localhost:3000/position/2","name":"Delete Position by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685195883907,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_5019495e1cb04710884f348994327d9d","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685194989198,"created":1685194957591,"url":"localhost:3000/ranking","name":"Get all the rankings","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957591,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685194944148,"created":1685194944148,"name":"Ranking","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685194944148,"_type":"request_group"},{"_id":"req_8af2d58be9b34151bb8b983ffd23c62f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685804903510,"created":1685195006526,"url":"localhost:3000/ranking","name":"Create a new Ranking","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n \"tournamentId\":1, \n \"startDate\": \"2024-05-01T00:00:00.000Z\",\n\t\"endDate\": \"2023-05-07T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957541,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_45ffd8b921a64933800891b7274fa048","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195335760,"created":1685195301241,"url":"localhost:3000/ranking/1","name":"Get ranking by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957491,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_7ee5427c82ab452cab39016a0633845f","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685262636332,"created":1685195345055,"url":"localhost:3000/ranking/2","name":"Update tounament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"endDate\": \"2023-05-31T23:59:59.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685194957441,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_10d0812099134acc82dac19f8dbc93fa","parentId":"fld_c4acb915ab3b4ba5ba81b7e0c4bb471a","modified":1685195502443,"created":1685195442068,"url":"localhost:3000/ranking/1","name":"Delete Ranking by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685194957391,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_6998f89bdaa74f65afb153446fbfc7b4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685183307994,"created":1685182768772,"url":"localhost:3000/tournament","name":"Get All the Tournament","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768772,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_d8bdf039469043acb4859177f6f947a3","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182757443,"created":1685182757443,"name":"Tournament","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685182757444,"_type":"request_group"},{"_id":"req_8724c2054979497ca78505fd053255be","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685803152956,"created":1685182850015,"url":"localhost:3000/tournament","name":"Create a new Tournament","description":"","method":"POST","body":{"mimeType":"application/json","text":"{ \n\t\"promotionId\": 1,\n \"startDate\": \"2024-01-30T00:00:00Z\", \n \"endDate\": \"2024-07-31T23:59:59Z\" \n}\n"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768747,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_a3bbce78721f4821a16e435392dd7133","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685788875125,"created":1685184586055,"url":"localhost:3000/tournament/5","name":"Get tournament by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768722,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_db2c961b54c34a78a6e1e26a7587c2f4","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685184845595,"created":1685184632030,"url":"localhost:3000/tournament/3","name":"Update tournament by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\n\t\"startDate\": \"2023-05-01T00:00:00.000Z\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685182768672,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_599fae1f7a9f4547922c4e30830c16a2","parentId":"fld_d8bdf039469043acb4859177f6f947a3","modified":1685789281183,"created":1685184793932,"url":"localhost:3000/tournament/7","name":"Delete tournament by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685182768622,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b3d7783f07ee4f5eb87301c46a4023f5","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685262193557,"created":1685261186414,"url":"localhost:3000/promotion/1/listofwinners","name":"Get list of first 20th winners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685261186414,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_5f4d1b015689493fbce4aa34c98dab9e","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685177890428,"created":1685177890428,"name":"Promotion","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1685177890428,"_type":"request_group"},{"_id":"req_1e51e284387e41dda6096b65c2906717","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179606979,"created":1685178086021,"url":"localhost:3000/promotion","name":"All the Promotions","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178086021,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_ba7df4a0d9a54a1fa431c3e9996fd1b9","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179611337,"created":1685178651409,"url":"localhost:3000/promotion","name":"Create a new Promotion","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"Bonus Mania\",\n \"url\": \"bonus-mania\",\n \"partnerId\":3 \n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085971,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_64144c38b1d44ad1b62fca8deba64bb6","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179677148,"created":1685179635219,"url":"localhost:3000/promotion/3","name":"Get Promotion by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085921,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_72220dcd2243492b83b430357dd0ce0a","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685179997801,"created":1685179908568,"url":"localhost:3000/promotion/3","name":"Update promtion by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n\t\"url\": \"/bonus-mania\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1685178085871,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_cd948d7551db47ef8ce49e59fd43ecad","parentId":"fld_5f4d1b015689493fbce4aa34c98dab9e","modified":1685180097036,"created":1685180061876,"url":"localhost:3000/promotion/3","name":"Delete promotion by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1685178085821,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_4f9433b8b3f147ecb15856fd11743b3f","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175655123,"created":1683649833771,"url":"localhost:3000/partner","name":"All the partners","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967258.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"fld_01e755aae2204fa39b632d8dba642733","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1684996678421,"created":1684996678421,"name":"Partner","description":"","environment":{},"environmentPropertyOrder":null,"metaSortKey":-1684996678421,"_type":"request_group"},{"_id":"req_c30996258ca4447fbacda2aac05f2d34","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685175935085,"created":1685175666529,"url":"localhost:3000/partner","name":"Create Partner","description":"","method":"POST","body":{"mimeType":"application/json","text":"{\n\t\"name\":\"edybet\",\n\t\"url\":\"www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967208.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_2df48ce2f0af481e831d1f216776b7da","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685177820690,"created":1685176012611,"url":"localhost:3000/partner/6","name":"Get partner by ID","description":"","method":"GET","body":{},"parameters":[],"headers":[{"id":"pair_1bdd72a6a547485bb9511e0638d1b4cd","name":"id","value":"3","description":"","disabled":true}],"authentication":{},"metaSortKey":-1684659967158.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_b0af0b9828864b598421ad7a2dbd52ae","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180039034,"created":1685177092424,"url":"localhost:3000/partner/5","name":"Update partner by ID","description":"","method":"PUT","body":{"mimeType":"application/json","text":"{\n \"url\": \"https:\\\\www.edybet.com\"\n}"},"parameters":[],"headers":[{"name":"Content-Type","value":"application/json"}],"authentication":{},"metaSortKey":-1684659967108.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"req_c3ac997c3f784a34a89dffd41f4f52c1","parentId":"fld_01e755aae2204fa39b632d8dba642733","modified":1685180056123,"created":1685177771585,"url":"localhost:3000/partner/5","name":"Delete partner by ID","description":"","method":"DELETE","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1684659967058.5,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global","_type":"request"},{"_id":"env_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833769,"created":1683649833769,"name":"Base Environment","data":{},"dataPropertyOrder":null,"color":null,"isPrivate":false,"metaSortKey":1683649833769,"_type":"environment"},{"_id":"jar_e55203d0c0c1b122f60e1a6db2eb939569ccf185","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833770,"created":1683649833770,"name":"Default Jar","cookies":[],"_type":"cookie_jar"},{"_id":"spc_91ce3bd29b224cb8b22124922a34ad03","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1685182671531,"created":1683649833767,"fileName":"Endpoints test","contents":"","contentType":"yaml","_type":"api_spec"},{"_id":"uts_85ee58a9146749ea99b65d4c0b6cef8d","parentId":"wrk_1f3db86dcce74f64a61b7ff9bd47f0e5","modified":1683649833772,"created":1683649833772,"name":"Example Test Suite","_type":"unit_test_suite"}]} \ No newline at end of file