import{m as p}from"./chunk-OJKN3TNK.js";import{a as o}from"./chunk-NHAEOK7K.js";import{x as s}from"./chunk-OIJW4GMG.js";import{J as i,ca as n,ia as a,p as c}from"./chunk-3FIHWXA5.js";var l=(()=>{class t{constructor(e){this._http=e}getAll(e){return this._http.post("/api/admin/service-centers/all",e,{headers:o})}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,r){return this._http.put(`/api/admin/service-center/${e}/overdraft`,{overdraft:r})}changeBalance(e,r){return this._http.put(`/api/admin/service-center/${e}/balance`,r)}static{this.\u0275fac=function(r){return new(r||t)(a(s))}}static{this.\u0275prov=n({token:t,factory:t.\u0275fac})}}return t})();var C=(()=>{class t{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,r){return this._serviceCenterServiceApi.changeOverdraft(e,r).pipe(i(1))}changeBalance(e,r){return this._serviceCenterServiceApi.changeBalance(e,r).pipe(i(1))}initDataSourceServiceCenters(e){return new p({key:"id",load:r=>c(this.getAll({criteria:{search:{name:r.filter??e??"",xin:r.filter,phone:r.filter}},take:50,skip:0,isAscending:!0,orderBy:"id"})).then(f=>(e&&(e=""),{data:f.data}))})}static{this.\u0275fac=function(r){return new(r||t)(a(l))}}static{this.\u0275prov=n({token:t,factory:t.\u0275fac})}}return t})();var m=(()=>{class t{constructor(e){this._http=e}getAll(e){return this._http.post("/api/admin/companies/all",e,{headers:o})}assignServiceCenter(e){return this._http.put("/api/admin/companies/assign-service-center",e)}static{this.\u0275fac=function(r){return new(r||t)(a(s))}}static{this.\u0275prov=n({token:t,factory:t.\u0275fac})}}return t})();var I=(()=>{class t{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=>c(this.getAll({criteria:{search:{name:e.filter,xin:e.filter,phone:e.filter}},take:50,skip:0,isAscending:!0,orderBy:"id"})).then(r=>({data:r.data}))})}static{this.\u0275fac=function(r){return new(r||t)(a(m))}}static{this.\u0275prov=n({token:t,factory:t.\u0275fac})}}return t})();export{l as a,C as b,m as c,I as d};
