payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Gary3D007/etl/pulls/comments/333471304","pull_request_review_id":300002198,"id":333471304,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMzQ3MTMwNA==","diff_hunk":"@@ -1,35 +1,37 @@\n package com.itechart.snatovich.payrolls.batch;\n \n+import com.fasterxml.jackson.databind.MappingIterator;\n+import com.fasterxml.jackson.dataformat.csv.CsvMapper;\n+import com.fasterxml.jackson.dataformat.csv.CsvSchema;\n import com.itechart.snatovich.payrolls.service.dto.PayrollDto;\n import lombok.extern.slf4j.Slf4j;\n import org.springframework.batch.item.file.mapping.FieldSetMapper;\n import org.springframework.batch.item.file.transform.FieldSet;\n import org.springframework.stereotype.Component;\n \n-import java.time.LocalDate;\n-import java.util.Arrays;\n+import java.io.IOException;\n \n @Slf4j\n @Component\n public class PayrollFieldSetMapper implements FieldSetMapper<PayrollDto> {\n     @Override\n     public PayrollDto mapFieldSet(FieldSet fieldSet) {\n-        log.debug(\"Field names: {}\", Arrays.asList(fieldSet.getNames()));\n \n-        PayrollDto result = new PayrollDto();\n-        result.setCompanyName(\"BSUIR\");\n-        result.setPayDate(LocalDate.of(2019, 11, 10));\n-        result.setIdentificationNumber(\"1234567891234A\");\n-        result.setFirstName(\"Ivan\");\n-        result.setLastName(\"Petrov\");\n-        result.setGrossAmount(500);\n-        result.setAtAmount(400);\n-        result.setWorkingHours(160);\n-        result.setDepartment(\"FITC\");\n-        result.setBirthdate(LocalDate.of(1958, 12, 20));\n-        result.setHireDate(LocalDate.of(2001, 9, 1));\n-        result.setGender(\"male\");\n-        result.setZipCode(\"220403\");\n+        CsvMapper mapper = new CsvMapper();\n+        CsvSchema schema = mapper.schemaFor(PayrollDto.class);","path":"src/main/java/com/itechart/snatovich/payrolls/batch/PayrollFieldSetMapper.java","position":38,"original_position":38,"commit_id":"9a4359f11a9e1571692a0909979a46a755bff602","original_commit_id":"9a4359f11a9e1571692a0909979a46a755bff602","user":{"login":"abelyaev-itechart","id":17317007,"node_id":"MDQ6VXNlcjE3MzE3MDA3","avatar_url":"https://avatars1.githubusercontent.com/u/17317007?v=4","gravatar_id":"","url":"https://api.github.com/users/abelyaev-itechart","html_url":"https://github.com/abelyaev-itechart","followers_url":"https://api.github.com/users/abelyaev-itechart/followers","following_url":"https://api.github.com/users/abelyaev-itechart/following{/other_user}","gists_url":"https://api.github.com/users/abelyaev-itechart/gists{/gist_id}","starred_url":"https://api.github.com/users/abelyaev-itechart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abelyaev-itechart/subscriptions","organizations_url":"https://api.github.com/users/abelyaev-itechart/orgs","repos_url":"https://api.github.com/users/abelyaev-itechart/repos","events_url":"https://api.github.com/users/abelyaev-itechart/events{/privacy}","received_events_url":"https://api.github.com/users/abelyaev-itechart/received_events","type":"User","site_admin":false},"body":"How would you handle header synonyms later if here mapping is performed against DTO class with very specific names of columns?","created_at":"2019-10-10T11:41:18Z","updated_at":"2019-10-10T11:41:51Z","html_url":"https://github.com/Gary3D007/etl/pull/1#discussion_r333471304","pull_request_url":"https://api.github.com/repos/Gary3D007/etl/pulls/1","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Gary3D007/etl/pulls/comments/333471304"},"html":{"href":"https://github.com/Gary3D007/etl/pull/1#discussion_r333471304"},"pull_request":{"href":"https://api.github.com/repos/Gary3D007/etl/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Gary3D007/etl/pulls/1","id":326687408,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI2Njg3NDA4","html_url":"https://github.com/Gary3D007/etl/pull/1","diff_url":"https://github.com/Gary3D007/etl/pull/1.diff","patch_url":"https://github.com/Gary3D007/etl/pull/1.patch","issue_url":"https://api.github.com/repos/Gary3D007/etl/issues/1","number":1,"state":"open","locked":false,"title":"Reader for provided file","user":{"login":"Gary3D007","id":28485126,"node_id":"MDQ6VXNlcjI4NDg1MTI2","avatar_url":"https://avatars3.githubusercontent.com/u/28485126?v=4","gravatar_id":"","url":"https://api.github.com/users/Gary3D007","html_url":"https://github.com/Gary3D007","followers_url":"https://api.github.com/users/Gary3D007/followers","following_url":"https://api.github.com/users/Gary3D007/following{/other_user}","gists_url":"https://api.github.com/users/Gary3D007/gists{/gist_id}","starred_url":"https://api.github.com/users/Gary3D007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gary3D007/subscriptions","organizations_url":"https://api.github.com/users/Gary3D007/orgs","repos_url":"https://api.github.com/users/Gary3D007/repos","events_url":"https://api.github.com/users/Gary3D007/events{/privacy}","received_events_url":"https://api.github.com/users/Gary3D007/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-10-10T11:32:58Z","updated_at":"2019-10-10T11:41:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea66ebdfbf07c7402a133a80d4f1828238d6fd82","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Gary3D007/etl/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Gary3D007/etl/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Gary3D007/etl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gary3D007/etl/issues/1/comments","statuses_url":"https://api.github.com/repos/Gary3D007/etl/statuses/9a4359f11a9e1571692a0909979a46a755bff602","head":{"label":"Gary3D007:implementReaderForProvidedFile","ref":"implementReaderForProvidedFile","sha":"9a4359f11a9e1571692a0909979a46a755bff602","user":{"login":"Gary3D007","id":28485126,"node_id":"MDQ6VXNlcjI4NDg1MTI2","avatar_url":"https://avatars3.githubusercontent.com/u/28485126?v=4","gravatar_id":"","url":"https://api.github.com/users/Gary3D007","html_url":"https://github.com/Gary3D007","followers_url":"https://api.github.com/users/Gary3D007/followers","following_url":"https://api.github.com/users/Gary3D007/following{/other_user}","gists_url":"https://api.github.com/users/Gary3D007/gists{/gist_id}","starred_url":"https://api.github.com/users/Gary3D007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gary3D007/subscriptions","organizations_url":"https://api.github.com/users/Gary3D007/orgs","repos_url":"https://api.github.com/users/Gary3D007/repos","events_url":"https://api.github.com/users/Gary3D007/events{/privacy}","received_events_url":"https://api.github.com/users/Gary3D007/received_events","type":"User","site_admin":false},"repo":{"id":213850115,"node_id":"MDEwOlJlcG9zaXRvcnkyMTM4NTAxMTU=","name":"etl","full_name":"Gary3D007/etl","private":false,"owner":{"login":"Gary3D007","id":28485126,"node_id":"MDQ6VXNlcjI4NDg1MTI2","avatar_url":"https://avatars3.githubusercontent.com/u/28485126?v=4","gravatar_id":"","url":"https://api.github.com/users/Gary3D007","html_url":"https://github.com/Gary3D007","followers_url":"https://api.github.com/users/Gary3D007/followers","following_url":"https://api.github.com/users/Gary3D007/following{/other_user}","gists_url":"https://api.github.com/users/Gary3D007/gists{/gist_id}","starred_url":"https://api.github.com/users/Gary3D007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gary3D007/subscriptions","organizations_url":"https://api.github.com/users/Gary3D007/orgs","repos_url":"https://api.github.com/users/Gary3D007/repos","events_url":"https://api.github.com/users/Gary3D007/events{/privacy}","received_events_url":"https://api.github.com/users/Gary3D007/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Gary3D007/etl","description":null,"fork":false,"url":"https://api.github.com/repos/Gary3D007/etl","forks_url":"https://api.github.com/repos/Gary3D007/etl/forks","keys_url":"https://api.github.com/repos/Gary3D007/etl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gary3D007/etl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gary3D007/etl/teams","hooks_url":"https://api.github.com/repos/Gary3D007/etl/hooks","issue_events_url":"https://api.github.com/repos/Gary3D007/etl/issues/events{/number}","events_url":"https://api.github.com/repos/Gary3D007/etl/events","assignees_url":"https://api.github.com/repos/Gary3D007/etl/assignees{/user}","branches_url":"https://api.github.com/repos/Gary3D007/etl/branches{/branch}","tags_url":"https://api.github.com/repos/Gary3D007/etl/tags","blobs_url":"https://api.github.com/repos/Gary3D007/etl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gary3D007/etl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gary3D007/etl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gary3D007/etl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gary3D007/etl/statuses/{sha}","languages_url":"https://api.github.com/repos/Gary3D007/etl/languages","stargazers_url":"https://api.github.com/repos/Gary3D007/etl/stargazers","contributors_url":"https://api.github.com/repos/Gary3D007/etl/contributors","subscribers_url":"https://api.github.com/repos/Gary3D007/etl/subscribers","subscription_url":"https://api.github.com/repos/Gary3D007/etl/subscription","commits_url":"https://api.github.com/repos/Gary3D007/etl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gary3D007/etl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gary3D007/etl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gary3D007/etl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gary3D007/etl/contents/{+path}","compare_url":"https://api.github.com/repos/Gary3D007/etl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gary3D007/etl/merges","archive_url":"https://api.github.com/repos/Gary3D007/etl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gary3D007/etl/downloads","issues_url":"https://api.github.com/repos/Gary3D007/etl/issues{/number}","pulls_url":"https://api.github.com/repos/Gary3D007/etl/pulls{/number}","milestones_url":"https://api.github.com/repos/Gary3D007/etl/milestones{/number}","notifications_url":"https://api.github.com/repos/Gary3D007/etl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gary3D007/etl/labels{/name}","releases_url":"https://api.github.com/repos/Gary3D007/etl/releases{/id}","deployments_url":"https://api.github.com/repos/Gary3D007/etl/deployments","created_at":"2019-10-09T07:27:11Z","updated_at":"2019-10-09T07:49:46Z","pushed_at":"2019-10-10T11:32:59Z","git_url":"git://github.com/Gary3D007/etl.git","ssh_url":"git@github.com:Gary3D007/etl.git","clone_url":"https://github.com/Gary3D007/etl.git","svn_url":"https://github.com/Gary3D007/etl","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Gary3D007:master","ref":"master","sha":"5e389f93b57007fe1e89c3b0dfb86f5b04dd1486","user":{"login":"Gary3D007","id":28485126,"node_id":"MDQ6VXNlcjI4NDg1MTI2","avatar_url":"https://avatars3.githubusercontent.com/u/28485126?v=4","gravatar_id":"","url":"https://api.github.com/users/Gary3D007","html_url":"https://github.com/Gary3D007","followers_url":"https://api.github.com/users/Gary3D007/followers","following_url":"https://api.github.com/users/Gary3D007/following{/other_user}","gists_url":"https://api.github.com/users/Gary3D007/gists{/gist_id}","starred_url":"https://api.github.com/users/Gary3D007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gary3D007/subscriptions","organizations_url":"https://api.github.com/users/Gary3D007/orgs","repos_url":"https://api.github.com/users/Gary3D007/repos","events_url":"https://api.github.com/users/Gary3D007/events{/privacy}","received_events_url":"https://api.github.com/users/Gary3D007/received_events","type":"User","site_admin":false},"repo":{"id":213850115,"node_id":"MDEwOlJlcG9zaXRvcnkyMTM4NTAxMTU=","name":"etl","full_name":"Gary3D007/etl","private":false,"owner":{"login":"Gary3D007","id":28485126,"node_id":"MDQ6VXNlcjI4NDg1MTI2","avatar_url":"https://avatars3.githubusercontent.com/u/28485126?v=4","gravatar_id":"","url":"https://api.github.com/users/Gary3D007","html_url":"https://github.com/Gary3D007","followers_url":"https://api.github.com/users/Gary3D007/followers","following_url":"https://api.github.com/users/Gary3D007/following{/other_user}","gists_url":"https://api.github.com/users/Gary3D007/gists{/gist_id}","starred_url":"https://api.github.com/users/Gary3D007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gary3D007/subscriptions","organizations_url":"https://api.github.com/users/Gary3D007/orgs","repos_url":"https://api.github.com/users/Gary3D007/repos","events_url":"https://api.github.com/users/Gary3D007/events{/privacy}","received_events_url":"https://api.github.com/users/Gary3D007/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Gary3D007/etl","description":null,"fork":false,"url":"https://api.github.com/repos/Gary3D007/etl","forks_url":"https://api.github.com/repos/Gary3D007/etl/forks","keys_url":"https://api.github.com/repos/Gary3D007/etl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gary3D007/etl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gary3D007/etl/teams","hooks_url":"https://api.github.com/repos/Gary3D007/etl/hooks","issue_events_url":"https://api.github.com/repos/Gary3D007/etl/issues/events{/number}","events_url":"https://api.github.com/repos/Gary3D007/etl/events","assignees_url":"https://api.github.com/repos/Gary3D007/etl/assignees{/user}","branches_url":"https://api.github.com/repos/Gary3D007/etl/branches{/branch}","tags_url":"https://api.github.com/repos/Gary3D007/etl/tags","blobs_url":"https://api.github.com/repos/Gary3D007/etl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gary3D007/etl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gary3D007/etl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gary3D007/etl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gary3D007/etl/statuses/{sha}","languages_url":"https://api.github.com/repos/Gary3D007/etl/languages","stargazers_url":"https://api.github.com/repos/Gary3D007/etl/stargazers","contributors_url":"https://api.github.com/repos/Gary3D007/etl/contributors","subscribers_url":"https://api.github.com/repos/Gary3D007/etl/subscribers","subscription_url":"https://api.github.com/repos/Gary3D007/etl/subscription","commits_url":"https://api.github.com/repos/Gary3D007/etl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gary3D007/etl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gary3D007/etl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gary3D007/etl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gary3D007/etl/contents/{+path}","compare_url":"https://api.github.com/repos/Gary3D007/etl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gary3D007/etl/merges","archive_url":"https://api.github.com/repos/Gary3D007/etl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gary3D007/etl/downloads","issues_url":"https://api.github.com/repos/Gary3D007/etl/issues{/number}","pulls_url":"https://api.github.com/repos/Gary3D007/etl/pulls{/number}","milestones_url":"https://api.github.com/repos/Gary3D007/etl/milestones{/number}","notifications_url":"https://api.github.com/repos/Gary3D007/etl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gary3D007/etl/labels{/name}","releases_url":"https://api.github.com/repos/Gary3D007/etl/releases{/id}","deployments_url":"https://api.github.com/repos/Gary3D007/etl/deployments","created_at":"2019-10-09T07:27:11Z","updated_at":"2019-10-09T07:49:46Z","pushed_at":"2019-10-10T11:32:59Z","git_url":"git://github.com/Gary3D007/etl.git","ssh_url":"git@github.com:Gary3D007/etl.git","clone_url":"https://github.com/Gary3D007/etl.git","svn_url":"https://github.com/Gary3D007/etl","homepage":null,"size":60,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gary3D007/etl/pulls/1"},"html":{"href":"https://github.com/Gary3D007/etl/pull/1"},"issue":{"href":"https://api.github.com/repos/Gary3D007/etl/issues/1"},"comments":{"href":"https://api.github.com/repos/Gary3D007/etl/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Gary3D007/etl/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Gary3D007/etl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gary3D007/etl/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Gary3D007/etl/statuses/9a4359f11a9e1571692a0909979a46a755bff602"}},"author_association":"OWNER"}}
other: {"actor":{"display_login":"abelyaev-itechart"}}