mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Moved custom validators from annotations to attributes
This commit is contained in:
parent
e5a14557a2
commit
930adaf439
27 changed files with 50 additions and 148 deletions
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue