   (korma/table :objective8.comments)
   (korma/belongs-to user {:fk :created_by_id})
   (korma/prepare map->comment)
-  (korma/transform (unmap-with-username :comment)))
+  (korma/transform (-> (unmap :comment) with-username)))
 
 (korma/defentity question
   (korma/pk :_id)
   (korma/table :objective8.questions)
   (korma/belongs-to user {:fk :created_by_id})
   (korma/prepare map->question)
-  (korma/transform (unmap-with-username :question)))
+  (korma/transform (-> (unmap :question) with-username)))
 
 (korma/defentity answer
   (korma/pk :_id)
   (korma/table :objective8.answers)
   (korma/belongs-to user {:fk :created_by_id})
   (korma/prepare map->answer)
-  (korma/transform (unmap-with-username :answer)))
+  (korma/transform (-> (unmap :answer) with-username)))
 
 (korma/defentity invitation
   (korma/pk :_id)

  (korma/table :objective8.drafts)
  (korma/belongs-to user {:fk :submitter_id})
  (korma/prepare map->draft)
  (korma/transform (unmap-with-sql-time :draft)))

(korma/defentity bearer-token
  (korma/pk :_id)

                 :_id (:_id m)
                 :_created_at (sql-time->iso-time-string (:_created_at m)))))

(defn with-username [unmap-fn]
  (fn [m] (-> (unmap-fn m)
              (assoc :username (:username m)))))

(defn with-sql-time [unmap-fn]
  (fn [m] (-> (unmap-fn m)
              (assoc :_created_at_sql_time (:_created_at m)))))

(defn with-global-id [unmap-fn]
  (fn [m] (-> (unmap-fn m)
              (assoc :global-id (:global_id m)))))

(declare objective user comment question answer invitation candidate bearer-token up-down-vote)

