package ru.soune.nocopy.dto.statistic;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ProtectedFilesStatisticResponse {

    @JsonProperty("total_files")
    private Long totalFiles;

    @JsonProperty("total_size_bytes")
    private Long totalSizeBytes;

    @JsonProperty("total_size_gb")
    private Double totalSizeGb;

    @JsonProperty("files_per_user_percentiles")
    private Percentiles filesPerUser;

    @JsonProperty("size_per_user_percentiles")
    private SizePercentiles sizePerUser;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Percentiles {
        @JsonProperty("p5")
        private Long p5;

        @JsonProperty("p50")
        private Long p50;

        @JsonProperty("p95")
        private Long p95;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class SizePercentiles {
        @JsonProperty("p5_bytes")
        private Long p5;

        @JsonProperty("p50_bytes")
        private Long p50;

        @JsonProperty("p95_bytes")
        private Long p95;

        @JsonProperty("p5_mb")
        private Double p5Mb;

        @JsonProperty("p50_mb")
        private Double p50Mb;

        @JsonProperty("p95_mb")
        private Double p95Mb;
    }
}
