added ability to remove a transaction rule.
This commit is contained in:
@@ -742,7 +742,9 @@
|
||||
:approval_status {:type :transaction_approval_status}}
|
||||
|
||||
:resolve :mutation/unapprove-transactions}
|
||||
|
||||
:delete_transaction_rule {:type :id
|
||||
:args {:transaction_rule_id {:type :id}}
|
||||
:resolve :mutation/delete-transaction-rule}
|
||||
:merge_vendors {:type :id
|
||||
:args {:from {:type :id}
|
||||
:to {:type :id}}
|
||||
@@ -1060,6 +1062,7 @@
|
||||
:get-client gq-clients/get-client
|
||||
:get-user get-user
|
||||
:mutation/add-handwritten-check gq-checks/add-handwritten-check
|
||||
:mutation/delete-transaction-rule gq-transaction-rules/delete-transaction-rule
|
||||
:mutation/print-checks print-checks
|
||||
:mutation/reject-invoices gq-invoices/reject-invoices
|
||||
:mutation/approve-invoices gq-invoices/approve-invoices
|
||||
|
||||
@@ -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