package ai.decompile.analysis.model.dto;

import ai.decompile.analysis.model.entity.StaticAnalysis;
import java.time.Instant;
import java.util.UUID;

public record AnalysisResponse(
    UUID id,
    UUID binaryId,
    UUID jobId,
    String engine,
    String status,
    int functionCount,
    String entryPoint,
    Instant createdAt,
    Instant updatedAt) {
  public static AnalysisResponse from(StaticAnalysis a) {
    return new AnalysisResponse(
        a.getId(),
        a.getBinary().getId(),
        a.getJobId(),
        a.getEngine(),
        a.getStatus(),
        a.getFunctionCount(),
        a.getEntryPoint(),
        a.getCreatedAt(),
        a.getUpdatedAt());
  }
}
