Here is a SQLite database for a music store. Here is a layout of the tables.
Your job is to build a REST API which allows basic CRUD operations (Create [POST], Read [GET], Update [PUT], Destroy [DELETE]) on this database. Pretend that you are part of a web development team building an internal site for employees to look things up. You should expect JSON-in and JSON-out. (Use Cloud9, or your own host, and make sure Matthew and I have access to run the code.)
GET /customershould return an array of JSON objects having CustomerId, FirstName, LastName, and Email.
GET /customer/:CustomerIdshould return a JSON object with all of the information about a customer
GET /customer/:CustomerId/invoiceshould return an array of JSON objects having InvoiceId, InvoiceDate, and Total
GET /customer/:CustomerId/invoice/:InvoiceIdshould return a JSON object having all information about that invoice plus the key
InvoiceLineswith value an array of JSON objects having TrackId, (track) Name, (album) Title, (artist) Name, (genre) Name, UnitPrice, and Quantity
POST /customer/should take in data about a new Customer, create the customer, and return the same as
GET /customer/:CustomerId, most importantly the new CustomerId
PUT /customer/:CustomerIdshould update a customer using the given data
DELETE /customer/:CustomerIdshould delete the customer
GET /playlistshould return an array of JSON objects with
GET /playlist/:PlaylistIdshould return an array of JSON objects, each with information about the appropriate tracks from that playlist (you can pick, but enough for a web-app running from this data to show interesting things about each track).
GET /revenueshould return an array of JSON objects each providing the revenue of the store in a given month
GET /revenue[/:year[/:month[/:day]]]should return a single JSON object giving the revenue for the requested period