fixes invoice import issues, fixes issue with too many keys in s3 for general produce.

This commit is contained in:
Bryce
2023-07-19 20:37:10 -07:00
parent edf5851176
commit e08a4cd28a
4 changed files with 2444 additions and 7 deletions

View File

@@ -27,6 +27,9 @@
(str/includes? (str header) "DISCOUNT_MESSAGE")
:wismettac
(str/includes? (str header) "Status")
:ledyard
:else
nil)]
(log/info "csv type was determined to be" csv-type)
@@ -162,6 +165,23 @@
[]
(drop 1 rows)))
(defmethod parse-csv :ledyard
[rows]
(transduce
(comp
(map (fn [[invoice-number date due amount standard :as row]]
{:vendor-code "Performance Food Group - LEDYARD"
:invoice-number invoice-number
:date (some-> date not-empty (parse-date-fallover ["MM/dd/yyyy"]))
:due (some-> due not-empty (parse-date-fallover ["MM/dd/yyyy"]))
:total (str/replace amount #"[\$,]" "")
:text (str/join " " row)
:full-text (str/join " " row)}))
)
conj
[]
(drop 1 rows)))
#_{:clj-kondo/ignore [:unused-binding]}
(defmethod parse-csv nil
[rows]