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

import `in`.techware.carrefour.model.StockTakeBean
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 = "stockTake")
class StockTakeEntity() {

    constructor(stockTakeBean: StockTakeBean) : this() {

        this.id = stockTakeBean.id
        this.zoneType = stockTakeBean.zoneType
        this.barcode = stockTakeBean.barcode
        this.isQuantityEnabled = stockTakeBean.isQuantityEnabled
        this.quantity = stockTakeBean.quantity
        this.sendStatus = stockTakeBean.sendStatus
    }

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


    fun getBean(): StockTakeBean {
        var stockTakeBean: StockTakeBean = StockTakeBean()

        stockTakeBean.id = this.id
        stockTakeBean.zoneType = this.zoneType
        stockTakeBean.barcode = this.barcode
        stockTakeBean.isQuantityEnabled = this.isQuantityEnabled
        stockTakeBean.quantity = this.quantity
        stockTakeBean.sendStatus = this.sendStatus

        return stockTakeBean;
    }
}