handwriting checks.

This commit is contained in:
Bryce
2024-03-17 22:37:12 -07:00
parent a972df1d43
commit 8fb27d6c66
4 changed files with 269 additions and 151 deletions

View File

@@ -37,11 +37,10 @@
:bank-account/plaid-account [:plaid-account/name :db/id :plaid-account/number :plaid-account/balance]
:bank-account/intuit-bank-account [:intuit-bank-account/name :intuit-bank-account/external-id :db/id]
:bank-account/integration-status [:integration-status/message
:db/id
:integration-status/last-attempt
:integration-status/last-updated
{:integration-status/state [:db/ident]}]}
]}
:db/id
:integration-status/last-attempt
:integration-status/last-updated
{:integration-status/state [:db/ident]}]}]}
{:yodlee-provider-account/_client [*]}
{:plaid-item/_client [*]}
{:client/emails [:db/id :email-contact/email :email-contact/description]}])
@@ -61,7 +60,7 @@
(fn [bas]
(map (fn [i ba]
(-> ba
(update :bank-account/type :db/ident )
(update :bank-account/type :db/ident)
(update-in [:bank-account/integration-status :integration-status/state] :db/ident)
(update-in [:bank-account/integration-status :integration-status/last-attempt] #(some-> % coerce/to-date-time))
(update-in [:bank-account/integration-status :integration-status/last-updated] #(some-> % coerce/to-date-time))
@@ -71,9 +70,9 @@
(defn get-all []
(->> (dc/q '[:find (pull ?e r)
:in $ r
:where [?e :client/name]]
(dc/db conn)
full-read)
:where [?e :client/name]]
(dc/db conn)
full-read)
(map first)
(map cleanse)))
@@ -98,23 +97,23 @@
(map cleanse)))
(defn get-by-id [id]
(->>
(dc/pull (dc/db conn )
full-read
id)
(->>
(dc/pull (dc/db conn)
full-read
id)
(cleanse)))
(defn code->id [code]
(->>
(->>
(dc/q '[:find ?e
:in $ ?code
:where [?e :client/code ?code]]
:in $ ?code
:where [?e :client/code ?code]]
(dc/db conn) code)
(first)
(first)))
(defn best-match [identifier]
(when (and identifier (not-empty identifier))
(when (and identifier (not-empty identifier))
(some-> (solr/query solr/impl "clients"
{"query" (format "_text_:\"%s\"" (str/upper-case (solr/escape identifier)))
"fields" "id"})
@@ -126,7 +125,7 @@
(defn exact-match [identifier]
(when (and identifier (not-empty identifier))
(when (and identifier (not-empty identifier))
(some-> (solr/query solr/impl "clients"
{"query" (format "exact:\"%s\"" (str/upper-case (solr/escape identifier)))
"fields" "id"})
@@ -149,7 +148,6 @@
"code" (:client/code result)
"exact" (map str/upper-case matches)})))
(defn raw-graphql-ids [db args]
(let [name-like-ids (cond (not (str/blank? (:name-like args)))
(set (map (comp #(Long/parseLong %) :id)
@@ -172,24 +170,24 @@
matching-ids)
(set (map :db/id (:clients args))))
query (cond-> {:query {:find []
:in ['$ ]
:in ['$]
:where []}
:args [db]}
valid-ids
(merge-query {:query {:in ['[?e ...]]}
:args [(set valid-ids)]})
(:sort args) (add-sorter-fields {"name" ['[?e :client/name ?sort-name]]}
args)
true
(merge-query {:query {:find ['?sort-default '?e] :where ['[?e :client/name ?sort-default]]}}))]
(->> (query2 query)
(apply-sort-3 (update args :sort conj {:sort-key "default-2" :asc true}))
(apply-pagination args))))
(apply-sort-3 (update args :sort conj {:sort-key "default-2" :asc true}))
(apply-pagination args))))
(defn graphql-results [ids db args]
(let [results (->> (pull-many db full-read
@@ -201,6 +199,6 @@
(defn get-graphql-page [args]
(let [db (dc/db conn)
{ids-to-retrieve :ids matching-count :count} (raw-graphql-ids db args)]
[(->> (graphql-results ids-to-retrieve db args))
matching-count]))