Skip to main content

Overview

By the end of this guide, you will understand how to create new users, assign roles and supervisors, manage user profiles, and deactivate users when needed. The platform supports three user roles: Admin, Supervisor, and Credit Officer, each with specific permissions and responsibilities.

Understanding User Roles

Before creating users, it’s important to understand the three user roles:
RolePermissionsUse Case
ADMINFull system access, can manage all users, configure settings, delete recordsSystem administrators
SUPERVISORManages Credit Officers, approves loans, generates reportsTeam leaders managing field staff
CREDIT_OFFICERDay-to-day operations, creates loans, records repaymentsField staff working with unions
Each Credit Officer can be assigned to a Supervisor. This creates a reporting hierarchy that enables supervisor reports and approval workflows.

Creating a New User

1

Navigate to User Management

From the sidebar menu:
  1. Click “User Management”
  2. Click “Users”
You’ll see a list of all existing users in the system.
2

Click Add User Button

Click the ”+ Add User” button in the top right corner of the page.
3

Fill in Required Information

Complete the user creation form with the following required fields:
FieldDescriptionRequiredFormat
First NameUser’s first name✅ YesText
Last NameUser’s last name✅ YesText
EmailLogin email address (must be unique)✅ YesValid email
PasswordInitial password for the user✅ YesMin 6 characters
RoleUser role in the system✅ YesADMIN, SUPERVISOR, or CREDIT_OFFICER
PhoneContact phone numberOptionalText
AddressPhysical addressOptionalText
Email addresses must be unique in the system. If you try to create a user with an existing email, you’ll receive an error.
4

Assign Supervisor (Credit Officers Only)

If you’re creating a Credit Officer, you’ll see an additional field:
  • Supervisor: Select which Supervisor this Credit Officer reports to
This field:
  • Is only available when Role is set to CREDIT_OFFICER
  • Allows Supervisors to see this officer’s loans and performance
  • Enables the approval workflow (officers submit, supervisors approve)
Assigning supervisors correctly is crucial for the approval workflow. Credit Officers can only submit loans for approval to their assigned supervisor.
5

Save the User

Click “Create User” to save the new user.After creation:
  • The user will appear in the users list
  • They can immediately log in using their email and password
  • You may want to inform them of their credentials securely

Assigning and Changing Supervisors

You can assign or reassign supervisors for Credit Officers at any time.
1

Locate the Credit Officer

  1. Go to User ManagementUsers
  2. Find the Credit Officer you want to assign
  3. Use the search box if needed to find them quickly
2

Open Edit Mode

Click the Edit icon (pencil) next to the user’s name.
3

Select Supervisor

In the edit form:
  1. Locate the Supervisor dropdown
  2. Select the new supervisor from the list
  3. Only users with role SUPERVISOR will appear in this list
To remove a supervisor assignment, select the empty option or “None” from the dropdown. This will set the supervisorId to null.
4

Save Changes

Click “Save Changes” to update the supervisor assignment.The change takes effect immediately:
  • The new supervisor can now see this officer’s data
  • The previous supervisor will no longer see this officer’s loans
  • All existing loans remain assigned to the officer

Managing User Profiles

Administrators can update user information at any time.
1

Navigate to the User

  1. Go to User ManagementUsers
  2. Find the user in the list
  3. Click the Edit icon (pencil)
2

Update Profile Information

You can modify:Personal Information:
  • First Name
  • Last Name
  • Phone number
  • Address
Account Settings:
  • Email address (must remain unique)
  • Role (ADMIN, SUPERVISOR, CREDIT_OFFICER)
  • Supervisor assignment (for Credit Officers)
  • Active status (see Deactivating Users)
Profile Picture:
  • Upload a new profile image
  • Remove existing profile image by setting removeProfileImage to true
3

Save Updates

Click “Save Changes” to apply your modifications.
Changing a user’s role may affect their access permissions immediately. For example:
  • Changing SUPERVISOR → CREDIT_OFFICER will remove their ability to approve loans
  • Changing CREDIT_OFFICER → SUPERVISOR will grant them approval permissions

Resetting User Passwords

As an administrator, you can reset passwords for any user.
1

Locate the User

Navigate to User ManagementUsers and find the user who needs a password reset.
2

Access Password Reset

  1. Open the user’s details by clicking on their name or the View icon
  2. Look for the “Reset Password” button
  3. Click the button to open the password reset dialog
3

Enter New Password

  1. Enter a new password (minimum 6 characters)
  2. Confirm the password
  3. Click “Confirm” to reset
After resetting a password, securely communicate the new credentials to the user. Consider asking them to change it again on their next login.
Users can also reset their own passwords using the “Forgot Password” link on the login page (USER_GUIDE.md:60-68).

Deactivating Users

Instead of deleting users (which can affect data integrity), you should deactivate them.
1

Navigate to the User

Go to User ManagementUsers and locate the user you want to deactivate.
2

Edit the User

Click the Edit icon (pencil) next to their name.
3

Toggle Active Status

  1. Find the “Active” or “isActive” toggle
  2. Switch it to OFF or set isActive to false
  3. Click “Save Changes”
4

Verify Deactivation

After deactivation:
  • The user cannot log in to the system
  • Their historical data remains intact
  • You can reactivate them at any time by setting isActive back to true
Important: Deactivated users:
  • Cannot access the platform
  • Still appear in historical records
  • Can be filtered out using the “Active” filter on the users list
  • Should be used instead of deletion for users with existing loans or repayments

Checking User Dependencies

Before deleting a user, check if they have associated records.
1

Access Dependency Check

Use the API endpoint GET /api/users/:id/dependencies or click the “Check Dependencies” button in the user details view.
2

Review Dependencies

The system will show:
  • Number of unions managed (for Credit Officers)
  • Number of loans created
  • Number of repayments recorded
  • Number of supervised officers (for Supervisors)
According to user.controller.ts:199-206, this information helps you decide whether to delete or deactivate a user.
3

Decide on Action

If user has dependencies:
  • Recommended: Deactivate instead of delete
  • Alternative: Reassign their records before deletion
If user has no dependencies:
  • Safe to delete if truly necessary

Viewing User Activity

Track user login history and activity:
  1. Navigate to the user’s profile
  2. View the following information:
    • Last Login: When they last accessed the system (lastLoginAt)
    • Last Activity: Most recent action timestamp (lastActivityAt)
    • Login Count: Total number of logins (loginCount)
Refer to the schema at backend/prisma/schema.prisma:105-106 for these tracked fields. The users list supports powerful filtering:
FilterDescriptionValues
SearchSearch by name or emailText input
RoleFilter by user roleADMIN, SUPERVISOR, CREDIT_OFFICER
Active StatusShow active or inactive usersTrue/False
SupervisorFilter officers by their supervisorSupervisor ID
Use the search functionality to quickly find users by typing their first name, last name, or email address.

API Reference

For developers integrating with the user management system:

Best Practices

Security Tips:
  • Use strong, unique passwords for all accounts
  • Reset passwords for users who haven’t logged in for extended periods
  • Regularly review active users and deactivate unused accounts
  • Don’t share login credentials between multiple people
Common Mistakes to Avoid:
  • Deleting users with historical records (use deactivation instead)
  • Creating duplicate users with similar email addresses
  • Forgetting to assign supervisors to Credit Officers
  • Changing roles without considering permission impacts

Build docs developers (and LLMs) love