<?php
namespace JanusHercules\PotentialCustomerBusinessInfo\Domain\Entity;
use App\Entity\EconomicSector;
use App\Utility\DatabaseIdGenerator;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity]
#[ORM\Table(name: 'potential_customer_business_infos')]
#[ORM\UniqueConstraint(name: 'business_name_unique_idx', columns: ['business_name'])]
class PotentialCustomerBusinessInfo
{
public function __construct(
string $businessName,
?string $businessSize,
string $city,
?string $contactEmail,
?string $contactName,
EconomicSector $economicSector,
string $streetAddress,
?string $turnover,
string $zipcode,
int $numberOfAvailableJobs
) {
$this->businessName = $businessName;
$this->businessSize = $businessSize;
$this->city = $city;
$this->contactEmail = $contactEmail;
$this->contactName = $contactName;
$this->economicSector = $economicSector;
$this->streetAddress = $streetAddress;
$this->turnover = $turnover;
$this->zipcode = $zipcode;
$this->numberOfAvailableJobs = $numberOfAvailableJobs;
}
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: DatabaseIdGenerator::class)]
#[ORM\Column(
name: 'id',
type: Types::GUID)]
#[ORM\Id]
private ?string $id = null;
public function getId(): ?string
{
return $this->id;
}
#[ORM\Column(
name: 'business_name',
type: Types::STRING,
length: 255,
nullable: false
)]
private string $businessName;
public function getBusinessName(): string
{
return $this->businessName;
}
public function setBusinessName(string $businessName): void
{
$this->businessName = $businessName;
}
#[ORM\Column(
name: 'business_size',
type: Types::TEXT,
length: 255,
nullable: true
)]
private ?string $businessSize;
public function getBusinessSize(): ?string
{
return $this->businessSize;
}
public function setBusinessSize(?string $businessSize): void
{
$this->businessSize = $businessSize;
}
#[ORM\Column(
name: 'city',
type: Types::TEXT,
length: 255,
nullable: false
)]
private string $city;
public function getCity(): string
{
return $this->city;
}
public function setCity(string $city): void
{
$this->city = $city;
}
#[ORM\Column(
name: 'contact_email',
type: Types::TEXT,
length: 255,
nullable: true
)]
#[Assert\Email(mode: 'strict')]
private ?string $contactEmail;
public function getContactEmail(): ?string
{
return $this->contactEmail;
}
public function setContactEmail(?string $contactEmail): void
{
$this->contactEmail = $contactEmail;
}
#[ORM\Column(
name: 'contact_name',
type: Types::TEXT,
length: 255,
nullable: true
)]
private ?string $contactName;
public function getContactName(): ?string
{
return $this->contactName;
}
public function setContactName(?string $contactName): void
{
$this->contactName = $contactName;
}
#[ORM\ManyToOne(
targetEntity: EconomicSector::class,
cascade: ['persist']
)]
#[ORM\JoinColumn(
name: 'economic_sectors_id',
referencedColumnName: 'id',
nullable: true,
onDelete: 'CASCADE'
)]
private EconomicSector $economicSector;
public function getEconomicSector(): EconomicSector
{
return $this->economicSector;
}
public function setEconomicSector(EconomicSector $economicSector): void
{
$this->economicSector = $economicSector;
}
#[ORM\Column(
name: 'street_address',
type: Types::TEXT,
length: 255,
nullable: false
)]
private string $streetAddress;
public function getStreetAddress(): string
{
return $this->streetAddress;
}
public function setStreetAddress(string $streetAddress): void
{
$this->streetAddress = $streetAddress;
}
#[ORM\Column(
name: 'turnover',
type: Types::TEXT,
length: 255,
nullable: true
)]
private ?string $turnover;
public function getTurnover(): ?string
{
return $this->turnover;
}
public function setTurnover(?string $turnover): void
{
$this->turnover = $turnover;
}
#[ORM\Column(
name: 'zipcode',
type: Types::TEXT,
length: 255,
nullable: false
)]
private string $zipcode;
public function getZipcode(): string
{
return $this->zipcode;
}
public function setZipcode(string $zipcode): void
{
$this->zipcode = $zipcode;
}
#[ORM\Column(
name: 'number_of_available_jobs',
type: Types::INTEGER,
nullable: false
)]
private int $numberOfAvailableJobs;
public function getNumberOfAvailableJobs(): int
{
return $this->numberOfAvailableJobs;
}
public function setNumberOfAvailableJobs(int $numberOfAvailableJobs): void
{
$this->numberOfAvailableJobs = $numberOfAvailableJobs;
}
}