import{a as u}from"./chunk-NHAEOK7K.js";import{a as y}from"./chunk-KOXD6BDO.js";import{t as o,x as h}from"./chunk-OIJW4GMG.js";import{J as r,ca as a,ia as s,r as n}from"./chunk-3FIHWXA5.js";import{a as p,b as c}from"./chunk-K4ALXBGI.js";var b=(()=>{class i{constructor(e){this._http=e}get(e){return this._http.post("/api/buyer/all",e,{headers:u})}create(e){return this._http.post("/api/buyer",e)}update(e,t){return this._http.put(`/api/buyer/${e}`,t)}delete(e){return this._http.delete(`/api/buyer/${e}`)}getById(e){return this._http.get(`/api/buyer/${e}`)}acquittanceDebt(e,t){return this._http.post(`/api/buyer/${t}/acquittance-debt`,p({},e))}accrueDebt(e,t){return this._http.post(`/api/buyer/${t}/accrue-debt`,p({},e))}syncBuyer(){return this._http.post("/api/buyer/sync",{})}import(e){let t=new o().append(y.SkipError,"skipError");return this._http.post("/api/buyer/import",e,{headers:t})}actualize(e){return this._http.post(`/api/buyer/${e}/actualize`,{})}balanceHistory(e,t){return this._http.post(`/api/buyer/${e}/balance-history`,t,{headers:u})}static{this.\u0275fac=function(t){return new(t||i)(s(h))}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac})}}return i})();var g=(()=>{class i{constructor(e){this._buyersServiceApi=e,this._defaultFilter={criteria:null,take:50,skip:0,orderBy:"BalanceUpdatedDate"}}get(e){return this._buyersServiceApi.get(e).pipe(r(1))}create(e){return this._buyersServiceApi.create(e).pipe(r(1))}update(e,t){return this._buyersServiceApi.update(e,t).pipe(r(1))}delete(e){return this._buyersServiceApi.delete(e).pipe(r(1))}getById(e){return this._buyersServiceApi.getById(e).pipe(r(1))}searchBuyer(e=null){let t={search:{xin:null,name:e,phoneNumber:e}};return this._buyersServiceApi.get(c(p({},this._defaultFilter),{criteria:t})).pipe(n(l=>l.data))}acquittanceDebt(e,t){return this._buyersServiceApi.acquittanceDebt(e,t).pipe(r(1))}accrueDebt(e,t){return this._buyersServiceApi.accrueDebt(e,t).pipe(r(1))}syncBuyer(){return this._buyersServiceApi.syncBuyer().pipe(r(1))}buyerImport(e){return this._buyersServiceApi.import(e).pipe(r(1))}actualize(e){return this._buyersServiceApi.actualize(e).pipe(r(1))}balanceHistory(e,t){return this._buyersServiceApi.balanceHistory(e,t).pipe(r(1))}static{this.\u0275fac=function(t){return new(t||i)(s(b))}}static{this.\u0275prov=a({token:i,factory:i.\u0275fac})}}return i})();export{b as a,g as b};
