Added Capstone 2 S51

master
Ron Reciproco 1 year ago
parent 02f70c993f
commit 10b9b3a29c

@ -0,0 +1,609 @@
{
"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",
"request": {
"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.eyJ1c2VySWQiOiI2NTUzNjU0NDk4YzFiYmRhMzNmODJiZjAiLCJlbWFpbCI6ImRpdmluZUBleGFtcGxlLmNvbSIsImlhdCI6MTY5OTk3NTczNSwiZXhwIjoxNjk5OTc5MzM1fQ.oWOhcmPp_5-c4vcSncTdfZWpTCybBQejZaLy3RiNV-E",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"userId\": \"6553654498c1bbda33f82bf0\",\r\n \"newEmail\": \"divine@example.com\",\r\n \"newFirstname\": \"Ron\",\r\n \"newLastName\": \"Pogi\",\r\n \"newPassword\": \"crypto123\"\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": "Product Get All",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/user/all",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"all"
]
}
},
"response": []
},
{
"name": "Product Get All [Active]",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/user/active",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"active"
]
}
},
"response": []
},
{
"name": "Get a Single Product",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/user/products/65545619b88d0a48f00ae778",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"products",
"65545619b88d0a48f00ae778"
]
}
},
"response": []
},
{
"name": "Order / User Checkout [Non-admin]",
"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.eyJ1c2VySWQiOiI2NTU0YWM4ZGQ3ZmJmOWVlOTAyMTdlNzciLCJlbWFpbCI6Im1hc3RlckBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMDUwOTkzLCJleHAiOjE3MDAwNTQ1OTN9._K7A7ZmE4ApbmE1qtpPYRmiugYn7HpgsIOAW7yR0pUA",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"userId\": \"6554ac8dd7fbf9ee90217e77\"\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": "Retrieve Authenticated user's orders",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTU0NGQ5YmU1YzAxZjZjMGNhNzkyMDAiLCJlbWFpbCI6IndhcGF0dUBlbWFpbC5jb20iLCJpc0FkbWluIjpmYWxzZSwiaWF0IjoxNzAwMDUwMzYzLCJleHAiOjE3MDAwNTM5NjN9.Csls5KcCnhERt_QrmcFz7vOkEvDaz8-B79AydV2DKqo",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"userId\": \"65544d9be5c01f6c0ca79200\"\r\n}\r\n",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/user/getOrders",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"getOrders"
]
}
},
"response": []
}
]
},
{
"name": "Admin",
"item": [
{
"name": "Product Create[Admin]",
"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/user/products",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"products"
]
}
},
"response": []
},
{
"name": "Update a product[Admin]",
"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/user/products/65545a1e6fa9d841e1518d1d",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"products",
"65545a1e6fa9d841e1518d1d"
]
}
},
"response": []
},
{
"name": "Activate Product[Admin]",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NTUzNWNiNTI2YjU4NmEzZTJmZDU2Y2MiLCJlbWFpbCI6ImFkbWluQGVtYWlsLmNvbSIsImlzQWRtaW4iOnRydWUsImlhdCI6MTcwMDAyOTI0MiwiZXhwIjoxNzAwMDMyODQyfQ.seG4bjWAoolGMrS04tRvEsc033HgR1aLnbhOlFw5rDc",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"url": {
"raw": "http://localhost:3000/user/products/6554634e5cac4bcd6f2394ed/activate",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"products",
"6554634e5cac4bcd6f2394ed",
"activate"
]
}
},
"response": []
},
{
"name": "Archive Product[Admin]",
"request": {
"method": "PUT",
"header": [],
"url": {
"raw": "http://localhost:3000/user/products/6554634e5cac4bcd6f2394ed/archive",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"user",
"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[Admin]",
"request": {
"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": []
}
]
}
]
}
Loading…
Cancel
Save