Make urgency numeric
This commit is contained in:
@@ -13,9 +13,9 @@
|
|||||||
obj)
|
obj)
|
||||||
|
|
||||||
(defn- objects-criticality [objs]
|
(defn- objects-criticality [objs]
|
||||||
(cond (some (partial contains? objs) critical-objects) :high
|
(cond (some (partial contains? objs) critical-objects) 9
|
||||||
(some (partial contains? objs) normal-objects) :medium
|
(some (partial contains? objs) normal-objects) 5
|
||||||
:else :low))
|
:else 1))
|
||||||
|
|
||||||
(defn- objects-probability [objs]
|
(defn- objects-probability [objs]
|
||||||
(let [prob (apply max (vals objs))]
|
(let [prob (apply max (vals objs))]
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
(t/schema [:map
|
(t/schema [:map
|
||||||
[:summary (sized-string 1 80)]
|
[:summary (sized-string 1 80)]
|
||||||
[:body (sized-string 1 256)]
|
[:body (sized-string 1 256)]
|
||||||
[:urgency {:optional true} [:enum :low :medium :high]]]))
|
[:urgency [:and :int [:>= 0] [:<= 10]]]]))
|
||||||
|
|
||||||
(def MotionEvent
|
(def MotionEvent
|
||||||
(t/schema [:map
|
(t/schema [:map
|
||||||
|
|||||||
Reference in New Issue
Block a user