feat: driver license check for teamers
closes #869bup9vf
This commit is contained in:
+111
-1
@@ -23,6 +23,11 @@ class Teamer implements TimestampableEntityInterface
|
||||
public const STATUS_NEW = 'new';
|
||||
public const STATUS_EXISTING = 'existing';
|
||||
|
||||
public const DRIVER_LICENSE_STATUS_NONE = 'none';
|
||||
public const DRIVER_LICENSE_STATUS_PENDING_REVIEW = 'pending_review';
|
||||
public const DRIVER_LICENSE_STATUS_APPROVED = 'approved';
|
||||
public const DRIVER_LICENSE_STATUS_DENIED = 'denied';
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
@@ -140,6 +145,27 @@ class Teamer implements TimestampableEntityInterface
|
||||
#[ORM\Column]
|
||||
private bool $allowOverlappingApplications = false;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $driverLicenseDeclaration = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private bool $driverLicenseVerified = false;
|
||||
|
||||
#[ORM\Column(length: 64)]
|
||||
private string $driverLicenseStatus = self::DRIVER_LICENSE_STATUS_NONE;
|
||||
|
||||
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
|
||||
private ?Upload $driverLicenseUpload = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $driverLicenseReviewComment = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)]
|
||||
private ?\DateTimeImmutable $driverLicenseReviewedAt = null;
|
||||
|
||||
#[ORM\Column(length: 8, nullable: true)]
|
||||
private ?string $driverLicenseReviewedBy = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->uuid = Uuid::v4();
|
||||
@@ -750,7 +776,91 @@ class Teamer implements TimestampableEntityInterface
|
||||
|
||||
public function hasPickup(int $pickupId): bool
|
||||
{
|
||||
return in_array($pickupId, $this->getPickups());
|
||||
return true === in_array($pickupId, $this->getPickups(), true);
|
||||
}
|
||||
|
||||
public function getDriverLicenseDeclaration(): ?bool
|
||||
{
|
||||
return $this->driverLicenseDeclaration;
|
||||
}
|
||||
|
||||
public function setDriverLicenseDeclaration(?bool $driverLicenseDeclaration): static
|
||||
{
|
||||
$this->driverLicenseDeclaration = $driverLicenseDeclaration;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isDriverLicenseVerified(): bool
|
||||
{
|
||||
return $this->driverLicenseVerified;
|
||||
}
|
||||
|
||||
public function setDriverLicenseVerified(bool $driverLicenseVerified): static
|
||||
{
|
||||
$this->driverLicenseVerified = $driverLicenseVerified;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDriverLicenseStatus(): string
|
||||
{
|
||||
return $this->driverLicenseStatus;
|
||||
}
|
||||
|
||||
public function setDriverLicenseStatus(string $driverLicenseStatus): static
|
||||
{
|
||||
$this->driverLicenseStatus = $driverLicenseStatus;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDriverLicenseUpload(): ?Upload
|
||||
{
|
||||
return $this->driverLicenseUpload;
|
||||
}
|
||||
|
||||
public function setDriverLicenseUpload(?Upload $driverLicenseUpload): static
|
||||
{
|
||||
$this->driverLicenseUpload = $driverLicenseUpload;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDriverLicenseReviewComment(): ?string
|
||||
{
|
||||
return $this->driverLicenseReviewComment;
|
||||
}
|
||||
|
||||
public function setDriverLicenseReviewComment(?string $driverLicenseReviewComment): static
|
||||
{
|
||||
$this->driverLicenseReviewComment = $driverLicenseReviewComment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDriverLicenseReviewedAt(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->driverLicenseReviewedAt;
|
||||
}
|
||||
|
||||
public function setDriverLicenseReviewedAt(?\DateTimeImmutable $driverLicenseReviewedAt): static
|
||||
{
|
||||
$this->driverLicenseReviewedAt = $driverLicenseReviewedAt;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDriverLicenseReviewedBy(): ?string
|
||||
{
|
||||
return $this->driverLicenseReviewedBy;
|
||||
}
|
||||
|
||||
public function setDriverLicenseReviewedBy(?string $driverLicenseReviewedBy): static
|
||||
{
|
||||
$this->driverLicenseReviewedBy = $driverLicenseReviewedBy;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLanguage(): ?string
|
||||
|
||||
@@ -21,6 +21,7 @@ class Upload implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
public const TYPE_CONTRACT = 'contract';
|
||||
public const TYPE_INVOICE = 'invoice';
|
||||
public const TYPE_DOCUMENT = 'document';
|
||||
public const TYPE_DRIVER_LICENSE = 'driver_license';
|
||||
|
||||
public const STATUS_NEW = 'new';
|
||||
public const STATUS_PENDING = 'pending';
|
||||
@@ -133,6 +134,7 @@ class Upload implements BlameableEntityInterface, TimestampableEntityInterface
|
||||
self::TYPE_CONTRACT => 'Honorarvertrag',
|
||||
self::TYPE_INVOICE => 'Honorarnote',
|
||||
self::TYPE_DOCUMENT => 'Info',
|
||||
self::TYPE_DRIVER_LICENSE => 'Führerschein',
|
||||
default => 'Dokument',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user