import{K as s}from"./index-CYy8zBsj.js";const t="purchase-return",n=s.injectEndpoints({endpoints:r=>({listPurchaseReturns:r.query({query:()=>({url:t,method:"GET"}),providesTags:["PurchaseReturn"]}),getPurchaseReturnById:r.query({query:e=>({url:`${t}/${e}`,method:"GET"}),providesTags:(e,a,u)=>[{type:"PurchaseReturn",id:u}]}),listPurchaseReturnsByMrn:r.query({query:e=>({url:`${t}/mrn/${e}`,method:"GET"}),providesTags:["PurchaseReturn"]}),createPurchaseReturn:r.mutation({query:({body:e})=>({url:t,method:"POST",body:e}),invalidatesTags:["PurchaseReturn"]}),updatePurchaseReturn:r.mutation({query:({body:e})=>({url:t,method:"PUT",body:e}),invalidatesTags:(e,a,{body:u})=>u!=null&&u.id?["PurchaseReturn",{type:"PurchaseReturn",id:u.id}]:["PurchaseReturn"]}),deletePurchaseReturnDraft:r.mutation({query:e=>({url:`${t}/${e}`,method:"DELETE"}),invalidatesTags:(e,a,u)=>["PurchaseReturn",{type:"PurchaseReturn",id:u}]}),approvePurchaseReturn:r.mutation({query:({id:e})=>({url:`${t}/${e}/approve`,method:"POST"}),invalidatesTags:(e,a,{id:u})=>["PurchaseReturn",{type:"PurchaseReturn",id:u}]}),submitPurchaseReturn:r.mutation({query:({id:e})=>({url:`${t}/${e}/submit`,method:"POST"}),invalidatesTags:(e,a,{id:u})=>["PurchaseReturn",{type:"PurchaseReturn",id:u}]}),cancelPurchaseReturn:r.mutation({query:({id:e,body:a})=>({url:`${t}/${e}/cancel`,method:"POST",body:a}),invalidatesTags:(e,a,{id:u})=>["PurchaseReturn",{type:"PurchaseReturn",id:u}]}),validatePurchaseReturn:r.mutation({query:({body:e})=>({url:`${t}/validate`,method:"POST",body:e})})}),overrideExisting:!1}),{useListPurchaseReturnsQuery:h,useLazyListPurchaseReturnsQuery:i,useGetPurchaseReturnByIdQuery:P,useLazyGetPurchaseReturnByIdQuery:R,useListPurchaseReturnsByMrnQuery:o,useLazyListPurchaseReturnsByMrnQuery:y,useCreatePurchaseReturnMutation:p,useUpdatePurchaseReturnMutation:m,useDeletePurchaseReturnDraftMutation:d,useApprovePurchaseReturnMutation:T,useSubmitPurchaseReturnMutation:l,useCancelPurchaseReturnMutation:v,useValidatePurchaseReturnMutation:q}=n;export{T as a,l as b,v as c,d,y as e,R as f,p as g,q as h,m as i,P as j,h as u};
