Make bigoli work
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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]}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user