API endpoints to delete customer/project/activity (#5181)

* added service methods with events to delete customer, project, activity
* added API endpoints to delete customer, project, activity
* added tests for new API endpoints
This commit is contained in:
Kevin Papst
2024-11-27 15:25:13 +01:00
committed by GitHub
parent f13b81ede7
commit e030ff08db
13 changed files with 408 additions and 80 deletions

View File

@@ -15,6 +15,7 @@ use App\Entity\Project;
use App\Event\ActivityCreateEvent;
use App\Event\ActivityCreatePostEvent;
use App\Event\ActivityCreatePreEvent;
use App\Event\ActivityDeleteEvent;
use App\Event\ActivityMetaDefinitionEvent;
use App\Event\ActivityUpdatePostEvent;
use App\Event\ActivityUpdatePreEvent;
@@ -69,8 +70,13 @@ class ActivityService
return $activity;
}
public function deleteActivity(Activity $activity): void
{
$this->dispatcher->dispatch(new ActivityDeleteEvent($activity));
$this->repository->deleteActivity($activity);
}
/**
* @param Activity $activity
* @param string[] $groups
* @throws ValidationFailedException
*/