import{K as a}from"./index-CYy8zBsj.js";const r=a.injectEndpoints({endpoints:t=>({createInvoice:t.mutation({query:e=>({url:"billing",method:"POST",body:e}),invalidatesTags:["Dashboard"]}),updateInvoice:t.mutation({query:e=>({url:"billing",method:"PUT",body:e}),invalidatesTags:["Dashboard"]}),getInvoiceById:t.query({query:e=>`billing/${e}`}),getAllInvoices:t.query({query:()=>"billing"}),getInvoicesByStatus:t.query({query:e=>`billing/by-status/${e}`}),deleteInvoice:t.mutation({query:e=>({url:`billing/${e}`,method:"DELETE"})}),searchInvoices:t.mutation({query:({page:e,size:o,searchValue:i})=>({url:`billing/search-by-criteria?page=${e}&size=${o}`,method:"POST",body:{searchValue:i||""}})}),searchInvoicesByStatus:t.mutation({query:({page:e,size:o,status:i,searchValue:n})=>({url:`billing/search-by-criteria?page=${e}&size=${o}&status=${i}`,method:"POST",body:{searchValue:n||""}})}),createInvoiceFromDelivery:t.mutation({query:({deliveryId:e,body:o})=>({url:`billing/from-delivery/${e}`,method:"POST",body:o||{}})}),createInvoiceFromSalesOrder:t.mutation({query:({soVersionId:e,body:o})=>({url:`billing/from-sales-order/${e}`,method:"POST",body:o||{}})}),createInvoiceFromQuotation:t.mutation({query:({quotationId:e,body:o})=>({url:`billing/from-quotation/${e}`,method:"POST",body:o||{}})}),confirmFromSource:t.mutation({query:e=>({url:"billing/confirm-from-source",method:"POST",body:e})}),createInvoiceFromScrapRequest:t.mutation({query:({scrapRequestId:e,body:o})=>({url:`billing/from-scrap-request/${e}`,method:"POST",body:o||{}})}),approveInvoice:t.mutation({query:e=>({url:`billing/${e}/approve`,method:"POST"})}),confirmInvoice:t.mutation({query:e=>({url:`billing/${e}/confirm`,method:"POST"})}),cancelInvoice:t.mutation({query:({id:e,reason:o})=>({url:`billing/${e}/cancel`,method:"POST",body:{reason:o}})}),submitForApproval:t.mutation({query:e=>({url:`billing/${e}/submit`,method:"POST"})}),rejectInvoice:t.mutation({query:({id:e,reason:o})=>({url:`billing/${e}/reject`,method:"POST",body:{reason:o}})}),generateEInvoice:t.mutation({query:e=>({url:`billing/${e}/generate-einvoice`,method:"POST"})}),cancelIrn:t.mutation({query:({id:e,cnlRsn:o,cnlRem:i})=>({url:`billing/${e}/cancel-irn`,method:"POST",body:{cnlRsn:o,cnlRem:i}})}),generateEWayBill:t.mutation({query:e=>({url:`billing/${e}/generate-ewaybill`,method:"POST"})}),cancelEWayBill:t.mutation({query:({id:e,reason:o})=>({url:`billing/${e}/cancel-ewaybill`,method:"POST",body:{reason:o}})}),extendEWayBill:t.mutation({query:e=>({url:`billing/${e}/extend-ewaybill`,method:"POST"})}),getApprovalHistory:t.query({query:e=>`billing/${e}/approval-history`}),resolveSourceByNumber:t.query({query:({type:e,series:o,number:i})=>`billing/resolve-source?type=${encodeURIComponent(e)}&series=${encodeURIComponent(o)}&number=${i}`,keepUnusedDataFor:0})})}),{useCreateInvoiceMutation:s,useUpdateInvoiceMutation:l,useGetInvoiceByIdQuery:c,useLazyGetInvoiceByIdQuery:y,useGetAllInvoicesQuery:m,useDeleteInvoiceMutation:v,useSearchInvoicesMutation:I,useCreateInvoiceFromDeliveryMutation:g,useCreateInvoiceFromSalesOrderMutation:p,useCreateInvoiceFromQuotationMutation:q,useCreateInvoiceFromScrapRequestMutation:S,useConfirmFromSourceMutation:h,useApproveInvoiceMutation:d,useConfirmInvoiceMutation:b,useCancelInvoiceMutation:$,useGetInvoicesByStatusQuery:T,useSearchInvoicesByStatusMutation:M,useSubmitForApprovalMutation:O,useRejectInvoiceMutation:P,useGenerateEInvoiceMutation:B,useCancelIrnMutation:f,useGenerateEWayBillMutation:E,useCancelEWayBillMutation:F,useExtendEWayBillMutation:C,useGetApprovalHistoryQuery:A,useLazyGetApprovalHistoryQuery:Q,useLazyResolveSourceByNumberQuery:G}=r;export{M as a,p as b,I as c,s as d,l as e,h as f,b as g,B as h,f as i,E as j,F as k,C as l,d as m,P as n,v as o,g as p,q,S as r,y as u};
