 (ns oc.storage.resources.label
   (:require [oc.lib.schema :as lib-schema]
-            [clojure.set :as clj-set]
+            [oc.lib.html :as lib-html]
             [taoensso.timbre :as timbre]
             [schema.core :as schema]
             [oc.storage.resources.common :as common]

(schema/defn ^:always-validate list-labels-by-org-user :- [common/Label]
  [conn org-uuid :- lib-schema/UniqueID user-id :- lib-schema/UniqueID]
  {:pre [(db-common/conn? conn)]}
  (db-common/read-resources conn table-name :org-uuid-user-id-labels [[org-uuid user-id]]))
   org-uuid :- lib-schema/UniqueID
   author :- lib-schema/Author]
  (let [ts (db-common/current-timestamp)]
    (-> {primary-key (db-common/unique-id)}
        (assoc :created-at ts)
        (assoc :updated-at ts)
        (assoc :org-uuid org-uuid)
        (assoc :name label-name)
        (clean-input)
        (assoc :slug (slug/slugify label-name)) ;; Will be adjusted later during save
        (assoc :author author)
        (assoc :used-by [{:user-id (:user-id author) :count 0}]))))

(schema/defn ^:always-validate create-label!
  "
