{"action":"created","comment":{"url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/comments/233664812","pull_request_review_id":175133663,"id":233664812,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzY2NDgxMg==","diff_hunk":"@@ -0,0 +1,63 @@\n+<?php\n+/**\n+ * Created by PhpStorm.\n+ * User: elvis\n+ * Date: 2018/11/11\n+ * Time: 17:58\n+ */\n+\n+use \\Psr\\Http\\Message\\ServerRequestInterface as Request;\n+use \\Psr\\Http\\Message\\ResponseInterface as Response;\n+\n+// Get All Coupon types\n+$app->get('/api/couponTypes', function (Request $request, Response $response) {\n+\n+    $sql = \"SELECT * FROM coupon_type\";\n+    try {\n+        // Get DB Object\n+        $db = new db();\n+        // Connect\n+        $db = $db->connect();\n+        $stmt = $db->query($sql);\n+        $types = $stmt->fetchAll(PDO::FETCH_OBJ);\n+        $db = null;\n+        $response->write(json_encode($types));\n+        return $response->withStatus(200);\n+    } catch (PDOException $e) {\n+        $db = null;\n+        $errorMessage = $e->getMessage();\n+        return $response->write(json_encode(['error'=>$errorMessage]))->withStatus(500);\n+    }\n+});\n+\n+//add coupon types\n+$app->post('/api/couponTypes/create', function(Request $request, Response $response){","path":"src/routes/coupon_types.php","position":34,"original_position":34,"commit_id":"8bc74ba56e9ea72614618b9a5266abeb1f4c13a5","original_commit_id":"8bc74ba56e9ea72614618b9a5266abeb1f4c13a5","user":{"login":"suiyoubi","id":22045332,"node_id":"MDQ6VXNlcjIyMDQ1MzMy","avatar_url":"https://avatars1.githubusercontent.com/u/22045332?v=4","gravatar_id":"","url":"https://api.github.com/users/suiyoubi","html_url":"https://github.com/suiyoubi","followers_url":"https://api.github.com/users/suiyoubi/followers","following_url":"https://api.github.com/users/suiyoubi/following{/other_user}","gists_url":"https://api.github.com/users/suiyoubi/gists{/gist_id}","starred_url":"https://api.github.com/users/suiyoubi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suiyoubi/subscriptions","organizations_url":"https://api.github.com/users/suiyoubi/orgs","repos_url":"https://api.github.com/users/suiyoubi/repos","events_url":"https://api.github.com/users/suiyoubi/events{/privacy}","received_events_url":"https://api.github.com/users/suiyoubi/received_events","type":"User","site_admin":false},"body":"Please use `coupon-types`","created_at":"2018-11-14T23:44:46Z","updated_at":"2018-11-14T23:44:47Z","html_url":"https://github.com/suiyoubi/hotelify-php/pull/13#discussion_r233664812","pull_request_url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/comments/233664812"},"html":{"href":"https://github.com/suiyoubi/hotelify-php/pull/13#discussion_r233664812"},"pull_request":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13","id":230731898,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNzMxODk4","html_url":"https://github.com/suiyoubi/hotelify-php/pull/13","diff_url":"https://github.com/suiyoubi/hotelify-php/pull/13.diff","patch_url":"https://github.com/suiyoubi/hotelify-php/pull/13.patch","issue_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/13","number":13,"state":"open","locked":false,"title":"Feature/coupon type","user":{"login":"klQiu","id":21168885,"node_id":"MDQ6VXNlcjIxMTY4ODg1","avatar_url":"https://avatars0.githubusercontent.com/u/21168885?v=4","gravatar_id":"","url":"https://api.github.com/users/klQiu","html_url":"https://github.com/klQiu","followers_url":"https://api.github.com/users/klQiu/followers","following_url":"https://api.github.com/users/klQiu/following{/other_user}","gists_url":"https://api.github.com/users/klQiu/gists{/gist_id}","starred_url":"https://api.github.com/users/klQiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klQiu/subscriptions","organizations_url":"https://api.github.com/users/klQiu/orgs","repos_url":"https://api.github.com/users/klQiu/repos","events_url":"https://api.github.com/users/klQiu/events{/privacy}","received_events_url":"https://api.github.com/users/klQiu/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-14T07:10:09Z","updated_at":"2018-11-14T23:44:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13/commits","review_comments_url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13/comments","review_comment_url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/13/comments","statuses_url":"https://api.github.com/repos/suiyoubi/hotelify-php/statuses/8bc74ba56e9ea72614618b9a5266abeb1f4c13a5","head":{"label":"suiyoubi:feature/coupon_type","ref":"feature/coupon_type","sha":"8bc74ba56e9ea72614618b9a5266abeb1f4c13a5","user":{"login":"suiyoubi","id":22045332,"node_id":"MDQ6VXNlcjIyMDQ1MzMy","avatar_url":"https://avatars1.githubusercontent.com/u/22045332?v=4","gravatar_id":"","url":"https://api.github.com/users/suiyoubi","html_url":"https://github.com/suiyoubi","followers_url":"https://api.github.com/users/suiyoubi/followers","following_url":"https://api.github.com/users/suiyoubi/following{/other_user}","gists_url":"https://api.github.com/users/suiyoubi/gists{/gist_id}","starred_url":"https://api.github.com/users/suiyoubi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suiyoubi/subscriptions","organizations_url":"https://api.github.com/users/suiyoubi/orgs","repos_url":"https://api.github.com/users/suiyoubi/repos","events_url":"https://api.github.com/users/suiyoubi/events{/privacy}","received_events_url":"https://api.github.com/users/suiyoubi/received_events","type":"User","site_admin":false},"repo":{"id":157008576,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwMDg1NzY=","name":"hotelify-php","full_name":"suiyoubi/hotelify-php","private":false,"owner":{"login":"suiyoubi","id":22045332,"node_id":"MDQ6VXNlcjIyMDQ1MzMy","avatar_url":"https://avatars1.githubusercontent.com/u/22045332?v=4","gravatar_id":"","url":"https://api.github.com/users/suiyoubi","html_url":"https://github.com/suiyoubi","followers_url":"https://api.github.com/users/suiyoubi/followers","following_url":"https://api.github.com/users/suiyoubi/following{/other_user}","gists_url":"https://api.github.com/users/suiyoubi/gists{/gist_id}","starred_url":"https://api.github.com/users/suiyoubi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suiyoubi/subscriptions","organizations_url":"https://api.github.com/users/suiyoubi/orgs","repos_url":"https://api.github.com/users/suiyoubi/repos","events_url":"https://api.github.com/users/suiyoubi/events{/privacy}","received_events_url":"https://api.github.com/users/suiyoubi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/suiyoubi/hotelify-php","description":null,"fork":false,"url":"https://api.github.com/repos/suiyoubi/hotelify-php","forks_url":"https://api.github.com/repos/suiyoubi/hotelify-php/forks","keys_url":"https://api.github.com/repos/suiyoubi/hotelify-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suiyoubi/hotelify-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suiyoubi/hotelify-php/teams","hooks_url":"https://api.github.com/repos/suiyoubi/hotelify-php/hooks","issue_events_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/events{/number}","events_url":"https://api.github.com/repos/suiyoubi/hotelify-php/events","assignees_url":"https://api.github.com/repos/suiyoubi/hotelify-php/assignees{/user}","branches_url":"https://api.github.com/repos/suiyoubi/hotelify-php/branches{/branch}","tags_url":"https://api.github.com/repos/suiyoubi/hotelify-php/tags","blobs_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suiyoubi/hotelify-php/statuses/{sha}","languages_url":"https://api.github.com/repos/suiyoubi/hotelify-php/languages","stargazers_url":"https://api.github.com/repos/suiyoubi/hotelify-php/stargazers","contributors_url":"https://api.github.com/repos/suiyoubi/hotelify-php/contributors","subscribers_url":"https://api.github.com/repos/suiyoubi/hotelify-php/subscribers","subscription_url":"https://api.github.com/repos/suiyoubi/hotelify-php/subscription","commits_url":"https://api.github.com/repos/suiyoubi/hotelify-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/suiyoubi/hotelify-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/suiyoubi/hotelify-php/contents/{+path}","compare_url":"https://api.github.com/repos/suiyoubi/hotelify-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suiyoubi/hotelify-php/merges","archive_url":"https://api.github.com/repos/suiyoubi/hotelify-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suiyoubi/hotelify-php/downloads","issues_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues{/number}","pulls_url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls{/number}","milestones_url":"https://api.github.com/repos/suiyoubi/hotelify-php/milestones{/number}","notifications_url":"https://api.github.com/repos/suiyoubi/hotelify-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suiyoubi/hotelify-php/labels{/name}","releases_url":"https://api.github.com/repos/suiyoubi/hotelify-php/releases{/id}","deployments_url":"https://api.github.com/repos/suiyoubi/hotelify-php/deployments","created_at":"2018-11-10T18:17:06Z","updated_at":"2018-11-14T04:35:57Z","pushed_at":"2018-11-14T07:53:11Z","git_url":"git://github.com/suiyoubi/hotelify-php.git","ssh_url":"git@github.com:suiyoubi/hotelify-php.git","clone_url":"https://github.com/suiyoubi/hotelify-php.git","svn_url":"https://github.com/suiyoubi/hotelify-php","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"suiyoubi:master","ref":"master","sha":"e1d3d2588a1763f22dbfa6a2b2752c73d489305a","user":{"login":"suiyoubi","id":22045332,"node_id":"MDQ6VXNlcjIyMDQ1MzMy","avatar_url":"https://avatars1.githubusercontent.com/u/22045332?v=4","gravatar_id":"","url":"https://api.github.com/users/suiyoubi","html_url":"https://github.com/suiyoubi","followers_url":"https://api.github.com/users/suiyoubi/followers","following_url":"https://api.github.com/users/suiyoubi/following{/other_user}","gists_url":"https://api.github.com/users/suiyoubi/gists{/gist_id}","starred_url":"https://api.github.com/users/suiyoubi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suiyoubi/subscriptions","organizations_url":"https://api.github.com/users/suiyoubi/orgs","repos_url":"https://api.github.com/users/suiyoubi/repos","events_url":"https://api.github.com/users/suiyoubi/events{/privacy}","received_events_url":"https://api.github.com/users/suiyoubi/received_events","type":"User","site_admin":false},"repo":{"id":157008576,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcwMDg1NzY=","name":"hotelify-php","full_name":"suiyoubi/hotelify-php","private":false,"owner":{"login":"suiyoubi","id":22045332,"node_id":"MDQ6VXNlcjIyMDQ1MzMy","avatar_url":"https://avatars1.githubusercontent.com/u/22045332?v=4","gravatar_id":"","url":"https://api.github.com/users/suiyoubi","html_url":"https://github.com/suiyoubi","followers_url":"https://api.github.com/users/suiyoubi/followers","following_url":"https://api.github.com/users/suiyoubi/following{/other_user}","gists_url":"https://api.github.com/users/suiyoubi/gists{/gist_id}","starred_url":"https://api.github.com/users/suiyoubi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suiyoubi/subscriptions","organizations_url":"https://api.github.com/users/suiyoubi/orgs","repos_url":"https://api.github.com/users/suiyoubi/repos","events_url":"https://api.github.com/users/suiyoubi/events{/privacy}","received_events_url":"https://api.github.com/users/suiyoubi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/suiyoubi/hotelify-php","description":null,"fork":false,"url":"https://api.github.com/repos/suiyoubi/hotelify-php","forks_url":"https://api.github.com/repos/suiyoubi/hotelify-php/forks","keys_url":"https://api.github.com/repos/suiyoubi/hotelify-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suiyoubi/hotelify-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suiyoubi/hotelify-php/teams","hooks_url":"https://api.github.com/repos/suiyoubi/hotelify-php/hooks","issue_events_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/events{/number}","events_url":"https://api.github.com/repos/suiyoubi/hotelify-php/events","assignees_url":"https://api.github.com/repos/suiyoubi/hotelify-php/assignees{/user}","branches_url":"https://api.github.com/repos/suiyoubi/hotelify-php/branches{/branch}","tags_url":"https://api.github.com/repos/suiyoubi/hotelify-php/tags","blobs_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suiyoubi/hotelify-php/statuses/{sha}","languages_url":"https://api.github.com/repos/suiyoubi/hotelify-php/languages","stargazers_url":"https://api.github.com/repos/suiyoubi/hotelify-php/stargazers","contributors_url":"https://api.github.com/repos/suiyoubi/hotelify-php/contributors","subscribers_url":"https://api.github.com/repos/suiyoubi/hotelify-php/subscribers","subscription_url":"https://api.github.com/repos/suiyoubi/hotelify-php/subscription","commits_url":"https://api.github.com/repos/suiyoubi/hotelify-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/suiyoubi/hotelify-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/suiyoubi/hotelify-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/suiyoubi/hotelify-php/contents/{+path}","compare_url":"https://api.github.com/repos/suiyoubi/hotelify-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suiyoubi/hotelify-php/merges","archive_url":"https://api.github.com/repos/suiyoubi/hotelify-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suiyoubi/hotelify-php/downloads","issues_url":"https://api.github.com/repos/suiyoubi/hotelify-php/issues{/number}","pulls_url":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls{/number}","milestones_url":"https://api.github.com/repos/suiyoubi/hotelify-php/milestones{/number}","notifications_url":"https://api.github.com/repos/suiyoubi/hotelify-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suiyoubi/hotelify-php/labels{/name}","releases_url":"https://api.github.com/repos/suiyoubi/hotelify-php/releases{/id}","deployments_url":"https://api.github.com/repos/suiyoubi/hotelify-php/deployments","created_at":"2018-11-10T18:17:06Z","updated_at":"2018-11-14T04:35:57Z","pushed_at":"2018-11-14T07:53:11Z","git_url":"git://github.com/suiyoubi/hotelify-php.git","ssh_url":"git@github.com:suiyoubi/hotelify-php.git","clone_url":"https://github.com/suiyoubi/hotelify-php.git","svn_url":"https://github.com/suiyoubi/hotelify-php","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13"},"html":{"href":"https://github.com/suiyoubi/hotelify-php/pull/13"},"issue":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/13"},"comments":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/suiyoubi/hotelify-php/statuses/8bc74ba56e9ea72614618b9a5266abeb1f4c13a5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"suiyoubi"}}