{"action":"created","comment":{"url":"https://api.github.com/repos/Opetushallitus/ataru/pulls/comments/168083072","pull_request_review_id":96391352,"id":168083072,"diff_hunk":"@@ -23,34 +23,37 @@\n (defn- jatkuva-haku? [haku]\n   (clojure.string/starts-with? (:hakutapaUri haku) \"hakutapa_03#\"))\n \n-(defn- parse-hakuaika\n-  \"Hakuaika from hakuaika can override hakuaika from haku. Haku may have multiple hakuaikas defined.\"\n-  [hakukohde haku]\n-  ; TODO need to check that hakukohde hakuaika is valid wrt. haku hakuaika?\n-  (if (and (:hakuaikaAlkuPvm hakukohde) (:hakuaikaLoppuPvm hakukohde))\n-    {:start (:hakuaikaAlkuPvm hakukohde)\n-     :end   (:hakuaikaLoppuPvm hakukohde)}\n-    (let [this-haku-hakuaika (find-current-or-last-hakuaika (:hakuaikas haku))]\n-      {:start (:alkuPvm this-haku-hakuaika)\n-       :end   (:loppuPvm this-haku-hakuaika)})))\n-\n (defn hakuaika-on [start end]\n-  (cond\n-    (and start end (time-within? (time/now) start end))\n-    true\n-\n-    ;; \"Jatkuva haku\"\n-    (and start (not end) (time/after? (time/now) (time-coerce/from-long start)))\n-    true\n-\n-    :else\n-    false))\n-\n-(defn get-hakuaika-info [hakukohde haku ohjausparametrit]\n-  (as-> (parse-hakuaika hakukohde haku) {:keys [start end] :as interval}\n-        (assoc interval :on (hakuaika-on start end))\n-        (assoc interval\n-               :attachment-modify-grace-period-days\n-               (-> ohjausparametrit :PH_LMT :value))\n-        (assoc interval :jatkuva-haku? (jatkuva-haku? haku))\n-        (assoc interval :hakukierros-end (-> ohjausparametrit :PH_HKP :date))))\n+      (cond\n+        (and start end (time-within? (time/now) start end))\n+        true\n+\n+        ;; \"Jatkuva haku\"\n+        (and start (not end) (time/after? (time/now) (time-coerce/from-long start)))\n+        true\n+\n+        :else\n+        false))\n+\n+(defn parse-hakuaika-from-hakukohde [hakukohde]\n+      (if-let [start (:hakuaikaAlkuPvm hakukohde)]","path":"src/clj/ataru/tarjonta_service/hakuaika.clj","position":47,"original_position":47,"commit_id":"26ff65421f1d69e87e6f7f68a15210378fb16c5b","original_commit_id":"26ff65421f1d69e87e6f7f68a15210378fb16c5b","user":{"login":"heeboA","id":6974611,"avatar_url":"https://avatars2.githubusercontent.com/u/6974611?v=4","gravatar_id":"","url":"https://api.github.com/users/heeboA","html_url":"https://github.com/heeboA","followers_url":"https://api.github.com/users/heeboA/followers","following_url":"https://api.github.com/users/heeboA/following{/other_user}","gists_url":"https://api.github.com/users/heeboA/gists{/gist_id}","starred_url":"https://api.github.com/users/heeboA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heeboA/subscriptions","organizations_url":"https://api.github.com/users/heeboA/orgs","repos_url":"https://api.github.com/users/heeboA/repos","events_url":"https://api.github.com/users/heeboA/events{/privacy}","received_events_url":"https://api.github.com/users/heeboA/received_events","type":"User","site_admin":false},"body":"Indent","created_at":"2018-02-14T05:59:41Z","updated_at":"2018-02-14T06:04:05Z","html_url":"https://github.com/Opetushallitus/ataru/pull/461#discussion_r168083072","pull_request_url":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Opetushallitus/ataru/pulls/comments/168083072"},"html":{"href":"https://github.com/Opetushallitus/ataru/pull/461#discussion_r168083072"},"pull_request":{"href":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461"}}},"pull_request":{"url":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461","id":168841697,"html_url":"https://github.com/Opetushallitus/ataru/pull/461","diff_url":"https://github.com/Opetushallitus/ataru/pull/461.diff","patch_url":"https://github.com/Opetushallitus/ataru/pull/461.patch","issue_url":"https://api.github.com/repos/Opetushallitus/ataru/issues/461","number":461,"state":"open","locked":false,"title":"Hle 288","user":{"login":"jussijartamo","id":3907498,"avatar_url":"https://avatars3.githubusercontent.com/u/3907498?v=4","gravatar_id":"","url":"https://api.github.com/users/jussijartamo","html_url":"https://github.com/jussijartamo","followers_url":"https://api.github.com/users/jussijartamo/followers","following_url":"https://api.github.com/users/jussijartamo/following{/other_user}","gists_url":"https://api.github.com/users/jussijartamo/gists{/gist_id}","starred_url":"https://api.github.com/users/jussijartamo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jussijartamo/subscriptions","organizations_url":"https://api.github.com/users/jussijartamo/orgs","repos_url":"https://api.github.com/users/jussijartamo/repos","events_url":"https://api.github.com/users/jussijartamo/events{/privacy}","received_events_url":"https://api.github.com/users/jussijartamo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-13T13:16:42Z","updated_at":"2018-02-14T06:04:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e3879f0464d17948192dc37fc28775984c52a0c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461/commits","review_comments_url":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461/comments","review_comment_url":"https://api.github.com/repos/Opetushallitus/ataru/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Opetushallitus/ataru/issues/461/comments","statuses_url":"https://api.github.com/repos/Opetushallitus/ataru/statuses/26ff65421f1d69e87e6f7f68a15210378fb16c5b","head":{"label":"Opetushallitus:HLE-288","ref":"HLE-288","sha":"26ff65421f1d69e87e6f7f68a15210378fb16c5b","user":{"login":"Opetushallitus","id":2628558,"avatar_url":"https://avatars3.githubusercontent.com/u/2628558?v=4","gravatar_id":"","url":"https://api.github.com/users/Opetushallitus","html_url":"https://github.com/Opetushallitus","followers_url":"https://api.github.com/users/Opetushallitus/followers","following_url":"https://api.github.com/users/Opetushallitus/following{/other_user}","gists_url":"https://api.github.com/users/Opetushallitus/gists{/gist_id}","starred_url":"https://api.github.com/users/Opetushallitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opetushallitus/subscriptions","organizations_url":"https://api.github.com/users/Opetushallitus/orgs","repos_url":"https://api.github.com/users/Opetushallitus/repos","events_url":"https://api.github.com/users/Opetushallitus/events{/privacy}","received_events_url":"https://api.github.com/users/Opetushallitus/received_events","type":"Organization","site_admin":false},"repo":{"id":54475848,"name":"ataru","full_name":"Opetushallitus/ataru","owner":{"login":"Opetushallitus","id":2628558,"avatar_url":"https://avatars3.githubusercontent.com/u/2628558?v=4","gravatar_id":"","url":"https://api.github.com/users/Opetushallitus","html_url":"https://github.com/Opetushallitus","followers_url":"https://api.github.com/users/Opetushallitus/followers","following_url":"https://api.github.com/users/Opetushallitus/following{/other_user}","gists_url":"https://api.github.com/users/Opetushallitus/gists{/gist_id}","starred_url":"https://api.github.com/users/Opetushallitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opetushallitus/subscriptions","organizations_url":"https://api.github.com/users/Opetushallitus/orgs","repos_url":"https://api.github.com/users/Opetushallitus/repos","events_url":"https://api.github.com/users/Opetushallitus/events{/privacy}","received_events_url":"https://api.github.com/users/Opetushallitus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Opetushallitus/ataru","description":"Generic form generation service","fork":false,"url":"https://api.github.com/repos/Opetushallitus/ataru","forks_url":"https://api.github.com/repos/Opetushallitus/ataru/forks","keys_url":"https://api.github.com/repos/Opetushallitus/ataru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Opetushallitus/ataru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Opetushallitus/ataru/teams","hooks_url":"https://api.github.com/repos/Opetushallitus/ataru/hooks","issue_events_url":"https://api.github.com/repos/Opetushallitus/ataru/issues/events{/number}","events_url":"https://api.github.com/repos/Opetushallitus/ataru/events","assignees_url":"https://api.github.com/repos/Opetushallitus/ataru/assignees{/user}","branches_url":"https://api.github.com/repos/Opetushallitus/ataru/branches{/branch}","tags_url":"https://api.github.com/repos/Opetushallitus/ataru/tags","blobs_url":"https://api.github.com/repos/Opetushallitus/ataru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Opetushallitus/ataru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Opetushallitus/ataru/git/refs{/sha}","trees_url":"https://api.github.com/repos/Opetushallitus/ataru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Opetushallitus/ataru/statuses/{sha}","languages_url":"https://api.github.com/repos/Opetushallitus/ataru/languages","stargazers_url":"https://api.github.com/repos/Opetushallitus/ataru/stargazers","contributors_url":"https://api.github.com/repos/Opetushallitus/ataru/contributors","subscribers_url":"https://api.github.com/repos/Opetushallitus/ataru/subscribers","subscription_url":"https://api.github.com/repos/Opetushallitus/ataru/subscription","commits_url":"https://api.github.com/repos/Opetushallitus/ataru/commits{/sha}","git_commits_url":"https://api.github.com/repos/Opetushallitus/ataru/git/commits{/sha}","comments_url":"https://api.github.com/repos/Opetushallitus/ataru/comments{/number}","issue_comment_url":"https://api.github.com/repos/Opetushallitus/ataru/issues/comments{/number}","contents_url":"https://api.github.com/repos/Opetushallitus/ataru/contents/{+path}","compare_url":"https://api.github.com/repos/Opetushallitus/ataru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Opetushallitus/ataru/merges","archive_url":"https://api.github.com/repos/Opetushallitus/ataru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Opetushallitus/ataru/downloads","issues_url":"https://api.github.com/repos/Opetushallitus/ataru/issues{/number}","pulls_url":"https://api.github.com/repos/Opetushallitus/ataru/pulls{/number}","milestones_url":"https://api.github.com/repos/Opetushallitus/ataru/milestones{/number}","notifications_url":"https://api.github.com/repos/Opetushallitus/ataru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Opetushallitus/ataru/labels{/name}","releases_url":"https://api.github.com/repos/Opetushallitus/ataru/releases{/id}","deployments_url":"https://api.github.com/repos/Opetushallitus/ataru/deployments","created_at":"2016-03-22T13:07:32Z","updated_at":"2017-12-31T14:17:04Z","pushed_at":"2018-02-14T05:46:15Z","git_url":"git://github.com/Opetushallitus/ataru.git","ssh_url":"git@github.com:Opetushallitus/ataru.git","clone_url":"https://github.com/Opetushallitus/ataru.git","svn_url":"https://github.com/Opetushallitus/ataru","homepage":"","size":5770,"stargazers_count":5,"watchers_count":5,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":6,"watchers":5,"default_branch":"master"}},"base":{"label":"Opetushallitus:master","ref":"master","sha":"51aae6c58188fbb3a92b09930c1a513db4f220ae","user":{"login":"Opetushallitus","id":2628558,"avatar_url":"https://avatars3.githubusercontent.com/u/2628558?v=4","gravatar_id":"","url":"https://api.github.com/users/Opetushallitus","html_url":"https://github.com/Opetushallitus","followers_url":"https://api.github.com/users/Opetushallitus/followers","following_url":"https://api.github.com/users/Opetushallitus/following{/other_user}","gists_url":"https://api.github.com/users/Opetushallitus/gists{/gist_id}","starred_url":"https://api.github.com/users/Opetushallitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opetushallitus/subscriptions","organizations_url":"https://api.github.com/users/Opetushallitus/orgs","repos_url":"https://api.github.com/users/Opetushallitus/repos","events_url":"https://api.github.com/users/Opetushallitus/events{/privacy}","received_events_url":"https://api.github.com/users/Opetushallitus/received_events","type":"Organization","site_admin":false},"repo":{"id":54475848,"name":"ataru","full_name":"Opetushallitus/ataru","owner":{"login":"Opetushallitus","id":2628558,"avatar_url":"https://avatars3.githubusercontent.com/u/2628558?v=4","gravatar_id":"","url":"https://api.github.com/users/Opetushallitus","html_url":"https://github.com/Opetushallitus","followers_url":"https://api.github.com/users/Opetushallitus/followers","following_url":"https://api.github.com/users/Opetushallitus/following{/other_user}","gists_url":"https://api.github.com/users/Opetushallitus/gists{/gist_id}","starred_url":"https://api.github.com/users/Opetushallitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Opetushallitus/subscriptions","organizations_url":"https://api.github.com/users/Opetushallitus/orgs","repos_url":"https://api.github.com/users/Opetushallitus/repos","events_url":"https://api.github.com/users/Opetushallitus/events{/privacy}","received_events_url":"https://api.github.com/users/Opetushallitus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Opetushallitus/ataru","description":"Generic form generation service","fork":false,"url":"https://api.github.com/repos/Opetushallitus/ataru","forks_url":"https://api.github.com/repos/Opetushallitus/ataru/forks","keys_url":"https://api.github.com/repos/Opetushallitus/ataru/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Opetushallitus/ataru/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Opetushallitus/ataru/teams","hooks_url":"https://api.github.com/repos/Opetushallitus/ataru/hooks","issue_events_url":"https://api.github.com/repos/Opetushallitus/ataru/issues/events{/number}","events_url":"https://api.github.com/repos/Opetushallitus/ataru/events","assignees_url":"https://api.github.com/repos/Opetushallitus/ataru/assignees{/user}","branches_url":"https://api.github.com/repos/Opetushallitus/ataru/branches{/branch}","tags_url":"https://api.github.com/repos/Opetushallitus/ataru/tags","blobs_url":"https://api.github.com/repos/Opetushallitus/ataru/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Opetushallitus/ataru/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Opetushallitus/ataru/git/refs{/sha}","trees_url":"https://api.github.com/repos/Opetushallitus/ataru/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Opetushallitus/ataru/statuses/{sha}","languages_url":"https://api.github.com/repos/Opetushallitus/ataru/languages","stargazers_url":"https://api.github.com/repos/Opetushallitus/ataru/stargazers","contributors_url":"https://api.github.com/repos/Opetushallitus/ataru/contributors","subscribers_url":"https://api.github.com/repos/Opetushallitus/ataru/subscribers","subscription_url":"https://api.github.com/repos/Opetushallitus/ataru/subscription","commits_url":"https://api.github.com/repos/Opetushallitus/ataru/commits{/sha}","git_commits_url":"https://api.github.com/repos/Opetushallitus/ataru/git/commits{/sha}","comments_url":"https://api.github.com/repos/Opetushallitus/ataru/comments{/number}","issue_comment_url":"https://api.github.com/repos/Opetushallitus/ataru/issues/comments{/number}","contents_url":"https://api.github.com/repos/Opetushallitus/ataru/contents/{+path}","compare_url":"https://api.github.com/repos/Opetushallitus/ataru/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Opetushallitus/ataru/merges","archive_url":"https://api.github.com/repos/Opetushallitus/ataru/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Opetushallitus/ataru/downloads","issues_url":"https://api.github.com/repos/Opetushallitus/ataru/issues{/number}","pulls_url":"https://api.github.com/repos/Opetushallitus/ataru/pulls{/number}","milestones_url":"https://api.github.com/repos/Opetushallitus/ataru/milestones{/number}","notifications_url":"https://api.github.com/repos/Opetushallitus/ataru/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Opetushallitus/ataru/labels{/name}","releases_url":"https://api.github.com/repos/Opetushallitus/ataru/releases{/id}","deployments_url":"https://api.github.com/repos/Opetushallitus/ataru/deployments","created_at":"2016-03-22T13:07:32Z","updated_at":"2017-12-31T14:17:04Z","pushed_at":"2018-02-14T05:46:15Z","git_url":"git://github.com/Opetushallitus/ataru.git","ssh_url":"git@github.com:Opetushallitus/ataru.git","clone_url":"https://github.com/Opetushallitus/ataru.git","svn_url":"https://github.com/Opetushallitus/ataru","homepage":"","size":5770,"stargazers_count":5,"watchers_count":5,"language":"Clojure","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":6,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461"},"html":{"href":"https://github.com/Opetushallitus/ataru/pull/461"},"issue":{"href":"https://api.github.com/repos/Opetushallitus/ataru/issues/461"},"comments":{"href":"https://api.github.com/repos/Opetushallitus/ataru/issues/461/comments"},"review_comments":{"href":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461/comments"},"review_comment":{"href":"https://api.github.com/repos/Opetushallitus/ataru/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Opetushallitus/ataru/pulls/461/commits"},"statuses":{"href":"https://api.github.com/repos/Opetushallitus/ataru/statuses/26ff65421f1d69e87e6f7f68a15210378fb16c5b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"heeboA"}}