Make bigoli work

This commit is contained in:
2024-10-24 23:26:59 -07:00
parent e3fe08ce9f
commit 7e890cebee
3 changed files with 12 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@@ -64,12 +64,13 @@
(defmulti parse-file (fn [_ filename] (.toLowerCase (last (str/split filename #"\." )))))
(defn invoke-glimpse2 [f]
(-> (lambda/invoke {:function-name "glimpse2" :payload
(json/write-str
(alog/peek ::x {"url" (str "https://" "data.prod.app.integreatconsult.com" "/" f ) }))})
:payload
slurp
json/read-str))
(let [result (slurp (:payload (lambda/invoke {:function-name "glimpse2" :payload
(json/write-str
(alog/peek ::x {"url" (str "https://" "data.prod.app.integreatconsult.com" "/" f ) }))})))]
(alog/info ::glimpse2-payload :payload result)
(-> result
json/read-str)))
(defn glimpse2 [file]
(try

View File

@@ -170,10 +170,10 @@
;; GOLDEN BRANDS
{:vendor "Bigoli Fresh Pasta"
:keywords [#"bigolifreshpasta.com"]
:extract {:date #"INVOICE #.*?\n.*?([0-9]+/[0-9]+/[0-9]+)" ;; HOW TO GO TO SPCIFIC LINE
:customer-identifier #"BILL TO.*\n\s+(.*?)\s{2,}"
:invoice-number #"INVOICE #.*?\n(\d+)"
:total #" TOTAL\s+([0-9,]+\.[0-9]{2})"}
:extract {:date #"Invoice Date.*?([0-9]+/[0-9]+/[0-9]+)" ;; HOW TO GO TO SPCIFIC LINE
:customer-identifier #"BILL TO.*\n\s*(.*?)\s{2,}"
:invoice-number #"Invoice #.*?(\d+)"
:total #" BALANCE DUE\s+(?:\$)?([0-9,]+\.[0-9]{2})"}
:parser {:date [:clj-time "MM/dd/yyyy"]
:total [:trim-commas nil]}}