 ;;     - show-before: int >= 0 number of days before the due date when the instance should appear in the inbox
 
 (defn- new-task
-  [task-name project tags sub-tasks description remind-date due-date show-before repeating done]
   [task-name parent task-type tags sub-tasks description remind-date due-date show-before repeating done]
   (when-not (is-task {:type task-type})
     (throw (js/Error. (str "Task type must belong to ["

(defn all-projects
  []
  (assoc
    (merge @active-projects @completed-projects)
    "Inbox"
    (inbox)))

(defn register-task
  [task-name {:keys [parent tags sub-tasks description remind-date due-date show-before repeating]

  (if (and (:repeating task)
           (= (get-in task [:repeating :type])
              "pattern"))
    (register-entity-in task repeating-tasks)
    (if (:done task)
      (register-entity-in task completed-tasks)
      (register-entity-in task active-tasks)))
  (register-entity-in task tasks)
  (register-tags! task :tasks))

(defn- store-project!
  [project]
  (if (= (:id project) "Inbox")
    (reset! inbox-project project)
    (do
      (register-entity-in project projects)
      (if (:done project)
        (register-entity-in project completed-projects)
        (register-entity-in project active-projects)))
    (register-tags! project :projects)))

(defn- get-parent
  [task]
  (if (= (:type task) "Task")
    (get (all-projects) (:parent task))
    (get (all-tasks) (:parent task))))

(defn- install-task
  [task]
