feat: move profile completeness check from login to booking flow entry
- Add profileComplete flag to User entity to avoid API calls - Set flag during login (BpnAuthenticator) and profile save - Check flag in IndexController when entering booking flow - Remove ProfileCompletionSubscriber (no longer needed) Users with incomplete profiles are only redirected when starting a new booking, not on every login. Eliminates extra API call by caching completeness status on the user entity.
This commit is contained in:
@@ -35,6 +35,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
|
||||
private ?\DateTimeImmutable $lastLoginAt = null;
|
||||
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
private bool $profileComplete = false;
|
||||
|
||||
public function __construct(string $email)
|
||||
{
|
||||
$this->email = $email;
|
||||
@@ -129,6 +132,18 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isProfileComplete(): bool
|
||||
{
|
||||
return $this->profileComplete;
|
||||
}
|
||||
|
||||
public function setProfileComplete(bool $profileComplete): static
|
||||
{
|
||||
$this->profileComplete = $profileComplete;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user