                :collection collection
                :parent-collection parent-collection
                :parent-id parent-id
-               :end-time validity})]
+               :validity validity})]
       (map (fn [[{:keys [dataset collection parent-collection parent-id validity]} _]]
              (meta dataset collection parent-collection parent-id validity)) grouped)
       )))

   :parent-id id})

(defn- meta-close-childs [features]
  "{:action :close-childs :dataset _ :collection _ :parent-collection _ :parent-id _ :end-time _"
  (let [grouped (group-by #(select-keys % [:dataset :collection :parent-collection :parent-id :validity]) features)]
    (letfn [(meta [dataset collection parent-collection parent-id validity]
              {:action :close-childs

        collected (assoc no-attributes :attributes collected)]
    collected))

(defn- close-child [processor dataset collection id close-time]
  (let [persistence (:persistence processor)
        childs-of-child (pers/childs persistence dataset collection id)
        metas (map (fn [[child-col child-id]] {:action :close-childs
                                  :dataset dataset
                                  :collection child-col
                                  :parent-collection collection
                                  :parent-id id
                                  :validity close-time}) childs-of-child)
        validity (pers/current-validity persistence dataset collection id)
        state (pers/last-action persistence dataset collection id)]
        (if-not (= state :close)
          (consume processor (conj metas {:action :close
                                            :dataset dataset
                                            :collection collection
                                            :id id
                                            :current-validity validity
                                            :validity close-time}))
          (consume processor metas))))

(defn- close-childs [processor meta-record]
  (let [{:keys [dataset collection parent-collection parent-id validity]} meta-record
        persistence (:persistence processor)
        ids (pers/childs persistence dataset parent-collection parent-id collection)
        closed (doall (mapcat #(close-child processor dataset collection % validity) ids))]
     closed))

(defn- delete-child* [processor dataset collection id]
  (let [persistence (:persistence processor)
