Makes imports more resilient

This commit is contained in:
Bryce
2023-05-24 08:45:26 -07:00
parent 693674ac3a
commit d6b3048ff0
3 changed files with 6 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
[amazonica.aws.s3 :as s3]
[auto-ap.datomic :refer [conn]]
[auto-ap.jobs.core :refer [execute]]
[auto-ap.datomic :refer [audit-transact]]
[auto-ap.datomic :refer [audit-transact random-tempid]]
[auto-ap.datomic.clients :as d-clients]
[auto-ap.datomic.invoices :refer [code-invoice]]
[auto-ap.parse :as parse]
@@ -80,6 +80,7 @@
(log/infof "Importing %s for %s" (header-row "InvoiceNumber") (header-row "CustomerName"))
(cond-> #:invoice {:invoice-number (header-row "InvoiceNumber")
:db/id (random-tempid)
:total (+ total tax)
:outstanding-balance (+ total tax)
:location (parse/best-location-match (dc/pull (dc/db conn)