yodlee and invoice.

This commit is contained in:
2022-01-15 10:43:48 -08:00
parent 3ec3718548
commit 1f96868ee1
4 changed files with 11 additions and 8 deletions

View File

@@ -230,7 +230,7 @@
(defn import-uploaded-invoice [user imports]
(lc/with-context {:area "upload-invoice"}
(log/info "Number of invoices to import is" (count imports) "sample: " (first imports))
(log/info "Number of invoices to import is" (count imports) )
(let [clients (d-clients/get-all)
potential-invoices (->> imports
(mapv #(import->invoice % clients))
@@ -240,7 +240,7 @@
(mapv (fn [i] [:propose-invoice i])))]
(when-not (seq potential-invoices)
(throw (ex-info "No new invoices found."
{:imports (str (vec imports))})))
{})))
(log/info "creating invoice" potential-invoices)
@(d/transact (d/connect uri) potential-invoices))))
@@ -425,7 +425,7 @@
:headers {"Content-Type" "application/edn"}}
(catch Exception e
(log/warn e)
{:status 500
{:status 400
:body (pr-str {:message (.getMessage e)
:error (.toString e)
:data (ex-data e)})