cards #8

Merged
faraphel merged 12 commits from cards into main 2024-06-13 15:12:13 +02:00
Showing only changes of commit 56330ff7c7 - Show all commits

View file

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