<?php

/*
 * This file is part of the VitiCore 2.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\Shop\Model;

use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Validator\Constraints as Assert;

#[ORM\Entity(repositoryClass: 'CpCreation\VitiCore\Shop\Repository\ShippingAutoSupRepository')]
#[ORM\Table(name: 'shop_shipping_auto_sup')]
#[ORM\HasLifecycleCallbacks]
class ShippingAutoSup
{
    #[ORM\Id]
    #[ORM\Column(type: 'uuid')]
    #[ORM\GeneratedValue(strategy: 'NONE')]
    private UuidInterface $id;

    #[ORM\Column(type: 'string', nullable: true)]
    private ?string $postal = null;

    #[ORM\Column(type: 'string')]
    #[Assert\NotBlank]
    private ?string $city = null;

    #[ORM\Column(type: 'string')]
    #[Assert\NotBlank]
    private ?string $county = null;

    #[ORM\Column(type: 'string')]
    #[Assert\NotBlank]
    private ?string $country = null;

    #[ORM\Column(type: 'boolean')]
    private bool $verification;

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

    public function __construct()
    {
        $this->id = Uuid::uuid4();
        $this->verification = false;
    }

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

    public function getPostal(): ?string
    {
        return $this->postal;
    }

    public function setPostal(?string $postal): void
    {
        $this->postal = $postal;
    }

    public function getCity(): ?string
    {
        return $this->city;
    }

    public function setCity(?string $city = null): void
    {
        $this->city = $city;
    }

    public function getCounty(): ?string
    {
        return $this->county;
    }

    public function setCounty(?string $county): void
    {
        $this->county = $county;
    }

    public function getCountry(): ?string
    {
        return $this->country;
    }

    public function setCountry(?string $country): void
    {
        $this->country = $country;
    }

    public function isVerification(): bool
    {
        return $this->verification;
    }

    public function setVerification(bool $verification): void
    {
        $this->verification = $verification;
    }

    public function getOldName(): ?string
    {
        return $this->oldName;
    }

    public function setOldName(string $oldName): void
    {
        $this->oldName = $oldName;
    }
}
