From e45df3ee8422f9eaaa0a8d5e3797677f788c24cd Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Sat, 22 Jun 2019 22:56:17 +0200 Subject: [PATCH] remove less from compile, specs for edit-properties fuction --- project.clj | 3 +-- src/wanijo/instance/domain.clj | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/project.clj b/project.clj index b5e7413..595fcd6 100644 --- a/project.clj +++ b/project.clj @@ -61,7 +61,6 @@ :ring {:handler wanijo.handler/app} :less {:source-paths ["resources/app/stylesheets"] :target-path "resources/public/css"} - :aliases {"uberjar" ["do" ["less" "once"] "uberjar"] - "compile" ["do" ["less" "once"] "compile"]} + :aliases {"uberjar" ["do" ["less" "once"] "uberjar"]} :hiera {:cluster-depth 2} :eastwood {:namespaces [:source-paths]}) diff --git a/src/wanijo/instance/domain.clj b/src/wanijo/instance/domain.clj index 314deb4..0db3923 100644 --- a/src/wanijo/instance/domain.clj +++ b/src/wanijo/instance/domain.clj @@ -1,11 +1,15 @@ (ns wanijo.instance.domain (:require [clojure.spec.alpha :as spec] + [clojure.spec.test.alpha :as spectest] [wanijo.framework.neo4j :as neo4j] [clojure.pprint :as pprint])) (spec/def ::created-at ::neo4j/date-str) (spec/def ::updated-at ::neo4j/date-str) (spec/def ::name (spec/and (complement empty?) string?)) +(spec/def ::value (some-fn string? boolean? nil? number?)) +(spec/def ::instance_uuid ::neo4j/uuid) +(spec/def ::attribute_uuid ::neo4j/uuid) (neo4j/defquery findy-by-schema "MATCH (i:instance)-[:of]->(s:schema) @@ -115,6 +119,18 @@ :attribute_uuid (-> prop :attribute :uuid)}])) (:properties instance))) +(spec/def ::prop-tuple-values + (spec/keys :req-un [::neo4j/uuid + ::neo4j/date-str + ::value + ::instance_uuid + ::attribute_uuid])) +(spec/def ::prop-tuple + (spec/tuple fn? ::prop-tuple-values)) +(spec/fdef instance->prop-tuples + :ret (spec/coll-of ::prop-tuple)) +(spectest/instrument `instance->prop-tuples) + (defn edit! [instance] (let [prop-tuples (instance->prop-tuples instance)] (apply neo4j/exec-queries!