aboutsummaryrefslogtreecommitdiff
path: root/src/clj/queue_api/db
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2018-02-22 00:38:26 -0300
committerGabriel A. Giovanini <mail@gabrielgio.me>2018-02-22 00:38:26 -0300
commitf55b9febe8974f861e2179baddaf9d48fa73552c (patch)
treef0d11523c5f986643a0b37cc067dcd962ecd25de /src/clj/queue_api/db
parent0b8277f72cdc2ed2abeb566f30958bd8e0dc5167 (diff)
downloadqueue-api-f55b9febe8974f861e2179baddaf9d48fa73552c.tar.gz
queue-api-f55b9febe8974f861e2179baddaf9d48fa73552c.tar.bz2
queue-api-f55b9febe8974f861e2179baddaf9d48fa73552c.zip
A better swagger documentation and a better routing test
Diffstat (limited to 'src/clj/queue_api/db')
-rw-r--r--src/clj/queue_api/db/core.clj11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/clj/queue_api/db/core.clj b/src/clj/queue_api/db/core.clj
index 0482feb..adbda25 100644
--- a/src/clj/queue_api/db/core.clj
+++ b/src/clj/queue_api/db/core.clj
@@ -16,12 +16,12 @@
(defn add-agent
"Add an agent into the database"
- [{:keys [id name primary-skillset secondary-skillset]}]
+ [{:keys [id name primary_skillset secondary_skillset]}]
(d/transact! conn
[{:agent/id id
:agent/name name
- :agent/primary-skillset primary-skillset
- :agent/secondary-skillset secondary-skillset}]))
+ :agent/primary-skillset primary_skillset
+ :agent/secondary-skillset secondary_skillset}]))
(defn add-job
"Add a job into the database"
@@ -107,6 +107,11 @@
[id]
(d/entity @conn [:agent/id id]))
+(defn job
+ "Get a job by id"
+ [id]
+ (d/entity @conn [:job/id id]))
+
(defn fittest-job
"Get the fittest job for a agent `id`."
[^String id]