 (defn process-command
   "Execute the given governance transformation on the given
    circle, returning the new circle."
-  [circle record]
-  (let [function-primary (first record)
-        command (function-primary commands)]
+  [circle [function-primary :as record]]
+  (let [command (function-primary commands)]
     (if command
       (command circle record function-primary)
       (do

                    (merge {:name entity-name}))]
    (execute-governance-function record fn circle params)))

(defn define-policy [circle record _]
  (g/add-policy circle (second record) (nth record 2)))

(defn strike-policy [circle record _]
  (g/remove-policy circle (second record)))

(def elected-role-mapping {"facilitator" g/facilitator-name
                           "secretary"   g/secretary-name


(def formatter (f/formatter "yyyy-MM-dd"))

(defn elect [circle [_ person-name role-name expiration] _]
  (g/elect-to-role circle (elected-role-mapping role-name)
                   person-name (f/parse formatter expiration)))

(defn appoint [circle [_ person-name role-name focus] _]
  (g/appoint-to-role circle role-name person-name focus))

(defn unappoint [circle [_ person-name role-name] _]
  (g/unappoint-from-role circle role-name person-name))

(def commands {:create    modify-entity
               :delete    modify-entity
