import{a as h,c as m}from"./chunk-JOFGKPLY.js";import{n as l}from"./chunk-DC6G5OHZ.js";import{a as y}from"./chunk-JUPKAJPM.js";import{a as d}from"./chunk-PDYJ5OYY.js";import{d as c,i as n}from"./chunk-Z2AWIQRI.js";import{L as i,aa as a,ia as s,na as p}from"./chunk-C2QKZJOP.js";var u=(()=>{let o=class o{constructor(e){this._http=e}authorizeEmployee(e){return this._http.get(`/api/user/companies/${e}/authorize`)}findUserByLogin(e){let t=new c().append(d.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}`,{})}};o.\u0275fac=function(t){return new(t||o)(p(n))},o.\u0275prov=s({token:o,factory:o.\u0275fac});let r=o;return r})();var A=(()=>{let o=class o{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))}),i(1))}getEmployees(e){return this._employeeServiceApi.getEmployees(e).pipe(i(1))}getEmployeeById(e){return this._employeeServiceApi.getEmployeeById(e).pipe(i(1))}createNewEmployee(e,t){return this._employeeServiceApi.createNewEmployee(this._toCreateFormModel(e,t)).pipe(i(1))}editEmployee(e,t){return this._employeeServiceApi.editEmployee(e,this._toEditFormModel(t)).pipe(i(1))}removeEmployee(e){return this._employeeServiceApi.removeEmployee(e).pipe(i(1))}findUserByLogin(e){return this._employeeServiceApi.findUserByLogin(e).pipe(i(1))}authByCode(e){return this._employeeServiceApi.authByCode(e).pipe(i(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}}};o.\u0275fac=function(t){return new(t||o)(p(u),p(l))},o.\u0275prov=s({token:o,factory:o.\u0275fac});let r=o;return r})();export{u as a,A as b};
//# sourceMappingURL=chunk-GF5II5JA.js.map
