import httpClient from '@/common/http-client';
import dayExcelHeader from './mock/dayExcelHeader.json';
import monthExcelHeader from './mock/monthExcelHeader.json'
import bsnmDayExcelHeader from './mock/bsnmDayExcelHeader.json'
import bsnmMonthExcelHeader from './mock/bsnmMonthExcelHeader.json'

// HUBEZ_BO_API - 일별 통계 목록 조회.
const dayList = (params) => {
    return httpClient.post('/api/v1/bo/stats/dayList', params, { withCredentials: false });
}

// HUBEZ_BO_API - 월별 통계 목록 조회.
const monthList = (params) => {
    return httpClient.post('/api/v1/bo/stats/monthList', params, { withCredentials: false });
}

// HUBEZ_BO_API - [사업자별] 일별 통계 목록 조회.
const bsnmDayList = (params) => {
    return httpClient.post('/api/v1/bo/stats/bsnmDayList', params, { withCredentials: false });
}

// HUBEZ_BO_API - [사업자별] 월별 통계 목록 조회.
const bsnmMonthList = (params) => {
    return httpClient.post('/api/v1/bo/stats/bsnmMonthList', params, { withCredentials: false });
}

const bsnmMonthListExcel = (params) => {
    return httpClient.post('/api/v1/bo/stats/bsnmMonthListExcel', params);
}

const bsnmDayListExcel = (params) => {
    return httpClient.post('/api/v1/bo/stats/bsnmDayListExcel', params);
}

const getExcelHeader = category => {
    // 엑셀에 출력할 Header 정보를 Mockup 데이터로 관리한다.
    return new Promise(function(resolve, reject) {
        let header = [];
        switch (category) {
            case 'DAY':
                header = dayExcelHeader.header;
                break;
            case 'MONTH':
                header = monthExcelHeader.header;
                break;
            case 'BSNM_DAY':
                header = bsnmDayExcelHeader.header;
                break;
            case 'BSNM_MONTH':
                header = bsnmMonthExcelHeader.header;
                break;
            default:
                header = '';
                break;
        }
        resolve(header);
    });
};

export default {
    dayList,
    monthList,
    bsnmDayList,
    bsnmMonthList,
    getExcelHeader,
    bsnmMonthListExcel,
    bsnmDayListExcel,
    
}