EZ cater is available now.

This commit is contained in:
2022-07-30 16:25:21 -07:00
parent e38388b980
commit 46cfb440ef
4 changed files with 315 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
[clojure.tools.logging :as log]
[compojure.core :refer [context defroutes GET POST wrap-routes]]
[ring.middleware.json :refer [wrap-json-params]]
[auto-ap.ezcater.core :as e]
[ring.util.request :refer [body-string]]))
(defroutes routes
@@ -14,8 +15,9 @@
:headers {"Content-Type" "application/json"}
:body "{}"})
(POST "/event" request
;; {"id" "bf3dcf5c-a68f-42d9-9084-049133e03d3d", "parent_type" "Caterer", "parent_id" "91541331-d7ae-4634-9e8b-ccbbcfb2ce70", "entity_type" "Order", "entity_id" "9ab05fee-a9c5-483b-a7f2-14debde4b7a8", "key" "accepted", "occurred_at" "2022-07-21T19:21:07.549Z"}
(log/info (str "POST EVENT " (body-string request) request))
(e/import-order (:json-params request))
{:status 200
:headers {"Content-Type" "application/json"}
:body "{}"}))