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

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

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

@Entity(tableName = "promotion")
class PromotionEntity() {

    constructor(promotionBean: PromotionBean) : this() {

        this.id = promotionBean.id
        this.gondolaSelectedPosition = promotionBean.gondolaSelectedPosition
        this.gondola = promotionBean.gondola
        this.barcode = promotionBean.barcode
        this.sendStatus = promotionBean.sendStatus
    }

    @ColumnInfo(name = "id")
    @PrimaryKey(autoGenerate = true)
    var id: Long = 0
    var gondolaSelectedPosition: Int = 0
    var gondola: String = ""
    var barcode: String = ""
    var sendStatus: Int = 0


    fun getBean(): PromotionBean {
        var promotionBean: PromotionBean = PromotionBean()

        promotionBean.id = this.id
        promotionBean.gondolaSelectedPosition = this.gondolaSelectedPosition
        promotionBean.gondola = this.gondola
        promotionBean.barcode = this.barcode
        promotionBean.sendStatus = this.sendStatus

        return promotionBean;
    }
}