Skip to main content
The 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
Source: [Group.kt:7]

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

The Group model includes several computed properties for convenient UI display:

isOwed

Returns true if the current user is owed money (balance is positive or zero), false if they owe money.

formattedBalance

Returns the absolute value of the balance formatted as a dollar amount (e.g., “$15.50”).

balanceLabel

Returns a human-readable label describing the user’s balance (e.g., “You are owed 15.50"or"Youowe15.50" or "You owe 15.50”).

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

The Group model uses Kotlin Serialization with the @Serializable annotation. All fields are serialized with their property names (no custom @SerialName annotations).