You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
590 lines
14 KiB
JSON
590 lines
14 KiB
JSON
{
|
|
"info": {
|
|
"_postman_id": "7a7182a1-6696-4ea5-b672-9c4e48d009a9",
|
|
"name": "csp2-postman",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
|
"_exporter_id": "29492519"
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "User",
|
|
"item": [
|
|
{
|
|
"name": "User Register",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"email\": \"renzo@email.com\",\r\n \"password\": \"renzo\"\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/register",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"register"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "User Authenticate/Login",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0NGQ5YmU1YzAxZjZjMGNhNzkyMDAiLCJlbWFpbCI6IndhcGF0dUBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMjE0NTcwLCJleHAiOjE3MDAyMTgxNzB9.IMrvxc4l2A5cwMATP3FuCIiZUmaS-eewpqLz5CORQQA",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"email\": \"wapatu@email.com\",\r\n \"password\": \"wapatu\"\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/authenticate",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"authenticate"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "User Update Account",
|
|
"protocolProfileBehavior": {
|
|
"followAuthorizationHeader": true
|
|
},
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0NGQ5YmU1YzAxZjZjMGNhNzkyMDAiLCJlbWFpbCI6IndhcGF0dUBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMjE0NTcwLCJleHAiOjE3MDAyMTgxNzB9.IMrvxc4l2A5cwMATP3FuCIiZUmaS-eewpqLz5CORQQA",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PUT",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"userId\": \"65544d9be5c01f6c0ca79200\",\r\n \"newEmail\": \"user@email.com\",\r\n \"newFirstname\": \"Ron\",\r\n \"newLastName\": \"Pogi\",\r\n \"newPassword\": \"user\"\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/update",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"update"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Retrieve Active Products",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/active",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"active"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Retrieve Single Product",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/products/65545619b88d0a48f00ae778",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"products",
|
|
"65545619b88d0a48f00ae778"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "User Checkout(Create Order)",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"userId\": \"65544d9be5c01f6c0ca79200\", // Replace with a valid user ID from your database\r\n \"products\": [\r\n {\r\n \"productId\": \"6553a4e897ac8ac9462f96c4\", // Replace with a valid product ID from your database\r\n \"productName\": \"Mastering Card\",\r\n \"quantity\": 1\r\n }\r\n ],\r\n \"totalAmount\": 500\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/order",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"order"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Retrieve user data",
|
|
"protocolProfileBehavior": {
|
|
"disableBodyPruning": true
|
|
},
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0NGQ5YmU1YzAxZjZjMGNhNzkyMDAiLCJlbWFpbCI6IndhcGF0dUBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMjE0NTcwLCJleHAiOjE3MDAyMTgxNzB9.IMrvxc4l2A5cwMATP3FuCIiZUmaS-eewpqLz5CORQQA",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"userId\": \"65544d9be5c01f6c0ca79200\"\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/retrieveUser",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"retrieveUser"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Admin",
|
|
"item": [
|
|
{
|
|
"name": "Retrieve All Products",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/all",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"all"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Create Product",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTUzNWNiNTI2YjU4NmEzZTJmZDU2Y2MiLCJlbWFpbCI6ImFkbWluQGVtYWlsLmNvbSIsImlzQWRtaW4iOnRydWUsImlhdCI6MTcwMDA0MTY3OCwiZXhwIjoxNzAwMDQ1Mjc4fQ.R3pE54-sStTo10q8caVvMg-Uup9akuGgM7rsINdfvPo",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"name\": \"Poporing Card\",\r\n \"description\": \"Description unknown\",\r\n \"price\": 500\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/create",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"create"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Product",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTUzNWNiNTI2YjU4NmEzZTJmZDU2Y2MiLCJlbWFpbCI6ImFkbWluQGVtYWlsLmNvbSIsImlzQWRtaW4iOnRydWUsImlhdCI6MTcwMDAyMzgxMSwiZXhwIjoxNzAwMDI3NDExfQ.DrhpNlBJKpfHod7MfTalQ5j2-s8tnR630yh2-_EIYWw",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PUT",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"name\": \"Christmas Cookie Card\",\r\n \"description\": \"Updated Product Description\",\r\n \"price\": 29.99,\r\n \"isActive\": false\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/products/65545a1e6fa9d841e1518d1d",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"products",
|
|
"65545a1e6fa9d841e1518d1d"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Activate Product",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTUzNWNiNTI2YjU4NmEzZTJmZDU2Y2MiLCJlbWFpbCI6ImFkbWluQGVtYWlsLmNvbSIsImlzQWRtaW4iOnRydWUsImlhdCI6MTcwMDAyOTI0MiwiZXhwIjoxNzAwMDMyODQyfQ.seG4bjWAoolGMrS04tRvEsc033HgR1aLnbhOlFw5rDc",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PUT",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/products/6554634e5cac4bcd6f2394ed/activate",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"products",
|
|
"6554634e5cac4bcd6f2394ed",
|
|
"activate"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Archive/Draft Product",
|
|
"request": {
|
|
"method": "PUT",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/product/products/6554634e5cac4bcd6f2394ed/archive",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"product",
|
|
"products",
|
|
"6554634e5cac4bcd6f2394ed",
|
|
"archive"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Set User to Admin",
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/set-admin/",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"set-admin",
|
|
""
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Retrieve All Orders",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0YWM4ZGQ3ZmJmOWVlOTAyMTdlNzciLCJlbWFpbCI6Im1hc3RlckBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMjEyNjkzLCJleHAiOjE3MDAyMTYyOTN9.J908JWFjN5dKRw0-XJPHa4kD6QAW4M7tv1LOVmbtM_E",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/user/orders-all",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"user",
|
|
"orders-all"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Cart",
|
|
"item": [
|
|
{
|
|
"name": "Add to cart",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0YWM4ZGQ3ZmJmOWVlOTAyMTdlNzciLCJlbWFpbCI6Im1hc3RlckBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMDU0NDk2LCJleHAiOjE3MDAwNTgwOTZ9.ytA5zJ3gqEefw7lRAgvVXlWD3-iANaEjjkYgBqMWc4I",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"userId\": \"655396dcc8ea29f42422e214\",\r\n \"productId\": \"6553a54566c4c86c39034b55\",\r\n \"quantity\": 5\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/cart/add-to-cart",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"cart",
|
|
"add-to-cart"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Item",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0YWM4ZGQ3ZmJmOWVlOTAyMTdlNzciLCJlbWFpbCI6Im1hc3RlckBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMDU0NDk2LCJleHAiOjE3MDAwNTgwOTZ9.ytA5zJ3gqEefw7lRAgvVXlWD3-iANaEjjkYgBqMWc4I",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"userId\": \"655396dcc8ea29f42422e214\",\r\n \"productId\": \"6553a55666c4c86c39034b59\",\r\n \"quantity\": 1\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/cart/remove-from-cart",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"cart",
|
|
"remove-from-cart"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Quantity",
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0YWM4ZGQ3ZmJmOWVlOTAyMTdlNzciLCJlbWFpbCI6Im1hc3RlckBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMDU0NDk2LCJleHAiOjE3MDAwNTgwOTZ9.ytA5zJ3gqEefw7lRAgvVXlWD3-iANaEjjkYgBqMWc4I",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "PUT",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\r\n \"userId\": \"655396dcc8ea29f42422e214\",\r\n \"productId\": \"6553a55666c4c86c39034b59\",\r\n \"quantity\": 2000 // Update to the desired quantity\r\n}\r\n",
|
|
"options": {
|
|
"raw": {
|
|
"language": "json"
|
|
}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "http://localhost:3000/cart//update-quantity",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"cart",
|
|
"",
|
|
"update-quantity"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Cart Total Price",
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "http://localhost:3000/cart/6554cc5a4446b63dcf2d7fc0/655396dcc8ea29f42422e214",
|
|
"protocol": "http",
|
|
"host": [
|
|
"localhost"
|
|
],
|
|
"port": "3000",
|
|
"path": [
|
|
"cart",
|
|
"6554cc5a4446b63dcf2d7fc0",
|
|
"655396dcc8ea29f42422e214"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |