Checks now have a status that gets updated
This commit is contained in:
@@ -85,3 +85,9 @@
|
||||
(defn count-graphql [args]
|
||||
(:count (first (query
|
||||
(assoc (base-graphql args) :select [:%count.*])))))
|
||||
|
||||
(defn update! [row]
|
||||
(j/update! (get-conn)
|
||||
:checks
|
||||
(-> row (fields->data) (clj->db))
|
||||
["id = ?" (:id row)]))
|
||||
|
||||
@@ -69,7 +69,8 @@
|
||||
:resolve :get-company-for-check}
|
||||
:date {:type 'String}
|
||||
:s3_url {:type 'String}
|
||||
:check_number {:type 'Int}}}
|
||||
:check_number {:type 'Int}
|
||||
:status {:type 'String}}}
|
||||
|
||||
:transaction {:fields {:id {:type 'Int}
|
||||
:amount {:type 'String}
|
||||
|
||||
@@ -52,7 +52,9 @@
|
||||
transaction
|
||||
check-number (extract-check-number transaction)
|
||||
company-id (account->company account-id)
|
||||
bank-account-id (yodlee-account-id->bank-account-id account-id)]]
|
||||
bank-account-id (yodlee-account-id->bank-account-id account-id)
|
||||
check-id (transaction->check-id transaction check-number company-id bank-account-id)
|
||||
]]
|
||||
|
||||
(try
|
||||
(transactions/upsert!
|
||||
@@ -68,7 +70,10 @@
|
||||
:company-id company-id
|
||||
:check-number check-number
|
||||
:bank-account-id (yodlee-account-id->bank-account-id account-id)
|
||||
:check-id (transaction->check-id transaction check-number company-id bank-account-id)
|
||||
:check-id check-id
|
||||
})
|
||||
(when check-id
|
||||
(checks/update! {:id check-id :status "cleared"}))
|
||||
|
||||
(catch Exception e
|
||||
(println e))))))
|
||||
|
||||
Reference in New Issue
Block a user