package `in`.techware.carrefour.dbUtils.entity

import `in`.techware.carrefour.model.LabelSurveyBean
import android.arch.persistence.room.ColumnInfo
import android.arch.persistence.room.Entity
import android.arch.persistence.room.PrimaryKey

/**
 * Created by Jemsheer K D on 26 July, 2018.
 * Package `in`.techware.carrefour.dbUtils.entity
 * Project Carrefour
 */
@Entity(tableName = "labelSurvey")
class LabelSurveyEntity() {

    constructor(labelSurveyBean: LabelSurveyBean) : this() {

        this.id = labelSurveyBean.id
        this.section = labelSurveyBean.section
        this.barcode = labelSurveyBean.barcode
        this.price = labelSurveyBean.price
        this.sendStatus = labelSurveyBean.sendStatus
    }

    @ColumnInfo(name = "id")
    @PrimaryKey(autoGenerate = true)
    var id: Long = 0
    var section: String = ""
    var barcode: String = ""
    var price: Float = 0f
    var sendStatus: Int = 0


    fun getBean(): LabelSurveyBean {
        var labelSurveyBean: LabelSurveyBean = LabelSurveyBean()

        labelSurveyBean.id = this.id
        labelSurveyBean.section = this.section
        labelSurveyBean.barcode = this.barcode
        labelSurveyBean.price = this.price
        labelSurveyBean.sendStatus = this.sendStatus

        return labelSurveyBean;
    }
}