harden document versions

This commit is contained in:
team 1
2026-02-16 08:48:35 +01:00
parent 93c4a53589
commit 6cc58c7d0d
4 changed files with 88 additions and 51 deletions

View File

@@ -10,6 +10,12 @@ class IngestJob
{
public const TYPE_DOCUMENT = 'DOCUMENT';
public const TYPE_GLOBAL_REINDEX = 'GLOBAL_REINDEX';
/**
* Special job type used when a DocumentVersion is activated.
* Semantics: always re-ingest the selected version (even if it was previously INDEXED),
* ensuring the index reflects the currently active version.
*/
public const TYPE_DOCUMENT_VERSION_ACTIVATE = 'DOCUMENT_VERSION_ACTIVATE';
public const STATUS_QUEUED = 'QUEUED';
public const STATUS_RUNNING = 'RUNNING';
@@ -49,12 +55,12 @@ class IngestJob
#[ORM\Column(type: 'text', nullable: true)]
private ?string $errorMessage = null;
public function __construct(string $type)
public function __construct(string $type, string $status = self::STATUS_RUNNING)
{
$this->id = Uuid::v4();
$this->type = $type;
$this->startedAt = new \DateTimeImmutable();
$this->status = self::STATUS_RUNNING;
$this->status = $status;
}
public function getId(): Uuid { return $this->id; }