TaskSchema module
This commit is contained in:
36
backend/src/DTO/TaskSchemaRequest.php
Normal file
36
backend/src/DTO/TaskSchemaRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\DTO;
|
||||
|
||||
use App\Enum\TaskSchemaStatus;
|
||||
use App\Enum\TaskStatus;
|
||||
use Symfony\Component\Serializer\Attribute\Context;
|
||||
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
class TaskSchemaRequest
|
||||
{
|
||||
public function __construct(
|
||||
#[Assert\NotBlank]
|
||||
#[Assert\Length(max: 255)]
|
||||
public readonly string $name,
|
||||
|
||||
#[Assert\NotNull]
|
||||
public readonly TaskSchemaStatus $status = TaskSchemaStatus::Active,
|
||||
|
||||
#[Assert\NotNull]
|
||||
public readonly TaskStatus $taskStatus = TaskStatus::Active,
|
||||
|
||||
#[Context([DateTimeNormalizer::FORMAT_KEY => '!Y-m-d'])]
|
||||
public readonly ?\DateTimeImmutable $date = null,
|
||||
|
||||
public readonly ?array $repeat = null,
|
||||
|
||||
#[Context([DateTimeNormalizer::FORMAT_KEY => '!Y-m-d'])]
|
||||
public readonly ?\DateTimeImmutable $start = null,
|
||||
|
||||
#[Context([DateTimeNormalizer::FORMAT_KEY => '!Y-m-d'])]
|
||||
public readonly ?\DateTimeImmutable $end = null,
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user