package com.yaoai.api.dto.ai;

import com.yaoai.domain.entity.Episode;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class EpisodeDTO {

    private Long id;
    private Long outlineId;
    private Integer episodeNumber;
    private String title;
    private String summary;
    private String script;
    private String status;
    private int storyboardCount;
    private LocalDateTime createdAt;

    public static EpisodeDTO from(Episode e) {
        return from(e, 0);
    }

    public static EpisodeDTO from(Episode e, int storyboardCount) {
        EpisodeDTO dto = new EpisodeDTO();
        dto.setId(e.getId());
        dto.setOutlineId(e.getOutlineId());
        dto.setEpisodeNumber(e.getEpisodeNumber());
        dto.setTitle(e.getTitle());
        dto.setSummary(e.getSummary());
        dto.setScript(e.getScript());
        dto.setStatus(e.getStatus());
        dto.setStoryboardCount(storyboardCount);
        dto.setCreatedAt(e.getCreatedAt());
        return dto;
    }
}
