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

import `in`.techware.carrefour.model.ItemListBean
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 = "itemList")
class ItemListEntity() {

    constructor(itemListBean: ItemListBean) : this() {

        this.barcode = itemListBean.barcode
        this.quantity = itemListBean.quantity
        this.sendStatus = itemListBean.sendStatus
    }

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


    fun getBean(): ItemListBean {
        var itemListBean: ItemListBean = ItemListBean()

        itemListBean.barcode = this.barcode
        itemListBean.quantity = this.quantity
        itemListBean.sendStatus = this.sendStatus

        return itemListBean;
    }
}