import{t as e}from"./api-DqXJkjY6.js";var{useListLoanApplicationsQuery:t,useGetLoanApplicationQuery:n,useGetLoanStatusCountsQuery:r,useCreateLoanApplicationMutation:i,useCreateIndividualApplicationMutation:a,useSubmitApplicationMutation:o,useSanctionApplicationMutation:s,useCancelApplicationMutation:c,useListPartiesQuery:l,useAddPartyMutation:u,useRemovePartyMutation:d,useDeleteApplicationMutation:f,useGetLoanApplicationCreditReportQuery:p}=e.injectEndpoints({endpoints:e=>({listLoanApplications:e.query({query:e=>({url:`/loan-applications/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`LoanApplication`,id:e})),{type:`LoanApplication`,id:`LIST`}]:[{type:`LoanApplication`,id:`LIST`}]}),getLoanApplication:e.query({query:e=>`/loan-applications/${e}/`,providesTags:(e,t,n)=>[{type:`LoanApplication`,id:n}]}),getLoanStatusCounts:e.query({query:e=>({url:`/loan-applications/status-counts/`,params:e||void 0}),providesTags:[{type:`LoanApplication`,id:`LIST`}]}),createLoanApplication:e.mutation({query:e=>({url:`/loan-applications/`,method:`POST`,body:e}),invalidatesTags:[{type:`LoanApplication`,id:`LIST`}]}),createIndividualApplication:e.mutation({query:e=>({url:`/loan-applications/create-individual/`,method:`POST`,body:e}),invalidatesTags:[{type:`LoanApplication`,id:`LIST`}]}),submitApplication:e.mutation({query:e=>({url:`/loan-applications/${e}/submit/`,method:`POST`}),invalidatesTags:(e,t,n)=>[{type:`LoanApplication`,id:n},{type:`LoanApplication`,id:`LIST`},{type:`ApprovalRequest`,id:`LIST`}]}),sanctionApplication:e.mutation({query:({id:e,body:t})=>({url:`/loan-applications/${e}/sanction/`,method:`POST`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`LoanApplication`,id:n},{type:`LoanApplication`,id:`LIST`}]}),cancelApplication:e.mutation({query:({id:e,body:t})=>({url:`/loan-applications/${e}/cancel/`,method:`POST`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`LoanApplication`,id:n},{type:`LoanApplication`,id:`LIST`},{type:`ApprovalRequest`,id:`LIST`}]}),listParties:e.query({query:e=>`/loan-applications/${e}/parties/`,providesTags:(e,t,n)=>e?[...e.map(({id:e})=>({type:`LoanApplicationParty`,id:e})),{type:`LoanApplicationParty`,id:`LIST-${n}`}]:[{type:`LoanApplicationParty`,id:`LIST-${n}`}]}),addParty:e.mutation({query:({applicationId:e,body:t})=>({url:`/loan-applications/${e}/parties/`,method:`POST`,body:t}),invalidatesTags:(e,t,{applicationId:n})=>[{type:`LoanApplicationParty`,id:`LIST-${n}`}]}),removeParty:e.mutation({query:({applicationId:e,partyId:t})=>({url:`/loan-applications/${e}/parties/${t}/`,method:`DELETE`}),invalidatesTags:(e,t,{applicationId:n,partyId:r})=>[{type:`LoanApplicationParty`,id:r},{type:`LoanApplicationParty`,id:`LIST-${n}`}]}),deleteApplication:e.mutation({query:e=>({url:`/loan-applications/${e}/`,method:`DELETE`}),invalidatesTags:[{type:`LoanApplication`,id:`LIST`}]}),getLoanApplicationCreditReport:e.query({query:e=>`/loan-applications/${e}/credit-report/`,providesTags:(e,t,n)=>[{type:`LoanApplication`,id:`CREDIT-${n}`}]})})});export{f as a,r as c,d,s as f,i,t as l,c as n,p as o,o as p,a as r,n as s,u as t,l as u};