package database

@Suppress("unused")
data class UserDB(var index: UInt, var username: String, var password: String, var location: String, var airline_tags: String, var city_tags: String, var messagebank_ann_id: String, var broadcastzones: String){
    override fun toString(): String {
        return "UserDB(index=$index, username='$username', location='$location', airline_tags='$airline_tags', city_tags='$city_tags', messagebank_ann_id='$messagebank_ann_id', broadcastzones='$broadcastzones')"
    }

    fun isNotEmpty() : Boolean {
        return username.isNotEmpty() && password.isNotEmpty() && location.isNotEmpty() && airline_tags.isNotEmpty() && city_tags.isNotEmpty() && messagebank_ann_id.isNotEmpty() && broadcastzones.isNotEmpty()
    }

    /**
     * Compares this UserDB object with another UserDB object for equality.
     * Two UserDB objects are considered equal if all their properties are equal, except for the index property.
     */
    fun isEqual(other: UserDB?): Boolean {
        if (other == null) return false
        return this.username == other.username &&
                this.password == other.password &&
                this.location == other.location &&
                this.airline_tags == other.airline_tags &&
                this.city_tags == other.city_tags &&
                this.messagebank_ann_id == other.messagebank_ann_id &&
                this.broadcastzones == other.broadcastzones

    }
}



