{"action":"created","comment":{"url":"https://api.github.com/repos/athena-scheduler/athena/pulls/comments/172612082","pull_request_review_id":101654568,"id":172612082,"diff_hunk":"@@ -0,0 +1,100 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Threading.Tasks;\n+using Microsoft.AspNetCore.Http;\n+using Microsoft.AspNetCore.Mvc;\n+using Athena.Core.Repositories;\n+using Athena.Core.Models;\n+using Athena.Exceptions;\n+using System.Net;\n+\n+namespace Athena.Controllers.api\n+{\n+    [Route(\"api/v1/[Controller]\")]\n+    public class CourseController : Controller\n+    {\n+        private readonly ICourseRepository courses;\n+        private readonly IInstitutionRepository institutions;\n+        private readonly IStudentRepository students;\n+        private readonly IRequirementRepository requirements;\n+\n+        public CourseController(ICourseRepository coursesRepository, IInstitutionRepository institutionRepository, IStudentRepository studentRepository, IRequirementRepository requirementRepository)\n+        {\n+            courses = coursesRepository ?? throw new ArgumentNullException(nameof(coursesRepository));\n+            institutions = institutionRepository ?? throw new ArgumentNullException(nameof(institutionRepository));\n+            students = studentRepository ?? throw new ArgumentNullException(nameof(studentRepository));\n+            requirements = requirementRepository ?? throw new ArgumentNullException(nameof(requirementRepository));\n+        }\n+\n+        [HttpPost]\n+        public async Task AddCourse([FromBody] Course course) => await courses.AddAsync(course);\n+\n+        [HttpGet(\"{id}\")]\n+        public async Task<Course> GetCourse(Guid id) => await courses.GetAsync(id);\n+\n+        [HttpPut(\"{id}\")]\n+        public async Task EditCourse(Guid id, [FromBody] Course course)\n+        {\n+            if (id != course.Id)\n+            {\n+                throw new ApiException(HttpStatusCode.BadRequest, $\"Tried to edit {id} but got a model for {course.Id}\");\n+            }\n+            await courses.EditAsync(course);\n+        }\n+\n+        [HttpDelete(\"{id}\")]\n+        public async Task DeleteCourse(Guid id)\n+        {\n+            var course = await courses.GetAsync(id);\n+            if (course == null)\n+            {\n+                throw new ApiException(HttpStatusCode.BadRequest, $\"Tried to delete {course} that does not exist\");\n+            }\n+            await courses.DeleteAsync(course);\n+        }\n+\n+        [HttpGet]\n+        public async Task<IEnumerable<Course>> GetCompletedCoursesForStudentAsync(Student student)\n+        {\n+            if (student == null)\n+            {\n+                throw new ApiException(HttpStatusCode.BadRequest, $\"Tried to get course for {student} that does not exist\");\n+            }\n+            return (await courses.GetCompletedCoursesForStudentAsync(student));\n+        }\n+\n+        [HttpGet(\"{id}/requirements\")]\n+        public async Task<IEnumerable<Requirement>> GetRequirementsCourseSatisfiesAsync(Guid id)\n+        {\n+            var course =  await courses.GetAsync(id);\n+            if (course == null)\n+            {\n+                throw new ApiException(HttpStatusCode.NotFound, $\"course with id {id} not found\");\n+            }\n+            return (await requirements.GetRequirementsCourseSatisfiesAsync(course));\n+        }\n+\n+        [HttpGet(\"{id}/requirements\")]","path":"src/Athena/Controllers/api/CourseController.cs","position":78,"original_position":78,"commit_id":"b97bf1aaec8a0a4ae98e1df68f1cf48a0efd7dae","original_commit_id":"b97bf1aaec8a0a4ae98e1df68f1cf48a0efd7dae","user":{"login":"nlowe","id":794251,"avatar_url":"https://avatars1.githubusercontent.com/u/794251?v=4","gravatar_id":"","url":"https://api.github.com/users/nlowe","html_url":"https://github.com/nlowe","followers_url":"https://api.github.com/users/nlowe/followers","following_url":"https://api.github.com/users/nlowe/following{/other_user}","gists_url":"https://api.github.com/users/nlowe/gists{/gist_id}","starred_url":"https://api.github.com/users/nlowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlowe/subscriptions","organizations_url":"https://api.github.com/users/nlowe/orgs","repos_url":"https://api.github.com/users/nlowe/repos","events_url":"https://api.github.com/users/nlowe/events{/privacy}","received_events_url":"https://api.github.com/users/nlowe/received_events","type":"User","site_admin":false},"body":"Conflicting route. Should probably be `{id}/requirement/prereq`","created_at":"2018-03-06T18:21:18Z","updated_at":"2018-03-06T18:48:45Z","html_url":"https://github.com/athena-scheduler/athena/pull/24#discussion_r172612082","pull_request_url":"https://api.github.com/repos/athena-scheduler/athena/pulls/24","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/athena-scheduler/athena/pulls/comments/172612082"},"html":{"href":"https://github.com/athena-scheduler/athena/pull/24#discussion_r172612082"},"pull_request":{"href":"https://api.github.com/repos/athena-scheduler/athena/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/athena-scheduler/athena/pulls/24","id":173236712,"html_url":"https://github.com/athena-scheduler/athena/pull/24","diff_url":"https://github.com/athena-scheduler/athena/pull/24.diff","patch_url":"https://github.com/athena-scheduler/athena/pull/24.patch","issue_url":"https://api.github.com/repos/athena-scheduler/athena/issues/24","number":24,"state":"open","locked":false,"title":"Api Controller methods and testing implementation","user":{"login":"PeterETschaekofske","id":8696688,"avatar_url":"https://avatars3.githubusercontent.com/u/8696688?v=4","gravatar_id":"","url":"https://api.github.com/users/PeterETschaekofske","html_url":"https://github.com/PeterETschaekofske","followers_url":"https://api.github.com/users/PeterETschaekofske/followers","following_url":"https://api.github.com/users/PeterETschaekofske/following{/other_user}","gists_url":"https://api.github.com/users/PeterETschaekofske/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterETschaekofske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterETschaekofske/subscriptions","organizations_url":"https://api.github.com/users/PeterETschaekofske/orgs","repos_url":"https://api.github.com/users/PeterETschaekofske/repos","events_url":"https://api.github.com/users/PeterETschaekofske/events{/privacy}","received_events_url":"https://api.github.com/users/PeterETschaekofske/received_events","type":"User","site_admin":false},"body":"All api controllers are made and have methods implemented.Unit tests were made for all api controllers with all tests passing. Please check the api controller methods to see if I am missing any checks for null values and if other checks are needed. ","created_at":"2018-03-06T18:02:11Z","updated_at":"2018-03-06T18:48:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b8c931424b6f877d15e2238bfd38cd973c84c8c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nchurchill","id":8990332,"avatar_url":"https://avatars0.githubusercontent.com/u/8990332?v=4","gravatar_id":"","url":"https://api.github.com/users/nchurchill","html_url":"https://github.com/nchurchill","followers_url":"https://api.github.com/users/nchurchill/followers","following_url":"https://api.github.com/users/nchurchill/following{/other_user}","gists_url":"https://api.github.com/users/nchurchill/gists{/gist_id}","starred_url":"https://api.github.com/users/nchurchill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nchurchill/subscriptions","organizations_url":"https://api.github.com/users/nchurchill/orgs","repos_url":"https://api.github.com/users/nchurchill/repos","events_url":"https://api.github.com/users/nchurchill/events{/privacy}","received_events_url":"https://api.github.com/users/nchurchill/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":811831748,"url":"https://api.github.com/repos/athena-scheduler/athena/labels/area:backend","name":"area:backend","color":"d4c5f9","default":false},{"id":811833180,"url":"https://api.github.com/repos/athena-scheduler/athena/labels/feature","name":"feature","color":"b9f7a0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/athena-scheduler/athena/pulls/24/commits","review_comments_url":"https://api.github.com/repos/athena-scheduler/athena/pulls/24/comments","review_comment_url":"https://api.github.com/repos/athena-scheduler/athena/pulls/comments{/number}","comments_url":"https://api.github.com/repos/athena-scheduler/athena/issues/24/comments","statuses_url":"https://api.github.com/repos/athena-scheduler/athena/statuses/b97bf1aaec8a0a4ae98e1df68f1cf48a0efd7dae","head":{"label":"athena-scheduler:Controllers","ref":"Controllers","sha":"b97bf1aaec8a0a4ae98e1df68f1cf48a0efd7dae","user":{"login":"athena-scheduler","id":34181325,"avatar_url":"https://avatars0.githubusercontent.com/u/34181325?v=4","gravatar_id":"","url":"https://api.github.com/users/athena-scheduler","html_url":"https://github.com/athena-scheduler","followers_url":"https://api.github.com/users/athena-scheduler/followers","following_url":"https://api.github.com/users/athena-scheduler/following{/other_user}","gists_url":"https://api.github.com/users/athena-scheduler/gists{/gist_id}","starred_url":"https://api.github.com/users/athena-scheduler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athena-scheduler/subscriptions","organizations_url":"https://api.github.com/users/athena-scheduler/orgs","repos_url":"https://api.github.com/users/athena-scheduler/repos","events_url":"https://api.github.com/users/athena-scheduler/events{/privacy}","received_events_url":"https://api.github.com/users/athena-scheduler/received_events","type":"Organization","site_admin":false},"repo":{"id":116443002,"name":"athena","full_name":"athena-scheduler/athena","owner":{"login":"athena-scheduler","id":34181325,"avatar_url":"https://avatars0.githubusercontent.com/u/34181325?v=4","gravatar_id":"","url":"https://api.github.com/users/athena-scheduler","html_url":"https://github.com/athena-scheduler","followers_url":"https://api.github.com/users/athena-scheduler/followers","following_url":"https://api.github.com/users/athena-scheduler/following{/other_user}","gists_url":"https://api.github.com/users/athena-scheduler/gists{/gist_id}","starred_url":"https://api.github.com/users/athena-scheduler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athena-scheduler/subscriptions","organizations_url":"https://api.github.com/users/athena-scheduler/orgs","repos_url":"https://api.github.com/users/athena-scheduler/repos","events_url":"https://api.github.com/users/athena-scheduler/events{/privacy}","received_events_url":"https://api.github.com/users/athena-scheduler/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/athena-scheduler/athena","description":"Scheduling assistant for Schools, Universities, and other Educational Institutions","fork":false,"url":"https://api.github.com/repos/athena-scheduler/athena","forks_url":"https://api.github.com/repos/athena-scheduler/athena/forks","keys_url":"https://api.github.com/repos/athena-scheduler/athena/keys{/key_id}","collaborators_url":"https://api.github.com/repos/athena-scheduler/athena/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/athena-scheduler/athena/teams","hooks_url":"https://api.github.com/repos/athena-scheduler/athena/hooks","issue_events_url":"https://api.github.com/repos/athena-scheduler/athena/issues/events{/number}","events_url":"https://api.github.com/repos/athena-scheduler/athena/events","assignees_url":"https://api.github.com/repos/athena-scheduler/athena/assignees{/user}","branches_url":"https://api.github.com/repos/athena-scheduler/athena/branches{/branch}","tags_url":"https://api.github.com/repos/athena-scheduler/athena/tags","blobs_url":"https://api.github.com/repos/athena-scheduler/athena/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/athena-scheduler/athena/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/athena-scheduler/athena/git/refs{/sha}","trees_url":"https://api.github.com/repos/athena-scheduler/athena/git/trees{/sha}","statuses_url":"https://api.github.com/repos/athena-scheduler/athena/statuses/{sha}","languages_url":"https://api.github.com/repos/athena-scheduler/athena/languages","stargazers_url":"https://api.github.com/repos/athena-scheduler/athena/stargazers","contributors_url":"https://api.github.com/repos/athena-scheduler/athena/contributors","subscribers_url":"https://api.github.com/repos/athena-scheduler/athena/subscribers","subscription_url":"https://api.github.com/repos/athena-scheduler/athena/subscription","commits_url":"https://api.github.com/repos/athena-scheduler/athena/commits{/sha}","git_commits_url":"https://api.github.com/repos/athena-scheduler/athena/git/commits{/sha}","comments_url":"https://api.github.com/repos/athena-scheduler/athena/comments{/number}","issue_comment_url":"https://api.github.com/repos/athena-scheduler/athena/issues/comments{/number}","contents_url":"https://api.github.com/repos/athena-scheduler/athena/contents/{+path}","compare_url":"https://api.github.com/repos/athena-scheduler/athena/compare/{base}...{head}","merges_url":"https://api.github.com/repos/athena-scheduler/athena/merges","archive_url":"https://api.github.com/repos/athena-scheduler/athena/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/athena-scheduler/athena/downloads","issues_url":"https://api.github.com/repos/athena-scheduler/athena/issues{/number}","pulls_url":"https://api.github.com/repos/athena-scheduler/athena/pulls{/number}","milestones_url":"https://api.github.com/repos/athena-scheduler/athena/milestones{/number}","notifications_url":"https://api.github.com/repos/athena-scheduler/athena/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/athena-scheduler/athena/labels{/name}","releases_url":"https://api.github.com/repos/athena-scheduler/athena/releases{/id}","deployments_url":"https://api.github.com/repos/athena-scheduler/athena/deployments","created_at":"2018-01-06T01:18:40Z","updated_at":"2018-02-22T22:21:04Z","pushed_at":"2018-03-06T18:07:31Z","git_url":"git://github.com/athena-scheduler/athena.git","ssh_url":"git@github.com:athena-scheduler/athena.git","clone_url":"https://github.com/athena-scheduler/athena.git","svn_url":"https://github.com/athena-scheduler/athena","homepage":null,"size":841,"stargazers_count":1,"watchers_count":1,"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":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"athena-scheduler:master","ref":"master","sha":"5d945cbf9f3f88a07ffd4b7085f5c4627df7ed15","user":{"login":"athena-scheduler","id":34181325,"avatar_url":"https://avatars0.githubusercontent.com/u/34181325?v=4","gravatar_id":"","url":"https://api.github.com/users/athena-scheduler","html_url":"https://github.com/athena-scheduler","followers_url":"https://api.github.com/users/athena-scheduler/followers","following_url":"https://api.github.com/users/athena-scheduler/following{/other_user}","gists_url":"https://api.github.com/users/athena-scheduler/gists{/gist_id}","starred_url":"https://api.github.com/users/athena-scheduler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athena-scheduler/subscriptions","organizations_url":"https://api.github.com/users/athena-scheduler/orgs","repos_url":"https://api.github.com/users/athena-scheduler/repos","events_url":"https://api.github.com/users/athena-scheduler/events{/privacy}","received_events_url":"https://api.github.com/users/athena-scheduler/received_events","type":"Organization","site_admin":false},"repo":{"id":116443002,"name":"athena","full_name":"athena-scheduler/athena","owner":{"login":"athena-scheduler","id":34181325,"avatar_url":"https://avatars0.githubusercontent.com/u/34181325?v=4","gravatar_id":"","url":"https://api.github.com/users/athena-scheduler","html_url":"https://github.com/athena-scheduler","followers_url":"https://api.github.com/users/athena-scheduler/followers","following_url":"https://api.github.com/users/athena-scheduler/following{/other_user}","gists_url":"https://api.github.com/users/athena-scheduler/gists{/gist_id}","starred_url":"https://api.github.com/users/athena-scheduler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/athena-scheduler/subscriptions","organizations_url":"https://api.github.com/users/athena-scheduler/orgs","repos_url":"https://api.github.com/users/athena-scheduler/repos","events_url":"https://api.github.com/users/athena-scheduler/events{/privacy}","received_events_url":"https://api.github.com/users/athena-scheduler/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/athena-scheduler/athena","description":"Scheduling assistant for Schools, Universities, and other Educational Institutions","fork":false,"url":"https://api.github.com/repos/athena-scheduler/athena","forks_url":"https://api.github.com/repos/athena-scheduler/athena/forks","keys_url":"https://api.github.com/repos/athena-scheduler/athena/keys{/key_id}","collaborators_url":"https://api.github.com/repos/athena-scheduler/athena/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/athena-scheduler/athena/teams","hooks_url":"https://api.github.com/repos/athena-scheduler/athena/hooks","issue_events_url":"https://api.github.com/repos/athena-scheduler/athena/issues/events{/number}","events_url":"https://api.github.com/repos/athena-scheduler/athena/events","assignees_url":"https://api.github.com/repos/athena-scheduler/athena/assignees{/user}","branches_url":"https://api.github.com/repos/athena-scheduler/athena/branches{/branch}","tags_url":"https://api.github.com/repos/athena-scheduler/athena/tags","blobs_url":"https://api.github.com/repos/athena-scheduler/athena/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/athena-scheduler/athena/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/athena-scheduler/athena/git/refs{/sha}","trees_url":"https://api.github.com/repos/athena-scheduler/athena/git/trees{/sha}","statuses_url":"https://api.github.com/repos/athena-scheduler/athena/statuses/{sha}","languages_url":"https://api.github.com/repos/athena-scheduler/athena/languages","stargazers_url":"https://api.github.com/repos/athena-scheduler/athena/stargazers","contributors_url":"https://api.github.com/repos/athena-scheduler/athena/contributors","subscribers_url":"https://api.github.com/repos/athena-scheduler/athena/subscribers","subscription_url":"https://api.github.com/repos/athena-scheduler/athena/subscription","commits_url":"https://api.github.com/repos/athena-scheduler/athena/commits{/sha}","git_commits_url":"https://api.github.com/repos/athena-scheduler/athena/git/commits{/sha}","comments_url":"https://api.github.com/repos/athena-scheduler/athena/comments{/number}","issue_comment_url":"https://api.github.com/repos/athena-scheduler/athena/issues/comments{/number}","contents_url":"https://api.github.com/repos/athena-scheduler/athena/contents/{+path}","compare_url":"https://api.github.com/repos/athena-scheduler/athena/compare/{base}...{head}","merges_url":"https://api.github.com/repos/athena-scheduler/athena/merges","archive_url":"https://api.github.com/repos/athena-scheduler/athena/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/athena-scheduler/athena/downloads","issues_url":"https://api.github.com/repos/athena-scheduler/athena/issues{/number}","pulls_url":"https://api.github.com/repos/athena-scheduler/athena/pulls{/number}","milestones_url":"https://api.github.com/repos/athena-scheduler/athena/milestones{/number}","notifications_url":"https://api.github.com/repos/athena-scheduler/athena/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/athena-scheduler/athena/labels{/name}","releases_url":"https://api.github.com/repos/athena-scheduler/athena/releases{/id}","deployments_url":"https://api.github.com/repos/athena-scheduler/athena/deployments","created_at":"2018-01-06T01:18:40Z","updated_at":"2018-02-22T22:21:04Z","pushed_at":"2018-03-06T18:07:31Z","git_url":"git://github.com/athena-scheduler/athena.git","ssh_url":"git@github.com:athena-scheduler/athena.git","clone_url":"https://github.com/athena-scheduler/athena.git","svn_url":"https://github.com/athena-scheduler/athena","homepage":null,"size":841,"stargazers_count":1,"watchers_count":1,"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":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/athena-scheduler/athena/pulls/24"},"html":{"href":"https://github.com/athena-scheduler/athena/pull/24"},"issue":{"href":"https://api.github.com/repos/athena-scheduler/athena/issues/24"},"comments":{"href":"https://api.github.com/repos/athena-scheduler/athena/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/athena-scheduler/athena/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/athena-scheduler/athena/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/athena-scheduler/athena/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/athena-scheduler/athena/statuses/b97bf1aaec8a0a4ae98e1df68f1cf48a0efd7dae"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nlowe"}}