['project_task:read']], denormalizationContext: ['groups' => ['project_task:write']], order: ['createdAt' => 'DESC'] )] #[ApiFilter(SearchFilter::class, properties: ['name' => 'partial', 'project.name' => 'partial'])] #[ApiFilter(DateFilter::class, properties: ['createdAt', 'updatedAt'])] #[ApiFilter(ProjectTaskProjectFilter::class)] class ProjectTask implements ModuleAwareInterface { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(['project_task:read'])] private ?int $id = null; #[ORM\Column(length: 255)] #[Groups(['project_task:read', 'project_task:write'])] #[Assert\NotBlank(message: 'Der Name der Tätigkeit darf nicht leer sein')] #[Assert\Length(max: 255)] private ?string $name = null; #[ORM\Column(type: Types::TEXT, nullable: true)] #[Groups(['project_task:read', 'project_task:write'])] private ?string $description = null; #[ORM\ManyToOne(targetEntity: Project::class)] #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')] #[Groups(['project_task:read', 'project_task:write'])] private ?Project $project = null; #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)] #[Groups(['project_task:read', 'project_task:write'])] #[Assert\PositiveOrZero(message: 'Das Budget muss positiv sein')] private ?string $budget = null; #[ORM\Column(type: Types::DECIMAL, precision: 8, scale: 2, nullable: true)] #[Groups(['project_task:read', 'project_task:write'])] #[Assert\PositiveOrZero(message: 'Das Stundenkontingent muss positiv sein')] private ?string $hourContingent = null; #[ORM\Column(type: Types::DECIMAL, precision: 8, scale: 2, nullable: true)] #[Groups(['project_task:read', 'project_task:write'])] #[Assert\PositiveOrZero(message: 'Der Stundensatz muss positiv sein')] private ?string $hourlyRate = null; #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)] #[Groups(['project_task:read', 'project_task:write'])] #[Assert\PositiveOrZero(message: 'Der Gesamtpreis muss positiv sein')] private ?string $totalPrice = null; #[ORM\Column] #[Groups(['project_task:read'])] private ?\DateTimeImmutable $createdAt = null; #[ORM\Column(nullable: true)] #[Groups(['project_task:read'])] private ?\DateTimeImmutable $updatedAt = null; public function __construct() { $this->createdAt = new \DateTimeImmutable(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getProject(): ?Project { return $this->project; } public function setProject(?Project $project): static { $this->project = $project; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getBudget(): ?string { return $this->budget; } public function setBudget(?string $budget): static { $this->budget = $budget; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getHourContingent(): ?string { return $this->hourContingent; } public function setHourContingent(?string $hourContingent): static { $this->hourContingent = $hourContingent; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getHourlyRate(): ?string { return $this->hourlyRate; } public function setHourlyRate(?string $hourlyRate): static { $this->hourlyRate = $hourlyRate; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getTotalPrice(): ?string { return $this->totalPrice; } public function setTotalPrice(?string $totalPrice): static { $this->totalPrice = $totalPrice; $this->updatedAt = new \DateTimeImmutable(); return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function __toString(): string { return $this->name ?? ''; } /** * Returns the module code this entity belongs to. * Required by ModuleVoter for permission checks. */ public function getModuleName(): string { return 'project_tasks'; } }