added ability to remove a transaction rule.
This commit is contained in:
@@ -45,6 +45,15 @@
|
||||
:account account_id
|
||||
:location location}))
|
||||
|
||||
(defn delete-transaction-rule [context {:keys [transaction_rule_id ]} value]
|
||||
(assert-admin (:id context))
|
||||
(let [existing-transaction-rule (tr/get-by-id transaction_rule_id)]
|
||||
(when-not (:transaction-rule/description existing-transaction-rule)
|
||||
(throw (ex-info "Transaction rule not found" {:validation-error "Transaction Rule not found"})))
|
||||
|
||||
@(d/transact (d/connect uri) [[:db/retractEntity transaction_rule_id]])
|
||||
transaction_rule_id))
|
||||
|
||||
(defn upsert-transaction-rule [context {{:keys [id description yodlee_merchant_id note client_id bank_account_id amount_lte amount_gte vendor_id accounts transaction_approval_status dom_gte dom_lte]} :transaction_rule :as z} value]
|
||||
(assert-admin (:id context))
|
||||
(let [existing-transaction (tr/get-by-id id)
|
||||
|
||||
Reference in New Issue
Block a user