<?php
/**
 * Recording finalization result.
 *
 * @package ScheduledChanges
 */

namespace ScheduledChanges\Recording;

use ScheduledChanges\Domain\Shared\Uuid;

/**
 * Identifies the draft launch generated from a recording.
 */
final class RecordingFinalizationResult {
	private Uuid $launch_uuid;
	private int $launch_id;
	private int $version_id;
	private int $selected_change_count;
	public function __construct(
		Uuid $launch_uuid,
		int $launch_id,
		int $version_id,
		int $selected_change_count
	) {
		$this->launch_uuid           = $launch_uuid;
		$this->launch_id             = $launch_id;
		$this->version_id            = $version_id;
		$this->selected_change_count = $selected_change_count;
		if ( $this->launch_id <= 0 || $this->version_id <= 0 || $this->selected_change_count <= 0 ) {
			throw new \InvalidArgumentException( 'Finalized recordings require a launch, version, and selected changes.' );
		}
	}

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

	public function launchId(): int {
		return $this->launch_id;
	}

	public function versionId(): int {
		return $this->version_id;
	}

	public function selectedChangeCount(): int {
		return $this->selected_change_count;
	}
}
