<?php

namespace App\Domain\Conversion\Application\Response;

use App\Domain\Conversion\Domain\Model\ConversionResult;

final readonly class ConversionResponse
{
    public function __construct(
        public string $convertedFilePath,
        public string $outputFilename,
        public int $originalFileSize,
        public int $convertedFileSize
    ) {
    }

    public static function fromConversionResult(ConversionResult $result): self
    {
        return new self(
            convertedFilePath: $result->getConvertedFilePath(),
            outputFilename: $result->getOutputFilename(),
            originalFileSize: $result->getOriginalFileSize(),
            convertedFileSize: $result->getConvertedFileSize()
        );
    }
}
