Перевод на DDD

This commit is contained in:
brusnitsyn
2026-07-31 17:19:03 +09:00
parent 2dd55b9d11
commit 2c6d4a04cc
48 changed files with 1796 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Domain\Patient\Actions;
use App\Domain\Patient\Contracts\PatientRepositoryInterface;
use App\Domain\Patient\DTO\PatientData;
use Illuminate\Support\Collection;
readonly class GetDepartmentJournalPatientAction
{
public function __construct(
private PatientRepositoryInterface $patientRepository
) {}
public function execute(int $departmentId): ?Collection
{
$patients = $this->patientRepository->getCurrentByDepartmentId($departmentId);
if ($patients && $patients->count() > 0) {
return $patients->map(fn ($patient) => PatientData::fromMis($patient));
}
return null;
}
}