From 064286aa2fb5bd3509ac9d524806c34788c14c05 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 26 Apr 2022 09:52:00 +0200 Subject: [PATCH] private comment for action. still needs (de)normalization --- .../AccompanyingPeriodWork.php | 20 +++++++++++ .../vuejs/AccompanyingCourseWorkEdit/App.vue | 9 +++++ .../migrations/Version20220425135900.php | 35 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20220425135900.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 055507162..91d85883a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; +use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\User; use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -134,6 +135,12 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues */ private string $note = ''; + /** + * @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="prcomment_") + * @Serializer\Groups({"read", "accompanying_period_work:edit", "docgen:read"}) + */ + private CommentEmbeddable $privateComment; + /** * @ORM\ManyToMany(targetEntity=Person::class) * @ORM\JoinTable(name="chill_person_accompanying_period_work_person") @@ -202,6 +209,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues public function __construct() { $this->goals = new ArrayCollection(); + $this->privateComment = new CommentEmbeddable(); $this->results = new ArrayCollection(); $this->thirdParties = new ArrayCollection(); $this->persons = new ArrayCollection(); @@ -323,6 +331,11 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this->note; } + public function getPrivateComment(): CommentEmbeddable + { + return $this->privateComment; + } + public function getPersons(): Collection { return $this->persons; @@ -505,6 +518,13 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + public function setPrivateComment(CommentEmbeddable $privateComment): self + { + $this->privateComment = $privateComment; + + return $this; + } + public function setSocialAction(?SocialAction $socialAction): self { $this->socialAction = $socialAction; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index bcfa53e45..19d253f41 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -33,6 +33,15 @@ > +
+ + +
+

{{ $t('goals_title') }}

diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220425135900.php b/src/Bundle/ChillPersonBundle/migrations/Version20220425135900.php new file mode 100644 index 000000000..8598ee432 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220425135900.php @@ -0,0 +1,35 @@ +addSql('ALTER TABLE chill_person_accompanying_period_work ADD prcomment_comment TEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD prcomment_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD prcomment_userId INT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP prcomment_comment'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP prcomment_date'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP prcomment_userId'); + } +}