import { api } from '@common/services/api'; import type { HnsAnalysisItem, CreateHnsAnalysisInput } from '@interfaces/hns/HnsInterface'; // ============================================================ // HNS 분석 API // ============================================================ export async function fetchHnsAnalyses(params?: { status?: string; substance?: string; search?: string; acdntSn?: number; }): Promise { const response = await api.get('/hns/analyses', { params }); return response.data; } export async function fetchHnsAnalysis(sn: number): Promise { const response = await api.get(`/hns/analyses/${sn}`); return response.data; } export async function createHnsAnalysis( input: CreateHnsAnalysisInput, ): Promise<{ hnsAnlysSn: number }> { const response = await api.post<{ hnsAnlysSn: number }>('/hns/analyses', input); return response.data; } export async function saveHnsAnalysis( sn: number, data: { rsltData: Record; execSttsCd?: string; riskCd?: string; }, ): Promise { await api.post(`/hns/analyses/${sn}/save`, data); } export async function deleteHnsAnalysis(sn: number): Promise { await api.delete(`/hns/analyses/${sn}`); }