package com.yaoai.api.dto.project;

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

import java.time.LocalDateTime;

@Data
public class ProjectDTO {

    private Long id;
    private String name;
    private String description;
    private String status;
    private String style;
    private String aspectRatio;
    private String resolution;
    private String coverUrl;
    private long assetCount;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    public static ProjectDTO from(Project p, String coverUrl, long assetCount) {
        ProjectDTO dto = new ProjectDTO();
        dto.setId(p.getId());
        dto.setName(p.getName());
        dto.setDescription(p.getDescription());
        dto.setStatus(p.getStatus());
        dto.setStyle(p.getStyle());
        dto.setAspectRatio(p.getAspectRatio());
        dto.setResolution(p.getResolution());
        dto.setCoverUrl(coverUrl);
        dto.setAssetCount(assetCount);
        dto.setCreatedAt(p.getCreatedAt());
        dto.setUpdatedAt(p.getUpdatedAt());
        return dto;
    }
}
