The inventory resource keeps track of how many of each product we have in our warehouse. At a minimum it will reference a product and the quantity on hand. Inventory also tracks restock levels and the condition of the item (i.e., new, open box, used). Restock levels will help you know when to order more products. Being able to query products by their condition (e.g., new, used) is very useful.
Column | Data type | Condition |
---|---|---|
id |
int |
id > 0 |
quantity |
int |
quantity > 0 |
inventory_name |
string |
N/A |
category |
string |
N/A |
condition |
Enum |
condition in set(NEW, OPENED, USED) |
restock_level |
<integer> |
restock_level > 0 |
Method | URI | Description | Input |
---|---|---|---|
GET |
/inventory/ |
List all items in the inventory | Item Attribute(s) |
GET |
/inventory/<int:id> |
Given the correct id this retrieves the inventory |
Item ID |
DELETE |
/inventory/<int:id> |
Given the correct id this deletes the entry |
Item ID |
PUT |
/inventory/<int:id> |
Given the correct id this updates the entry |
Item Attributes |
POST |
/inventory |
Given the inventory parameters, create a new inventory entry | Item Attributes |
PUT |
/inventory/<int:id>/restock |
Click on the restock button will increase the quantity of an item if it is below restock_level |
Item Attributes |
Copyright (c) 2016, 2024 John Rofrano. All rights reserved.
Licensed under the Apache License. See LICENSE
This repository is part of the New York University (NYU) masters class: CSCI-GA.2820-001 DevOps and Agile Methodologies created and taught by John Rofrano, Adjunct Instructor, NYU Courant Institute, Graduate Division, Computer Science, and NYU Stern School of Business.