more spec stuff

integration-tests
Josha von Gizycki 6 years ago
parent 0b76877028
commit bac79cd60c

@ -65,16 +65,18 @@
SET p.value = {value},
p.created_at = {created_at},
p.updated_at = {updated_at}")
(defn create! [user-uuid schema-uuid instance]
(defn create! [user-uuid
schema-uuid
{:keys [name properties]}]
(let [instance-uuid (neo4j/uuid)
now (neo4j/now-str)
instance-tuple [create-instance
{:schema_uuid schema-uuid
:name (:name instance)
:name name
:uuid instance-uuid
:created_at now
:user_uuid user-uuid}]
prop-tuples (for [{:keys [attribute value]} (:properties instance)]
prop-tuples (for [{:keys [attribute value]} properties]
[create-property
{:uuid instance-uuid
:attr_uuid (:uuid attribute)

@ -1,10 +1,11 @@
(ns wanijo.instance.forms
(:require [wanijo.instance.domain :as domain]))
(:require [wanijo.specs :as specs]
[wanijo.instance.domain :as domain]))
(def form
{:fields {:name {:label "Name"
:required true
:spec ::domain/name}}})
:spec ::specs/req-name}}})
(defn link-form [instances]
{:fields {:name {:label "Name"}

@ -7,6 +7,8 @@
(spec/def ::created-at
(spec/and string? ::neo4j/date-str))
(spec/def ::name string?)
(spec/def ::req-name
(spec/and ::name (complement empty?)))
(spec/def ::instance_uuid ::neo4j/uuid)
(spec/def ::attribute_uuid ::neo4j/uuid)
(spec/def ::now ::neo4j/date-str)

Loading…
Cancel
Save