                                     (keys)
                                     (set)))
 
-(defrecord JobExecutionContext [project-dir state]
+(defrecord ^{:no-doc true} JobExecutionContext [project-dir state]
 
   sm/Stateful
   (current-state [^JobExecutionContext this] (:state this))

(ns fhofherr.simple.core.job-execution-context
  (:require [fhofherr.simple.core.status-model :as sm]))

(def ^:private state-transitions {::created #{::executing}

                             :state ::created}))

(defn created?
  "Check if `ex-ctx`s state is *created*."
  [^JobExecutionContext ex-ctx]
  (= ::created (sm/current-state ex-ctx)))

(defn mark-executing
  "Mark `ex-ctx`s as *executing*."
  [^JobExecutionContext ex-ctx]
  (sm/transition-to-state ex-ctx ::executing))

(defn executing?
  "Check if `ex-ctx`s state is *executing*."
  [^JobExecutionContext ex-ctx]
  (= ::executing (sm/current-state ex-ctx)))

(defn mark-successful
  "Mark `ex-ctx`s as *successful*."
  [^JobExecutionContext ex-ctx]
  (sm/transition-to-state ex-ctx ::successful))

(defn successful?
  "Check if `ex-ctx`s state is *successful*."
  [^JobExecutionContext ex-ctx]
  (= ::successful (sm/current-state ex-ctx)))

(defn mark-failed
  "Mark `ex-ctx`s as *failed*."
  [^JobExecutionContext ex-ctx]
  (sm/transition-to-state ex-ctx ::failed))

(defn failed?
  "Check if `ex-ctx`s state is *failed*."
  [^JobExecutionContext ex-ctx]
  (= ::failed (sm/current-state ex-ctx)))
