adding some safety checks to not continue matching indefinitely.

This commit is contained in:
Bryce Covert
2019-04-24 06:54:29 -07:00
parent b9b0147d7c
commit deef4eb4a4
3 changed files with 12 additions and 8 deletions

View File

@@ -359,7 +359,7 @@
(defn void-check [context {id :payment_id} value]
(let [check (d-checks/get-by-id id)]
(assert (or (= :payment-status/pending (:payment/status check))
(#{:payment-type/cash :payment-type/debit} (:payment/type check))))
(#{:payment-type/cash} (:payment/type check))))
(assert-can-see-client (:id context) (:db/id (:payment/client check)))
(let [removing-payments (mapcat (fn [x]
(let [invoice (:invoice-payment/invoice x)