base commit

This commit is contained in:
Mekan1206
2026-07-30 17:24:40 +05:00
commit a794dacd39
345 changed files with 29597 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace App\DTOs\Import;
readonly class ReportRowDto
{
public function __construct(
public string $employeeNumber,
public ?string $reportDate,
public ?string $title,
public ?string $description,
public ?string $severity,
) {}
/**
* @param array<string, mixed> $row
*/
public static function fromMappedRow(array $row): self
{
return new self(
employeeNumber: (string) ($row['employee_number'] ?? ''),
reportDate: self::nullableString($row['report_date'] ?? null),
title: self::nullableString($row['title'] ?? null),
description: self::nullableString($row['description'] ?? null),
severity: self::nullableString($row['severity'] ?? null),
);
}
private static function nullableString(mixed $value): ?string
{
if ($value === null || $value === '') {
return null;
}
return (string) $value;
}
}