import{t as e}from"./api-DAEUkJit.js";var{useErpSyncSummaryQuery:t,useListSyncRunsQuery:n,useSyncNowMutation:r,useGetErpSyncStatusQuery:i,useGetErpConnectionQuery:a,useUpdateErpConnectionMutation:o,useTestErpConnectionMutation:s,useListSyncEntitiesQuery:c,useUpdateSyncEntityMutation:l,useSyncEntityNowMutation:u,useSyncAllMutation:d,useTestSyncEntityMutation:f,useListFieldMappingsQuery:p,useCreateFieldMappingMutation:m,useUpdateFieldMappingMutation:h,useDeleteFieldMappingMutation:g,useErpConsoleSummaryQuery:_,useListRunsQuery:v}=e.injectEndpoints({endpoints:e=>({erpSyncSummary:e.query({query:()=>`/erp-sync/sync-runs/summary/`,providesTags:[{type:`StockSyncRun`,id:`SUMMARY`}]}),listSyncRuns:e.query({query:e=>({url:`/erp-sync/sync-runs/`,params:e||void 0}),providesTags:[{type:`StockSyncRun`,id:`LIST`}]}),syncNow:e.mutation({query:()=>({url:`/erp-sync/sync-runs/sync-now/`,method:`POST`}),invalidatesTags:[{type:`StockSyncRun`,id:`LIST`},{type:`StockSyncRun`,id:`SUMMARY`},{type:`Stock`,id:`LIST`}]}),getErpSyncStatus:e.query({query:()=>`/erp-sync/status/`,transformResponse:e=>e.data,providesTags:[{type:`ErpConnection`,id:`SINGLETON`}]}),getErpConnection:e.query({query:()=>`/erp-sync/connection/`,providesTags:[{type:`ErpConnection`,id:`SINGLETON`}]}),updateErpConnection:e.mutation({query:e=>({url:`/erp-sync/connection/`,method:`PATCH`,body:e}),invalidatesTags:[{type:`ErpConnection`,id:`SINGLETON`},{type:`SyncEntity`,id:`SUMMARY`}]}),testErpConnection:e.mutation({query:()=>({url:`/erp-sync/connection/test/`,method:`POST`}),invalidatesTags:[{type:`ErpConnection`,id:`SINGLETON`}]}),listSyncEntities:e.query({query:e=>({url:`/erp-sync/entities/`,params:{page_size:`50`,...e||{}}}),providesTags:e=>e?[...e.results.map(({id:e})=>({type:`SyncEntity`,id:e})),{type:`SyncEntity`,id:`LIST`}]:[{type:`SyncEntity`,id:`LIST`}]}),updateSyncEntity:e.mutation({query:({id:e,body:t})=>({url:`/erp-sync/entities/${e}/`,method:`PATCH`,body:t}),invalidatesTags:(e,t,{id:n})=>[{type:`SyncEntity`,id:n},{type:`SyncEntity`,id:`LIST`},{type:`SyncEntity`,id:`SUMMARY`}]}),syncEntityNow:e.mutation({query:e=>({url:`/erp-sync/entities/${e}/sync-now/`,method:`POST`}),invalidatesTags:[{type:`SyncRun`,id:`LIST`},{type:`SyncEntity`,id:`LIST`},{type:`SyncEntity`,id:`SUMMARY`},{type:`Stock`,id:`LIST`}]}),syncAll:e.mutation({query:()=>({url:`/erp-sync/entities/sync-all/`,method:`POST`}),invalidatesTags:[{type:`SyncRun`,id:`LIST`},{type:`SyncEntity`,id:`LIST`},{type:`SyncEntity`,id:`SUMMARY`},{type:`Stock`,id:`LIST`}]}),testSyncEntity:e.mutation({query:({id:e,body:t})=>({url:`/erp-sync/entities/${e}/test/`,method:`POST`,body:t})}),listFieldMappings:e.query({query:e=>({url:`/erp-sync/field-mappings/`,params:{entity:e,page_size:`200`}}),providesTags:[{type:`FieldMapping`,id:`LIST`}]}),createFieldMapping:e.mutation({query:e=>({url:`/erp-sync/field-mappings/`,method:`POST`,body:e}),invalidatesTags:[{type:`FieldMapping`,id:`LIST`},{type:`SyncEntity`,id:`LIST`}]}),updateFieldMapping:e.mutation({query:({id:e,body:t})=>({url:`/erp-sync/field-mappings/${e}/`,method:`PATCH`,body:t}),invalidatesTags:[{type:`FieldMapping`,id:`LIST`}]}),deleteFieldMapping:e.mutation({query:e=>({url:`/erp-sync/field-mappings/${e}/`,method:`DELETE`}),invalidatesTags:[{type:`FieldMapping`,id:`LIST`},{type:`SyncEntity`,id:`LIST`}]}),erpConsoleSummary:e.query({query:()=>`/erp-sync/runs/summary/`,providesTags:[{type:`SyncEntity`,id:`SUMMARY`},{type:`SyncRun`,id:`SUMMARY`}]}),listRuns:e.query({query:e=>({url:`/erp-sync/runs/`,params:{page_size:`50`,...e||{}}}),providesTags:[{type:`SyncRun`,id:`LIST`}]})})});export{i as a,c,s as d,f,l as h,a as i,d as l,h as m,g as n,p as o,o as p,_ as r,v as s,m as t,u};