import{axiosInstance as e,getError as t}from"./index-BSpgqPAY.js";var n=class{getAxiosInstance(){return e}async getTundishes(){let e=await this.getAxiosInstance().get(`/tundish`);return e.data}async getTundishAll(e=null){try{let t=await this.getAxiosInstance().get(`/tundish/all`,{params:{isTracked:e}});return{ok:!0,data:t.data}}catch(e){return{ok:!1,message:t(e)}}}async getParts(e){let t=await this.getAxiosInstance().get(`/root/parts`,{params:{componentTypeId:e}});return{error:!1,data:t.data}}async getTundishPlantOverview(){let e=await this.getAxiosInstance().get(`/tundish/plant-overview`);return{error:!1,data:e.data}}async getRootDetails(e){let t=await this.getAxiosInstance().get(`/tundish/details`,{params:{rootId:e}});return{error:!1,data:t.data}}async changeRootLocation({rootId:e=null,locationId:t}){let n=await this.getAxiosInstance().patch(`/tundish/location`,{},{params:{rootId:e,locationId:t}});return n.data}async setRootState(e){let t=await this.getAxiosInstance().patch(`/Root/status`,{},{params:{...e}});return t.data.success?{ok:!0,data:t.data}:Promise.reject(t.data)}async getComponentsListForTundishId(e){let t=await this.getAxiosInstance().get(`/tundish/${e}/components`);return t.status==200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async getSpecialComponentsListForTundishId(e){let t=await this.getAxiosInstance().get(`/special-components`,{params:{tundishId:e}});return t.status===200?{error:!0,data:t.data}:{error:!1,data:t.data}}async getCampaignsForComponent(e,t){let n=await this.getAxiosInstance().get(`/tundish/${e}/components/${t}/campaigns`);return n.status===200?{error:!1,data:n.data}:{error:!0,data:n.data}}async getTundishTasks(e,t={}){let n=await this.getAxiosInstance().get(`/Tundish/${e}/tasks`,{params:{...t}});return n.status===200?{error:!0,data:n.data}:{error:!1,data:n.data}}async getTundishHeats(e,t={}){let n=await this.getAxiosInstance().get(`/Tundish/${e}/heats`,{params:{...t}});return n.status===200?{error:!0,data:n.data}:{error:!1,data:n.data}}async getCampaignList(){let e=await this.getAxiosInstance().get(`/Tundish/campaigns`);return e.status===200?{error:!0,data:e.data}:{error:!1,data:e.data}}async getTundishBuildLog(e){let{startDateTime:t,endDateTime:n,interval:r,sequenceName:i,tundishes:a}=e,o=await this.getAxiosInstance().get(`/sequence/all-by-tundish`,{params:{interval:r,start:t,end:n,sequenceName:i,tundishesCSV:a?.join(`,`)||`All`}});return o.status===200?{error:!1,data:o.data}:{error:!0,data:o.data}}async getTundishTrackReport(e){let t=await this.getAxiosInstance().post(`/Backend/Execute`,{method:`NSB.TundishReport`,parameters:[{name:`Start`,value:e.start},{name:`End`,value:e.end}]});return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async getHeatEventsForTundish(e,t={}){let n=await this.getAxiosInstance().get(`/heat/events`,{params:{rootId:e,start:t.from||null,end:t.to||null}});return n.status===200?{error:!0,data:n.data}:{error:!1,data:n.data}}async getRootEvents(e){let t=await this.getAxiosInstance().get(`/root/events`,{params:{...e}});return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async getTundishById(e){let t=await this.getAxiosInstance().get(`/tundish/${e}`);return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}async changeRootStatus(e){try{let t=await this.getAxiosInstance().patch(`/tundish/status`,{},{params:{...e}});return t.data.success?{ok:!0,data:t.data.result}:t.data}catch(e){return{ok:!1,data:t(e)}}}async putTundishInOOS(e){let t=await this.getAxiosInstance().post(`/special-components/${e}/oos`);return t.status===200?{ok:!0,data:t.data}:{ok:!1,data:t.data}}};const r=new n;export{r as tundishesRepository};
//# sourceMappingURL=tundishes.repository-hmZi9tX_.js.map