Moved custom validators from annotations to attributes

This commit is contained in:
Jan Böhmer 2023-06-11 19:32:15 +02:00
parent e5a14557a2
commit 930adaf439
27 changed files with 50 additions and 148 deletions

View file

@ -51,9 +51,9 @@ class Currency extends AbstractStructuralDBElement
/**
* @var BigDecimal|null The exchange rate between this currency and the base currency
* (how many base units the current currency is worth)
* @BigDecimalPositive()
*/
#[ORM\Column(type: 'big_decimal', precision: 11, scale: 5, nullable: true)]
#[BigDecimalPositive()]
protected ?BigDecimal $exchange_rate = null;
/**

View file

@ -53,20 +53,20 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
/**
* @var BigDecimal The price related to the detail. (Given in the selected currency)
* @BigDecimalPositive()
*/
#[Groups(['extended', 'full'])]
#[ORM\Column(type: 'big_decimal', precision: 11, scale: 5)]
#[BigDecimalPositive()]
protected BigDecimal $price;
/**
* @var ?Currency The currency used for the current price information.
* If this is null, the global base unit is assumed.
* @Selectable()
* If this is null, the global base unit is assumed
*/
#[Groups(['extended', 'full', 'import'])]
#[ORM\ManyToOne(targetEntity: 'Currency', inversedBy: 'pricedetails')]
#[ORM\JoinColumn(name: 'id_currency')]
#[Selectable()]
protected ?Currency $currency = null;
/**