parent
627dc678a9
commit
0024f99fe9
@ -1,10 +1,26 @@
|
|||||||
(ns wanijo.public.db
|
(ns wanijo.public.db
|
||||||
(:require [wanijo.infrastructure.neo4j :as neo4j]))
|
(:require [wanijo.infrastructure.neo4j :as neo4j]))
|
||||||
|
|
||||||
(def key-mapping
|
(def schema-uuids
|
||||||
{"dev" "Development"
|
{:coc "4f7b561c-51d2-4332-895f-cd583946dcab"
|
||||||
"req" "Projekte"
|
:role "f87b5810-b8c2-4420-91ae-87f0e02af88a"
|
||||||
"prk" "Requirements Engineering"})
|
:level "4ce60c8f-3864-4528-9e63-7c862cb8644a"
|
||||||
|
:module "574b1813-5366-4e48-9034-9c1bce52d455"
|
||||||
|
:component "439856be-85be-49c1-b58b-4594741f37b3"})
|
||||||
|
|
||||||
(neo4j/defquery roles
|
(def coc-instance-uuids
|
||||||
"MATCH (i:instance {name:{name}})")
|
{"dev" "6348f1ab-1771-4bef-b101-eb76ec236646"
|
||||||
|
"req" "44b02979-7e78-491c-8631-fc49a47b799d"
|
||||||
|
"prk" "318ee72d-8a8b-42c5-aa90-d5efc1787d22"})
|
||||||
|
|
||||||
|
(neo4j/defquery roles-of-coc
|
||||||
|
"MATCH (coc:instance {uuid:{coc_uuid}}),
|
||||||
|
(coc)--(:link)--(role:instance),
|
||||||
|
(role)-[:of]->(rschema:schema {uuid:{roleschema_uuid}})
|
||||||
|
RETURN role
|
||||||
|
ORDER BY role.name")
|
||||||
|
(defn roles-of-coc! [coc-key]
|
||||||
|
(map :role
|
||||||
|
(neo4j/exec-query! roles-of-coc
|
||||||
|
{:coc_uuid (get coc-instance-uuids coc-key)
|
||||||
|
:roleschema_uuid (:role schema-uuids)})))
|
||||||
|
Loading…
Reference in new issue