67 lines
2.1 KiB
TypeScript
67 lines
2.1 KiB
TypeScript
import { stClient } from "@/shared/api/client";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
|
|
import type {
|
|
DashboardApiResponse,
|
|
DashboardSearchParams,
|
|
DashboardService,
|
|
EcptReqCountResponse,
|
|
StatsSubmissionResponse,
|
|
UnSubmitCountResponse,
|
|
VrfcErrCountResponse,
|
|
VrfcReportResponse,
|
|
} from "../../model/dashboard/dashboard-interface";
|
|
|
|
async function getVrfcReport(
|
|
params: DashboardSearchParams,
|
|
): Promise<DashboardApiResponse<VrfcReportResponse>> {
|
|
const response = await stClient.get<
|
|
DashboardApiResponse<VrfcReportResponse>
|
|
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/vrfc-report`, { params });
|
|
return response.data;
|
|
}
|
|
|
|
async function getVrfcErrCount(
|
|
params: DashboardSearchParams,
|
|
): Promise<DashboardApiResponse<VrfcErrCountResponse>> {
|
|
const response = await stClient.get<
|
|
DashboardApiResponse<VrfcErrCountResponse>
|
|
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/vrfc-err-count`, { params });
|
|
return response.data;
|
|
}
|
|
|
|
async function getUnSubmitCount(
|
|
params: DashboardSearchParams,
|
|
): Promise<DashboardApiResponse<UnSubmitCountResponse>> {
|
|
const response = await stClient.get<
|
|
DashboardApiResponse<UnSubmitCountResponse>
|
|
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/submission-status`, { params });
|
|
return response.data;
|
|
}
|
|
|
|
async function getStatsSubmissionRate(
|
|
params: DashboardSearchParams,
|
|
): Promise<DashboardApiResponse<StatsSubmissionResponse>> {
|
|
const response = await stClient.get<
|
|
DashboardApiResponse<StatsSubmissionResponse>
|
|
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/stats-submission-rate`, { params });
|
|
return response.data;
|
|
}
|
|
|
|
async function getEcptReqCount(
|
|
params: DashboardSearchParams,
|
|
): Promise<DashboardApiResponse<EcptReqCountResponse>> {
|
|
const response = await stClient.get<
|
|
DashboardApiResponse<EcptReqCountResponse>
|
|
>(`${ENDPOINT.ST_SERVICE.DASHBOARD}/ecpt-req-count`, { params });
|
|
return response.data;
|
|
}
|
|
|
|
export const dashboardApi: DashboardService = {
|
|
getVrfcReport,
|
|
getVrfcErrCount,
|
|
getUnSubmitCount,
|
|
getStatsSubmissionRate,
|
|
getEcptReqCount,
|
|
};
|