{"action":"created","comment":{"url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/comments/195985359","pull_request_review_id":129451854,"id":195985359,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTk4NTM1OQ==","diff_hunk":"@@ -38,6 +38,15 @@ module Types\n       AccountNumber = Strict::Int\n                       .constrained(gteq: 0, lteq: 9999)\n                       .optional\n+                      .constructor do |input|\n+                        unless input.nil? || input.to_s.empty?\n+                          Integer(input)\n+                        else\n+                          input\n+                        end\n+                      rescue ArgumentError\n+                        input","path":"lib/fortnox/api/types.rb","position":11,"original_position":11,"commit_id":"51bbce1987c0fdc4e13e830a512841346bbc8887","original_commit_id":"51bbce1987c0fdc4e13e830a512841346bbc8887","user":{"login":"d-Pixie","id":1247102,"node_id":"MDQ6VXNlcjEyNDcxMDI=","avatar_url":"https://avatars3.githubusercontent.com/u/1247102?v=4","gravatar_id":"","url":"https://api.github.com/users/d-Pixie","html_url":"https://github.com/d-Pixie","followers_url":"https://api.github.com/users/d-Pixie/followers","following_url":"https://api.github.com/users/d-Pixie/following{/other_user}","gists_url":"https://api.github.com/users/d-Pixie/gists{/gist_id}","starred_url":"https://api.github.com/users/d-Pixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-Pixie/subscriptions","organizations_url":"https://api.github.com/users/d-Pixie/orgs","repos_url":"https://api.github.com/users/d-Pixie/repos","events_url":"https://api.github.com/users/d-Pixie/events{/privacy}","received_events_url":"https://api.github.com/users/d-Pixie/received_events","type":"User","site_admin":false},"body":"Not all valid/invalid cases are tested. We could test for everything but right now, with my suggested changes, we do test the two main cases: Things that respond to to_s and has a valid value will convert, the rest will cause a Dry types constraint error...","created_at":"2018-06-18T07:35:43Z","updated_at":"2018-06-18T07:35:43Z","html_url":"https://github.com/my-codeworks/fortnox-api/pull/158#discussion_r195985359","pull_request_url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/comments/195985359"},"html":{"href":"https://github.com/my-codeworks/fortnox-api/pull/158#discussion_r195985359"},"pull_request":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158"}},"in_reply_to_id":195980014},"pull_request":{"url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158","id":192495510,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNDk1NTEw","html_url":"https://github.com/my-codeworks/fortnox-api/pull/158","diff_url":"https://github.com/my-codeworks/fortnox-api/pull/158.diff","patch_url":"https://github.com/my-codeworks/fortnox-api/pull/158.patch","issue_url":"https://api.github.com/repos/my-codeworks/fortnox-api/issues/158","number":158,"state":"open","locked":false,"title":"Cast AccountNumber string to integer","user":{"login":"samuel02","id":286735,"node_id":"MDQ6VXNlcjI4NjczNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/286735?v=4","gravatar_id":"","url":"https://api.github.com/users/samuel02","html_url":"https://github.com/samuel02","followers_url":"https://api.github.com/users/samuel02/followers","following_url":"https://api.github.com/users/samuel02/following{/other_user}","gists_url":"https://api.github.com/users/samuel02/gists{/gist_id}","starred_url":"https://api.github.com/users/samuel02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuel02/subscriptions","organizations_url":"https://api.github.com/users/samuel02/orgs","repos_url":"https://api.github.com/users/samuel02/repos","events_url":"https://api.github.com/users/samuel02/events{/privacy}","received_events_url":"https://api.github.com/users/samuel02/received_events","type":"User","site_admin":false},"body":"According to the documentation at https://developer.fortnox.se/documentation/resources/customers/\r\nthe field `SalesAccount` on the `Customer` is a 4 digit string.","created_at":"2018-06-04T18:48:19Z","updated_at":"2018-06-18T07:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1fb29c7544df91f33b973509e98adcbfafd192a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158/commits","review_comments_url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158/comments","review_comment_url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/my-codeworks/fortnox-api/issues/158/comments","statuses_url":"https://api.github.com/repos/my-codeworks/fortnox-api/statuses/51bbce1987c0fdc4e13e830a512841346bbc8887","head":{"label":"samuel02:correct-type-for-customer-sales-account","ref":"correct-type-for-customer-sales-account","sha":"51bbce1987c0fdc4e13e830a512841346bbc8887","user":{"login":"samuel02","id":286735,"node_id":"MDQ6VXNlcjI4NjczNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/286735?v=4","gravatar_id":"","url":"https://api.github.com/users/samuel02","html_url":"https://github.com/samuel02","followers_url":"https://api.github.com/users/samuel02/followers","following_url":"https://api.github.com/users/samuel02/following{/other_user}","gists_url":"https://api.github.com/users/samuel02/gists{/gist_id}","starred_url":"https://api.github.com/users/samuel02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuel02/subscriptions","organizations_url":"https://api.github.com/users/samuel02/orgs","repos_url":"https://api.github.com/users/samuel02/repos","events_url":"https://api.github.com/users/samuel02/events{/privacy}","received_events_url":"https://api.github.com/users/samuel02/received_events","type":"User","site_admin":false},"repo":{"id":133401735,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM0MDE3MzU=","name":"fortnox-api","full_name":"samuel02/fortnox-api","owner":{"login":"samuel02","id":286735,"node_id":"MDQ6VXNlcjI4NjczNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/286735?v=4","gravatar_id":"","url":"https://api.github.com/users/samuel02","html_url":"https://github.com/samuel02","followers_url":"https://api.github.com/users/samuel02/followers","following_url":"https://api.github.com/users/samuel02/following{/other_user}","gists_url":"https://api.github.com/users/samuel02/gists{/gist_id}","starred_url":"https://api.github.com/users/samuel02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuel02/subscriptions","organizations_url":"https://api.github.com/users/samuel02/orgs","repos_url":"https://api.github.com/users/samuel02/repos","events_url":"https://api.github.com/users/samuel02/events{/privacy}","received_events_url":"https://api.github.com/users/samuel02/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samuel02/fortnox-api","description":"Gem that abstracts Fortnox's F3 API","fork":true,"url":"https://api.github.com/repos/samuel02/fortnox-api","forks_url":"https://api.github.com/repos/samuel02/fortnox-api/forks","keys_url":"https://api.github.com/repos/samuel02/fortnox-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samuel02/fortnox-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samuel02/fortnox-api/teams","hooks_url":"https://api.github.com/repos/samuel02/fortnox-api/hooks","issue_events_url":"https://api.github.com/repos/samuel02/fortnox-api/issues/events{/number}","events_url":"https://api.github.com/repos/samuel02/fortnox-api/events","assignees_url":"https://api.github.com/repos/samuel02/fortnox-api/assignees{/user}","branches_url":"https://api.github.com/repos/samuel02/fortnox-api/branches{/branch}","tags_url":"https://api.github.com/repos/samuel02/fortnox-api/tags","blobs_url":"https://api.github.com/repos/samuel02/fortnox-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samuel02/fortnox-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samuel02/fortnox-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/samuel02/fortnox-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samuel02/fortnox-api/statuses/{sha}","languages_url":"https://api.github.com/repos/samuel02/fortnox-api/languages","stargazers_url":"https://api.github.com/repos/samuel02/fortnox-api/stargazers","contributors_url":"https://api.github.com/repos/samuel02/fortnox-api/contributors","subscribers_url":"https://api.github.com/repos/samuel02/fortnox-api/subscribers","subscription_url":"https://api.github.com/repos/samuel02/fortnox-api/subscription","commits_url":"https://api.github.com/repos/samuel02/fortnox-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/samuel02/fortnox-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/samuel02/fortnox-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/samuel02/fortnox-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/samuel02/fortnox-api/contents/{+path}","compare_url":"https://api.github.com/repos/samuel02/fortnox-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samuel02/fortnox-api/merges","archive_url":"https://api.github.com/repos/samuel02/fortnox-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samuel02/fortnox-api/downloads","issues_url":"https://api.github.com/repos/samuel02/fortnox-api/issues{/number}","pulls_url":"https://api.github.com/repos/samuel02/fortnox-api/pulls{/number}","milestones_url":"https://api.github.com/repos/samuel02/fortnox-api/milestones{/number}","notifications_url":"https://api.github.com/repos/samuel02/fortnox-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samuel02/fortnox-api/labels{/name}","releases_url":"https://api.github.com/repos/samuel02/fortnox-api/releases{/id}","deployments_url":"https://api.github.com/repos/samuel02/fortnox-api/deployments","created_at":"2018-05-14T18:00:56Z","updated_at":"2018-06-14T17:47:27Z","pushed_at":"2018-06-15T15:27:27Z","git_url":"git://github.com/samuel02/fortnox-api.git","ssh_url":"git@github.com:samuel02/fortnox-api.git","clone_url":"https://github.com/samuel02/fortnox-api.git","svn_url":"https://github.com/samuel02/fortnox-api","homepage":null,"size":1233,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"my-codeworks:development","ref":"development","sha":"a163445248da9ae7256ad1233217dadb12236ef2","user":{"login":"my-codeworks","id":3019360,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMTkzNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/3019360?v=4","gravatar_id":"","url":"https://api.github.com/users/my-codeworks","html_url":"https://github.com/my-codeworks","followers_url":"https://api.github.com/users/my-codeworks/followers","following_url":"https://api.github.com/users/my-codeworks/following{/other_user}","gists_url":"https://api.github.com/users/my-codeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/my-codeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/my-codeworks/subscriptions","organizations_url":"https://api.github.com/users/my-codeworks/orgs","repos_url":"https://api.github.com/users/my-codeworks/repos","events_url":"https://api.github.com/users/my-codeworks/events{/privacy}","received_events_url":"https://api.github.com/users/my-codeworks/received_events","type":"Organization","site_admin":false},"repo":{"id":17282331,"node_id":"MDEwOlJlcG9zaXRvcnkxNzI4MjMzMQ==","name":"fortnox-api","full_name":"my-codeworks/fortnox-api","owner":{"login":"my-codeworks","id":3019360,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMTkzNjA=","avatar_url":"https://avatars2.githubusercontent.com/u/3019360?v=4","gravatar_id":"","url":"https://api.github.com/users/my-codeworks","html_url":"https://github.com/my-codeworks","followers_url":"https://api.github.com/users/my-codeworks/followers","following_url":"https://api.github.com/users/my-codeworks/following{/other_user}","gists_url":"https://api.github.com/users/my-codeworks/gists{/gist_id}","starred_url":"https://api.github.com/users/my-codeworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/my-codeworks/subscriptions","organizations_url":"https://api.github.com/users/my-codeworks/orgs","repos_url":"https://api.github.com/users/my-codeworks/repos","events_url":"https://api.github.com/users/my-codeworks/events{/privacy}","received_events_url":"https://api.github.com/users/my-codeworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/my-codeworks/fortnox-api","description":"Gem that abstracts Fortnox's F3 API","fork":false,"url":"https://api.github.com/repos/my-codeworks/fortnox-api","forks_url":"https://api.github.com/repos/my-codeworks/fortnox-api/forks","keys_url":"https://api.github.com/repos/my-codeworks/fortnox-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/my-codeworks/fortnox-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/my-codeworks/fortnox-api/teams","hooks_url":"https://api.github.com/repos/my-codeworks/fortnox-api/hooks","issue_events_url":"https://api.github.com/repos/my-codeworks/fortnox-api/issues/events{/number}","events_url":"https://api.github.com/repos/my-codeworks/fortnox-api/events","assignees_url":"https://api.github.com/repos/my-codeworks/fortnox-api/assignees{/user}","branches_url":"https://api.github.com/repos/my-codeworks/fortnox-api/branches{/branch}","tags_url":"https://api.github.com/repos/my-codeworks/fortnox-api/tags","blobs_url":"https://api.github.com/repos/my-codeworks/fortnox-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/my-codeworks/fortnox-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/my-codeworks/fortnox-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/my-codeworks/fortnox-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/my-codeworks/fortnox-api/statuses/{sha}","languages_url":"https://api.github.com/repos/my-codeworks/fortnox-api/languages","stargazers_url":"https://api.github.com/repos/my-codeworks/fortnox-api/stargazers","contributors_url":"https://api.github.com/repos/my-codeworks/fortnox-api/contributors","subscribers_url":"https://api.github.com/repos/my-codeworks/fortnox-api/subscribers","subscription_url":"https://api.github.com/repos/my-codeworks/fortnox-api/subscription","commits_url":"https://api.github.com/repos/my-codeworks/fortnox-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/my-codeworks/fortnox-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/my-codeworks/fortnox-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/my-codeworks/fortnox-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/my-codeworks/fortnox-api/contents/{+path}","compare_url":"https://api.github.com/repos/my-codeworks/fortnox-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/my-codeworks/fortnox-api/merges","archive_url":"https://api.github.com/repos/my-codeworks/fortnox-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/my-codeworks/fortnox-api/downloads","issues_url":"https://api.github.com/repos/my-codeworks/fortnox-api/issues{/number}","pulls_url":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls{/number}","milestones_url":"https://api.github.com/repos/my-codeworks/fortnox-api/milestones{/number}","notifications_url":"https://api.github.com/repos/my-codeworks/fortnox-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/my-codeworks/fortnox-api/labels{/name}","releases_url":"https://api.github.com/repos/my-codeworks/fortnox-api/releases{/id}","deployments_url":"https://api.github.com/repos/my-codeworks/fortnox-api/deployments","created_at":"2014-02-28T10:02:07Z","updated_at":"2018-06-11T12:45:01Z","pushed_at":"2018-06-15T15:27:29Z","git_url":"git://github.com/my-codeworks/fortnox-api.git","ssh_url":"git@github.com:my-codeworks/fortnox-api.git","clone_url":"https://github.com/my-codeworks/fortnox-api.git","svn_url":"https://github.com/my-codeworks/fortnox-api","homepage":null,"size":1212,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":34,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":7,"open_issues":34,"watchers":7,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158"},"html":{"href":"https://github.com/my-codeworks/fortnox-api/pull/158"},"issue":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/issues/158"},"comments":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/my-codeworks/fortnox-api/statuses/51bbce1987c0fdc4e13e830a512841346bbc8887"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"d-Pixie"}}