package com.zhengmeng.ocrplatform.task;

import com.zhengmeng.ocrplatform.document.OcrDocumentEntity;

import java.time.LocalDateTime;

public record OcrTaskDocumentItem(
        Long id,
        String taskId,
        String originalFilename,
        String objectPath,
        String contentType,
        long fileSize,
        String sha256,
        Integer pageCount,
        LocalDateTime createdAt
) {
    public static OcrTaskDocumentItem from(OcrDocumentEntity entity) {
        return new OcrTaskDocumentItem(
                entity.getId(),
                entity.getTaskId(),
                entity.getOriginalFilename(),
                entity.getObjectPath(),
                entity.getContentType(),
                entity.getFileSize(),
                entity.getSha256(),
                entity.getPageCount(),
                entity.getCreatedAt()
        );
    }
}
