{"action":"created","comment":{"url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/comments/33308862","id":33308862,"diff_hunk":"@@ -0,0 +1,64 @@\n+//\n+//  GRSShoppingCart.h\n+//  Grocery Store Client\n+//\n+//  Created by Caleb Lee on 2015/06/24.\n+//  Copyright (c) 2015年 Vokal. All rights reserved.\n+//\n+\n+#import <Foundation/Foundation.h>\n+#import \"Product.h\"\n+\n+typedef void(^GRSShoppingCartPurchaseCompletion)(NSArray *products, NSError *error);\n+\n+/**\n+ *  GRSShoppingCart keeps track of products waiting to be purchased and purchases them\n+ *  upon user command.\n+ */\n+@interface GRSShoppingCart : NSObject\n+\n+/**\n+ *  GRSShoppingCart is a singleton. This returns the singleton instance.\n+ *\n+ *  @return the shared shopping cart\n+ */\n++ (instancetype)sharedInstance;\n+\n+/**\n+ *  A dictionary of all the products in the shopping cart. Keys are product names; \n+ *  values are the desired quantity in NSNumber format.\n+ */\n+@property (strong, readonly, nonatomic) NSMutableDictionary *productsInCart;\n+\n+/**\n+ *  Adds a product and the desired purchased quantity to the shopping cart. If the product\n+ *  is already in the cart, the quantity will simply get updated.\n+ *\n+ *  @param product  the product to purchase\n+ *  @param quantity the quantity to purchase\n+ */\n+- (void)addProductToCart:(Product *)product quantity:(NSInteger)quantity;","path":"Grocery Store Client/Controls/GRSShoppingCart.h","position":47,"original_position":40,"commit_id":"18d1c6c8d97a01ce726ab1a67229a9b0d760ecf6","original_commit_id":"5784578380e131666923a2bfb61a505a4e944612","user":{"login":"vokal-isaac","id":7505072,"avatar_url":"https://avatars.githubusercontent.com/u/7505072?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal-isaac","html_url":"https://github.com/vokal-isaac","followers_url":"https://api.github.com/users/vokal-isaac/followers","following_url":"https://api.github.com/users/vokal-isaac/following{/other_user}","gists_url":"https://api.github.com/users/vokal-isaac/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal-isaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal-isaac/subscriptions","organizations_url":"https://api.github.com/users/vokal-isaac/orgs","repos_url":"https://api.github.com/users/vokal-isaac/repos","events_url":"https://api.github.com/users/vokal-isaac/events{/privacy}","received_events_url":"https://api.github.com/users/vokal-isaac/received_events","type":"User","site_admin":false},"body":"Ahh, you had Xcode autogenerate them.  Yeah, then it may be harder and certainly isn't worth messing with for this project.  I *think* you can have the class name and entity name be different (both are defined in the model file), so I have typically had the class name prefixed and no prefix on the entity name, though I think most people at Vokal put the prefix in both places so that the entity name is the same as the class name (which can be useful).  If one uses mogenerator, it definitely works correctly off of those class names being prefixed.  When one uses Xcode to generate the code, it's a bit harder (maybe impossible) to safely regenerate the generated class files without losing any customizations.","created_at":"2015-06-25T21:47:18Z","updated_at":"2015-06-25T21:47:18Z","html_url":"https://github.com/caleb-lee/grocery-store-client/pull/2#discussion_r33308862","pull_request_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/comments/33308862"},"html":{"href":"https://github.com/caleb-lee/grocery-store-client/pull/2#discussion_r33308862"},"pull_request":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2","id":38488058,"html_url":"https://github.com/caleb-lee/grocery-store-client/pull/2","diff_url":"https://github.com/caleb-lee/grocery-store-client/pull/2.diff","patch_url":"https://github.com/caleb-lee/grocery-store-client/pull/2.patch","issue_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/2","number":2,"state":"open","locked":false,"title":"Refine UI / Shopping Cart","user":{"login":"caleb-lee","id":11948335,"avatar_url":"https://avatars.githubusercontent.com/u/11948335?v=3","gravatar_id":"","url":"https://api.github.com/users/caleb-lee","html_url":"https://github.com/caleb-lee","followers_url":"https://api.github.com/users/caleb-lee/followers","following_url":"https://api.github.com/users/caleb-lee/following{/other_user}","gists_url":"https://api.github.com/users/caleb-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/caleb-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleb-lee/subscriptions","organizations_url":"https://api.github.com/users/caleb-lee/orgs","repos_url":"https://api.github.com/users/caleb-lee/repos","events_url":"https://api.github.com/users/caleb-lee/events{/privacy}","received_events_url":"https://api.github.com/users/caleb-lee/received_events","type":"User","site_admin":false},"body":"The interface now includes ways to use every API available from the server (larger quantities than one, purchasing multiple products at once, deleting stock, etc.). It also utilizes autolayout and will scale to various phone screens.","created_at":"2015-06-24T21:11:04Z","updated_at":"2015-06-25T21:47:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a29ffe27f03b26a7af46ce7e14d85123383faa3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2/commits","review_comments_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2/comments","review_comment_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/2/comments","statuses_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/statuses/18d1c6c8d97a01ce726ab1a67229a9b0d760ecf6","head":{"label":"caleb-lee:refine-ui","ref":"refine-ui","sha":"18d1c6c8d97a01ce726ab1a67229a9b0d760ecf6","user":{"login":"caleb-lee","id":11948335,"avatar_url":"https://avatars.githubusercontent.com/u/11948335?v=3","gravatar_id":"","url":"https://api.github.com/users/caleb-lee","html_url":"https://github.com/caleb-lee","followers_url":"https://api.github.com/users/caleb-lee/followers","following_url":"https://api.github.com/users/caleb-lee/following{/other_user}","gists_url":"https://api.github.com/users/caleb-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/caleb-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleb-lee/subscriptions","organizations_url":"https://api.github.com/users/caleb-lee/orgs","repos_url":"https://api.github.com/users/caleb-lee/repos","events_url":"https://api.github.com/users/caleb-lee/events{/privacy}","received_events_url":"https://api.github.com/users/caleb-lee/received_events","type":"User","site_admin":false},"repo":{"id":37933030,"name":"grocery-store-client","full_name":"caleb-lee/grocery-store-client","owner":{"login":"caleb-lee","id":11948335,"avatar_url":"https://avatars.githubusercontent.com/u/11948335?v=3","gravatar_id":"","url":"https://api.github.com/users/caleb-lee","html_url":"https://github.com/caleb-lee","followers_url":"https://api.github.com/users/caleb-lee/followers","following_url":"https://api.github.com/users/caleb-lee/following{/other_user}","gists_url":"https://api.github.com/users/caleb-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/caleb-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleb-lee/subscriptions","organizations_url":"https://api.github.com/users/caleb-lee/orgs","repos_url":"https://api.github.com/users/caleb-lee/repos","events_url":"https://api.github.com/users/caleb-lee/events{/privacy}","received_events_url":"https://api.github.com/users/caleb-lee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caleb-lee/grocery-store-client","description":"","fork":false,"url":"https://api.github.com/repos/caleb-lee/grocery-store-client","forks_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/forks","keys_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/teams","hooks_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/hooks","issue_events_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/events{/number}","events_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/events","assignees_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/assignees{/user}","branches_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/branches{/branch}","tags_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/tags","blobs_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/statuses/{sha}","languages_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/languages","stargazers_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/stargazers","contributors_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/contributors","subscribers_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/subscribers","subscription_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/subscription","commits_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/contents/{+path}","compare_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/merges","archive_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/downloads","issues_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues{/number}","pulls_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls{/number}","milestones_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/milestones{/number}","notifications_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/labels{/name}","releases_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/releases{/id}","created_at":"2015-06-23T17:13:33Z","updated_at":"2015-06-23T17:14:05Z","pushed_at":"2015-06-25T18:22:44Z","git_url":"git://github.com/caleb-lee/grocery-store-client.git","ssh_url":"git@github.com:caleb-lee/grocery-store-client.git","clone_url":"https://github.com/caleb-lee/grocery-store-client.git","svn_url":"https://github.com/caleb-lee/grocery-store-client","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"caleb-lee:master","ref":"master","sha":"63a424ff4db6d19bbcc4a9163b6ab44e23a7478c","user":{"login":"caleb-lee","id":11948335,"avatar_url":"https://avatars.githubusercontent.com/u/11948335?v=3","gravatar_id":"","url":"https://api.github.com/users/caleb-lee","html_url":"https://github.com/caleb-lee","followers_url":"https://api.github.com/users/caleb-lee/followers","following_url":"https://api.github.com/users/caleb-lee/following{/other_user}","gists_url":"https://api.github.com/users/caleb-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/caleb-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleb-lee/subscriptions","organizations_url":"https://api.github.com/users/caleb-lee/orgs","repos_url":"https://api.github.com/users/caleb-lee/repos","events_url":"https://api.github.com/users/caleb-lee/events{/privacy}","received_events_url":"https://api.github.com/users/caleb-lee/received_events","type":"User","site_admin":false},"repo":{"id":37933030,"name":"grocery-store-client","full_name":"caleb-lee/grocery-store-client","owner":{"login":"caleb-lee","id":11948335,"avatar_url":"https://avatars.githubusercontent.com/u/11948335?v=3","gravatar_id":"","url":"https://api.github.com/users/caleb-lee","html_url":"https://github.com/caleb-lee","followers_url":"https://api.github.com/users/caleb-lee/followers","following_url":"https://api.github.com/users/caleb-lee/following{/other_user}","gists_url":"https://api.github.com/users/caleb-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/caleb-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caleb-lee/subscriptions","organizations_url":"https://api.github.com/users/caleb-lee/orgs","repos_url":"https://api.github.com/users/caleb-lee/repos","events_url":"https://api.github.com/users/caleb-lee/events{/privacy}","received_events_url":"https://api.github.com/users/caleb-lee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caleb-lee/grocery-store-client","description":"","fork":false,"url":"https://api.github.com/repos/caleb-lee/grocery-store-client","forks_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/forks","keys_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/teams","hooks_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/hooks","issue_events_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/events{/number}","events_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/events","assignees_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/assignees{/user}","branches_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/branches{/branch}","tags_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/tags","blobs_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/statuses/{sha}","languages_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/languages","stargazers_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/stargazers","contributors_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/contributors","subscribers_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/subscribers","subscription_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/subscription","commits_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/contents/{+path}","compare_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/merges","archive_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/downloads","issues_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues{/number}","pulls_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls{/number}","milestones_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/milestones{/number}","notifications_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/labels{/name}","releases_url":"https://api.github.com/repos/caleb-lee/grocery-store-client/releases{/id}","created_at":"2015-06-23T17:13:33Z","updated_at":"2015-06-23T17:14:05Z","pushed_at":"2015-06-25T18:22:44Z","git_url":"git://github.com/caleb-lee/grocery-store-client.git","ssh_url":"git@github.com:caleb-lee/grocery-store-client.git","clone_url":"https://github.com/caleb-lee/grocery-store-client.git","svn_url":"https://github.com/caleb-lee/grocery-store-client","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2"},"html":{"href":"https://github.com/caleb-lee/grocery-store-client/pull/2"},"issue":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/2"},"comments":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/caleb-lee/grocery-store-client/statuses/18d1c6c8d97a01ce726ab1a67229a9b0d760ecf6"}}}}