/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package cn.ysk.cashier.dto.product;

import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author lyf
* @date 2024-01-19
**/
@Data
public class TbProductStockDetailDto implements Serializable {

    private Long id;

    /** skuId */
    private String skuId;

    /** 商品Id */
    private String productId;

    /** 商品名称 */
    private String productName;

    /** 是否开启库存 */
    private Integer isStock;

    /** 规格 */
    private String specSnap;

    /** 商品单位 */
    private String unitName;

    /** 店铺Id */
    private String shopId;

    private String recordId;

    /** 操作批次号 */
    private String batchNumber;

    /** 库存操作来源：收银端调用 CASHIER   系统后台调用SHOP */
    private String sourcePath;

    /** 关联订单Id */
    private String orderId;

    /**  1入库 -1出库 */
    private Integer subType;

    /** purchase采购入库 transfer调拔入库
stockpile存酒入库
2盘点入库3退货入库4期初5生产归还入库6内部令用归还7借出归还8其它入库9调拔出库sale销售出库11盘点出库12锁定13生产领料14内部领用15借用出库16其它出库17报废出库 */
    private String type;

    /** 上次剩余数量 */
    private Integer leftNumber;

    /** 出入库时间 */
    private Long stockTime;

    /** 本次操作库存数量 */
    private Double stockNumber;

    /** 入库合计成本金额 */
    private BigDecimal costAmount;

    /** 出售合计金额 */
    private BigDecimal salesAmount;

    /** 操作人 */
    private String operator;

    /** 备注 */
    private String remark;

    /** 库存镜像 */
    private String stockSnap;

    private String barCode;

    private String coverImg;

    private Long createdAt;

    private Long updatedAt;

    public void setTypes() {
        switch (this.type) {
            case "purchase":
                this.type = "其他入库";
                break;
            case "other-out":
                this.type = "其他出库";
                break;
            case "reject":
                this.type = "供应商退货";
                break;
            case "purveyor":
                this.type = "供应商入库";
                break;
        }
    }
}