makes plaid really usable, allowing choosing on bank screen, and searchable on vendors page.
This commit is contained in:
@@ -25,16 +25,18 @@
|
||||
|
||||
|
||||
(defn plaid->transaction [t]
|
||||
#:transaction {:description-original (:name t)
|
||||
:raw-id (:transaction_id t)
|
||||
:db/id (random-tempid)
|
||||
:id #_{:clj-kondo/ignore [:unresolved-var]}
|
||||
(di/sha-256 (:transaction_id t))
|
||||
:amount (if (= "credit" (:type (:account t)))
|
||||
(- (double (:amount t)))
|
||||
(double (:amount t)))
|
||||
:date (coerce/to-date (atime/parse (:authorized_date t) atime/iso-date))
|
||||
:status "POSTED"})
|
||||
(cond-> #:transaction {:description-original (:name t)
|
||||
:raw-id (:transaction_id t)
|
||||
:db/id (random-tempid)
|
||||
:id #_{:clj-kondo/ignore [:unresolved-var]}
|
||||
(di/sha-256 (:transaction_id t))
|
||||
:amount (if (= "credit" (:type (:account t)))
|
||||
(- (double (:amount t)))
|
||||
(double (:amount t)))
|
||||
:date (coerce/to-date (atime/parse (:authorized_date t) atime/iso-date))
|
||||
:status "POSTED"}
|
||||
(:merchant_name t) (assoc :transaction/plaid-merchant {:plaid-merchant/name (:merchant_name t)
|
||||
:db/id (random-tempid)})))
|
||||
|
||||
|
||||
(defn import-plaid-int []
|
||||
@@ -53,6 +55,7 @@
|
||||
:account
|
||||
(accounts-by-id (:account_id transaction))))
|
||||
:transaction/bank-account bank-account-id
|
||||
|
||||
:transaction/client client-id))))
|
||||
(t/finish! import-batch)
|
||||
(catch Exception e
|
||||
|
||||
Reference in New Issue
Block a user