 (ns checkin-halake.routes.admin
+  (:refer-clojure :exclude [format])
   (:require [compojure.core :refer [defroutes GET POST PUT]]
             [checkin-halake.util :as util]
             [checkin-halake.models

             [admin :as admin]
             [ticket :as ticket]
             [events :as events]
             [checkin :as checkin]]))

(defroutes ^:private admin-routes*
  (POST "/users" {{:keys [name password phone email]} :params}

          (when (and user (contains? ticket/ticket-types type))
            (ticket/add-ticket-to-user user type count)
            (let [tickets (ticket/available-tickets user)]
              (util/response-with-status true :tickets tickets)))))
  (POST "/events" {{:keys [title image-url event-at content-url]} :params}
        (if-let [event-at (try (str->datetime event-at)
                               (catch IllegalArgumentException _ nil))]
          (let [event (events/register-event title image-url event-at content-url)]
            (util/response-with-status true :event event))
          (util/response-with-status false :reason "Wrong datetime format"))))

(defn- wrap-check-admin [app]
  (fn [{:keys [user] :as req}]
