import{t as e}from"./api-DqXJkjY6.js";var{useListProductsQuery:t,useGetProductQuery:n,useCreateProductMutation:r,useUpdateProductMutation:i,useDeleteProductMutation:a,useListSchemesQuery:o,useCreateSchemeMutation:s,useUpdateSchemeMutation:c,useDeleteSchemeMutation:l,useActivateSchemeMutation:u,useSupersedeSchemeMutation:d,useCloneSchemeVersionMutation:f}=e.injectEndpoints({endpoints:e=>({listProducts:e.query({query:e=>({url:`/loan-products/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`LoanProduct`,id:e})),{type:`LoanProduct`,id:`LIST`}]:[{type:`LoanProduct`,id:`LIST`}]}),getProduct:e.query({query:e=>`/loan-products/${e}/`,providesTags:(e,t,n)=>[{type:`LoanProduct`,id:n}]}),createProduct:e.mutation({query:e=>({url:`/loan-products/`,method:`POST`,body:e}),invalidatesTags:[{type:`LoanProduct`,id:`LIST`}]}),updateProduct:e.mutation({query:({id:e,body:t})=>({url:`/loan-products/${e}/`,method:`PATCH`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`LoanProduct`,id:n},{type:`LoanProduct`,id:`LIST`}]}),deleteProduct:e.mutation({query:e=>({url:`/loan-products/${e}/`,method:`DELETE`}),invalidatesTags:(e,t,n)=>[{type:`LoanProduct`,id:n},{type:`LoanProduct`,id:`LIST`}]}),listSchemes:e.query({query:e=>({url:`/loan-schemes/`,params:e||void 0}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`LoanScheme`,id:e})),{type:`LoanScheme`,id:`LIST`}]:[{type:`LoanScheme`,id:`LIST`}]}),createScheme:e.mutation({query:e=>({url:`/loan-schemes/`,method:`POST`,body:e}),invalidatesTags:[{type:`LoanScheme`,id:`LIST`},{type:`LoanProduct`,id:`LIST`}]}),updateScheme:e.mutation({query:({id:e,body:t})=>({url:`/loan-schemes/${e}/`,method:`PATCH`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`LoanScheme`,id:n},{type:`LoanScheme`,id:`LIST`}]}),deleteScheme:e.mutation({query:e=>({url:`/loan-schemes/${e}/`,method:`DELETE`}),invalidatesTags:(e,t,n)=>[{type:`LoanScheme`,id:n},{type:`LoanScheme`,id:`LIST`},{type:`LoanProduct`,id:`LIST`}]}),activateScheme:e.mutation({query:e=>({url:`/loan-schemes/${e}/activate/`,method:`POST`}),invalidatesTags:(e,t,n)=>[{type:`LoanScheme`,id:n},{type:`LoanScheme`,id:`LIST`}]}),supersedeScheme:e.mutation({query:e=>({url:`/loan-schemes/${e}/supersede/`,method:`POST`}),invalidatesTags:(e,t,n)=>[{type:`LoanScheme`,id:n},{type:`LoanScheme`,id:`LIST`}]}),cloneSchemeVersion:e.mutation({query:e=>({url:`/loan-schemes/${e}/clone-version/`,method:`POST`}),invalidatesTags:[{type:`LoanScheme`,id:`LIST`},{type:`LoanProduct`,id:`LIST`}]})})});export{a,t as c,i as d,c as f,s as i,o as l,f as n,l as o,r,n as s,u as t,d as u};