<?php
namespace App\Entity\Channel\Payment;
use App\Entity\Channel\Channel;
use App\Enum\Pennylane\InvoiceStatusEnum;
use App\Repository\Channel\Payment\LicensesInvoiceRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[
ORM\Entity(repositoryClass: LicensesInvoiceRepository::class),
ORM\Table(name: 'channel_licenses_invoice'),
]
class LicensesInvoice
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: Channel::class)]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Channel $channel = null;
#[ORM\Column(type: 'string', nullable: false)]
private ?string $invoiceNumber = null;
#[ORM\Column(type: 'date_immutable', nullable: false)]
private ?\DateTimeImmutable $deadlineAt = null;
#[ORM\Column(type: 'string', nullable: false)]
private ?string $amount = null;
#[ORM\Column(type: 'string', nullable: false)]
private ?string $pennylaneId = null;
#[ORM\Column(type: 'datetime_immutable', nullable: false)]
private ?\DateTimeImmutable $pennylaneCreatedAt = null;
#[ORM\Column(type: 'datetime_immutable', nullable: false)]
private ?\DateTimeImmutable $pennylaneUpdateAt = null;
#[ORM\Column(type: 'string', nullable: false, options: ['default' => InvoiceStatusEnum::UPCOMING])]
#[Assert\Choice(callback: [InvoiceStatusEnum::class, 'getChoices'])]
private string $pennylanePaymentStatus = InvoiceStatusEnum::UPCOMING;
public function getId(): ?int
{
return $this->id;
}
public function getChannel(): ?Channel
{
return $this->channel;
}
public function setChannel(?Channel $channel): LicensesInvoice
{
$this->channel = $channel;
return $this;
}
public function getInvoiceNumber(): ?string
{
return $this->invoiceNumber;
}
public function setInvoiceNumber(?string $invoiceNumber): LicensesInvoice
{
$this->invoiceNumber = $invoiceNumber;
return $this;
}
public function getDeadlineAt(): ?\DateTimeImmutable
{
return $this->deadlineAt;
}
public function setDeadlineAt(?\DateTimeImmutable $deadlineAt): LicensesInvoice
{
$this->deadlineAt = $deadlineAt;
return $this;
}
public function getAmount(): ?string
{
return $this->amount;
}
public function setAmount(?string $amount): LicensesInvoice
{
$this->amount = $amount;
return $this;
}
public function getPennylaneId(): ?string
{
return $this->pennylaneId;
}
public function setPennylaneId(?string $pennylaneId): LicensesInvoice
{
$this->pennylaneId = $pennylaneId;
return $this;
}
public function getPennylaneCreatedAt(): ?\DateTimeImmutable
{
return $this->pennylaneCreatedAt;
}
public function setPennylaneCreatedAt(?\DateTimeImmutable $pennylaneCreatedAt): LicensesInvoice
{
$this->pennylaneCreatedAt = $pennylaneCreatedAt;
return $this;
}
public function getPennylaneUpdateAt(): ?\DateTimeImmutable
{
return $this->pennylaneUpdateAt;
}
public function setPennylaneUpdateAt(?\DateTimeImmutable $pennylaneUpdateAt): LicensesInvoice
{
$this->pennylaneUpdateAt = $pennylaneUpdateAt;
return $this;
}
public function getPennylanePaymentStatus(): string
{
return $this->pennylanePaymentStatus;
}
public function setPennylanePaymentStatus(string $pennylanePaymentStatus): LicensesInvoice
{
$this->pennylanePaymentStatus = $pennylanePaymentStatus;
return $this;
}
}