(cloud) fixes issues encountered in testing.

This commit is contained in:
2023-04-24 21:05:54 -07:00
parent 69eaf42eda
commit 8dae0fde10
11 changed files with 129 additions and 52 deletions

View File

@@ -57,3 +57,14 @@
(or (= "admin" (:user/role identity))
((set (map :db/id (:user/clients identity))) (:db/id client))
((set (map :db/id (:user/clients identity))) client)))
(defn ->pattern [x]
(. java.util.regex.Pattern (compile x java.util.regex.Pattern/CASE_INSENSITIVE)))
(defn dom [^java.util.Date x]
(-> x
(.toInstant)
(.atZone (java.time.ZoneId/of "US/Pacific"))
(.get java.time.temporal.ChronoField/DAY_OF_MONTH)))

View File

@@ -376,7 +376,7 @@
(defn upsert-transaction [db transaction]
;; because some transactions will reference temp ids, you have to dissoc them, like :transaction/payment
(let [upserted-entity (upsert-entity db (dissoc transaction :transaction/payment))
(let [upserted-entity (upsert-entity db (dissoc transaction :transaction/payment :import-batch/_entry))
with-transaction (try (dc/with db {:tx-data upserted-entity})
(catch ClassCastException e
(println "Dev local does not support with in tx functions. :(")