{"action":"created","comment":{"url":"https://api.github.com/repos/edx/ecommerce/pulls/comments/94204885","pull_request_review_id":14735767,"id":94204885,"diff_hunk":"@@ -164,6 +164,8 @@\n                 <label for=\"single-course\"><%= gettext('Single course') %></label>\n                 <input id=\"multiple-courses\" type=\"radio\" name=\"catalog_type\" value=\"Multiple courses\">\n                 <label for=\"multiple-courses\"><%= gettext('Multiple courses') %></label>\n+                <input id=\"catalog\" type=\"radio\" name=\"catalog_type\" value=\"Course catalog\">\n+                <label for=\"catalog\"><%= gettext('Course catalog') %></label>","path":"ecommerce/static/templates/coupon_form.html","position":null,"original_position":5,"commit_id":"f9d2a0c3755cf9a9fb31f664dc9f3cdb25c514dc","original_commit_id":"276586cad83e0a3df87ce401982be7c87139e7f4","user":{"login":"asadiqbal08","id":7334669,"avatar_url":"https://avatars.githubusercontent.com/u/7334669?v=3","gravatar_id":"","url":"https://api.github.com/users/asadiqbal08","html_url":"https://github.com/asadiqbal08","followers_url":"https://api.github.com/users/asadiqbal08/followers","following_url":"https://api.github.com/users/asadiqbal08/following{/other_user}","gists_url":"https://api.github.com/users/asadiqbal08/gists{/gist_id}","starred_url":"https://api.github.com/users/asadiqbal08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asadiqbal08/subscriptions","organizations_url":"https://api.github.com/users/asadiqbal08/orgs","repos_url":"https://api.github.com/users/asadiqbal08/repos","events_url":"https://api.github.com/users/asadiqbal08/events{/privacy}","received_events_url":"https://api.github.com/users/asadiqbal08/received_events","type":"User","site_admin":false},"body":"ah. I forgot it.","created_at":"2016-12-30T06:15:17Z","updated_at":"2016-12-30T06:15:17Z","html_url":"https://github.com/edx/ecommerce/pull/1066#discussion_r94204885","pull_request_url":"https://api.github.com/repos/edx/ecommerce/pulls/1066","_links":{"self":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/comments/94204885"},"html":{"href":"https://github.com/edx/ecommerce/pull/1066#discussion_r94204885"},"pull_request":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1066"}}},"pull_request":{"url":"https://api.github.com/repos/edx/ecommerce/pulls/1066","id":99354541,"html_url":"https://github.com/edx/ecommerce/pull/1066","diff_url":"https://github.com/edx/ecommerce/pull/1066.diff","patch_url":"https://github.com/edx/ecommerce/pull/1066.patch","issue_url":"https://api.github.com/repos/edx/ecommerce/issues/1066","number":1066,"state":"open","locked":false,"title":"add course catalog selection functionality to coupon admin tool","user":{"login":"zubair-arbi","id":5072991,"avatar_url":"https://avatars.githubusercontent.com/u/5072991?v=3","gravatar_id":"","url":"https://api.github.com/users/zubair-arbi","html_url":"https://github.com/zubair-arbi","followers_url":"https://api.github.com/users/zubair-arbi/followers","following_url":"https://api.github.com/users/zubair-arbi/following{/other_user}","gists_url":"https://api.github.com/users/zubair-arbi/gists{/gist_id}","starred_url":"https://api.github.com/users/zubair-arbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zubair-arbi/subscriptions","organizations_url":"https://api.github.com/users/zubair-arbi/orgs","repos_url":"https://api.github.com/users/zubair-arbi/repos","events_url":"https://api.github.com/users/zubair-arbi/events{/privacy}","received_events_url":"https://api.github.com/users/zubair-arbi/received_events","type":"User","site_admin":false},"body":"ENT-110\r\n\r\n### WIP\r\n@asadiqbal08 @saleem-latif @mattdrayer \r\n\r\nThere were two ways to add catalogs selection functionality:\r\n\r\n1. Provide catalogs lists from view and pass the list as an argument all the way to `coupon_form_view.js` from `coupon_app.js`\r\n2. Get catalogs list through `ajax` while rendering the page `coupon_form.html`.\r\n\r\nI followed second approach which is currently being used for populating the `catagories` field and also seems more suitable for our current requirement.\r\n\r\nWe also needed a new field to save the catalog id returned from the discovery service to display the selected catalog on edit coupon view and also to display catalog courses on offer redeem page. Saving the catalog id on our end will abstract us away from any changes (name, query etc) being made in the service `discovery`. \r\n\r\n> _**Note:** We will need to create a follow up story to update the `Redeem` coupon page to use the new field `course_catalog` for displaying the courses against some coupon._\r\n\r\n## Completed tasks:\r\n* Add new field `course_catalog` to save the id for the related catalog in coupon range model\r\n* Add migration for the `offer` model `Range`\r\n* Update coupon form to display the new course type selection `Course catalog`\r\n* Update coupon form to add a new field `course_catalog` to allow catalogs selection while creating coupons\r\n* Update backend code to get the `course_catalog` value in the model `Range`\r\n* Add method `get_course_catalogs` to recursively get all catalogs or a single course catalog from the service `discovery`\r\n* Update serializer `CouponSerializer` to include `course_catalog` field\r\n* Display course catalog name on the coupon detail page in case of `Course catalog`.\r\n\r\n## Remaining tasks:\r\n* Update the `Coupon edit page` for course catalogs\r\n* Add unit tests\r\n* Add js tests\r\n\r\n### Coupon create page\r\n<img width=\"1095\" alt=\"screen shot 2016-12-28 at 7 11 06 pm\" src=\"https://cloud.githubusercontent.com/assets/5072991/21523602/8a875ac0-cd31-11e6-849d-f4ef2e528ee9.png\">\r\n\r\n### Coupon detail page\r\n<img width=\"1097\" alt=\"screen shot 2016-12-28 at 7 11 35 pm\" src=\"https://cloud.githubusercontent.com/assets/5072991/21523610/958265fa-cd31-11e6-8d8d-46b954237c19.png\">\r\n\r\n\r\n","created_at":"2016-12-26T09:27:35Z","updated_at":"2016-12-30T06:15:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"128d308c838bb6928d33818caa619a4dbd109285","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/edx/ecommerce/pulls/1066/commits","review_comments_url":"https://api.github.com/repos/edx/ecommerce/pulls/1066/comments","review_comment_url":"https://api.github.com/repos/edx/ecommerce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/ecommerce/issues/1066/comments","statuses_url":"https://api.github.com/repos/edx/ecommerce/statuses/f9d2a0c3755cf9a9fb31f664dc9f3cdb25c514dc","head":{"label":"edx:zub/ENT-110-select-catalog-on-coupon-admin-tool","ref":"zub/ENT-110-select-catalog-on-coupon-admin-tool","sha":"f9d2a0c3755cf9a9fb31f664dc9f3cdb25c514dc","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":30175039,"name":"ecommerce","full_name":"edx/ecommerce","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/ecommerce","description":"Django application used to manage edX's product catalog and handle orders for those products.","fork":false,"url":"https://api.github.com/repos/edx/ecommerce","forks_url":"https://api.github.com/repos/edx/ecommerce/forks","keys_url":"https://api.github.com/repos/edx/ecommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/ecommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/ecommerce/teams","hooks_url":"https://api.github.com/repos/edx/ecommerce/hooks","issue_events_url":"https://api.github.com/repos/edx/ecommerce/issues/events{/number}","events_url":"https://api.github.com/repos/edx/ecommerce/events","assignees_url":"https://api.github.com/repos/edx/ecommerce/assignees{/user}","branches_url":"https://api.github.com/repos/edx/ecommerce/branches{/branch}","tags_url":"https://api.github.com/repos/edx/ecommerce/tags","blobs_url":"https://api.github.com/repos/edx/ecommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/ecommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/ecommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/ecommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/ecommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/ecommerce/languages","stargazers_url":"https://api.github.com/repos/edx/ecommerce/stargazers","contributors_url":"https://api.github.com/repos/edx/ecommerce/contributors","subscribers_url":"https://api.github.com/repos/edx/ecommerce/subscribers","subscription_url":"https://api.github.com/repos/edx/ecommerce/subscription","commits_url":"https://api.github.com/repos/edx/ecommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/ecommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/ecommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/ecommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/ecommerce/contents/{+path}","compare_url":"https://api.github.com/repos/edx/ecommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/ecommerce/merges","archive_url":"https://api.github.com/repos/edx/ecommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/ecommerce/downloads","issues_url":"https://api.github.com/repos/edx/ecommerce/issues{/number}","pulls_url":"https://api.github.com/repos/edx/ecommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/ecommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/ecommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/ecommerce/labels{/name}","releases_url":"https://api.github.com/repos/edx/ecommerce/releases{/id}","deployments_url":"https://api.github.com/repos/edx/ecommerce/deployments","created_at":"2015-02-02T06:55:15Z","updated_at":"2016-12-21T15:48:54Z","pushed_at":"2016-12-29T21:40:26Z","git_url":"git://github.com/edx/ecommerce.git","ssh_url":"git@github.com:edx/ecommerce.git","clone_url":"https://github.com/edx/ecommerce.git","svn_url":"https://github.com/edx/ecommerce","homepage":"","size":5777,"stargazers_count":45,"watchers_count":45,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":28,"forks":48,"open_issues":28,"watchers":45,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"14d7a5679a8f748e82c27e2e104b242a983494ff","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":30175039,"name":"ecommerce","full_name":"edx/ecommerce","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/ecommerce","description":"Django application used to manage edX's product catalog and handle orders for those products.","fork":false,"url":"https://api.github.com/repos/edx/ecommerce","forks_url":"https://api.github.com/repos/edx/ecommerce/forks","keys_url":"https://api.github.com/repos/edx/ecommerce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/ecommerce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/ecommerce/teams","hooks_url":"https://api.github.com/repos/edx/ecommerce/hooks","issue_events_url":"https://api.github.com/repos/edx/ecommerce/issues/events{/number}","events_url":"https://api.github.com/repos/edx/ecommerce/events","assignees_url":"https://api.github.com/repos/edx/ecommerce/assignees{/user}","branches_url":"https://api.github.com/repos/edx/ecommerce/branches{/branch}","tags_url":"https://api.github.com/repos/edx/ecommerce/tags","blobs_url":"https://api.github.com/repos/edx/ecommerce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/ecommerce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/ecommerce/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/ecommerce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/ecommerce/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/ecommerce/languages","stargazers_url":"https://api.github.com/repos/edx/ecommerce/stargazers","contributors_url":"https://api.github.com/repos/edx/ecommerce/contributors","subscribers_url":"https://api.github.com/repos/edx/ecommerce/subscribers","subscription_url":"https://api.github.com/repos/edx/ecommerce/subscription","commits_url":"https://api.github.com/repos/edx/ecommerce/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/ecommerce/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/ecommerce/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/ecommerce/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/ecommerce/contents/{+path}","compare_url":"https://api.github.com/repos/edx/ecommerce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/ecommerce/merges","archive_url":"https://api.github.com/repos/edx/ecommerce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/ecommerce/downloads","issues_url":"https://api.github.com/repos/edx/ecommerce/issues{/number}","pulls_url":"https://api.github.com/repos/edx/ecommerce/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/ecommerce/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/ecommerce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/ecommerce/labels{/name}","releases_url":"https://api.github.com/repos/edx/ecommerce/releases{/id}","deployments_url":"https://api.github.com/repos/edx/ecommerce/deployments","created_at":"2015-02-02T06:55:15Z","updated_at":"2016-12-21T15:48:54Z","pushed_at":"2016-12-29T21:40:26Z","git_url":"git://github.com/edx/ecommerce.git","ssh_url":"git@github.com:edx/ecommerce.git","clone_url":"https://github.com/edx/ecommerce.git","svn_url":"https://github.com/edx/ecommerce","homepage":"","size":5777,"stargazers_count":45,"watchers_count":45,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":28,"forks":48,"open_issues":28,"watchers":45,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1066"},"html":{"href":"https://github.com/edx/ecommerce/pull/1066"},"issue":{"href":"https://api.github.com/repos/edx/ecommerce/issues/1066"},"comments":{"href":"https://api.github.com/repos/edx/ecommerce/issues/1066/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1066/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/ecommerce/pulls/1066/commits"},"statuses":{"href":"https://api.github.com/repos/edx/ecommerce/statuses/f9d2a0c3755cf9a9fb31f664dc9f3cdb25c514dc"}}}}
{"actor":{"display_login":"asadiqbal08"}}