The WareHouse API Backend allows performing following operation.
- Data Loaders
- Load all articles from
inventory.json
specified by location inapplication.properties
- Load all Products from
products.json
specified by location inapplication.properties
- Maintains quantity of products available for sell based on underlying Article inventory in system
- Load all articles from
- 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
- 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
- Java 8
- Spring-Boot
- Apache Camel
- JPA
- In-Memory Database H2
- Maven
- Git bash
- 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/
- Apache Camel routes are configured to pick inventory.json and product.json from c:/folder1
- Load Articles by placing
inventory.json
inc:/folder1
- Load Products by placing
products.json
inc:/folder1
- failure in one record will not break loaders instead failed record will be in
c:/folder1/failure/inventory
orc:/folder1/failure/inventory
- 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.
- 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
- Run application using
mvn spring-boot: run
- Navigate to http://localhost:8080