<?php

namespace App\Entity;

use App\Repository\ContratsPaymentsRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Attribute\Uploadable;
use Vich\UploaderBundle\Mapping\Attribute\UploadableField;

#[ORM\Entity(repositoryClass: ContratsPaymentsRepository::class)]
#[Uploadable]
class ContratsPayments
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\ManyToOne(inversedBy: 'contratsPayments')]
    private ?Contrats $contrat = null;

    #[ORM\Column(length: 255)]
    private ?string $type = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $typePayment = null;

    #[ORM\Column(length: 255)]
    private ?string $paymentId = null;

    #[ORM\Column(length: 255)]
    private ?string $state = null;

    #[ORM\Column(nullable: true)]
    private ?\DateTimeImmutable $paymentAt = null;

    #[ORM\Column(nullable: true)]
    private ?float $amount = null;

    #[ORM\Column(nullable: true)]
    private ?\DateTimeImmutable $validateAt = null;

    #[ORM\Column(type: Types::JSON,nullable: true)]
    private array $card = [];


    #[UploadableField(mapping: 'payment_confirmed', fileNameProperty: 'paymentFileName', size: 'paymentFileSize')]
    private ?File $paymentFile = null;
    #[ORM\Column(nullable: true)]
    private ?string $paymentFileName = null;
    #[ORM\Column(nullable: true)]
    private ?int $paymentFileSize = null;

    #[UploadableField(mapping: 'payment_confirmed_signed', fileNameProperty: 'paymentSignedFileName', size: 'paymentSignedFileSize')]
    private ?File $paymentSignedFile = null;
    #[ORM\Column(nullable: true)]
    private ?string $paymentSignedFileName = null;
    #[ORM\Column(nullable: true)]
    private ?int $paymentSignedFileSize = null;

    #[ORM\Column(nullable: true)]
    private ?\DateTimeImmutable $updateAt = null;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getContrat(): ?Contrats
    {
        return $this->contrat;
    }

    public function setContrat(?Contrats $contrat): static
    {
        $this->contrat = $contrat;

        return $this;
    }

    public function getType(): ?string
    {
        return $this->type;
    }

    public function setType(string $type): static
    {
        $this->type = $type;

        return $this;
    }

    public function getTypePayment(): ?string
    {
        return $this->typePayment;
    }

    public function setTypePayment(?string $typePayment): static
    {
        $this->typePayment = $typePayment;

        return $this;
    }

    public function getPaymentId(): ?string
    {
        return $this->paymentId;
    }

    public function setPaymentId(string $paymentId): static
    {
        $this->paymentId = $paymentId;

        return $this;
    }

    public function getState(): ?string
    {
        return $this->state;
    }

    public function setState(string $state): static
    {
        $this->state = $state;

        return $this;
    }

    public function getPaymentAt(): ?\DateTimeImmutable
    {
        return $this->paymentAt;
    }

    public function setPaymentAt(\DateTimeImmutable $paymentAt): static
    {
        $this->paymentAt = $paymentAt;

        return $this;
    }

    public function getAmount(): ?float
    {
        return $this->amount;
    }

    public function setAmount(?float $amount): static
    {
        $this->amount = $amount;

        return $this;
    }

    public function getValidateAt(): ?\DateTimeImmutable
    {
        return $this->validateAt;
    }

    public function setValidateAt(\DateTimeImmutable $validateAt): static
    {
        $this->validateAt = $validateAt;

        return $this;
    }

    public function getCard(): array
    {
        return $this->card;
    }

    public function setCard(array $card): static
    {
        $this->card = $card;

        return $this;
    }

    /**
     * @return \DateTimeImmutable|null
     */
    public function getUpdateAt(): ?\DateTimeImmutable
    {
        return $this->updateAt;
    }

    /**
     * @return File|null
     */
    public function getPaymentFile(): ?File
    {
        return $this->paymentFile;
    }


    /**
     * @return string|null
     */
    public function getPaymentFileName(): ?string
    {
        return $this->paymentFileName;
    }

    /**
     * @return int|null
     */
    public function getPaymentFileSize(): ?int
    {
        return $this->paymentFileSize;
    }

    /**
     * @return File|null
     */
    public function getPaymentSignedFile(): ?File
    {
        return $this->paymentSignedFile;
    }

    /**
     * @return string|null
     */
    public function getPaymentSignedFileName(): ?string
    {
        return $this->paymentSignedFileName;
    }

    /**
     * @return int|null
     */
    public function getPaymentSignedFileSize(): ?int
    {
        return $this->paymentSignedFileSize;
    }

    /**
     * @param \DateTimeImmutable|null $updateAt
     */
    public function setUpdateAt(?\DateTimeImmutable $updateAt): void
    {
        $this->updateAt = $updateAt;
    }

    /**
     * @param File|null $paymentFile
     */
    public function setPaymentFile(?File $paymentFile): void
    {
        $this->paymentFile = $paymentFile;
    }

    /**
     * @param string|null $paymentFileName
     */
    public function setPaymentFileName(?string $paymentFileName): void
    {
        $this->paymentFileName = $paymentFileName;
    }

    /**
     * @param int|null $paymentFileSize
     */
    public function setPaymentFileSize(?int $paymentFileSize): void
    {
        $this->paymentFileSize = $paymentFileSize;
    }

    /**
     * @param File|null $paymentSignedFile
     */
    public function setPaymentSignedFile(?File $paymentSignedFile): void
    {
        $this->paymentSignedFile = $paymentSignedFile;
    }

    /**
     * @param string|null $paymentSignedFileName
     */
    public function setPaymentSignedFileName(?string $paymentSignedFileName): void
    {
        $this->paymentSignedFileName = $paymentSignedFileName;
    }

    /**
     * @param int|null $paymentSignedFileSize
     */
    public function setPaymentSignedFileSize(?int $paymentSignedFileSize): void
    {
        $this->paymentSignedFileSize = $paymentSignedFileSize;
    }
}
