A ReST API exposing merchant, item, and aggregated revenue data for an e-commerce application using a service-oriented architecture.
GET /items
or GET /merchants
-
These endpoints take optional
page
andper_page
parameters to specify number and format of items returned -
Defaults to 20 items per page and first page if not specified
GET /items/:id
or GET /merchants/:id
POST /items
- Accepts the following JSON body with only the following fields:
{
"name": "value1",
"description": "value2",
"unit_price": 100.99,
"merchant_id": 14
}
(Note that the unit price is to be sent as a numeric value, not a string.)
PATCH /items
- Accepts the following JSON body with one or more of the following fields:
{
"name": "value1",
"description": "value2",
"unit_price": 100.99,
"merchant_id": 7
}
(Note that the unit price is to be sent as a numeric value, not a string.)
DELETE /items
GET /merchants/:id/items
GET /items/:id/merchant
GET /merchants/find
- Requires a
find
parameter with a string or string fragment to search
GET /items/find_all
-
Requires EITHER a
name
parameter OR price parameters -
Price parameters allowed include:
min_price
,max_price
, or both -
name
parameter will search all item names AND descriptions for the string or string fragment -
Prices must be formatted as numeric values, e.g.:
4.99
or939.01
GET /revenue
- Requires both
start
andend
date parameters inYYYY-MM-DD
format
GET /revenue/items
-
Defaults to the top 10 items
-
Takes optional
quantity
parameter to specify number of items returned
GET /revenue/merchants/:id
GET /revenue/weekly
- Project was developed using a TDD approach (RSpec)
- FactoryBot and Faker were used to generate mock data
- Simplecov was used to track total test coverage (100% covered)
- Gems Used:
- Use
$ bundle exec rspec
to run the full test suite - To see a coverage report enter
$ open coverage/index.html
-
Ruby 2.7.2
-
Rails 2.5.3
Molly Krumholz is a backend developer who loves to adventure on two feet or two wheels (only one board though 🏂). Things she finds satisfying include: thoroughly testing code, refactoring gnarly ActiveRecord queries, and making code run even just slightly faster.