package de.effigenix.infrastructure.production.web.dto;

import de.effigenix.domain.production.ProductionStep;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(requiredProperties = {"id", "stepNumber", "description"})
public record ProductionStepResponse(
        String id,
        int stepNumber,
        String description,
        @Schema(nullable = true) Integer durationMinutes,
        @Schema(nullable = true) Integer temperatureCelsius
) {
    public static ProductionStepResponse from(ProductionStep step) {
        return new ProductionStepResponse(
                step.id().value(),
                step.stepNumber(),
                step.description(),
                step.durationMinutes(),
                step.temperatureCelsius()
        );
    }
}
