[WIP] - added a field for the persons to hold their password hash

This commit is contained in:
Faraphel 2024-05-18 17:04:13 +02:00
parent 2a70ca1ee2
commit 56330ff7c7

View file

@ -1,5 +1,6 @@
package com.faraphel.tasks_valider.database.entities
import androidx.compose.ui.text.capitalize
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
@ -12,7 +13,13 @@ data class PersonEntity (
@ColumnInfo("first_name") val firstName: String,
@ColumnInfo("last_name") val lastName: String,
@ColumnInfo("card_id") val cardId: UUID,
@ColumnInfo("password_hash") val passwordHash: String
) : BaseEntity() {
/**
* Return the full name of the person
*/
fun fullName(): String = "${this.firstName.capitalize()} ${this.lastName.uppercase()}"
companion object {
const val TABLE_NAME = "persons"
}