Group model represents a collection of users who share expenses together. Each group tracks its members, balance, and visual identity.
Data Class Definition
Group.kt
Fields
String
required
Unique identifier for the group
String
required
Display name of the group (e.g., “Roommates”, “Europe Trip”)
String
default:"\"\""
Optional emoji character to display alongside the group icon
GroupIcon
default:"GroupIcon.Group"
Visual icon for the group. See [GroupIcon] for available options.
Int
default:"0"
Number of members currently in the group
Long
default:"0L"
Current user’s balance in cents. Positive values indicate the user is owed money, negative values indicate the user owes money.
String
default:"\"USD\""
Three-letter ISO currency code for the group’s transactions
String
default:"\"\""
User ID of the member who created the group
Computed Properties
TheGroup model includes several computed properties for convenient UI display:
isOwed
true if the current user is owed money (balance is positive or zero), false if they owe money.
formattedBalance
balanceLabel
Relationships
- Members: A group contains multiple users. See GroupMember for member details.
- Expenses: A group can have many expenses. See Expense and GroupExpense models.
- Balances: Each member has a balance within the group. See MemberBalance.
Usage Examples
Creating a Group
Accessing Computed Properties
Repository Operations
From [GroupRepository.kt]:Serialization
TheGroup model uses Kotlin Serialization with the @Serializable annotation. All fields are serialized with their property names (no custom @SerialName annotations).