Adds support for transaction rules case insensitive search

This commit is contained in:
Bryce Covert
2021-10-11 17:47:05 -07:00
parent 4a405714c1
commit d20ae49e39
6 changed files with 24 additions and 2138 deletions

View File

@@ -3,7 +3,8 @@
[auto-ap.datomic :refer [uri merge-query apply-sort-3 apply-pagination add-sorter-fields]]
[auto-ap.graphql.utils :refer [limited-clients]]
[clojure.set :refer [rename-keys]]
[clj-time.coerce :as c]))
[clj-time.coerce :as c]
[clojure.string :as str]))
(defn <-datomic [result]
result)
@@ -52,6 +53,12 @@
:where ['[?e :transaction-rule/vendor ?vendor-id]]}
:args [(:vendor-id args)]})
(not (str/blank? (:note args)))
(merge-query {:query {:in ['?note-pattern]
:where ['[?e :transaction-rule/note ?n]
'[(re-find ?note-pattern ?n)]]}
:args [(re-pattern (str "(?i)" (:note args)))]})
true
(merge-query {:query {:find ['?e]
:where ['[?e :transaction-rule/transaction-approval-status]]}}))]

View File

@@ -626,7 +626,8 @@
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}
:asc {:type 'Boolean}}
:asc {:type 'Boolean}
:note {:type 'String}}
:resolve :get-transaction-rule-page}
:ledger_page {:type :ledger_page