{"action":"created","comment":{"url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/comments/235740630","pull_request_review_id":177638653,"id":235740630,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTc0MDYzMA==","diff_hunk":"@@ -0,0 +1,86 @@\n+﻿using Database.Helpers;\n+using Database.Models;\n+using Database.Query;\n+using HovedopgaveStatusSide.Helpers;\n+using System;\n+using System.Collections.Generic;\n+using System.Diagnostics;\n+using System.Text.RegularExpressions;\n+\n+namespace Database.Database\n+{\n+    public class Storage\n+    {\n+        private ICollection<Classes> classes = new List<Classes>\n+        {\n+           Classes.Credit,\n+           Classes.OcrOptions\n+        };\n+\n+        private IDatabase db;\n+\n+        public Storage(IDatabase database)\n+        {\n+            db = database;\n+        }\n+\n+        public Customer GetCustomer(string id)\n+        {\n+            Customer customer = new Customer();\n+            try\n+            {\n+                Query.Query query = QueryFactory.CreateHTTP(RequestMethod.GET, UriHelper.GetBillingPath(id), classes);\n+                RESTResult result = db.ExecuteQuery(query);\n+                if (result.DictionaryResult != null)\n+                {\n+                    customer = Serializer.Serializer.Deserialize<Customer>(result.DictionaryResult);\n+                    customer.Id = id;\n+                }\n+            }\n+            catch (Exception e)\n+            {\n+                Debug.WriteLine(\"Exception thrown in GetCustomer\");\n+                Debug.WriteLine(e.Message);\n+            }\n+\n+            return customer;\n+        }\n+\n+        public void SetCollectionReferences(ref Customer customer)\n+        {\n+            try\n+            {\n+                Query.Query query = QueryFactory.CreateHTTP(RequestMethod.GET, UriHelper.GetColRefPath(customer.Id));\n+                RESTResult result = db.ExecuteQuery(query);\n+\n+                Regex dateRegex = new Regex(@\"(?!\\\\\"\")\\d{8}\");\n+                Regex fundedRequestRegex = new Regex(@\"\\d+(?=\\r\\n)\");\n+\n+                foreach (var obj in result.DictionaryResult)\n+                {\n+                    CollectionReference collectionReference = new CollectionReference();\n+                    collectionReference.Id = obj.Key.Split(\"colref-\")[1];\n+                    var val = obj.Value.ToString();\n+                    MatchCollection dateMatches = dateRegex.Matches(val);\n+                    MatchCollection fundedRequestMatches = fundedRequestRegex.Matches(val);\n+\n+                    for (int i = 0; i < dateMatches.Count && i < fundedRequestMatches.Count; ++i)","path":"codereview/Database/Database/Storage.cs","position":67,"original_position":67,"commit_id":"e887f6e5f77d7155f3be2ffdbd5145af68ae63a2","original_commit_id":"e887f6e5f77d7155f3be2ffdbd5145af68ae63a2","user":{"login":"michael-fosgerau","id":10065865,"node_id":"MDQ6VXNlcjEwMDY1ODY1","avatar_url":"https://avatars3.githubusercontent.com/u/10065865?v=4","gravatar_id":"","url":"https://api.github.com/users/michael-fosgerau","html_url":"https://github.com/michael-fosgerau","followers_url":"https://api.github.com/users/michael-fosgerau/followers","following_url":"https://api.github.com/users/michael-fosgerau/following{/other_user}","gists_url":"https://api.github.com/users/michael-fosgerau/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-fosgerau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-fosgerau/subscriptions","organizations_url":"https://api.github.com/users/michael-fosgerau/orgs","repos_url":"https://api.github.com/users/michael-fosgerau/repos","events_url":"https://api.github.com/users/michael-fosgerau/events{/privacy}","received_events_url":"https://api.github.com/users/michael-fosgerau/received_events","type":"User","site_admin":false},"body":"```suggestion\r\n                    for (var i = 0; i < dateMatches.Count && i < fundedRequestMatches.Count; ++i)\r\n```","created_at":"2018-11-22T14:17:40Z","updated_at":"2018-11-22T14:49:56Z","html_url":"https://github.com/Abagofair/HovedopgaveStatusSide/pull/24#discussion_r235740630","pull_request_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/comments/235740630"},"html":{"href":"https://github.com/Abagofair/HovedopgaveStatusSide/pull/24#discussion_r235740630"},"pull_request":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24","id":232964319,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyOTY0MzE5","html_url":"https://github.com/Abagofair/HovedopgaveStatusSide/pull/24","diff_url":"https://github.com/Abagofair/HovedopgaveStatusSide/pull/24.diff","patch_url":"https://github.com/Abagofair/HovedopgaveStatusSide/pull/24.patch","issue_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/24","number":24,"state":"open","locked":false,"title":"Code review","user":{"login":"Abagofair","id":11569880,"node_id":"MDQ6VXNlcjExNTY5ODgw","avatar_url":"https://avatars0.githubusercontent.com/u/11569880?v=4","gravatar_id":"","url":"https://api.github.com/users/Abagofair","html_url":"https://github.com/Abagofair","followers_url":"https://api.github.com/users/Abagofair/followers","following_url":"https://api.github.com/users/Abagofair/following{/other_user}","gists_url":"https://api.github.com/users/Abagofair/gists{/gist_id}","starred_url":"https://api.github.com/users/Abagofair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abagofair/subscriptions","organizations_url":"https://api.github.com/users/Abagofair/orgs","repos_url":"https://api.github.com/users/Abagofair/repos","events_url":"https://api.github.com/users/Abagofair/events{/privacy}","received_events_url":"https://api.github.com/users/Abagofair/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-22T12:34:02Z","updated_at":"2018-11-22T14:49:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8376241443fff1192ef6924e286a7d05acf0365","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24/commits","review_comments_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24/comments","review_comment_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/24/comments","statuses_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/statuses/e887f6e5f77d7155f3be2ffdbd5145af68ae63a2","head":{"label":"Abagofair:codeReviewNumber2","ref":"codeReviewNumber2","sha":"e887f6e5f77d7155f3be2ffdbd5145af68ae63a2","user":{"login":"Abagofair","id":11569880,"node_id":"MDQ6VXNlcjExNTY5ODgw","avatar_url":"https://avatars0.githubusercontent.com/u/11569880?v=4","gravatar_id":"","url":"https://api.github.com/users/Abagofair","html_url":"https://github.com/Abagofair","followers_url":"https://api.github.com/users/Abagofair/followers","following_url":"https://api.github.com/users/Abagofair/following{/other_user}","gists_url":"https://api.github.com/users/Abagofair/gists{/gist_id}","starred_url":"https://api.github.com/users/Abagofair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abagofair/subscriptions","organizations_url":"https://api.github.com/users/Abagofair/orgs","repos_url":"https://api.github.com/users/Abagofair/repos","events_url":"https://api.github.com/users/Abagofair/events{/privacy}","received_events_url":"https://api.github.com/users/Abagofair/received_events","type":"User","site_admin":false},"repo":{"id":153084990,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwODQ5OTA=","name":"HovedopgaveStatusSide","full_name":"Abagofair/HovedopgaveStatusSide","private":false,"owner":{"login":"Abagofair","id":11569880,"node_id":"MDQ6VXNlcjExNTY5ODgw","avatar_url":"https://avatars0.githubusercontent.com/u/11569880?v=4","gravatar_id":"","url":"https://api.github.com/users/Abagofair","html_url":"https://github.com/Abagofair","followers_url":"https://api.github.com/users/Abagofair/followers","following_url":"https://api.github.com/users/Abagofair/following{/other_user}","gists_url":"https://api.github.com/users/Abagofair/gists{/gist_id}","starred_url":"https://api.github.com/users/Abagofair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abagofair/subscriptions","organizations_url":"https://api.github.com/users/Abagofair/orgs","repos_url":"https://api.github.com/users/Abagofair/repos","events_url":"https://api.github.com/users/Abagofair/events{/privacy}","received_events_url":"https://api.github.com/users/Abagofair/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Abagofair/HovedopgaveStatusSide","description":null,"fork":false,"url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide","forks_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/forks","keys_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/teams","hooks_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/hooks","issue_events_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/events{/number}","events_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/events","assignees_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/assignees{/user}","branches_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/branches{/branch}","tags_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/tags","blobs_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/refs{/sha}","trees_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/statuses/{sha}","languages_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/languages","stargazers_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/stargazers","contributors_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/contributors","subscribers_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/subscribers","subscription_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/subscription","commits_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/commits{/sha}","git_commits_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/commits{/sha}","comments_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/comments{/number}","issue_comment_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/comments{/number}","contents_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/contents/{+path}","compare_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/merges","archive_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/downloads","issues_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues{/number}","pulls_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls{/number}","milestones_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/milestones{/number}","notifications_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/labels{/name}","releases_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/releases{/id}","deployments_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/deployments","created_at":"2018-10-15T09:14:55Z","updated_at":"2018-11-22T11:12:21Z","pushed_at":"2018-11-22T12:34:02Z","git_url":"git://github.com/Abagofair/HovedopgaveStatusSide.git","ssh_url":"git@github.com:Abagofair/HovedopgaveStatusSide.git","clone_url":"https://github.com/Abagofair/HovedopgaveStatusSide.git","svn_url":"https://github.com/Abagofair/HovedopgaveStatusSide","homepage":null,"size":1941,"stargazers_count":0,"watchers_count":0,"language":"C#","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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Abagofair:master","ref":"master","sha":"7155b1275fb342328f56afa21d48c63e430f1c43","user":{"login":"Abagofair","id":11569880,"node_id":"MDQ6VXNlcjExNTY5ODgw","avatar_url":"https://avatars0.githubusercontent.com/u/11569880?v=4","gravatar_id":"","url":"https://api.github.com/users/Abagofair","html_url":"https://github.com/Abagofair","followers_url":"https://api.github.com/users/Abagofair/followers","following_url":"https://api.github.com/users/Abagofair/following{/other_user}","gists_url":"https://api.github.com/users/Abagofair/gists{/gist_id}","starred_url":"https://api.github.com/users/Abagofair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abagofair/subscriptions","organizations_url":"https://api.github.com/users/Abagofair/orgs","repos_url":"https://api.github.com/users/Abagofair/repos","events_url":"https://api.github.com/users/Abagofair/events{/privacy}","received_events_url":"https://api.github.com/users/Abagofair/received_events","type":"User","site_admin":false},"repo":{"id":153084990,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMwODQ5OTA=","name":"HovedopgaveStatusSide","full_name":"Abagofair/HovedopgaveStatusSide","private":false,"owner":{"login":"Abagofair","id":11569880,"node_id":"MDQ6VXNlcjExNTY5ODgw","avatar_url":"https://avatars0.githubusercontent.com/u/11569880?v=4","gravatar_id":"","url":"https://api.github.com/users/Abagofair","html_url":"https://github.com/Abagofair","followers_url":"https://api.github.com/users/Abagofair/followers","following_url":"https://api.github.com/users/Abagofair/following{/other_user}","gists_url":"https://api.github.com/users/Abagofair/gists{/gist_id}","starred_url":"https://api.github.com/users/Abagofair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Abagofair/subscriptions","organizations_url":"https://api.github.com/users/Abagofair/orgs","repos_url":"https://api.github.com/users/Abagofair/repos","events_url":"https://api.github.com/users/Abagofair/events{/privacy}","received_events_url":"https://api.github.com/users/Abagofair/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Abagofair/HovedopgaveStatusSide","description":null,"fork":false,"url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide","forks_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/forks","keys_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/teams","hooks_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/hooks","issue_events_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/events{/number}","events_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/events","assignees_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/assignees{/user}","branches_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/branches{/branch}","tags_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/tags","blobs_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/refs{/sha}","trees_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/statuses/{sha}","languages_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/languages","stargazers_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/stargazers","contributors_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/contributors","subscribers_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/subscribers","subscription_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/subscription","commits_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/commits{/sha}","git_commits_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/git/commits{/sha}","comments_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/comments{/number}","issue_comment_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/comments{/number}","contents_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/contents/{+path}","compare_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/merges","archive_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/downloads","issues_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues{/number}","pulls_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls{/number}","milestones_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/milestones{/number}","notifications_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/labels{/name}","releases_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/releases{/id}","deployments_url":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/deployments","created_at":"2018-10-15T09:14:55Z","updated_at":"2018-11-22T11:12:21Z","pushed_at":"2018-11-22T12:34:02Z","git_url":"git://github.com/Abagofair/HovedopgaveStatusSide.git","ssh_url":"git@github.com:Abagofair/HovedopgaveStatusSide.git","clone_url":"https://github.com/Abagofair/HovedopgaveStatusSide.git","svn_url":"https://github.com/Abagofair/HovedopgaveStatusSide","homepage":null,"size":1941,"stargazers_count":0,"watchers_count":0,"language":"C#","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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24"},"html":{"href":"https://github.com/Abagofair/HovedopgaveStatusSide/pull/24"},"issue":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/24"},"comments":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/Abagofair/HovedopgaveStatusSide/statuses/e887f6e5f77d7155f3be2ffdbd5145af68ae63a2"}},"author_association":"OWNER"}}
{"actor":{"display_login":"michael-fosgerau"}}