- Run
bundle
- Run
rails db:{create,migrate}
- To import all CSV data run
rake import:all
- To import individual CSVs run
rake import:'csv_file'
where 'csv_file' can be:- merchants
- items
- customers
- invoices
- invoice_items
- transactions
- Example:
rake import:merchants
HTTP Request: GET /api/v1/merchants
HTTP Request: GET /api/v1/merchants/{id}
HTTP Request: GET /api/v1/merchants/find?{parameters}
Parameter | Description |
---|---|
id | search based on the merchant's primary key |
name | search based on the merchant's name |
created_at | search based on the time created at |
updated_at | search based on the time updated at |
HTTP Request: GET /api/v1/merchants/find_all?{parameters}
Parameter | Description |
---|---|
id | search based on the merchant's primary key |
name | search based on the merchant's name |
created_at | search based on the time created at |
updated_at | search based on the time updated at |
HTTP Request: GET /api/v1/merchants/{merchant id}/items
HTTP Request: GET /api/v1/merchants/{merchant id}/invoices
HTTP Request: GET /api/v1/merchants/most_revenue?quantity={number of merchants}
HTTP Request: GET /api/v1/merchants/most_items?quantity={number of merchants}
HTTP Request: GET /api/v1/merchants/revenue?date={date}
Date Format: 2012-03-23
HTTP Request: GET /api/v1/merchants/{merchant id}/revenue
HTTP Request: GET /api/v1/merchants/{merchant id}/revenue?date={date}
Date Format: 2012-03-23
HTTP Request: GET /api/v1/merchants/{merchant id}/favorite_customer
HTTP Request: GET /api/v1/invoices
HTTP Request: GET /api/v1/invoices/{id}
HTTP Request: GET /api/v1/invoices/find?{parameters}
Parameter | Description |
---|---|
id | search based on the invoice's primary key |
customer_id | search based on the invoice's customer |
merchant_id | search based on the invoice's merchant |
status | search based on the invoice's status |
created_at | search based on the time created at |
updated_at | search based on the time updated at |
HTTP Request: GET /api/v1/invoices/find_all?{parameters}
Parameter | Description |
---|---|
id | search based on the invoice's primary key |
customer_id | search based on the invoice's customer |
merchant_id | search based on the invoice's merchant |
status | search based on the invoice's status |
created_at | search based on the time created at |
updated_at | search based on the time updated at |
HTTP Request: GET /api/v1/invoices/{invoice id}/transactions
HTTP Request: GET /api/v1/invoices/{invoice id}/invoice_items