{"action":"created","comment":{"url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/comments/184886901","pull_request_review_id":116170306,"id":184886901,"diff_hunk":"@@ -0,0 +1,68 @@\n+package converters\n+\n+import javax.inject.Singleton\n+\n+import converters.messages.Json.{Address, Buyer, Seller, TaxInvoice}\n+import models.CommercialTransaction\n+import models.TradeAgreement.{Dealer, TradeAgreement}\n+import play.api.libs.json.JsValue\n+import utilities.Json\n+\n+@Singleton\n+class TaxInvoiceConverter {\n+  def convertTradeAgreementToJson(tradeAgreement: TradeAgreement): JsValue = {\n+    val buyerAddress = convertAddressToJsonAddress(tradeAgreement.buyer.address)\n+    val sellerAddress = convertAddressToJsonAddress(tradeAgreement.seller.address)\n+    val buyer = convertBuyerToJsonBuyer(tradeAgreement.buyer, buyerAddress)\n+    val seller = convertSellerToJsonSeller(tradeAgreement.seller, sellerAddress)\n+    val taxInvoice = TaxInvoice(seller, buyer)\n+\n+    Json.toJson(taxInvoice)\n+  }\n+\n+  private def convertAddressToJsonAddress(tradeAgreementAddress: CommercialTransaction.Address): Address = {\n+    val address = Address(\n+      tradeAgreementAddress.buildingName+\" \"\n+        +tradeAgreementAddress.buildingNumber,\n+      tradeAgreementAddress.streetName+\" \"\n+        +tradeAgreementAddress.subDistrictCode+\" \"\n+        +tradeAgreementAddress.districtCode+\" \"\n+        +tradeAgreementAddress.countrySubDivisionCode+\" \"\n+        +tradeAgreementAddress.postalCode,\n+      tradeAgreementAddress.districtCode,\n+      tradeAgreementAddress.subDistrictCode,\n+      tradeAgreementAddress.postalCode,\n+      tradeAgreementAddress.countrySubDivisionCode,\n+      tradeAgreementAddress.countryCode)\n+\n+    address\n+  }\n+\n+  private def convertBuyerToJsonBuyer(dealer: Dealer, buyerAddress: Address): Buyer = {\n+    val buyer = Buyer(\n+      dealer.taxPayerId,\n+      \"\",\n+      \"\",\n+      dealer.name,\n+      dealer.email,\n+      \"\",\n+      \"\",\n+      buyerAddress)\n+\n+    buyer\n+  }\n+\n+  private def convertSellerToJsonSeller(dealer: Dealer, sellerAddress: Address): Seller = {","path":"app/converters/TaxInvoiceConverter.scala","position":null,"original_position":55,"commit_id":"8c927b197e4d01d8a968c0a5ef84211441abd16f","original_commit_id":"3815113a537601f343714b53b5fc69858c9ec6ff","user":{"login":"pikepeak","id":15785832,"avatar_url":"https://avatars1.githubusercontent.com/u/15785832?v=4","gravatar_id":"","url":"https://api.github.com/users/pikepeak","html_url":"https://github.com/pikepeak","followers_url":"https://api.github.com/users/pikepeak/followers","following_url":"https://api.github.com/users/pikepeak/following{/other_user}","gists_url":"https://api.github.com/users/pikepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/pikepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikepeak/subscriptions","organizations_url":"https://api.github.com/users/pikepeak/orgs","repos_url":"https://api.github.com/users/pikepeak/repos","events_url":"https://api.github.com/users/pikepeak/events{/privacy}","received_events_url":"https://api.github.com/users/pikepeak/received_events","type":"User","site_admin":false},"body":"อันนี้เเก้ตามที่ได้เเนะนำมาเรียบร้อยเเล้วครับ","created_at":"2018-04-29T15:35:14Z","updated_at":"2018-04-29T15:35:14Z","html_url":"https://github.com/it-kmitl-2018/group6-backend/pull/29#discussion_r184886901","pull_request_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/comments/184886901"},"html":{"href":"https://github.com/it-kmitl-2018/group6-backend/pull/29#discussion_r184886901"},"pull_request":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29"}},"in_reply_to_id":184884300},"pull_request":{"url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29","id":184827482,"html_url":"https://github.com/it-kmitl-2018/group6-backend/pull/29","diff_url":"https://github.com/it-kmitl-2018/group6-backend/pull/29.diff","patch_url":"https://github.com/it-kmitl-2018/group6-backend/pull/29.patch","issue_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/29","number":29,"state":"open","locked":false,"title":"Tax invoice converter","user":{"login":"pikepeak","id":15785832,"avatar_url":"https://avatars1.githubusercontent.com/u/15785832?v=4","gravatar_id":"","url":"https://api.github.com/users/pikepeak","html_url":"https://github.com/pikepeak","followers_url":"https://api.github.com/users/pikepeak/followers","following_url":"https://api.github.com/users/pikepeak/following{/other_user}","gists_url":"https://api.github.com/users/pikepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/pikepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikepeak/subscriptions","organizations_url":"https://api.github.com/users/pikepeak/orgs","repos_url":"https://api.github.com/users/pikepeak/repos","events_url":"https://api.github.com/users/pikepeak/events{/privacy}","received_events_url":"https://api.github.com/users/pikepeak/received_events","type":"User","site_admin":false},"body":"มีการเเก้ชื่อ models ไปเป็น messages ใน package converters\r\nเเละ ข้อมูลที่ส่งเข้ามาในconverterยังมาไม่ครบจึงทำการให้ข้อมูลที่ไม่มี เป็น \"\"  ","created_at":"2018-04-29T10:13:06Z","updated_at":"2018-04-29T15:35:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"148ba3f11e4ec6910a131f4d642ef7a1b7457374","assignee":{"login":"pikepeak","id":15785832,"avatar_url":"https://avatars1.githubusercontent.com/u/15785832?v=4","gravatar_id":"","url":"https://api.github.com/users/pikepeak","html_url":"https://github.com/pikepeak","followers_url":"https://api.github.com/users/pikepeak/followers","following_url":"https://api.github.com/users/pikepeak/following{/other_user}","gists_url":"https://api.github.com/users/pikepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/pikepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikepeak/subscriptions","organizations_url":"https://api.github.com/users/pikepeak/orgs","repos_url":"https://api.github.com/users/pikepeak/repos","events_url":"https://api.github.com/users/pikepeak/events{/privacy}","received_events_url":"https://api.github.com/users/pikepeak/received_events","type":"User","site_admin":false},"assignees":[{"login":"pikepeak","id":15785832,"avatar_url":"https://avatars1.githubusercontent.com/u/15785832?v=4","gravatar_id":"","url":"https://api.github.com/users/pikepeak","html_url":"https://github.com/pikepeak","followers_url":"https://api.github.com/users/pikepeak/followers","following_url":"https://api.github.com/users/pikepeak/following{/other_user}","gists_url":"https://api.github.com/users/pikepeak/gists{/gist_id}","starred_url":"https://api.github.com/users/pikepeak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pikepeak/subscriptions","organizations_url":"https://api.github.com/users/pikepeak/orgs","repos_url":"https://api.github.com/users/pikepeak/repos","events_url":"https://api.github.com/users/pikepeak/events{/privacy}","received_events_url":"https://api.github.com/users/pikepeak/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29/commits","review_comments_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29/comments","review_comment_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/29/comments","statuses_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/statuses/8c927b197e4d01d8a968c0a5ef84211441abd16f","head":{"label":"it-kmitl-2018:Tax_invoice_converter","ref":"Tax_invoice_converter","sha":"8c927b197e4d01d8a968c0a5ef84211441abd16f","user":{"login":"it-kmitl-2018","id":36155350,"avatar_url":"https://avatars0.githubusercontent.com/u/36155350?v=4","gravatar_id":"","url":"https://api.github.com/users/it-kmitl-2018","html_url":"https://github.com/it-kmitl-2018","followers_url":"https://api.github.com/users/it-kmitl-2018/followers","following_url":"https://api.github.com/users/it-kmitl-2018/following{/other_user}","gists_url":"https://api.github.com/users/it-kmitl-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/it-kmitl-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it-kmitl-2018/subscriptions","organizations_url":"https://api.github.com/users/it-kmitl-2018/orgs","repos_url":"https://api.github.com/users/it-kmitl-2018/repos","events_url":"https://api.github.com/users/it-kmitl-2018/events{/privacy}","received_events_url":"https://api.github.com/users/it-kmitl-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":120293131,"name":"group6-backend","full_name":"it-kmitl-2018/group6-backend","owner":{"login":"it-kmitl-2018","id":36155350,"avatar_url":"https://avatars0.githubusercontent.com/u/36155350?v=4","gravatar_id":"","url":"https://api.github.com/users/it-kmitl-2018","html_url":"https://github.com/it-kmitl-2018","followers_url":"https://api.github.com/users/it-kmitl-2018/followers","following_url":"https://api.github.com/users/it-kmitl-2018/following{/other_user}","gists_url":"https://api.github.com/users/it-kmitl-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/it-kmitl-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it-kmitl-2018/subscriptions","organizations_url":"https://api.github.com/users/it-kmitl-2018/orgs","repos_url":"https://api.github.com/users/it-kmitl-2018/repos","events_url":"https://api.github.com/users/it-kmitl-2018/events{/privacy}","received_events_url":"https://api.github.com/users/it-kmitl-2018/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/it-kmitl-2018/group6-backend","description":null,"fork":false,"url":"https://api.github.com/repos/it-kmitl-2018/group6-backend","forks_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/forks","keys_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/teams","hooks_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/hooks","issue_events_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/events{/number}","events_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/events","assignees_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/assignees{/user}","branches_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/branches{/branch}","tags_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/tags","blobs_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/languages","stargazers_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/stargazers","contributors_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/contributors","subscribers_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/subscribers","subscription_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/subscription","commits_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/contents/{+path}","compare_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/merges","archive_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/downloads","issues_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues{/number}","pulls_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/labels{/name}","releases_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/releases{/id}","deployments_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/deployments","created_at":"2018-02-05T11:00:46Z","updated_at":"2018-03-25T16:56:20Z","pushed_at":"2018-04-29T15:34:17Z","git_url":"git://github.com/it-kmitl-2018/group6-backend.git","ssh_url":"git@github.com:it-kmitl-2018/group6-backend.git","clone_url":"https://github.com/it-kmitl-2018/group6-backend.git","svn_url":"https://github.com/it-kmitl-2018/group6-backend","homepage":null,"size":119,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"it-kmitl-2018:develop","ref":"develop","sha":"a3723755e272b71d8f0264ffc1c62a897efc6c0d","user":{"login":"it-kmitl-2018","id":36155350,"avatar_url":"https://avatars0.githubusercontent.com/u/36155350?v=4","gravatar_id":"","url":"https://api.github.com/users/it-kmitl-2018","html_url":"https://github.com/it-kmitl-2018","followers_url":"https://api.github.com/users/it-kmitl-2018/followers","following_url":"https://api.github.com/users/it-kmitl-2018/following{/other_user}","gists_url":"https://api.github.com/users/it-kmitl-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/it-kmitl-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it-kmitl-2018/subscriptions","organizations_url":"https://api.github.com/users/it-kmitl-2018/orgs","repos_url":"https://api.github.com/users/it-kmitl-2018/repos","events_url":"https://api.github.com/users/it-kmitl-2018/events{/privacy}","received_events_url":"https://api.github.com/users/it-kmitl-2018/received_events","type":"Organization","site_admin":false},"repo":{"id":120293131,"name":"group6-backend","full_name":"it-kmitl-2018/group6-backend","owner":{"login":"it-kmitl-2018","id":36155350,"avatar_url":"https://avatars0.githubusercontent.com/u/36155350?v=4","gravatar_id":"","url":"https://api.github.com/users/it-kmitl-2018","html_url":"https://github.com/it-kmitl-2018","followers_url":"https://api.github.com/users/it-kmitl-2018/followers","following_url":"https://api.github.com/users/it-kmitl-2018/following{/other_user}","gists_url":"https://api.github.com/users/it-kmitl-2018/gists{/gist_id}","starred_url":"https://api.github.com/users/it-kmitl-2018/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/it-kmitl-2018/subscriptions","organizations_url":"https://api.github.com/users/it-kmitl-2018/orgs","repos_url":"https://api.github.com/users/it-kmitl-2018/repos","events_url":"https://api.github.com/users/it-kmitl-2018/events{/privacy}","received_events_url":"https://api.github.com/users/it-kmitl-2018/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/it-kmitl-2018/group6-backend","description":null,"fork":false,"url":"https://api.github.com/repos/it-kmitl-2018/group6-backend","forks_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/forks","keys_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/teams","hooks_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/hooks","issue_events_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/events{/number}","events_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/events","assignees_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/assignees{/user}","branches_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/branches{/branch}","tags_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/tags","blobs_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/languages","stargazers_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/stargazers","contributors_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/contributors","subscribers_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/subscribers","subscription_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/subscription","commits_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/contents/{+path}","compare_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/merges","archive_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/downloads","issues_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues{/number}","pulls_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/labels{/name}","releases_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/releases{/id}","deployments_url":"https://api.github.com/repos/it-kmitl-2018/group6-backend/deployments","created_at":"2018-02-05T11:00:46Z","updated_at":"2018-03-25T16:56:20Z","pushed_at":"2018-04-29T15:34:17Z","git_url":"git://github.com/it-kmitl-2018/group6-backend.git","ssh_url":"git@github.com:it-kmitl-2018/group6-backend.git","clone_url":"https://github.com/it-kmitl-2018/group6-backend.git","svn_url":"https://github.com/it-kmitl-2018/group6-backend","homepage":null,"size":119,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29"},"html":{"href":"https://github.com/it-kmitl-2018/group6-backend/pull/29"},"issue":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/29"},"comments":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/it-kmitl-2018/group6-backend/statuses/8c927b197e4d01d8a968c0a5ef84211441abd16f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pikepeak"}}