                               :current-validity validity
                               :validity end-time}))))
 
-(defn- close-nested-meta [persistence dataset parent-collection parent-id end-time]
+(defn- close-nested-childs-meta [persistence dataset parent-collection parent-id end-time]
   (let [nested (pers/childs persistence dataset parent-collection parent-id)
         metas (map (fn [[col id]] {:dataset dataset
                                   :collection col

                                  :end-time end-time}) nested)]
    metas))

(defn- close-all [processor meta-record]
  (let [{:keys [dataset collection parent-collection parent-id end-time]} meta-record
        persistence (:persistence processor)
        ids (pers/childs persistence dataset parent-collection parent-id collection)
        nested-metas (mapcat #(close-nested-meta persistence dataset collection % end-time) ids)
        closed-nesteds (doall (mapcat #(close-all processor %) nested-metas))
        closed (doall (mapcat #(close-all* processor dataset collection % end-time) ids))]
    (concat closed-nesteds closed)))

(defn- delete-child* [processor dataset collection id]

   :parent-collection collection
   :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
               :dataset dataset
               :collection collection
               :parent-collection parent-collection
