             [reloaded.repl :refer [system init start stop go reset]]
             [com.stuartsierra.component :as component]
             [tictag.config :refer [config]]
-            [tictag.server :as server]
+            [tictag.server :as server :refer [evaluate]]
             [tictag.db :as db]
             [tictag.beeminder :as bm]
             [tictag.system]


(reloaded.repl/set-init! #(tictag.system/system config))

(defn dev-user [] (db/get-user (:db system) "TEST_USER"))

(def my-user-id (-> (select :id)
                    (from :users)
                    (where [:= :username "TEST_USER"])
                    (limit 1)))

(def my-beeminder-id (-> (select :beeminder.id)

  (j/with-db-transaction [tx (-> system :db :db)]
    (j/execute! tx
                (-> (insert-into :users)
                    (values [{:username "test"
                              :email    "tictag-test@agh.io"
                              :pass     (db/hashp "test")
                              :tz       "America/Los_Angeles"}])
                    (upsert (-> (on-conflict :username)
                                (do-nothing)))
