package database

@Suppress("unused")
data class Log(
    val index: ULong,
    val datenya: String,
    val timenya: String,
    val machine: String,
    val description : String
){
    companion object{

        fun NewLog(
            machine: String,
            description: String
        ) : Log {
            val current = java.time.LocalDateTime.now()
            val date = current.toLocalDate().toString() // format YYYY-MM-DD
            val time = current.toLocalTime().withNano(0).toString() // format HH:MM:SS
            return Log(0u, date, time, machine, description)
        }
    }

    override fun toString() : String {
        return "$datenya $timenya [$machine] $description"
    }
}
