             [clojure.java.io :refer [file]]
             [clojure.tools.logging :as log]
             [environ.core :refer [env]]
+            [clj-time.core :as t]
             [me.raynes.fs :as fs]
             [mdr2.production :as prod]
             [mdr2.production.path :as path]

  (env :archive-other-spool-dir))

(def ^:private default-job
  {:verzeichnis ""
   :archivar "NN"
   :abholer "NN"
   :aktion "save"
   :transaktions_status "pending"})

(defn- container-id
  "Return the name of a archive spool directory for a given

  [production sektion]
  (let [new-job
        {:verzeichnis (container-id production sektion)
         :sektion (case sektion :master "master" :dist-master "cdimage")
         :datum (t/now)}
        job (merge default-job new-job)]
    (jdbc/insert! db :container job)))

