{"action":"created","comment":{"url":"https://api.github.com/repos/erxes/erxes-api/pulls/comments/212957841","pull_request_review_id":149687723,"id":212957841,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjk1Nzg0MQ==","diff_hunk":"@@ -0,0 +1,54 @@\n+import { Model, model } from \"mongoose\";\n+import {\n+  ISegment,\n+  ISegmentDocument,\n+  segmentSchema\n+} from \"./definitions/segments\";\n+\n+interface ISegmentModel extends Model<ISegmentDocument> {\n+  createSegment(doc: ISegment): Promise<ISegmentDocument>;\n+  updateSegment(_id: string, doc: ISegment): Promise<ISegmentDocument>;\n+  removeSegment(_id: string): void;\n+}\n+\n+class Segment {\n+  /**\n+   * Create a segment\n+   * @param  {Object} segmentObj object\n+   * @return {Promise} Newly created segment object\n+   */\n+  public static createSegment(doc) {\n+    return Segments.create(doc);\n+  }\n+\n+  /*\n+   * Update segment\n+   */\n+  public static async updateSegment(_id, doc) {","path":"src/db/models/Segments.ts","position":27,"original_position":27,"commit_id":"09a9aef235a289696f12374c5bb6b2e00caf4b90","original_commit_id":"09a9aef235a289696f12374c5bb6b2e00caf4b90","user":{"login":"batamar","id":1748899,"node_id":"MDQ6VXNlcjE3NDg4OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/1748899?v=4","gravatar_id":"","url":"https://api.github.com/users/batamar","html_url":"https://github.com/batamar","followers_url":"https://api.github.com/users/batamar/followers","following_url":"https://api.github.com/users/batamar/following{/other_user}","gists_url":"https://api.github.com/users/batamar/gists{/gist_id}","starred_url":"https://api.github.com/users/batamar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batamar/subscriptions","organizations_url":"https://api.github.com/users/batamar/orgs","repos_url":"https://api.github.com/users/batamar/repos","events_url":"https://api.github.com/users/batamar/events{/privacy}","received_events_url":"https://api.github.com/users/batamar/received_events","type":"User","site_admin":false},"body":"add types","created_at":"2018-08-27T12:33:25Z","updated_at":"2018-08-27T12:36:02Z","html_url":"https://github.com/erxes/erxes-api/pull/174#discussion_r212957841","pull_request_url":"https://api.github.com/repos/erxes/erxes-api/pulls/174","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/erxes/erxes-api/pulls/comments/212957841"},"html":{"href":"https://github.com/erxes/erxes-api/pull/174#discussion_r212957841"},"pull_request":{"href":"https://api.github.com/repos/erxes/erxes-api/pulls/174"}}},"pull_request":{"url":"https://api.github.com/repos/erxes/erxes-api/pulls/174","id":211002537,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExMDAyNTM3","html_url":"https://github.com/erxes/erxes-api/pull/174","diff_url":"https://github.com/erxes/erxes-api/pull/174.diff","patch_url":"https://github.com/erxes/erxes-api/pull/174.patch","issue_url":"https://api.github.com/repos/erxes/erxes-api/issues/174","number":174,"state":"open","locked":false,"title":"Ts kh","user":{"login":"khangaridb","id":32699094,"node_id":"MDQ6VXNlcjMyNjk5MDk0","avatar_url":"https://avatars2.githubusercontent.com/u/32699094?v=4","gravatar_id":"","url":"https://api.github.com/users/khangaridb","html_url":"https://github.com/khangaridb","followers_url":"https://api.github.com/users/khangaridb/followers","following_url":"https://api.github.com/users/khangaridb/following{/other_user}","gists_url":"https://api.github.com/users/khangaridb/gists{/gist_id}","starred_url":"https://api.github.com/users/khangaridb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khangaridb/subscriptions","organizations_url":"https://api.github.com/users/khangaridb/orgs","repos_url":"https://api.github.com/users/khangaridb/repos","events_url":"https://api.github.com/users/khangaridb/events{/privacy}","received_events_url":"https://api.github.com/users/khangaridb/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-27T04:28:36Z","updated_at":"2018-08-27T12:36:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c0d2ab913545f0c46859ebc2fdc9ee6cd3a996cf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/erxes/erxes-api/pulls/174/commits","review_comments_url":"https://api.github.com/repos/erxes/erxes-api/pulls/174/comments","review_comment_url":"https://api.github.com/repos/erxes/erxes-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/erxes/erxes-api/issues/174/comments","statuses_url":"https://api.github.com/repos/erxes/erxes-api/statuses/09a9aef235a289696f12374c5bb6b2e00caf4b90","head":{"label":"erxes:ts-kh","ref":"ts-kh","sha":"09a9aef235a289696f12374c5bb6b2e00caf4b90","user":{"login":"erxes","id":20272096,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjcyMDk2","avatar_url":"https://avatars2.githubusercontent.com/u/20272096?v=4","gravatar_id":"","url":"https://api.github.com/users/erxes","html_url":"https://github.com/erxes","followers_url":"https://api.github.com/users/erxes/followers","following_url":"https://api.github.com/users/erxes/following{/other_user}","gists_url":"https://api.github.com/users/erxes/gists{/gist_id}","starred_url":"https://api.github.com/users/erxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erxes/subscriptions","organizations_url":"https://api.github.com/users/erxes/orgs","repos_url":"https://api.github.com/users/erxes/repos","events_url":"https://api.github.com/users/erxes/events{/privacy}","received_events_url":"https://api.github.com/users/erxes/received_events","type":"Organization","site_admin":false},"repo":{"id":102176438,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIxNzY0Mzg=","name":"erxes-api","full_name":"erxes/erxes-api","owner":{"login":"erxes","id":20272096,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjcyMDk2","avatar_url":"https://avatars2.githubusercontent.com/u/20272096?v=4","gravatar_id":"","url":"https://api.github.com/users/erxes","html_url":"https://github.com/erxes","followers_url":"https://api.github.com/users/erxes/followers","following_url":"https://api.github.com/users/erxes/following{/other_user}","gists_url":"https://api.github.com/users/erxes/gists{/gist_id}","starred_url":"https://api.github.com/users/erxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erxes/subscriptions","organizations_url":"https://api.github.com/users/erxes/orgs","repos_url":"https://api.github.com/users/erxes/repos","events_url":"https://api.github.com/users/erxes/events{/privacy}","received_events_url":"https://api.github.com/users/erxes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erxes/erxes-api","description":"API for erxes","fork":false,"url":"https://api.github.com/repos/erxes/erxes-api","forks_url":"https://api.github.com/repos/erxes/erxes-api/forks","keys_url":"https://api.github.com/repos/erxes/erxes-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erxes/erxes-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erxes/erxes-api/teams","hooks_url":"https://api.github.com/repos/erxes/erxes-api/hooks","issue_events_url":"https://api.github.com/repos/erxes/erxes-api/issues/events{/number}","events_url":"https://api.github.com/repos/erxes/erxes-api/events","assignees_url":"https://api.github.com/repos/erxes/erxes-api/assignees{/user}","branches_url":"https://api.github.com/repos/erxes/erxes-api/branches{/branch}","tags_url":"https://api.github.com/repos/erxes/erxes-api/tags","blobs_url":"https://api.github.com/repos/erxes/erxes-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erxes/erxes-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erxes/erxes-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/erxes/erxes-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erxes/erxes-api/statuses/{sha}","languages_url":"https://api.github.com/repos/erxes/erxes-api/languages","stargazers_url":"https://api.github.com/repos/erxes/erxes-api/stargazers","contributors_url":"https://api.github.com/repos/erxes/erxes-api/contributors","subscribers_url":"https://api.github.com/repos/erxes/erxes-api/subscribers","subscription_url":"https://api.github.com/repos/erxes/erxes-api/subscription","commits_url":"https://api.github.com/repos/erxes/erxes-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/erxes/erxes-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/erxes/erxes-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/erxes/erxes-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/erxes/erxes-api/contents/{+path}","compare_url":"https://api.github.com/repos/erxes/erxes-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erxes/erxes-api/merges","archive_url":"https://api.github.com/repos/erxes/erxes-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erxes/erxes-api/downloads","issues_url":"https://api.github.com/repos/erxes/erxes-api/issues{/number}","pulls_url":"https://api.github.com/repos/erxes/erxes-api/pulls{/number}","milestones_url":"https://api.github.com/repos/erxes/erxes-api/milestones{/number}","notifications_url":"https://api.github.com/repos/erxes/erxes-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erxes/erxes-api/labels{/name}","releases_url":"https://api.github.com/repos/erxes/erxes-api/releases{/id}","deployments_url":"https://api.github.com/repos/erxes/erxes-api/deployments","created_at":"2017-09-02T06:00:44Z","updated_at":"2018-08-19T09:59:27Z","pushed_at":"2018-08-27T12:09:30Z","git_url":"git://github.com/erxes/erxes-api.git","ssh_url":"git@github.com:erxes/erxes-api.git","clone_url":"https://github.com/erxes/erxes-api.git","svn_url":"https://github.com/erxes/erxes-api","homepage":"https://erxes.io/","size":2279,"stargazers_count":13,"watchers_count":13,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":24,"license":null,"forks":6,"open_issues":24,"watchers":13,"default_branch":"master"}},"base":{"label":"erxes:ts","ref":"ts","sha":"8e5bbada91bf21e31ed61bad251aa34ca6afc3fd","user":{"login":"erxes","id":20272096,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjcyMDk2","avatar_url":"https://avatars2.githubusercontent.com/u/20272096?v=4","gravatar_id":"","url":"https://api.github.com/users/erxes","html_url":"https://github.com/erxes","followers_url":"https://api.github.com/users/erxes/followers","following_url":"https://api.github.com/users/erxes/following{/other_user}","gists_url":"https://api.github.com/users/erxes/gists{/gist_id}","starred_url":"https://api.github.com/users/erxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erxes/subscriptions","organizations_url":"https://api.github.com/users/erxes/orgs","repos_url":"https://api.github.com/users/erxes/repos","events_url":"https://api.github.com/users/erxes/events{/privacy}","received_events_url":"https://api.github.com/users/erxes/received_events","type":"Organization","site_admin":false},"repo":{"id":102176438,"node_id":"MDEwOlJlcG9zaXRvcnkxMDIxNzY0Mzg=","name":"erxes-api","full_name":"erxes/erxes-api","owner":{"login":"erxes","id":20272096,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMjcyMDk2","avatar_url":"https://avatars2.githubusercontent.com/u/20272096?v=4","gravatar_id":"","url":"https://api.github.com/users/erxes","html_url":"https://github.com/erxes","followers_url":"https://api.github.com/users/erxes/followers","following_url":"https://api.github.com/users/erxes/following{/other_user}","gists_url":"https://api.github.com/users/erxes/gists{/gist_id}","starred_url":"https://api.github.com/users/erxes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erxes/subscriptions","organizations_url":"https://api.github.com/users/erxes/orgs","repos_url":"https://api.github.com/users/erxes/repos","events_url":"https://api.github.com/users/erxes/events{/privacy}","received_events_url":"https://api.github.com/users/erxes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erxes/erxes-api","description":"API for erxes","fork":false,"url":"https://api.github.com/repos/erxes/erxes-api","forks_url":"https://api.github.com/repos/erxes/erxes-api/forks","keys_url":"https://api.github.com/repos/erxes/erxes-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erxes/erxes-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erxes/erxes-api/teams","hooks_url":"https://api.github.com/repos/erxes/erxes-api/hooks","issue_events_url":"https://api.github.com/repos/erxes/erxes-api/issues/events{/number}","events_url":"https://api.github.com/repos/erxes/erxes-api/events","assignees_url":"https://api.github.com/repos/erxes/erxes-api/assignees{/user}","branches_url":"https://api.github.com/repos/erxes/erxes-api/branches{/branch}","tags_url":"https://api.github.com/repos/erxes/erxes-api/tags","blobs_url":"https://api.github.com/repos/erxes/erxes-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erxes/erxes-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erxes/erxes-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/erxes/erxes-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erxes/erxes-api/statuses/{sha}","languages_url":"https://api.github.com/repos/erxes/erxes-api/languages","stargazers_url":"https://api.github.com/repos/erxes/erxes-api/stargazers","contributors_url":"https://api.github.com/repos/erxes/erxes-api/contributors","subscribers_url":"https://api.github.com/repos/erxes/erxes-api/subscribers","subscription_url":"https://api.github.com/repos/erxes/erxes-api/subscription","commits_url":"https://api.github.com/repos/erxes/erxes-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/erxes/erxes-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/erxes/erxes-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/erxes/erxes-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/erxes/erxes-api/contents/{+path}","compare_url":"https://api.github.com/repos/erxes/erxes-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erxes/erxes-api/merges","archive_url":"https://api.github.com/repos/erxes/erxes-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erxes/erxes-api/downloads","issues_url":"https://api.github.com/repos/erxes/erxes-api/issues{/number}","pulls_url":"https://api.github.com/repos/erxes/erxes-api/pulls{/number}","milestones_url":"https://api.github.com/repos/erxes/erxes-api/milestones{/number}","notifications_url":"https://api.github.com/repos/erxes/erxes-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erxes/erxes-api/labels{/name}","releases_url":"https://api.github.com/repos/erxes/erxes-api/releases{/id}","deployments_url":"https://api.github.com/repos/erxes/erxes-api/deployments","created_at":"2017-09-02T06:00:44Z","updated_at":"2018-08-19T09:59:27Z","pushed_at":"2018-08-27T12:09:30Z","git_url":"git://github.com/erxes/erxes-api.git","ssh_url":"git@github.com:erxes/erxes-api.git","clone_url":"https://github.com/erxes/erxes-api.git","svn_url":"https://github.com/erxes/erxes-api","homepage":"https://erxes.io/","size":2279,"stargazers_count":13,"watchers_count":13,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":24,"license":null,"forks":6,"open_issues":24,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/erxes/erxes-api/pulls/174"},"html":{"href":"https://github.com/erxes/erxes-api/pull/174"},"issue":{"href":"https://api.github.com/repos/erxes/erxes-api/issues/174"},"comments":{"href":"https://api.github.com/repos/erxes/erxes-api/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/erxes/erxes-api/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/erxes/erxes-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/erxes/erxes-api/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/erxes/erxes-api/statuses/09a9aef235a289696f12374c5bb6b2e00caf4b90"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"batamar"}}