package com.yaoai.api.dto.ai;

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

import java.time.LocalDateTime;

@Data
public class AssemblyTaskDTO {

    private Long id;
    private Long episodeId;
    private String status;
    private Integer shotCount;
    private String downloadUrl;
    private String errorMessage;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    public static AssemblyTaskDTO from(AssemblyTask t, String downloadUrl) {
        AssemblyTaskDTO dto = new AssemblyTaskDTO();
        dto.setId(t.getId());
        dto.setEpisodeId(t.getEpisodeId());
        dto.setStatus(t.getStatus());
        dto.setShotCount(t.getShotCount());
        dto.setDownloadUrl(downloadUrl);
        dto.setErrorMessage(t.getErrorMessage());
        dto.setCreatedAt(t.getCreatedAt());
        dto.setUpdatedAt(t.getUpdatedAt());
        return dto;
    }
}
