From 620515ad15339907d98e5fb734f3f07089932800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 17 Apr 2025 10:56:45 +0200 Subject: [PATCH] Remove "not null" validation on HouseholdComposition properties This change removes the "not null" constraint on specific properties in the HouseholdComposition entity to allow null values. The adjustment addresses Issue #380 and ensures better flexibility without impacting the schema. --- .changes/unreleased/Fixed-20250417-105627.yaml | 7 +++++++ .../Entity/Household/HouseholdComposition.php | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Fixed-20250417-105627.yaml diff --git a/.changes/unreleased/Fixed-20250417-105627.yaml b/.changes/unreleased/Fixed-20250417-105627.yaml new file mode 100644 index 000000000..005f2cd3f --- /dev/null +++ b/.changes/unreleased/Fixed-20250417-105627.yaml @@ -0,0 +1,7 @@ +kind: Fixed +body: | + Remove the "not null" validation constraint on recently added properties on HouseholdComposition +time: 2025-04-17T10:56:27.939628281+02:00 +custom: + Issue: "380" + SchemaChange: No schema change diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php index ac84bb3fd..10d63e19d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdComposition.php @@ -58,13 +58,11 @@ class HouseholdComposition implements TrackCreationInterface, TrackUpdateInterfa #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])] private ?int $numberOfChildren = null; - #[Assert\NotNull] #[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])] #[Serializer\Groups(['docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])] private ?int $numberOfDependents = null; - #[Assert\NotNull] #[Assert\GreaterThanOrEqual(0, groups: ['Default', 'household_composition'])] #[Serializer\Groups(['docgen:read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])]