{"action":"closed","issue":{"url":"https://api.github.com/repos/inetCatapult/service-maker/issues/56","labels_url":"https://api.github.com/repos/inetCatapult/service-maker/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/inetCatapult/service-maker/issues/56/comments","events_url":"https://api.github.com/repos/inetCatapult/service-maker/issues/56/events","html_url":"https://github.com/inetCatapult/service-maker/issues/56","id":91839996,"number":56,"title":"Create the Instance data model and connect it to a database","user":{"login":"a-type","id":2829772,"avatar_url":"https://avatars.githubusercontent.com/u/2829772?v=3","gravatar_id":"","url":"https://api.github.com/users/a-type","html_url":"https://github.com/a-type","followers_url":"https://api.github.com/users/a-type/followers","following_url":"https://api.github.com/users/a-type/following{/other_user}","gists_url":"https://api.github.com/users/a-type/gists{/gist_id}","starred_url":"https://api.github.com/users/a-type/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-type/subscriptions","organizations_url":"https://api.github.com/users/a-type/orgs","repos_url":"https://api.github.com/users/a-type/repos","events_url":"https://api.github.com/users/a-type/events{/privacy}","received_events_url":"https://api.github.com/users/a-type/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/inetCatapult/service-maker/milestones/1","html_url":"https://github.com/inetCatapult/service-maker/milestones/1.0.0","labels_url":"https://api.github.com/repos/inetCatapult/service-maker/milestones/1/labels","id":1177703,"number":1,"title":"1.0.0","description":"Basic functionality to support a single-tenant production use case with custom built AMIs.","creator":{"login":"jagoda","id":655686,"avatar_url":"https://avatars.githubusercontent.com/u/655686?v=3","gravatar_id":"","url":"https://api.github.com/users/jagoda","html_url":"https://github.com/jagoda","followers_url":"https://api.github.com/users/jagoda/followers","following_url":"https://api.github.com/users/jagoda/following{/other_user}","gists_url":"https://api.github.com/users/jagoda/gists{/gist_id}","starred_url":"https://api.github.com/users/jagoda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jagoda/subscriptions","organizations_url":"https://api.github.com/users/jagoda/orgs","repos_url":"https://api.github.com/users/jagoda/repos","events_url":"https://api.github.com/users/jagoda/events{/privacy}","received_events_url":"https://api.github.com/users/jagoda/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":24,"state":"open","created_at":"2015-06-23T16:18:28Z","updated_at":"2015-07-13T15:42:29Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-06-29T15:41:20Z","updated_at":"2015-07-13T15:42:29Z","closed_at":"2015-07-13T15:42:29Z","body":"Define a schema (using [Joi](https://github.com/hapijs/joi) is recommended) for the `Instance` model as documented [here](https://github.com/inetCatapult/service-maker/blob/v1.0/doc/API.md). Connect the application to a database (MongoDB or PostgreSQL) and create an adapter which will create new Instances and store them in the database.\r\n\r\nTo test functionality, stub the database connector API using [Sinon](http://sinonjs.org/). When you create a new Instance using your adapter class, you should see the appropriate create methods being called on the stub, with the correct arguments. Test different cases and situations:\r\n\r\n* Creating a new, valid Instance\r\n* Creating an Instance with invalid properties\r\n* Creating an Instance when the database connector is not working (have the stub return an error)\r\n\r\nMake sure the cases behave as expected."}}