intuit import button and sysco importing.
This commit is contained in:
@@ -55,6 +55,11 @@
|
||||
:input-stream (io/make-input-stream (.getBytes t) {})
|
||||
:metadata {:content-type "application/text"}))
|
||||
|
||||
(defn copy-prod-refresh-token []
|
||||
(set-refresh-token (slurp (:object-content (s3/get-object
|
||||
:bucket-name "data.prod.app.integreatconsult.com"
|
||||
:key "intuit/refresh-token")))))
|
||||
|
||||
(defn init-tokens [access refresh]
|
||||
(set-access-token access)
|
||||
(set-refresh-token refresh))
|
||||
|
||||
@@ -25,6 +25,18 @@
|
||||
[?iab :intuit-bank-account/external-id ?external-id]]
|
||||
db #_client-whitelist)))
|
||||
|
||||
|
||||
(defn allow-once [f]
|
||||
(let [in-progress? (atom false)]
|
||||
(fn []
|
||||
(println in-progress?)
|
||||
(when (= false @in-progress?)
|
||||
(try
|
||||
(reset! in-progress? true)
|
||||
(f)
|
||||
(finally
|
||||
(reset! in-progress? false)))))))
|
||||
|
||||
(defn upsert-transactions []
|
||||
(let [db (d/db conn)
|
||||
import-id (y/start-import :import-source/intuit "Automated Intuit User")
|
||||
@@ -56,7 +68,7 @@
|
||||
:import-batch/suppressed (count (:suppressed result))}))))))
|
||||
(y/finish-import (assoc @stats :db/id import-id))))
|
||||
|
||||
|
||||
(def upsert-transactions (allow-once upsert-transactions))
|
||||
|
||||
|
||||
(defn dry-run-upsert-transactions []
|
||||
|
||||
Reference in New Issue
Block a user