Fixes best sales date detection as well

This commit is contained in:
2023-01-21 22:55:26 -08:00
parent 6636117cf9
commit 5c26447d4c

View File

@@ -471,7 +471,7 @@
(log/info ::transforming-settlements)
(try
(->> (for [settlement settlements
:let [best-sales-date (->> (d/q '[:find ?s4 (count ?s)
:let [best-sales-date (some->> (d/q '[:find ?s4 (count ?s)
:in $ ?settlement-id
:where
[?settlement :expected-deposit/external-id ?settlement-id]
@@ -553,7 +553,7 @@
(apply de/zip
(for [square-location (:client/square-locations client)
:when (:square-location/client-location square-location)]
(upsert client square-location (time/plus (time/now) (time/days -7)) (time/now)))))
(upsert client square-location (time/plus (time/now) (time/days -14)) (time/now)))))
([client location start end]
(capture-context->lc
(de/chain (daily-results client location start end)