[#FER-30] Revoir l'affichage type bovin (!57)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #57 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #57.
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter;
|
||||
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
|
||||
use ApiPlatform\Metadata\ApiFilter;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
@@ -19,6 +20,7 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
'label' => 'ipartial',
|
||||
'code' => 'ipartial',
|
||||
])]
|
||||
#[ApiFilter(BooleanFilter::class, properties: ['display'])]
|
||||
#[ApiResource(
|
||||
operations: [
|
||||
new Get(
|
||||
@@ -58,6 +60,15 @@ class BovineType
|
||||
#[Groups(['bovine-type:read', 'bovine-type:write', 'reception:read', 'reception-bovine:read', 'bovine:read', 'building_case:read'])]
|
||||
private ?string $code = null;
|
||||
|
||||
/**
|
||||
* Détermine si le type bovin est proposé à la sélection lors d'une réception.
|
||||
* Les types créés automatiquement par la synchro inventaire arrivent à false ;
|
||||
* seul un admin peut les activer.
|
||||
*/
|
||||
#[ORM\Column(options: ['default' => false])]
|
||||
#[Groups(['bovine-type:read', 'bovine-type:write'])]
|
||||
private bool $display = false;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@@ -86,4 +97,16 @@ class BovineType
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isDisplay(): bool
|
||||
{
|
||||
return $this->display;
|
||||
}
|
||||
|
||||
public function setDisplay(bool $display): static
|
||||
{
|
||||
$this->display = $display;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user