Skip to content

imFawkes/stocks

Repository files navigation

README

Ruby vesion 2.7.2, Rails version 6.1.1

How to test:

Clone app:
git clone https://github.com/imFawkes/stocks_api <directory>

Add gems:
bundle install

Setup DB:
rails db:setup

Run server in one terminal window:
rails s

Use curl in anoter terminal window to test:

transfer products from one warehouse to another:
curl -i -d '{"warehouse_id":"1", "new_warehouse_id":"2", "quantity":"5"}' -H "Content-Type: application/json" -X POST http://localhost:3000/products/1/transfer

sell products with passed quantity:
curl -i -d '{"product_id":"2", "quantity":"5"}' -H "Content-Type: application/json" -X POST http://localhost:3000/products/2/sell

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages