feat(api): ajouter les entites et repositories inventory
This commit is contained in:
@@ -36,49 +36,48 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
class Profile implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: 'string', length: 30)]
|
||||
#[ORM\Column(type: 'string', length: 36)]
|
||||
#[Groups(['profile:read'])]
|
||||
private ?string $id = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 180, unique: true)]
|
||||
#[Assert\NotBlank]
|
||||
#[ORM\Column(type: 'string', length: 180, unique: true, nullable: true)]
|
||||
#[Assert\Email]
|
||||
#[Groups(['profile:read', 'profile:write'])]
|
||||
private string $email;
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 100)]
|
||||
#[ORM\Column(type: 'string', length: 100, name: 'firstName')]
|
||||
#[Assert\NotBlank]
|
||||
#[Groups(['profile:read', 'profile:write'])]
|
||||
private string $firstName;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 100)]
|
||||
#[ORM\Column(type: 'string', length: 100, name: 'lastName')]
|
||||
#[Assert\NotBlank]
|
||||
#[Groups(['profile:read', 'profile:write'])]
|
||||
private string $lastName;
|
||||
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => true])]
|
||||
#[ORM\Column(type: 'boolean', options: ['default' => true], name: 'isActive')]
|
||||
#[Groups(['profile:read', 'profile:write'])]
|
||||
private bool $isActive = true;
|
||||
|
||||
/**
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column(type: 'json')]
|
||||
#[ORM\Column(type: 'json', options: ['default' => '["ROLE_USER"]'])]
|
||||
#[Groups(['profile:read', 'profile:write'])]
|
||||
private array $roles = ['ROLE_USER'];
|
||||
|
||||
/**
|
||||
* @var string The hashed password
|
||||
*/
|
||||
#[ORM\Column(type: 'string')]
|
||||
#[ORM\Column(type: 'string', nullable: true)]
|
||||
#[Groups(['profile:write'])]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\Column(type: 'datetime_immutable')]
|
||||
#[ORM\Column(type: 'datetime_immutable', name: 'createdAt')]
|
||||
#[Groups(['profile:read'])]
|
||||
private DateTimeImmutable $createdAt;
|
||||
|
||||
#[ORM\Column(type: 'datetime_immutable')]
|
||||
#[ORM\Column(type: 'datetime_immutable', name: 'updatedAt')]
|
||||
#[Groups(['profile:read'])]
|
||||
private DateTimeImmutable $updatedAt;
|
||||
|
||||
@@ -95,12 +94,12 @@ class Profile implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getEmail(): string
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
public function setEmail(?string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
@@ -148,7 +147,7 @@ class Profile implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return $this->email;
|
||||
return (string) $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user