Feat: Make fees editable, duplicatable and add internal name

This commit is contained in:
Björn Fromme
2023-10-20 16:35:56 +02:00
parent 992bdcc46c
commit 9e9608e604
9 changed files with 205 additions and 5 deletions
+28
View File
@@ -27,6 +27,22 @@ class Fee implements BlameableEntityInterface, TimestampableEntityInterface
#[Assert\NotBlank(message: 'Bitte gib die Bezeichnung an')]
private ?string $name = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Bitte gib die interne Bezeichnung an')]
private ?string $nameInternal = null;
public static function duplicate(Fee $fee): static
{
$instance = new static();
$instance
->setName($fee->getName())
->setNameInternal($fee->getNameInternal())
->setValue($fee->getValue())
;
return $instance;
}
public function getId(): ?int
{
return $this->id;
@@ -55,4 +71,16 @@ class Fee implements BlameableEntityInterface, TimestampableEntityInterface
return $this;
}
public function getNameInternal(): ?string
{
return $this->nameInternal;
}
public function setNameInternal(?string $nameInternal): static
{
$this->nameInternal = $nameInternal;
return $this;
}
}