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

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

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

@Entity(tableName = "facing")
class FacingEntity() {

    constructor(facingBean: FacingBean) : this() {

        this.barcode = facingBean.barcode
        this.quantity = facingBean.quantity
        this.sendStatus = facingBean.sendStatus
    }

    @ColumnInfo(name = "id")
    @PrimaryKey()
    var barcode: String = ""
    var quantity: Float = 1f
    var sendStatus: Int = 0


    fun getBean(): FacingBean {
        var facingBean: FacingBean = FacingBean()

        facingBean.barcode = this.barcode
        facingBean.quantity = this.quantity
        facingBean.sendStatus = this.sendStatus

        return facingBean;
    }
}