csfixes plus changelog updated

This commit is contained in:
Julie Lenaerts 2022-02-25 16:24:25 +01:00
parent d852477c51
commit 2e59c1415b
3 changed files with 56 additions and 52 deletions

View File

@ -33,9 +33,10 @@ and this project adheres to
* [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434) * [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434)
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435) * [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
* [parcours]: Order social activities and only display most recent three in parcours resumé (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/481) * [parcours]: Order social activities and only display most recent three in parcours resumé (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/481)
* [3party]: 3party: redirect to parent when contact (child) is opened in view page * [3party]: 3party: redirect to parent when contact (child) is opened in view page
* [parcours / addresses]: launch an event when a person change address (either through changing household or because the household is associated to a new address). If the person is localising a course, the course location go back to a temporarily address. * [parcours / addresses]: launch an event when a person change address (either through changing household or because the household is associated to a new address). If the person is localising a course, the course location go back to a temporarily address.
* Creation of PickCivilityType, and implementation in PersonType and ThirdpartyType * Creation of PickCivilityType, and implementation in PersonType and ThirdpartyType
* [budget]: budget enabled for persons and households (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/469)
### test release 2022-02-14 ### test release 2022-02-14

View File

@ -12,6 +12,8 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Entity; namespace Chill\PersonBundle\Entity;
use ArrayIterator; use ArrayIterator;
use Chill\BudgetBundle\Entity\Charge;
use Chill\BudgetBundle\Entity\Resource;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Address;
@ -29,8 +31,6 @@ use Chill\PersonBundle\Entity\Person\PersonCurrentAddress;
use Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential; use Chill\PersonBundle\Validator\Constraints\Household\HouseholdMembershipSequential;
use Chill\PersonBundle\Validator\Constraints\Person\Birthdate; use Chill\PersonBundle\Validator\Constraints\Person\Birthdate;
use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter; use Chill\PersonBundle\Validator\Constraints\Person\PersonHasCenter;
use Chill\BudgetBundle\Entity\Charge;
use Chill\BudgetBundle\Entity\Resource;
use DateTime; use DateTime;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeInterface; use DateTimeInterface;
@ -38,7 +38,6 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\PersistentCollection;
use Exception; use Exception;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap; use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -158,6 +157,26 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*/ */
private $birthdate; private $birthdate;
/**
* Read-only field, computed by the database.
*
* @ORM\OneToMany(
* targetEntity=Charge::class,
* mappedBy="person"
* )
*/
private Collection $budgetCharges;
/**
* Read-only field, computed by the database.
*
* @ORM\OneToMany(
* targetEntity=Resource::class,
* mappedBy="person"
* )
*/
private Collection $budgetResources;
/** /**
* The person's center. * The person's center.
* *
@ -486,26 +505,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*/ */
private $updatedBy; private $updatedBy;
/**
* Read-only field, computed by the database.
*
* @ORM\OneToMany(
* targetEntity=Resource::class,
* mappedBy="person"
* )
*/
private Collection $budgetResources;
/**
* Read-only field, computed by the database.
*
* @ORM\OneToMany(
* targetEntity=Charge::class,
* mappedBy="person"
* )
*/
private Collection $budgetCharges;
/** /**
* Person constructor. * Person constructor.
*/ */
@ -564,16 +563,16 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this; return $this;
} }
public function addBudgetResource(Resource $budgetResource): self public function addBudgetCharge(Charge $budgetCharge): self
{ {
$this->budgetResources[] = $budgetResource; $this->budgetCharges[] = $budgetCharge;
return $this; return $this;
} }
public function addBudgetCharge(Charge $budgetCharge): self public function addBudgetResource(Resource $budgetResource): self
{ {
$this->budgetCharges[] = $budgetCharge; $this->budgetResources[] = $budgetResource;
return $this; return $this;
} }
@ -669,7 +668,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
* *
* Used in template, to find the participation when iterating on a list * Used in template, to find the participation when iterating on a list
* of period. * of period.
*
*/ */
public function findParticipationForPeriod(AccompanyingPeriod $period): ?AccompanyingPeriodParticipation public function findParticipationForPeriod(AccompanyingPeriod $period): ?AccompanyingPeriodParticipation
{ {
@ -851,22 +849,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->addresses; return $this->addresses;
} }
/**
* @return Collection|BudgetResources[]
*/
public function getBudgetResources(): Collection
{
return $this->budgetResources;
}
/**
* @return Collection|BudgetCharges[]
*/
public function getBudgetCharges(): Collection
{
return $this->budgetCharges;
}
/** /**
* Return the age of a person, calculated at the date 'now'. * Return the age of a person, calculated at the date 'now'.
* *
@ -897,6 +879,22 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->birthdate; return $this->birthdate;
} }
/**
* @return Collection|BudgetCharges[]
*/
public function getBudgetCharges(): Collection
{
return $this->budgetCharges;
}
/**
* @return Collection|BudgetResources[]
*/
public function getBudgetResources(): Collection
{
return $this->budgetResources;
}
public function getCenter(): ?Center public function getCenter(): ?Center
{ {
return $this->center; return $this->center;
@ -1426,9 +1424,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
$this->addresses->removeElement($address); $this->addresses->removeElement($address);
} }
public function removeBudgetResource(Resource $budgetResource): self public function removeAltName(PersonAltName $altName): self
{ {
$this->budgetResources->removeElement($budgetResource); if ($this->altNames->contains($altName)) {
$altName->setPerson(null);
$this->altNames->removeElement($altName);
}
return $this; return $this;
} }
@ -1440,12 +1441,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this; return $this;
} }
public function removeAltName(PersonAltName $altName): self public function removeBudgetResource(Resource $budgetResource): self
{ {
if ($this->altNames->contains($altName)) { $this->budgetResources->removeElement($budgetResource);
$altName->setPerson(null);
$this->altNames->removeElement($altName);
}
return $this; return $this;
} }

View File

@ -7,6 +7,11 @@ services:
event: 'prePersist' event: 'prePersist'
entity: 'Chill\PersonBundle\Entity\Person' entity: 'Chill\PersonBundle\Entity\Person'
method: 'prePersistPerson' method: 'prePersistPerson'
-
name: 'doctrine.orm.entity_listener'
event: 'preUpdate'
entity: 'Chill\PersonBundle\Entity\Person'
method: 'prePersistPerson'
- -
name: 'doctrine.orm.entity_listener' name: 'doctrine.orm.entity_listener'
event: 'prePersist' event: 'prePersist'