package kr.co.accura.wtm.domain.teal.dto;

import kr.co.accura.wtm.domain.teal.entity.TealVersion;

import java.time.LocalDate;
import java.time.LocalDateTime;

public record TealVersionDto(
        Long id,
        Long projectId,
        Integer versionNumber,
        LocalDate effectiveDate,
        String description,
        String status,
        Long uploadedBy,
        LocalDateTime createdAt,
        int entryCount
) {
    public static TealVersionDto from(TealVersion version, int entryCount) {
        return new TealVersionDto(
                version.getId(),
                version.getProjectId(),
                version.getVersionNumber(),
                version.getEffectiveDate(),
                version.getDescription(),
                version.getStatus(),
                version.getUploadedBy(),
                version.getCreatedAt(),
                entryCount
        );
    }
}
