4d3879156d
API Platform pagine par défaut à 30 éléments/page et le helper front extractHydraMembers ne lit que la première page (il ignore hydra:view.next), ce qui tronque silencieusement toute liste de plus de 30 éléments. - Back : paginationEnabled false sur les GetCollection consommées en entier et à volume borné/modéré (Client, Project, User, TaskTag, TaskGroup, TaskStatus, TaskPriority, TaskEffort, Workflow). - Front : nouveau helper fetchAllHydra() qui parcourt toutes les pages ; utilisé pour /notifications (volume non borné, reste paginé côté back). - Doc : règle anti-troncature ajoutée au CLAUDE.md. Déjà protégés (vérifiés) : Task, TimeEntry, TaskDocument, TaskRecurrence, AbsenceRequest/Policy/Balance (paginationEnabled false) et /time_entries/range.
76 lines
1.9 KiB
PHP
76 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Entity;
|
|
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Delete;
|
|
use ApiPlatform\Metadata\Get;
|
|
use ApiPlatform\Metadata\GetCollection;
|
|
use ApiPlatform\Metadata\Patch;
|
|
use ApiPlatform\Metadata\Post;
|
|
use App\Repository\TaskTagRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
|
|
#[ApiResource(
|
|
operations: [
|
|
new GetCollection(paginationEnabled: false, security: "is_granted('ROLE_USER')"),
|
|
new Get(security: "is_granted('ROLE_USER')"),
|
|
new Post(security: "is_granted('ROLE_ADMIN')"),
|
|
new Patch(security: "is_granted('ROLE_ADMIN')"),
|
|
new Delete(security: "is_granted('ROLE_ADMIN')"),
|
|
],
|
|
normalizationContext: ['groups' => ['task_tag:read']],
|
|
denormalizationContext: ['groups' => ['task_tag:write']],
|
|
order: ['label' => 'ASC'],
|
|
)]
|
|
#[ORM\Entity(repositoryClass: TaskTagRepository::class)]
|
|
#[ORM\Table(name: 'task_type')]
|
|
class TaskTag
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
#[Groups(['task_tag:read', 'task:read', 'time_entry:read'])]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
#[Groups(['task_tag:read', 'task_tag:write', 'task:read', 'time_entry:read'])]
|
|
private ?string $label = null;
|
|
|
|
#[ORM\Column(length: 7)]
|
|
#[Groups(['task_tag:read', 'task_tag:write', 'task:read', 'time_entry:read'])]
|
|
private ?string $color = '#222783';
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getLabel(): ?string
|
|
{
|
|
return $this->label;
|
|
}
|
|
|
|
public function setLabel(string $label): static
|
|
{
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getColor(): ?string
|
|
{
|
|
return $this->color;
|
|
}
|
|
|
|
public function setColor(string $color): static
|
|
{
|
|
$this->color = $color;
|
|
|
|
return $this;
|
|
}
|
|
}
|