        first))
 
 (defn- resolve-image
-  [context model]
+  [model context]
   (update-in model [:image-id] #(:id (find-image context %))))
+
+(defn- create-import
+  [model storage]
+  (imports/create storage model))
 
 (defn- create-imports
   [storage context imports]
   (mapv (fn [attributes]
-          (->> attributes
-               (resolve-user context)
-               (resolve-image context)
-               (imports/create storage)
-               throw-on-invalid))
+          (-> attributes
+              (resolve-user context)
+              (resolve-image context)
+              (create-import storage)
+              throw-on-invalid))
         imports))
 
 (defn- realize-imports
-  [storage context]
+  [context storage]
   (update-in context [:imports] #(create-imports storage context %)))
 
 (defn- get-commodity

       users))

(defn- realize-users
  [storage context]
  (update-in context [:users] #(create-users storage %)))

(defn- find-user

    entity))

(defn- resolve-default-commodity-ids
  [context storage]
  (update-in context
             [:entities]
             #(map (partial resolve-default-commodity-id storage context) %)))
