{"action":"created","comment":{"url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/comments/88495303","pull_request_review_id":9067654,"id":88495303,"diff_hunk":"@@ -0,0 +1,59 @@\n+﻿using System.Configuration;\n+using Twilio;\n+using TwilioStore.Interfaces.Domain;\n+using TwilioStore.Interfaces.Exceptions;\n+using TwilioStore.Interfaces.Services;\n+\n+namespace TwilioStore.Services\n+{\n+    public class OrderService : IOrderService\n+    {\n+        private readonly INotificationService _notificationService;\n+\n+        public OrderService(INotificationService notificationService = null)\n+        {\n+            _notificationService = notificationService ?? new NotificationService();\n+        }\n+\n+        public void ProcessOrder(IOrder order)\n+        {\n+            TryReserveInventory(order);\n+            var trackingNum = ShipOrder(order);\n+            _notificationService.SendText(order.Customer.MobileNumber,\n+                $\"Your order {order.Id} has shipped! Tracking: {trackingNum}\");\n+        }\n+\n+        private void TryReserveInventory(IOrder order)\n+        {\n+            try\n+            {\n+                ReserveInventory(order);\n+            }\n+            catch (InsufficientInventoryException e)\n+            {\n+                _notificationService.SendText(order.Customer.MobileNumber,\n+                    $\"Sorry, we don't have enough {e.LineItem.Description} in stock. :(\");\n+                throw;\n+            }\n+        }\n+\n+        private void ReserveInventory(IOrder order)\n+        {\n+            foreach (var lineItem in order.Items)\n+            {\n+                ReserveInventoryForLineItem(lineItem);\n+            }\n+        }\n+\n+        private void ReserveInventoryForLineItem(IOrderDetail lineItem)","path":"TwilioStore.Services/OrderService.cs","position":48,"original_position":48,"commit_id":"3decf43a482df30e94b3de2c58851b4f1fde56de","original_commit_id":"3decf43a482df30e94b3de2c58851b4f1fde56de","user":{"login":"acamino","id":957202,"avatar_url":"https://avatars.githubusercontent.com/u/957202?v=3","gravatar_id":"","url":"https://api.github.com/users/acamino","html_url":"https://github.com/acamino","followers_url":"https://api.github.com/users/acamino/followers","following_url":"https://api.github.com/users/acamino/following{/other_user}","gists_url":"https://api.github.com/users/acamino/gists{/gist_id}","starred_url":"https://api.github.com/users/acamino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acamino/subscriptions","organizations_url":"https://api.github.com/users/acamino/orgs","repos_url":"https://api.github.com/users/acamino/repos","events_url":"https://api.github.com/users/acamino/events{/privacy}","received_events_url":"https://api.github.com/users/acamino/received_events","type":"User","site_admin":false},"body":"This is interesting. This method is the only justification for the existence of `InsufficientInventoryException` and it's empty. Probably something is missing here.\r\n\r\n_Disclaimer: I'm extra afraid of TODOs in code._ 😉 ","created_at":"2016-11-17T16:51:26Z","updated_at":"2016-11-17T16:51:27Z","html_url":"https://github.com/TwilioDevEd/automated-testing-csharp/pull/1#discussion_r88495303","pull_request_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/comments/88495303"},"html":{"href":"https://github.com/TwilioDevEd/automated-testing-csharp/pull/1#discussion_r88495303"},"pull_request":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1","id":94191312,"html_url":"https://github.com/TwilioDevEd/automated-testing-csharp/pull/1","diff_url":"https://github.com/TwilioDevEd/automated-testing-csharp/pull/1.diff","patch_url":"https://github.com/TwilioDevEd/automated-testing-csharp/pull/1.patch","issue_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/1","number":1,"state":"open","locked":false,"title":"Tech Review","user":{"login":"acamino","id":957202,"avatar_url":"https://avatars.githubusercontent.com/u/957202?v=3","gravatar_id":"","url":"https://api.github.com/users/acamino","html_url":"https://github.com/acamino","followers_url":"https://api.github.com/users/acamino/followers","following_url":"https://api.github.com/users/acamino/following{/other_user}","gists_url":"https://api.github.com/users/acamino/gists{/gist_id}","starred_url":"https://api.github.com/users/acamino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acamino/subscriptions","organizations_url":"https://api.github.com/users/acamino/orgs","repos_url":"https://api.github.com/users/acamino/repos","events_url":"https://api.github.com/users/acamino/events{/privacy}","received_events_url":"https://api.github.com/users/acamino/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-17T15:40:29Z","updated_at":"2016-11-17T16:51:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4747c1a5547dd9ba57bfd66764c574ef2a157ac8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/1/comments","statuses_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/statuses/3decf43a482df30e94b3de2c58851b4f1fde56de","head":{"label":"TwilioDevEd:code-review","ref":"code-review","sha":"3decf43a482df30e94b3de2c58851b4f1fde56de","user":{"login":"TwilioDevEd","id":8114879,"avatar_url":"https://avatars.githubusercontent.com/u/8114879?v=3","gravatar_id":"","url":"https://api.github.com/users/TwilioDevEd","html_url":"https://github.com/TwilioDevEd","followers_url":"https://api.github.com/users/TwilioDevEd/followers","following_url":"https://api.github.com/users/TwilioDevEd/following{/other_user}","gists_url":"https://api.github.com/users/TwilioDevEd/gists{/gist_id}","starred_url":"https://api.github.com/users/TwilioDevEd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TwilioDevEd/subscriptions","organizations_url":"https://api.github.com/users/TwilioDevEd/orgs","repos_url":"https://api.github.com/users/TwilioDevEd/repos","events_url":"https://api.github.com/users/TwilioDevEd/events{/privacy}","received_events_url":"https://api.github.com/users/TwilioDevEd/received_events","type":"Organization","site_admin":false},"repo":{"id":73967712,"name":"automated-testing-csharp","full_name":"TwilioDevEd/automated-testing-csharp","owner":{"login":"TwilioDevEd","id":8114879,"avatar_url":"https://avatars.githubusercontent.com/u/8114879?v=3","gravatar_id":"","url":"https://api.github.com/users/TwilioDevEd","html_url":"https://github.com/TwilioDevEd","followers_url":"https://api.github.com/users/TwilioDevEd/followers","following_url":"https://api.github.com/users/TwilioDevEd/following{/other_user}","gists_url":"https://api.github.com/users/TwilioDevEd/gists{/gist_id}","starred_url":"https://api.github.com/users/TwilioDevEd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TwilioDevEd/subscriptions","organizations_url":"https://api.github.com/users/TwilioDevEd/orgs","repos_url":"https://api.github.com/users/TwilioDevEd/repos","events_url":"https://api.github.com/users/TwilioDevEd/events{/privacy}","received_events_url":"https://api.github.com/users/TwilioDevEd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TwilioDevEd/automated-testing-csharp","description":"Automate testing of your C# Twilio apps.","fork":false,"url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp","forks_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/forks","keys_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/teams","hooks_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/hooks","issue_events_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/events{/number}","events_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/events","assignees_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/assignees{/user}","branches_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/branches{/branch}","tags_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/tags","blobs_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/statuses/{sha}","languages_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/languages","stargazers_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/stargazers","contributors_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/contributors","subscribers_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/subscribers","subscription_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/subscription","commits_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/contents/{+path}","compare_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/merges","archive_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/downloads","issues_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues{/number}","pulls_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls{/number}","milestones_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/milestones{/number}","notifications_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/labels{/name}","releases_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/releases{/id}","deployments_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/deployments","created_at":"2016-11-16T22:38:28Z","updated_at":"2016-11-16T22:41:24Z","pushed_at":"2016-11-17T15:40:29Z","git_url":"git://github.com/TwilioDevEd/automated-testing-csharp.git","ssh_url":"git@github.com:TwilioDevEd/automated-testing-csharp.git","clone_url":"https://github.com/TwilioDevEd/automated-testing-csharp.git","svn_url":"https://github.com/TwilioDevEd/automated-testing-csharp","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":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":"TwilioDevEd:master","ref":"master","sha":"943acb1dedd825d02026f150808550908354e412","user":{"login":"TwilioDevEd","id":8114879,"avatar_url":"https://avatars.githubusercontent.com/u/8114879?v=3","gravatar_id":"","url":"https://api.github.com/users/TwilioDevEd","html_url":"https://github.com/TwilioDevEd","followers_url":"https://api.github.com/users/TwilioDevEd/followers","following_url":"https://api.github.com/users/TwilioDevEd/following{/other_user}","gists_url":"https://api.github.com/users/TwilioDevEd/gists{/gist_id}","starred_url":"https://api.github.com/users/TwilioDevEd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TwilioDevEd/subscriptions","organizations_url":"https://api.github.com/users/TwilioDevEd/orgs","repos_url":"https://api.github.com/users/TwilioDevEd/repos","events_url":"https://api.github.com/users/TwilioDevEd/events{/privacy}","received_events_url":"https://api.github.com/users/TwilioDevEd/received_events","type":"Organization","site_admin":false},"repo":{"id":73967712,"name":"automated-testing-csharp","full_name":"TwilioDevEd/automated-testing-csharp","owner":{"login":"TwilioDevEd","id":8114879,"avatar_url":"https://avatars.githubusercontent.com/u/8114879?v=3","gravatar_id":"","url":"https://api.github.com/users/TwilioDevEd","html_url":"https://github.com/TwilioDevEd","followers_url":"https://api.github.com/users/TwilioDevEd/followers","following_url":"https://api.github.com/users/TwilioDevEd/following{/other_user}","gists_url":"https://api.github.com/users/TwilioDevEd/gists{/gist_id}","starred_url":"https://api.github.com/users/TwilioDevEd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TwilioDevEd/subscriptions","organizations_url":"https://api.github.com/users/TwilioDevEd/orgs","repos_url":"https://api.github.com/users/TwilioDevEd/repos","events_url":"https://api.github.com/users/TwilioDevEd/events{/privacy}","received_events_url":"https://api.github.com/users/TwilioDevEd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TwilioDevEd/automated-testing-csharp","description":"Automate testing of your C# Twilio apps.","fork":false,"url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp","forks_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/forks","keys_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/teams","hooks_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/hooks","issue_events_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/events{/number}","events_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/events","assignees_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/assignees{/user}","branches_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/branches{/branch}","tags_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/tags","blobs_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/statuses/{sha}","languages_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/languages","stargazers_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/stargazers","contributors_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/contributors","subscribers_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/subscribers","subscription_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/subscription","commits_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/contents/{+path}","compare_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/merges","archive_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/downloads","issues_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues{/number}","pulls_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls{/number}","milestones_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/milestones{/number}","notifications_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/labels{/name}","releases_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/releases{/id}","deployments_url":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/deployments","created_at":"2016-11-16T22:38:28Z","updated_at":"2016-11-16T22:41:24Z","pushed_at":"2016-11-17T15:40:29Z","git_url":"git://github.com/TwilioDevEd/automated-testing-csharp.git","ssh_url":"git@github.com:TwilioDevEd/automated-testing-csharp.git","clone_url":"https://github.com/TwilioDevEd/automated-testing-csharp.git","svn_url":"https://github.com/TwilioDevEd/automated-testing-csharp","homepage":null,"size":13,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":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/TwilioDevEd/automated-testing-csharp/pulls/1"},"html":{"href":"https://github.com/TwilioDevEd/automated-testing-csharp/pull/1"},"issue":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/1"},"comments":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/TwilioDevEd/automated-testing-csharp/statuses/3decf43a482df30e94b3de2c58851b4f1fde56de"}}}}
{"actor":{"display_login":"acamino"}}