src/Containers/CrmSection/ContractContainer/Entities/ContractEntity.php line 132

Open in your IDE?
  1. <?php
  2. namespace App\Containers\CrmSection\ContractContainer\Entities;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use ApiPlatform\Metadata\Delete;
  5. use ApiPlatform\Metadata\Get;
  6. use ApiPlatform\Metadata\GetCollection;
  7. use ApiPlatform\Metadata\Patch;
  8. use ApiPlatform\Metadata\Put;
  9. use ApiPlatform\Metadata\Post;
  10. use ApiPlatform\Metadata\ApiFilter;
  11. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  12. use ApiPlatform\Doctrine\Orm\Filter\NumericFilter;
  13. use ApiPlatform\Doctrine\Orm\Filter\RangeFilter;
  14. use ApiPlatform\Doctrine\Orm\Filter\DateFilter;
  15. use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
  16. use ApiPlatform\Doctrine\Orm\Filter\OrderFilter;
  17. use Doctrine\ORM\Mapping as ORM;
  18. use Doctrine\DBAL\Types\Types;
  19. use Gedmo\Mapping\Annotation as Gedmo;
  20. use Symfony\Component\Serializer\Annotation\Groups;
  21. use Symfony\Component\Serializer\Annotation\MaxDepth;
  22. use Symfony\Component\Serializer\Annotation\Context;
  23. use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
  24. use App\Containers\CrmSection\ContractContainer\Data\Repositories\ContractRepository;
  25. use App\Containers\CrmSection\ClientContainer\Entities\ClientEntity;
  26. use App\Containers\CrmSection\CarContainer\Entities\CarEntity;
  27. use App\Containers\SettingSection\ListContainer\Entities\InsuranceProductEntity;
  28. use App\Containers\SettingSection\PartnerContainer\Entities\PartnerEntity;
  29. use App\Containers\SettingSection\ListContainer\Entities\FuelTypeEntity;
  30. use App\Containers\SettingSection\ListContainer\Entities\CarTypeEntity;
  31. use App\Containers\SettingSection\ListContainer\Entities\CarBrandEntity;
  32. use App\Containers\SettingSection\ListContainer\Entities\CarModelEntity;
  33. use App\Containers\SettingSection\ListContainer\Entities\SourceEntity;
  34. use App\Containers\SettingSection\ListContainer\Entities\StatusEntity;
  35. use App\Containers\SettingSection\ListContainer\Entities\CarUsageTypeEntity;
  36. use App\Containers\SettingSection\ListContainer\Entities\CarUsageReasonEntity;
  37. use App\Containers\CrmSection\CalculationContainer\Entities\CalculationEntity;
  38. use App\Containers\CrmSection\PrintablesContainer\Entities\PrintableEntity;
  39. use App\Containers\CrmSection\IndexContainer\Entities\TranslationEntity;
  40. use App\Ship\ApiPlatform\Filter\SimpleSearchFilter;
  41. /** 
  42.  * Договор
  43. */
  44. #[ApiResource(
  45.     routePrefix'/crm',
  46.     normalizationContext: [
  47.         'groups' => 'read',
  48.         'enable_max_depth' => true
  49.     ],
  50.     operations: [
  51.         new Get(
  52.             uriTemplate'/contracts/{id}'requirements: ['id' => '\d+'],
  53.             security"is_granted('ROLE_ADMIN') or is_granted('ROLE_USER_CLIENT') or is_granted('ROLE_READONLY')"
  54.         ),
  55.         new Patch(
  56.             uriTemplate'/contracts/{id}'requirements: ['id' => '\d+'],
  57.             security"is_granted('ROLE_ADMIN') or is_granted('ROLE_USER_CLIENT')"
  58.         ),
  59.         // new Put(
  60.         //     uriTemplate: '/contracts/{id}', requirements: ['id' => '\d+'],
  61.         //     security: "is_granted('ROLE_ADMIN') or is_granted('ROLE_USER_CLIENT')"
  62.         // ),
  63.         // new Delete(
  64.         //     uriTemplate: '/contracts/{id}', requirements: ['id' => '\d+'],
  65.         //     security: "is_granted('ROLE_ADMIN')"
  66.         // ),
  67.         // new Post(
  68.         //     uriTemplate: '/contracts',
  69.         //     security: "is_granted('ROLE_ADMIN') or is_granted('ROLE_USER_CLIENT')"
  70.         // ),
  71.         new GetCollection(
  72.             uriTemplate'/contracts',
  73.             security"is_granted('ROLE_ADMIN') or is_granted('ROLE_USER_CLIENT') or is_granted('ROLE_READONLY')"
  74.         ),
  75.     ],
  76.     shortName'CRM_Contracts'
  77. )]
  78. #[ApiFilter(SearchFilter::class, properties: [
  79.     'id' => 'exact',
  80.     'number' => 'partial',
  81.     'carNumber' => 'partial',
  82.     'carVIN' => 'partial',
  83.     'externalCode' => 'partial',
  84.     'carColor' => 'exact'
  85.     'status' => 'exact',
  86.     'state' => 'exact',
  87.     'client' => 'exact',
  88.     'car' => 'exact',
  89.     'insuranceProduct' => 'exact',
  90.     'carUsageType' => 'exact',
  91.     'carUsageReason' => 'exact',
  92.     'calculation' => 'exact',
  93.     'carFuelType' => 'exact',
  94.     'carType' => 'exact',
  95.     'carBrand' => 'exact',
  96.     'carModel' => 'exact',
  97.     'mainContract' => 'exact',
  98.     'client.name' => 'partial',
  99.     'client.lastName' => 'partial',
  100.     'client.patronymic' => 'partial',
  101.     'client.externalCode' => 'partial',
  102.     'client.phone' => 'exact',
  103.     'client.email' => 'exact',
  104.     'client.inn' => 'exact',
  105.     'partner' => 'exact',
  106.     'insuranceProduct.name' => 'exact',
  107.     'insuranceProduct.code' => 'exact',
  108.     'carBrand.name' => 'exact',
  109.     'carBrand.codeAutoria' => 'exact',
  110.     'carModel.name' => 'exact',
  111.     'carModel.codeAutoria' => 'exact',
  112.     'status.name' => 'exact',
  113.     'status.externalCode' => 'exact',
  114.     'source.name' => 'exact',
  115.     'source.externalCode' => 'exact'
  116. ])]
  117. #[ApiFilter(NumericFilter::class, properties: ['id''dateProduction''rating''ratingReport'])]
  118. #[ApiFilter(RangeFilter::class, properties: ['id''priceUAH''carPriceUSD''carPriceUAH''dateProduction''carEngineVolume''rating''ratingReport''prolongationBalanceKilometers''prolongationAdditionalCoefficientKilometers''currentBalanceKilometers'])]
  119. #[ApiFilter(BooleanFilter::class, properties: ['isProlongation''isActiveMainContract''isPaid''isSentTo1C''isForbidProlongation''isNotCheckOSCPV''isHide'])]
  120. #[ApiFilter(DateFilter::class, properties: ['dateStart''dateEnd''dateConclusionContract''dateSigningContract''dateSigningAct'])]
  121. #[ApiFilter(OrderFilter::class)]
  122. #[ApiFilter(filterClassSimpleSearchFilter::class, properties: [
  123.     'number''carNumber''carVIN''externalCode'
  124. ])]
  125. #[ORM\Entity(repositoryClassContractRepository::class)]
  126. #[ORM\Table(name'`crm_contracts`')]
  127. #[ORM\Index(columns: ['number''car_number'], name'crm_contracts_custom_idx')]
  128. #[Gedmo\TranslationEntity(class: TranslationEntity::class)]
  129. class ContractEntity
  130. {   
  131.     #[ORM\Id]
  132.     #[ORM\GeneratedValue]
  133.     #[ORM\Column(typeTypes::INTEGER)]
  134.     #[Groups(['read'])]
  135.     private ?int $id null;
  136.     #[ORM\Column(typeTypes::STRINGlength255nullabletrueuniquetrue)]
  137.     #[Groups(['read'])]
  138.     private ?string $externalCode null;
  139.     // Номер договора
  140.     #[ORM\Column(typeTypes::STRINGlength50nullabletrueuniquetrue)]
  141.     #[Groups(['read'])]
  142.     private ?string $number null;
  143.     // Статус
  144.     #[ORM\ManyToOne(targetEntityStatusEntity::class)]
  145.     #[ORM\JoinColumn(name'status_id'referencedColumnName'id'nullablefalse)]
  146.     #[Groups(['read'])]
  147.     #[MaxDepth(1)]
  148.     private StatusEntity $status;
  149.     // Состояние
  150.     #[Groups(['read'])]
  151.     #[MaxDepth(1)]
  152.     public ?StatusEntity $state null;
  153.     // Клиент
  154.     #[ORM\ManyToOne(targetEntityClientEntity::class)]
  155.     #[ORM\JoinColumn(name'client_id'referencedColumnName'id'nullablefalse)]
  156.     #[Groups(['read'])]
  157.     #[MaxDepth(2)]
  158.     private ClientEntity $client;
  159.     // Страховой продукт
  160.     #[ORM\ManyToOne(targetEntityInsuranceProductEntity::class)]
  161.     #[ORM\JoinColumn(name'insurance_product_id'referencedColumnName'id'nullablefalse)]
  162.     #[Groups(['read'])]
  163.     #[MaxDepth(1)]
  164.     private InsuranceProductEntity $insuranceProduct;
  165.     // Партнер
  166.     #[ORM\ManyToOne(targetEntityPartnerEntity::class)]
  167.     #[ORM\JoinColumn(name'partner_id'referencedColumnName'id'onDelete'SET NULL')]
  168.     #[Groups(['read'])]
  169.     #[MaxDepth(1)]
  170.     private ?PartnerEntity $partner;
  171.     
  172.     // Типы использования транспорта
  173.     #[ORM\ManyToOne(targetEntityCarUsageTypeEntity::class)]
  174.     #[ORM\JoinColumn(name'car_usage_type_id'referencedColumnName'id'nullablefalse)]
  175.     #[Groups(['read'])]
  176.     #[MaxDepth(1)]
  177.     private CarUsageTypeEntity $carUsageType;
  178.     // Основания использования транспорта
  179.     #[ORM\ManyToOne(targetEntityCarUsageReasonEntity::class)]
  180.     #[ORM\JoinColumn(name'car_usage_reason_id'referencedColumnName'id'nullablefalse)]
  181.     #[Groups(['read'])]
  182.     #[MaxDepth(1)]
  183.     private CarUsageReasonEntity $carUsageReason;
  184.     // Расчёт
  185.     #[ORM\ManyToOne(targetEntityCalculationEntity::class)]
  186.     #[ORM\JoinColumn(name'calculation_id'referencedColumnName'id'nullablefalse)]
  187.     #[Groups(['read'])]
  188.     #[MaxDepth(2)]
  189.     private CalculationEntity $calculation;
  190.     // Стоимость в ГРН
  191.     #[ORM\Column(typeTypes::FLOATscale3nullablefalse)]
  192.     #[Groups(['read'])]
  193.     private float $priceUAH;
  194.     // Стоимость дополнительного километра в ГРН
  195.     #[ORM\Column(typeTypes::FLOATscale3nullablefalse)]
  196.     #[Groups(['read'])]
  197.     private float $costAdditionalKilometerUAH;
  198.     // Оценка вождения автомобилем
  199.     #[ORM\Column(typeTypes::FLOATscale2nullabletrueoptions: ['default' => 0.00])]
  200.     #[Groups(['read'])]
  201.     private ?float $rating 0.00;
  202.     #[ORM\Column(typeTypes::FLOATscale2nullabletrueoptions: ['default' => 0.00])]
  203.     #[Groups(['read'])]
  204.     private ?float $ratingReport 0.00;
  205.     // Номер авто
  206.     #[ORM\Column(typeTypes::STRINGlength50nullablefalse)]
  207.     #[Groups(['read'])]
  208.     private string $carNumber;
  209.     // Год выпуска
  210.     #[ORM\Column(typeTypes::INTEGERlength4nullablefalse)]
  211.     #[Groups(['read'])]
  212.     private int $dateProduction;
  213.     // Стоимость авто в USD
  214.     #[ORM\Column(typeTypes::INTEGERnullablefalse)]
  215.     #[Groups(['read'])]
  216.     private int $carPriceUSD;
  217.     // Стоимость авто в ГРН
  218.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  219.     #[Groups(['read'])]
  220.     private ?int $carPriceUAH null;
  221.     // Объем двигателя
  222.     #[ORM\Column(typeTypes::FLOATscale3nullabletrue)]
  223.     #[Groups(['read'])]
  224.     private ?float $carEngineVolume null;
  225.     // Тип топлива
  226.     #[ORM\ManyToOne(targetEntityFuelTypeEntity::class)]
  227.     #[ORM\JoinColumn(name'car_fuel_type_id'referencedColumnName'id'nullabletrue)]
  228.     #[Groups(['read'])]
  229.     #[MaxDepth(1)]
  230.     private ?FuelTypeEntity $carFuelType null;
  231.     // Тип транспорта
  232.     #[ORM\ManyToOne(targetEntityCarTypeEntity::class)]
  233.     #[ORM\JoinColumn(name'car_type_id'referencedColumnName'id'nullabletrue)]
  234.     #[Groups(['read'])]
  235.     #[MaxDepth(1)]
  236.     private ?CarTypeEntity $carType null;
  237.     // Цвет
  238.     #[ORM\Column(typeTypes::STRINGlength150nullabletrue)]
  239.     #[Gedmo\Translatable]
  240.     #[Groups(['read'])]
  241.     private ?string $carColor null;
  242.     // VIN
  243.     #[ORM\Column(typeTypes::STRINGlength150nullabletrue)]
  244.     #[Groups(['read'])]
  245.     private ?string $carVIN null;
  246.     // Марка
  247.     #[ORM\ManyToOne(targetEntityCarBrandEntity::class)]
  248.     #[ORM\JoinColumn(name'car_brand_id'referencedColumnName'id'nullabletrue)]
  249.     #[Groups(['read'])]
  250.     #[MaxDepth(1)]
  251.     private ?CarBrandEntity $carBrand null;
  252.     // Модель
  253.     #[ORM\ManyToOne(targetEntityCarModelEntity::class)]
  254.     #[ORM\JoinColumn(name'car_model_id'referencedColumnName'id'nullabletrue)]
  255.     #[Groups(['read'])]
  256.     #[MaxDepth(1)]
  257.     private ?CarModelEntity $carModel null;
  258.     // Дата начала действия
  259.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  260.     #[Context(
  261.         normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'],
  262.         denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d']
  263.     )]
  264.     #[Groups(['read'])]
  265.     private ?\DateTimeInterface $dateStart null;
  266.     // Дата окончания действия
  267.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  268.     #[Context(
  269.         normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'],
  270.         denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d']
  271.     )]
  272.     #[Groups(['read'])]
  273.     private ?\DateTimeInterface $dateEnd null;
  274.     // Дата заключения договора
  275.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  276.     #[Context(
  277.         normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s'],
  278.         denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s']
  279.     )]
  280.     #[Groups(['read'])]
  281.     private ?\DateTimeInterface $dateConclusionContract null;
  282.     // Пролонгация
  283.     #[ORM\Column(typeTypes::BOOLEAN)]
  284.     #[Groups(['read'])]
  285.     private ?bool $isProlongation false;
  286.     // Основновной договор при пролонгации
  287.     #[ORM\ManyToOne(targetEntityContractEntity::class)]
  288.     #[ORM\JoinColumn(name'main_contract_id'referencedColumnName'id'nullabletrue)]
  289.     #[Groups(['read'])]
  290.     #[MaxDepth(2)]
  291.     private ?ContractEntity $mainContract null;
  292.     // Активность основной сделки при пролонгации
  293.     #[ORM\Column(typeTypes::BOOLEAN)]
  294.     #[Groups(['read'])]
  295.     private ?bool $isActiveMainContract false;
  296.     // Пролонговано
  297.     #[Groups(['read'])]
  298.     public bool $isProlonged false;
  299.     // Количество бонусов
  300.     #[Groups(['read'])]
  301.     public ?int $bonuses 0;
  302.     // Количество оплаченных километров
  303.     #[Groups(['read'])]
  304.     public ?float $paidKilometers 0.00;
  305.     // Пробег
  306.     #[Groups(['read'])]
  307.     public ?float $mileage 0.00;
  308.     // Остаток километров
  309.     #[Groups(['read'])]
  310.     public ?float $remainingKilometers 0.00;
  311.     // Лимит КМ
  312.     #[ORM\Column(typeTypes::INTEGERnullablefalse)]
  313.     #[Groups(['read'])]
  314.     private ?int $limitKilometers null;
  315.     // Остаток КМ при пролонгации
  316.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  317.     #[Groups(['read'])]
  318.     private ?int $prolongationBalanceKilometers 0;
  319.     #[ORM\Column(typeTypes::FLOATscale3nullabletrue)]
  320.     #[Groups(['read'])]
  321.     private ?float $prolongationAdditionalCoefficientKilometers null;
  322.     // Текущий остаток КМ
  323.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  324.     #[Groups(['read'])]
  325.     private ?int $currentBalanceKilometers 0;
  326.     // Печатная форма
  327.     #[Groups(['read'])]
  328.     public ?PrintableEntity $printable null;
  329.     // Источник
  330.     #[ORM\ManyToOne(targetEntitySourceEntity::class)]
  331.     #[ORM\JoinColumn(name'source_id'referencedColumnName'id'nullabletrue)]
  332.     #[Groups(['read'])]
  333.     #[MaxDepth(1)]
  334.     private ?SourceEntity $source null;
  335.     // Код подписи договора
  336.     #[ORM\Column(typeTypes::STRINGlength100nullabletrue)]
  337.     #[Groups(['read'])]
  338.     private ?string $codeSigningContract null;
  339.     // Дата подписи договора
  340.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  341.     #[Context(
  342.         normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s'],
  343.         denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s']
  344.     )]
  345.     #[Groups(['read'])]
  346.     private ?\DateTimeInterface $dateSigningContract null;
  347.     // Код подписи акта
  348.     #[ORM\Column(typeTypes::STRINGlength100nullabletrue)]
  349.     #[Groups(['read'])]
  350.     private ?string $codeSigningAct null;
  351.     // Дата подписи акта
  352.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLEnullabletrue)]
  353.     #[Context(
  354.         normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s'],
  355.         denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s']
  356.     )]
  357.     #[Groups(['read'])]
  358.     private ?\DateTimeInterface $dateSigningAct null;
  359.     // Договор оплачен
  360.     #[ORM\Column(typeTypes::BOOLEAN)]
  361.     #[Groups(['read'])]
  362.     private ?bool $isPaid false;
  363.     // Отправлен в 1С
  364.     #[ORM\Column(typeTypes::BOOLEAN)]
  365.     #[Groups(['read'])]
  366.     private ?bool $isSentTo1C false;
  367.     // Ошибка при отправке в 1С
  368.     #[ORM\Column(typeTypes::STRINGlength255nullabletrue)]
  369.     #[Groups(['read'])]
  370.     private ?string $errorSentTo1C null;
  371.     // Автомобиль
  372.     #[ORM\ManyToOne(targetEntityCarEntity::class)]
  373.     #[ORM\JoinColumn(name'car_id'referencedColumnName'id'nullabletrue)]
  374.     #[Groups(['read'])]
  375.     #[MaxDepth(2)]
  376.     private ?CarEntity $car null;
  377.     // Трекер активен
  378.     #[Groups(['read'])]
  379.     public ?bool $trackerIsActive null;
  380.     // Трекер заблокирован
  381.     #[Groups(['read'])]
  382.     public ?bool $trackerIsBlocked null;
  383.     // Дата деактивации трекера
  384.     #[Context(
  385.         normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s'],
  386.         denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s']
  387.     )]
  388.     #[Groups(['read'])]
  389.     public ?\DateTimeInterface $trackerDeactivationDate null;
  390.     // Запрет пролонгации
  391.     #[ORM\Column(typeTypes::BOOLEAN)]
  392.     #[Groups(['read'])]
  393.     private ?bool $isForbidProlongation false;
  394.     // Не проверять ОСАГО
  395.     #[ORM\Column(typeTypes::BOOLEAN)]
  396.     #[Groups(['read'])]
  397.     private ?bool $isNotCheckOSCPV false;
  398.     // Скрыть
  399.     #[ORM\Column(typeTypes::BOOLEAN)]
  400.     #[Groups(['read'])]
  401.     private ?bool $isHide false;
  402.     #[Gedmo\Timestampable(on'create')]
  403.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLE)]
  404.     #[Groups(['read'])]
  405.     protected $createdAt;
  406.     #[Gedmo\Timestampable(on'update')]
  407.     #[ORM\Column(typeTypes::DATETIME_IMMUTABLE)]
  408.     #[Groups(['read'])]
  409.     protected $updatedAt;
  410.     /**
  411.      * Used locale to override Translation listener`s locale
  412.      * this is not a mapped field of entity metadata, just a simple property
  413.      */
  414.     #[Gedmo\Locale]
  415.     private $locale;
  416.     public function getId(): ?int
  417.     {
  418.         return $this->id;
  419.     }
  420.     public function getExternalCode()
  421.     {
  422.         return $this->externalCode;
  423.     }
  424.     public function setExternalCode($code)
  425.     {
  426.         $this->externalCode $code;
  427.         return $this;
  428.     }
  429.     public function getNumber()
  430.     {
  431.         return $this->number;
  432.     }
  433.     public function setNumber($number)
  434.     {
  435.         $this->number $number;
  436.         return $this;
  437.     }
  438.  
  439.     public function getClient()
  440.     {
  441.         return $this->client;
  442.     }
  443.     public function setClient($client)
  444.     {
  445.         $this->client $client;
  446.         return $this;
  447.     }
  448.     public function getInsuranceProduct()
  449.     {
  450.         return $this->insuranceProduct;
  451.     }
  452.     public function setInsuranceProduct($product)
  453.     {
  454.         $this->insuranceProduct $product;
  455.         return $this;
  456.     }
  457.     public function getPartner()
  458.     {
  459.         return $this->partner;
  460.     }
  461.     public function setPartner(?PartnerEntity $partner)
  462.     {
  463.         $this->partner $partner;
  464.         return $this;
  465.     }
  466.     public function getCalculation()
  467.     {
  468.         return $this->calculation;
  469.     }
  470.     public function setCalculation($calculation)
  471.     {
  472.         $this->calculation $calculation;
  473.         return $this;
  474.     }
  475.     public function getCarUsageType()
  476.     {
  477.         return $this->carUsageType;
  478.     }
  479.     public function setCarUsageType($type)
  480.     {
  481.         $this->carUsageType $type;
  482.         return $this;
  483.     }
  484.     public function getCarUsageReason()
  485.     {
  486.         return $this->carUsageReason;
  487.     }
  488.     public function setCarUsageReason($reason)
  489.     {
  490.         $this->carUsageReason $reason;
  491.         return $this;
  492.     }
  493.     public function getPriceUAH()
  494.     {
  495.         return $this->priceUAH;
  496.     }
  497.     public function setPriceUAH($price)
  498.     {
  499.         $this->priceUAH = ($price !== null round($price3) : null);
  500.         return $this;
  501.     }
  502.     public function getCostAdditionalKilometerUAH()
  503.     {
  504.         return $this->costAdditionalKilometerUAH;
  505.     }
  506.     public function setCostAdditionalKilometerUAH($cost)
  507.     {
  508.         $this->costAdditionalKilometerUAH = ($cost !== null round($cost3) : null);
  509.         return $this;
  510.     }
  511.     public function getRating()
  512.     {
  513.         return $this->rating;
  514.     }
  515.     public function setRating($value)
  516.     {
  517.         $this->rating = ($value round($value2) : 0.00);
  518.         return $this;
  519.     }
  520.     public function getRatingReport()
  521.     {
  522.         return $this->ratingReport;
  523.     }
  524.     public function setRatingReport($value)
  525.     {
  526.         $this->ratingReport = ($value round($value2) : 0.00);
  527.         return $this;
  528.     }
  529.     public function getCarNumber()
  530.     {
  531.         return $this->carNumber;
  532.     }
  533.     public function setCarNumber($number)
  534.     {
  535.         $this->carNumber = ($number !== null str_replace(' ',''trim($number)) : null);
  536.         return $this;
  537.     }
  538.     public function setDateProduction($year)
  539.     {
  540.         $this->dateProduction $year;
  541.         return $this;
  542.     }
  543.     public function getDateProduction()
  544.     {
  545.         return $this->dateProduction;
  546.     }
  547.     public function getCarBrand()
  548.     {
  549.         return $this->carBrand;
  550.     }
  551.     public function setCarBrand($brand)
  552.     {
  553.         $this->carBrand $brand;
  554.         return $this;
  555.     }
  556.     public function getCarModel()
  557.     {
  558.         return $this->carModel;
  559.     }
  560.     public function setCarModel($model)
  561.     {
  562.         $this->carModel $model;
  563.         return $this;
  564.     }
  565.     public function getCarPriceUSD()
  566.     {
  567.         return $this->carPriceUSD;
  568.     }
  569.     public function setCarPriceUSD($price)
  570.     {
  571.         $this->carPriceUSD $price;
  572.         return $this;
  573.     }
  574.     public function getCarPriceUAH()
  575.     {
  576.         return $this->carPriceUAH;
  577.     }
  578.     public function setCarPriceUAH($price)
  579.     {
  580.         $this->carPriceUAH $price;
  581.         return $this;
  582.     }
  583.     public function getCarEngineVolume()
  584.     {
  585.         return $this->carEngineVolume;
  586.     }
  587.     public function setCarEngineVolume($value)
  588.     {
  589.         $this->carEngineVolume = ($value !== null round($value3) : null);
  590.         return $this;
  591.     }
  592.     public function getCarFuelType()
  593.     {
  594.         return $this->carFuelType;
  595.     }
  596.     public function setCarFuelType($type)
  597.     {
  598.         $this->carFuelType $type;
  599.         return $this;
  600.     }
  601.     public function getCarType()
  602.     {
  603.         return $this->carType;
  604.     }
  605.     public function setCarType($type)
  606.     {
  607.         $this->carType $type;
  608.         return $this;
  609.     }
  610.     public function getCarColor()
  611.     {
  612.         return $this->carColor;
  613.     }
  614.     public function setCarColor($color)
  615.     {
  616.         $this->carColor $color;
  617.         return $this;
  618.     }
  619.     public function getCarVIN()
  620.     {
  621.         return $this->carVIN;
  622.     }
  623.     public function setCarVIN($VIN)
  624.     {
  625.         $this->carVIN $VIN;
  626.         return $this;
  627.     }
  628.     public function setDateStart(\DateTimeImmutable|null $date)
  629.     {
  630.         $this->dateStart $date;
  631.         return $this;
  632.     }
  633.     public function getDateStart()
  634.     {
  635.         return $this->dateStart;
  636.     }
  637.     public function setDateEnd(\DateTimeImmutable|null $date)
  638.     {
  639.         $this->dateEnd $date;
  640.         return $this;
  641.     }
  642.     public function getDateEnd()
  643.     {
  644.         return $this->dateEnd;
  645.     }
  646.     public function setDateConclusionContract(\DateTimeImmutable|null $date)
  647.     {
  648.         $this->dateConclusionContract $date;
  649.         return $this;
  650.     }
  651.     public function getDateConclusionContract()
  652.     {
  653.         return $this->dateConclusionContract;
  654.     }
  655.     public function getStatus()
  656.     {
  657.         return $this->status;
  658.     }
  659.     public function setStatus($status)
  660.     {
  661.         $this->status $status;
  662.         return $this;
  663.     }
  664.     public function getIsProlongation()
  665.     {
  666.         return $this->isProlongation;
  667.     }
  668.     public function setIsProlongation($value)
  669.     {
  670.         $this->isProlongation $value;
  671.         return $this;
  672.     }
  673.     public function getMainContract()
  674.     {
  675.         return $this->mainContract;
  676.     }
  677.     public function setMainContract($contract)
  678.     {
  679.         $this->mainContract $contract;
  680.         return $this;
  681.     }
  682.     public function getRootContract(): self
  683.     {
  684.         $contract $this;
  685.         while (null !== $contract->getMainContract())
  686.             $contract $contract->getMainContract();
  687.         return $contract;
  688.     }
  689.     public function getIsActiveMainContract()
  690.     {
  691.         return $this->isActiveMainContract;
  692.     }
  693.     public function setIsActiveMainContract($value)
  694.     {
  695.         $this->isActiveMainContract $value;
  696.         return $this;
  697.     }
  698.     public function getLimitKilometers()
  699.     {
  700.         return $this->limitKilometers;
  701.     }
  702.     public function setLimitKilometers($kilometers)
  703.     {
  704.         $this->limitKilometers $kilometers;
  705.         return $this;
  706.     }
  707.     public function getProlongationBalanceKilometers()
  708.     {
  709.         return $this->prolongationBalanceKilometers;
  710.     }
  711.     public function setProlongationBalanceKilometers($kilometers)
  712.     {
  713.         $this->prolongationBalanceKilometers $kilometers;
  714.         return $this;
  715.     }
  716.     public function getProlongationAdditionalCoefficientKilometers()
  717.     {
  718.         return $this->prolongationAdditionalCoefficientKilometers;
  719.     }
  720.     public function setProlongationAdditionalCoefficientKilometers($value)
  721.     {
  722.         $this->prolongationAdditionalCoefficientKilometers $value round($value3) : null;
  723.         return $this;
  724.     }
  725.     public function getCurrentBalanceKilometers()
  726.     {
  727.         return $this->currentBalanceKilometers;
  728.     }
  729.     public function setCurrentBalanceKilometers($kilometers)
  730.     {
  731.         $this->currentBalanceKilometers $kilometers;
  732.         return $this;
  733.     }
  734.     public function getSource()
  735.     {
  736.         return $this->source;
  737.     }
  738.     public function setSource($source)
  739.     {
  740.         $this->source $source;
  741.         return $this;
  742.     }
  743.     public function getIsPaid()
  744.     {
  745.         return $this->isPaid;
  746.     }
  747.  
  748.     public function setIsPaid($value)
  749.     {
  750.         $this->isPaid $value;
  751.         return $this;
  752.     }
  753.     public function getIsSentTo1C()
  754.     {
  755.         return $this->isSentTo1C;
  756.     }
  757.     public function setIsSentTo1C($value)
  758.     {
  759.         $this->isSentTo1C $value;
  760.         return $this;
  761.     }
  762.     public function getErrorSentTo1C()
  763.     {
  764.         return $this->errorSentTo1C;
  765.     }
  766.     public function setErrorSentTo1C($error)
  767.     {
  768.         $this->errorSentTo1C $error;
  769.         return $this;
  770.     }
  771.     public function getCodeSigningContract()
  772.     {
  773.         return $this->codeSigningContract;
  774.     }
  775.  
  776.     public function setCodeSigningContract($code)
  777.     {
  778.         $this->codeSigningContract $code;
  779.         return $this;
  780.     }
  781.     public function setDateSigningContract(\DateTimeImmutable|null $date)
  782.     {
  783.         $this->dateSigningContract $date;
  784.         return $this;
  785.     }
  786.     public function getDateSigningContract()
  787.     {
  788.         return $this->dateSigningContract;
  789.     }
  790.     public function getCodeSigningAct()
  791.     {
  792.         return $this->codeSigningAct;
  793.     }
  794.     public function setCodeSigningAct($code)
  795.     {
  796.         $this->codeSigningAct $code;
  797.         return $this;
  798.     }
  799.     public function setDateSigningAct(\DateTimeImmutable|null $date)
  800.     {
  801.         $this->dateSigningAct $date;
  802.         return $this;
  803.     }
  804.     public function getDateSigningAct()
  805.     {
  806.         return $this->dateSigningAct;
  807.     }
  808.     public function getCar()
  809.     {
  810.         return $this->car;
  811.     }
  812.     public function setCar($car)
  813.     {
  814.         $this->car $car;
  815.         return $this;
  816.     }
  817.     public function getIsForbidProlongation()
  818.     {
  819.         return $this->isForbidProlongation;
  820.     }
  821.     public function setIsForbidProlongation($value)
  822.     {
  823.         $this->isForbidProlongation $value;
  824.         return $this;
  825.     }
  826.     public function getIsNotCheckOSCPV()
  827.     {
  828.         return $this->isNotCheckOSCPV;
  829.     }
  830.     public function setIsNotCheckOSCPV($value)
  831.     {
  832.         $this->isNotCheckOSCPV $value;
  833.         return $this;
  834.     }
  835.     public function getIsHide()
  836.     {
  837.         return $this->isHide;
  838.     }
  839.     public function setIsHide($value)
  840.     {
  841.         $this->isHide $value;
  842.         return $this;
  843.     }
  844.     public function getCreatedAt()
  845.     {
  846.         return $this->createdAt;
  847.     }
  848.     public function getUpdatedAt()
  849.     {
  850.         return $this->updatedAt;
  851.     }
  852.     public function setTranslatableLocale($locale)
  853.     {
  854.         $this->locale $locale;
  855.     }
  856. }