{"action":"created","comment":{"url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/comments/128973593","pull_request_review_id":51699392,"id":128973593,"diff_hunk":"@@ -0,0 +1,68 @@\n+const mongoose = require('mongoose');\n+\n+const Model = require('./');\n+\n+mongoose.Promise = global.Promise;\n+const Schema = mongoose.Schema;\n+\n+const IngredientSchema = new Schema({\n+  name: {\n+    type: String,\n+    required: [true, 'Ingredient name is required'],\n+    lowercase: true,\n+    validate: {\n+      validator(v) {\n+        return new Promise(resolve => {\n+          resolve(v && v.length > 2);\n+        });\n+      },\n+      message: 'Ingredient name should be greater than two characters'\n+    },\n+  },\n+  quantity: {\n+    type: Number,\n+    lowercase: true,\n+    default: 0\n+  },\n+  unit: {\n+    type: String,\n+    validate: {\n+      validator(unit) {\n+        return new Promise(resolve => {\n+          if (this.quantity && (unit && unit.length > 0)) {\n+            return resolve(true);\n+          }\n+          resolve(false);\n+        });\n+      },\n+      message: 'Quantity is required if unit is supplied'\n+    }\n+  },\n+  recipeId: {\n+    type: String,\n+    required: [true, 'Recipe id is required']\n+  }\n+}, {\n+  timestamps:\n+    { createdAt: 'created_at',","path":"app/models/ingredient.js","position":47,"original_position":47,"commit_id":"891a39ba5c071cbe9f47cf213d613d29bd05be36","original_commit_id":"891a39ba5c071cbe9f47cf213d613d29bd05be36","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected indentation of 2 spaces but found 4  indent","created_at":"2017-07-24T08:13:40Z","updated_at":"2017-07-24T08:13:40Z","html_url":"https://github.com/enahomurphy/micro-recipe/pull/2#discussion_r128973593","pull_request_url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/comments/128973593"},"html":{"href":"https://github.com/enahomurphy/micro-recipe/pull/2#discussion_r128973593"},"pull_request":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2","id":131993321,"html_url":"https://github.com/enahomurphy/micro-recipe/pull/2","diff_url":"https://github.com/enahomurphy/micro-recipe/pull/2.diff","patch_url":"https://github.com/enahomurphy/micro-recipe/pull/2.patch","issue_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/2","number":2,"state":"open","locked":false,"title":"Recipe service","user":{"login":"enahomurphy","id":13594802,"avatar_url":"https://avatars0.githubusercontent.com/u/13594802?v=4","gravatar_id":"","url":"https://api.github.com/users/enahomurphy","html_url":"https://github.com/enahomurphy","followers_url":"https://api.github.com/users/enahomurphy/followers","following_url":"https://api.github.com/users/enahomurphy/following{/other_user}","gists_url":"https://api.github.com/users/enahomurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/enahomurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahomurphy/subscriptions","organizations_url":"https://api.github.com/users/enahomurphy/orgs","repos_url":"https://api.github.com/users/enahomurphy/repos","events_url":"https://api.github.com/users/enahomurphy/events{/privacy}","received_events_url":"https://api.github.com/users/enahomurphy/received_events","type":"User","site_admin":false},"body":"### Title\r\n   - Create recipe service\r\n### Description \r\n  - This PR Adds the ability for users to create, read, update and delete recipes, ingredients and categories.\r\n#### SUMMARY\r\n  - When service is pulled and started, the user should have the ability to perform crud operations for creating, editing updating and deleting recipes and related models.\r\n\r\n### Dev Notes \r\n  - You can run this service using locally installed node and mongo DB installation\r\n  - You can also use docker-compose to run the service\r\n\r\n### How to use\r\n - Clone repository \r\n- Cd into the recipe folder\r\n- create a .env file for the .env.sample file\r\n- Add your DB_URL and NODE_ENV\r\n- run \"npm start\"\r\n- make your API calls to localhost:8080/api/v1/recipes\r\n\r\n\r\n###  Available endpoints\r\n\r\n\r\nverbs | endpoints | description\r\n-- | -- | --\r\nGET | /recipes | Get all recipes\r\nPOST | /recipes | Creates new recipe\r\nPATCH | /recipes/<id> | Updates a recipe\r\nDELETE | /recipes/<id> | Deletes a recipe\r\nGET | /recipes/<id> | Gets a single recipe\r\n|  |\r\nGET | /categories | Gets all categories\r\nPOST | /categories | Creates a new category\r\nPATCH | /categories/<id> | Updates a category\r\nDELETE | /categories/<id> | Deletes a category\r\nGET | /categories/<id> | Gets a single category\r\nGET | /categories/<id>/recipes | Gets all recipe that belongs to a category\r\nGET | /categories?q={query} | Searches for categories\r\nGET | /categories?limit={limit} | Limits categories\r\nGET | /categories?page={page} | paginates categories\r\n  |   |  \r\nGET | /recipes/<id>/ingredients | Gets all ingredients related to recipe\r\nGET | /recipe/<id>/ingredients | Gets all ingredients\r\nPOST | /recipe/<id>/ingredients | Creates new ingredients\r\nPATCH | /ingredients/<id> | Updates an ingredient\r\nDELETE | /ingredients/<id> | Deletes an ingredient\r\nGET | /ingredients/<id> | Gets a single ingredient\r\nGET | /recipe/<id>/ingredients?q={query} | Searches for ingredients\r\nGET | /recipe/<id>/ingredients?limit={limit} | limits search result\r\nGET | /recipe/<id>/ingredients?page={page} | paginates result set\r\n\r\n","created_at":"2017-07-24T08:13:23Z","updated_at":"2017-07-24T08:13:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cbe729582c27bbe9cf098a04aa6095c776bf022f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2/commits","review_comments_url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2/comments","review_comment_url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/2/comments","statuses_url":"https://api.github.com/repos/enahomurphy/micro-recipe/statuses/891a39ba5c071cbe9f47cf213d613d29bd05be36","head":{"label":"enahomurphy:recipe-service","ref":"recipe-service","sha":"891a39ba5c071cbe9f47cf213d613d29bd05be36","user":{"login":"enahomurphy","id":13594802,"avatar_url":"https://avatars0.githubusercontent.com/u/13594802?v=4","gravatar_id":"","url":"https://api.github.com/users/enahomurphy","html_url":"https://github.com/enahomurphy","followers_url":"https://api.github.com/users/enahomurphy/followers","following_url":"https://api.github.com/users/enahomurphy/following{/other_user}","gists_url":"https://api.github.com/users/enahomurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/enahomurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahomurphy/subscriptions","organizations_url":"https://api.github.com/users/enahomurphy/orgs","repos_url":"https://api.github.com/users/enahomurphy/repos","events_url":"https://api.github.com/users/enahomurphy/events{/privacy}","received_events_url":"https://api.github.com/users/enahomurphy/received_events","type":"User","site_admin":false},"repo":{"id":96758910,"name":"micro-recipe","full_name":"enahomurphy/micro-recipe","owner":{"login":"enahomurphy","id":13594802,"avatar_url":"https://avatars0.githubusercontent.com/u/13594802?v=4","gravatar_id":"","url":"https://api.github.com/users/enahomurphy","html_url":"https://github.com/enahomurphy","followers_url":"https://api.github.com/users/enahomurphy/followers","following_url":"https://api.github.com/users/enahomurphy/following{/other_user}","gists_url":"https://api.github.com/users/enahomurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/enahomurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahomurphy/subscriptions","organizations_url":"https://api.github.com/users/enahomurphy/orgs","repos_url":"https://api.github.com/users/enahomurphy/repos","events_url":"https://api.github.com/users/enahomurphy/events{/privacy}","received_events_url":"https://api.github.com/users/enahomurphy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/enahomurphy/micro-recipe","description":"recipe microservice ","fork":false,"url":"https://api.github.com/repos/enahomurphy/micro-recipe","forks_url":"https://api.github.com/repos/enahomurphy/micro-recipe/forks","keys_url":"https://api.github.com/repos/enahomurphy/micro-recipe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enahomurphy/micro-recipe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enahomurphy/micro-recipe/teams","hooks_url":"https://api.github.com/repos/enahomurphy/micro-recipe/hooks","issue_events_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/events{/number}","events_url":"https://api.github.com/repos/enahomurphy/micro-recipe/events","assignees_url":"https://api.github.com/repos/enahomurphy/micro-recipe/assignees{/user}","branches_url":"https://api.github.com/repos/enahomurphy/micro-recipe/branches{/branch}","tags_url":"https://api.github.com/repos/enahomurphy/micro-recipe/tags","blobs_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/refs{/sha}","trees_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enahomurphy/micro-recipe/statuses/{sha}","languages_url":"https://api.github.com/repos/enahomurphy/micro-recipe/languages","stargazers_url":"https://api.github.com/repos/enahomurphy/micro-recipe/stargazers","contributors_url":"https://api.github.com/repos/enahomurphy/micro-recipe/contributors","subscribers_url":"https://api.github.com/repos/enahomurphy/micro-recipe/subscribers","subscription_url":"https://api.github.com/repos/enahomurphy/micro-recipe/subscription","commits_url":"https://api.github.com/repos/enahomurphy/micro-recipe/commits{/sha}","git_commits_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/commits{/sha}","comments_url":"https://api.github.com/repos/enahomurphy/micro-recipe/comments{/number}","issue_comment_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/comments{/number}","contents_url":"https://api.github.com/repos/enahomurphy/micro-recipe/contents/{+path}","compare_url":"https://api.github.com/repos/enahomurphy/micro-recipe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enahomurphy/micro-recipe/merges","archive_url":"https://api.github.com/repos/enahomurphy/micro-recipe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enahomurphy/micro-recipe/downloads","issues_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues{/number}","pulls_url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls{/number}","milestones_url":"https://api.github.com/repos/enahomurphy/micro-recipe/milestones{/number}","notifications_url":"https://api.github.com/repos/enahomurphy/micro-recipe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enahomurphy/micro-recipe/labels{/name}","releases_url":"https://api.github.com/repos/enahomurphy/micro-recipe/releases{/id}","deployments_url":"https://api.github.com/repos/enahomurphy/micro-recipe/deployments","created_at":"2017-07-10T09:17:26Z","updated_at":"2017-07-10T09:17:26Z","pushed_at":"2017-07-24T08:13:25Z","git_url":"git://github.com/enahomurphy/micro-recipe.git","ssh_url":"git@github.com:enahomurphy/micro-recipe.git","clone_url":"https://github.com/enahomurphy/micro-recipe.git","svn_url":"https://github.com/enahomurphy/micro-recipe","homepage":null,"size":77,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"enahomurphy:master","ref":"master","sha":"b7da1c97d2440c753663b7bf77fc0880b7042c45","user":{"login":"enahomurphy","id":13594802,"avatar_url":"https://avatars0.githubusercontent.com/u/13594802?v=4","gravatar_id":"","url":"https://api.github.com/users/enahomurphy","html_url":"https://github.com/enahomurphy","followers_url":"https://api.github.com/users/enahomurphy/followers","following_url":"https://api.github.com/users/enahomurphy/following{/other_user}","gists_url":"https://api.github.com/users/enahomurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/enahomurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahomurphy/subscriptions","organizations_url":"https://api.github.com/users/enahomurphy/orgs","repos_url":"https://api.github.com/users/enahomurphy/repos","events_url":"https://api.github.com/users/enahomurphy/events{/privacy}","received_events_url":"https://api.github.com/users/enahomurphy/received_events","type":"User","site_admin":false},"repo":{"id":96758910,"name":"micro-recipe","full_name":"enahomurphy/micro-recipe","owner":{"login":"enahomurphy","id":13594802,"avatar_url":"https://avatars0.githubusercontent.com/u/13594802?v=4","gravatar_id":"","url":"https://api.github.com/users/enahomurphy","html_url":"https://github.com/enahomurphy","followers_url":"https://api.github.com/users/enahomurphy/followers","following_url":"https://api.github.com/users/enahomurphy/following{/other_user}","gists_url":"https://api.github.com/users/enahomurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/enahomurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahomurphy/subscriptions","organizations_url":"https://api.github.com/users/enahomurphy/orgs","repos_url":"https://api.github.com/users/enahomurphy/repos","events_url":"https://api.github.com/users/enahomurphy/events{/privacy}","received_events_url":"https://api.github.com/users/enahomurphy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/enahomurphy/micro-recipe","description":"recipe microservice ","fork":false,"url":"https://api.github.com/repos/enahomurphy/micro-recipe","forks_url":"https://api.github.com/repos/enahomurphy/micro-recipe/forks","keys_url":"https://api.github.com/repos/enahomurphy/micro-recipe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/enahomurphy/micro-recipe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/enahomurphy/micro-recipe/teams","hooks_url":"https://api.github.com/repos/enahomurphy/micro-recipe/hooks","issue_events_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/events{/number}","events_url":"https://api.github.com/repos/enahomurphy/micro-recipe/events","assignees_url":"https://api.github.com/repos/enahomurphy/micro-recipe/assignees{/user}","branches_url":"https://api.github.com/repos/enahomurphy/micro-recipe/branches{/branch}","tags_url":"https://api.github.com/repos/enahomurphy/micro-recipe/tags","blobs_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/refs{/sha}","trees_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/enahomurphy/micro-recipe/statuses/{sha}","languages_url":"https://api.github.com/repos/enahomurphy/micro-recipe/languages","stargazers_url":"https://api.github.com/repos/enahomurphy/micro-recipe/stargazers","contributors_url":"https://api.github.com/repos/enahomurphy/micro-recipe/contributors","subscribers_url":"https://api.github.com/repos/enahomurphy/micro-recipe/subscribers","subscription_url":"https://api.github.com/repos/enahomurphy/micro-recipe/subscription","commits_url":"https://api.github.com/repos/enahomurphy/micro-recipe/commits{/sha}","git_commits_url":"https://api.github.com/repos/enahomurphy/micro-recipe/git/commits{/sha}","comments_url":"https://api.github.com/repos/enahomurphy/micro-recipe/comments{/number}","issue_comment_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/comments{/number}","contents_url":"https://api.github.com/repos/enahomurphy/micro-recipe/contents/{+path}","compare_url":"https://api.github.com/repos/enahomurphy/micro-recipe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/enahomurphy/micro-recipe/merges","archive_url":"https://api.github.com/repos/enahomurphy/micro-recipe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/enahomurphy/micro-recipe/downloads","issues_url":"https://api.github.com/repos/enahomurphy/micro-recipe/issues{/number}","pulls_url":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls{/number}","milestones_url":"https://api.github.com/repos/enahomurphy/micro-recipe/milestones{/number}","notifications_url":"https://api.github.com/repos/enahomurphy/micro-recipe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/enahomurphy/micro-recipe/labels{/name}","releases_url":"https://api.github.com/repos/enahomurphy/micro-recipe/releases{/id}","deployments_url":"https://api.github.com/repos/enahomurphy/micro-recipe/deployments","created_at":"2017-07-10T09:17:26Z","updated_at":"2017-07-10T09:17:26Z","pushed_at":"2017-07-24T08:13:25Z","git_url":"git://github.com/enahomurphy/micro-recipe.git","ssh_url":"git@github.com:enahomurphy/micro-recipe.git","clone_url":"https://github.com/enahomurphy/micro-recipe.git","svn_url":"https://github.com/enahomurphy/micro-recipe","homepage":null,"size":77,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2"},"html":{"href":"https://github.com/enahomurphy/micro-recipe/pull/2"},"issue":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/2"},"comments":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/enahomurphy/micro-recipe/statuses/891a39ba5c071cbe9f47cf213d613d29bd05be36"}}}}
{"actor":{"display_login":"houndci-bot"}}