diff --git a/changelog.md b/changelog.md index ce60c61..083c690 100644 --- a/changelog.md +++ b/changelog.md @@ -68,4 +68,5 @@ #### Improve - Move columns in activity table -- Reditect to activity after creating one \ No newline at end of file +- Reditect to activity after creating one +- Add canceled status \ No newline at end of file diff --git a/src/Entity/ActivityEntity.php b/src/Entity/ActivityEntity.php index cb5ad03..7044071 100644 --- a/src/Entity/ActivityEntity.php +++ b/src/Entity/ActivityEntity.php @@ -18,6 +18,7 @@ StatusEnum::IN_PROGRESS, StatusEnum::WAITING, StatusEnum::POSTPONED, + StatusEnum::CANCELED, StatusEnum::CLOSED, ]; diff --git a/src/Entity/TaskEntity.php b/src/Entity/TaskEntity.php index c7eb860..e6efa18 100644 --- a/src/Entity/TaskEntity.php +++ b/src/Entity/TaskEntity.php @@ -18,6 +18,7 @@ StatusEnum::IN_PROGRESS, StatusEnum::WAITING, StatusEnum::PLANIFIED, + StatusEnum::CANCELED, StatusEnum::CLOSED, ]; @@ -149,7 +150,7 @@ return $this; } - + /** * Get the related actor * @@ -159,7 +160,7 @@ { return $this->actor; } - + /** * Set the new related actor * @@ -169,7 +170,7 @@ public function setActor(?ActorEntity $actor): self { $this->actor = $actor; - + return $this; } @@ -195,7 +196,7 @@ return $this; } - + /** * Get the status of the task * @@ -206,7 +207,7 @@ { return $this->status; } - + /** * Set a new status for the task * @@ -220,7 +221,7 @@ throw new InvalidEnumKeyException(); } $this->status = $status; - + return $this; } } \ No newline at end of file diff --git a/src/Enum/StatusEnum.php b/src/Enum/StatusEnum.php index 8de06e7..44ed231 100644 --- a/src/Enum/StatusEnum.php +++ b/src/Enum/StatusEnum.php @@ -22,9 +22,12 @@ /** @var string Activity is postponed */ public const POSTPONED = 'posetponed'; - /** @var No more actions required, success or fail */ + /** @var string No more actions required, success or fail */ public const CLOSED = 'closed'; + /** @var string Canceled */ + public const CANCELED = 'canceled'; + /** @var array Names of status */ public const STATUS_NAME = [ self::OPEN => 'Ouvert', @@ -32,6 +35,7 @@ self::WAITING => 'En attente', self::PLANIFIED => 'Planifié', self::POSTPONED => 'Reporté', + self::CANCELED => 'Annulé', self::CLOSED => 'Clos', ];