src/Entity/Demand.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DemandRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass=DemandRepository::class)
  9.  */
  10. class Demand
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="uuid", unique=true)
  15.      * @ORM\GeneratedValue(strategy="CUSTOM")
  16.      * @ORM\CustomIdGenerator(class=UuidGenerator::class)
  17.      */
  18.     public string $id;
  19.     /**
  20.      * @ORM\Column(type="integer", nullable=true)
  21.      */
  22.     public ?int $raynetLeadId null;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     public string $place;
  27.     /**
  28.      * @ORM\Column(type="float")
  29.      */
  30.     public float $floor_area;
  31.     /**
  32.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('SALE', 'LEASE')"))
  33.      */
  34.     public string $kind;
  35.     /**
  36.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('HOUSE', 'FLAT')"))
  37.      */
  38.     public string $property_type;
  39.     /**
  40.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('FAMILY_HOUSE', 'HUT', 'COTTAGE')", nullable="true"))
  41.      */
  42.     public string|null $house_type;
  43.     /**
  44.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('BAD', 'NOTHING_MUCH', 'GOOD', 'VERY_GOOD', 'NEW', 'EXCELLENT')"), nullable="true")
  45.      */
  46.     public string $rating;
  47.     /**
  48.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('PRIVATE', 'COOPERATIVE', 'COUNCIL', 'OTHER')"), nullable=true)
  49.      */
  50.     public string $ownership;
  51.     // TODO: SELECT
  52.     /**
  53.      * @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)
  54.      */
  55.     public string $local_type;
  56.     /**
  57.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('BRICK', 'PANEL', 'WOOD', 'STONE', 'MONTAGE', 'MIXED', 'LOW_ENERGY', 'OTHER')"), nullable=true)
  58.      */
  59.     public string $construction;
  60.     /**
  61.      * @ORM\Column(type="integer", nullable=true)
  62.      */
  63.     public int $floor;
  64.     /**
  65.      * @ORM\Column(type="integer", nullable=true)
  66.      */
  67.     public int $total_floors;
  68.     /**
  69.      * @ORM\Column(type="boolean", nullable=true)
  70.      */
  71.     public bool $lift;
  72.     /**
  73.      * @ORM\Column(type="string", length=255)
  74.      */
  75.     public string $name;
  76.     /**
  77.      * @ORM\Column(type="string", length=255)
  78.      */
  79.     public string $email;
  80.     /**
  81.      * @ORM\Column(type="string", length=255)
  82.      */
  83.     public string $phone;
  84.     /**
  85.      * @ORM\Column(type="text", nullable=true)
  86.      */
  87.     public string $message;
  88.     /**
  89.      * @ORM\Column(type="text", nullable=true)
  90.      */
  91.     public string|null $note;
  92.     /**
  93.      * @ORM\Column(type="string", length=100, columnDefinition="ENUM('NEW', 'HOT_LEAD', 'RESOLVING', 'WON', 'IRRELEVANT', 'WRONG_DATA', 'LOST', 'REMIND', 'CALL_AGAIN', 'LOSE')"), nullable=true)
  94.      */
  95.     public string $state;
  96.     /**
  97.      * @ORM\Column(type="text", nullable=true)
  98.      */
  99.     public string $valuoLink;
  100.     /**
  101.      * @ORM\Column(type="integer")
  102.      */
  103.     public int $ctaNumber;
  104.     /**
  105.      * @ORM\Column(type="float", nullable=true)
  106.      */
  107.     public float $garages;
  108.     /**
  109.      * @ORM\Column(type="float", nullable=true)
  110.      */
  111.     public float $parking_spaces;
  112.     /**
  113.      * @ORM\Column(type="float", nullable=true)
  114.      */
  115.     public float $balcony_area;
  116.     /**
  117.      * @ORM\Column(type="float", nullable=true)
  118.      */
  119.     public float $garden_area;
  120.     /**
  121.      * @ORM\Column(type="float", nullable=true)
  122.      */
  123.     public float $other_area;
  124.     /**
  125.      * @Assert\Type(type="boolean", groups={"flow_calculator_step1"})
  126.      */
  127.     public bool $isSkipped false;
  128.     /**
  129.      * @Assert\Type(type="string", groups={"flow_calculator_step1"})
  130.      */
  131.     public string $coordinates '';
  132.     /**
  133.      * @ORM\Column(type="datetime", nullable=false)
  134.      */
  135.     public \DateTime $createdAt;
  136.     /**
  137.      * @ORM\Column(type="string", nullable=true)
  138.      */
  139.     public string $formattedMaxPrice;
  140.     /**
  141.      * @ORM\Column(type="string", nullable=true)
  142.      */
  143.     public string $formattedMaxPriceMeter;
  144.     /**
  145.      * @ORM\Column(type="string", nullable=true)
  146.      */
  147.     public string $formattedMinPrice;
  148.     /**
  149.      * @ORM\Column(type="string", nullable=true)
  150.      */
  151.     public string $formattedMinPriceMeter;
  152.     /**
  153.      * @ORM\Column(type="string", nullable=true)
  154.      */
  155.     public string $formattedAvgPrice;
  156.     /**
  157.      * @ORM\Column(type="string", nullable=true)
  158.      */
  159.     public string $formattedAvgPriceMeter;
  160.     /**
  161.      * @ORM\Column(type="string", nullable=true)
  162.      */
  163.     public string $formattedAsOf;
  164.     public function __construct()
  165.     {
  166.         $this->createdAt = new \DateTime('now');
  167.     }
  168.     public const KIND_SALE 'SALE';
  169.     public const KIND_LEASE 'LEASE';
  170.     public const PROPERTY_TYPE_HOUSE 'HOUSE';
  171.     public const PROPERTY_TYPE_FLAT 'FLAT';
  172.     public const HOUSE_TYPE_FAMILY_HOUSE 'FAMILY_HOUSE';
  173.     public const HOUSE_TYPE_HUT 'HUT';
  174.     public const HOUSE_TYPE_COTTAGE 'COTTAGE';
  175.     public const RATING_UNINHABITABLE 'BAD';
  176.     public const RATING_BRECONSTRUCTION 'NOTHING_MUCH';
  177.     public const RATING_AVERAGE 'GOOD';
  178.     public const RATING_ARECONSTRUCTION 'VERY_GOOD';
  179.     public const RATING_NEW 'NEW';
  180.     public const RATING_EXCELLENT 'EXCELLENT';
  181.     public const OWNERSHIP_PRIVATE 'PRIVATE';
  182.     public const OWNERSHIP_COOPERATIVE 'COOPERATIVE';
  183.     public const OWNERSHIP_COUNCIL 'COUNCIL';
  184.     public const OWNERSHIP_OTHER 'OTHER';
  185.     public const LOCAL_TYPE_1K '1+KK';
  186.     public const LOCAL_TYPE_11 '1+1';
  187.     public const LOCAL_TYPE_2K '2+KK';
  188.     public const LOCAL_TYPE_21 '2+1';
  189.     public const LOCAL_TYPE_3K '3+KK';
  190.     public const LOCAL_TYPE_31 '3+1';
  191.     public const LOCAL_TYPE_4K '4+KK';
  192.     public const LOCAL_TYPE_41 '4+1';
  193.     public const LOCAL_TYPE_OTHER 'jiné';
  194.     public const CONSTRUCTION_BRICK 'BRICK';
  195.     public const CONSTRUCTION_PANEL 'PANEL';
  196.     public const CONSTRUCTION_WOOD 'WOOD';
  197.     public const CONSTRUCTION_STONE 'STONE';
  198.     public const CONSTRUCTION_MONTAGE 'MONTAGE';
  199.     public const CONSTRUCTION_MIXED 'MIXED';
  200.     public const CONSTRUCTION_LOW_ENERGY 'LOW_ENERGY';
  201.     public const CONSTRUCTION_OTHER 'OTHER';
  202.     public const ACCESSORIES_GARAGE 'GARAGE';
  203.     public const ACCESSORIES_BALCONY 'BALCONY';
  204.     public const ACCESSORIES_GARDEN 'GARDEN';
  205.     public const ACCESSORIES_PARKPLACE 'PARKPLACE';
  206.     public const STATE_NEW 'NEW';
  207.     public const STATE_HOT_LEAD 'HOT_LEAD';
  208.     public const STATE_RESOLVING 'RESOLVING';
  209.     public const STATE_WON 'WON';
  210.     public const STATE_LOSE 'LOSE';
  211.     public const STATE_IRRELEVANT 'IRRELEVANT';
  212.     public const STATE_WRONG_DATA 'WRONG_DATA';
  213.     public const STATE_LOST 'LOST';
  214.     public const STATE_REMIND 'REMIND';
  215.     public const STATE_CALL_AGAIN 'CALL_AGAIN';
  216.     public const STATE_NOT_CURRENT 'NOT_CURRENT';
  217.     public const STATE_CHOICES = [
  218.         self::STATE_NEW => 'Nový',
  219.         self::STATE_HOT_LEAD => 'Hot lead',
  220.         self::STATE_RESOLVING => 'V řešení BO',
  221.         self::STATE_WON => 'Vyhráno',
  222.         self::STATE_LOSE => 'Prohráno',
  223.         self::STATE_IRRELEVANT => 'Nerelevantní',
  224.         self::STATE_WRONG_DATA => 'Neplatné údaje',
  225.         self::STATE_LOST => 'Nemá zájem',
  226.         self::STATE_REMIND => 'Připomínat',
  227.         self::STATE_CALL_AGAIN => 'Zavolat znovu',
  228.         self::STATE_NOT_CURRENT => 'Není aktuální',
  229.     ];
  230.     public const PROPERTY_TYPE_CHOICES = [
  231.         self::PROPERTY_TYPE_HOUSE => 'Dům',
  232.         self::PROPERTY_TYPE_FLAT => 'Byt',
  233.     ];
  234.     public const PROPERTY_TYPE_CHOICES_RAYNET = [
  235.         self::PROPERTY_TYPE_HOUSE => 'chata',
  236.         self::PROPERTY_TYPE_FLAT => 'byt',
  237.     ];
  238.     public const HOUSE_TYPE_CHOICES = [
  239.         self::HOUSE_TYPE_FAMILY_HOUSE => 'Rodinný dům',
  240.         self::HOUSE_TYPE_HUT => 'chata',
  241.         self::HOUSE_TYPE_COTTAGE => 'chalupa',
  242.     ];
  243.     public const KIND_CHOICES = [
  244.         self::KIND_SALE => 'Prodej',
  245.         self::KIND_LEASE => 'Pronájem',
  246.     ];
  247.     public const KIND_CHOICES_RAYNET_ID = [
  248.         self::KIND_SALE => 540,
  249.         self::KIND_LEASE => 541,
  250.     ];
  251.     public const RATING_CHOICES = [
  252.         self::RATING_UNINHABITABLE => 'Neobývatelný',
  253.         self::RATING_BRECONSTRUCTION => 'Před rekonstrukcí',
  254.         self::RATING_AVERAGE => 'Průměrný',
  255.         self::RATING_ARECONSTRUCTION => 'Velmi dobrý',
  256.         self::RATING_NEW => 'Novostavba',
  257.         self::RATING_EXCELLENT => 'Luxusní',
  258.     ];
  259.     public const RATING_CHOICES_RAYNET = [
  260.         self::RATING_UNINHABITABLE => 'neobývatelný',
  261.         self::RATING_BRECONSTRUCTION => 'před rekonstrukcí',
  262.         self::RATING_AVERAGE => 'průměrný',
  263.         self::RATING_ARECONSTRUCTION => 'velmi dobrý',
  264.         self::RATING_NEW => 'novostavba',
  265.         self::RATING_EXCELLENT => 'luxusní',
  266.     ];
  267.     public const OWNERSHIP_CHOICES_RAYNET = [
  268.         self::OWNERSHIP_PRIVATE => 'osobní',
  269.         self::OWNERSHIP_COOPERATIVE => 'družstevní',
  270.         self::OWNERSHIP_COUNCIL => 'státní/obecní',
  271.         self::OWNERSHIP_OTHER => 'jiné',
  272.     ];
  273.     public const OWNERSHIP_CHOICES = [
  274.         self::OWNERSHIP_PRIVATE => 'Osobní',
  275.         self::OWNERSHIP_COOPERATIVE => 'Družstevní',
  276.         self::OWNERSHIP_COUNCIL => 'Státní/Obecní',
  277.         self::OWNERSHIP_OTHER => 'Jiné',
  278.     ];
  279.     public const LOCAL_TYPE_CHOICES = [
  280.         self::LOCAL_TYPE_1K => '1+kk',
  281.         self::LOCAL_TYPE_11 => '1+1',
  282.         self::LOCAL_TYPE_2K => '2+kk',
  283.         self::LOCAL_TYPE_21 => '2+1',
  284.         self::LOCAL_TYPE_3K => '3+kk',
  285.         self::LOCAL_TYPE_31 => '3+1',
  286.         self::LOCAL_TYPE_4K => '4+kk',
  287.         self::LOCAL_TYPE_41 => '4+1',
  288.         self::LOCAL_TYPE_OTHER => 'jiné',
  289.     ];
  290.     public const CONSTRUCTION_CHOICES = [
  291.         self::CONSTRUCTION_BRICK => 'Cihlová',
  292.         self::CONSTRUCTION_WOOD => 'Dřevěná',
  293.         self::CONSTRUCTION_STONE => 'Kamenná',
  294.         self::CONSTRUCTION_MONTAGE => 'Montovaná',
  295.         self::CONSTRUCTION_PANEL => 'Panelová',
  296.         self::CONSTRUCTION_MIXED => 'Smíšená',
  297.         self::CONSTRUCTION_LOW_ENERGY => 'Nízkonákladová',
  298.         self::CONSTRUCTION_OTHER => 'Jiná',
  299.     ];
  300. }