mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-07-04 22:50:15 +02:00
18a6090366
* Add Penalty Seconds on tests * Refactors and start of candidate answer relation * Add breadcrumbs and UI consistency updates across backoffice templates * Add breadcrumbs and UI consistency updates across backoffice templates * Add Dutch translations for email verification and security messages * Rector * Refactor for code consistency and type safety assertions across repositories and entities * Refactor candidate-related logic to optimize queries, improve template separation, and add "Answer Mapping" functionality. * Cleanup * Update Symfony * Add coderabbit config * Fixes from coderabbit
50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tvdt\Entity;
|
|
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Gedmo\Mapping\Annotation as Gedmo;
|
|
use Symfony\Bridge\Doctrine\Types\UuidType;
|
|
use Symfony\Component\Uid\Uuid;
|
|
use Tvdt\Repository\QuizCandidateRepository;
|
|
|
|
#[ORM\Entity(repositoryClass: QuizCandidateRepository::class)]
|
|
#[ORM\UniqueConstraint(columns: ['candidate_id', 'quiz_id'])]
|
|
class QuizCandidate
|
|
{
|
|
#[ORM\Column(type: UuidType::NAME, unique: true)]
|
|
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
|
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
|
#[ORM\Id]
|
|
public private(set) Uuid $id;
|
|
|
|
#[ORM\Column]
|
|
public float $corrections = 0;
|
|
|
|
#[ORM\Column(type: Types::SMALLINT, options: ['default' => 0])]
|
|
public int $penaltySeconds = 0;
|
|
|
|
#[ORM\Column(type: Types::BOOLEAN, options: ['default' => true])]
|
|
public bool $active = true;
|
|
|
|
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE, nullable: true)]
|
|
public ?\DateTimeImmutable $started = null;
|
|
|
|
#[Gedmo\Timestampable(on: 'create')]
|
|
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
|
|
public private(set) \DateTimeImmutable $created;
|
|
|
|
public function __construct(
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
#[ORM\ManyToOne(inversedBy: 'candidateData')]
|
|
public Quiz $quiz,
|
|
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
#[ORM\ManyToOne(inversedBy: 'quizData')]
|
|
public Candidate $candidate,
|
|
) {}
|
|
}
|