             [clojure.set :refer [rename-keys]]
             [clojure.reflect :refer :all]
             [clj-money.validation :as validation]
-            [clj-money.models.helpers :refer [with-storage]]
+            [clj-money.models.helpers :refer [with-storage
+                                              defcreate]]
             [clj-money.models.storage :refer [create-entity
                                               select-entities
                                               find-entity-by-id

       empty?))

(defn- before-save
  [entity]
  (cond-> entity

    (contains? entity :monitored-account-ids)
    (update-in [:monitored-account-ids] pr-str)))

(defn- validation-rules
  [storage]

  [storage spec entity]
  (validation/validate spec (validation-rules storage) entity))

(def create
  (defcreate {:before-save before-save
              :create create-entity
              :spec ::new-entity
              :rules-fn validation-rules}))

(defn select
  "Returns entities for the specified user"
