package com.wms_main.model.vo.wms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.wms_main.model.po.TAppKanban;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 看板Vo
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class KanbanVo {
    /**
     * 记录id
     */
    @JsonProperty("recordId")
    private String recordId;
    /**
     * 料号
     */
    @JsonProperty("goodsId")
    private String goodsId;
    /**
     * 看板id
     */
    @JsonProperty("kanbanId")
    private String kanbanId;
    /**
     * 看板状态
     */
    @JsonProperty("kanbanStatus")
    private Integer kanbanStatus;

    /**
     * 将Po转化为Vo
     * @param kanbanPo Po
     * @return Vo
     */
    public static KanbanVo ofPo(TAppKanban kanbanPo) {
        return new KanbanVo(
                kanbanPo.getRecordId(),
                kanbanPo.getGoodsId(),
                kanbanPo.getKanbanId(),
                kanbanPo.getKanbanStatus()
        );
    }
}
