improves create a person with address

* validation: must have an address when 'create a form' is checked;
* minor improvements
This commit is contained in:
2022-05-06 11:43:05 +02:00
parent 64432bb08a
commit 6abbf9bf21
6 changed files with 56 additions and 30 deletions

View File

@@ -35,7 +35,7 @@ class HouseholdMember
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
* @Serializer\Groups({"read", "docgen:read"})
* @Assert\GreaterThan(
* @Assert\GreaterThanOrEqual(
* propertyPath="startDate",
* message="household_membership.The end date must be after start date",
* groups={"household_memberships"}
@@ -202,7 +202,7 @@ class HouseholdMember
public function setPosition(?Position $position): self
{
if ($this->position instanceof Position) {
if ($this->position instanceof Position && $this->position !== $position) {
throw new LogicException('The position is already set. You cannot change ' .
'a position of a membership');
}