                             (map (partial coerce-uuids uuid-attrs))
                             (map (partial coerce-server-timestamp server-timestamp))
                             (map (partial coerce-session-uuid session-uuid))
-                            (map (partial coerce-points-to document-id))
                             (filter whitelisted?)
                             (remove-float-conflicts)
                             (add-frontend-ids (or document-id team-id))

                {} txes)))

(defn add-frontend-ids [document-id txes]
  (:txes (reduce (fn [{:keys [txes eid-map]} [type e a v]]
                   (if-let [temp-id (get eid-map e)]
                     {:txes (conj txes [type temp-id a v])
                      :eid-map eid-map}
                     (let [temp-id (d/tempid :db.part/user)]
                       {:txes (concat txes [[type temp-id a v]
                                            [:db/add temp-id :frontend/id (UUID. document-id e)]])
                        :eid-map (assoc eid-map e temp-id)})))
                 {:txes [] :eid-map {}} txes)))

;; TODO: only let creators mark things as private
;; TODO: only let people on the white list make things as private

  (if (= :session/uuid a)
    [type e a session-uuid]
    transaction))

(def incoming-whitelist
  #{:layer/name
