Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Abhinav2510/warehouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏭 WareHouse

Java Spring

Description:

The WareHouse API Backend allows performing following operation.

  • Data Loaders
    • Load all articles from inventory.json specified by location in application.properties
    • Load all Products from products.json specified by location in application.properties
    • Maintains quantity of products available for sell based on underlying Article inventory in system
  • REST APIS
    • list all products
    • sell the units of products in specified quantity
    • Update quantity of products available for sell based on underlying Article inventory in system

🛡️ Code coverage

image

⚖️ Assumptions :

  • Validations for recipe creation and update are assumed as
    • articleName/productName should be at least 3 to 255 characters
    • article can not have negative available stock

🛠️ Tech-Stack

Java Spring

  • Java 8
  • Spring-Boot
  • Apache Camel
  • JPA
  • In-Memory Database H2
  • Maven
  • Git bash

Database diagram

image

📝 Steps to run the application

  • Checkout the code / Download from git repo()
  • checkout : open git bash and run command git clone https://github.com/Abhinav2510/warehouse.git
  • Option 1: Maven way of running
    • open command prompt(cmd) or terminal on Mac
    • navigate to the project folder
    • run command mvn clean install
    • once its successfully build run command mvn spring-boot: run

Now application is up and running on http://localhost:8080/

❔ How to use this service

🗳️ Load Articles/products

  • Apache Camel routes are configured to pick inventory.json and product.json from c:/folder1
  • Load Articles by placing inventory.json in c:/folder1
  • Load Products by placing products.json in c:/folder1
  • failure in one record will not break loaders instead failed record will be in c:/folder1/failure/inventory or c:/folder1/failure/inventory

🕸️ get products and sell product

  • Open the URL in your browser : http://localhost:8080
  • User will see a swagger page with all the defined specs of the service.
  • There will have 2 Tags you can see.

1. inventory-product-controller

Description:

  • Endpoint 1: GET /inventory/product
    • get all the products with pagination suppoty
  • Endpoint 2: POST /inventory/product
    • Allows user to sell quantity of product specified in post request body

🧪 Testing using Swagger UI

Running application

image

About

warehouse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages