feat: add national code to patient records and user entity, update related functionality

This commit is contained in:
hamed
2026-06-22 19:44:17 +03:30
parent 3c103bc51e
commit 5b1dfe9b40
7 changed files with 252 additions and 130 deletions
+5
View File
@@ -32,6 +32,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(name: 'real_name', type: 'string', length: 100, nullable: true)]
private ?string $realName = null;
#[ORM\Column(name: 'national_code', type: 'string', length: 10, nullable: true)]
private ?string $nationalCode = null;
#[ORM\Column(type: 'json')]
private array $roles = ['ROLE_USER'];
@@ -57,6 +60,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
public function getMobileNumber(): string { return $this->mobileNumber; }
public function getEmail(): ?string { return $this->email; }
public function getRealName(): ?string { return $this->realName; }
public function getNationalCode(): ?string { return $this->nationalCode; }
public function getStatus(): int { return $this->status; }
public function getCreatedAt(): int { return $this->createdAt; }
@@ -77,6 +81,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
public function setEmail(?string $email): self { $this->email = $email; return $this; }
public function setRealName(?string $name): self { $this->realName = $name; $this->updatedAt = time(); return $this; }
public function setNationalCode(?string $code): self { $this->nationalCode = $code !== null && $code !== '' ? $code : null; $this->updatedAt = time(); return $this; }
public function setPasswordHash(?string $hash): self { $this->passwordHash = $hash; $this->updatedAt = time(); return $this; }
public function setRoles(array $roles): self { $this->roles = $roles; $this->updatedAt = time(); return $this; }
public function setStatus(int $status): self { $this->status = $status; $this->updatedAt = time(); return $this; }