Add EntityWorkflowSend and EntityWorkflowSendView entities

Introduced EntityWorkflowSend and EntityWorkflowSendView entities to enable tracking of workflow content sent to external parties. Updated EntityWorkflowStep to associate with these entities and added a corresponding database migration script.
This commit is contained in:
2024-10-03 11:55:58 +02:00
parent 9a9d14eb5a
commit 2213f6f429
4 changed files with 303 additions and 0 deletions

View File

@@ -112,6 +112,11 @@ class EntityWorkflowStep
#[ORM\OneToMany(mappedBy: 'step', targetEntity: EntityWorkflowStepHold::class)]
private Collection $holdsOnStep;
/**
* @var Collection<int, EntityWorkflowSend>
*/
private Collection $sends;
public function __construct()
{
$this->ccUser = new ArrayCollection();
@@ -120,6 +125,7 @@ class EntityWorkflowStep
$this->destUserByAccessKey = new ArrayCollection();
$this->signatures = new ArrayCollection();
$this->holdsOnStep = new ArrayCollection();
$this->sends = new ArrayCollection();
$this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
}
@@ -190,6 +196,18 @@ class EntityWorkflowStep
return $this;
}
/**
* @internal use @see{EntityWorkflowSend}'s constructor instead
*/
public function addSend(EntityWorkflowSend $send): self
{
if (!$this->sends->contains($send)) {
$this->sends[] = $send;
}
return $this;
}
public function removeSignature(EntityWorkflowStepSignature $signature): self
{
if ($this->signatures->contains($signature)) {