1
0
mirror of synced 2025-01-24 09:11:41 +03:00

Add 'type' field to Plate object

This commit is contained in:
Andrey Muriy 2023-03-27 15:14:21 +03:00
parent 3330635d64
commit 64a66e98c8

View File

@ -6,6 +6,20 @@ use JMS\Serializer\Annotation as Serializer;
class Plate
{
public const TYPE_ORDER = 'order';
public const TYPE_SHIPMENT = 'shipment';
/**
* Тип сущности для печатной формы
*
* @var string
*
* @Serializer\Groups({"get", "set"})
* @Serializer\SerializedName("type")
* @Serializer\Type("string")
*/
public $type;
/**
* Код печатной формы
*
@ -28,9 +42,10 @@ class Plate
*/
public $label;
public function __construct($code, $label)
public function __construct($code, $label, $type = self::TYPE_ORDER)
{
$this->code = $code;
$this->label = $label;
$this->type = $type;
}
}