/** * UsersService - Gestión de usuarios * * CRUD de usuarios con soporte multi-tenant y RBAC. * * @module Users */ import { Repository } from 'typeorm'; import { User } from '../../core/entities/user.entity'; import { Role } from '../../auth/entities/role.entity'; import { UserRole } from '../../auth/entities/user-role.entity'; export interface CreateUserDto { email: string; password: string; firstName: string; lastName: string; tenantId: string; roles?: string[]; } export interface UpdateUserDto { firstName?: string; lastName?: string; isActive?: boolean; } export interface AssignRoleDto { userId: string; roleCode: string; tenantId: string; } export interface UserListOptions { tenantId: string; page?: number; limit?: number; search?: string; isActive?: boolean; } export declare class UsersService { private readonly userRepository; private readonly roleRepository; private readonly userRoleRepository; constructor(userRepository: Repository, roleRepository: Repository, userRoleRepository: Repository); /** * Listar usuarios de un tenant */ findAll(options: UserListOptions): Promise<{ users: User[]; total: number; }>; /** * Obtener usuario por ID */ findById(id: string, tenantId: string): Promise; /** * Obtener usuario por email */ findByEmail(email: string, tenantId: string): Promise; /** * Crear usuario */ create(dto: CreateUserDto, createdBy?: string): Promise; /** * Actualizar usuario */ update(id: string, tenantId: string, dto: UpdateUserDto): Promise; /** * Soft delete de usuario */ delete(id: string, tenantId: string, _deletedBy?: string): Promise; /** * Activar/Desactivar usuario */ setActive(id: string, tenantId: string, isActive: boolean): Promise; /** * Asignar rol a usuario */ assignRole(dto: AssignRoleDto, assignedBy?: string): Promise; /** * Remover rol de usuario */ removeRole(userId: string, roleCode: string, tenantId: string): Promise; /** * Obtener roles de usuario */ getUserRoles(userId: string, tenantId: string): Promise; /** * Listar todos los roles disponibles */ listRoles(): Promise; } //# sourceMappingURL=users.service.d.ts.map