<?phpnamespace App\Entity;use App\Interfaces\CRMLead;use App\Repository\FormAfterSalesRepository;use App\Service\CRM\Lead;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass=FormAfterSalesRepository::class) */class FormAfterSales extends BaseForm implements CRMLead{ /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $document; /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $company; /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $name; /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $last_name; /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $email; /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $phone; /** * @ORM\Column(type="string") * @Assert\Length(max="255") * @Assert\NotBlank() */ private $department; /** * @ORM\Column(type="json", nullable=true) */ private $crm_body; /** * @ORM\Column(type="json", nullable=true) */ private $crm_result; /** * FormAfterSales constructor. */ public function __construct() { parent::__construct(); } public function getModel(): ?string { return null; } public function getCrmModel(): ?string { return null; } public function leadToCRM(): Lead { $lead = new Lead(); $lead ->setDocumentNumber($this->getDocument()) ->setCompany($this->getCompany()) ->setName($this->getName()) ->setLastname($this->getLastName()) ->setEmail($this->getEmail()) ->setPhone($this->getPhone()) ->setDepartment($this->getDepartment()) ->setTopic('Cotización') ->setCategory('Repuesto') ->setOriginForm('UD Trucks Repuestos') ->setUtmSource($this->getUtmSource()) ->setUtmCampaign($this->getUtmCampaign()) ->setUtmTerm($this->getUtmTerm()) ->setUtmMedium($this->getUtmMedium()); return $lead; } public function getDocument(): ?string { return $this->document; } public function setDocument(string $document): self { $this->document = $document; return $this; } public function getCompany(): ?string { return $this->company; } public function setCompany(string $company): self { $this->company = $company; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getLastName(): ?string { return $this->last_name; } public function setLastName(string $last_name): self { $this->last_name = $last_name; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getPhone(): ?string { return $this->phone; } public function setPhone(string $phone): self { $this->phone = $phone; return $this; } public function getDepartment(): ?string { return $this->department; } public function setDepartment(string $department): self { $this->department = $department; return $this; } public function getCrmBody(): ?array { return $this->crm_body; } public function setCrmBody(?array $crm_body): self { $this->crm_body = $crm_body; return $this; } public function getCrmResult(): ?array { return $this->crm_result; } public function setCrmResult(?array $crm_result): self { $this->crm_result = $crm_result; return $this; }}