import{n as i,o as n,p as c,q as o,t}from"./index-Cc987VYg.js";import{f as u}from"./fiscal-years-vx03jk7N.js";const a="fiscal-years";function F(s){return i({queryKey:[a,"list",s],queryFn:()=>u.getFiscalYears(s)})}function d(s,e=!0){return i({queryKey:[a,"detail",s],queryFn:()=>u.getFiscalYear(s),enabled:e&&!!s})}function q(){const s=n();return c({mutationFn:e=>u.createFiscalYear(e),onSuccess:()=>{s.invalidateQueries({queryKey:[a]}),t.success("Fiscal year created successfully")},onError:e=>{const r=o(e);t.error(r,{duration:5e3})}})}function f(){const s=n();return c({mutationFn:({id:e,data:r})=>u.updateFiscalYear(e,r),onSuccess:(e,r)=>{s.invalidateQueries({queryKey:[a]}),s.invalidateQueries({queryKey:[a,"detail",r.id]}),t.success("Fiscal year updated successfully")},onError:e=>{const r=o(e);t.error(r,{duration:5e3})}})}function Y(){const s=n();return c({mutationFn:e=>u.closeFiscalYear(e),onSuccess:(e,r)=>{s.invalidateQueries({queryKey:[a]}),s.invalidateQueries({queryKey:[a,"detail",r]}),t.success("Fiscal year closed successfully")},onError:e=>{const r=o(e);t.error(r,{duration:5e3})}})}function m(){return i({queryKey:["entities"],queryFn:()=>u.getEntities()})}export{m as a,d as b,q as c,f as d,Y as e,F as u};
