<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\ServiceOrderHistoryRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use ApiPlatform\Core\Annotation\ApiProperty;
#[ORM\Entity(repositoryClass: ServiceOrderHistoryRepository::class)]
#[ApiResource(
normalizationContext: ['groups' => ['service_history:read']],
denormalizationContext: ['groups' => ['service_history:write']],
order: ['id' => 'DESC'],
)]
#[ApiFilter(SearchFilter::class, properties: [
'personalAccount.id' => 'exact',
'personalAccount.owner.id' => 'exact',
])]
class ServiceOrderHistory
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['service_history:read', 'service_history:write'])]
private ?int $id = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateEntered = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateModified = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(length: 100, nullable: true)]
private ?string $type = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(length: 100, nullable: true)]
private ?string $status = null;
#[ORM\ManyToOne(inversedBy: 'serviceOrderHistories')]
private ?AppPersonalAccount $personalAccount = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(length: 255, nullable: true)]
private ?string $pdf = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(length: 100, nullable: true)]
private ?string $idCrm = null;
#[Groups(['service_history:read', 'service_history:write'])]
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getDateEntered(): ?\DateTimeInterface
{
return $this->dateEntered;
}
public function setDateEntered(?\DateTimeInterface $dateEntered): static
{
$this->dateEntered = $dateEntered;
return $this;
}
public function getDateModified(): ?\DateTimeInterface
{
return $this->dateModified;
}
public function setDateModified(?\DateTimeInterface $dateModified): static
{
$this->dateModified = $dateModified;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): static
{
$this->type = $type;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): static
{
$this->status = $status;
return $this;
}
public function getPersonalAccount(): ?AppPersonalAccount
{
return $this->personalAccount;
}
public function setPersonalAccount(?AppPersonalAccount $personalAccount): static
{
$this->personalAccount = $personalAccount;
return $this;
}
public function getPdf(): ?string
{
return $this->pdf;
}
public function setPdf(?string $pdf): static
{
$this->pdf = $pdf;
return $this;
}
public function getIdCrm(): ?string
{
return $this->idCrm;
}
public function setIdCrm(?string $idCrm): static
{
$this->idCrm = $idCrm;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
}