<?php
/**
 * Provider execution context.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Provider;

use ScheduledChanges\Domain\Shared\Uuid;

/**
 * Immutable details available to a provider write operation.
 */
final class ExecutionContext {
	private Uuid $runUuid;
	private Uuid $operationUuid;
	private bool $dryRun      = false;
	private ?int $actorUserId = null;
	public function __construct( Uuid $runUuid, Uuid $operationUuid, bool $dryRun = false, ?int $actorUserId = null ) {
		$this->runUuid       = $runUuid;
		$this->operationUuid = $operationUuid;
		$this->dryRun        = $dryRun;
		$this->actorUserId   = $actorUserId;
	}

	public function runUuid(): Uuid {
		return $this->runUuid;
	}

	public function operationUuid(): Uuid {
		return $this->operationUuid;
	}

	public function dryRun(): bool {
		return $this->dryRun;
	}

	public function actorUserId(): ?int {
		return $this->actorUserId;
	}
}
