supports yodlee manual import.
This commit is contained in:
@@ -22,9 +22,9 @@
|
||||
(and company-id bank-account-id amount)
|
||||
|
||||
(let [matching-checks (checks/get-graphql {:company-id company-id
|
||||
:bank-account-id bank-account-id
|
||||
:amount amount
|
||||
:status "pending"})]
|
||||
:bank-account-id bank-account-id
|
||||
:amount (- amount)
|
||||
:status "pending"})]
|
||||
(if (= 1 (count matching-checks))
|
||||
(:id (first matching-checks))
|
||||
nil))
|
||||
@@ -48,14 +48,19 @@
|
||||
description-simple :simple} :description
|
||||
{merchant-id :i
|
||||
merchant-name :name} :merchant
|
||||
base-type :baseType
|
||||
type :type
|
||||
status :status}
|
||||
transaction
|
||||
amount (if (= "DEBIT" base-type)
|
||||
(- amount)
|
||||
amount)
|
||||
check-number (extract-check-number transaction)
|
||||
company-id (yodlee-account-id->company account-id)
|
||||
bank-account-id (yodlee-account-id->bank-account-id account-id)
|
||||
check-id (transaction->check-id transaction check-number company-id bank-account-id amount)
|
||||
]]
|
||||
(println transaction)
|
||||
|
||||
(try
|
||||
(transactions/upsert!
|
||||
@@ -88,8 +93,9 @@
|
||||
|
||||
(mapcat (fn [transaction-group]
|
||||
(map
|
||||
(fn [index {:keys [date description-original high-level-category amount] :as transaction}]
|
||||
(fn [index {:keys [date description-original high-level-category amount account-id] :as transaction}]
|
||||
{:id (str date "-" description-original "-" amount "-" index)
|
||||
|
||||
:date (time/unparse date "YYYY-MM-dd")
|
||||
:amount {:amount amount}
|
||||
:description {:original description-original
|
||||
|
||||
Reference in New Issue
Block a user