Skip to main content
The Member struct is the central data model for church member management, providing a modular, extensible way to represent all aspects of a member’s profile.

Overview

The Member struct consolidates member information from Salesforce into logical sub-structs:
  • Core Identity: Basic demographics, identifiers, and membership status
  • Contact Information: Phone, email, address, and communication preferences
  • Employment Information: Work status, organization, occupation, and sector
  • Marital Information: Status, spouse details, anniversary tracking, and children
  • Discipleship Information: Spiritual journey, courses, ministry involvement, and serving

Core Properties

id
String?
Unique identifier for the member from Salesforce.
memberId
MemberID?
Type-safe member ID that validates and normalizes member IDs (must start with “TKT”).
memberName
String?
Full name of the member, automatically constructed from first, middle, and last name components.
firstName
String?
First name of the member.
middleName
String?
Middle name of the member.
lastName
String?
Last name of the member.
gender
Gender?
The member’s gender. Possible values: male, female.
phone
String?
Primary phone number of the member.
lifeGroupName
String?
Name of the life group the member belongs to.

Demographic Properties

dateOfBirth
BirthDateInfo?
Rich birthday information with date components, age calculations, and days until next birthday.Sub-properties:
  • date: Date - The original birth date
  • year: Int - Year component
  • month: Int - Month component
  • day: Int - Day component
  • age: Int - Current age in years
  • daysUntilNextBirthday: Int - Days until next birthday
  • shortFormat: String - Date in “day/month” format (e.g., “15/3”)
  • usFormat: String - Date in “month/day” format (e.g., “3/15”)
  • fullFormat: String - Full date in “day/month/year” format (e.g., “15/3/1990”)
title
MemberTitle?
The member’s title. Possible values: dr, mr, mrs, ms, prof, rev, ps.
memberType
MemberType?
The member’s type. Possible values: tkt, efam, spm, iocVillages, conferenceEventsOnly, tktTeenXYouth, kingsKid, uae.
bloodGroup
BloodGroup?
The member’s blood group. Examples: aPositive, bNegative, oPositive, abNegative.
preferredLanguages
[PreferredLanguage]?
Array of preferred languages. Possible values: english, telugu, hindi.

Membership Properties

attendingCampus
AttendingCampus?
The campus the member is attending. Possible values: eastLBNagar, westKukatpally, westHiTechCity, centralSecunderabad.
serviceCampus
ServiceCampus?
The campus where the member serves.
partOfLifeGroup
Bool?
Whether the member is part of a life group.
status
MemberStatus?
The member’s status. Possible values: regular, irregular, relocated, longTimeAbsentee, doNotCall, leftTheChurch, promotedToGlory, active, doNotContact, inActive, inactiveDNC.
campus
Campus?
The campus the member is associated with.
spm
Bool?
Whether the member is part of SPM (School of Practical Ministry).
attendingService
AttendingService?
The service the member is attending. Examples: firstService, secondService, online, fridayNightService.
contactInformation
ContactInformation?
Comprehensive contact information including phone, email, address, and WhatsApp.See ContactInformation for details.
employmentInformation
EmploymentInformation?
Employment and professional information including status, organization, occupation, and sector.See EmploymentInformation for details.
maritalInformation
MaritalInformation?
Marital status and family information including spouse, anniversary, and children.See MaritalInformation for details.
discipleshipInformation
DiscipleshipInformation?
Spiritual journey and discipleship information including baptism, courses, and ministry involvement.See DiscipleshipInformation for details.
photo
MemberPhoto?
The parsed member photo with URL and metadata extracted from HTML.Sub-properties:
  • url: String - Direct image URL
  • alt: String? - Alt text description
  • tags: [String] - Tags for the photo (e.g., “whatsapp”)

Date Tracking

createdDate
Date?
Date when the member record was created in Salesforce.
lastModifiedDate
Date?
Date when the member record was last modified in Salesforce.

Example Usage

let member = try await congregation.members.fetch(
    id: MemberID(validating: "TKT123456")
)

// Access basic information
print("Name: \(member.memberName ?? "Unknown")")
print("Phone: \(member.phone ?? "No phone")")
print("Status: \(member.status?.displayName ?? "Unknown")")

// Access rich date information
if let birthday = member.dateOfBirth {
    print("Age: \(birthday.age)")
    print("Next birthday in: \(birthday.daysUntilNextBirthday) days")
}

// Check spiritual milestones
if member.discipleshipInformation?.waterBaptism?.received == true {
    print("Member has been baptized")
}

// Check ministry involvement
if let serving = member.discipleshipInformation?.serving {
    print("Ministry: \(serving.involved?.displayName ?? "Not specified")")
    print("Department: \(serving.primaryDepartment?.displayName ?? "Not specified")")
}

Accessing Nested Data

The Member struct provides convenient access to nested data through protocol conformance:
// Access contact information directly or through nested struct
let phone = member.phone // Direct access
let email = member.email // Through ContactInformationRepresentable
let whatsapp = member.whatsappNumber // Through ContactInformationRepresentable

// Access employment information
let status = member.employmentStatus // Through EmploymentInformationRepresentable
let occupation = member.occupation // Through EmploymentInformationRepresentable

// Access marital information
let maritalStatus = member.maritalStatus // Through MaritalInformationRepresentable
let anniversary = member.weddingAnniversary // Through MaritalInformationRepresentable

// Access discipleship information
let waterBaptism = member.waterBaptism // Through DiscipleshipInformationRepresentable
let serving = member.serving // Through DiscipleshipInformationRepresentable

Field Expansion

Use MemberExpand to selectively fetch related information:
// Fetch member with specific expanded fields
let member = try await congregation.members.fetch(
    id: MemberID(validating: "TKT123456"),
    expanded: [.contactInformation, .employmentInformation]
)

// Only the requested fields will be populated
print(member.contactInformation) // Available
print(member.employmentInformation) // Available
print(member.maritalInformation) // nil (not requested)
print(member.discipleshipInformation) // nil (not requested)

See Also

Build docs developers (and LLMs) love