UserProfile model represents a user’s basic profile information in the Divvy app.
Data Class Definition
UserProfile.kt
Fields
Unique identifier for the user
The user’s display name shown throughout the app
Optional email address for the user. Nullable field.
Usage Examples
Creating a UserProfile
UserProfile Without Email
Related Models
GroupMember
A simplified representation of a user within a group context:GroupMember.kt
GroupMember model is used when displaying members in a group and only requires the user ID and name, not the full profile information.
MemberBalance
Represents a user’s balance within a specific group:MemberBalance.kt
Serialization
TheUserProfile model uses Kotlin Serialization with the @Serializable annotation. All fields are serialized with their property names (no custom @SerialName annotations).
Usage in the App
User profiles are referenced throughout the app:- Group Creation: The
createdByfield in Group references a user ID - Expenses: The
paidByUserIdfield in Expense indicates who paid - Ledger Entries: The
paidByUserIdandtoUserIdfields in LedgerEntry track transactions between users - Activity Feed: User names and IDs are displayed in expense and settlement activities