src/Entity/Todos.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\TodoPriorityEnum;
  4. use App\Enum\TodoStatusEnum;
  5. use App\Enum\TodoTypeEnum;
  6. use App\Repository\TodosRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10.  * @ORM\Entity(repositoryClass=TodosRepository::class)
  11.  * @ORM\Table(name="todos")
  12.  * @ORM\HasLifecycleCallbacks
  13.  */
  14. class Todos
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      * @Groups({"todo@ref", "todo@base", "todo@core"})
  21.      */
  22.     private $id;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      * @Groups({"todo@base", "todo@core"})
  26.      */
  27.     private $title;
  28.     /**
  29.      * @ORM\Column(type="text", nullable=true)
  30.      * @Groups({"todo@core"})
  31.      */
  32.     private $description;
  33.     /**
  34.      * Ham kullanici (sesli) konusma metni — AI ozetinden ayri, kullanici duzenleyebilir.
  35.      * @ORM\Column(type="text", nullable=true)
  36.      * @Groups({"todo@core"})
  37.      */
  38.     private $transcript;
  39.     /**
  40.      * Degerler: TodoPriorityEnum. DB tarafinda gercek ENUM kolonu (todo_priority_type).
  41.      *
  42.      * @ORM\Column(type="todo_priority_type")
  43.      * @Groups({"todo@core"})
  44.      */
  45.     private $priority = TodoPriorityEnum::MEDIUM;
  46.     /**
  47.      * Degerler: TodoTypeEnum. DB tarafinda gercek ENUM kolonu (todo_type).
  48.      *
  49.      * @ORM\Column(type="todo_type")
  50.      * @Groups({"todo@core"})
  51.      */
  52.     private $type = TodoTypeEnum::IMPROVEMENT;
  53.     /**
  54.      * @ORM\Column(type="string", length=100, nullable=true)
  55.      * @Groups({"todo@core"})
  56.      */
  57.     private $module;
  58.     /**
  59.      * Degerler: TodoStatusEnum. DB tarafinda gercek ENUM kolonu (todo_status_type).
  60.      *
  61.      * @ORM\Column(type="todo_status_type")
  62.      * @Groups({"todo@core"})
  63.      */
  64.     private $status = TodoStatusEnum::PENDING;
  65.     /**
  66.      * @ORM\Column(type="text", nullable=true)
  67.      * @Groups({"todo@core"})
  68.      */
  69.     private $admin_note;
  70.     /**
  71.      * @ORM\Column(type="boolean", options={"default": false})
  72.      * @Groups({"todo@core"})
  73.      */
  74.     private $is_system = false;
  75.     /**
  76.      * @ORM\Column(type="boolean", options={"default": false})
  77.      * @Groups({"todo@core"})
  78.      */
  79.     private $assign_to_ai = false;
  80.     /**
  81.      * Degerler: TodoAiStatusEnum. DB tarafinda gercek ENUM kolonu (todo_ai_status_type).
  82.      *
  83.      * @ORM\Column(type="todo_ai_status_type", nullable=true)
  84.      * @Groups({"todo@core"})
  85.      */
  86.     private $ai_status;
  87.     /**
  88.      * @ORM\Column(type="string", length=120, nullable=true)
  89.      * @Groups({"todo@core"})
  90.      */
  91.     private $ai_branch;
  92.     /**
  93.      * Ekran goruntusu / belge dosya adlari (mini havuz — DB'de sadece dosya adi,
  94.      * web path runtime'da FE'de /assets/todo_documents/{name} ile kurulur).
  95.      *
  96.      * @ORM\Column(type="json", nullable=true)
  97.      * @Groups({"todo@core"})
  98.      */
  99.     private $documents = [];
  100.     /**
  101.      * @ORM\ManyToOne(targetEntity=User::class)
  102.      * @ORM\JoinColumn(nullable=false)
  103.      * @Groups({"todo@user"})
  104.      */
  105.     private $user;
  106.     /**
  107.      * @ORM\Column(type="datetime")
  108.      * @Groups({"todo@core"})
  109.      */
  110.     private $created_at;
  111.     /**
  112.      * @ORM\Column(type="datetime")
  113.      * @Groups({"todo@core"})
  114.      */
  115.     private $updated_at;
  116.     /**
  117.      * Bu todo'yu "Done" işaretleyen admin'in user id'si — confirm bildirimini o admin'e göndermek için.
  118.      * @ORM\Column(type="integer", nullable=true)
  119.      * @Groups({"todo@core"})
  120.      */
  121.     private $done_by_admin_id;
  122.     /**
  123.      * AI'nin bu todo icin hesapladigi tahmini efor — INSAN GELISTIRICI saati
  124.      * (AI'nin kendi implement suresi DEGIL). 8 saat = 1 is gunu.
  125.      * Kullanici formundan gelmez; sadece analiz akisi yazar (bkz. ai-estimate ucu),
  126.      * bu yuzden upsertTodo'nun hydrate listesine EKLENMEZ — aksi halde todo
  127.      * duzenlenince sessizce silinir.
  128.      *
  129.      * @ORM\Column(type="float", nullable=true)
  130.      * @Groups({"todo@core"})
  131.      */
  132.     private $ai_estimate_hours;
  133.     /**
  134.      * Tahminin gerekcesi — hangi dosyalar, neden bu kadar, riskler, kalan isler.
  135.      * Kartta gosterilmez; todo detayinda okunur.
  136.      *
  137.      * @ORM\Column(type="text", nullable=true)
  138.      * @Groups({"todo@core"})
  139.      */
  140.     private $ai_estimate_note;
  141.     /**
  142.      * Analizin yapildigi an. Bayat tahmin tespiti bunun uzerinden yapilir:
  143.      * ai_estimated_at < updated_at ise todo analizden sonra degismis demektir,
  144.      * FE tahmini "guncel degil" olarak isaretler.
  145.      *
  146.      * @ORM\Column(type="datetime", nullable=true)
  147.      * @Groups({"todo@core"})
  148.      */
  149.     private $ai_estimated_at;
  150.     /**
  151.      * @ORM\PrePersist
  152.      */
  153.     public function onPrePersist(): void
  154.     {
  155.         $this->created_at = new \DateTime();
  156.         $this->updated_at = new \DateTime();
  157.     }
  158.     /**
  159.      * @ORM\PreUpdate
  160.      */
  161.     public function onPreUpdate(): void
  162.     {
  163.         $this->updated_at = new \DateTime();
  164.     }
  165.     public function getId(): ?int { return $this->id; }
  166.     public function getDoneByAdminId(): ?int { return $this->done_by_admin_id; }
  167.     public function setDoneByAdminId(?int $done_by_admin_id): self { $this->done_by_admin_id = $done_by_admin_id; return $this; }
  168.     public function getAiEstimateHours(): ?float { return $this->ai_estimate_hours; }
  169.     public function setAiEstimateHours(?float $ai_estimate_hours): self { $this->ai_estimate_hours = $ai_estimate_hours; return $this; }
  170.     public function getAiEstimateNote(): ?string { return $this->ai_estimate_note; }
  171.     public function setAiEstimateNote(?string $ai_estimate_note): self { $this->ai_estimate_note = $ai_estimate_note; return $this; }
  172.     public function getAiEstimatedAt(): ?\DateTimeInterface { return $this->ai_estimated_at; }
  173.     public function setAiEstimatedAt(?\DateTimeInterface $ai_estimated_at): self { $this->ai_estimated_at = $ai_estimated_at; return $this; }
  174.     public function getTitle(): ?string { return $this->title; }
  175.     public function setTitle(string $title): self { $this->title = $title; return $this; }
  176.     public function getDescription(): ?string { return $this->description; }
  177.     public function setDescription(?string $description): self { $this->description = $description; return $this; }
  178.     public function getTranscript(): ?string { return $this->transcript; }
  179.     public function setTranscript(?string $transcript): self { $this->transcript = $transcript; return $this; }
  180.     public function getPriority(): ?string { return $this->priority; }
  181.     public function setPriority(string $priority): self { $this->priority = $priority; return $this; }
  182.     public function getType(): ?string { return $this->type; }
  183.     public function setType(string $type): self { $this->type = $type; return $this; }
  184.     public function getModule(): ?string { return $this->module; }
  185.     public function setModule(?string $module): self { $this->module = $module; return $this; }
  186.     public function getStatus(): ?string { return $this->status; }
  187.     public function setStatus(string $status): self { $this->status = $status; return $this; }
  188.     public function getAdminNote(): ?string { return $this->admin_note; }
  189.     public function setAdminNote(?string $admin_note): self { $this->admin_note = $admin_note; return $this; }
  190.     public function getIsSystem(): bool { return (bool) $this->is_system; }
  191.     public function setIsSystem(bool $is_system): self { $this->is_system = $is_system; return $this; }
  192.     public function getAssignToAi(): bool { return (bool) $this->assign_to_ai; }
  193.     public function setAssignToAi(bool $assign_to_ai): self { $this->assign_to_ai = $assign_to_ai; return $this; }
  194.     public function getAiStatus(): ?string { return $this->ai_status; }
  195.     public function setAiStatus(?string $ai_status): self { $this->ai_status = $ai_status; return $this; }
  196.     public function getAiBranch(): ?string { return $this->ai_branch; }
  197.     public function setAiBranch(?string $ai_branch): self { $this->ai_branch = $ai_branch; return $this; }
  198.     public function getDocuments(): ?array { return $this->documents ?? []; }
  199.     public function setDocuments(?array $documents): self { $this->documents = $documents ?? []; return $this; }
  200.     public function getUser(): ?User { return $this->user; }
  201.     public function setUser(?User $user): self { $this->user = $user; return $this; }
  202.     public function getCreatedAt(): ?\DateTime { return $this->created_at; }
  203.     public function getUpdatedAt(): ?\DateTime { return $this->updated_at; }
  204. }