import { Injectable } from '@angular/core'; import { Modules } from './claims/claims.class'; import { HttpClient } from '@angular/common/http'; import { Config } from '../../_helpers/config.class'; import { UserClaims, User } from './user-claims.class'; @Injectable() export class UserService { constructor(private http: HttpClient) { } public getUserClaims(userId: string) { return this.http.get(`${Config.getControllerUrl('StaffManage', 'GetClaims')}/${userId}`); } public submitUserClaims(claims: UserClaims) { return this.http.post(`${Config.getControllerUrl('StaffManage', 'SaveClaims')}`, claims); } public getModules() { return this.http.get(`${Config.getControllerUrl('StaffManage')}/GetAllModules`); } public getAllComponents() { return this.http.get(`${Config.getControllerUrl('StaffManage')}/GetAllComponents`); } public getRoles() { return this.http.get(`${Config.getControllerUrl('Account', 'Roles')}`); } public getClaimsList() { return this.http.get(`${Config.getControllerUrl('Account', 'GetClaimsList')}`); } public registerRole(roleName: string) { return this.http.get(`${Config.getControllerUrl('Account', 'RegisterRole')}/${roleName}`); } public getUsers(skip: number, pageSize: number) { return this.http.get(`${Config.getControllerUrl('Account', 'Users')}`); } public getUserModules(userId: string) { return this.http.get(`${Config.getControllerUrl('Erp')}/GetUserRights/${userId}`); } public saveUserModules(userModules: any) { return this.http.post(`${Config.getControllerUrl('Erp')}/SaveErpUserRights`, userModules); } public getModuleById(id: string) { return this.http.get(`${Config.getControllerUrl('StaffManage')}/GetModule/${id}`); } public saveModule(module: any) { return this.http.post(`${Config.getControllerUrl('Erp')}/SaveErpTables`, module); } public saveUser(model: User) { return this.http.post(`${Config.getControllerUrl('Account', 'Register')}`, model); } public checkClientSubscription(id: number) { return this.http.post(`${Config.getControllerUrl('Account', 'CheckClientSubscription')}`, { Client_Id: id }); } public getUsersforClients(id: number) { return this.http.post(`${Config.getControllerUrl('Account', 'GetUsersforClients')}`, { Client_Id: id }); } public checkEmailExistance(email: string) { return this.http.post(`${Config.getControllerUrl('Account', 'CheckEmailExistance')}`, { Code: email }); } public checkUserNameExistance(userName: string) { return this.http.post(`${Config.getControllerUrl('Account', 'CheckUserNameExistance')}`, { Code: userName }); } public getRegisterUserById(id: string) { return this.http.post(`${Config.getControllerUrl('Account', 'GetRegisterUserById')}`, { Code: id }); } }