package com.example.demo.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import jakarta.validation.constraints.Size;

import java.util.List;

import com.example.demo.dto.StepDto;

public class RecipeUpdateRequest {

    @NotBlank(message = "title is required")
    @Size(max = 100, message = "title must be 100 characters or less")
    private String title;

    @Size(max = 1000, message = "description must be 1000 characters or less")
    private String description;

    @PositiveOrZero(message = "prepTimeMinutes must be 0 or greater")
    private int prepTimeMinutes;

    @PositiveOrZero(message = "cookTimeMinutes must be 0 or greater")
    private int cookTimeMinutes;

    @PositiveOrZero(message = "servings must be 0 or greater")
    private int servings;

    @NotNull(message = "ingredients list is required")
    @Valid
    private List<IngredientDto> ingredients;

    @NotNull(message = "steps list is required")
    @Valid
    private List<StepDto> steps;

    public String getTitle() { return title; }
    public void setTitle(String title) { this.title = title; }

    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }

    public int getPrepTimeMinutes() { return prepTimeMinutes; }
    public void setPrepTimeMinutes(int prepTimeMinutes) { this.prepTimeMinutes = prepTimeMinutes; }

    public int getCookTimeMinutes() { return cookTimeMinutes; }
    public void setCookTimeMinutes(int cookTimeMinutes) { this.cookTimeMinutes = cookTimeMinutes; }

    public int getServings() { return servings; }
    public void setServings(int servings) { this.servings = servings; }

    public List<IngredientDto> getIngredients() { return ingredients; }
    public void setIngredients(List<IngredientDto> ingredients) { this.ingredients = ingredients; }

    public List<StepDto> getSteps() { return steps; }
    public void setSteps(List<StepDto> steps) { this.steps = steps; }
}