src/Entity/SriDocument.php line 17

  1. <?php
  2. /*
  3.  *  @author Guerby Duval <info@tranzaksyon.com>
  4.  *  @link https://tranzaksyon.com
  5.  *  @copyright You are not allowed to remove this author "Guerby Duval <info@tranzaksyon.com>", the link "https://tranzaksyon.com" neither this copyright.
  6.  */
  7. namespace App\Entity;
  8. use App\Repository\SriDocumentRepository;
  9. use Doctrine\DBAL\Types\Types;
  10. use Doctrine\ORM\Mapping as ORM;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. use Symfony\Component\Validator\Constraints\NotBlank;
  13. #[ORM\Entity(repositoryClass: SriDocumentRepository::class)]
  14. class SriDocument
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     #[Groups(['document_out'])]
  20.     private ?int $id = null;
  21.     #[ORM\Column(length: 255)]
  22.     #[Groups(['document_out'])]
  23.     #[NotBlank(groups: ['invoice-received'])]
  24.     private ?string $claveAccesso = null;
  25.     #[ORM\OneToOne(inversedBy: 'sriDocument', cascade: ['persist'])]
  26.     #[Groups(['document_in'])]
  27.     #[NotBlank]
  28.     private ?Invoice $invoice = null;
  29.     #[ORM\OneToOne(mappedBy: 'document', cascade: ['persist', 'remove'])]
  30.     private ?Lote $lote = null;
  31.     #[ORM\Column(length: 15)]
  32.     #[Groups(['document_out'])]
  33.     #[NotBlank(groups: ['invoice-received'])]
  34.     private ?string $secuencial = null;
  35.     #[ORM\Column(length: 25, nullable: true, columnDefinition: "ENUM('APROBADO','RECHAZADO', 'EN_PROGRESO', 'CANCELLING')")]
  36.     #[Groups(['document_out'])]
  37.     private ?string $estado = null;
  38.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  39.     #[Groups(['document_out'])]
  40.     private ?string $error = null;
  41.     #[ORM\Column(length: 3)]
  42.     #[Groups(['document_out'])]
  43.     #[NotBlank(groups: ['invoice-received'])]
  44.     private ?string $serie1 = null;
  45.     #[ORM\Column(length: 3)]
  46.     #[Groups(['document_out'])]
  47.     #[NotBlank(groups: ['invoice-received'])]
  48.     private ?string $serie2 = null;
  49.     #[ORM\Column(nullable: true)]
  50.     #[Groups(['document_out', 'document_in'])]
  51.     private ?bool $cancel = null;
  52.     #[ORM\Column(nullable: true)]
  53.     private ?bool $hasFetchError = null;
  54.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  55.     #[Groups(['document_out'])]
  56.     #[NotBlank(groups: ['invoice-received'])]
  57.     private ?\DateTimeInterface $approvedDate = null;
  58.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  59.     private ?string $qr = null;
  60.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  61.     private ?string $xmlPath = null;
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getClaveAccesso(): ?string
  67.     {
  68.         return $this->claveAccesso;
  69.     }
  70.     public function setClaveAccesso(string $claveAccesso): self
  71.     {
  72.         $this->claveAccesso = $claveAccesso;
  73.         return $this;
  74.     }
  75.     public function getInvoice(): ?Invoice
  76.     {
  77.         return $this->invoice;
  78.     }
  79.     public function setInvoice(?Invoice $invoice): self
  80.     {
  81.         $this->invoice = $invoice;
  82.         return $this;
  83.     }
  84.     public function getSecuencial(): ?string
  85.     {
  86.         return $this->secuencial;
  87.     }
  88.     public function setSecuencial(string $secuencial): self
  89.     {
  90.         $this->secuencial = $secuencial;
  91.         return $this;
  92.     }
  93.     public function getEstado(): ?string
  94.     {
  95.         return $this->estado;
  96.     }
  97.     public function setEstado(?string $estado): self
  98.     {
  99.         $this->estado = $estado;
  100.         return $this;
  101.     }
  102.     public function getError(): ?string
  103.     {
  104.         return $this->error;
  105.     }
  106.     public function setError(?string $error): self
  107.     {
  108.         $this->error = $error;
  109.         return $this;
  110.     }
  111.     public function getSerie1(): ?string
  112.     {
  113.         return $this->serie1;
  114.     }
  115.     public function setSerie1(string $serie1): self
  116.     {
  117.         $this->serie1 = $serie1;
  118.         return $this;
  119.     }
  120.     public function getSerie2(): ?string
  121.     {
  122.         return $this->serie2;
  123.     }
  124.     public function setSerie2(string $serie2): self
  125.     {
  126.         $this->serie2 = $serie2;
  127.         return $this;
  128.     }
  129.     public function isCancel(): ?bool
  130.     {
  131.         return $this->cancel;
  132.     }
  133.     public function setCancel(?bool $cancel): self
  134.     {
  135.         $this->cancel = $cancel;
  136.         return $this;
  137.     }
  138.     public function isHasFetchError(): ?bool
  139.     {
  140.         return $this->hasFetchError;
  141.     }
  142.     public function setHasFetchError(?bool $hasFetchError): self
  143.     {
  144.         $this->hasFetchError = $hasFetchError;
  145.         return $this;
  146.     }
  147.     public function getApprovedDate(): ?\DateTimeInterface
  148.     {
  149.         return $this->approvedDate;
  150.     }
  151.     public function setApprovedDate(?\DateTimeInterface $approvedDate): static
  152.     {
  153.         $this->approvedDate = $approvedDate;
  154.         return $this;
  155.     }
  156.     public function getQr(): ?string
  157.     {
  158.         return $this->qr;
  159.     }
  160.     public function setQr(?string $qr): static
  161.     {
  162.         $this->qr = $qr;
  163.         return $this;
  164.     }
  165.     public function getXmlPath(): ?string
  166.     {
  167.         return $this->xmlPath;
  168.     }
  169.     public function setXmlPath(?string $xmlPath): static
  170.     {
  171.         $this->xmlPath = $xmlPath;
  172.         return $this;
  173.     }
  174.     public function getLote(): ?Lote
  175.     {
  176.         return $this->lote;
  177.     }
  178.     public function setLote(Lote $lote): static
  179.     {
  180.         // set the owning side of the relation if necessary
  181.         if ($lote->getDocument() !== $this) {
  182.             $lote->setDocument($this);
  183.         }
  184.         $this->lote = $lote;
  185.         return $this;
  186.     }
  187. }