From b7cfdebad58aaecd54df85f46cba5048b3312ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 12 Nov 2023 22:06:05 +0100 Subject: [PATCH] Added data field for vendor PartLot barcodes --- src/Entity/Parts/PartLot.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Entity/Parts/PartLot.php b/src/Entity/Parts/PartLot.php index 58fa2afb..fe683499 100644 --- a/src/Entity/Parts/PartLot.php +++ b/src/Entity/Parts/PartLot.php @@ -60,8 +60,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; #[ORM\Entity] #[ORM\HasLifecycleCallbacks] #[ORM\Table(name: 'part_lots')] -#[ORM\Index(name: 'part_lots_idx_instock_un_expiration_id_part', columns: ['instock_unknown', 'expiration_date', 'id_part'])] -#[ORM\Index(name: 'part_lots_idx_needs_refill', columns: ['needs_refill'])] +#[ORM\Index(columns: ['instock_unknown', 'expiration_date', 'id_part'], name: 'part_lots_idx_instock_un_expiration_id_part')] +#[ORM\Index(columns: ['needs_refill'], name: 'part_lots_idx_needs_refill')] +#[ORM\Index(columns: ['vendor_barcode'], name: 'part_lots_idx_barcode')] #[ValidPartLot] #[ApiResource( operations: [ @@ -154,6 +155,12 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named #[Groups(['part_lot:read', 'part_lot:write'])] protected ?User $owner = null; + /** + * @var string|null The content of the barcode of this part lot (e.g. a barcode on the package put by the vendor) + */ + #[ORM\Column(type: Types::STRING, nullable: true)] + protected ?string $vendor_barcode = null; + public function __clone() { if ($this->id) {