payments ssr

voiding

supports bulk void.

exact match id linking

voidnig payments works.

minor tweak.
This commit is contained in:
2024-02-09 17:32:34 -08:00
parent 7b622b945a
commit d73a3153bb
27 changed files with 1160 additions and 290 deletions

View File

@@ -1,16 +1,18 @@
(ns auto-ap.graphql.utils
(:require [clojure.string :as str]
[auto-ap.datomic :refer [conn]]
[clj-time.coerce :as coerce]
(:require [auto-ap.datomic :refer [conn]]
[auto-ap.logging :as alog]
[auto-ap.time :as atime]
[buddy.auth :refer [throw-unauthorized]]
[datomic.api :as dc]
[iol-ion.query :refer [entid]]
[clojure.walk :as walk]
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
[com.brunobonacci.mulog :as mu]
[cheshire.core :as cheshire]
[clj-time.coerce :as coerce]
[clojure.set :as set]
[auto-ap.logging :as alog]))
[clojure.string :as str]
[clojure.walk :as walk]
[com.brunobonacci.mulog :as mu]
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
[datomic.api :as dc]
[hiccup2.core :as hiccup]
[iol-ion.query :refer [entid]]))
(defn snake->kebab [s]
@@ -192,3 +194,19 @@
(if (seq extra-client-ids)
(set/intersection user-client-ids extra-client-ids)
user-client-ids)))
(defn exception->notification [f]
(try
(f)
(catch Throwable e
(throw (ex-info (.getMessage e)
{:type :notification}
e)))))
(defn notify-if-locked [client-id date]
(try
(assert-not-locked client-id date)
(catch Exception e
(throw (ex-info (.getMessage e)
{:type :notification}
e)))))