import{a as h,c as m}from"./chunk-ZNYLCQSJ.js";import{p as l}from"./chunk-JBWPPKX4.js";import{a as u}from"./chunk-7N232KV6.js";import{a as y}from"./chunk-PDYJ5OYY.js";import{d as n,i as c}from"./chunk-NDLDFKR2.js";import{$ as a,K as o,fa as s,ka as p}from"./chunk-PVUKHE45.js";var d=(()=>{let i=class i{constructor(e){this._http=e}authorizeEmployee(e){return this._http.get(`/api/user/companies/${e}/authorize`)}findUserByLogin(e){let t=new n().append(y.SkipError,"skipError");return this._http.get(`/api/user/${e}/find`,{headers:t})}getEmployees(e){return this._http.post("/api/employee/all",e,{headers:u})}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`)}};i.\u0275fac=function(t){return new(t||i)(p(c))},i.\u0275prov=s({token:i,factory:i.\u0275fac});let r=i;return r})();var A=(()=>{let i=class i{constructor(e,t){this._employeeServiceApi=e,this._store=t}authorizeEmployee(e){return this._employeeServiceApi.authorizeEmployee(e).pipe(a(t=>{this._store.dispatch(new m),this._store.dispatch(new h(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}}};i.\u0275fac=function(t){return new(t||i)(p(d),p(l))},i.\u0275prov=s({token:i,factory:i.\u0275fac});let r=i;return r})();export{d as a,A as b};
//# sourceMappingURL=chunk-5JFE5MLS.js.map
