diff --git a/src/clj/auto_ap/graphql/transaction_rules.clj b/src/clj/auto_ap/graphql/transaction_rules.clj index f703bb4e..4c3064f3 100644 --- a/src/clj/auto_ap/graphql/transaction_rules.clj +++ b/src/clj/auto_ap/graphql/transaction_rules.clj @@ -55,6 +55,10 @@ (assert-admin (:id context)) (let [existing-transaction (tr/get-by-id id) account-total (reduce + 0 (map (fn [x] (:percentage x)) accounts)) + _ (try + (. java.util.regex.Pattern (compile description java.util.regex.Pattern/CASE_INSENSITIVE)) + (catch Exception e + (throw (ex-info (ex-message e) {:validation-error (ex-message e)})))) _ (when-not (dollars= 1.0 account-total) (let [error (str "Account total (" account-total ") does not reach 100%")] (throw (ex-info error {:validation-error error}))))