{"action":"created","comment":{"url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/comments/38863076","id":38863076,"diff_hunk":"@@ -1,15 +1,55 @@\n package cart;\n \n+import common.contexts.UserContext;\n+import common.utils.PriceFormatter;\n+import io.sphere.sdk.carts.Cart;\n import io.sphere.sdk.models.Base;\n+import io.sphere.sdk.utils.MoneyImpl;\n \n import java.util.List;\n+import java.util.Optional;\n+\n+import static java.util.stream.Collectors.toList;\n \n public class CartItems extends Base {\n     private List<CartItem> list;\n+    private String subtotal;\n+    private String orderDiscount;\n+    private String delivery;\n+    private String tax;\n+    private String orderTotal;\n \n     public CartItems() {\n     }\n \n+    public static CartItems of(final Cart cart, final UserContext userContext) {\n+        final CartItems cartItems = new CartItems();\n+        final List<CartItem> cartItemList = cart.getLineItems()\n+                .stream()\n+                .map(lineItem -> CartItem.of(lineItem, userContext))\n+                .collect(toList());\n+        cartItems.setList(cartItemList);\n+        final PriceFormatter priceFormatter = PriceFormatter.of(userContext.locale());\n+        final String subtotal = priceFormatter.format(cart.getTotalPrice());","path":"app/cart/CartItems.java","position":33,"original_position":33,"commit_id":"97ee19a247bd5fee46850efd2a1a24f3da8d8844","original_commit_id":"97ee19a247bd5fee46850efd2a1a24f3da8d8844","user":{"login":"lauraluiz","id":1917621,"avatar_url":"https://avatars.githubusercontent.com/u/1917621?v=3","gravatar_id":"","url":"https://api.github.com/users/lauraluiz","html_url":"https://github.com/lauraluiz","followers_url":"https://api.github.com/users/lauraluiz/followers","following_url":"https://api.github.com/users/lauraluiz/following{/other_user}","gists_url":"https://api.github.com/users/lauraluiz/gists{/gist_id}","starred_url":"https://api.github.com/users/lauraluiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauraluiz/subscriptions","organizations_url":"https://api.github.com/users/lauraluiz/orgs","repos_url":"https://api.github.com/users/lauraluiz/repos","events_url":"https://api.github.com/users/lauraluiz/events{/privacy}","received_events_url":"https://api.github.com/users/lauraluiz/received_events","type":"User","site_admin":false},"body":"subtotal = sum(all line items)\r\nWithout cart discounts and shipping costs","created_at":"2015-09-07T13:45:37Z","updated_at":"2015-09-07T13:45:37Z","html_url":"https://github.com/sphereio/sphere-sunrise-dmexco/pull/37#discussion_r38863076","pull_request_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/comments/38863076"},"html":{"href":"https://github.com/sphereio/sphere-sunrise-dmexco/pull/37#discussion_r38863076"},"pull_request":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37","id":44352421,"html_url":"https://github.com/sphereio/sphere-sunrise-dmexco/pull/37","diff_url":"https://github.com/sphereio/sphere-sunrise-dmexco/pull/37.diff","patch_url":"https://github.com/sphereio/sphere-sunrise-dmexco/pull/37.patch","issue_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/37","number":37,"state":"open","locked":false,"title":"Feature/10/cart page summary, connected to #10","user":{"login":"schleichardt","id":1320833,"avatar_url":"https://avatars.githubusercontent.com/u/1320833?v=3","gravatar_id":"","url":"https://api.github.com/users/schleichardt","html_url":"https://github.com/schleichardt","followers_url":"https://api.github.com/users/schleichardt/followers","following_url":"https://api.github.com/users/schleichardt/following{/other_user}","gists_url":"https://api.github.com/users/schleichardt/gists{/gist_id}","starred_url":"https://api.github.com/users/schleichardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schleichardt/subscriptions","organizations_url":"https://api.github.com/users/schleichardt/orgs","repos_url":"https://api.github.com/users/schleichardt/repos","events_url":"https://api.github.com/users/schleichardt/events{/privacy}","received_events_url":"https://api.github.com/users/schleichardt/received_events","type":"User","site_admin":false},"body":"@lauraluiz please review\r\n\r\npreview app:\r\n\r\n1. go to http://sphere-sunrise-dmexco-10.herokuapp.com/en/michael-kors-shopper-jetsettravel-30S3GTVT6L-red-A0E200000001YM5.html\r\n1. optional: select a quantity\r\n1. click on \"ADD TO BAG\"\r\n1. go to http://sphere-sunrise-dmexco-10.herokuapp.com/en/cart\r\n1. if you want to delete the item from the cart, use chrome/resources and delete the Play cookie","created_at":"2015-09-07T12:55:01Z","updated_at":"2015-09-07T13:45:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"lauraluiz","id":1917621,"avatar_url":"https://avatars.githubusercontent.com/u/1917621?v=3","gravatar_id":"","url":"https://api.github.com/users/lauraluiz","html_url":"https://github.com/lauraluiz","followers_url":"https://api.github.com/users/lauraluiz/followers","following_url":"https://api.github.com/users/lauraluiz/following{/other_user}","gists_url":"https://api.github.com/users/lauraluiz/gists{/gist_id}","starred_url":"https://api.github.com/users/lauraluiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauraluiz/subscriptions","organizations_url":"https://api.github.com/users/lauraluiz/orgs","repos_url":"https://api.github.com/users/lauraluiz/repos","events_url":"https://api.github.com/users/lauraluiz/events{/privacy}","received_events_url":"https://api.github.com/users/lauraluiz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37/commits","review_comments_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37/comments","review_comment_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/37/comments","statuses_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/statuses/97ee19a247bd5fee46850efd2a1a24f3da8d8844","head":{"label":"sphereio:feature/10/cart-page-summary","ref":"feature/10/cart-page-summary","sha":"97ee19a247bd5fee46850efd2a1a24f3da8d8844","user":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":41804394,"name":"sphere-sunrise-dmexco","full_name":"sphereio/sphere-sunrise-dmexco","owner":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/sphere-sunrise-dmexco","description":"","fork":false,"url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco","forks_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/forks","keys_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/teams","hooks_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/hooks","issue_events_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/events","assignees_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/tags","blobs_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/languages","stargazers_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/stargazers","contributors_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/contributors","subscribers_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/subscribers","subscription_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/subscription","commits_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/merges","archive_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/downloads","issues_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/releases{/id}","created_at":"2015-09-02T14:02:09Z","updated_at":"2015-09-02T14:11:01Z","pushed_at":"2015-09-07T13:38:00Z","git_url":"git://github.com/sphereio/sphere-sunrise-dmexco.git","ssh_url":"git@github.com:sphereio/sphere-sunrise-dmexco.git","clone_url":"https://github.com/sphereio/sphere-sunrise-dmexco.git","svn_url":"https://github.com/sphereio/sphere-sunrise-dmexco","homepage":null,"size":6000,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":0,"default_branch":"master"}},"base":{"label":"sphereio:master","ref":"master","sha":"5a58e9d52fc033703ba1f8920990c2d98bc64d0d","user":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":41804394,"name":"sphere-sunrise-dmexco","full_name":"sphereio/sphere-sunrise-dmexco","owner":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/sphere-sunrise-dmexco","description":"","fork":false,"url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco","forks_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/forks","keys_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/teams","hooks_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/hooks","issue_events_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/events","assignees_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/tags","blobs_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/languages","stargazers_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/stargazers","contributors_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/contributors","subscribers_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/subscribers","subscription_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/subscription","commits_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/merges","archive_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/downloads","issues_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/releases{/id}","created_at":"2015-09-02T14:02:09Z","updated_at":"2015-09-02T14:11:01Z","pushed_at":"2015-09-07T13:38:00Z","git_url":"git://github.com/sphereio/sphere-sunrise-dmexco.git","ssh_url":"git@github.com:sphereio/sphere-sunrise-dmexco.git","clone_url":"https://github.com/sphereio/sphere-sunrise-dmexco.git","svn_url":"https://github.com/sphereio/sphere-sunrise-dmexco","homepage":null,"size":6000,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":21,"forks":0,"open_issues":21,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37"},"html":{"href":"https://github.com/sphereio/sphere-sunrise-dmexco/pull/37"},"issue":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/37"},"comments":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/sphereio/sphere-sunrise-dmexco/statuses/97ee19a247bd5fee46850efd2a1a24f3da8d8844"}}}}