{"action":"created","comment":{"url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/comments/68581638","id":68581638,"diff_hunk":"@@ -0,0 +1,126 @@\n+//\n+// Copyright (c) 2016 Commercetools. All rights reserved.\n+//\n+\n+import ReactiveCocoa\n+import Result\n+import ObjectMapper\n+import Commercetools\n+\n+class OrdersViewModel: BaseViewModel {\n+\n+    // Inputs\n+    let refreshObserver: Observer<Void, NoError>\n+    let sectionExpandedObserver: Observer<Int, NoError>\n+\n+    // Outputs\n+    let isLoading: MutableProperty<Bool>\n+    let contentChangesSignal: Signal<Changeset, NoError>\n+    let ordersExpanded = MutableProperty(false)\n+    let reservationsExpanded = MutableProperty(false)\n+\n+    var orders = [Order]()\n+    var reservations = [Order]()\n+\n+    private let contentChangesObserver: Observer<Changeset, NoError>\n+\n+    // MARK: - Lifecycle\n+\n+    override init() {\n+        isLoading = MutableProperty(true)\n+\n+        let (refreshSignal, observer) = Signal<Void, NoError>.pipe()\n+        refreshObserver = observer\n+\n+        let (sectionExpandedSignal, expandedObserver) = Signal<Int, NoError>.pipe()\n+        sectionExpandedObserver = expandedObserver\n+\n+        let (signal, changesObserver) = Signal<Changeset, NoError>.pipe()\n+        contentChangesSignal = signal\n+        contentChangesObserver = changesObserver\n+\n+        super.init()\n+\n+        refreshSignal\n+        .observeNext { [weak self] in","path":"Sunrise/ViewModels/OrdersViewModel.swift","position":45,"original_position":45,"commit_id":"4c2ef7537c10440efed242d41aae7a3e028539f6","original_commit_id":"4c2ef7537c10440efed242d41aae7a3e028539f6","user":{"login":"cneijenhuis","id":2638512,"avatar_url":"https://avatars.githubusercontent.com/u/2638512?v=3","gravatar_id":"","url":"https://api.github.com/users/cneijenhuis","html_url":"https://github.com/cneijenhuis","followers_url":"https://api.github.com/users/cneijenhuis/followers","following_url":"https://api.github.com/users/cneijenhuis/following{/other_user}","gists_url":"https://api.github.com/users/cneijenhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/cneijenhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cneijenhuis/subscriptions","organizations_url":"https://api.github.com/users/cneijenhuis/orgs","repos_url":"https://api.github.com/users/cneijenhuis/repos","events_url":"https://api.github.com/users/cneijenhuis/events{/privacy}","received_events_url":"https://api.github.com/users/cneijenhuis/received_events","type":"User","site_admin":false},"body":"When is that signal being sent? I tried to refresh the view by pressing the `My Account` tab bar item, but that didn't seem to trigger it?","created_at":"2016-06-27T14:05:23Z","updated_at":"2016-06-27T14:05:23Z","html_url":"https://github.com/commercetools/commercetools-sunrise-ios/pull/34#discussion_r68581638","pull_request_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34","_links":{"self":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/comments/68581638"},"html":{"href":"https://github.com/commercetools/commercetools-sunrise-ios/pull/34#discussion_r68581638"},"pull_request":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34","id":75301275,"html_url":"https://github.com/commercetools/commercetools-sunrise-ios/pull/34","diff_url":"https://github.com/commercetools/commercetools-sunrise-ios/pull/34.diff","patch_url":"https://github.com/commercetools/commercetools-sunrise-ios/pull/34.patch","issue_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/34","number":34,"state":"open","locked":false,"title":"Closes #13 , closes #25 My orders and reservations","user":{"login":"nikola-mladenovic","id":14024032,"avatar_url":"https://avatars.githubusercontent.com/u/14024032?v=3","gravatar_id":"","url":"https://api.github.com/users/nikola-mladenovic","html_url":"https://github.com/nikola-mladenovic","followers_url":"https://api.github.com/users/nikola-mladenovic/followers","following_url":"https://api.github.com/users/nikola-mladenovic/following{/other_user}","gists_url":"https://api.github.com/users/nikola-mladenovic/gists{/gist_id}","starred_url":"https://api.github.com/users/nikola-mladenovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikola-mladenovic/subscriptions","organizations_url":"https://api.github.com/users/nikola-mladenovic/orgs","repos_url":"https://api.github.com/users/nikola-mladenovic/repos","events_url":"https://api.github.com/users/nikola-mladenovic/events{/privacy}","received_events_url":"https://api.github.com/users/nikola-mladenovic/received_events","type":"User","site_admin":false},"body":"For my orders and reservations, I assumed that at some point we will have more differences between cart overview and order or reservation summary. The implementation is done in a way that these two are separated, but still we're reusing the common logic used for specific discount and prices calculation, which has been moved over to `BaseViewModel`.","created_at":"2016-06-27T12:18:38Z","updated_at":"2016-06-27T14:05:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36e82257cc906ab60b35d8cb1260f2d6054cabe3","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},"assignees":[{"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},{"login":"cneijenhuis","id":2638512,"avatar_url":"https://avatars.githubusercontent.com/u/2638512?v=3","gravatar_id":"","url":"https://api.github.com/users/cneijenhuis","html_url":"https://github.com/cneijenhuis","followers_url":"https://api.github.com/users/cneijenhuis/followers","following_url":"https://api.github.com/users/cneijenhuis/following{/other_user}","gists_url":"https://api.github.com/users/cneijenhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/cneijenhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cneijenhuis/subscriptions","organizations_url":"https://api.github.com/users/cneijenhuis/orgs","repos_url":"https://api.github.com/users/cneijenhuis/repos","events_url":"https://api.github.com/users/cneijenhuis/events{/privacy}","received_events_url":"https://api.github.com/users/cneijenhuis/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34/commits","review_comments_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34/comments","review_comment_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/34/comments","statuses_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/statuses/4c2ef7537c10440efed242d41aae7a3e028539f6","head":{"label":"commercetools:issue/#13-my-account","ref":"issue/#13-my-account","sha":"4c2ef7537c10440efed242d41aae7a3e028539f6","user":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars.githubusercontent.com/u/1084585?v=3","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":58478045,"name":"commercetools-sunrise-ios","full_name":"commercetools/commercetools-sunrise-ios","owner":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars.githubusercontent.com/u/1084585?v=3","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercetools/commercetools-sunrise-ios","description":"","fork":false,"url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios","forks_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/forks","keys_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/teams","hooks_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/hooks","issue_events_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/events","assignees_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/tags","blobs_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/languages","stargazers_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/stargazers","contributors_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/contributors","subscribers_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/subscribers","subscription_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/subscription","commits_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/merges","archive_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/downloads","issues_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/deployments","created_at":"2016-05-10T16:46:38Z","updated_at":"2016-05-20T09:25:18Z","pushed_at":"2016-06-27T12:18:38Z","git_url":"git://github.com/commercetools/commercetools-sunrise-ios.git","ssh_url":"git@github.com:commercetools/commercetools-sunrise-ios.git","clone_url":"https://github.com/commercetools/commercetools-sunrise-ios.git","svn_url":"https://github.com/commercetools/commercetools-sunrise-ios","homepage":null,"size":199,"stargazers_count":4,"watchers_count":4,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":4,"default_branch":"master"}},"base":{"label":"commercetools:master","ref":"master","sha":"a0fdcb94cb50f5a1c18d4f3f1c46cad5d4a579db","user":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars.githubusercontent.com/u/1084585?v=3","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"repo":{"id":58478045,"name":"commercetools-sunrise-ios","full_name":"commercetools/commercetools-sunrise-ios","owner":{"login":"commercetools","id":1084585,"avatar_url":"https://avatars.githubusercontent.com/u/1084585?v=3","gravatar_id":"","url":"https://api.github.com/users/commercetools","html_url":"https://github.com/commercetools","followers_url":"https://api.github.com/users/commercetools/followers","following_url":"https://api.github.com/users/commercetools/following{/other_user}","gists_url":"https://api.github.com/users/commercetools/gists{/gist_id}","starred_url":"https://api.github.com/users/commercetools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercetools/subscriptions","organizations_url":"https://api.github.com/users/commercetools/orgs","repos_url":"https://api.github.com/users/commercetools/repos","events_url":"https://api.github.com/users/commercetools/events{/privacy}","received_events_url":"https://api.github.com/users/commercetools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercetools/commercetools-sunrise-ios","description":"","fork":false,"url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios","forks_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/forks","keys_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/teams","hooks_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/hooks","issue_events_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/events{/number}","events_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/events","assignees_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/assignees{/user}","branches_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/branches{/branch}","tags_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/tags","blobs_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/languages","stargazers_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/stargazers","contributors_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/contributors","subscribers_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/subscribers","subscription_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/subscription","commits_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/contents/{+path}","compare_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/merges","archive_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/downloads","issues_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues{/number}","pulls_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/labels{/name}","releases_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/releases{/id}","deployments_url":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/deployments","created_at":"2016-05-10T16:46:38Z","updated_at":"2016-05-20T09:25:18Z","pushed_at":"2016-06-27T12:18:38Z","git_url":"git://github.com/commercetools/commercetools-sunrise-ios.git","ssh_url":"git@github.com:commercetools/commercetools-sunrise-ios.git","clone_url":"https://github.com/commercetools/commercetools-sunrise-ios.git","svn_url":"https://github.com/commercetools/commercetools-sunrise-ios","homepage":null,"size":199,"stargazers_count":4,"watchers_count":4,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":8,"forks":0,"open_issues":8,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34"},"html":{"href":"https://github.com/commercetools/commercetools-sunrise-ios/pull/34"},"issue":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/34"},"comments":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/commercetools/commercetools-sunrise-ios/statuses/4c2ef7537c10440efed242d41aae7a3e028539f6"}}}}
{"actor":{"display_login":"cneijenhuis"}}