Работа над журналом для ст. мед сестер

This commit is contained in:
brusnitsyn
2026-05-04 17:11:16 +09:00
parent f107ebd167
commit 7a58812072
61 changed files with 3532 additions and 1163 deletions

View File

@@ -3,11 +3,12 @@
namespace App\Application\Reports;
use App\Application\Reports\DTO\GenerateReportResult;
use App\Infrastructure\Reports\Services\AutoFillReportPayloadBuilder;
use App\Infrastructure\Reports\Services\ReportSaveOrchestrator;
use App\Models\Department;
use App\Models\Report;
use App\Models\User;
use App\Services\DateRange;
use App\Services\ReportService;
final readonly class ReportSavePathService
{
@@ -15,7 +16,8 @@ final readonly class ReportSavePathService
private ReportFlowDecider $reportFlowDecider,
private ReportInputFactory $reportInputFactory,
private GenerateReportUseCase $generateReportUseCase,
private ReportService $reportService,
private ReportSaveOrchestrator $reportSaveOrchestrator,
private AutoFillReportPayloadBuilder $autoFillReportPayloadBuilder,
) {}
public function usesNewArchitecture(string $reportType = 'daily'): bool
@@ -29,7 +31,7 @@ final readonly class ReportSavePathService
public function saveManual(User $actor, array $validated, string $reportType = 'daily'): GenerateReportResult|Report
{
if (! $this->usesNewArchitecture($reportType)) {
return $this->reportService->storeReport($validated, $actor, false);
return $this->reportSaveOrchestrator->storeReport($validated, $actor, false);
}
return $this->generateReportUseCase->handle(
@@ -44,9 +46,9 @@ final readonly class ReportSavePathService
string $reportType = 'daily',
): GenerateReportResult|Report {
if (! $this->usesNewArchitecture($reportType)) {
$payload = $this->reportService->buildAutoFillReportPayload($scopedUser, $department, $dateRange);
$payload = $this->autoFillReportPayloadBuilder->build($scopedUser, $department, $dateRange);
return $this->reportService->storeReport($payload, $scopedUser, true);
return $this->reportSaveOrchestrator->storeReport($payload, $scopedUser, true);
}
return $this->generateReportUseCase->handle(