supporting transaction automation
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
(def default-read '[*
|
||||
{:transaction-rule/client [:client/name :db/id :client/code]}
|
||||
{:transaction-rule/bank-account [*]}
|
||||
{:transaction-rule/yodlee-merchant [*]}
|
||||
{:transaction-rule/yodlee-merchant [:db/id :yodlee-merchant/name :yodlee-merchant/yodlee-id]}
|
||||
{:transaction-rule/transaction-approval-status [:db/id :db/ident]}
|
||||
{:transaction-rule/vendor [:vendor/name :db/id :vendor/default-account]}
|
||||
{:transaction-rule/accounts [:transaction-rule-account/percentage
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
(defn get-merchants [args]
|
||||
;; TODO admin?
|
||||
(let [query {:query {:find ['(pull ?e [:yodlee-merchant/name :yodlee-merchant/yodlee-id])]
|
||||
(let [query {:query {:find ['(pull ?e [:yodlee-merchant/name :yodlee-merchant/yodlee-id :db/id])]
|
||||
:in ['$]
|
||||
:where [['?e :yodlee-merchant/name]]}
|
||||
:args [(d/db (d/connect uri))]}]
|
||||
|
||||
@@ -539,6 +539,7 @@
|
||||
:note {:type 'String}
|
||||
:bank_account_id {:type :id}
|
||||
:client_id {:type :id}
|
||||
:yodlee_merchant_id {:type :id}
|
||||
:amount_lte {:type :money}
|
||||
:amount_gte {:type :money}
|
||||
:dom_lte {:type 'Int}
|
||||
@@ -851,7 +852,9 @@
|
||||
(catch Exception e
|
||||
(if-let [v (:validation-error (ex-data e))]
|
||||
(println "validation error" v)
|
||||
(println e))
|
||||
(do
|
||||
(.printStackTrace e)
|
||||
(println e )))
|
||||
|
||||
(throw e)))))
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
:account account_id
|
||||
:location location}))
|
||||
;; TODO ASSERT ADMIN
|
||||
(defn upsert-transaction-rule [context {{:keys [id description note client_id bank_account_id amount_lte amount_gte vendor_id accounts transaction_approval_status ]} :transaction_rule :as z} value]
|
||||
(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 ]} :transaction_rule :as z} value]
|
||||
#_(assert-admin (:id context))
|
||||
(let [existing-transaction (tr/get-by-id id)
|
||||
deleted (deleted-accounts existing-transaction accounts)
|
||||
@@ -53,6 +53,7 @@
|
||||
:note note
|
||||
:client client_id
|
||||
:bank-account bank_account_id
|
||||
:yodlee-merchant yodlee_merchant_id
|
||||
:amount-lte amount_lte
|
||||
:amount-gte amount_gte
|
||||
:vendor vendor_id
|
||||
|
||||
Reference in New Issue
Block a user