{"info":{"_postman_id":"fdcb4ad5-f10c-48dd-9249-a52c4dc751c5","name":"Treez Service","description":"<html><head></head><body><p>Treez service to model current inventory, deducting from inventory as orders are created, and adding inventory back if orders are canceled</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"5377031","collectionId":"fdcb4ad5-f10c-48dd-9249-a52c4dc751c5","publishedId":"SWTK2syr","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"AABB25"},"publishDate":"2020-02-10T04:04:57.000Z"},"item":[{"name":"INVENTORY","item":[{"name":"READ ALL INVENTORY ITEMS","id":"c729b4d4-c95f-422c-937c-ea1b5150bef8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:1337/Inventories","description":"<ul>\n<li><em>deleted</em> items are not returned for non-Admin Users. The authorization is mocked so every user is not admin</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["Inventories"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"880cf8f5-127f-4ef5-b504-1b8634ba4158","name":"READ ALL INVENTORY ITEMS","originalRequest":{"method":"GET","header":[],"url":"http://localhost:1337/Inventories"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"784"},{"key":"ETag","value":"W/\"310-WGK77DdH6+pRACQpFtEojGzqRN0\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:44:48 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"createdAt\": 1581263832305,\n        \"updatedAt\": 1581263832305,\n        \"id\": 125,\n        \"name\": \"Aquafina\",\n        \"description\": \"Bottled Watter\",\n        \"price\": 5,\n        \"quantityAvailable\": 20,\n        \"deleted\": false\n    },\n    {\n        \"createdAt\": 1581263832305,\n        \"updatedAt\": 1581263832305,\n        \"id\": 126,\n        \"name\": \"Bread\",\n        \"description\": \"Plain Bread\",\n        \"price\": 10,\n        \"quantityAvailable\": 6,\n        \"deleted\": false\n    },\n    {\n        \"createdAt\": 1581263832305,\n        \"updatedAt\": 1581263832305,\n        \"id\": 127,\n        \"name\": \"Milk\",\n        \"description\": \"Almond Milk\",\n        \"price\": 13.5,\n        \"quantityAvailable\": 17,\n        \"deleted\": false\n    },\n    {\n        \"createdAt\": 1581263832305,\n        \"updatedAt\": 1581263832305,\n        \"id\": 128,\n        \"name\": \"Plantains\",\n        \"description\": \"\",\n        \"price\": 14,\n        \"quantityAvailable\": 5,\n        \"deleted\": false\n    },\n    {\n        \"createdAt\": 1581263832305,\n        \"updatedAt\": 1581263832305,\n        \"id\": 129,\n        \"name\": \"Mangoes\",\n        \"description\": \"Awesome fruit\",\n        \"price\": 8.45,\n        \"quantityAvailable\": 25,\n        \"deleted\": false\n    }\n]"}],"_postman_id":"c729b4d4-c95f-422c-937c-ea1b5150bef8"},{"name":"READ SINGLE INVENTORY ITEM","id":"806d64b8-b579-4085-ba48-e6742d9d83b4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:1337/Inventories/87","description":"<ul>\n<li><em>deleted</em> items are not returned for non-Admin Users. The authorization is mocked so every user is not admin</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["Inventories","87"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"4621733d-73f2-49a0-a2b2-6a0a634f7ee7","name":"READ SINGLE INVENTORY ITEM","originalRequest":{"method":"GET","header":[],"url":"http://localhost:1337/Inventories/126"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"154"},{"key":"ETag","value":"W/\"9a-+3XuEt6BYVA/UH76CTQWh46Xk9A\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:45:32 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"createdAt\": 1581263832305,\n    \"updatedAt\": 1581263832305,\n    \"id\": 126,\n    \"name\": \"Bread\",\n    \"description\": \"Plain Bread\",\n    \"price\": 10,\n    \"quantityAvailable\": 6,\n    \"deleted\": false\n}"},{"id":"d1874d33-2ec8-4882-84e2-5542b8fde14e","name":"READ SINGLE INVENTORY ITEM (NOT FOUND)","originalRequest":{"method":"GET","header":[],"url":"http://localhost:1337/Inventories/2"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"ETag","value":"W/\"25-StS8c7zMsiohg15XaPbiSssjmmY\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:46:10 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Inventory Item not found!\"\n}"}],"_postman_id":"806d64b8-b579-4085-ba48-e6742d9d83b4"},{"name":"CREATE INVENTORY ITEM","id":"7d09dbbe-495d-46fd-a704-9ec2c60e440e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"description","value":"Mobile Phone","type":"text"},{"key":"price","value":"1400","type":"text"},{"key":"quantityAvailable","value":"3","type":"text"},{"key":"name","value":"iPhone 12","type":"text"}]},"url":"http://localhost:1337/Inventories","description":"<ul>\n<li>All fields (name, price, quantityAvailable, and description) are required</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["Inventories"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"3b9e08ef-bbeb-48ae-bc33-fa0153b148b5","name":"CREATE INVENTORY ITEM (MISSING FIELD)","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"description","value":"Mobile Phone","type":"text"},{"key":"price","value":"1400","type":"text"},{"key":"quantityAvailable","value":"3","type":"text","disabled":true},{"key":"name","value":"iPhone 12","type":"text"}]},"url":"http://localhost:1337/Inventories"},"status":"Not Acceptable","code":406,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"48"},{"key":"ETag","value":"W/\"30-EROO700CZmRIRjFbFiGwoM9YQ64\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:48:12 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        \"\\\"quantityAvailable\\\" is required\"\n    ]\n}"},{"id":"c94a22f7-bf37-46f1-aa45-ce44025c82d6","name":"CREATE INVENTORY ITEM (SUCCESS)","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"description","value":"Mobile Phone","type":"text"},{"key":"price","value":"1400","type":"text"},{"key":"quantityAvailable","value":"3","type":"text"},{"key":"name","value":"iPhone 12","type":"text"}]},"url":"http://localhost:1337/Inventories"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"210"},{"key":"ETag","value":"W/\"d2-AZlcS6lkpvb7ci3PEgmctzRt+Z0\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:47:46 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"New Inventory Item Created!\",\n    \"item\": {\n        \"createdAt\": 1581317266487,\n        \"updatedAt\": 1581317266487,\n        \"id\": 130,\n        \"name\": \"iPhone 12\",\n        \"description\": \"Mobile Phone\",\n        \"price\": 1400,\n        \"quantityAvailable\": 3,\n        \"deleted\": false\n    }\n}"}],"_postman_id":"7d09dbbe-495d-46fd-a704-9ec2c60e440e"},{"name":"UPDATE INVENTORY ITEM","id":"33a93d59-e3b5-4e9e-81c1-8f558918d1cf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"A4 Book","type":"text"},{"key":"description","value":"Notebooks","type":"text"},{"key":"price","value":"33.4","type":"text","disabled":true},{"key":"quantityAvailable","value":"55","type":"text"}]},"url":"http://localhost:1337/Inventories/10","description":"<ul>\n<li>Any field can be updated</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["Inventories","10"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"33a93d59-e3b5-4e9e-81c1-8f558918d1cf"},{"name":"DELETE INVENTORY ITEM","id":"e17d39fc-dace-4b6f-90db-9c76fad4f8f5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost:1337/Inventories/27","description":"<ul>\n<li>Within the system, the items <em>deleted</em> flag is set to <em>true</em> when \"deleted\" and not expunged for record keeping purposes</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["Inventories","27"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f1e8bd5e-c197-4e72-919a-60e6a59b1107","name":"DELETE INVENTORY ITEM (NOT FOUND)","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost:1337/Inventories/27"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"ETag","value":"W/\"25-StS8c7zMsiohg15XaPbiSssjmmY\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:49:06 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Inventory Item not found!\"\n}"}],"_postman_id":"e17d39fc-dace-4b6f-90db-9c76fad4f8f5"}],"id":"7d4840b6-4c66-434d-97f0-c41d9be4e07b","_postman_id":"7d4840b6-4c66-434d-97f0-c41d9be4e07b","description":""},{"name":"ORDER","item":[{"name":"READ ALL ORDERS","id":"08e33a0e-54b5-4d21-b2d0-5796c93b3d77","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:1337/orders","urlObject":{"protocol":"http","port":"1337","path":["orders"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"08e33a0e-54b5-4d21-b2d0-5796c93b3d77"},{"name":"READ SINGLE ORDER","id":"504eb339-de91-49af-88e5-d801a534be79","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:1337/orders/2","urlObject":{"protocol":"http","port":"1337","path":["orders","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"504eb339-de91-49af-88e5-d801a534be79"},{"name":"CREATE NEW ORDER","id":"e611338d-4303-4a50-a065-8eb031a9ebfa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"customer\": \"sam@samsonmaconi.com\",\n\t\"orderItems\": [\n\t\t{\"item\": 21, \"count\": 5},\n\t\t{\"item\": 45, \"count\": 15}\n\t]\n}"},"url":"http://localhost:1337/orders","description":"<ul>\n<li><em>customer</em> string and <em>orderItems</em> array are both required within the object</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["orders"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"2098ca01-b89e-452e-9be0-b07c3e2b1ee1","name":"CREATE NEW ORDER (INVALID INVENTORY ORDER ITEMS)","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"customer\": \"sam@samsonmaconi.com\",\n\t\"orderItems\": [\n\t\t{\"item\": 21, \"count\": 5},\n\t\t{\"item\": 45, \"count\": 15}\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:1337/orders"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Sails <sailsjs.com>"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"53"},{"key":"ETag","value":"W/\"35-cHxFrPrQb/S1Y77jvFqhj7fTm9s\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Mon, 10 Feb 2020 06:50:10 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"One or more invalid order items detected!\"\n}"}],"_postman_id":"e611338d-4303-4a50-a065-8eb031a9ebfa"},{"name":"UPDATE ORDER","id":"31dc8c57-0801-4382-8c8e-05b697c63c23","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"orderItems\": [\n\t\t{\"item\": 21, \"count\": 8}\n\t],\n\t\"status\": \"completed\"\n}"},"url":"http://localhost:1337/orders/3","description":"<ul>\n<li><em>Order Items</em> and/or <em>Status</em> can be updated if the order has not been <em>canceled</em> or <em>completed</em>. </li>\n<li>The status can only be changed to <em>completed</em> thru this endpoint.</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["orders","3"],"host":["localhost"],"query":[{"disabled":true,"key":"name","value":"A4 Book"},{"disabled":true,"key":"description","value":"Notebook"},{"disabled":true,"key":"price","value":"21.5"},{"disabled":true,"key":"quantityAvailable","value":"7"}],"variable":[]}},"response":[],"_postman_id":"31dc8c57-0801-4382-8c8e-05b697c63c23"},{"name":"DELETE (CANCEL) ORDER","id":"37319237-8f95-4829-93d0-b4e9e0887d00","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost:1337/orders/10","description":"<ul>\n<li>Order <em>status</em> are updated to <em>canceled</em> within the system</li>\n<li><em>completed</em> or <em>canceled</em> orders are not valid for cancelation/deletion</li>\n</ul>\n","urlObject":{"protocol":"http","port":"1337","path":["orders","10"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"37319237-8f95-4829-93d0-b4e9e0887d00"}],"id":"201e2085-0377-4425-8b7c-fea5e9f08b1a","_postman_id":"201e2085-0377-4425-8b7c-fea5e9f08b1a","description":""}],"event":[{"listen":"prerequest","script":{"id":"9b3b86ac-1f42-4c3b-aedd-52fc8db67c6e","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"a31bdec3-7373-44b7-9709-434ae2082e2a","type":"text/javascript","exec":[""]}}]}