export budget, timeBudget and budgetType (#2812)

This commit is contained in:
Kevin Papst
2021-10-04 16:57:45 +02:00
committed by GitHub
parent d25653b6ed
commit 9453947309
9 changed files with 54 additions and 29 deletions

View File

@@ -9,6 +9,7 @@
namespace App\Entity;
use App\Export\Annotation as Exporter;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
@@ -23,7 +24,7 @@ trait BudgetTrait
* @Serializer\Expose()
* @Serializer\Groups({"Activity_Entity", "Project_Entity", "Customer_Entity"})
*
* @ Exporter\Expose(label="label.budget")
* @Exporter\Expose(label="label.budget", type="float")
*
* @ORM\Column(name="budget", type="float", nullable=false)
* @Assert\Range(min=0.00, max=900000000000.00)
@@ -38,7 +39,7 @@ trait BudgetTrait
* @Serializer\Expose()
* @Serializer\Groups({"Activity_Entity", "Project_Entity", "Customer_Entity"})
*
* @ Exporter\Expose(label="label.timeBudget", type="duration")
* @Exporter\Expose(label="label.timeBudget", type="duration")
*
* @ORM\Column(name="time_budget", type="integer", nullable=false)
* @Assert\Range(min=0, max=2145600000)
@@ -55,7 +56,7 @@ trait BudgetTrait
* @Serializer\Expose()
* @Serializer\Groups({"Activity_Entity", "Project_Entity", "Customer_Entity"})
*
* @ Exporter\Expose(label="label.timeBudget", type="duration")
* @Exporter\Expose(label="label.budgetType")
*
* @ORM\Column(name="budget_type", type="string", length=10, nullable=true)
*/
@@ -99,6 +100,11 @@ trait BudgetTrait
$this->budgetType = $budgetType;
}
public function setIsMonthlyBudget(): void
{
$this->setBudgetType('month');
}
public function getBudgetType(): ?string
{
return $this->budgetType;