import{a as l}from"./chunk-GJ2XPATQ.js";import{a as _}from"./chunk-TTT4O4HK.js";import{c as C}from"./chunk-VJXA7ZH3.js";import{a as f}from"./chunk-Y75MWVBQ.js";import{o as m}from"./chunk-GW2OL5S3.js";import{a as x}from"./chunk-P5XIDEFS.js";import{i as g}from"./chunk-CO3WTSA4.js";import{I as s,Z as S,ea as c,ja as o,q as b}from"./chunk-DYUFV4HF.js";import{d,n as y}from"./chunk-INB5GR2I.js";import{a as h,b as u}from"./chunk-B7YGBANW.js";y();var a=class a{constructor(t){this._http=t,this._defaultFilter={criteria:null,take:100,skip:0,orderBy:"id",isAscending:!0}}getCashboxes(t=this._defaultFilter){let r=u(h({},t),{criteria:{storeId:this._retailStoreId}});return this._http.post("/api/cashbox/all",h({},r),{headers:x})}getCashbox(t){return this._http.get(`/api/cashbox/${t}`)}editCashbox(t,r){return this._http.put(`/api/cashbox/${t}`,h({},r))}createCashbox(t){return this._http.post("/api/cashbox",h({},t))}getCashboxesByStoreId(t){return this._http.get(`/api/store/${t}/cashboxes`)}getSyncState(t){return this._http.get(`/api/store/${t}/last-sync-state`)}bindCashbox(t){return this._http.post(`/api/cashbox/${t}/bind`,{})}getBindStatus(t){return this._http.get(`/api/cashbox/${t}/bind-status`)}getCashboxState(t){return this._http.get(`/api/cashbox/${t}/state`)}unbindCashbox(t){return this._http.post(`/api/cashbox/${t}/unbind`,{})}settingsCashbox(t,r){return this._http.put(`/api/cashbox/${t}/settings`,r)}syncCashbox(){return this._http.post("/api/cashbox/sync",{},{headers:x})}};a.\u0275fac=function(r){return new(r||a)(o(g))},a.\u0275prov=c({token:a,factory:a.\u0275fac});var p=a;d([f(C.selectedStoreId)],p.prototype,"_retailStoreId",void 0);var R=(()=>{let t=class t{constructor(e,i,A){this._cashboxesServiceApi=e,this._accountsServiceApi=i,this._store=A}getCashboxes(e){return this._cashboxesServiceApi.getCashboxes(e).pipe(s(1))}getById(e){return this._cashboxesServiceApi.getCashbox(e).pipe(s(1))}create(e){return this._cashboxesServiceApi.createCashbox(e).pipe(s(1))}edit(e,i){return this._cashboxesServiceApi.editCashbox(e,i).pipe(s(1))}getAccountsForPaymentMethods(){return this._accountsServiceApi.getAccounts().pipe(s(1),b(e=>e.data),b(e=>e.filter(i=>i.useAsPaymentMethod&&i.type!==1)))}getAllCashboxes(){return this._cashboxesServiceApi.getCashboxes().pipe(S(e=>{this._store.dispatch(new _(e.data))}))}getSyncState(e){return this._cashboxesServiceApi.getSyncState(e).pipe(s(1))}bindCashbox(e){return this._cashboxesServiceApi.bindCashbox(e).pipe(s(1))}getBindStatus(e){return this._cashboxesServiceApi.getBindStatus(e).pipe(s(1))}getCashboxState(e){return this._cashboxesServiceApi.getCashboxState(e)}unbindCashbox(e){return this._cashboxesServiceApi.unbindCashbox(e).pipe(s(1))}getCashboxesByStoreId(e){return this._cashboxesServiceApi.getCashboxesByStoreId(e).pipe(s(1))}settingsCashbox(e,i){return this._cashboxesServiceApi.settingsCashbox(e,i).pipe(s(1))}syncCashbox(){return this._cashboxesServiceApi.syncCashbox().pipe(s(1))}};t.\u0275fac=function(i){return new(i||t)(o(p),o(l),o(m))},t.\u0275prov=c({token:t,factory:t.\u0275fac});let n=t;return n})();export{p as a,R as b};
//# sourceMappingURL=chunk-PGWCIYHW.js.map
