import{K as a}from"./index-CYy8zBsj.js";const u=a.injectEndpoints({endpoints:r=>({createDelivery:r.mutation({query:e=>({url:"delivery",method:"POST",body:e})}),updateDelivery:r.mutation({query:e=>({url:"delivery",method:"PUT",body:e})}),getDeliveryById:r.query({query:e=>`delivery/${e}`}),getAllDeliveries:r.query({query:()=>"delivery"}),deleteDelivery:r.mutation({query:e=>({url:`delivery/${e}`,method:"DELETE"})}),createDeliveryFromSO:r.mutation({query:e=>({url:"delivery/from-so",method:"POST",body:e})}),addDeliveryItem:r.mutation({query:({id:e,body:t})=>({url:`delivery/${e}/items`,method:"POST",body:t})}),updateDeliveryItem:r.mutation({query:({id:e,itemId:t,body:i})=>({url:`delivery/${e}/items/${t}`,method:"PUT",body:i})}),deleteDeliveryItem:r.mutation({query:({id:e,itemId:t})=>({url:`delivery/${e}/items/${t}`,method:"DELETE"})}),addDeliveryCharge:r.mutation({query:({id:e,body:t})=>({url:`delivery/${e}/charges`,method:"POST",body:t})}),updateDeliveryCharge:r.mutation({query:({id:e,chargeId:t,body:i})=>({url:`delivery/${e}/charges/${t}`,method:"PUT",body:i})}),deleteDeliveryCharge:r.mutation({query:({id:e,chargeId:t})=>({url:`delivery/${e}/charges/${t}`,method:"DELETE"})}),submitDeliveryForApproval:r.mutation({query:e=>({url:`delivery/${e}/submit-approval`,method:"POST"})}),approveDelivery:r.mutation({query:e=>({url:`delivery/${e}/approve`,method:"POST"})}),rejectDelivery:r.mutation({query:({id:e,reason:t})=>({url:`delivery/${e}/reject`,method:"POST",body:{reason:t}})}),confirmDelivery:r.mutation({query:e=>({url:`delivery/${e}/confirm`,method:"POST"})}),dispatchDelivery:r.mutation({query:e=>({url:`delivery/${e}/dispatch`,method:"POST"})}),cancelDelivery:r.mutation({query:({id:e,reason:t})=>({url:`delivery/${e}/cancel`,method:"POST",body:{reason:t}})}),closeDelivery:r.mutation({query:e=>({url:`delivery/${e}/close`,method:"POST"})}),searchDeliveries:r.mutation({query:({page:e,size:t,searchValue:i,excludeInvoiced:y})=>({url:`delivery/search-by-criteria?page=${e}&size=${t}${y?"&excludeInvoiced=true":""}`,method:"POST",body:{searchValue:i||""}})}),getDeliveriesBySalesOrder:r.query({query:e=>`delivery/by-so/${e}`}),getSalesOrderRemaining:r.query({query:()=>"delivery/so-remaining"})})}),{useSearchDeliveriesMutation:o,useCreateDeliveryMutation:s,useUpdateDeliveryMutation:v,useGetDeliveryByIdQuery:m,useLazyGetDeliveryByIdQuery:n,useGetAllDeliveriesQuery:d,useDeleteDeliveryMutation:D,useCreateDeliveryFromSOMutation:h,useAddDeliveryItemMutation:c,useUpdateDeliveryItemMutation:p,useDeleteDeliveryItemMutation:q,useAddDeliveryChargeMutation:S,useUpdateDeliveryChargeMutation:$,useDeleteDeliveryChargeMutation:O,useSubmitDeliveryForApprovalMutation:g,useApproveDeliveryMutation:M,useRejectDeliveryMutation:T,useConfirmDeliveryMutation:P,useDispatchDeliveryMutation:C,useCancelDeliveryMutation:I,useCloseDeliveryMutation:E,useGetDeliveriesBySalesOrderQuery:A,useLazyGetDeliveriesBySalesOrderQuery:G,useGetSalesOrderRemainingQuery:Q,useLazyGetSalesOrderRemainingQuery:f}=u;export{v as a,f as b,g as c,M as d,T as e,P as f,C as g,I as h,E as i,o as j,n as k,D as l,h as m,Q as n,s as u};
