src/Entity/CRM/TranscriptionJob.php line 13

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Order;
  4. use App\Enum\IngestSource;
  5. use App\Enum\TranscriptionJobStatus;
  6. use App\Repository\TranscriptionJobRepository;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassTranscriptionJobRepository::class)]
  10. class TranscriptionJob
  11. {
  12.     public const MANUAL_TRANSCRIPTION_QUEUE_PRIORITY 1_000_000;
  13.     public const MANUAL_EVALUATION_QUEUE_PRIORITY 1_000_000;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\ManyToOne(inversedBy'transcriptionJobs')]
  19.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  20.     private ?Branch $tenant null;
  21.     #[ORM\ManyToOne(inversedBy'transcriptionJobs')]
  22.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  23.     private ?DataSource $source null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $filename null;
  26.     #[ORM\Column(length768uniquetrue)]
  27.     private ?string $filePath null;
  28.     #[ORM\Column(length16enumTypeTranscriptionJobStatus::class)]
  29.     private TranscriptionJobStatus $status TranscriptionJobStatus::PENDING;
  30.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  31.     private \DateTimeInterface $createdAt;
  32.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  33.     private ?\DateTimeInterface $completedAt null;
  34.     #[ORM\Column(nullabletrue)]
  35.     private ?float $duration null;
  36.     #[ORM\Column]
  37.     private bool $audioDeleted false;
  38.     #[ORM\Column]
  39.     private int $queuePriority 0;
  40.     #[ORM\Column(length255nullabletrue)]
  41.     private ?string $uploadedBy null;
  42.     #[ORM\Column(length10nullabletrue)]
  43.     private ?string $callDate null;
  44.     #[ORM\Column(length8nullabletrue)]
  45.     private ?string $callTime null;
  46.     #[ORM\Column(length64nullabletrue)]
  47.     private ?string $consultantId null;
  48.     #[ORM\Column(length32nullabletrue)]
  49.     private ?string $targetNumber null;
  50.     #[ORM\Column(length64nullabletrue)]
  51.     private ?string $branchNumber null;
  52.     #[ORM\Column(length32enumTypeIngestSource::class)]
  53.     private IngestSource $ingestSource IngestSource::FTP;
  54.     #[ORM\ManyToOne]
  55.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  56.     private ?Order $linkedOrder null;
  57.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  58.     private ?string $note null;
  59.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  60.     private ?string $transcription null;
  61.     #[ORM\ManyToOne(inversedBy'transcriptionJobs')]
  62.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  63.     private ?CallStatus $callStatus null;
  64.     #[ORM\OneToOne(mappedBy'transcriptionJob'targetEntityCallEvaluation::class)]
  65.     private ?CallEvaluation $evaluation null;
  66.     public function __construct()
  67.     {
  68.         $this->createdAt = new \DateTimeImmutable();
  69.     }
  70.     public function __toString(): string
  71.     {
  72.         return (string) ($this->filename ?? ('Job #' $this->id));
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getTenant(): ?Branch
  79.     {
  80.         return $this->tenant;
  81.     }
  82.     public function setTenant(?Branch $tenant): static
  83.     {
  84.         $this->tenant $tenant;
  85.         return $this;
  86.     }
  87.     public function getSource(): ?DataSource
  88.     {
  89.         return $this->source;
  90.     }
  91.     public function setSource(?DataSource $source): static
  92.     {
  93.         $this->source $source;
  94.         return $this;
  95.     }
  96.     public function getFilename(): ?string
  97.     {
  98.         return $this->filename;
  99.     }
  100.     public function setFilename(string $filename): static
  101.     {
  102.         $this->filename $filename;
  103.         return $this;
  104.     }
  105.     public function getFilePath(): ?string
  106.     {
  107.         return $this->filePath;
  108.     }
  109.     public function setFilePath(string $filePath): static
  110.     {
  111.         $this->filePath $filePath;
  112.         return $this;
  113.     }
  114.     public function getStatus(): TranscriptionJobStatus
  115.     {
  116.         return $this->status;
  117.     }
  118.     public function setStatus(TranscriptionJobStatus $status): static
  119.     {
  120.         $this->status $status;
  121.         return $this;
  122.     }
  123.     public function getCreatedAt(): \DateTimeInterface
  124.     {
  125.         return $this->createdAt;
  126.     }
  127.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  128.     {
  129.         $this->createdAt $createdAt;
  130.         return $this;
  131.     }
  132.     public function getCompletedAt(): ?\DateTimeInterface
  133.     {
  134.         return $this->completedAt;
  135.     }
  136.     public function setCompletedAt(?\DateTimeInterface $completedAt): static
  137.     {
  138.         $this->completedAt $completedAt;
  139.         return $this;
  140.     }
  141.     public function getDuration(): ?float
  142.     {
  143.         return $this->duration;
  144.     }
  145.     public function setDuration(?float $duration): static
  146.     {
  147.         $this->duration $duration;
  148.         return $this;
  149.     }
  150.     public function isAudioDeleted(): bool
  151.     {
  152.         return $this->audioDeleted;
  153.     }
  154.     public function setAudioDeleted(bool $audioDeleted): static
  155.     {
  156.         $this->audioDeleted $audioDeleted;
  157.         return $this;
  158.     }
  159.     public function getQueuePriority(): int
  160.     {
  161.         return $this->queuePriority;
  162.     }
  163.     public function setQueuePriority(int $queuePriority): static
  164.     {
  165.         $this->queuePriority $queuePriority;
  166.         return $this;
  167.     }
  168.     public function getUploadedBy(): ?string
  169.     {
  170.         return $this->uploadedBy;
  171.     }
  172.     public function setUploadedBy(?string $uploadedBy): static
  173.     {
  174.         $this->uploadedBy $uploadedBy;
  175.         return $this;
  176.     }
  177.     public function getCallDate(): ?string
  178.     {
  179.         return $this->callDate;
  180.     }
  181.     public function setCallDate(?string $callDate): static
  182.     {
  183.         $this->callDate $callDate;
  184.         return $this;
  185.     }
  186.     public function getCallTime(): ?string
  187.     {
  188.         return $this->callTime;
  189.     }
  190.     public function setCallTime(?string $callTime): static
  191.     {
  192.         $this->callTime $callTime;
  193.         return $this;
  194.     }
  195.     public function getConsultantId(): ?string
  196.     {
  197.         return $this->consultantId;
  198.     }
  199.     public function setConsultantId(?string $consultantId): static
  200.     {
  201.         $this->consultantId $consultantId;
  202.         return $this;
  203.     }
  204.     public function getTargetNumber(): ?string
  205.     {
  206.         return $this->targetNumber;
  207.     }
  208.     public function setTargetNumber(?string $targetNumber): static
  209.     {
  210.         $this->targetNumber $targetNumber;
  211.         return $this;
  212.     }
  213.     public function getBranchNumber(): ?string
  214.     {
  215.         return $this->branchNumber;
  216.     }
  217.     public function setBranchNumber(?string $branchNumber): static
  218.     {
  219.         $this->branchNumber $branchNumber;
  220.         return $this;
  221.     }
  222.     public function getIngestSource(): IngestSource
  223.     {
  224.         return $this->ingestSource;
  225.     }
  226.     public function setIngestSource(IngestSource $ingestSource): static
  227.     {
  228.         $this->ingestSource $ingestSource;
  229.         return $this;
  230.     }
  231.     public function getLinkedOrder(): ?Order
  232.     {
  233.         return $this->linkedOrder;
  234.     }
  235.     public function setLinkedOrder(?Order $linkedOrder): static
  236.     {
  237.         $this->linkedOrder $linkedOrder;
  238.         return $this;
  239.     }
  240.     public function getNote(): ?string
  241.     {
  242.         return $this->note;
  243.     }
  244.     public function setNote(?string $note): static
  245.     {
  246.         $this->note $note;
  247.         return $this;
  248.     }
  249.     public function getTranscription(): ?string
  250.     {
  251.         return $this->transcription;
  252.     }
  253.     public function setTranscription(?string $transcription): static
  254.     {
  255.         $this->transcription $transcription;
  256.         return $this;
  257.     }
  258.     public function getCallStatus(): ?CallStatus
  259.     {
  260.         return $this->callStatus;
  261.     }
  262.     public function setCallStatus(?CallStatus $callStatus): static
  263.     {
  264.         $this->callStatus $callStatus;
  265.         return $this;
  266.     }
  267.     public function getEvaluation(): ?CallEvaluation
  268.     {
  269.         return $this->evaluation;
  270.     }
  271.     public function setEvaluation(?CallEvaluation $evaluation): static
  272.     {
  273.         $this->evaluation $evaluation;
  274.         return $this;
  275.     }
  276. }