<?php

// page.update:after && page.changeStatus:after
return function($newPage, $oldPage) {
  $project = $newPage->template() == 'project' ? $newPage : $newPage->parents()->findBy('template', 'project');
  if ($project) {
    $project->rebuildStepsCache();
    // Invalider aussi le cache des notifications (briefs validés, etc.)
    $project->invalidateNotificationsCache();
  }
};