critical feature - you can now unset fields.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
(:require [auto-ap.datomic.transaction-rules :as tr]
|
||||
[auto-ap.datomic.transactions :as t]
|
||||
[datomic.api :as d]
|
||||
[auto-ap.datomic :refer [remove-nils uri merge-query]]
|
||||
[auto-ap.datomic :refer [remove-nils uri merge-query replace-nils-with-retract]]
|
||||
[auto-ap.utils :refer [dollars=]]
|
||||
[auto-ap.graphql.utils :refer [->graphql <-graphql limited-clients assert-admin result->page snake->kebab]]
|
||||
[clj-time.coerce :as c]
|
||||
@@ -59,23 +59,24 @@
|
||||
(nil? yodlee_merchant_id))
|
||||
(let [error (str "You must provide a description or a yodlee merchant")]
|
||||
(throw (ex-info error {:validation-error error}))))
|
||||
transaction [(remove-nils #:transaction-rule {:db/id (if id
|
||||
id
|
||||
"transaction-rule")
|
||||
:description description
|
||||
: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
|
||||
:transaction-approval-status
|
||||
(some->> transaction_approval_status
|
||||
name
|
||||
snake->kebab
|
||||
(keyword "transaction-approval-status"))
|
||||
:accounts (map transaction-rule-account->entity accounts)})]
|
||||
transaction (replace-nils-with-retract #:transaction-rule {:db/id (if id
|
||||
id
|
||||
"transaction-rule")
|
||||
:description description
|
||||
: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
|
||||
:transaction-approval-status
|
||||
(some->> transaction_approval_status
|
||||
name
|
||||
snake->kebab
|
||||
(keyword "transaction-approval-status"))
|
||||
:accounts (map transaction-rule-account->entity accounts)}
|
||||
existing-transaction)
|
||||
|
||||
_ (println transaction)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user