Implements a failover date for plaid
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
|
|
||||||
(defn plaid->transaction [t plaid-merchant->vendor-id]
|
(defn plaid->transaction [t plaid-merchant->vendor-id]
|
||||||
|
(alog/info ::trying-transaction :transaction t)
|
||||||
(cond-> #:transaction {:description-original (:name t)
|
(cond-> #:transaction {:description-original (:name t)
|
||||||
:raw-id (:transaction_id t)
|
:raw-id (:transaction_id t)
|
||||||
:db/id (random-tempid)
|
:db/id (random-tempid)
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
:amount (if (= "credit" (:type (:account 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 (:authorized_date t) atime/iso-date))
|
:date (coerce/to-date (atime/parse (or (:authorized_date t) (:date t)) atime/iso-date))
|
||||||
:status "POSTED"}
|
:status "POSTED"}
|
||||||
(:merchant_name t) (assoc :transaction/plaid-merchant {:plaid-merchant/name (:merchant_name t)
|
(:merchant_name t) (assoc :transaction/plaid-merchant {:plaid-merchant/name (:merchant_name t)
|
||||||
:db/id (random-tempid)})
|
:db/id (random-tempid)})
|
||||||
|
|||||||
Reference in New Issue
Block a user