Skip to content

renjiniravath/inventory-management

Repository files navigation

inventory-management

An inventory management application for a logistics company

Setting up

Running

Run the following command in the root folder to run the program

  • docker-compose up

Safely stopping the system

  • Ctrl+C

  • docker-compose down

Endpoints

Root URL - http://localhost:8080

  • This is the root url where the API is hosted. Prepend this root before all requests

GET /item

Lists all items in the inventory with name and warehouse details

Response

{
  "items": [
    {
      "id": 1,
      "name": "Item 2",
      "warehouseId": 1,
      "warehouseName": "RDU"
    },
    {
      "id": 2,
      "name": "Item 1",
      "warehouseId": 2,
      "warehouseName": "JFK"
    }
  ],
  "count": 2
}

POST /item

Adds a item to the inventory

Request

{
  "name": "Item 1",
  "warehouseId": 2
}

Response

Item successfully created

PUT /item/:id

Updates the details of an item in the inventory

Request

Provide atleast one of the fields

{
  "name": "Item 1",
  "warehouseId": 2
}

Response

Item successfully edited

DELETE /item/:id

Deletes an item from inventory

Response

Item successfully deleted

GET /warehouse

Lists all warehouses

Response

{
  "warehouses": [
    {
      "id": 1,
      "name": "RDU"
    },
    {
      "id": 2,
      "name": "JFK"
    }
  ],
  "count": 2
}

POST /warehouse

Adds a warehouse

Request

{
  "name": "JFK"
}

Response

Warehouse successfully created

PUT /warehouse/:id

Updates the name of a warehouse

Request

{
  "name": "JFK"
}

Response

Warehouse successfully edited

DELETE /warehouse/:id

Deletes an warehouse

Response

Warehouse successfully deleted

About

An inventory management application for a logistics company

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors