WIP: Implement application process

This commit is contained in:
Björn Fromme
2023-10-10 17:17:30 +02:00
parent 3a458df94f
commit 6910ab6134
34 changed files with 937 additions and 119 deletions
+1
View File
@@ -15,6 +15,7 @@ class Application implements TimestampableEntityInterface
public const STATUS_NEW = 'new';
public const STATUS_PENDING = 'pending';
public const STATUS_REJECTED = 'rejected';
#[ORM\Id]
#[ORM\GeneratedValue]
+28
View File
@@ -73,12 +73,16 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
#[ORM\ManyToOne]
private ?User $contact = null;
#[ORM\ManyToMany(targetEntity: Teamer::class, mappedBy: 'bookmarks')]
private Collection $teamers;
public function __construct()
{
$this->uuid = Uuid::v4();
$this->fees = new ArrayCollection();
$this->applications = new ArrayCollection();
$this->dispositions = new ArrayCollection();
$this->teamers = new ArrayCollection();
$this->benefits = "Anreise im E&P Reisebus\nUnterkunft\nVerpflegung\nSkipass\n";
}
@@ -316,4 +320,28 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
return $this;
}
/**
* @return Collection<int, Teamer>
*/
public function getTeamers(): Collection
{
return $this->teamers;
}
public function addTeamer(Teamer $teamer): static
{
if (!$this->teamers->contains($teamer)) {
$this->teamers->add($teamer);
}
return $this;
}
public function removeTeamer(Teamer $teamer): static
{
$this->teamers->removeElement($teamer);
return $this;
}
}
+37 -4
View File
@@ -24,17 +24,26 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
private string $uuid;
#[ORM\ManyToOne(inversedBy: 'dispositions')]
private ?Assignment $assignment = null;
private ?Assignment $assignment;
#[ORM\ManyToOne(inversedBy: 'dispositions')]
private ?Teamer $teamer = null;
private ?Teamer $teamer;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $remarks = null;
private ?string $remarks;
public function __construct()
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Upload $contractPdf = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Upload $invoicePdf = null;
public function __construct(Application $application)
{
$this->uuid = Uuid::v4();
$this->assignment = $application->getAssignment();
$this->teamer = $application->getTeamer();
$this->remarks = $application->getRemarks();
}
public function getId(): ?int
@@ -82,4 +91,28 @@ class Disposition implements BlameableEntityInterface, TimestampableEntityInterf
return $this;
}
public function getContractPdf(): ?Upload
{
return $this->contractPdf;
}
public function setContractPdf(?Upload $contractPdf): static
{
$this->contractPdf = $contractPdf;
return $this;
}
public function getInvoicePdf(): ?Upload
{
return $this->invoicePdf;
}
public function setInvoicePdf(?Upload $invoicePdf): static
{
$this->invoicePdf = $invoicePdf;
return $this;
}
}
+7 -7
View File
@@ -94,25 +94,25 @@ class Teamer implements TimestampableEntityInterface
#[Assert\NotNull(message: 'Bitte lade ein Foto von dir hoch', groups: ['profile', 'profile_preflight'])]
private ?Upload $photo = null;
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Feedback::class)]
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Feedback::class, cascade: ['remove'])]
private Collection $feedback;
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: TrainingAttendance::class)]
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: TrainingAttendance::class, cascade: ['remove'])]
private Collection $trainingAttendances;
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: License::class)]
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: License::class, cascade: ['remove'])]
private Collection $licenses;
#[ORM\ManyToMany(targetEntity: JobProfile::class)]
#[ORM\ManyToMany(targetEntity: JobProfile::class, orphanRemoval: true)]
private Collection $jobProfiles;
#[ORM\ManyToMany(targetEntity: Assignment::class)]
#[ORM\ManyToMany(targetEntity: Assignment::class, inversedBy: 'teamers', orphanRemoval: true)]
private Collection $bookmarks;
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Application::class)]
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Application::class, cascade: ['remove'])]
private Collection $applications;
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Disposition::class)]
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Disposition::class, cascade: ['remove'])]
private Collection $dispositions;
#[ORM\OneToOne(mappedBy: 'teamer')]