progress on bugs
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
conj
|
||||
[]
|
||||
transaction_ids)
|
||||
transaction-rule (update (tr/get-by-id transaction_rule_id) :transaction-rule/description #(some-> % re-pattern))]
|
||||
transaction-rule (update (tr/get-by-id transaction_rule_id) :transaction-rule/description #(some-> % rm/->pattern))]
|
||||
(doseq [transaction transactions]
|
||||
(when (not (rm/rule-applies? transaction transaction-rule))
|
||||
(throw (ex-info "Transaction rule does not apply" {:validation-error "Transaction rule does not apply"
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
[auto-ap.datomic.transaction-rules :as tr]
|
||||
[clojure.tools.logging :as log]))
|
||||
|
||||
(defn ->pattern [x]
|
||||
(. java.util.regex.Pattern (compile x java.util.regex.Pattern/CASE_INSENSITIVE)))
|
||||
|
||||
(defn rule-applies? [transaction {:keys [:transaction-rule/description
|
||||
:transaction-rule/dom-gte :transaction-rule/dom-lte
|
||||
:transaction-rule/amount-gte :transaction-rule/amount-lte
|
||||
@@ -83,8 +86,7 @@
|
||||
(recur rules)))
|
||||
[])))
|
||||
|
||||
(defn ->pattern [x]
|
||||
(. java.util.regex.Pattern (compile x java.util.regex.Pattern/CASE_INSENSITIVE)))
|
||||
|
||||
|
||||
(defn group-rules-by-priority [rules]
|
||||
(->> rules
|
||||
|
||||
Reference in New Issue
Block a user