This project is an API sales data analysis tool. The return format for all endpoints is JSON.
The markdown for this project can be found here
-Ashley Schauer github
-Alex Fosco github
Clone the repo in your terminal:
git clone https://github.com/AELSchauer/turing-rails_engine_api.git
Navigate into the project:
cd turing-rails_engine_api
Bundle:
bundle install
Create, migrate, and seed your database:
rake db:create
rake db:migrate
rake db:seed
Run rspec
in your terminal to ensure all tests are passing.
You can visit these endpoints to see a JSON response.
In your terminal, start a local server: rails s
Open your browser to localhost:3000
GET
/api/v1/merchantsGET
/api/v1/merchants/:idGET
/api/v1/merchants/randomGET
/api/v1/customersGET
/api/v1/customers/:idGET
/api/v1/customers/randomGET
/api/v1/itemsGET
/api/v1/items/:idGET
/api/v1/items/randomGET
/api/v1/invoicesGET
/api/v1/invoices/:idGET
/api/v1/invoices/randomGET
/api/v1/invoice_itemsGET
/api/v1/invoice_items/:idGET
/api/v1/invoice_items/randomGET
/api/v1/transactionsGET
/api/v1/transactions/:idGET
/api/v1/transactions/randomGET
/api/v1/merchants/:id/items returns a collection of items associated with that merchantGET
/api/v1/merchants/:id/invoices returns a collection of invoices associated with that merchant from their known ordersGET
/api/v1/invoices/:id/transactions returns a collection of associated transactionsGET
/api/v1/invoices/:id/invoice_items returns a collection of associated invoice itemsGET
/api/v1/invoices/:id/items returns a collection of associated itemsGET
/api/v1/invoices/:id/customer returns the associated customerGET
/api/v1/invoices/:id/merchant returns the associated merchantGET
/api/v1/invoice_items/:id/invoice returns the associated invoiceGET
/api/v1/invoice_items/:id/item returns the associated itemGET
/api/v1/items/:id/invoice_items returns a collection of associated invoice items
GET
/api/v1/items/:id/merchant returns the associated merchant
GET
/api/v1/transactions/:id/invoice returns the associated invoice
GET
/api/v1/customers/:id/invoices returns a collection of associated invoicesGET
/api/v1/customers/:id/transactions returns a collection of associated transactionsGET
/api/v1/merchants/most_revenue?quantity=x returns the top x merchants ranked by total revenueGET
/api/v1/merchants/most_items?quantity=x returns the top x merchants ranked by total number of items soldGET
/api/v1/merchants/revenue?date=x returns the total revenue for date x across all merchantsGET
/api/v1/merchants/:id/revenue returns the total revenue for that merchant across all transactionsGET
/api/v1/merchants/:id/revenue?date=x returns the total revenue for that merchant for a specific invoice date xGET
/api/v1/merchants/:id/favorite_customer returns the customer who has conducted the most total number of successful transactions.GET
/api/v1/items/most_revenue?quantity=x returns the top x items ranked by total revenue generatedGET
/api/v1/items/most_items?quantity=x returns the top x item instances ranked by total number soldGET
/api/v1/items/:id/best_day returns the date with the most sales for the given item using the invoice date. If there are multiple days with equal number of sales, return the most recent day.GET
/api/v1/customers/:id/favorite_merchant returns a merchant where the customer has conducted the most successful transactions