(ns find-bad-expense-accounts)

(require '[auto-ap.expense-accounts :as ea])

(let [accounts (-> (set (filter #(= 0 (mod % 100)) (keys ea/expense-accounts)))
                   (disj 2200)
                   (disj 2300)
                   (disj 3100)
                   (disj 3200)
                   (disj 3400))]

  (doseq [x accounts  
          :let [c (d/query {:query {:find ['(pull ?e [*])]
                                    :in ['$ '?x]
                                    :where ['[?e :invoice-expense-account/expense-account-id ?x]]}
                            :args [(d/db (d/connect uri)) x]})]]
    
    (if (> (count c ) 0)
      (clojure.pprint/pprint [x c]))))
