inverting plaid account settings, adding check numbers
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
[digest :as di]
|
||||
[manifold.deferred :as de]
|
||||
[manifold.executor :as ex]
|
||||
[unilog.context :as lc]))
|
||||
[unilog.context :as lc]
|
||||
[clojure.string :as str]))
|
||||
|
||||
(defn get-plaid-accounts [db]
|
||||
(-> (dc/q '[:find ?ba ?c ?external-id ?t
|
||||
@@ -36,12 +37,13 @@
|
||||
:id #_{:clj-kondo/ignore [:unresolved-var]}
|
||||
(di/sha-256 (:transaction_id t))
|
||||
:amount (if (= "credit" (:type (:account t)))
|
||||
(- (double (:amount t)))
|
||||
(double (:amount t)))
|
||||
(double (:amount t))
|
||||
(- (double (:amount t))))
|
||||
:date (coerce/to-date (atime/parse (or (:authorized_date t) (:date t)) atime/iso-date))
|
||||
:status "POSTED"}
|
||||
(:merchant_name t) (assoc :transaction/plaid-merchant {:plaid-merchant/name (:merchant_name t)
|
||||
:db/id (random-tempid)})
|
||||
(not (str/blank? (:check_number t))) (assoc :transaction/check-number (Integer/parseInt (:check_number t)))
|
||||
(plaid-merchant->vendor-id (:merchant_name t)) (assoc :transaction/default-vendor
|
||||
(plaid-merchant->vendor-id (:merchant_name t)))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user