feat: activity page

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-11 20:54:55 +01:00
parent f418b36167
commit 19395b4869
21 changed files with 625 additions and 35 deletions

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace App\Domain\Shared\Application\Response;
use App\Domain\Shared\Domain\Contract\ResponseInterface;
use App\Domain\Shared\Domain\Model\Job;
readonly class JobResponse implements ResponseInterface
{
public function __construct(
public string $id,
public string $type,
public string $status,
public \DateTimeImmutable $createdAt,
public ?\DateTimeImmutable $startedAt,
public ?\DateTimeImmutable $completedAt,
public ?string $failureReason,
public int $attempts,
public int $maxAttempts,
public array $context
) {
}
public static function fromJob(Job $job): self
{
return new self(
id: $job->id,
type: $job->type,
status: $job->status->value,
createdAt: $job->createdAt,
startedAt: $job->startedAt,
completedAt: $job->completedAt,
failureReason: $job->failureReason,
attempts: $job->attempts,
maxAttempts: $job->maxAttempts,
context: $job->context
);
}
}