Allow to edit the GTIN property of a part and validate the GTIN

This commit is contained in:
Jan Böhmer 2026-02-08 14:44:56 +01:00
parent 7fd7697c02
commit 57c8368b5e
10 changed files with 236 additions and 6 deletions

View file

@ -24,6 +24,7 @@ namespace App\Entity\Parts\PartTraits;
use App\Entity\Parts\InfoProviderReference;
use App\Entity\Parts\PartCustomState;
use App\Validator\Constraints\ValidGTIN;
use Doctrine\DBAL\Types\Types;
use App\Entity\Parts\Part;
use Doctrine\ORM\Mapping as ORM;
@ -89,7 +90,7 @@ trait AdvancedPropertyTrait
*/
#[Groups(['extended', 'full', 'import', 'part:read', 'part:write'])]
#[ORM\Column(type: Types::STRING, nullable: true)]
#[Length(max: 14)]
#[ValidGTIN]
protected ?string $gtin = null;
/**