Rails Engine is a JSON API which exposes the SalesEngine data schema.
-
git clone [email protected]:MDes41/rails_engine.git -
Bundle gem file:
bundle -
Set up database:
rake db:{create,migrate} -
Seed database with
rake import
- 5.0.0.1
GET /api/v1/merchants.jsonreturns an index of all merchantsGET /api/v1/merchants1.jsonreturns merchant with an id of 1
GET /api/v1/merchants/find?name=Schroeder-Jerdefinds merchant with name of Schroeder-Jerde
GET /api/v1/merchants/find_all?name=Cummings-Thielfinds all merchants with name of Cummings-Thiel
api/v1/merchants/random.jsonreturns a random merchant
GET /api/v1/merchants/:id/itemsreturns a collection of items associated with that merchantGET /api/v1/merchants/:id/invoicesreturns a collection of invoices associated with that merchant from their known orders
GET /api/v1/invoices/:id/transactionsreturns a collection of associated transactionsGET /api/v1/invoices/:id/invoice_itemsreturns a collection of associated invoice itemsGET /api/v1/invoices/:id/itemsreturns a collection of associated itemsGET /api/v1/invoices/:id/customerreturns the associated customerGET /api/v1/invoices/:id/merchantreturns the associated merchant
GET /api/v1/invoice_items/:id/invoicereturns the associated invoiceGET /api/v1/invoice_items/:id/itemreturns the associated item
GET /api/v1/items/:id/invoice_itemsreturns a collection of associated invoice itemsGET /api/v1/items/:id/merchantreturns the associated merchant
GET /api/v1/transactions/:id/invoicereturns the associated invoice
GET /api/v1/customers/:id/invoicesreturns a collection of associated invoicesGET /api/v1/customers/:id/transactionsreturns a collection of associated transactions
GET /api/v1/merchants/most_revenue?quantity=xreturns the top x merchants ranked by total revenueGET /api/v1/merchants/most_items?quantity=xreturns the top x merchants ranked by total number of items soldGET /api/v1/merchants/revenue?date=xreturns the total revenue for date x across all merchants
GET /api/v1/merchants/:id/revenuereturns the total revenue for that merchant across all transactionsGET /api/v1/merchants/:id/revenue?date=xreturns the total revenue for that merchant for a specific invoice date xGET /api/v1/merchants/:id/favorite_customerreturns the customer who has conducted the most total number of successful transactions.
GET /api/v1/items/most_revenue?quantity=xreturns the top x items ranked by total revenue generated
GET /api/v1/customers/:id/favorite_merchantreturns a merchant where the customer has conducted the most successful transactions
Brad Green
Matt DeMarteau