From 7336398f9db546a2a6068469bc77b23b33b389d9 Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 25 Jul 2023 09:38:58 -0700 Subject: [PATCH] Implements a failover date for plaid --- src/clj/auto_ap/import/plaid.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/import/plaid.clj b/src/clj/auto_ap/import/plaid.clj index 76756015..c07ec23a 100644 --- a/src/clj/auto_ap/import/plaid.clj +++ b/src/clj/auto_ap/import/plaid.clj @@ -29,6 +29,7 @@ (defn plaid->transaction [t plaid-merchant->vendor-id] + (alog/info ::trying-transaction :transaction t) (cond-> #:transaction {:description-original (:name t) :raw-id (:transaction_id t) :db/id (random-tempid) @@ -37,7 +38,7 @@ :amount (if (= "credit" (:type (:account 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"} (:merchant_name t) (assoc :transaction/plaid-merchant {:plaid-merchant/name (:merchant_name t) :db/id (random-tempid)})