stash light

This commit is contained in:
team 1
2026-02-12 10:03:52 +01:00
parent 5b650a8f28
commit 0bb0c0b42f
51 changed files with 6864 additions and 72 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace App\Service;
use App\Entity\IngestJob;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Uid\Uuid;
final class IngestJobService
{
public function __construct(private EntityManagerInterface $em)
{
}
public function startJob(
string $type,
?User $user = null,
?Uuid $documentId = null,
?Uuid $documentVersionId = null,
?string $logPath = null
): IngestJob
{
$job = new IngestJob($type);
$job->setStartedBy($user);
$job->setDocumentId($documentId);
$job->setDocumentVersionId($documentVersionId);
$job->setLogPath($logPath);
$this->em->persist($job);
$this->em->flush();
return $job;
}
public function markCompleted(IngestJob $job): void
{
$job->markCompleted();
$this->em->flush();
}
public function markFailed(IngestJob $job, string $message): void
{
$job->markFailed($message);
$this->em->flush();
}
public function markAborted(IngestJob $job): void
{
$job->markAborted();
$this->em->flush();
}
}