 
 (defn job-started-handler
     [request]
-    (let [job-name (-> (read-request-body request) body->job-name)]
+    (let [job-name (read-job-name-from-request request)]
         (println "job started" job-name)
         (send-response {:status :ok})))
 
 (defn job-finished-handler
     [request]
-    (let [job-name (-> (read-request-body request) body->job-name)]
+    (let [job-name (read-job-name-from-request request)]
         (println "job finished" job-name)
         (send-response {:status :ok})))
 
+(defn job-results-handler
+    [request]
+    (let [job-name (read-job-name-from-request request)
+          results  (-> (read-request-body request) body->results)]
+        (println "job name" job-name)
+        (println "results:" results)
+        ;(pprint/pprint results)
+        (send-response {:status :ok})))
+

    [request]
    (file-utils/slurp- (:body request)))

(defn body->job-name
    [body]
    (let [data (json/read-str body)]
        (get data "name")))

(defn send-response
    [response]

(ns emender-service.rest-api)

(require '[ring.util.response     :as http-response])
(require '[clojure.pprint         :as pprint])
(require '[clojure.data.json      :as json])

(require '[emender-service.file-utils :as file-utils])
