From 71a2f279073d08e090bcee036cf0bbf54dde7e60 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 22 Feb 2014 12:22:40 -0700 Subject: add solution notes to readme. --- README.md | 54 +++++++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c25095b..7a74feb 100644 --- a/README.md +++ b/README.md @@ -57,52 +57,40 @@ A typical well license has the following structure (all fields are required): 3. This private Github repo has been created just for you. Please push your code to it for review. -## Design (Rough) +### Solution -### Assumptions +This solution is hosted on heroku at: [http://infinite-atoll-2481.herokuapp.com](http://infinite-atoll-2481.herokuapp.com) -* Name of applicant is the name of the employee at the company that submitted the application. -* Date of license is the date the license was issued. -* Assume perf isn't the focus, so no need to over-engineer with a denorm read model. - -### Model +#### Endpoints -WellLicense (aggregate root) -* belongs_to applicant -* belongs_to well_type -* belongs_to location -* issued_at -* expired_at +There are 3 different endpoints that serve these requirements. An +example of how to connect to the endpoints can be found in bin/acceptance.sh. -WellType (flyweight value object) -* id -* name - -Applicant -* company +* GET /licenses - list of all well licenses +* GET /licenses/:guid - details of a single license +* GET /companies/:guid/licenses - list of all active licences for company +* GET /companies/:guid/licenses?township=:township - list of active licenses for township, for company. +* GET /companies/:guid/licenses?status=expired&township=:township - list of expired licenses for township, for company. -Location (value object) -* latitude -* longitude -* township +#### Design (Rough) -LicenseStatus (flyweight, state) -* id +##### Assumptions -### Endpoints +* Name of applicant is the name of the employee at the company that submitted the application. +* Date of license is the date the license was issued. +* Assume perf isn't the focus, so no need to over-engineer with a denorm read model. -* GET /licenses - list of all well licenses -* GET /licenses/:guid - details of a single license -* GET /company/:guid/licenses - list of all active licences for company -* GET /company/:guid/licenses?township=:township - list of active licenses for township, for company. -* GET /company/:guid/licenses?status=expired&township=:township - list of expired licenses for township, for company. +##### todo -#### todo * rename license to well license * move secret token to env variable. * cache additional payload data. +* resolve n+1 issues +* figure out why location doesn't lazy load in jbuilder template. + +##### nice to haves -#### nice to haves * simplecov * factory girl * dotenv +* bullet -- cgit v1.2.3