bank accounts can now have locations.

This commit is contained in:
Bryce Covert
2019-06-04 07:08:10 -07:00
parent cf2319b681
commit 7ac17c9cbc
13 changed files with 90 additions and 18 deletions

View File

@@ -11,7 +11,8 @@
[auto-ap.datomic.clients :as d-clients]
[auto-ap.time :as time]
[auto-ap.datomic.transaction-rules :as tr]
[auto-ap.rule-matching :as rm]))
[auto-ap.rule-matching :as rm]
[clojure.string :as str]))
@@ -77,7 +78,7 @@
bank-account-id (:db/id bank-account)
client (:client/_bank-accounts bank-account)
client-id (:db/id client)
valid-locations (:client/locations client)
valid-locations (or (:bank-account/locations bank-account) (:client/locations client))
check (transaction->payment transaction check-number client-id bank-account-id amount id)]
:when (and client-id
(not (existing (sha-256 (str id)))))]
@@ -87,7 +88,8 @@
:id (sha-256 (str id))
:account-id account-id
:date (coerce/to-date (time/parse date "YYYY-MM-dd"))
:yodlee-merchant (when (and merchant-id merchant-name)
:yodlee-merchant (when (and merchant-id merchant-name (not (str/blank? merchant-id)))
{:yodlee-merchant/yodlee-id merchant-id
:yodlee-merchant/name merchant-name})
:amount (double amount)