     (doseq [[_ section] real-sections]
       (common/create-resource common/section-table-name section ts))
     (common/create-resource table-name (merge company rs-w-ts) ts)))
-
-;; (defun create-company
-;;   "Given the company property map, create the company, returning the property map for the resource or `false`.
-;;   If you get a false response and aren't sure why, use the `valid-company` function to get a reason keyword."
-
-;;   ([company user] (create-company company user (common/current-timestamp)))
-
-;;   ;; not a map
-;;   ([_company :guard #(not (map? %)) _user _timestamp] false)
-;;   ([_company _user :guard #(not (map? %)) _timestamp] false)
-
-;;   ;; no org-id
-;;   ([_company _user :guard #(not (:org-id %)) _timestamp] false)
-
-;;   ;; potentially a valid company
-;;   ([company user timestamp]
-;;     (let [company-slug (or (:slug company) (slug/slugify (:name company)))
-;;           author (common/author-for-user user)
-;;           interim-company (-> company
-;;                             (clean) ; remove disallowed properties
-;;                             (assoc :slug company-slug) ; store the slug
-;;                             (assoc :org-id (:org-id user)) ; store the org
-;;                             (categories-for) ; add/replace the :categories property
-;;                             (sections-for)) ; add/replace the :sections property
-;;           section-names (flatten (vals (:sections interim-company)))
-;;           final-company (->> interim-company
-;;                           (author-for author section-names) ; add/replace the :author in the sections
-;;                           (updated-for timestamp section-names))] ; add/replace the :updated-at in the sections
-;;       (if (true? (valid-company final-company))
-;;         (do
-;;           ;; create the each section in the DB
-;;           (doseq [section-name section-names]
-;;             (let [section (-> (get final-company (keyword section-name))
-;;                               (assoc :company-slug (:slug final-company))
-;;                               (assoc :section-name section-name))]
-;;               (common/create-resource common/section-table-name section timestamp)))
-;;           ;; create the company in the DB
-;;           (common/create-resource table-name final-company timestamp))
-;;         false))))
 
 (defn update-company
   "

  []
  ;; Delete all sections and all companies
  (common/delete-all-resources! common/section-table-name)
  (common/delete-all-resources! table-name))
    sections ; already contains the section-name
    (let [category-name (common/category-for section-name)] ; get the category for this section name
      (update-in sections [category-name] conj section-name)))) ; add the section name to the category

;; ----- Validations -----

