{"action":"created","comment":{"url":"https://api.github.com/repos/hmrc/individuals-api/pulls/comments/125685099","pull_request_review_id":48098644,"id":125685099,"diff_hunk":"@@ -17,32 +17,55 @@\n package uk.gov.hmrc.individualsapi.models\n \n import org.joda.time.LocalDate\n+import uk.gov.hmrc.domain.EmpRef\n \n case class DesEmployments(employments: Seq[DesEmployment])\n \n case class DesAddress(line1: String,\n                       postalCode: String,\n-                      line2: Option[String],\n-                      line3: Option[String],\n-                      line4: Option[String],\n-                      line5: Option[String])\n+                      line2: Option[String] = None,\n+                      line3: Option[String] = None,\n+                      line4: Option[String] = None,\n+                      line5: Option[String] = None)\n \n case class DesPayment(paymentDate: LocalDate,\n                       totalPayInPeriod: Double,\n-                      totalNonTaxOrNICsPayments: Option[Double],\n-                      weekPayNumber: Option[Int],\n-                      monthPayNumber: Option[Int])\n-\n-case class DesEmployment(employerName: Option[String],\n-                         employerAddress: Option[DesAddress],\n-                         employerDistrictNumber: Option[String],\n-                         employerSchemeReference: Option[String],\n-                         employmentStartDate: Option[LocalDate],\n-                         employmentLeavingDate: Option[LocalDate],\n-                         employmentPayFrequency: Option[DesEmploymentPayFrequency.Value],\n-                         payments: Seq[DesPayment]\n-                        )\n+                      totalNonTaxOrNICsPayments: Option[Double] = None,\n+                      weekPayNumber: Option[Int] = None,\n+                      monthPayNumber: Option[Int] = None)\n+\n+case class DesEmployment(payments: Seq[DesPayment],\n+                         employerName: Option[String] = None,\n+                         employerAddress: Option[DesAddress] = None,\n+                         employerDistrictNumber: Option[String] = None,\n+                         employerSchemeReference: Option[String] = None,\n+                         employmentStartDate: Option[LocalDate] = None,\n+                         employmentLeavingDate: Option[LocalDate] = None,\n+                         employmentPayFrequency: Option[DesEmploymentPayFrequency.Value] = None\n+                        ) {\n+\n+  val employerPayeReference = {\n+    (employerDistrictNumber, employerSchemeReference) match {\n+      case (Some(districtNumber), Some(schemeReference)) => Some(EmpRef(districtNumber, schemeReference))\n+      case _ => None\n+    }\n+  }\n+}\n \n object DesEmploymentPayFrequency extends Enumeration {\n   val W1, W2, W4, IO, IR, M1, M3, M6, MA = Value\n }\n+\n+object DesEmployments {\n+  def toPayments(desEmployment: DesEmployment): Seq[Payment] = {","path":"app/uk/gov/hmrc/individualsapi/models/DesEmploymentIncome.scala","position":61,"original_position":61,"commit_id":"0c8f6b03e85a42a174db2e65454a39d581d8d698","original_commit_id":"0c8f6b03e85a42a174db2e65454a39d581d8d698","user":{"login":"edinhodzic","id":4981314,"avatar_url":"https://avatars2.githubusercontent.com/u/4981314?v=3","gravatar_id":"","url":"https://api.github.com/users/edinhodzic","html_url":"https://github.com/edinhodzic","followers_url":"https://api.github.com/users/edinhodzic/followers","following_url":"https://api.github.com/users/edinhodzic/following{/other_user}","gists_url":"https://api.github.com/users/edinhodzic/gists{/gist_id}","starred_url":"https://api.github.com/users/edinhodzic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edinhodzic/subscriptions","organizations_url":"https://api.github.com/users/edinhodzic/orgs","repos_url":"https://api.github.com/users/edinhodzic/repos","events_url":"https://api.github.com/users/edinhodzic/events{/privacy}","received_events_url":"https://api.github.com/users/edinhodzic/received_events","type":"User","site_admin":false},"body":"Ah yes, the one to many relationship would be a problem for what I suggested. In which case it looks fine to me as it is or the other thing you suggested.","created_at":"2017-07-05T15:54:51Z","updated_at":"2017-07-05T15:54:52Z","html_url":"https://github.com/hmrc/individuals-api/pull/54#discussion_r125685099","pull_request_url":"https://api.github.com/repos/hmrc/individuals-api/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/hmrc/individuals-api/pulls/comments/125685099"},"html":{"href":"https://github.com/hmrc/individuals-api/pull/54#discussion_r125685099"},"pull_request":{"href":"https://api.github.com/repos/hmrc/individuals-api/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/hmrc/individuals-api/pulls/54","id":128978544,"html_url":"https://github.com/hmrc/individuals-api/pull/54","diff_url":"https://github.com/hmrc/individuals-api/pull/54.diff","patch_url":"https://github.com/hmrc/individuals-api/pull/54.patch","issue_url":"https://api.github.com/repos/hmrc/individuals-api/issues/54","number":54,"state":"open","locked":false,"title":"OGD-140 - Income endpoint for Production","user":{"login":"tom59","id":9407349,"avatar_url":"https://avatars0.githubusercontent.com/u/9407349?v=3","gravatar_id":"","url":"https://api.github.com/users/tom59","html_url":"https://github.com/tom59","followers_url":"https://api.github.com/users/tom59/followers","following_url":"https://api.github.com/users/tom59/following{/other_user}","gists_url":"https://api.github.com/users/tom59/gists{/gist_id}","starred_url":"https://api.github.com/users/tom59/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tom59/subscriptions","organizations_url":"https://api.github.com/users/tom59/orgs","repos_url":"https://api.github.com/users/tom59/repos","events_url":"https://api.github.com/users/tom59/events{/privacy}","received_events_url":"https://api.github.com/users/tom59/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-05T14:35:51Z","updated_at":"2017-07-05T15:54:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58f26f946f2278e2255bf3abcf066befa767fc4d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmrc/individuals-api/pulls/54/commits","review_comments_url":"https://api.github.com/repos/hmrc/individuals-api/pulls/54/comments","review_comment_url":"https://api.github.com/repos/hmrc/individuals-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmrc/individuals-api/issues/54/comments","statuses_url":"https://api.github.com/repos/hmrc/individuals-api/statuses/0c8f6b03e85a42a174db2e65454a39d581d8d698","head":{"label":"hmrc:OGD-140","ref":"OGD-140","sha":"0c8f6b03e85a42a174db2e65454a39d581d8d698","user":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":90980903,"name":"individuals-api","full_name":"hmrc/individuals-api","owner":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/individuals-api","description":null,"fork":false,"url":"https://api.github.com/repos/hmrc/individuals-api","forks_url":"https://api.github.com/repos/hmrc/individuals-api/forks","keys_url":"https://api.github.com/repos/hmrc/individuals-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/individuals-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/individuals-api/teams","hooks_url":"https://api.github.com/repos/hmrc/individuals-api/hooks","issue_events_url":"https://api.github.com/repos/hmrc/individuals-api/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/individuals-api/events","assignees_url":"https://api.github.com/repos/hmrc/individuals-api/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/individuals-api/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/individuals-api/tags","blobs_url":"https://api.github.com/repos/hmrc/individuals-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/individuals-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/individuals-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/individuals-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/individuals-api/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/individuals-api/languages","stargazers_url":"https://api.github.com/repos/hmrc/individuals-api/stargazers","contributors_url":"https://api.github.com/repos/hmrc/individuals-api/contributors","subscribers_url":"https://api.github.com/repos/hmrc/individuals-api/subscribers","subscription_url":"https://api.github.com/repos/hmrc/individuals-api/subscription","commits_url":"https://api.github.com/repos/hmrc/individuals-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/individuals-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/individuals-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/individuals-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/individuals-api/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/individuals-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/individuals-api/merges","archive_url":"https://api.github.com/repos/hmrc/individuals-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/individuals-api/downloads","issues_url":"https://api.github.com/repos/hmrc/individuals-api/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/individuals-api/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/individuals-api/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/individuals-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/individuals-api/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/individuals-api/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/individuals-api/deployments","created_at":"2017-05-11T13:14:33Z","updated_at":"2017-05-11T13:14:51Z","pushed_at":"2017-07-05T14:37:19Z","git_url":"git://github.com/hmrc/individuals-api.git","ssh_url":"git@github.com:hmrc/individuals-api.git","clone_url":"https://github.com/hmrc/individuals-api.git","svn_url":"https://github.com/hmrc/individuals-api","homepage":"","size":257,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"hmrc:master","ref":"master","sha":"2ecf50a91469e26f3b54eecce3a6fda0197aa97a","user":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"repo":{"id":90980903,"name":"individuals-api","full_name":"hmrc/individuals-api","owner":{"login":"hmrc","id":5755339,"avatar_url":"https://avatars2.githubusercontent.com/u/5755339?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrc","html_url":"https://github.com/hmrc","followers_url":"https://api.github.com/users/hmrc/followers","following_url":"https://api.github.com/users/hmrc/following{/other_user}","gists_url":"https://api.github.com/users/hmrc/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrc/subscriptions","organizations_url":"https://api.github.com/users/hmrc/orgs","repos_url":"https://api.github.com/users/hmrc/repos","events_url":"https://api.github.com/users/hmrc/events{/privacy}","received_events_url":"https://api.github.com/users/hmrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmrc/individuals-api","description":null,"fork":false,"url":"https://api.github.com/repos/hmrc/individuals-api","forks_url":"https://api.github.com/repos/hmrc/individuals-api/forks","keys_url":"https://api.github.com/repos/hmrc/individuals-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrc/individuals-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrc/individuals-api/teams","hooks_url":"https://api.github.com/repos/hmrc/individuals-api/hooks","issue_events_url":"https://api.github.com/repos/hmrc/individuals-api/issues/events{/number}","events_url":"https://api.github.com/repos/hmrc/individuals-api/events","assignees_url":"https://api.github.com/repos/hmrc/individuals-api/assignees{/user}","branches_url":"https://api.github.com/repos/hmrc/individuals-api/branches{/branch}","tags_url":"https://api.github.com/repos/hmrc/individuals-api/tags","blobs_url":"https://api.github.com/repos/hmrc/individuals-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrc/individuals-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrc/individuals-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrc/individuals-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrc/individuals-api/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrc/individuals-api/languages","stargazers_url":"https://api.github.com/repos/hmrc/individuals-api/stargazers","contributors_url":"https://api.github.com/repos/hmrc/individuals-api/contributors","subscribers_url":"https://api.github.com/repos/hmrc/individuals-api/subscribers","subscription_url":"https://api.github.com/repos/hmrc/individuals-api/subscription","commits_url":"https://api.github.com/repos/hmrc/individuals-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrc/individuals-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrc/individuals-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrc/individuals-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrc/individuals-api/contents/{+path}","compare_url":"https://api.github.com/repos/hmrc/individuals-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrc/individuals-api/merges","archive_url":"https://api.github.com/repos/hmrc/individuals-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrc/individuals-api/downloads","issues_url":"https://api.github.com/repos/hmrc/individuals-api/issues{/number}","pulls_url":"https://api.github.com/repos/hmrc/individuals-api/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrc/individuals-api/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrc/individuals-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrc/individuals-api/labels{/name}","releases_url":"https://api.github.com/repos/hmrc/individuals-api/releases{/id}","deployments_url":"https://api.github.com/repos/hmrc/individuals-api/deployments","created_at":"2017-05-11T13:14:33Z","updated_at":"2017-05-11T13:14:51Z","pushed_at":"2017-07-05T14:37:19Z","git_url":"git://github.com/hmrc/individuals-api.git","ssh_url":"git@github.com:hmrc/individuals-api.git","clone_url":"https://github.com/hmrc/individuals-api.git","svn_url":"https://github.com/hmrc/individuals-api","homepage":"","size":257,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmrc/individuals-api/pulls/54"},"html":{"href":"https://github.com/hmrc/individuals-api/pull/54"},"issue":{"href":"https://api.github.com/repos/hmrc/individuals-api/issues/54"},"comments":{"href":"https://api.github.com/repos/hmrc/individuals-api/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/hmrc/individuals-api/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/hmrc/individuals-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmrc/individuals-api/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/hmrc/individuals-api/statuses/0c8f6b03e85a42a174db2e65454a39d581d8d698"}}}}
{"actor":{"display_login":"edinhodzic"}}