makes requirement of exact match.

This commit is contained in:
2023-04-04 16:32:12 -07:00
parent b8d14233b5
commit 37995536d5
3 changed files with 13 additions and 4 deletions

View File

@@ -121,6 +121,16 @@
first)]
(or fuzzy-match client-word-match))))
(defn exact-match
([clients invoice-client-name]
(->> clients
(filter (fn [{:keys [:client/matches :client/name] :as client :or {matches []}}]
(seq
(filter (fn [m]
(= (.toLowerCase invoice-client-name) (.toLowerCase m)))
(conj matches name)))))
first)))
(defn best-location-match [client text full-text]
(or (->> client
:client/location-matches