fixes issues with a neverending search. Also fixes client saving to match normal test.

This commit is contained in:
2023-03-24 13:01:33 -07:00
parent 7fd3528d0f
commit 4f94602716
8 changed files with 112 additions and 87 deletions

View File

@@ -3,6 +3,7 @@
[amazonica.aws.s3 :as s3]
[auto-ap.datomic :refer [audit-transact conn]]
[auto-ap.datomic.clients :as d-clients]
[iol-ion.tx :refer [upsert-entity]]
[auto-ap.graphql.utils
:refer [->graphql
assert-admin
@@ -21,7 +22,8 @@
[unilog.context :as lc]
[mount.core :as mount]
[yang.scheduler :as scheduler]
[iol-ion.tx :refer [random-tempid]])
[iol-ion.tx :refer [random-tempid]]
[com.brunobonacci.mulog :as mu])
(:import
(java.util UUID)
(org.apache.commons.codec.binary Base64)))
@@ -99,7 +101,7 @@
:email-contact/description (:description e)})
(:emails edit_client))
:client/feature-flags (:feature_flags edit_client)
:client/feature-flags (:feature_flags edit_client)
:client/ezcater-locations (map
(fn [el]
{:db/id (or (:id el) (random-tempid))
@@ -112,14 +114,15 @@
(map (fn [lm] {:db/id (or (:id lm ) (random-tempid))
:location-match/location (:location lm)
:location-match/matches [(:match lm)]})))
:client/address {:db/id (or (:id (:address edit_client)) (random-tempid))
:address/street1 (:street1 (:address edit_client))
:address/street2 (:street2 (:address edit_client))
:address/city (:city (:address edit_client))
:address/state (:state (:address edit_client))
:address/zip (:zip (:address edit_client))}
:client/address (when (seq (filter identity (vals (:address edit_client))))
{:db/id (or (:id (:address edit_client)) (random-tempid))
:address/street1 (:street1 (:address edit_client))
:address/street2 (:street2 (:address edit_client))
:address/city (:city (:address edit_client))
:address/state (:state (:address edit_client))
:address/zip (:zip (:address edit_client))})
:client/bank-accounts (map (fn [ba]
{:db/id (:id ba)
{:db/id (or (:id ba) (random-tempid))
:bank-account/code (:code ba)
:bank-account/bank-name (:bank_name ba)
:bank-account/bank-code (:bank_code ba)
@@ -145,6 +148,7 @@
(:bank_accounts edit_client))
}
_ (mu/log ::upserting :up updated-entity)
_ (assert-no-shared-transaction-sources client-code [`(upsert-entity ~updated-entity)])
_ (log/info "upserting client" updated-entity)