package com.iqser.red.service.persistence.service.v1.api.shared.model;

import java.io.Serializable;
import java.time.OffsetDateTime;
import java.util.Map;

import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.ProcessingStatus;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.WorkflowStatus;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "Object aggregation of different stats for a specific dossier.")
public class DossierStats implements Serializable {

    @Schema(description = "The ID of the dossier")
    private String dossierId;
    @Schema(description = "The number of files that belongs to the given dossier")
    private int numberOfFiles;
    @Schema(description = "The number of soft deleted files that belongs to the given dossier")
    private int numberOfSoftDeletedFiles;
    @Schema(description = "The sum of all pages")
    private int numberOfPages;
    @Schema(description = "The sum of all excluded pages")
    private int numberOfExcludedPages;
    @Schema(description = "True if at least one file in the dossier has redactions flag")
    private boolean hasRedactionsFilePresent; // true if at least one file in the dossier has redactions
    @Schema(description = "True if at least one file in the dossier has hints flag but doesn't have redactions flag")
    private boolean hasHintsNoRedactionsFilePresent; // true if at least one file in the dossier has hints but doesn't have redactions
    @Schema(description = "True if at least one file in the dossier has suggestions flag")
    private boolean hasSuggestionsFilePresent; // true if at least one file in the dossier has suggestions
    @Schema(description = "True if at least one file in the dossier has updates flag")
    private boolean hasUpdatesFilePresent; //true if at least one file in the dossier has updates
    @Schema(description = "True if at least one file in the dossier has none of the other flags")
    private boolean hasNoFlagsFilePresent; // true if at least one file in the dossier has none of the other flags
    @Schema(description = "Number of files in each processing status")
    private Map<ProcessingStatus, Integer> fileCountPerProcessingStatus;
    @Schema(description = "Number of files in each status")
    private Map<WorkflowStatus, Integer> fileCountPerWorkflowStatus;
    @Schema(description = "The most recent file modification date")
    private OffsetDateTime lastFileUpdateDate;
    @Schema(description = "The most recent file manipulation date")
    private OffsetDateTime fileManipulationDate;

}
