Skip to main content

What are Union Members?

Union Members (also called customers) are individuals who belong to a union and can receive loans. Each member has a detailed profile with personal information, contact details, documents, and loan history.
Members must be assigned to a union before they can apply for loans. Only verified members are eligible for loan disbursement.

Union Member Data Model

From the Prisma schema:
model UnionMember {
  id            String    @id @default(cuid())
  code          String?   @unique  // Optional member code
  firstName     String               // Required
  lastName      String               // Required
  phone         String?
  email         String?
  address       String?
  dateOfBirth   DateTime?
  gender        String?
  maritalStatus String?
  profession    String?
  company       String?
  city          String?
  state         String?
  country       String?
  zipCode       String?
  note          String?
  profileImage  String?
  isVerified    Boolean   @default(true)
  
  // Union Assignment
  unionId          String            // Required
  union            Union
  currentOfficerId String?           // Derived from union
  currentOfficer   User?
  
  // Relations
  documents                UnionMemberDocument[]
  loans                    Loan[]
  unionMemberReassignments UnionMemberReassignment[]
  
  createdAt DateTime  @default(now())
  updatedAt DateTime  @updatedAt
  deletedAt DateTime? // Soft delete
}

Profile Fields

Required Information

FieldTypeDescription
firstNameStringMember’s first name
lastNameStringMember’s last name
unionIdStringUnion membership (must exist)

Contact Information

FieldTypeDescription
phoneStringMobile/contact number
emailStringEmail address (optional)
addressStringStreet address
cityStringCity or town
stateStringState or region
countryStringCountry
zipCodeStringPostal code

Personal Details

FieldTypeDescription
dateOfBirthDateTimeBirthday
genderStringMale/Female/Other
maritalStatusStringMarital status
professionStringOccupation
companyStringEmployer name

System Fields

FieldTypeDescription
codeStringUnique member identifier (optional)
isVerifiedBooleanVerification status (default: true)
profileImageStringProfile photo URL
noteStringAdministrative notes

Viewing All Members

1

Navigate

Click Business ManagementUnion Members
2

View List

See all members you have permission to access

List Features

Search

Search by name, email, or phone number

Filter by Union

Select a specific union to view its members

Filter by Officer

View members assigned to a specific credit officer

Export

Download member list as CSV file

Role-Based Access

Can view and manage all members across all unions
Can view members in unions managed by their credit officers
Can only view and manage members in their assigned unions

Adding a New Member

1

Start Creation

Go to Union Members page and click + Add Member
2

Personal Information

Fill in required fields:
  • First Name (required)
  • Last Name (required)
  • Phone (highly recommended)
  • Email (optional)
  • Date of Birth (optional)
  • Gender (optional)
3

Address Information

Enter location details:
  • Street address
  • City, State, Country
  • Zip/Postal code
4

Union Assignment

Select Union (required)The member will be assigned to this union and its credit officer
5

Professional Details

Optionally add:
  • Profession/occupation
  • Company/employer
  • Marital status
6

Upload Documents

Add identification documents if required (see Document section below)
7

Save

Click Create Member to save the profile

API Endpoint

// POST /api/union-members
const createMember = async (data: {
  firstName: string;
  lastName: string;
  unionId: string;
  phone?: string;
  email?: string;
  address?: string;
  dateOfBirth?: string;
  gender?: string;
  maritalStatus?: string;
  profession?: string;
  company?: string;
  city?: string;
  state?: string;
  country?: string;
  zipCode?: string;
  note?: string;
}) => {
  // Creates new union member
}
Member Code: If you don’t provide a code, the system generates a unique identifier automatically.

Viewing Member Details

Click any member in the list to see their complete profile:

Profile Overview

  • Full name and member code
  • Profile photo (if uploaded)
  • Contact information
  • Verification status

Personal Details

  • Date of birth and age
  • Gender and marital status
  • Profession and company
  • Address details

Union Membership

  • Current union
  • Assigned credit officer
  • Membership date
  • Reassignment history

Loan History

  • All loans (past and present)
  • Total borrowed
  • Repayment performance
  • Current loan status

Documents Tab

View all uploaded documents:
  • ID cards
  • Proof of address
  • Business permits
  • Other supporting documents
Each document shows:
  • Document type
  • Upload date
  • Verification status
  • Issuing authority (if applicable)
  • Expiry date (if applicable)

Editing Member Information

1

Find Member

Locate the member in the list
2

Open Editor

Click the Edit icon (pencil) in Actions column
3

Update Fields

Modify any information as needed
4

Save Changes

Click Save Changes to update
You cannot change the union assignment from the edit form. Use the Reassign Member feature instead.

Member Verification

Before a member can receive loan disbursements, they should be verified.
1

Open Member Details

Click on the member’s profile
2

Locate Verification Section

Find the “Verification” toggle switch
3

Toggle Status

Switch Verified to ON (green)
4

Add Notes

Optionally add verification notes explaining what was confirmed

Verification Checklist

Before marking a member as verified, confirm:
  • ✅ Identity documents are valid
  • ✅ Contact information is correct
  • ✅ Address can be confirmed
  • ✅ Member understands loan terms
  • ✅ Required documents are uploaded

API Endpoint

// POST /api/union-members/:id/toggle-verification
const toggleVerification = async (memberId: string) => {
  // Toggles isVerified status
}

Reassigning Members to Different Unions

Members can be moved from one union to another:
When reassigning a member, they move to the new union and its credit officer
1

Open Member Profile

Navigate to the member’s detail page
2

Click Reassign

Find and click the Reassign Member button
3

Select New Union

Choose the destination union from the dropdown
4

Provide Reason

Enter the reason for reassignment (required for audit trail)
5

Confirm

Review and click Confirm Reassignment

