Coverage Summary for Class: AccountEntity (com.georgeci.moneysurfer.data.db.entity)

Class Class, % Method, % Branch, % Line, % Instruction, %
AccountEntity 100% (1/1) 100% (2/2) 100% (13/13) 100% (67/67)


 package com.georgeci.moneysurfer.data.db.entity
 
 import androidx.room.ColumnInfo
 import androidx.room.Entity
 import androidx.room.ForeignKey
 import androidx.room.Index
 import androidx.room.PrimaryKey
 
 @Entity(
     tableName = "accounts",
     foreignKeys = [
         ForeignKey(
             entity = WorkspaceEntity::class,
             parentColumns = ["id"],
             childColumns = ["workspaceId"],
         ),
     ],
     indices = [Index("workspaceId")],
 )
 data class AccountEntity(
     @PrimaryKey
     @ColumnInfo(name = "id") val id: String,
     @ColumnInfo(name = "workspaceId") val workspaceId: String,
     @ColumnInfo(name = "name") val name: String,
     @ColumnInfo(name = "type") val type: String,
     @ColumnInfo(name = "currency") val currency: String,
     @ColumnInfo(name = "balance") val balance: Long,
     @ColumnInfo(name = "archived", defaultValue = "0") val archived: Boolean = false,
     @ColumnInfo(name = "updatedAt", defaultValue = "0") val updatedAt: Long = 0L,
     /** Epoch millis of the archive write, `null` while the account is active. */
     @ColumnInfo(name = "archivedAt") val archivedAt: Long? = null,
     /**
      * "Extra details" as a JSON array of `{"key","value"}` objects — see
      * [com.georgeci.moneysurfer.data.db.entity.AccountExtraDetailsColumn]. One column rather than
      * a child table because the entries have no identity of their own: nothing queries, renames
      * or counts them across accounts, and they are written and read as one blob with the account.
      */
     @ColumnInfo(name = "extraDetails", defaultValue = "'[]'") val extraDetails: String = "[]",
     /**
      * User-defined position within the workspace, ascending. Every read orders by it and falls
      * back to `name` so rows that share a value — a workspace nobody has reordered yet — still
      * come out in a stable order.
      */
     @ColumnInfo(name = "sortOrder", defaultValue = "0") val sortOrder: Int = 0,
 )