<?php

declare(strict_types=1);

namespace App\Framework\Deployment\Pipeline\Events;

use App\Framework\Core\ValueObjects\Duration;
use App\Framework\Deployment\Pipeline\ValueObjects\PipelineId;
use App\Framework\Deployment\Pipeline\ValueObjects\PipelineStage;

/**
 * Pipeline Rolled Back Event
 *
 * Dispatched when a pipeline is rolled back after failure.
 */
final readonly class PipelineRolledBack
{
    public function __construct(
        public PipelineId $pipelineId,
        public PipelineStage $failedStage,
        public string $reason,
        public Duration $rollbackDuration,
        public \DateTimeImmutable $timestamp
    ) {}
}
