import{a as l,c as h}from"./chunk-ZQPWXQD7.js";import{m as c}from"./chunk-OWZ5YAMH.js";import{a as y}from"./chunk-KXX3UDJ3.js";import{a as m}from"./chunk-PDYJ5OYY.js";import{d as a,j as n}from"./chunk-GQAU5ACB.js";import{S as o,fa as s,la as p,pa as r}from"./chunk-ISMRT7VU.js";var u=(()=>{class i{constructor(e){this._http=e}authorizeEmployee(e){return this._http.get(`/api/user/companies/${e}/authorize`)}findUserByLogin(e){let t=new a().append(m.SkipError,"skipError");return this._http.get(`/api/user/${e}/find`,{headers:t})}getEmployees(e){return this._http.post("/api/employee/all",e,{headers:y})}getEmployeeById(e){return this._http.get(`/api/employee/${e}`)}createNewEmployee(e){return this._http.post("/api/employee",e)}editEmployee(e,t){return this._http.put(`/api/employee/${e}`,t)}removeEmployee(e){return this._http.delete(`/api/employee/${e}`)}authByCode(e){return this._http.post("/api/user/authorize-by-code",{code:e})}restore(e){return this._http.put(`/api/employee/${e}/restore`,{})}loginHistory(e){return this._http.get(`/api/employee/${e}/login-history`)}static{this.\u0275fac=function(t){return new(t||i)(r(n))}}static{this.\u0275prov=p({token:i,factory:i.\u0275fac})}}return i})();var I=(()=>{class i{constructor(e,t){this._employeeServiceApi=e,this._store=t}authorizeEmployee(e){return this._employeeServiceApi.authorizeEmployee(e).pipe(s(t=>{this._store.dispatch(new h),this._store.dispatch(new l(t))}),o(1))}getEmployees(e){return this._employeeServiceApi.getEmployees(e).pipe(o(1))}getEmployeeById(e){return this._employeeServiceApi.getEmployeeById(e).pipe(o(1))}createNewEmployee(e,t){return this._employeeServiceApi.createNewEmployee(this._toCreateFormModel(e,t)).pipe(o(1))}editEmployee(e,t){return this._employeeServiceApi.editEmployee(e,this._toEditFormModel(t)).pipe(o(1))}removeEmployee(e){return this._employeeServiceApi.removeEmployee(e).pipe(o(1))}findUserByLogin(e){return this._employeeServiceApi.findUserByLogin(e).pipe(o(1))}authByCode(e){return this._employeeServiceApi.authByCode(e).pipe(o(1))}restore(e){return this._employeeServiceApi.restore(e).pipe(o(1))}loginHistory(e){return this._employeeServiceApi.loginHistory(e).pipe(o(1))}_toCreateFormModel(e,t){return{userId:e,cashboxIds:t.cashboxes,storeIds:t.retailStores,roleId:t.role,accessToSalesMode:t.accessToSalesMode,accessToCabinet:t.accessToCabinet,authorizationCode:t.authorizationCode}}_toEditFormModel(e){return{cashboxIds:e.cashboxes,storeIds:e.retailStores,roleId:e.role,accessToSalesMode:e.accessToSalesMode,accessToCabinet:e.accessToCabinet,authorizationCode:e.authorizationCode}}static{this.\u0275fac=function(t){return new(t||i)(r(u),r(c))}}static{this.\u0275prov=p({token:i,factory:i.\u0275fac})}}return i})();export{u as a,I as b};
//# sourceMappingURL=chunk-V4WCDZSD.js.map
