import{L as n}from"./index-ktJf6c6X.js";const r=n.injectEndpoints({endpoints:e=>({searchQuotations:e.mutation({query:({page:t,size:o,searchValue:u,roleName:a})=>({url:`quotation/search-by-criteria?page=${t}&size=${o}${a?`&roleName=${encodeURIComponent(a)}`:""}`,method:"POST",body:{searchValue:u||""}})}),getQuotationById:e.query({query:t=>`quotation/${t}`,keepUnusedDataFor:0}),createQuotation:e.mutation({query:t=>({url:"quotation",method:"POST",body:t})}),updateQuotation:e.mutation({query:t=>({url:"quotation",method:"PUT",body:t})}),getActiveVersion:e.query({query:t=>`quotation/root/${t}`}),getVersionHistory:e.query({query:t=>`quotation/root/${t}/versions`,keepUnusedDataFor:0,providesTags:(t,o,u)=>[{type:"QuotationVersionHistory",id:u}]}),cloneVersion:e.mutation({query:t=>({url:`quotation/root/${t}/clone-version`,method:"POST"}),invalidatesTags:(t,o,u)=>[{type:"QuotationVersionHistory",id:u}]}),newFromOld:e.mutation({query:t=>({url:`quotation/root/${t}/new-from-old`,method:"POST"})}),deleteQuotationVersion:e.mutation({query:({versionId:t})=>({url:`quotation/${t}`,method:"DELETE"}),invalidatesTags:(t,o,{rootId:u})=>u?[{type:"QuotationVersionHistory",id:u}]:[]}),updateTemplate:e.mutation({query:({id:t,template:o})=>({url:`quotation/${t}/template`,method:"PUT",body:{template:o}})}),getPreview:e.query({query:t=>`quotation/${t}/preview`}),addService:e.mutation({query:({id:t,body:o})=>({url:`quotation/${t}/services`,method:"POST",body:o})}),updateService:e.mutation({query:({id:t,serviceId:o,body:u})=>({url:`quotation/${t}/services/${o}`,method:"PUT",body:u})}),deleteService:e.mutation({query:({id:t,serviceId:o})=>({url:`quotation/${t}/services/${o}`,method:"DELETE"})}),addCharge:e.mutation({query:({id:t,body:o})=>({url:`quotation/${t}/charges`,method:"POST",body:o})}),updateCharge:e.mutation({query:({id:t,chargeId:o,body:u})=>({url:`quotation/${t}/charges/${o}`,method:"PUT",body:u})}),deleteCharge:e.mutation({query:({id:t,chargeId:o})=>({url:`quotation/${t}/charges/${o}`,method:"DELETE"})}),getServiceConfigs:e.query({query:()=>"service-configuration"}),getServiceConfigsByModule:e.query({query:t=>`service-configuration/by-module?module=${t}`}),getAdditionalChargeConfigs:e.query({query:()=>"additional-charges"}),getDefaultTerms:e.query({query:t=>`terms-and-condition/defaults?documentType=${t}`}),getTermsByDocumentType:e.query({query:t=>`terms-and-condition/by-document-type?documentType=${t}`}),sendQuotation:e.mutation({query:t=>({url:`quotation/${t}/send`,method:"POST"})}),approveQuotation:e.mutation({query:t=>({url:`quotation/${t}/approve`,method:"POST"})}),convertQuotation:e.mutation({query:({id:t,partial:o=!1})=>({url:`quotation/${t}/convert?partial=${o}`,method:"POST"})}),acceptQuotation:e.mutation({query:t=>({url:`quotation/${t}/accept`,method:"POST"})}),rejectQuotation:e.mutation({query:({id:t,reason:o})=>({url:`quotation/${t}/reject`,method:"POST",body:o?{reason:o}:{}})}),reviseQuotation:e.mutation({query:t=>({url:`quotation/${t}/revise`,method:"POST"})}),getPriceComparison:e.query({query:t=>`quotation/${t}/price-comparison`}),updateToLatestPrices:e.mutation({query:t=>({url:`quotation/${t}/update-prices`,method:"POST"})}),getQuotationByDisplayNumber:e.query({query:({series:t,number:o})=>`quotation/by-display-number?series=${encodeURIComponent(t)}&number=${o}`,keepUnusedDataFor:0})})}),{useSearchQuotationsMutation:s,useGetQuotationByIdQuery:y,useLazyGetQuotationByIdQuery:m,useCreateQuotationMutation:q,useUpdateQuotationMutation:c,useGetActiveVersionQuery:d,useGetVersionHistoryQuery:p,useCloneVersionMutation:Q,useNewFromOldMutation:h,useDeleteQuotationVersionMutation:g,useUpdateTemplateMutation:T,useGetPreviewQuery:$,useAddServiceMutation:v,useUpdateServiceMutation:l,useDeleteServiceMutation:S,useAddChargeMutation:P,useUpdateChargeMutation:M,useDeleteChargeMutation:C,useGetServiceConfigsQuery:f,useLazyGetServiceConfigsByModuleQuery:D,useGetAdditionalChargeConfigsQuery:O,useGetDefaultTermsQuery:U,useLazyGetDefaultTermsQuery:G,useLazyGetTermsByDocumentTypeQuery:L,useSendQuotationMutation:V,useApproveQuotationMutation:A,useConvertQuotationMutation:E,useAcceptQuotationMutation:B,useRejectQuotationMutation:w,useReviseQuotationMutation:z,useLazyGetPriceComparisonQuery:j,useUpdateToLatestPricesMutation:k,useLazyGetQuotationByDisplayNumberQuery:F}=r;export{G as a,s as b,m as c,q as d,c as e,U as f,y as g,V as h,A as i,E as j,B as k,w as l,z as m,j as n,k as o,Q as p,h as q,g as r,p as s,D as u};
