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

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

/**
 * Created by Jemsheer K D on 25 July, 2018.
 * Package `in`.techware.carrefour.dbUtils.entity
 * Project Carrefour
 */


@Entity(tableName = "printLabel")
class PrintLabelEntity() {

    constructor(printLabelBean: PrintLabelBean) : this() {

        this.id = printLabelBean.id
        this.printerLabel = printLabelBean.printerLabel
        this.labelType = printLabelBean.labelType
        this.barcode = printLabelBean.barcode
        this.isQuantityEnabled = printLabelBean.isQuantityEnabled
        this.quantity = printLabelBean.quantity
        this.sendStatus = printLabelBean.sendStatus
    }

    @ColumnInfo(name = "id")
    @PrimaryKey(autoGenerate = true)
    var id: Long = 0
    var barcode: String = ""
    var isQuantityEnabled: Boolean = false
    var quantity: Float = 1F
    var labelType: Int = 0
    var printerLabel: String = ""
    var sendStatus: Int = 0


    fun getBean(): PrintLabelBean {
        var printLabelBean: PrintLabelBean = PrintLabelBean()

        printLabelBean.id = this.id
        printLabelBean.printerLabel = this.printerLabel
        printLabelBean.labelType = this.labelType
        printLabelBean.barcode = this.barcode
        printLabelBean.isQuantityEnabled = this.isQuantityEnabled
        printLabelBean.quantity = this.quantity
        printLabelBean.sendStatus = this.sendStatus

        return printLabelBean;
    }
}