{"action":"created","comment":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/228522605","pull_request_review_id":168817300,"id":228522605,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODUyMjYwNQ==","diff_hunk":"@@ -0,0 +1,26 @@\n+<?php\n+\n+declare(strict_types=1);\n+\n+namespace Pim\\Component\\Catalog\\Channel\\Query;\n+\n+interface FindActivatedCurrenciesInterface","path":"src/Pim/Component/Catalog/Channel/Query/FindActivatedCurrenciesInterface.php","position":7,"original_position":7,"commit_id":"e217a37cfe952fcdaa32454a0948415007774b5d","original_commit_id":"3c7eb1d742b3258c81d020a66fbe617a5b9aef88","user":{"login":"jjanvier","id":3691804,"node_id":"MDQ6VXNlcjM2OTE4MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/3691804?v=4","gravatar_id":"","url":"https://api.github.com/users/jjanvier","html_url":"https://github.com/jjanvier","followers_url":"https://api.github.com/users/jjanvier/followers","following_url":"https://api.github.com/users/jjanvier/following{/other_user}","gists_url":"https://api.github.com/users/jjanvier/gists{/gist_id}","starred_url":"https://api.github.com/users/jjanvier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjanvier/subscriptions","organizations_url":"https://api.github.com/users/jjanvier/orgs","repos_url":"https://api.github.com/users/jjanvier/repos","events_url":"https://api.github.com/users/jjanvier/events{/privacy}","received_events_url":"https://api.github.com/users/jjanvier/received_events","type":"User","site_admin":false},"body":"think about decoupling please! domain vs infra is the key\r\nyou have no other choice apparently\r\n\r\nyour query function uses the EntityManager\r\nif you have no interface, then you'll end up with infrastructure concerns in the ` src/Pim/Component/Catalog/Factory/Value/PriceCollectionValueFactory.php`\r\n\r\nplease read (and remember :p) that carefully https://matthiasnoback.nl/2018/08/when-to-add-an-interface-to-a-class/\r\n> If the class depends on third-party code\r\n\r\nthat's the case here\r\n","created_at":"2018-10-26T13:17:00Z","updated_at":"2018-10-26T13:17:16Z","html_url":"https://github.com/akeneo/pim-community-dev/pull/9032#discussion_r228522605","pull_request_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments/228522605"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/9032#discussion_r228522605"},"pull_request":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032"}},"in_reply_to_id":228509015},"pull_request":{"url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032","id":225785913,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1Nzg1OTEz","html_url":"https://github.com/akeneo/pim-community-dev/pull/9032","diff_url":"https://github.com/akeneo/pim-community-dev/pull/9032.diff","patch_url":"https://github.com/akeneo/pim-community-dev/pull/9032.patch","issue_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/9032","number":9032,"state":"open","locked":false,"title":"PIM-7765: Add checks channel/currency in PriceCollectionFactory","user":{"login":"SamirBoulil","id":1826473,"node_id":"MDQ6VXNlcjE4MjY0NzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1826473?v=4","gravatar_id":"","url":"https://api.github.com/users/SamirBoulil","html_url":"https://github.com/SamirBoulil","followers_url":"https://api.github.com/users/SamirBoulil/followers","following_url":"https://api.github.com/users/SamirBoulil/following{/other_user}","gists_url":"https://api.github.com/users/SamirBoulil/gists{/gist_id}","starred_url":"https://api.github.com/users/SamirBoulil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamirBoulil/subscriptions","organizations_url":"https://api.github.com/users/SamirBoulil/orgs","repos_url":"https://api.github.com/users/SamirBoulil/repos","events_url":"https://api.github.com/users/SamirBoulil/events{/privacy}","received_events_url":"https://api.github.com/users/SamirBoulil/received_events","type":"User","site_admin":false},"body":"**Description (for Contributor and Core Developer)**\r\n\r\n**Problem:**\r\nWhen showing a product, and ultimately, hydrating its price collection values we do not check if the currencies coming from the database are still activated in the channel. hence, we hydrate those prices regardless.\r\n\r\nWhen the user wants to do a modification on the product and saves it, those \"old\" prices are sent to the backend alongside with the updates, and a violation error occurs because 🎉  you cannot set a price on a product for a currency not activated by the channel :)\r\n\r\n**The user cannot update the price anymore through the UI**\r\n\r\n**Proposed solution:**\r\nThe solution is to:\r\n- filter out the prices that have a currency not activated in the channel of the value at hydration time (for scopable prices attributes).\r\n- filter out the prices that a currency not activated at hydration time (for non-scopable prices attributes)\r\n\r\n**Definition Of Done (for Core Developer only)**\r\n\r\n| Q                                 | A\r\n| --------------------------------- | ---\r\n| Added Specs                       | -\r\n| Added legacy Behats               | -\r\n| Added acceptance tests            | -\r\n| Added integration tests           | -\r\n| Changelog updated                 | Todo\r\n| Review and 2 GTM                  | Todo\r\n| Micro Demo to the PO (Story only) | -\r\n| Migration script                  | -\r\n| Tech Doc                          | -\r\n\r\n`Todo`: Pending / Work in progress\r\n`OK`: Done / Validated\r\n`-`: Not needed\r\n","created_at":"2018-10-25T14:38:31Z","updated_at":"2018-10-26T13:17:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7784d2ac49148af1f3b53bf57a709299e134527","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032/commits","review_comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032/comments","review_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/9032/comments","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/e217a37cfe952fcdaa32454a0948415007774b5d","head":{"label":"akeneo:PIM-7765","ref":"PIM-7765","sha":"e217a37cfe952fcdaa32454a0948415007774b5d","user":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":5367323,"node_id":"MDEwOlJlcG9zaXRvcnk1MzY3MzIz","name":"pim-community-dev","full_name":"akeneo/pim-community-dev","private":false,"owner":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/akeneo/pim-community-dev","description":"[Community Development Repository] The open source Product Information Management (PIM)","fork":false,"url":"https://api.github.com/repos/akeneo/pim-community-dev","forks_url":"https://api.github.com/repos/akeneo/pim-community-dev/forks","keys_url":"https://api.github.com/repos/akeneo/pim-community-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/pim-community-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/pim-community-dev/teams","hooks_url":"https://api.github.com/repos/akeneo/pim-community-dev/hooks","issue_events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/events","assignees_url":"https://api.github.com/repos/akeneo/pim-community-dev/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/pim-community-dev/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/tags","blobs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/pim-community-dev/languages","stargazers_url":"https://api.github.com/repos/akeneo/pim-community-dev/stargazers","contributors_url":"https://api.github.com/repos/akeneo/pim-community-dev/contributors","subscribers_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscribers","subscription_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscription","commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/akeneo/pim-community-dev/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/pim-community-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/pim-community-dev/merges","archive_url":"https://api.github.com/repos/akeneo/pim-community-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/pim-community-dev/downloads","issues_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/pim-community-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/pim-community-dev/releases{/id}","deployments_url":"https://api.github.com/repos/akeneo/pim-community-dev/deployments","created_at":"2012-08-10T09:27:26Z","updated_at":"2018-10-26T12:10:05Z","pushed_at":"2018-10-26T13:10:37Z","git_url":"git://github.com/akeneo/pim-community-dev.git","ssh_url":"git@github.com:akeneo/pim-community-dev.git","clone_url":"https://github.com/akeneo/pim-community-dev.git","svn_url":"https://github.com/akeneo/pim-community-dev","homepage":"http://www.akeneo.com","size":149797,"stargazers_count":549,"watchers_count":549,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":333,"mirror_url":null,"archived":false,"open_issues_count":287,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":333,"open_issues":287,"watchers":549,"default_branch":"master"}},"base":{"label":"akeneo:2.3","ref":"2.3","sha":"f9397ee9f0585226266acf41d0f9bc1227cc103e","user":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":5367323,"node_id":"MDEwOlJlcG9zaXRvcnk1MzY3MzIz","name":"pim-community-dev","full_name":"akeneo/pim-community-dev","private":false,"owner":{"login":"akeneo","id":2510186,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MTAxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/2510186?v=4","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/akeneo/pim-community-dev","description":"[Community Development Repository] The open source Product Information Management (PIM)","fork":false,"url":"https://api.github.com/repos/akeneo/pim-community-dev","forks_url":"https://api.github.com/repos/akeneo/pim-community-dev/forks","keys_url":"https://api.github.com/repos/akeneo/pim-community-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/pim-community-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/pim-community-dev/teams","hooks_url":"https://api.github.com/repos/akeneo/pim-community-dev/hooks","issue_events_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/pim-community-dev/events","assignees_url":"https://api.github.com/repos/akeneo/pim-community-dev/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/pim-community-dev/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/tags","blobs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/pim-community-dev/languages","stargazers_url":"https://api.github.com/repos/akeneo/pim-community-dev/stargazers","contributors_url":"https://api.github.com/repos/akeneo/pim-community-dev/contributors","subscribers_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscribers","subscription_url":"https://api.github.com/repos/akeneo/pim-community-dev/subscription","commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/pim-community-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/pim-community-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/akeneo/pim-community-dev/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/pim-community-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/pim-community-dev/merges","archive_url":"https://api.github.com/repos/akeneo/pim-community-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/pim-community-dev/downloads","issues_url":"https://api.github.com/repos/akeneo/pim-community-dev/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/pim-community-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/pim-community-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/pim-community-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/pim-community-dev/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/pim-community-dev/releases{/id}","deployments_url":"https://api.github.com/repos/akeneo/pim-community-dev/deployments","created_at":"2012-08-10T09:27:26Z","updated_at":"2018-10-26T12:10:05Z","pushed_at":"2018-10-26T13:10:37Z","git_url":"git://github.com/akeneo/pim-community-dev.git","ssh_url":"git@github.com:akeneo/pim-community-dev.git","clone_url":"https://github.com/akeneo/pim-community-dev.git","svn_url":"https://github.com/akeneo/pim-community-dev","homepage":"http://www.akeneo.com","size":149797,"stargazers_count":549,"watchers_count":549,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":333,"mirror_url":null,"archived":false,"open_issues_count":287,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":333,"open_issues":287,"watchers":549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032"},"html":{"href":"https://github.com/akeneo/pim-community-dev/pull/9032"},"issue":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/9032"},"comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/issues/9032/comments"},"review_comments":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032/comments"},"review_comment":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/pulls/9032/commits"},"statuses":{"href":"https://api.github.com/repos/akeneo/pim-community-dev/statuses/e217a37cfe952fcdaa32454a0948415007774b5d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jjanvier"}}