{"info":{"_postman_id":"4ee4afb2-0daf-4a9f-9698-294c28fb18f0","name":"Magnalense","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"15748545","collectionId":"4ee4afb2-0daf-4a9f-9698-294c28fb18f0","publishedId":"2s9YsFCtBn","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-01-02T10:48:12.000Z"},"item":[{"name":"Admin","item":[{"name":"Products","item":[{"name":"Create product","id":"f6a60bcc-a60e-4d74-be41-8fc1bca7ec66","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"Olamides glasses\",\r\n    \"price\": 29.99,\r\n    \"image\": \"random_image.jpg\",\r\n    \"otherImages\": [\r\n        \"image2.jpg\",\r\n        \"image3.jpg\"\r\n    ],\r\n    \"description\": \"This is a random product description.\",\r\n    \"prescription\": {\r\n        \"leftEye\": 2.75,\r\n        \"rightEye\": 3.0\r\n    },\r\n    \"quantity\": \"10\",\r\n    \"category\": \"Medicated Glasses\",\r\n    \"frameMaterial\": \"Wood\",\r\n    \"color\": \"Silver\",\r\n    \"lensMaterial\": \"Glass\"\r\n    //   \"rating\": [\r\n    //     {\r\n    //       \"user\": \"6586eafb5b584686e45777f5\",  \r\n    //       \"rating\": 4.5,\r\n    //       \"comment\": \"Random comment about the product.\"\r\n    //     }\r\n    //   ]\r\n}","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/products","description":"<h2 id=\"create-product\">Create Product</h2>\n<h4 id=\"endpoint\">Endpoint</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST {{host}}/products\n\n</code></pre><h4 id=\"description\">Description</h4>\n<p>Create a new product.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p><strong>Method:</strong> <code>POST</code></p>\n</li>\n<li><p><strong>URL:</strong> {{host}}/products</p>\n</li>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n<li><code>Authorization: Required</code></li>\n</ul>\n</li>\n</ul>\n<h4 id=\"body\">Body</h4>\n<ul>\n<li><strong>Format:</strong> JSON</li>\n<li><strong>Required Fields:</strong><ul>\n<li><code>title</code> (string): Title of the product.</li>\n<li><code>price</code> (number): Price of the product.</li>\n<li><code>description</code> (string): Description of the product.</li>\n<li><code>category</code> (string): Category of the product.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">POST http://your-api-base-url/products\nHeaders:\n  Content-Type: application/json\n  Authorization: Bearer YOUR_ACCESS_TOKEN\nBody:\n{\n  \"title\": \"RayBans\",\n  \"price\": 99.99,\n  \"description\": \"High-quality sunglasses\",\n  \"category\": \"Sunglasses\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><strong>Status Codes:</strong><ul>\n<li><code>201 Created</code>: Product successfully created.</li>\n<li><code>400 Bad Request</code>: Required fields are missing or empty.</li>\n<li><code>500 Internal Server Error</code>: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"title\": \"Random Product 2\",\n    \"price\": 29.99,\n    \"image\": \"random_image.jpg\",\n    \"otherImages\": [\n        \"image2.jpg\",\n        \"image3.jpg\"\n    ],\n    \"description\": \"This is a random product description.\",\n    \"prescription\": [\n        {\n            \"leftEye\": 2.75,\n            \"rightEye\": 3,\n            \"_id\": \"65873bcbdaf66a02aa9d938b\"\n        }\n    ],\n    \"quantity\": \"10\",\n    \"category\": \"Medicated Glasses\",\n    \"frameMaterial\": \"Wood\",\n    \"color\": \"Silver\",\n    \"lensMaterial\": \"Glass\",\n    \"rating\": [],\n    \"_id\": \"65873bcbdaf66a02aa9d938a\",\n    \"createdAt\": \"2023-12-23T19:58:03.834Z\",\n    \"updatedAt\": \"2023-12-23T19:58:03.834Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n<h4 id=\"error-response\">Error Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Required fields must not be empty\"\n}\n\n</code></pre>\n","urlObject":{"path":["products"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f6a60bcc-a60e-4d74-be41-8fc1bca7ec66"},{"name":"Delete Product","id":"f68ffd3d-59e8-4cf8-9855-f64d43f230ae","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{mangalenseHost}}/products/659137adaac8b6c25e4bd441","description":"<h2 id=\"delete-a-product\">Delete a Product</h2>\n<h4 id=\"endpoint\">Endpoint</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>DELETE {{host}}/products/:id\n\n</code></pre><h4 id=\"description\">Description</h4>\n<p>Delete an existing product.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p><strong>Method:</strong> <code>DELETE</code></p>\n</li>\n<li><p><strong>URL:</strong> <code>http://your-api-base-url/products/:id</code></p>\n</li>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><code>Authorization: Required</code></li>\n</ul>\n</li>\n</ul>\n<h4 id=\"url-parameters\">URL Parameters</h4>\n<ul>\n<li><code>id</code> (string): Product ID (required)</li>\n</ul>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">DELETE http://your-api-base-url/api/products/65873b69daf66a02aa9d9380\nHeaders:\n  Authorization: Bearer YOUR_ACCESS_TOKEN\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><strong>Status Codes:</strong><ul>\n<li><code>200 OK</code>: Product successfully deleted.</li>\n<li><code>400 Bad Request</code>: Product ID is missing or empty.</li>\n<li><code>404 Not Found</code>: Product not found.</li>\n<li><code>500 Internal Server Error</code>: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Product deleted successfully\"\n}\n\n</code></pre>\n<h4 id=\"error-response\">Error Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Product ID is required\"\n}\n\n</code></pre>\n","urlObject":{"path":["products","659137adaac8b6c25e4bd441"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f68ffd3d-59e8-4cf8-9855-f64d43f230ae"},{"name":"Update Product","id":"4eceded5-6406-4432-b53d-3275afacc609","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"olamides sunglasses glasses\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/products/659300cb8f6a95c1344cec36","description":"<h2 id=\"update-a-product\">Update a Product</h2>\n<h4 id=\"endpoint\">Endpoint</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>PUT {{host}}/products/:id\n\n</code></pre><h4 id=\"description\">Description</h4>\n<p>Update an existing product.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p><strong>Method:</strong> <code>PUT</code></p>\n</li>\n<li><p><strong>URL:</strong> <code>http://your-api-base-url/products/:id</code></p>\n</li>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n<li><code>Authorization: Required</code></li>\n</ul>\n</li>\n</ul>\n<h4 id=\"url-parameters\">URL Parameters</h4>\n<ul>\n<li><code>id</code> (string): Product ID (required)</li>\n</ul>\n<h4 id=\"body\">Body</h4>\n<ul>\n<li><strong>Format:</strong> JSON</li>\n<li><strong>Optional Fields:</strong><ul>\n<li><code>title</code> (string): Title of the product.</li>\n<li><code>price</code> (number): Price of the product.</li>\n<li><code>description</code> (string): Description of the product.</li>\n<li><code>category</code> (string): Category of the product.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">PUT http://your-api-base-url/api/products/65873b69daf66a02aa9d9380\nHeaders:\n  Content-Type: application/json\n  Authorization: Bearer YOUR_ACCESS_TOKEN\nBody:\n{\n  \"title\": \"Updated RayBans\",\n  \"price\": 129.99,\n  \"description\": \"Updated high-quality sunglasses\",\n  \"category\": \"Sunglasses\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><strong>Status Codes:</strong><ul>\n<li><code>200 OK</code>: Product successfully updated.</li>\n<li><code>400 Bad Request</code>: Product ID is missing or empty.</li>\n<li><code>404 Not Found</code>: Product not found.</li>\n<li><code>500 Internal Server Error</code>: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"_id\": \"65873b69daf66a02aa9d9380\",\n  \"title\": \"Updated RayBans\",\n  \"price\": 129.99,\n  \"image\": \"raybans_image.jpg\",\n  \"otherImages\": [\"image2.jpg\", \"image3.jpg\"],\n  \"description\": \"Updated high-quality sunglasses\",\n  \"prescription\": [],\n  \"quantity\": null,\n  \"category\": \"Sunglasses\",\n  \"frameMaterial\": null,\n  \"color\": null,\n  \"lensMaterial\": null,\n  \"rating\": [],\n  \"createdAt\": \"2023-12-23T19:56:25.837Z\",\n  \"updatedAt\": \"2023-12-23T20:12:34.567Z\",\n  \"__v\": 0\n}\n\n</code></pre>\n<h4 id=\"error-response\">Error Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Product ID is required\"\n}\n\n</code></pre>\n","urlObject":{"path":["products","659300cb8f6a95c1344cec36"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"4eceded5-6406-4432-b53d-3275afacc609"}],"id":"c6c98b83-52ae-4516-b734-d46e08b9f38f","description":"<h3 id=\"admin-endpoints\">Admin Endpoints</h3>\n<p>This folder manages administrative actions for products:</p>\n<ol>\n<li><p><strong>Create Product</strong></p>\n<ul>\n<li><p><code>POST /products</code></p>\n</li>\n<li><p>Create a new product.</p>\n</li>\n<li><p><strong>Authorization:</strong> Required</p>\n</li>\n<li><p><strong>Example Request:</strong> <code>POST /products</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Update Product</strong></p>\n<ul>\n<li><p><code>PUT /products/:id</code></p>\n</li>\n<li><p>Update an existing product.</p>\n</li>\n<li><p><strong>Authorization:</strong> Required</p>\n</li>\n<li><p><strong>Example Request:</strong> <code>PUT /products/ID</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Delete Product</strong></p>\n<ul>\n<li><p><code>DELETE /products/:id</code></p>\n</li>\n<li><p>Delete an existing product.</p>\n</li>\n<li><p><strong>Authorization:</strong> Required</p>\n</li>\n<li><p><strong>Example Request:</strong> <code>DELETE /products/ID</code></p>\n</li>\n</ul>\n</li>\n</ol>\n","_postman_id":"c6c98b83-52ae-4516-b734-d46e08b9f38f"},{"name":"Authentication","item":[{"name":"Register","id":"09efdf40-d83d-4905-b524-ef44bc067ae5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"tosiron jegede\",\r\n    \"email\":\"adminnnn@gmail.com\",\r\n    \"password\":\"1234567\"\r\n\r\n\r\n}","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/admin/register","description":"<h3 id=\"register-user\">Register User</h3>\n<h3 id=\"register-admin\"><strong>Register Admin</strong></h3>\n<p><strong>Endpoint:</strong> <code>POST /admin/register</code></p>\n<p><strong>Description:</strong> Registers a new admin.</p>\n<p><strong>Request:</strong></p>\n<ul>\n<li><strong>Method:</strong> POST</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"name\": \"John Doe\",\n    \"email\":\"JohnDoeeeee@gmail.com\",\n    \"password\":\"1234567\"\n}\n\n</code></pre>\n<p><strong>Responses:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"user\": {\n    \"_id\": \"user_id\",\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\",\n    \"role\": \"admin\"\n  },\n  \"token\": \"admin_token\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"error\": \"Please provide name, email, and password\"}\n\n</code></pre>\n<p>500 Internal Server Error: Server error occurred</p>\n<p><code>POST /admin/register</code></p>\n","urlObject":{"path":["admin","register"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"09efdf40-d83d-4905-b524-ef44bc067ae5"},{"name":"Login","id":"e107b7dc-3c75-4c94-8de3-1b639fa0c4a6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{ \r\n    \"email\":\"adminnn@gmail.com\",\r\n    \"password\":\"1234567\"\r\n }","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/admin/login","description":"<h3 id=\"login-admin\">Login Admin</h3>\n<ul>\n<li><strong>Endpoint:</strong> <code>POST /admin/login</code></li>\n<li><strong>Description:</strong> Logs in an existing admin.</li>\n<li><strong>Request:</strong></li>\n</ul>\n<p><strong>Method:</strong> POST</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{ \n\"email\":\"JohnDoeee@gmail.com\",\n\"password\":\"1234567\"\n }\n\n</code></pre>\n<p><strong>Responses:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"user\": {\n    \"_id\": \"user_id\",\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\",\n    \"role\": \"admin\"\n  },\n  \"token\": \"admin_token\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"error\": \"Admin account does not exist\"   // or  \"error\": \"You are currently suspended, Please contact the admin\"\n\n</code></pre>\n<p>500 Internal Server Error: Server error occurred</p>\n<p><code>POST /admin/login</code></p>\n","urlObject":{"path":["admin","login"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e107b7dc-3c75-4c94-8de3-1b639fa0c4a6"},{"name":"Logout","id":"b22d5a77-92da-42c1-94b1-dcea1c5f7062","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/admin/logout","description":"<h3 id=\"logout-admin\">Logout Admin</h3>\n<p><strong>Endpoint:</strong> <code>GET /admin/logout</code></p>\n<p><strong>Description:</strong> Logs out the authenticated user.</p>\n<p><strong>Request:</strong></p>\n<ul>\n<li><p><strong>Method:</strong> GET</p>\n</li>\n<li><p><strong>Auth:</strong> Required</p>\n</li>\n</ul>\n<p><strong>Responses:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"message\": \"Logout successful\"}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\"> {  \"error\": \"User not found\"}\n\n</code></pre>\n<p>500 Internal Server Error: Server error occurred</p>\n<p><code>GET /admin/logout</code></p>\n","urlObject":{"path":["admin","logout"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b22d5a77-92da-42c1-94b1-dcea1c5f7062"}],"id":"e88ec3a1-702f-4f12-af6d-c2b04b6a3642","description":"<h2 id=\"authentication-endpoints\">Authentication Endpoints</h2>\n<p>This folder manages admin authentication actions.</p>\n<ol>\n<li><p>POST /admin/register</p>\n<ul>\n<li><strong>Endpoint:</strong> <code>POST /admin/register</code></li>\n<li><strong>Auth:</strong> Not Required</li>\n<li><strong>Description:</strong> Registers a new admin.</li>\n</ul>\n</li>\n<li><p>POST /admin/login</p>\n<ul>\n<li><strong>Endpoint:</strong> <code>POST /admin/login</code></li>\n<li><strong>Auth:</strong> Not Required</li>\n<li><strong>Description:</strong> Logs in an existing admin.</li>\n</ul>\n</li>\n<li><p>GET /admin/logout</p>\n<ul>\n<li><strong>Endpoint:</strong> <code>GET /admin/logout</code></li>\n<li><strong>Auth:</strong> Required</li>\n<li><strong>Description:</strong> Logs out the authenticated admin.</li>\n</ul>\n</li>\n</ol>\n","_postman_id":"e88ec3a1-702f-4f12-af6d-c2b04b6a3642"},{"name":"Users","item":[{"name":"Get all users","id":"6fb06aee-f665-4027-810d-bbc380c7f5b1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/admin/view-users","description":"<h3 id=\"view-all-users\"><strong>View All Users</strong></h3>\n<p><strong>Endpoint:</strong> GET /admin/view-users</p>\n<p><strong>Auth:</strong> Required (Admin)</p>\n<p><strong>Description:</strong> Retrieve a list of all users.</p>\n<p><strong>Example Request:</strong> <code>GET /admin/view-users</code></p>\n<p><strong>Response Status Codes:</strong></p>\n<ul>\n<li>200 OK: Successful request.</li>\n<li>500 Internal Server Error: An error occurred on the server.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"success\": true,\n    \"users\": [\n        {\n            \"cart\": [],\n            \"_id\": \"658dc1f2e23845c24a7f1dba\",\n            \"name\": \"John Doe\",\n            \"email\": \"JohnDoe@gmail.com\",\n            \"isSuspended\": true,\n            \"role\": \"user\",\n            \"createdAt\": \"2023-12-28T18:44:02.251Z\",\n            \"updatedAt\": \"2024-01-01T18:18:14.985Z\",\n            \"__v\": 0\n        },\n        {\n            \"cart\": [],\n            \"_id\": \"659133bcf6ae7365ecb92823\",\n            \"name\": \"John Doe\",\n            \"email\": \"JohnDoee@gmail.com\",\n            \"isSuspended\": false,\n            \"role\": \"user\",\n            \"createdAt\": \"2023-12-31T09:26:20.564Z\",\n            \"updatedAt\": \"2024-01-01T18:24:33.938Z\",\n            \"__v\": 0\n        }\n    ]\n}\n\n</code></pre>\n","urlObject":{"path":["admin","view-users"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6fb06aee-f665-4027-810d-bbc380c7f5b1"},{"name":"Suspend user","id":"ca4969e4-18e7-430c-861e-d125130f32e5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"url":"{{mangalenseHost}}/admin/suspend-user/658dc1f2e23845c24a7f1dba","description":"<h3 id=\"toggle-suspension\"><strong>Toggle Suspension</strong></h3>\n<p><strong>Endpoint:</strong> PATCH /admin/suspend-user/:userId</p>\n<p><strong>Auth:</strong> Required (Admin)</p>\n<p><strong>Description:</strong> Suspend or unsuspend a user.</p>\n<p><strong>Example Request:</strong> <code>PATCH /admin/suspend-user/65873b69daf66a02aa9d9380</code></p>\n<p><strong>Response Status Codes:</strong></p>\n<ul>\n<li><p>200 OK: Successful request.</p>\n</li>\n<li><p>500 Internal Server Error: An error occurred on the server.</p>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n \"success\": true,\n \"msg\": \"User suspended successfully\"\n}\n</code></pre>\n","urlObject":{"path":["admin","suspend-user","658dc1f2e23845c24a7f1dba"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ca4969e4-18e7-430c-861e-d125130f32e5"},{"name":"Get single user","id":"4d20cef0-0c0e-4130-b4e7-4da2b4e02c90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/admin/view-single-user/658dc1f2e23845c24a7f1dba","description":"<h3 id=\"view-single-user\"><strong>View Single User</strong></h3>\n<p><strong>Endpoint:</strong> GET /admin/view-single-user/:userId</p>\n<p><strong>Auth:</strong> Required (Admin)</p>\n<p><strong>Description:</strong> Retrieve details of a specific user.</p>\n<p><strong>Example Request:</strong> <code>GET /admin/view-single-user/65873b69daf66a02aa9d9380</code></p>\n<p><strong>Response Status Codes:</strong></p>\n<ul>\n<li>200 OK: Successful request.</li>\n<li>500 Internal Server Error: An error occurred on the server.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\"> {\n    \"success\": true,\n    \"user\": {\n        \"cart\": [],\n        \"_id\": \"658dc1f2e23845c24a7f1dba\",\n        \"name\": \"John Doe\",\n        \"email\": \"JohnDoe@gmail.com\",\n        \"isSuspended\": true,\n        \"role\": \"user\",\n        \"createdAt\": \"2023-12-28T18:44:02.251Z\",\n        \"updatedAt\": \"2024-01-01T18:18:14.985Z\",\n        \"__v\": 0\n    }\n}\n</code></pre>\n","urlObject":{"path":["admin","view-single-user","658dc1f2e23845c24a7f1dba"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"4d20cef0-0c0e-4130-b4e7-4da2b4e02c90"}],"id":"123d1a3a-b810-4eb3-a21c-a36cc06d4562","description":"<h3 id=\"admin-endpoints\">Admin Endpoints</h3>\n<p>This folder manages administrative actions for existing users:</p>\n<ul>\n<li><strong>View All Users</strong><ul>\n<li><strong>Endpoint:</strong> GET /admin/view-users</li>\n<li><strong>Auth:</strong> Required (Admin)</li>\n<li><strong>Description:</strong> Retrieve a list of all users.</li>\n</ul>\n</li>\n<li><strong>View Single User</strong><ul>\n<li><strong>Endpoint:</strong> GET /admin/view-single-user/:userId</li>\n<li><strong>Auth:</strong> Required (Admin)</li>\n<li><strong>Description:</strong> Retrieve details of a specific user.</li>\n</ul>\n</li>\n<li><strong>Toggle Suspension</strong><ul>\n<li><strong>Endpoint:</strong> PATCH /admin/suspend-user/:userId</li>\n<li><strong>Auth:</strong> Required (Admin)</li>\n<li><strong>Description:</strong> Suspend or unsuspend a user.</li>\n</ul>\n</li>\n</ul>\n<p>These endpoints enable admin-specific actions like viewing all users, retrieving details of a single user, and suspending/unsuspending users .</p>\n","_postman_id":"123d1a3a-b810-4eb3-a21c-a36cc06d4562"}],"id":"397a00e5-092c-47ac-9e5e-9a66beaf71ef","description":"<p>This folder contains the authentication-related endpoints for admin authentication, products, and user management</p>\n","_postman_id":"397a00e5-092c-47ac-9e5e-9a66beaf71ef"},{"name":"User","item":[{"name":"Products","item":[{"name":"Get all products","id":"99974ce2-a4c9-4db8-ba87-8902b944a8a1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/products","description":"<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET {{host}}/products\n\n</code></pre><h3 id=\"description\">Description</h3>\n<p>Get a list of products based on the specified search criteria.</p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li><p><strong>Query Parameters:</strong></p>\n<ul>\n<li><p><code>title</code> (string): Title of the product. (Optional)</p>\n</li>\n<li><p><code>color</code> (string): Color of the product. (Optional)</p>\n</li>\n<li><p><code>frameMaterial</code> (string): Frame material of the product. (Optional)</p>\n</li>\n<li><p><code>lensMaterial</code> (string): Lens material of the product. (Optional)</p>\n</li>\n<li><p><code>category</code> (string): Category of the product. (Optional)</p>\n</li>\n<li><p><code>page</code> (number): Page number for pagination (Optional, default is 1)</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"authentication\">Authentication</h4>\n<p>This endpoint requires authentication. The user must be logged in to access it.</p>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET http://your-api-base-url/products?title=RayBans&amp;color=yourColor&amp;Wood=yourFrameMaterial&amp;lensMaterial=Glass&amp;category=Sunglasses\n\n</code></pre><h4 id=\"response\">Response</h4>\n<ul>\n<li><strong>Status Codes:</strong><ul>\n<li><code>200 OK</code>: Successful request.</li>\n<li><code>500 Internal Server Error</code>: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"Number of Products\": 1,\n    \"products\": [\n        {\n            \"_id\": \"65873b69daf66a02aa9d9380\",\n            \"title\": \"Random Product 2\",\n            \"price\": 29.99,\n            \"image\": \"random_image.jpg\",\n            \"otherImages\": [\n                \"image2.jpg\",\n                \"image3.jpg\"\n            ],\n            \"description\": \"This is a random product description.\",\n            \"prescription\": [\n                {\n                    \"leftEye\": 2.75,\n                    \"rightEye\": 3,\n                    \"_id\": \"65873b69daf66a02aa9d9381\"\n                }\n            ],\n            \"quantity\": \"10\",\n            \"category\": \"Medicated Glasses\",\n            \"frameMaterial\": \"Wood\",\n            \"color\": \"Black\",\n            \"lensMaterial\": \"Glass\",\n            \"rating\": [],\n            \"createdAt\": \"2023-12-23T19:56:25.837Z\",\n            \"updatedAt\": \"2023-12-23T19:56:25.837Z\",\n            \"__v\": 0\n        }\n    ]\n}\n\n</code></pre>\n","urlObject":{"path":["products"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"99974ce2-a4c9-4db8-ba87-8902b944a8a1"},{"name":"Get single product","id":"e8a85eb4-b944-4133-baf5-3c7dcd8b5863","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/products/659145c93f58e5d4d4dfcbfb","description":"<h3 id=\"get-single-product\">Get Single Product</h3>\n<h4 id=\"description\">Description</h4>\n<p>Get details of a single product by ID.</p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li>Path Parameters:<ul>\n<li><code>id</code> (string): Product ID.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"authentication\">Authentication</h4>\n<p>This endpoint requires authentication. The user must be logged in to access it.</p>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET http://your-api-base-url/products/:id\n\n</code></pre><h4 id=\"response\">Response</h4>\n<ul>\n<li>Status Codes:<ul>\n<li>200 OK: Successful request.</li>\n<li>400 Bad Request: Product ID is required.</li>\n<li>404 Not Found: Product not found.</li>\n<li>500 Internal Server Error: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"65873b69daf66a02aa9d9380\",\n    \"title\": \"Random Product 2\",\n    \"price\": 29.99,\n    \"image\": \"random_image.jpg\",\n    \"otherImages\": [\n        \"image2.jpg\",\n        \"image3.jpg\"\n    ],\n    \"description\": \"This is a random product description.\",\n    \"prescription\": [\n        {\n            \"leftEye\": 2.75,\n            \"rightEye\": 3,\n            \"_id\": \"65873b69daf66a02aa9d9381\"\n        }\n    ],\n    \"quantity\": \"10\",\n    \"category\": \"Medicated Glasses\",\n    \"frameMaterial\": \"Wood\",\n    \"color\": \"Black\",\n    \"lensMaterial\": \"Glass\",\n    \"rating\": [],\n    \"createdAt\": \"2023-12-23T19:56:25.837Z\",\n    \"updatedAt\": \"2023-12-23T19:56:25.837Z\",\n    \"__v\": 0\n}\n\n</code></pre>\n","urlObject":{"path":["products","659145c93f58e5d4d4dfcbfb"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e8a85eb4-b944-4133-baf5-3c7dcd8b5863"}],"id":"da47d665-dec3-4579-97c2-e6989cd37b0a","description":"<h3 id=\"user-endpoints\">User Endpoints</h3>\n<p>This folder manages User actions for products:</p>\n<ol>\n<li><strong>Get All Products</strong><ul>\n<li><code>Get /products</code></li>\n<li>fetches all existing products.</li>\n<li><strong>Authorization:</strong> Not-Required</li>\n<li><strong>Example Request:</strong> <code>Get/products</code></li>\n</ul>\n</li>\n<li><strong>Get Single Product</strong><ul>\n<li><code>Get /products/:id</code></li>\n<li>fetches a product with the given ID.</li>\n<li><strong>Authorization:</strong> Required</li>\n<li><strong>Example Request:</strong> <code>Get/products/:id</code></li>\n</ul>\n</li>\n</ol>\n","_postman_id":"da47d665-dec3-4579-97c2-e6989cd37b0a"},{"name":"Authentication","item":[{"name":"Register","id":"b2f3f297-f4a4-4a90-98b9-f194e381be14","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"John Doe\",\r\n    \"email\":\"JohnDoeeeee@gmail.com\",\r\n    \"password\":\"1234567\"\r\n\r\n\r\n}","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/user/register","description":"<h3 id=\"register-user\">Register User</h3>\n<p><strong>Endpoint:</strong> <code>POST /user/register</code></p>\n<p><strong>Description:</strong> Registers a new user.</p>\n<p><strong>Request:</strong></p>\n<ul>\n<li><strong>Method:</strong> POST</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"name\": \"John Doe\",\n    \"email\":\"JohnDoeeeee@gmail.com\",\n    \"password\":\"1234567\"\n\n\n}\n\n</code></pre>\n<p><strong>Responses:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"user\": {\n    \"_id\": \"user_id\",\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\",\n    \"role\": \"user\",\n    \"isSuspended\": false\n  },\n  \"token\": \"user_token\"\n}\n\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"error\": \"Please provide name, email, and password\"}\n\n</code></pre>\n<p>500 Internal Server Error: Server error occurred</p>\n<p><code>POST /user/register</code></p>\n","urlObject":{"path":["user","register"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b2f3f297-f4a4-4a90-98b9-f194e381be14"},{"name":"Login","id":"a6387cab-1f9e-4435-8473-f8f8b158acec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{ \r\n\"email\":\"JohnDoeee@gmail.com\",\r\n\"password\":\"1234567\"\r\n }","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/user/login","description":"<h3 id=\"login-user\">Login User</h3>\n<ul>\n<li><strong>Endpoint:</strong> <code>POST /user/login</code></li>\n<li><strong>Description:</strong> Logs in an existing user.</li>\n<li><strong>Request:</strong></li>\n</ul>\n<p><strong>Method:</strong> POST</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{ \n\"email\":\"JohnDoeee@gmail.com\",\n\"password\":\"1234567\"\n }\n\n</code></pre>\n<p><strong>Responses:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"user\": {\n    \"_id\": \"user_id\",\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\",\n    \"role\": \"user\",\n    \"isSuspended\": false\n  },\n  \"token\": \"user_token\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"error\": \"User does not exist\"   // or  \"error\": \"You are currently suspended, Please contact the admin\"\n\n</code></pre>\n<p>500 Internal Server Error: Server error occurred</p>\n<p><code>POST /user/login</code></p>\n","urlObject":{"path":["user","login"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a6387cab-1f9e-4435-8473-f8f8b158acec"},{"name":"Logout","id":"59acc49f-6b32-44c1-af7b-b910255774af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/user/logout","description":"<h3 id=\"logout-user\">Logout User</h3>\n<p><strong>Endpoint:</strong> <code>GET /user/logout</code></p>\n<p><strong>Description:</strong> Logs out the authenticated user.</p>\n<p><strong>Request:</strong></p>\n<ul>\n<li><strong>Method:</strong> GET</li>\n<li><strong>Auth:</strong> Required</li>\n</ul>\n<p><strong>Responses:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{  \"message\": \"Logout successful\"}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\"> {  \"error\": \"User not authenticated\"}\n\n</code></pre>\n<p>500 Internal Server Error: Server error occurred</p>\n<p><code>GET /user/logout</code></p>\n","urlObject":{"path":["user","logout"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"59acc49f-6b32-44c1-af7b-b910255774af"}],"id":"b7aba4ac-bcc0-4c31-81a6-f808f171e118","description":"<h2 id=\"authentication-endpoints\">Authentication Endpoints</h2>\n<p>This folder manages user authentication actions.</p>\n<ol>\n<li><p>POST /admin/register</p>\n<ul>\n<li><p><strong>Endpoint:</strong> <code>POST /user/register</code></p>\n</li>\n<li><p><strong>Auth:</strong> Not Required</p>\n</li>\n<li><p><strong>Description:</strong> Registers a new user.</p>\n</li>\n</ul>\n</li>\n<li><p>POST /user/login</p>\n<ul>\n<li><p><strong>Endpoint:</strong> <code>POST /user/login</code></p>\n</li>\n<li><p><strong>Auth:</strong> Not Required</p>\n</li>\n<li><p><strong>Description:</strong> Logs in an existing user.</p>\n</li>\n</ul>\n</li>\n<li><p>GET /auth/logout</p>\n<ul>\n<li><p><strong>Endpoint:</strong> <code>GET /user/logout</code></p>\n</li>\n<li><p><strong>Auth:</strong> Required</p>\n</li>\n<li><p><strong>Description:</strong> Logs out the authenticated user.</p>\n</li>\n</ul>\n</li>\n</ol>\n","_postman_id":"b7aba4ac-bcc0-4c31-81a6-f808f171e118"},{"name":"Cart","item":[{"name":"View Cart","id":"26ac4ee4-3239-4440-b0aa-6296fc576f02","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{mangalenseHost}}/cart/","description":"<h3 id=\"view-user-cart\">View User Cart</h3>\n<p><strong>Endpoint:</strong> <code>GET {{host}}/cart</code></p>\n<p><strong>Description:</strong> Get the user's shopping cart.</p>\n<p><strong>Authentication:</strong> Required (User must be logged in).</p>\n<p><code>GET</code> <a href=\"http://your-api-base-url/cart\"><code>http://your-api-base-url/cart</code></a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"Number of Items in Cart\": 1,\n    \"viewCart\": {\n        \"_id\": \"6591c84737bdc16011d7f8c5\",\n        \"user\": \"659133d5f6ae7365ecb92828\",\n        \"items\": [\n            {\n                \"product\": {\n                    \"_id\": \"65913cfa177d317591d3024d\",\n                    \"title\": \"Random Product 2\",\n                    \"price\": 29.99,\n                    \"image\": \"random_image.jpg\",\n                    \"otherImages\": [\n                        \"image2.jpg\",\n                        \"image3.jpg\"\n                    ],\n                    \"description\": \"This is a random product description.\",\n                    \"prescription\": [\n                        {\n                            \"leftEye\": 2.75,\n                            \"rightEye\": 3,\n                            \"_id\": \"65913cfa177d317591d3024e\"\n                        }\n                    ],\n                    \"quantity\": \"10\",\n                    \"category\": \"Medicated Glasses\",\n                    \"frameMaterial\": \"Wood\",\n                    \"color\": \"Silver\",\n                    \"lensMaterial\": \"Glass\",\n                    \"totalRatings\": 4,\n                    \"averageRating\": 3.5,\n                    \"createdAt\": \"2023-12-31T10:05:46.588Z\",\n                    \"updatedAt\": \"2023-12-31T10:07:16.699Z\",\n                    \"__v\": 4\n                },\n                \"price\": 29.99,\n                \"quantity\": 1,\n                \"_id\": \"6593ddf0821a1783ca861d3a\"\n            }\n        ],\n        \"total\": 29.99,\n        \"createdAt\": \"2023-12-31T20:00:07.857Z\",\n        \"updatedAt\": \"2024-01-02T09:57:04.073Z\",\n        \"__v\": 10\n    }\n}\n\n</code></pre>\n","urlObject":{"path":["cart",""],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"26ac4ee4-3239-4440-b0aa-6296fc576f02"},{"name":"Add to Cart","id":"bc8477d8-8e03-4277-a3c0-e346f0ed1f29","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{mangalenseHost}}/cart/65913cfa177d317591d3024d","description":"<h3 id=\"add-to-cart\">Add to Cart</h3>\n<p><strong>Endpoint:</strong> <code>POST {{host}}/cart/:productId</code></p>\n<p><strong>Description:</strong> Add a product to the user's shopping cart.</p>\n<p><strong>Authentication:</strong> Required (User must be logged in).</p>\n<p>POST <a href=\"http://your-api-base-url/cart/product123\">http://your-api-base-url/cart/product123</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"msg\": \"Item added successfully\",\n    \"userCart\": {\n        \"_id\": \"6591c84737bdc16011d7f8c5\",\n        \"user\": \"659133d5f6ae7365ecb92828\",\n        \"items\": [\n            {\n                \"product\": \"65913cfa177d317591d3024d\",\n                \"price\": 29.99,\n                \"quantity\": 1,\n                \"_id\": \"6593dd1e081a62e9a3e54e7f\"\n            }\n        ],\n        \"total\": 29.99,\n        \"createdAt\": \"2023-12-31T20:00:07.857Z\",\n        \"updatedAt\": \"2024-01-02T09:53:34.302Z\",\n        \"__v\": 8\n    }\n}\n</code></pre>\n","urlObject":{"path":["cart","65913cfa177d317591d3024d"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"bc8477d8-8e03-4277-a3c0-e346f0ed1f29"},{"name":"Increase Quantity","id":"52901722-1c74-4382-a369-265b776de318","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"url":"{{mangalenseHost}}/cart/increase/65913cfa177d317591d3024d","description":"<h3 id=\"increase-quantity\">Increase Quantity</h3>\n<p><strong>Endpoint:</strong> <code>PATCH {{host}}/cart/increase/:productId</code></p>\n<p><strong>Description:</strong> Increase the quantity of a product in the user's shopping cart.</p>\n<p><strong>Authentication:</strong> Required (User must be logged in).</p>\n<p>PATCH <code>http://your-api-base-url/cart/increase/product123</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"6591c84737bdc16011d7f8c5\",\n    \"user\": \"659133d5f6ae7365ecb92828\",\n    \"items\": [\n        {\n            \"product\": \"65913cfa177d317591d3024d\",\n            \"price\": 29.99,\n            \"quantity\": 3,\n            \"_id\": \"6593dc642fe2fb32835393c5\"\n        }\n    ],\n    \"total\": 89.97,\n    \"createdAt\": \"2023-12-31T20:00:07.857Z\",\n    \"updatedAt\": \"2024-01-02T09:51:17.027Z\",\n    \"__v\": 6\n}\n\n</code></pre>\n","urlObject":{"path":["cart","increase","65913cfa177d317591d3024d"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"52901722-1c74-4382-a369-265b776de318"},{"name":"Decrease Quantity","id":"7680d2d3-46ba-4a4a-801c-671f04f1cca3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"url":"{{mangalenseHost}}/cart/decrease/65913cfa177d317591d3024d","description":"<h3 id=\"decrease-quantity\">Decrease Quantity</h3>\n<p><strong>Endpoint:</strong> <code>PATCH {{host}}/cart/decrease/:productId</code></p>\n<p><strong>Description:</strong> Decrease the quantity of a product in the user's shopping cart.</p>\n<p><strong>Authentication:</strong> Required (User must be logged in).</p>\n<p>PATCH <a href=\"http://your-api-base-url/cart/decrease/product123\"><code>http://your-api-base-url/cart/decrease/product123</code></a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"6591c84737bdc16011d7f8c5\",\n    \"user\": \"659133d5f6ae7365ecb92828\",\n    \"items\": [\n        {\n            \"product\": \"65913cfa177d317591d3024d\",\n            \"price\": 29.99,\n            \"quantity\": 1,\n            \"_id\": \"6593dc642fe2fb32835393c5\"\n        }\n    ],\n    \"total\": 29.99,\n    \"createdAt\": \"2023-12-31T20:00:07.857Z\",\n    \"updatedAt\": \"2024-01-02T09:51:41.494Z\",\n    \"__v\": 6\n}\n\n</code></pre>\n","urlObject":{"path":["cart","decrease","65913cfa177d317591d3024d"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7680d2d3-46ba-4a4a-801c-671f04f1cca3"},{"name":"Remove from cart","id":"74c0c26b-4213-49a5-89b0-8e741afb7b9e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{mangalenseHost}}/cart/65913cfa177d317591d3024d","description":"<p>StartFragment</p>\n<h3 id=\"remove-cart-item\">Remove Cart Item</h3>\n<p><strong>Endpoint:</strong> <code>DELETE {{host}}/cart/:productId</code></p>\n<p><strong>Description:</strong> Remove a product from the user's shopping cart</p>\n<p><strong>Authentication:</strong> Required (User must be logged in).</p>\n<p>DELETE <a href=\"http://your-api-base-url/cart/product123\">http://your-api-base-url/cart/product123</a></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"msg\": \"Item removed successfully\",\n    \"userCart\": {\n        \"_id\": \"6591c84737bdc16011d7f8c5\",\n        \"user\": \"659133d5f6ae7365ecb92828\",\n        \"items\": [],\n        \"total\": 0,\n        \"createdAt\": \"2023-12-31T20:00:07.857Z\",\n        \"updatedAt\": \"2024-01-02T09:55:52.877Z\",\n        \"__v\": 9\n    }\n}\n\n</code></pre>\n","urlObject":{"path":["cart","65913cfa177d317591d3024d"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"74c0c26b-4213-49a5-89b0-8e741afb7b9e"}],"id":"d8dd991c-0a59-492a-852c-e44a0a055890","description":"<h3 id=\"user-endpoints\">User Endpoints</h3>\n<p>This folder manages User actions for the shopping cart:</p>\n<ol>\n<li>View Cart<ul>\n<li>Endpoint: GET /cart</li>\n<li>Auth: Required</li>\n<li>Description: Retrieve the user's shopping cart.</li>\n<li>Example Request: GET /cart</li>\n</ul>\n</li>\n<li>Add to Cart<ul>\n<li>Endpoint: POST /cart/:productId</li>\n<li>Auth: Required</li>\n<li>Description: Add a product to the shopping cart.</li>\n<li>Example Request: POST /cart/:productId</li>\n</ul>\n</li>\n<li>Remove Item from Cart<ul>\n<li>Endpoint: DELETE /cart/:productId</li>\n<li>Auth: Required</li>\n<li>Description: Remove a product from the shopping cart.</li>\n<li>Example Request: DELETE /cart/:productId</li>\n</ul>\n</li>\n<li>Increase Item Quantity<ul>\n<li>Endpoint: PATCH /cart/increase/:productId</li>\n<li>Auth: Required</li>\n<li>Description: Increase the quantity of a specific product in the shopping cart.</li>\n<li>Example Request: PATCH /cart/increase/:productId</li>\n</ul>\n</li>\n<li>Decrease Item Quantity<ul>\n<li>Endpoint: PATCH /cart/decrease/:productId</li>\n<li>Auth: Required</li>\n<li>Description: Decrease the quantity of a specific product in the shopping cart.</li>\n<li>Example Request: PATCH /cart/decrease/:productId</li>\n</ul>\n</li>\n</ol>\n<p>These endpoints allow users to manage their shopping cart, including viewing, adding, removing, and adjusting the quantity of items.</p>\n","_postman_id":"d8dd991c-0a59-492a-852c-e44a0a055890"},{"name":"Reviews","item":[{"name":"Update Review","id":"90e3afe0-a706-49ca-b52d-a162c910b38c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"rating\":3.5,\r\n    \"comment\":\"very wonderful glasses\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/products/review/659145c93f58e5d4d4dfcbfb/update-review/65914cbcd59578b4a8e25c2b","description":"<h3 id=\"update-review\">Update Review</h3>\n<h4 id=\"description\">Description</h4>\n<p>Update a review for a specific product.</p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li>Path Parameters:<ul>\n<li><code>productId</code> (string): Product ID.</li>\n<li><code>reviewId</code> (string): Review ID.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"authentication\">Authentication</h4>\n<p>This endpoint requires authentication. The user must be logged in to access it.</p>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>PATCH http://your-api-base-url/products/review/:productId/update-review/:reviewId\n\n</code></pre><h4 id=\"request-body\">Request Body</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"rating\": 4.8,\n  \"comment\": \"Updated review!\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li>Status Codes:<ul>\n<li>200 OK: Review updated successfully.</li>\n<li>400 Bad Request: Product ID, review ID, and either rating, comment, or both, and user ID are required.</li>\n<li>404 Not Found: Product not found or no reviews found for the product.</li>\n<li>500 Internal Server Error: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Review updated successfully\",\n    \"totalRatings\": 1,\n    \"averageRating\": 4.8\n}\n\n</code></pre>\n","urlObject":{"path":["products","review","659145c93f58e5d4d4dfcbfb","update-review","65914cbcd59578b4a8e25c2b"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"90e3afe0-a706-49ca-b52d-a162c910b38c"},{"name":"Delete Review","id":"0f36bf2f-980b-4943-8106-9ca58d378388","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{mangalenseHost}}/products/review/659145c93f58e5d4d4dfcbfb/delete-review/65914b43745416fad648dbe4","description":"<h3 id=\"delete-review\">Delete Review</h3>\n<h4 id=\"description\">Description</h4>\n<p>Delete a review for a specific product.</p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li>Path Parameters:<ul>\n<li><code>productId</code> (string): Product ID.</li>\n<li><code>reviewId</code> (string): Review ID.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"authentication\">Authentication</h4>\n<p>This endpoint requires authentication. The user must be logged in to access it.</p>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>DELETE http://your-api-base-url/products/review/:productId/delete-review/:reviewId\n\n</code></pre><h4 id=\"response\">Response</h4>\n<ul>\n<li>Status Codes:<ul>\n<li>200 OK: Review deleted successfully.</li>\n<li>400 Bad Request: Product ID, Review ID, and User ID are required.</li>\n<li>404 Not Found: Review not found or no permission to delete this review.</li>\n<li>500 Internal Server Error: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Review deleted successfully\",\n    \"totalRatings\": 0,\n    \"averageRating\": 0\n}\n\n</code></pre>\n","urlObject":{"path":["products","review","659145c93f58e5d4d4dfcbfb","delete-review","65914b43745416fad648dbe4"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f36bf2f-980b-4943-8106-9ca58d378388"},{"name":"Add Review","id":"0552133f-9fc1-4de4-be2a-f930e84bc178","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"rating\":5,\r\n    \"comment\":\"very bad glasses from olamide\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{mangalenseHost}}/products/review/659300cb8f6a95c1344cec36","description":"<h3 id=\"add-review\">Add Review</h3>\n<h4 id=\"description\">Description</h4>\n<p>Add a review for a specific product.</p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li>Path Parameters:<ul>\n<li><code>productId</code> (string): Product ID.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"authentication\">Authentication</h4>\n<p>This endpoint requires authentication. The user must be logged in to access it.</p>\n<h4 id=\"example-request\">Example Request</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST http://your-api-base-url/products/review/:productId\n\n</code></pre><h4 id=\"request-body\">Request Body</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"rating\": 4.5,\n  \"comment\": \"This is a great product!\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li>Status Codes:<ul>\n<li>201 Created: Review added successfully.</li>\n<li>400 Bad Request: Product ID, rating, comment, and user ID are required.</li>\n<li>404 Not Found: Product not found.</li>\n<li>500 Internal Server Error: An error occurred on the server.</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Review added successfully\",\n    \"totalRatings\": 1,\n    \"averageRating\": 4.5\n}\n\n</code></pre>\n","urlObject":{"path":["products","review","659300cb8f6a95c1344cec36"],"host":["{{mangalenseHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0552133f-9fc1-4de4-be2a-f930e84bc178"}],"id":"db947706-d794-460f-925b-09dc18a1823e","description":"<h3 id=\"user-endpoints\">User Endpoints</h3>\n<p>This folder manages User actions for reviews:</p>\n<p><strong>1. Add Review</strong></p>\n<ul>\n<li><strong>Endpoint:</strong> <code>POST /products/review/:productId</code></li>\n<li><strong>Auth:</strong> Required</li>\n<li>POST /products/review/:productId</li>\n</ul>\n<p><strong>2. Update Review</strong></p>\n<ul>\n<li><strong>Endpoint:</strong> <code>PATCH /products/review/:productId/update-review/:reviewId</code></li>\n<li><strong>Auth:</strong> Required</li>\n<li>PATCH /products/review/:productId/update-review/:reviewId</li>\n</ul>\n<p><strong>3. Delete Review</strong></p>\n<ul>\n<li><strong>Endpoint:</strong> <code>DELETE /products/review/:productId/delete-review/:reviewId</code></li>\n<li><strong>Auth:</strong> Required</li>\n<li>DELETE /products/review/:productId/delete-review/:reviewId</li>\n</ul>\n","_postman_id":"db947706-d794-460f-925b-09dc18a1823e"}],"id":"e5d83eb7-3a2f-4848-9bdb-e82495387965","description":"<p>This folder contains the authentication-related endpoints for user authentication, products, cart and reviews</p>\n","_postman_id":"e5d83eb7-3a2f-4848-9bdb-e82495387965"}]}