import{a as c}from"./chunk-YO44C22F.js";import{a as p}from"./chunk-JTDXTMDS.js";import{f as o}from"./chunk-6VC7H3CZ.js";import{K as i,da as a,ja as n,p as s}from"./chunk-QMYHTLAJ.js";var l=(()=>{class r{constructor(e){this._http=e}getAll(e){return this._http.post("/api/admin/service-centers/all",e,{headers:c})}getById(e){return this._http.get(`/api/admin/service-center/${e}`)}create(e){return this._http.post("/api/admin/service-center",e)}delete(e){return this._http.delete(`/api/admin/service-center/${e}`)}changeOverdraft(e,t){return this._http.put(`/api/admin/service-center/${e}/overdraft`,{overdraft:t})}changeBalance(e,t){return this._http.put(`/api/admin/service-center/${e}/balance`,t)}balanceHistory(e,t){return this._http.post(`/api/admin/service-center/${e}/balance-history`,t,{headers:c})}static{this.\u0275fac=function(t){return new(t||r)(n(o))}}static{this.\u0275prov=a({token:r,factory:r.\u0275fac})}}return r})();var y=(()=>{class r{constructor(e){this._serviceCenterServiceApi=e}getAll(e){return this._serviceCenterServiceApi.getAll(e).pipe(i(1))}getById(e){return this._serviceCenterServiceApi.getById(e).pipe(i(1))}create(e){return this._serviceCenterServiceApi.create(e).pipe(i(1))}delete(e){return this._serviceCenterServiceApi.delete(e).pipe(i(1))}changeOverdraft(e,t){return this._serviceCenterServiceApi.changeOverdraft(e,t).pipe(i(1))}changeBalance(e,t){return this._serviceCenterServiceApi.changeBalance(e,t).pipe(i(1))}balanceHistory(e,t){return this._serviceCenterServiceApi.balanceHistory(e,t).pipe(i(1))}initDataSourceServiceCenters(e){return new p({key:"id",load:t=>s(this.getAll({criteria:{search:{name:t.filter??e??"",xin:t.filter,phone:t.filter}},take:50,skip:0,isAscending:!0,orderBy:"id"})).then(f=>(e&&(e=""),{data:f.data}))})}static{this.\u0275fac=function(t){return new(t||r)(n(l))}}static{this.\u0275prov=a({token:r,factory:r.\u0275fac})}}return r})();var m=(()=>{class r{constructor(e){this._http=e}getAll(e){return this._http.post("/api/admin/companies/all",e,{headers:c})}assignServiceCenter(e){return this._http.put("/api/admin/companies/assign-service-center",e)}static{this.\u0275fac=function(t){return new(t||r)(n(o))}}static{this.\u0275prov=a({token:r,factory:r.\u0275fac})}}return r})();var k=(()=>{class r{constructor(e){this._organizationServiceApi=e}getAll(e){return this._organizationServiceApi.getAll(e).pipe(i(1))}assignServiceCenter(e){return this._organizationServiceApi.assignServiceCenter(e).pipe(i(1))}initDataSourceCompanies(){return new p({key:"id",load:e=>s(this.getAll({criteria:{search:{name:e.filter,xin:e.filter,phone:e.filter}},take:50,skip:0,isAscending:!0,orderBy:"id"})).then(t=>({data:t.data}))})}static{this.\u0275fac=function(t){return new(t||r)(n(m))}}static{this.\u0275prov=a({token:r,factory:r.\u0275fac})}}return r})();export{l as a,y as b,m as c,k as d};
