Class

AdminService

AdminService()

Service responsible for privileged user management operations.

Constructor

# new AdminService()

View Source services/admin.service.js, line 8

Methods

# async createUser(userData) → {Promise.<TUser>}

Create a new user using the provided payload.

Parameters:
Name Type Description
userData CreateUserRequest

User creation payload from gRPC contract.

View Source services/admin.service.js, line 14

Newly created gRPC user representation.

Promise.<TUser>

# async deleteUser(email, currentUserEmail) → {Promise.<void>}

Delete a user ensuring admins cannot remove themselves.

Parameters:
Name Type Description
email string

Target user's email.

currentUserEmail string

Authenticated admin's email.

View Source services/admin.service.js, line 81

Resolves when deletion completes.

Promise.<void>

# async getAllSmes(currentUserId, page, limit, searchopt) → {Promise.<IPaginatedResponse.<ISmeResponse>>}

Retrieve paginated SMEs/admins excluding the current user.

Parameters:
Name Type Attributes Default Description
currentUserId string

Authenticated admin ID to exclude.

page number 1

Page number (default: 1).

limit number 10

Page size (default: 10).

search string <optional>

Optional search term.

View Source services/admin.service.js, line 122

Paginated response payload.

Promise.<IPaginatedResponse.<ISmeResponse>>

# async resetPassword(resetData) → {Promise.<void>}

Reset a user's password by email.

Parameters:
Name Type Description
resetData IResetPasswordDto

DTO containing the email and new password.

View Source services/admin.service.js, line 53

Resolves when the password is updated.

Promise.<void>