summaryrefslogtreecommitdiff
path: root/SOLUTION.md
blob: 21f2934633dc14dba5ca898db3f74209e2843e64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
### Solution

This solution is hosted on heroku at: [http://damp-scrubland-3368.herokuapp.com](http://damp-scrubland-3368.herokuapp.com)

#### Endpoints

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](bin/acceptance.sh)

* 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.

##### Assumptions

* 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.

##### TODO

* 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.
* rename license to well license

##### nice to haves

* simplecov
* factory girl
* dotenv
* bullet