<?php
namespace App\Entity;
use App\Repository\DemandRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=DemandRepository::class)
*/
class Demand
{
/**
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*/
public string $id;
/**
* @ORM\Column(type="integer", nullable=true)
*/
public ?int $raynetLeadId = null;
/**
* @ORM\Column(type="string", length=255)
*/
public string $place;
/**
* @ORM\Column(type="float")
*/
public float $floor_area;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('SALE', 'LEASE')"))
*/
public string $kind;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('HOUSE', 'FLAT')"))
*/
public string $property_type;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('FAMILY_HOUSE', 'HUT', 'COTTAGE')", nullable="true"))
*/
public string|null $house_type;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('BAD', 'NOTHING_MUCH', 'GOOD', 'VERY_GOOD', 'NEW', 'EXCELLENT')"), nullable="true")
*/
public string $rating;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('PRIVATE', 'COOPERATIVE', 'COUNCIL', 'OTHER')"), nullable=true)
*/
public string $ownership;
// TODO: SELECT
/**
* @ORM\Column(type="string", length=255, columnDefinition="ENUM('1+KK', '1+1', '2+KK', '2+1', '3+KK', '3+1', '4+KK', '4+1', 'jiné')"), nullable=true)
*/
public string $local_type;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('BRICK', 'PANEL', 'WOOD', 'STONE', 'MONTAGE', 'MIXED', 'LOW_ENERGY', 'OTHER')"), nullable=true)
*/
public string $construction;
/**
* @ORM\Column(type="integer", nullable=true)
*/
public int $floor;
/**
* @ORM\Column(type="integer", nullable=true)
*/
public int $total_floors;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
public bool $lift;
/**
* @ORM\Column(type="string", length=255)
*/
public string $name;
/**
* @ORM\Column(type="string", length=255)
*/
public string $email;
/**
* @ORM\Column(type="string", length=255)
*/
public string $phone;
/**
* @ORM\Column(type="text", nullable=true)
*/
public string $message;
/**
* @ORM\Column(type="text", nullable=true)
*/
public string|null $note;
/**
* @ORM\Column(type="string", length=100, columnDefinition="ENUM('NEW', 'HOT_LEAD', 'RESOLVING', 'WON', 'IRRELEVANT', 'WRONG_DATA', 'LOST', 'REMIND', 'CALL_AGAIN', 'LOSE')"), nullable=true)
*/
public string $state;
/**
* @ORM\Column(type="text", nullable=true)
*/
public string $valuoLink;
/**
* @ORM\Column(type="integer")
*/
public int $ctaNumber;
/**
* @ORM\Column(type="float", nullable=true)
*/
public float $garages;
/**
* @ORM\Column(type="float", nullable=true)
*/
public float $parking_spaces;
/**
* @ORM\Column(type="float", nullable=true)
*/
public float $balcony_area;
/**
* @ORM\Column(type="float", nullable=true)
*/
public float $garden_area;
/**
* @ORM\Column(type="float", nullable=true)
*/
public float $other_area;
/**
* @Assert\Type(type="boolean", groups={"flow_calculator_step1"})
*/
public bool $isSkipped = false;
/**
* @Assert\Type(type="string", groups={"flow_calculator_step1"})
*/
public string $coordinates = '';
/**
* @ORM\Column(type="datetime", nullable=false)
*/
public \DateTime $createdAt;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedMaxPrice;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedMaxPriceMeter;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedMinPrice;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedMinPriceMeter;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedAvgPrice;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedAvgPriceMeter;
/**
* @ORM\Column(type="string", nullable=true)
*/
public string $formattedAsOf;
public function __construct()
{
$this->createdAt = new \DateTime('now');
}
public const KIND_SALE = 'SALE';
public const KIND_LEASE = 'LEASE';
public const PROPERTY_TYPE_HOUSE = 'HOUSE';
public const PROPERTY_TYPE_FLAT = 'FLAT';
public const HOUSE_TYPE_FAMILY_HOUSE = 'FAMILY_HOUSE';
public const HOUSE_TYPE_HUT = 'HUT';
public const HOUSE_TYPE_COTTAGE = 'COTTAGE';
public const RATING_UNINHABITABLE = 'BAD';
public const RATING_BRECONSTRUCTION = 'NOTHING_MUCH';
public const RATING_AVERAGE = 'GOOD';
public const RATING_ARECONSTRUCTION = 'VERY_GOOD';
public const RATING_NEW = 'NEW';
public const RATING_EXCELLENT = 'EXCELLENT';
public const OWNERSHIP_PRIVATE = 'PRIVATE';
public const OWNERSHIP_COOPERATIVE = 'COOPERATIVE';
public const OWNERSHIP_COUNCIL = 'COUNCIL';
public const OWNERSHIP_OTHER = 'OTHER';
public const LOCAL_TYPE_1K = '1+KK';
public const LOCAL_TYPE_11 = '1+1';
public const LOCAL_TYPE_2K = '2+KK';
public const LOCAL_TYPE_21 = '2+1';
public const LOCAL_TYPE_3K = '3+KK';
public const LOCAL_TYPE_31 = '3+1';
public const LOCAL_TYPE_4K = '4+KK';
public const LOCAL_TYPE_41 = '4+1';
public const LOCAL_TYPE_OTHER = 'jiné';
public const CONSTRUCTION_BRICK = 'BRICK';
public const CONSTRUCTION_PANEL = 'PANEL';
public const CONSTRUCTION_WOOD = 'WOOD';
public const CONSTRUCTION_STONE = 'STONE';
public const CONSTRUCTION_MONTAGE = 'MONTAGE';
public const CONSTRUCTION_MIXED = 'MIXED';
public const CONSTRUCTION_LOW_ENERGY = 'LOW_ENERGY';
public const CONSTRUCTION_OTHER = 'OTHER';
public const ACCESSORIES_GARAGE = 'GARAGE';
public const ACCESSORIES_BALCONY = 'BALCONY';
public const ACCESSORIES_GARDEN = 'GARDEN';
public const ACCESSORIES_PARKPLACE = 'PARKPLACE';
public const STATE_NEW = 'NEW';
public const STATE_HOT_LEAD = 'HOT_LEAD';
public const STATE_RESOLVING = 'RESOLVING';
public const STATE_WON = 'WON';
public const STATE_LOSE = 'LOSE';
public const STATE_IRRELEVANT = 'IRRELEVANT';
public const STATE_WRONG_DATA = 'WRONG_DATA';
public const STATE_LOST = 'LOST';
public const STATE_REMIND = 'REMIND';
public const STATE_CALL_AGAIN = 'CALL_AGAIN';
public const STATE_NOT_CURRENT = 'NOT_CURRENT';
public const STATE_CHOICES = [
self::STATE_NEW => 'Nový',
self::STATE_HOT_LEAD => 'Hot lead',
self::STATE_RESOLVING => 'V řešení BO',
self::STATE_WON => 'Vyhráno',
self::STATE_LOSE => 'Prohráno',
self::STATE_IRRELEVANT => 'Nerelevantní',
self::STATE_WRONG_DATA => 'Neplatné údaje',
self::STATE_LOST => 'Nemá zájem',
self::STATE_REMIND => 'Připomínat',
self::STATE_CALL_AGAIN => 'Zavolat znovu',
self::STATE_NOT_CURRENT => 'Není aktuální',
];
public const PROPERTY_TYPE_CHOICES = [
self::PROPERTY_TYPE_HOUSE => 'Dům',
self::PROPERTY_TYPE_FLAT => 'Byt',
];
public const PROPERTY_TYPE_CHOICES_RAYNET = [
self::PROPERTY_TYPE_HOUSE => 'chata',
self::PROPERTY_TYPE_FLAT => 'byt',
];
public const HOUSE_TYPE_CHOICES = [
self::HOUSE_TYPE_FAMILY_HOUSE => 'Rodinný dům',
self::HOUSE_TYPE_HUT => 'chata',
self::HOUSE_TYPE_COTTAGE => 'chalupa',
];
public const KIND_CHOICES = [
self::KIND_SALE => 'Prodej',
self::KIND_LEASE => 'Pronájem',
];
public const KIND_CHOICES_RAYNET_ID = [
self::KIND_SALE => 540,
self::KIND_LEASE => 541,
];
public const RATING_CHOICES = [
self::RATING_UNINHABITABLE => 'Neobývatelný',
self::RATING_BRECONSTRUCTION => 'Před rekonstrukcí',
self::RATING_AVERAGE => 'Průměrný',
self::RATING_ARECONSTRUCTION => 'Velmi dobrý',
self::RATING_NEW => 'Novostavba',
self::RATING_EXCELLENT => 'Luxusní',
];
public const RATING_CHOICES_RAYNET = [
self::RATING_UNINHABITABLE => 'neobývatelný',
self::RATING_BRECONSTRUCTION => 'před rekonstrukcí',
self::RATING_AVERAGE => 'průměrný',
self::RATING_ARECONSTRUCTION => 'velmi dobrý',
self::RATING_NEW => 'novostavba',
self::RATING_EXCELLENT => 'luxusní',
];
public const OWNERSHIP_CHOICES_RAYNET = [
self::OWNERSHIP_PRIVATE => 'osobní',
self::OWNERSHIP_COOPERATIVE => 'družstevní',
self::OWNERSHIP_COUNCIL => 'státní/obecní',
self::OWNERSHIP_OTHER => 'jiné',
];
public const OWNERSHIP_CHOICES = [
self::OWNERSHIP_PRIVATE => 'Osobní',
self::OWNERSHIP_COOPERATIVE => 'Družstevní',
self::OWNERSHIP_COUNCIL => 'Státní/Obecní',
self::OWNERSHIP_OTHER => 'Jiné',
];
public const LOCAL_TYPE_CHOICES = [
self::LOCAL_TYPE_1K => '1+kk',
self::LOCAL_TYPE_11 => '1+1',
self::LOCAL_TYPE_2K => '2+kk',
self::LOCAL_TYPE_21 => '2+1',
self::LOCAL_TYPE_3K => '3+kk',
self::LOCAL_TYPE_31 => '3+1',
self::LOCAL_TYPE_4K => '4+kk',
self::LOCAL_TYPE_41 => '4+1',
self::LOCAL_TYPE_OTHER => 'jiné',
];
public const CONSTRUCTION_CHOICES = [
self::CONSTRUCTION_BRICK => 'Cihlová',
self::CONSTRUCTION_WOOD => 'Dřevěná',
self::CONSTRUCTION_STONE => 'Kamenná',
self::CONSTRUCTION_MONTAGE => 'Montovaná',
self::CONSTRUCTION_PANEL => 'Panelová',
self::CONSTRUCTION_MIXED => 'Smíšená',
self::CONSTRUCTION_LOW_ENERGY => 'Nízkonákladová',
self::CONSTRUCTION_OTHER => 'Jiná',
];
}