What Happens During Reassignment?

  1. Member’s unionId is updated to the new union
  2. currentOfficerId changes to the new union’s credit officer
  3. Reassignment history is recorded in UnionMemberReassignment
  4. All existing loans remain unchanged
  5. New loans will be under the new union

Reassignment History Model

model UnionMemberReassignment {
  id            String      @id
  unionMemberId String
  oldUnionId    String?
  newUnionId    String
  oldOfficerId  String?
  newOfficerId  String?
  changedByUserId String
  reason          String?
  changedAt       DateTime @default(now())
}
Each member’s profile includes a complete history of all union changes with dates, reasons, and who made the change

Document Management

Document Types

The system supports various document types configured by administrators:
  • National ID Card
  • Driver’s License
  • Passport
  • Utility Bill (proof of address)
  • Business Registration
  • Bank Statement
  • Custom types

Uploading Documents

1

Open Member Profile

Navigate to the member’s detail page
2

Documents Tab

Click on the Documents tab
3

Upload New

Click Upload Document button
4

Select Type

Choose the document type from dropdown
5

Choose File

Select the file from your device (image or PDF)
6

Add Details

Optionally provide:
  • Issuing authority
  • Issue date
  • Expiry date
7

Upload

Click Upload to save

Document Model

model UnionMemberDocument {
  id                String       @id
  unionMemberId     String
  documentTypeId    String
  fileUrl           String
  issuingAuthority  String?
  issueDate         DateTime?
  expiryDate        DateTime?
  verified          Boolean      @default(false)
  verificationNotes String?
  uploadedByUserId  String
  uploadedAt        DateTime     @default(now())
}

Verifying Documents

Supervisors or Admins can:
  1. Open the document
  2. Review its authenticity
  3. Toggle Verified status
  4. Add verification notes
  5. Set expiry reminders
Keep document expiry dates updated. The system can alert when documents are about to expire.

Deleting Members

You cannot delete a member who has:
  • Active loans
  • Pending loan applications
  • Outstanding balances
Complete or cancel all loans first, or deactivate the member instead.
1

Locate Member

Find the member in the list
2

Delete Action

Click the Delete icon (trash can)
3

Confirm

Review the warning and click Confirm Deletion
Members are soft deleted (marked with deletedAt) to preserve historical records and audit trails.

Search and Filters

Search Functionality

The search bar looks for matches in:
  • First name
  • Last name
  • Email address
  • Phone number
  • Member code
// Search example
searchTerm: "john" 
// Finds: "John Smith", "Smith John", "john@email.com", etc.

Filter Options

By Union

Select a union to see only its members

By Credit Officer

View members managed by a specific officer

By Verification Status

Filter verified vs. unverified members

Date Range

See members registered in a specific period

Advanced Filters

Filter members by Male, Female, or Other
Filter by Single, Married, Divorced, or Widowed
Search by occupation or business type

Export Options

Export All Members

1

Apply Filters

Set any filters you want (union, officer, verification status)
2

Click Export

Click the Export button
3

Choose Format

Select CSV or Excel format
4

Download

File downloads with all filtered member data

Export Includes

  • Member code and full name
  • Contact information (phone, email, address)
  • Union and officer assignments
  • Verification status
  • Registration date
  • Personal details (DOB, gender, profession)
  • Loan statistics

Best Practices

Data Entry

  • Always enter first and last names
  • Verify phone numbers are correct
  • Use consistent formatting
  • Add notes for special circumstances

Verification

  • Verify members before first loan
  • Update verification when documents expire
  • Document what was verified in notes
  • Re-verify periodically

Document Management

  • Upload clear, readable documents
  • Track expiry dates
  • Verify authenticity
  • Store securely

Privacy

  • Protect personal information
  • Don’t share login credentials
  • Log out on shared computers
  • Follow data protection policies

Troubleshooting

Check:
  • First name and last name are filled
  • Union is selected
  • Email isn’t already in use (if provided)
  • You have necessary permissions
Try:
  • Clear search filters
  • Check spelling in search
  • Verify you have access to their union
  • Check if member was deleted
Reason: Member has active loansSolution:
  1. Complete or cancel all loans
  2. Wait for loans to close
  3. Or mark member as inactive instead
Possible causes:
  • File too large (max size limit)
  • Unsupported file format
  • Network connection issue
Solution: Compress image/PDF or check file type
Check:
  • You’re Admin or Supervisor
  • Target union exists and is active
  • Member has no pending transactions
  • Reason is provided

API Reference

Endpoints

// Get all members
GET /api/union-members?page=1&limit=20&search=keyword&unionId=xxx&currentOfficerId=xxx

// Get member by ID
GET /api/union-members/:id

// Create member
POST /api/union-members
Body: { firstName, lastName, unionId, phone?, email?, ... }

// Update member
PUT /api/union-members/:id
Body: { firstName?, lastName?, phone?, email?, ... }

// Delete member (soft)
DELETE /api/union-members/:id

// Toggle verification
POST /api/union-members/:id/toggle-verification

// Reassign to new union
POST /api/union-members/:id/reassign
Body: { newUnionId, reason? }

// Export members
GET /api/union-members/export?unionId=xxx&currentOfficerId=xxx&search=keyword

// Check email uniqueness
GET /api/union-members/check-email?email=test@example.com

Summary

Union Member management provides:
  • ✅ Comprehensive member profiles
  • ✅ Document upload and verification
  • ✅ Union and officer assignments
  • ✅ Reassignment with audit trail
  • ✅ Search and filter capabilities
  • ✅ Role-based access control
  • ✅ Loan history tracking
  • ✅ Export and reporting

Next Steps

  • Create Loans for verified members
  • Process Repayments for active loans
  • Generate Reports on member performance

Build docs developers (and LLMs) love