{"info":{"_postman_id":"48125e1c-bc3c-4d06-9ba7-577e26bef8e8","name":"Cosmic Python API","description":"<html><head></head><body><p>This is Cosmic Python API Collection.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"14594760","collectionId":"48125e1c-bc3c-4d06-9ba7-577e26bef8e8","publishedId":"Tz5iA1Vc","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-12-16T16:11:14.000Z"},"item":[{"name":"Add Batch","event":[{"listen":"test","script":{"id":"333da576-cd95-4f2b-a8a9-d536c53caffd","exec":["pm.test(\"Response status code is 201\", function () {","    pm.response.to.have.status(201);","});","","","pm.test(\"Response body contains OK\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData).to.be.a(\"object\");","    pm.expect(jsonData.message).to.be.a(\"string\");","    pm.expect(jsonData.message).to.eql(\"OK\");","});","",""],"type":"text/javascript"}}],"id":"90fe0e7f-f835-47b7-b372-069393cad809","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"reference\": \"batch-1\", \n    \"sku\": \"sku-1\", \n    \"qty\": 10, \n    \"eta\": \"2021-01-01\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/add_batch","urlObject":{"path":["add_batch"],"host":["localhost:5005"],"query":[],"variable":[]}},"response":[{"id":"8f4a2d04-2bcf-4b4c-b522-c87e2a79cdef","name":"201 CREATED","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"reference\": \"batch-1\", \n    \"sku\": \"sku-1\", \n    \"qty\": 10, \n    \"eta\": \"2021-01-01\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/add_batch"},"status":"CREATED","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"22"},{"key":"Server","value":"Werkzeug/2.0.2 Python/3.9.9"},{"key":"Date","value":"Wed, 05 Jan 2022 20:18:19 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"OK\"\n}"}],"_postman_id":"90fe0e7f-f835-47b7-b372-069393cad809"},{"name":"Allocate","event":[{"listen":"test","script":{"id":"56bbf7bf-1ec4-45c7-8093-507cca103cb5","exec":["pm.test(\"Response status code is 202\", function () {","    pm.response.to.have.status(202);","});","","pm.test(\"Response body contains OK\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData).to.be.a(\"object\");","    pm.expect(jsonData.message).to.be.a(\"string\");","    pm.expect(jsonData.message).to.eql(\"OK\");","});",""],"type":"text/javascript"}}],"id":"5d639952-5195-449f-9c03-71fd3ef1f64a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"orderid\": \"order-1\",\n    \"sku\": \"sku-1\",\n    \"qty\": 5\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/allocate","urlObject":{"path":["allocate"],"host":["localhost:5005"],"query":[],"variable":[]}},"response":[{"id":"9ec9826a-8f51-4a8b-8653-947063e1f395","name":"202 ACCEPTED","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"orderid\": \"order-1\",\n    \"sku\": \"sku-1\",\n    \"qty\": 5\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/allocate"},"status":"ACCEPTED","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"22"},{"key":"Server","value":"Werkzeug/2.0.2 Python/3.9.9"},{"key":"Date","value":"Wed, 05 Jan 2022 20:17:11 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"OK\"\n}"},{"id":"6f65cf8e-060b-49ac-bc9a-533df24e3c46","name":"400 Bad Request","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"orderid\": \"order-1\",\n    \"sku\": \"unknown-sku\",\n    \"qty\": 5\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/allocate"},"status":"BAD REQUEST","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"43"},{"key":"Server","value":"Werkzeug/1.0.1 Python/3.8.8"},{"key":"Date","value":"Sun, 21 Feb 2021 08:30:31 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Invalid sku unknown-sku\"\n}"}],"_postman_id":"5d639952-5195-449f-9c03-71fd3ef1f64a"},{"name":"Deallocate","event":[{"listen":"test","script":{"id":"c5c17eb9-2e17-4c80-b60c-ea88c3b64d84","exec":["pm.test(\"Response status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response body contains OK\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData).to.be.a(\"object\");","    pm.expect(jsonData.message).to.be.a(\"string\");","    pm.expect(jsonData.message).to.eql(\"OK\");","});",""],"type":"text/javascript"}}],"id":"c580cee3-bc95-4cf9-a9b5-aba1be93941b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"orderid\": \"order-1\",\n    \"sku\": \"sku-1\",\n    \"qty\": 5\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/deallocate","urlObject":{"path":["deallocate"],"host":["localhost:5005"],"query":[],"variable":[]}},"response":[{"id":"f21fb97d-6d14-47c9-a13c-a127e4bc9b7d","name":"200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"orderid\": \"order-1\",\n    \"sku\": \"sku-1\",\n    \"qty\": 5\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/deallocate"},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"2"},{"key":"Server","value":"Werkzeug/2.0.2 Python/3.9.9"},{"key":"Date","value":"Thu, 16 Dec 2021 15:59:09 GMT"}],"cookie":[],"responseTime":null,"body":"OK"},{"id":"4a7006d1-103d-4269-baa4-c818d79ae5e3","name":"400 BAD REQUEST","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"orderid\": \"order-1\",\n    \"sku\": \"unknown-sku-1\",\n    \"qty\": 5\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5005/deallocate"},"status":"BAD REQUEST","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"45"},{"key":"Server","value":"Werkzeug/2.0.2 Python/3.9.9"},{"key":"Date","value":"Thu, 16 Dec 2021 16:01:02 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Invalid sku unknown-sku-1\"\n}"}],"_postman_id":"c580cee3-bc95-4cf9-a9b5-aba1be93941b"},{"name":"View Allocation","event":[{"listen":"test","script":{"id":"88d20f70-b86f-4619-a674-d18227245b07","exec":["pm.test(\"Response status code is 200\", function () {","    pm.response.to.have.status(200);","});","","pm.test(\"Response Body contains batches\", function () {","    var jsonData = pm.response.json();","    pm.expect(jsonData.length).to.greaterThan(0);","    pm.expect(jsonData[0].batchref).to.eql(\"batch-1\");","    pm.expect(jsonData[0].qty).to.eql(5);","    pm.expect(jsonData[0].sku).to.eql(\"sku-1\");","});"],"type":"text/javascript"}}],"id":"982696ab-6970-48b7-b8cd-fc5288b1bf49","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":"localhost:5005/allocations/order-1","urlObject":{"path":["allocations","order-1"],"host":["localhost:5005"],"query":[],"variable":[]}},"response":[{"id":"9d516c8d-a0d1-4bf2-afbb-bc5f881f797a","name":"200 OK","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":"localhost:5005/allocations/order-1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"74"},{"key":"Server","value":"Werkzeug/2.0.2 Python/3.9.9"},{"key":"Date","value":"Wed, 05 Jan 2022 20:20:37 GMT"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"batchref\": \"batch-1\",\n        \"qty\": 5,\n        \"sku\": \"sku-1\"\n    }\n]"},{"id":"4db439c0-a5c0-4b14-8217-6437a542ecc3","name":"404 NOT FOUND","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":"localhost:5005/allocations/order-1"},"status":"NOT FOUND","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"29"},{"key":"Server","value":"Werkzeug/2.0.2 Python/3.9.9"},{"key":"Date","value":"Wed, 05 Jan 2022 20:19:42 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Not found\"\n}"}],"_postman_id":"982696ab-6970-48b7-b8cd-fc5288b1bf49"}],"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"28ce0304-1f8a-40ea-a620-1c4c94e3a26d"}},{"listen":"test","script":{"type":"text/javascript","exec":[""],"id":"1bc84618-4336-4ffc-9995-45d4a4d92b9b"}}],"variable":[{"key":"hostname","value":"localhost:5005"}]}