mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-01 10:59:45 +00:00
Improve assignee handling and task assignment logic
- Added `hasAssigneeChanged` method for detecting assignee change - Updated `onTaskAssigned` logic to trigger only on assignee change
This commit is contained in:
@@ -20,7 +20,7 @@ class AssignTaskEvent extends Event
|
||||
final public const PERSIST = 'chill_task.assign_task';
|
||||
public function __construct(
|
||||
private readonly SingleTask $task,
|
||||
private readonly User $assignedUser,
|
||||
private readonly User $initialAssignee,
|
||||
) {}
|
||||
|
||||
public function getTask(): SingleTask
|
||||
@@ -28,8 +28,13 @@ class AssignTaskEvent extends Event
|
||||
return $this->task;
|
||||
}
|
||||
|
||||
public function getAssignedUser(): User
|
||||
public function getInitialAssignee(): User
|
||||
{
|
||||
return $this->assignedUser;
|
||||
return $this->initialAssignee;
|
||||
}
|
||||
|
||||
public function hasAssigneeChanged(): bool
|
||||
{
|
||||
return $this->initialAssignee !== $this->task->getAssignee();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user