{"action":"created","comment":{"url":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments/131165648","pull_request_review_id":54120226,"id":131165648,"diff_hunk":"@@ -61,52 +61,50 @@ module.exports = class StockAvailabilityManager extends BaseManager {\n         // });\n         return new Promise((resolve, reject) => {\n             let id = new ObjectId(storageId);\n-            var find = { \"storage._id\": id };\n+            var find = { \"storage._id\": id, _deleted: false };\n             var sort = { quantity: 1 };\n             this.collection.find(find).sort(sort)\n-                .toArray((err, result) => {\n+                .toArray(result => {\n                     resolve(result);\n                 })\n         });\n     }\n \n-\n     getNearestStock(inventoryId) {\n         let id = new ObjectId(inventoryId);\n         let inventory = new Promise((resolve, reject) => {\n-            this.collection.find({ _id: id })\n-                .toArray((err, result) => {\n+            this.collection.find({ _id: id, _deleted: false })\n+                .toArray(result => {\n                     resolve(result);\n                 });\n         });\n         let inventoryDb = new Promise((resolve, reject) => {\n             inventory.then(result => {\n                 this.collection.find({ \"item.code\": result[0].item.code })\n-                    .toArray((err, result) => {\n+                    .toArray(result => {\n                         resolve(result);\n                     })\n             })\n         });\n         let storeDb = new Promise((resolve, reject) => {\n-            this.storeCollection.find()\n-                .toArray((err, result) => {\n+            this.storeCollection.find({ _deleted: false })\n+                .toArray(result => {\n                     resolve(result);\n                 });\n         });\n         let invMovementDb = new Promise((resolve, reject) => {\n-            this.invMovementCollection.find()\n-                .toArray((err, result) => {\n+            this.invMovementCollection.find({ _deleted: false })\n+                .toArray(result => {\n                     resolve(result);\n                 });\n         });\n         return new Promise((resolve, reject) => {\n             Promise.all([inventoryDb, storeDb, invMovementDb])\n-                .then(array => {\n-                    let inventoryArray = array[0];\n-                    let storeArray = array[1];\n-                    let invMovementArray = array[2];\n+                .then(result => {\n+                    let inventoryArray = result[0];\n+                    let storeArray = result[1];\n+                    let invMovementArray = result[2];","path":"src/managers/inventory/stock-availability-manager.js","position":60,"original_position":60,"commit_id":"bcc87d8a45904d8c605c9a208feaacd3f9819406","original_commit_id":"bcc87d8a45904d8c605c9a208feaacd3f9819406","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":"'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).","created_at":"2017-08-03T14:55:31Z","updated_at":"2017-08-03T14:55:32Z","html_url":"https://github.com/danliris/bateeq-module/pull/354#discussion_r131165648","pull_request_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/354","_links":{"self":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments/131165648"},"html":{"href":"https://github.com/danliris/bateeq-module/pull/354#discussion_r131165648"},"pull_request":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/354"}}},"pull_request":{"url":"https://api.github.com/repos/danliris/bateeq-module/pulls/354","id":133965909,"html_url":"https://github.com/danliris/bateeq-module/pull/354","diff_url":"https://github.com/danliris/bateeq-module/pull/354.diff","patch_url":"https://github.com/danliris/bateeq-module/pull/354.patch","issue_url":"https://api.github.com/repos/danliris/bateeq-module/issues/354","number":354,"state":"open","locked":false,"title":"Dev","user":{"login":"fendywillyam","id":24405641,"avatar_url":"https://avatars3.githubusercontent.com/u/24405641?v=4","gravatar_id":"","url":"https://api.github.com/users/fendywillyam","html_url":"https://github.com/fendywillyam","followers_url":"https://api.github.com/users/fendywillyam/followers","following_url":"https://api.github.com/users/fendywillyam/following{/other_user}","gists_url":"https://api.github.com/users/fendywillyam/gists{/gist_id}","starred_url":"https://api.github.com/users/fendywillyam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fendywillyam/subscriptions","organizations_url":"https://api.github.com/users/fendywillyam/orgs","repos_url":"https://api.github.com/users/fendywillyam/repos","events_url":"https://api.github.com/users/fendywillyam/events{/privacy}","received_events_url":"https://api.github.com/users/fendywillyam/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-08-03T14:55:20Z","updated_at":"2017-08-03T14:55:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9768d26400397a777307aff8d248f8f1f2add370","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/354/commits","review_comments_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/354/comments","review_comment_url":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments{/number}","comments_url":"https://api.github.com/repos/danliris/bateeq-module/issues/354/comments","statuses_url":"https://api.github.com/repos/danliris/bateeq-module/statuses/bcc87d8a45904d8c605c9a208feaacd3f9819406","head":{"label":"danliris:dev","ref":"dev","sha":"bcc87d8a45904d8c605c9a208feaacd3f9819406","user":{"login":"danliris","id":20855729,"avatar_url":"https://avatars0.githubusercontent.com/u/20855729?v=4","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"repo":{"id":61858352,"name":"bateeq-module","full_name":"danliris/bateeq-module","owner":{"login":"danliris","id":20855729,"avatar_url":"https://avatars0.githubusercontent.com/u/20855729?v=4","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danliris/bateeq-module","description":"bateeq module","fork":false,"url":"https://api.github.com/repos/danliris/bateeq-module","forks_url":"https://api.github.com/repos/danliris/bateeq-module/forks","keys_url":"https://api.github.com/repos/danliris/bateeq-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danliris/bateeq-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danliris/bateeq-module/teams","hooks_url":"https://api.github.com/repos/danliris/bateeq-module/hooks","issue_events_url":"https://api.github.com/repos/danliris/bateeq-module/issues/events{/number}","events_url":"https://api.github.com/repos/danliris/bateeq-module/events","assignees_url":"https://api.github.com/repos/danliris/bateeq-module/assignees{/user}","branches_url":"https://api.github.com/repos/danliris/bateeq-module/branches{/branch}","tags_url":"https://api.github.com/repos/danliris/bateeq-module/tags","blobs_url":"https://api.github.com/repos/danliris/bateeq-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danliris/bateeq-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danliris/bateeq-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/danliris/bateeq-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danliris/bateeq-module/statuses/{sha}","languages_url":"https://api.github.com/repos/danliris/bateeq-module/languages","stargazers_url":"https://api.github.com/repos/danliris/bateeq-module/stargazers","contributors_url":"https://api.github.com/repos/danliris/bateeq-module/contributors","subscribers_url":"https://api.github.com/repos/danliris/bateeq-module/subscribers","subscription_url":"https://api.github.com/repos/danliris/bateeq-module/subscription","commits_url":"https://api.github.com/repos/danliris/bateeq-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/danliris/bateeq-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/danliris/bateeq-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/danliris/bateeq-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/danliris/bateeq-module/contents/{+path}","compare_url":"https://api.github.com/repos/danliris/bateeq-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danliris/bateeq-module/merges","archive_url":"https://api.github.com/repos/danliris/bateeq-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danliris/bateeq-module/downloads","issues_url":"https://api.github.com/repos/danliris/bateeq-module/issues{/number}","pulls_url":"https://api.github.com/repos/danliris/bateeq-module/pulls{/number}","milestones_url":"https://api.github.com/repos/danliris/bateeq-module/milestones{/number}","notifications_url":"https://api.github.com/repos/danliris/bateeq-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danliris/bateeq-module/labels{/name}","releases_url":"https://api.github.com/repos/danliris/bateeq-module/releases{/id}","deployments_url":"https://api.github.com/repos/danliris/bateeq-module/deployments","created_at":"2016-06-24T05:10:07Z","updated_at":"2016-08-08T03:26:08Z","pushed_at":"2017-08-03T14:55:21Z","git_url":"git://github.com/danliris/bateeq-module.git","ssh_url":"git@github.com:danliris/bateeq-module.git","clone_url":"https://github.com/danliris/bateeq-module.git","svn_url":"https://github.com/danliris/bateeq-module","homepage":null,"size":1293,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":1,"forks":15,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"danliris:uat","ref":"uat","sha":"65bff8801c5b4079af04575727f75c200b7b96b4","user":{"login":"danliris","id":20855729,"avatar_url":"https://avatars0.githubusercontent.com/u/20855729?v=4","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"repo":{"id":61858352,"name":"bateeq-module","full_name":"danliris/bateeq-module","owner":{"login":"danliris","id":20855729,"avatar_url":"https://avatars0.githubusercontent.com/u/20855729?v=4","gravatar_id":"","url":"https://api.github.com/users/danliris","html_url":"https://github.com/danliris","followers_url":"https://api.github.com/users/danliris/followers","following_url":"https://api.github.com/users/danliris/following{/other_user}","gists_url":"https://api.github.com/users/danliris/gists{/gist_id}","starred_url":"https://api.github.com/users/danliris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliris/subscriptions","organizations_url":"https://api.github.com/users/danliris/orgs","repos_url":"https://api.github.com/users/danliris/repos","events_url":"https://api.github.com/users/danliris/events{/privacy}","received_events_url":"https://api.github.com/users/danliris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danliris/bateeq-module","description":"bateeq module","fork":false,"url":"https://api.github.com/repos/danliris/bateeq-module","forks_url":"https://api.github.com/repos/danliris/bateeq-module/forks","keys_url":"https://api.github.com/repos/danliris/bateeq-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danliris/bateeq-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danliris/bateeq-module/teams","hooks_url":"https://api.github.com/repos/danliris/bateeq-module/hooks","issue_events_url":"https://api.github.com/repos/danliris/bateeq-module/issues/events{/number}","events_url":"https://api.github.com/repos/danliris/bateeq-module/events","assignees_url":"https://api.github.com/repos/danliris/bateeq-module/assignees{/user}","branches_url":"https://api.github.com/repos/danliris/bateeq-module/branches{/branch}","tags_url":"https://api.github.com/repos/danliris/bateeq-module/tags","blobs_url":"https://api.github.com/repos/danliris/bateeq-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danliris/bateeq-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danliris/bateeq-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/danliris/bateeq-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danliris/bateeq-module/statuses/{sha}","languages_url":"https://api.github.com/repos/danliris/bateeq-module/languages","stargazers_url":"https://api.github.com/repos/danliris/bateeq-module/stargazers","contributors_url":"https://api.github.com/repos/danliris/bateeq-module/contributors","subscribers_url":"https://api.github.com/repos/danliris/bateeq-module/subscribers","subscription_url":"https://api.github.com/repos/danliris/bateeq-module/subscription","commits_url":"https://api.github.com/repos/danliris/bateeq-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/danliris/bateeq-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/danliris/bateeq-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/danliris/bateeq-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/danliris/bateeq-module/contents/{+path}","compare_url":"https://api.github.com/repos/danliris/bateeq-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danliris/bateeq-module/merges","archive_url":"https://api.github.com/repos/danliris/bateeq-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danliris/bateeq-module/downloads","issues_url":"https://api.github.com/repos/danliris/bateeq-module/issues{/number}","pulls_url":"https://api.github.com/repos/danliris/bateeq-module/pulls{/number}","milestones_url":"https://api.github.com/repos/danliris/bateeq-module/milestones{/number}","notifications_url":"https://api.github.com/repos/danliris/bateeq-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danliris/bateeq-module/labels{/name}","releases_url":"https://api.github.com/repos/danliris/bateeq-module/releases{/id}","deployments_url":"https://api.github.com/repos/danliris/bateeq-module/deployments","created_at":"2016-06-24T05:10:07Z","updated_at":"2016-08-08T03:26:08Z","pushed_at":"2017-08-03T14:55:21Z","git_url":"git://github.com/danliris/bateeq-module.git","ssh_url":"git@github.com:danliris/bateeq-module.git","clone_url":"https://github.com/danliris/bateeq-module.git","svn_url":"https://github.com/danliris/bateeq-module","homepage":null,"size":1293,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":1,"forks":15,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/354"},"html":{"href":"https://github.com/danliris/bateeq-module/pull/354"},"issue":{"href":"https://api.github.com/repos/danliris/bateeq-module/issues/354"},"comments":{"href":"https://api.github.com/repos/danliris/bateeq-module/issues/354/comments"},"review_comments":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/354/comments"},"review_comment":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/danliris/bateeq-module/pulls/354/commits"},"statuses":{"href":"https://api.github.com/repos/danliris/bateeq-module/statuses/bcc87d8a45904d8c605c9a208feaacd3f9819406"}}}}
{"actor":{"display_login":"houndci-bot"}}