Coverage Summary for Class: Account (com.georgeci.moneysurfer.domain.model)

Class Class, % Method, % Branch, % Line, % Instruction, %
Account 100% (1/1) 100% (1/1) 100% (12/12) 100% (103/103)


 package com.georgeci.moneysurfer.domain.model
 
 import com.georgeci.moneysurfer.domain.primitives.AccountId
 import com.georgeci.moneysurfer.domain.primitives.AccountType
 import com.georgeci.moneysurfer.domain.primitives.CurrencyCode
 import com.georgeci.moneysurfer.domain.primitives.Money
 import com.georgeci.moneysurfer.domain.primitives.WorkspaceId
 import kotlin.time.Instant
 
 data class Account(
     val id: AccountId,
     val workspaceId: WorkspaceId,
     val name: String,
     val type: AccountType,
     val currencyCode: CurrencyCode,
     val balance: Money,
     val archived: Boolean = false,
     val updatedAt: Instant = Instant.fromEpochMilliseconds(0),
     /**
      * When the account was archived, or `null` while it is active. Set by the repository on
      * archive and cleared on restore — the manage list renders it as "Archived Nov 2024", which
      * `updatedAt` cannot supply because balance recalculation keeps bumping it.
      */
     val archivedAt: Instant? = null,
     /** Optional user-entered key–value details (IBAN, description, custom fields, …). */
     val extraDetails: List<AccountExtraDetail> = emptyList(),
     /**
      * Position of the account in every list the user sees, ascending. Owned by
      * `AccountRepository.reorder` — the manage screen's drag-to-reorder is the only thing that
      * assigns it; creation appends. Equal values are broken by name, so a workspace that has
      * never been reordered still lists in a stable order rather than an arbitrary one.
      */
     val sortOrder: Int = 0,
 )