package com.utic.center.utic.stat.server.repository;

import com.utic.center.common.dto.ProcessStateDto;
import com.utic.center.utic.stat.server.dto.BatchJobInfoDto;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

@Slf4j
@Getter
public class ApplicationRepository {

    private ApplicationRepository() {
        throw new IllegalStateException("ApplicationRepository class");
    }

    public static final ProcessStateDto processState = ProcessStateDto.builder()
            .processId("70030")
            .regDate("")
            .runState(ProcessStateDto.RUN_STATE.NORMAL.getValue())
            .rcvCnt(0)
            .sndCnt(0)
            .etcCnt(0)
            .errDesc("")
            .errTimeGap(120)
            .build();

    public static String regDate;
    public static String past10Min;
    public static String past25Min;
    public static String past30Min;
    public static String past45Min;
    public static String past60Min;
    public static String past90Min;
    public static String past120Min;
    public static List<BatchJobInfoDto> batchJobInfoList = new ArrayList<>();

    public static void addJobInfo(BatchJobInfoDto jobInfo) {
        if (batchJobInfoList.size() > 72) {
            batchJobInfoList.remove(0);
        }
        batchJobInfoList.add(jobInfo);
    }

}
