{"action":"created","comment":{"url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/comments/192559324","pull_request_review_id":125365593,"id":192559324,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjU1OTMyNA==","diff_hunk":"@@ -0,0 +1,99 @@\n+import {Document, Schema, Model, model} from \"mongoose\";\n+import {EntityKeys, IEntity} from \"./Entity\"\n+import {accessSync} from \"fs\";\n+\n+require('./db');\n+\n+export interface ITicket extends IEntity {\n+    featureId: string;\n+    start: Date;\n+    deadline: Date;\n+    priority: \"high\"|\"normal\"|\"low\";\n+    status: \"pending\"|\"doing\"|\"done\"|\"discarded\"|\"blocked\";\n+    assignedDeveloper: string;\n+    tocAsPlanned: number;\n+    tocFast: number;\n+    tocSlow: number;\n+    tags: [string];\n+}\n+\n+export interface ITicketModel extends ITicket, Document {\n+\n+}\n+\n+export const TicketKeys = {\n+    featureId: {type: String, required: true},\n+    start: {type: Date, required: true},\n+    deadline: {type: Date, required: true},\n+    priority: {type: String, required: true},\n+    status: {type: String, required: true},\n+    assignedDeveloper: {type: String, required: true},\n+    tocAsPlanned: {type: Number, required: true},\n+    tocFast: {type: Number, required: true},\n+    tocSlow: {type: Number, required: true},\n+    tags: {type: [String], required: false},\n+    ...EntityKeys\n+};\n+\n+\n+export const TicketSchema: Schema = new Schema(TicketKeys, {timestamps: true});\n+\n+export const Ticket: Model<ITicketModel> = model<ITicketModel>(\"Ticket\", TicketSchema);\n+\n+export class TicketClass {\n+    static async getTickets(featureId: string): Promise<Array<ITicket>> {\n+        const tickets = await Ticket.find({\"featureId\":featureId, \"deleted\":false, deletedObject: {[featureId]: false}});\n+        return await TicketClass.enrich(tickets);\n+    }\n+\n+    static async enrich(tickets: Array<ITicket>): Promise<Array<ITicket>> {\n+        // TODO: Do processing here\n+        tickets.forEach((ticket)=> {\n+            const risk = this.calculateRisk(ticket.priority, ticket.tocAsPlanned, ticket.tocFast, ticket.tocSlow);\n+            ticket._doc.risk = risk;","path":"src/models/Tickets.ts","position":53,"original_position":53,"commit_id":"9b9295aca791034a8e73eabb6024a68133ee9166","original_commit_id":"9b9295aca791034a8e73eabb6024a68133ee9166","user":{"login":"omerbehar","id":26936422,"node_id":"MDQ6VXNlcjI2OTM2NDIy","avatar_url":"https://avatars0.githubusercontent.com/u/26936422?v=4","gravatar_id":"","url":"https://api.github.com/users/omerbehar","html_url":"https://github.com/omerbehar","followers_url":"https://api.github.com/users/omerbehar/followers","following_url":"https://api.github.com/users/omerbehar/following{/other_user}","gists_url":"https://api.github.com/users/omerbehar/gists{/gist_id}","starred_url":"https://api.github.com/users/omerbehar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omerbehar/subscriptions","organizations_url":"https://api.github.com/users/omerbehar/orgs","repos_url":"https://api.github.com/users/omerbehar/repos","events_url":"https://api.github.com/users/omerbehar/events{/privacy}","received_events_url":"https://api.github.com/users/omerbehar/received_events","type":"User","site_admin":false},"body":"fixed\r\n","created_at":"2018-06-02T13:10:47Z","updated_at":"2018-06-02T13:10:47Z","html_url":"https://github.com/ShyAlon/sideproject-server/pull/6#discussion_r192559324","pull_request_url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/comments/192559324"},"html":{"href":"https://github.com/ShyAlon/sideproject-server/pull/6#discussion_r192559324"},"pull_request":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6"}},"in_reply_to_id":192374547},"pull_request":{"url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6","id":191856381,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxODU2Mzgx","html_url":"https://github.com/ShyAlon/sideproject-server/pull/6","diff_url":"https://github.com/ShyAlon/sideproject-server/pull/6.diff","patch_url":"https://github.com/ShyAlon/sideproject-server/pull/6.patch","issue_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/6","number":6,"state":"open","locked":false,"title":"Server testing","user":{"login":"ShyAlon","id":5547352,"node_id":"MDQ6VXNlcjU1NDczNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5547352?v=4","gravatar_id":"","url":"https://api.github.com/users/ShyAlon","html_url":"https://github.com/ShyAlon","followers_url":"https://api.github.com/users/ShyAlon/followers","following_url":"https://api.github.com/users/ShyAlon/following{/other_user}","gists_url":"https://api.github.com/users/ShyAlon/gists{/gist_id}","starred_url":"https://api.github.com/users/ShyAlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShyAlon/subscriptions","organizations_url":"https://api.github.com/users/ShyAlon/orgs","repos_url":"https://api.github.com/users/ShyAlon/repos","events_url":"https://api.github.com/users/ShyAlon/events{/privacy}","received_events_url":"https://api.github.com/users/ShyAlon/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-31T19:51:41Z","updated_at":"2018-06-02T13:10:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"479b5007885bfec24c774a59f66fa9a6cdb12597","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6/commits","review_comments_url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6/comments","review_comment_url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/6/comments","statuses_url":"https://api.github.com/repos/ShyAlon/sideproject-server/statuses/9b9295aca791034a8e73eabb6024a68133ee9166","head":{"label":"ShyAlon:serverTesting","ref":"serverTesting","sha":"9b9295aca791034a8e73eabb6024a68133ee9166","user":{"login":"ShyAlon","id":5547352,"node_id":"MDQ6VXNlcjU1NDczNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5547352?v=4","gravatar_id":"","url":"https://api.github.com/users/ShyAlon","html_url":"https://github.com/ShyAlon","followers_url":"https://api.github.com/users/ShyAlon/followers","following_url":"https://api.github.com/users/ShyAlon/following{/other_user}","gists_url":"https://api.github.com/users/ShyAlon/gists{/gist_id}","starred_url":"https://api.github.com/users/ShyAlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShyAlon/subscriptions","organizations_url":"https://api.github.com/users/ShyAlon/orgs","repos_url":"https://api.github.com/users/ShyAlon/repos","events_url":"https://api.github.com/users/ShyAlon/events{/privacy}","received_events_url":"https://api.github.com/users/ShyAlon/received_events","type":"User","site_admin":false},"repo":{"id":129138358,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkxMzgzNTg=","name":"sideproject-server","full_name":"ShyAlon/sideproject-server","owner":{"login":"ShyAlon","id":5547352,"node_id":"MDQ6VXNlcjU1NDczNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5547352?v=4","gravatar_id":"","url":"https://api.github.com/users/ShyAlon","html_url":"https://github.com/ShyAlon","followers_url":"https://api.github.com/users/ShyAlon/followers","following_url":"https://api.github.com/users/ShyAlon/following{/other_user}","gists_url":"https://api.github.com/users/ShyAlon/gists{/gist_id}","starred_url":"https://api.github.com/users/ShyAlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShyAlon/subscriptions","organizations_url":"https://api.github.com/users/ShyAlon/orgs","repos_url":"https://api.github.com/users/ShyAlon/repos","events_url":"https://api.github.com/users/ShyAlon/events{/privacy}","received_events_url":"https://api.github.com/users/ShyAlon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShyAlon/sideproject-server","description":null,"fork":false,"url":"https://api.github.com/repos/ShyAlon/sideproject-server","forks_url":"https://api.github.com/repos/ShyAlon/sideproject-server/forks","keys_url":"https://api.github.com/repos/ShyAlon/sideproject-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShyAlon/sideproject-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShyAlon/sideproject-server/teams","hooks_url":"https://api.github.com/repos/ShyAlon/sideproject-server/hooks","issue_events_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/events{/number}","events_url":"https://api.github.com/repos/ShyAlon/sideproject-server/events","assignees_url":"https://api.github.com/repos/ShyAlon/sideproject-server/assignees{/user}","branches_url":"https://api.github.com/repos/ShyAlon/sideproject-server/branches{/branch}","tags_url":"https://api.github.com/repos/ShyAlon/sideproject-server/tags","blobs_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShyAlon/sideproject-server/statuses/{sha}","languages_url":"https://api.github.com/repos/ShyAlon/sideproject-server/languages","stargazers_url":"https://api.github.com/repos/ShyAlon/sideproject-server/stargazers","contributors_url":"https://api.github.com/repos/ShyAlon/sideproject-server/contributors","subscribers_url":"https://api.github.com/repos/ShyAlon/sideproject-server/subscribers","subscription_url":"https://api.github.com/repos/ShyAlon/sideproject-server/subscription","commits_url":"https://api.github.com/repos/ShyAlon/sideproject-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShyAlon/sideproject-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShyAlon/sideproject-server/contents/{+path}","compare_url":"https://api.github.com/repos/ShyAlon/sideproject-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShyAlon/sideproject-server/merges","archive_url":"https://api.github.com/repos/ShyAlon/sideproject-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShyAlon/sideproject-server/downloads","issues_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues{/number}","pulls_url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls{/number}","milestones_url":"https://api.github.com/repos/ShyAlon/sideproject-server/milestones{/number}","notifications_url":"https://api.github.com/repos/ShyAlon/sideproject-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShyAlon/sideproject-server/labels{/name}","releases_url":"https://api.github.com/repos/ShyAlon/sideproject-server/releases{/id}","deployments_url":"https://api.github.com/repos/ShyAlon/sideproject-server/deployments","created_at":"2018-04-11T18:38:13Z","updated_at":"2018-05-26T18:59:08Z","pushed_at":"2018-05-31T19:51:41Z","git_url":"git://github.com/ShyAlon/sideproject-server.git","ssh_url":"git@github.com:ShyAlon/sideproject-server.git","clone_url":"https://github.com/ShyAlon/sideproject-server.git","svn_url":"https://github.com/ShyAlon/sideproject-server","homepage":null,"size":392,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ShyAlon:master","ref":"master","sha":"7017e1529a9944de435970ec3390a10b29e3b831","user":{"login":"ShyAlon","id":5547352,"node_id":"MDQ6VXNlcjU1NDczNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5547352?v=4","gravatar_id":"","url":"https://api.github.com/users/ShyAlon","html_url":"https://github.com/ShyAlon","followers_url":"https://api.github.com/users/ShyAlon/followers","following_url":"https://api.github.com/users/ShyAlon/following{/other_user}","gists_url":"https://api.github.com/users/ShyAlon/gists{/gist_id}","starred_url":"https://api.github.com/users/ShyAlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShyAlon/subscriptions","organizations_url":"https://api.github.com/users/ShyAlon/orgs","repos_url":"https://api.github.com/users/ShyAlon/repos","events_url":"https://api.github.com/users/ShyAlon/events{/privacy}","received_events_url":"https://api.github.com/users/ShyAlon/received_events","type":"User","site_admin":false},"repo":{"id":129138358,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkxMzgzNTg=","name":"sideproject-server","full_name":"ShyAlon/sideproject-server","owner":{"login":"ShyAlon","id":5547352,"node_id":"MDQ6VXNlcjU1NDczNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5547352?v=4","gravatar_id":"","url":"https://api.github.com/users/ShyAlon","html_url":"https://github.com/ShyAlon","followers_url":"https://api.github.com/users/ShyAlon/followers","following_url":"https://api.github.com/users/ShyAlon/following{/other_user}","gists_url":"https://api.github.com/users/ShyAlon/gists{/gist_id}","starred_url":"https://api.github.com/users/ShyAlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ShyAlon/subscriptions","organizations_url":"https://api.github.com/users/ShyAlon/orgs","repos_url":"https://api.github.com/users/ShyAlon/repos","events_url":"https://api.github.com/users/ShyAlon/events{/privacy}","received_events_url":"https://api.github.com/users/ShyAlon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ShyAlon/sideproject-server","description":null,"fork":false,"url":"https://api.github.com/repos/ShyAlon/sideproject-server","forks_url":"https://api.github.com/repos/ShyAlon/sideproject-server/forks","keys_url":"https://api.github.com/repos/ShyAlon/sideproject-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ShyAlon/sideproject-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ShyAlon/sideproject-server/teams","hooks_url":"https://api.github.com/repos/ShyAlon/sideproject-server/hooks","issue_events_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/events{/number}","events_url":"https://api.github.com/repos/ShyAlon/sideproject-server/events","assignees_url":"https://api.github.com/repos/ShyAlon/sideproject-server/assignees{/user}","branches_url":"https://api.github.com/repos/ShyAlon/sideproject-server/branches{/branch}","tags_url":"https://api.github.com/repos/ShyAlon/sideproject-server/tags","blobs_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ShyAlon/sideproject-server/statuses/{sha}","languages_url":"https://api.github.com/repos/ShyAlon/sideproject-server/languages","stargazers_url":"https://api.github.com/repos/ShyAlon/sideproject-server/stargazers","contributors_url":"https://api.github.com/repos/ShyAlon/sideproject-server/contributors","subscribers_url":"https://api.github.com/repos/ShyAlon/sideproject-server/subscribers","subscription_url":"https://api.github.com/repos/ShyAlon/sideproject-server/subscription","commits_url":"https://api.github.com/repos/ShyAlon/sideproject-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/ShyAlon/sideproject-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/ShyAlon/sideproject-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/ShyAlon/sideproject-server/contents/{+path}","compare_url":"https://api.github.com/repos/ShyAlon/sideproject-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ShyAlon/sideproject-server/merges","archive_url":"https://api.github.com/repos/ShyAlon/sideproject-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ShyAlon/sideproject-server/downloads","issues_url":"https://api.github.com/repos/ShyAlon/sideproject-server/issues{/number}","pulls_url":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls{/number}","milestones_url":"https://api.github.com/repos/ShyAlon/sideproject-server/milestones{/number}","notifications_url":"https://api.github.com/repos/ShyAlon/sideproject-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ShyAlon/sideproject-server/labels{/name}","releases_url":"https://api.github.com/repos/ShyAlon/sideproject-server/releases{/id}","deployments_url":"https://api.github.com/repos/ShyAlon/sideproject-server/deployments","created_at":"2018-04-11T18:38:13Z","updated_at":"2018-05-26T18:59:08Z","pushed_at":"2018-05-31T19:51:41Z","git_url":"git://github.com/ShyAlon/sideproject-server.git","ssh_url":"git@github.com:ShyAlon/sideproject-server.git","clone_url":"https://github.com/ShyAlon/sideproject-server.git","svn_url":"https://github.com/ShyAlon/sideproject-server","homepage":null,"size":392,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6"},"html":{"href":"https://github.com/ShyAlon/sideproject-server/pull/6"},"issue":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/6"},"comments":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/ShyAlon/sideproject-server/statuses/9b9295aca791034a8e73eabb6024a68133ee9166"}},"author_association":"OWNER"}}
{"actor":{"display_login":"omerbehar"}}