From babca5fc0f29da84790ec7456d4978f835fe82e1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 4 Jul 2024 17:11:57 +0200 Subject: [PATCH] Add metadata property to workflow to allow adding info about signatures needed --- .../Entity/Workflow/EntityWorkflow.php | 13 ++++++++++ .../migrations/Version20240704150808.php | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/migrations/Version20240704150808.php diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php index 9c314115e..868df0d5e 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflow.php @@ -86,6 +86,9 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)] private string $workflowName; + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])] + private array $metadata = []; + public function __construct() { $this->subscriberToFinal = new ArrayCollection(); @@ -455,4 +458,14 @@ class EntityWorkflow implements TrackCreationInterface, TrackUpdateInterface return $this->steps->get($this->steps->count() - 2); } + + public function getMetadata(): array + { + return $this->metadata; + } + + public function setMetadata(array $metadata): void + { + $this->metadata = $metadata; + } } diff --git a/src/Bundle/ChillMainBundle/migrations/Version20240704150808.php b/src/Bundle/ChillMainBundle/migrations/Version20240704150808.php new file mode 100644 index 000000000..8a0d1d489 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20240704150808.php @@ -0,0 +1,26 @@ +addSql('ALTER TABLE chill_main_workflow_entity ADD metadata JSONB DEFAULT \'[]\' NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_main_workflow_entity DROP metadata'); + } +}