(ns auto-ap.datomic.yodlee-merchants
  (:require
   [auto-ap.datomic :refer [conn]]
   [datomic.api :as dc]))

(defn get-merchants [_]
  ;; TODO admin?
  (->>
    (dc/q {:find  ['(pull ?e [:yodlee-merchant/name :yodlee-merchant/yodlee-id :db/id])]
           :in    ['$]
           :where [['?e :yodlee-merchant/name]]}
          (dc/db conn))
    (mapv first)))
