     (->> (select-prices s criteria)
          (map after-read))))
 
-(defn update
-  [storage-spec price]
-  (with-storage [s storage-spec]
-    (let [validated (validate s ::existing-price price)]
-      (if (validation/has-error? validated)
-        validated
-        (do
-          (->> validated
-               before-save
-               (update-price s))
-          (find-by-id s (:id price)))))))
+(def update
+  (update-fn {:update update-price
+              :before-save before-save
+              :rules-fn validation-rules
+              :find find-by-id
+              :spec ::existing-price
+              :after-read after-read
+              :coercion-rules coercion-rules}))
 
 (defn delete
   [storage-spec id]

(s/def ::existing-price (s/keys :req-un [::id ::trade-date ::price] :opt-un [::commodity-id]))

(defn- before-save
  [price]
  (update-in price [:trade-date] to-sql-date))

(defn- after-read

       before-validation
       (validation/validate spec (validation-rules storage))))

(def create
  (create-fn {:create create-price
              :before-save before-save
              :spec ::new-price
              :rules-fn validation-rules
              :coercion-rules coercion-rules}))

(defn find-by-id
  [storage-spec id]
