Adds ezcater fikes.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
[clojure.string :as str]
|
||||
[clojure.data.json :as json]
|
||||
[clj-time.coerce :as coerce]
|
||||
[clojure.tools.logging :as log]
|
||||
[clj-time.core :as time]
|
||||
[clojure.set :as set]
|
||||
[auto-ap.time :as atime]
|
||||
@@ -95,6 +94,7 @@
|
||||
:eventKey 'cancelled}}
|
||||
[[:subscription [:parentId :parentEntity :eventEntity :eventKey]]]]]})))))
|
||||
|
||||
|
||||
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
|
||||
(defn upsert-ezcater
|
||||
([] (upsert-ezcater (get-integrations)))
|
||||
@@ -108,7 +108,8 @@
|
||||
:integration-status/last-updated (coerce/to-date (time/now))})
|
||||
|
||||
(catch Exception e
|
||||
(log/warn e)
|
||||
(alog/warn ::cant-upsert-ezcater
|
||||
:exception e)
|
||||
(mark-integration-status integration {:integration-status/state :integration-state/failed
|
||||
:integration-status/message (.getMessage e)}))))))
|
||||
|
||||
@@ -277,6 +278,7 @@
|
||||
(update-in [:sales-order/charges 0 :charge/date] coerce/to-date))])))
|
||||
|
||||
(defn upsert-recent []
|
||||
(upsert-ezcater)
|
||||
(let [last-sunday (coerce/to-date (time/plus (second (->> (time/today)
|
||||
(iterate #(time/plus % (time/days -1)))
|
||||
(filter #(= 7 (time/day-of-week %)))))
|
||||
@@ -293,7 +295,8 @@
|
||||
[?c2 :ezcater-caterer/uuid ?uuid]]
|
||||
(d/db conn)
|
||||
last-sunday)
|
||||
:let [_ (log/info "Considering updating " order)
|
||||
:let [_ (alog/info ::considering
|
||||
:order order)
|
||||
id (last (str/split order #"/"))
|
||||
id (str/join "-" (drop 2 (str/split order #"-")))
|
||||
lookup-map {"id" "bf3dcf5c-a68f-42d9-9084-049133e03d3d",
|
||||
@@ -341,7 +344,8 @@
|
||||
:when (not= updated-order extant-order)]
|
||||
|
||||
updated-order))]
|
||||
(log/info "Found these orders to update:" orders-to-update)
|
||||
(alog/info :found-orders-to-update
|
||||
:orders orders-to-update)
|
||||
@(d/transact conn orders-to-update)))
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"/active" {:put :active-client}
|
||||
"/1099" :company-1099
|
||||
"/1099/table" {:get :company-1099-vendor-table}
|
||||
"/1099/vendor-dialog" {["/" [#"\d+" :vendor-id]] {:get :company-1099-vendor-dialog
|
||||
"/1099/vendor-dialog" {["/" [#"\d+" :vendor-id]] {:get :company-1099-vendor-dialog
|
||||
:post :company-1099-vendor-save}}}})
|
||||
|
||||
|
||||
|
||||
@@ -45,6 +45,29 @@
|
||||
;; this catches an error where you choose a parameter, change to invoices page, then change to voided invoices
|
||||
(println "Error!" e)))))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::unset-selected
|
||||
(fn [cofx [_ params suppress]]
|
||||
(let [checked @(re-frame/subscribe [::data-page/checked ::page])
|
||||
checked-params (get checked "header")
|
||||
specific-transactions (map :id (vals (dissoc checked "header")))]
|
||||
{:db (-> (:db cofx)
|
||||
(assoc-in [:status :loading] true))
|
||||
:graphql {:token (-> cofx :db :user)
|
||||
:owns-state {:single ::delete-selected}
|
||||
:query-obj
|
||||
{:venia/operation {:operation/type :mutation
|
||||
:operation/name "DeleteTransactions"}
|
||||
:venia/queries [{:query/data
|
||||
[:delete-transactions
|
||||
{:filters (some-> checked-params data-params->query-params)
|
||||
:ids specific-transactions
|
||||
:suppress suppress}
|
||||
[:message]]}]}
|
||||
:on-success (fn [_]
|
||||
[::params-change params])}
|
||||
:dispatch-n [[::data-page/reset-checked ::page]
|
||||
[::modal/modal-closed]]})))
|
||||
(re-frame/reg-event-fx
|
||||
::delete-selected
|
||||
(fn [cofx [_ params suppress]]
|
||||
|
||||
Reference in New Issue
Block a user