Merge branch 'staging' into add-scheduled-payment-filter

This commit is contained in:
Bryce Covert
2021-01-11 12:09:10 -08:00
7 changed files with 73 additions and 40 deletions

View File

@@ -3,7 +3,8 @@
[auto-ap.datomic :refer [uri merge-query apply-sort-3 apply-pagination add-sorter-fields conn]]
[auto-ap.graphql.utils :refer [limited-clients]]
[clj-time.coerce :as c]
[clj-time.coerce :as coerce]))
[clj-time.coerce :as coerce]
[clojure.tools.logging :as log]))
(defn sort-fn [sort-by]
(cond
@@ -102,7 +103,8 @@
:args [(:location args)]})
(:unresolved args)
(merge-query {:query {:where ['(or-join [?e]
(merge-query {:query {:where ['[?e :transaction/date]
'(or-join [?e]
(not [?e :transaction/accounts])
(and [?e :transaction/accounts ?tas]
(not [?tas :transaction-account/account])))]}})
@@ -136,6 +138,7 @@
(merge-query {:query {:find ['?sort-default '?e]
:where ['[?e :transaction/id]
'[?e :transaction/date ?sort-default]]}}))]
(log/info "query is" query)
(cond->> query
true (d/query)
true (apply-sort-3 args)

View File

@@ -1187,7 +1187,8 @@
month (range -1 7)
:let [next (t/plus (t/local-date (t/year (time/local-now))
(t/month (time/local-now))
day-of-month )
(Math/min (Math/max day-of-month 1)
30) )
(t/months month))]
:when (not (has-fulfilled? id next recent-fulfillments))]
{:identifier identifier

View File

@@ -31,8 +31,7 @@
:input-stream (io/make-input-stream raw-bytes {})
:metadata {:content-type "image/jpeg"}
:canned-acl "public-read")
(str "https://integreat-signature-images.s3.amazonaws.com/" signature-id ".jpg")
))))
(str "https://integreat-signature-images.s3.amazonaws.com/" signature-id ".jpg")))))
(defn edit-client [context {:keys [edit_client new_bank_accounts] :as args} value]
(assert-admin (:id context))

View File

@@ -279,20 +279,23 @@
([client-code provider-accounts]
(let [accounts (get-accounts-for-providers (client-code->login client-code) (map :id provider-accounts))]
(map (fn [pa]
{:yodlee-provider-account/id (:id pa)
:yodlee-provider-account/status (:status pa)
:yodlee-provider-account/detailed-status (-> pa :dataset first :additionalStatus)
:yodlee-provider-account/client [:client/code client-code]
:yodlee-provider-account/last-updated (-> pa :dataset first :lastUpdated coerce/to-date)
:yodlee-provider-account/accounts (mapv
(fn [a]
{:yodlee-account/id (:id a)
:yodlee-account/name (str (:providerName a) " (" (:accountName a) ")")
:yodlee-account/number (:accountNumber a)
:yodlee-account/status (-> a :dataset first :additionalStatus)
:yodlee-account/available-balance (or (-> a :currentBalance :amount)
0.0)})
(get accounts (:id pa)))})
(cond->
{:yodlee-provider-account/id (:id pa)
:yodlee-provider-account/status (:status pa)
:yodlee-provider-account/detailed-status (-> pa :dataset first :additionalStatus)
:yodlee-provider-account/client [:client/code client-code]
:yodlee-provider-account/accounts (mapv
(fn [a]
{:yodlee-account/id (:id a)
:yodlee-account/name (str (:providerName a) " (" (:accountName a) ")")
:yodlee-account/number (:accountNumber a)
:yodlee-account/status (-> a :dataset first :additionalStatus)
:yodlee-account/available-balance (or (-> a :currentBalance :amount)
0.0)})
(get accounts (:id pa)))}
(-> pa :dataset first :lastUpdated) (assoc :yodlee-provider-account/last-updated (-> pa :dataset first :lastUpdated coerce/to-date)) ))
provider-accounts))))
(defn refresh-provider-account [client-code id]