Работа над журналом для ст. мед сестер
This commit is contained in:
@@ -5,26 +5,30 @@ namespace App\Infrastructure\Reports\Adapters;
|
||||
use App\Application\Reports\DTO\GenerateReportInput;
|
||||
use App\Domain\Reports\Models\ReportSnapshot;
|
||||
use App\Domain\Reports\ValueObjects\MetrikaConfig;
|
||||
use App\Infrastructure\Reports\Services\AutoFillReportPayloadBuilder;
|
||||
use App\Infrastructure\Reports\Services\ReportRuntimeService;
|
||||
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\DateRangeService;
|
||||
use App\Services\ReportService;
|
||||
use App\Services\SnapshotService;
|
||||
use DateTimeImmutable;
|
||||
|
||||
class LegacyReportServiceAdapter
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ReportService $reportService,
|
||||
private readonly SnapshotService $snapshotService,
|
||||
private readonly DateRangeService $dateRangeService,
|
||||
private readonly AutoFillReportPayloadBuilder $autoFillReportPayloadBuilder,
|
||||
private readonly ReportRuntimeService $reportRuntimeService,
|
||||
private readonly ReportSaveOrchestrator $reportSaveOrchestrator,
|
||||
) {}
|
||||
|
||||
public function prepareMemoryForHeavySave(): void
|
||||
{
|
||||
$this->reportService->prepareForHeavySave();
|
||||
$this->reportRuntimeService->prepareForHeavySave();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +86,7 @@ class LegacyReportServiceAdapter
|
||||
|
||||
public function syncCalculatedMetrics(Report $report, User $user, ReportSnapshot $snapshot): void
|
||||
{
|
||||
$this->reportService->syncCalculatedMetricsForStoredReport(
|
||||
$this->reportSaveOrchestrator->syncCalculatedMetrics(
|
||||
$report,
|
||||
$user,
|
||||
[
|
||||
@@ -96,22 +100,22 @@ class LegacyReportServiceAdapter
|
||||
|
||||
public function finalizeStoredReport(Report $report): void
|
||||
{
|
||||
$this->reportService->finalizeStoredReport($report);
|
||||
$this->reportSaveOrchestrator->finalizeStoredReport($report);
|
||||
}
|
||||
|
||||
public function saveLethalMetricFromSnapshots(Report $report): void
|
||||
{
|
||||
$this->reportService->saveLethalMetricForStoredReport($report);
|
||||
$this->reportSaveOrchestrator->saveLethalMetricFromSnapshots($report);
|
||||
}
|
||||
|
||||
public function clearCacheAfterReportCreation(User $user, Report $report): void
|
||||
{
|
||||
$this->reportService->clearCacheAfterStoredReport($user, $report);
|
||||
$this->reportRuntimeService->clearCacheAfterReportCreation($user, $report);
|
||||
}
|
||||
|
||||
public function buildAutoFillPayload(User $user, Department $department, DateRange $dateRange): array
|
||||
{
|
||||
return $this->reportService->buildAutoFillReportPayload($user, $department, $dateRange);
|
||||
return $this->autoFillReportPayloadBuilder->build($user, $department, $dateRange);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user