29 lines
806 B
Kotlin
29 lines
806 B
Kotlin
package fr.sanchezm.attestationsCovid19.data.db.entity
|
|
|
|
import androidx.room.Entity
|
|
import androidx.room.PrimaryKey
|
|
|
|
const val CURRENT_PROFILE_ID = 0
|
|
|
|
@Entity(tableName = "profile")
|
|
data class Profile(
|
|
val firstName: String,
|
|
val lastName: String,
|
|
val birthday: String,
|
|
val birthPlace: String,
|
|
val address: String,
|
|
val city: String,
|
|
val postalCode: String
|
|
) {
|
|
@PrimaryKey
|
|
var id: Int = CURRENT_PROFILE_ID
|
|
|
|
override fun toString(): String {
|
|
val builder = StringBuilder()
|
|
builder.append("Nom:", lastName, "; ")
|
|
builder.append("Prenom:", firstName, "; ")
|
|
builder.append("Naissance:", birthday, " a ", birthPlace, "; ")
|
|
builder.append("Adresse:", address, " ", postalCode, " ", city, "; ")
|
|
return builder.toString()
|
|
}
|
|
} |