             [clj-money.partitioning :refer [table-name
                                             tables-for-range]]
             [clj-money.models.storage :refer [Storage]])
-  (:import java.sql.BatchUpdateException))
+  (:import [java.sql BatchUpdateException
+                     Date]))
 
 (defn- id-criteria?
   [value]

(s/def ::commodity-criteria (s/keys :req-un [::entity-id]))
(s/def ::image-criteria (s/keys :req-un [::user-id]))

(defn- price-criteria-selector
  [criteria]
  (cond


(defmulti price-criteria price-criteria-selector)
(defmethod price-criteria :commodity-id [_]
  (s/keys :req-un [::commodity-id ::trade-date]))
(defmethod price-criteria :id [_]
  (s/keys :req-un [::id ::trade-date]))
(defmethod price-criteria :entity-id [_]
  (s/keys :req-un [::entity-id ::trade-date]))
(s/def ::price-criteria (s/multi-spec price-criteria price-criteria-selector))

(defmulti attachment-criteria #(contains? % :id))
