Improved documentation of entity fields

This commit is contained in:
Jan Böhmer 2023-09-17 12:50:32 +02:00
parent 219fbe5fca
commit f01ec9dbe4
13 changed files with 30 additions and 27 deletions

View file

@ -93,56 +93,56 @@ class Category extends AbstractPartsContainingDBElement
protected string $comment = '';
/**
* @var string
* @var string The hint which is shown as hint under the partname field, when a part is created in this category.
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::TEXT)]
protected string $partname_hint = '';
/**
* @var string
* @var string The regular expression which is used to validate the partname of a part in this category.
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::TEXT)]
protected string $partname_regex = '';
/**
* @var bool
* @var bool Set to true, if the footprints should be disabled for parts this category (not implemented yet).
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $disable_footprints = false;
/**
* @var bool
* @var bool Set to true, if the manufacturers should be disabled for parts this category (not implemented yet).
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $disable_manufacturers = false;
/**
* @var bool
* @var bool Set to true, if the autodatasheets should be disabled for parts this category (not implemented yet).
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $disable_autodatasheets = false;
/**
* @var bool
* @var bool Set to true, if the properties should be disabled for parts this category (not implemented yet).
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $disable_properties = false;
/**
* @var string
* @var string The default description for parts in this category.
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::TEXT)]
protected string $default_description = '';
/**
* @var string
* @var string The default comment for parts in this category.
*/
#[Groups(['full', 'import', 'category:read', 'category:write'])]
#[ORM\Column(type: Types::TEXT)]

View file

@ -113,7 +113,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
protected bool $instock_unknown = false;
/**
* @var float For continuous sizes (length, volume, etc.) the instock is saved here.
* @var float The amount of parts in this lot. For integer-quantities this value is rounded to the next integer.
*/
#[Assert\PositiveOrZero]
#[Groups(['simple', 'extended', 'full', 'import', 'part_lot:read', 'part_lot:write'])]

View file

@ -43,14 +43,14 @@ trait AdvancedPropertyTrait
protected bool $needs_review = false;
/**
* @var string a comma separated list of tags, associated with the part
* @var string A comma separated list of tags, associated with the part
*/
#[Groups(['extended', 'full', 'import', 'part:read', 'part:write'])]
#[ORM\Column(type: Types::TEXT)]
protected string $tags = '';
/**
* @var float|null how much a single part unit weighs in grams
* @var float|null How much a single part unit weighs in grams
*/
#[Assert\PositiveOrZero]
#[Groups(['extended', 'full', 'import', 'part:read', 'part:write'])]

View file

@ -36,7 +36,7 @@ use Symfony\Component\Validator\Constraints as Assert;
trait InstockTrait
{
/**
* @var Collection|PartLot[] A list of part lots where this part is stored
* @var Collection<int, PartLot> A list of part lots where this part is stored
*/
#[Assert\Valid]
#[Groups(['extended', 'full', 'import'])]

View file

@ -46,7 +46,7 @@ trait ManufacturerTrait
protected ?Manufacturer $manufacturer = null;
/**
* @var string the url to the part on the manufacturer's homepage
* @var string The url to the part on the manufacturer's homepage
*/
#[Assert\Url]
#[Groups(['full', 'import', 'part:read', 'part:write'])]

View file

@ -36,7 +36,7 @@ use Doctrine\ORM\Mapping as ORM;
trait OrderTrait
{
/**
* @var Collection<int, Orderdetail> the details about how and where you can order this part
* @var Collection<int, Orderdetail> The details about how and where you can order this part
*/
#[Assert\Valid]
#[Groups(['extended', 'full', 'import'])]

View file

@ -108,21 +108,21 @@ class StorageLocation extends AbstractPartsContainingDBElement
protected Collection $parameters;
/**
* @var bool
* @var bool When this attribute is set, it is not possible to add additional parts or increase the instock of existing parts.
*/
#[Groups(['full', 'import', 'location:read', 'location:write'])]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $is_full = false;
/**
* @var bool
* @var bool When this property is set, only one part (but many instock) is allowed to be stored in this store location.
*/
#[Groups(['full', 'import', 'location:read', 'location:write'])]
#[ORM\Column(type: Types::BOOLEAN)]
protected bool $only_single_part = false;
/**
* @var bool
* @var bool When this property is set, it is only possible to increase the instock of parts, that are already stored here.
*/
#[Groups(['full', 'import', 'location:read', 'location:write'])]
#[ORM\Column(type: Types::BOOLEAN)]

View file

@ -108,7 +108,7 @@ class Supplier extends AbstractCompany
protected ?Currency $default_currency = null;
/**
* @var BigDecimal|null the shipping costs that have to be paid, when ordering via this supplier
* @var BigDecimal|null The shipping costs that have to be paid, when ordering via this supplier
*/
#[Groups(['extended', 'full', 'import'])]
#[ORM\Column(name: 'shipping_costs', nullable: true, type: 'big_decimal', precision: 11, scale: 5)]