
package com.tmerclub.cloud.common.product.constant;

/**
 * @Author lth
 * @Date 2021/9/9 15:49
 */
public enum StockBillType {
    /**
     * 采购入库
     */
    PURCHASE_STORAGE(1, StockType.WAREHOUSING, "采购入库", "Purchasing Inbound"),
    /**
     * 退货入库
     */
    RETURN_STORAGE(2, StockType.WAREHOUSING, "退款入库", "Refunds to the Treasury"),
    /**
     * 其他入库
     */
    OTHER_STORAGE(3, StockType.WAREHOUSING, "其他入库", "Other inbound"),
    /**
     * 销售出库
     */
    PURCHASE_OUTBOUND(4, StockType.OUT_OF_STOCK, "销售出库", "Sales out"),
    /**
     * 编辑出库
     */
    EDIT_OUTBOUND(5, StockType.OUT_OF_STOCK, "编辑出库", "Edit Out"),
    /**
     * 其他出库
     */
    OTHER_OUTBOUND(6, StockType.OUT_OF_STOCK, "其他出库", "Other Outbound"),
    /**
     * 库存初始化
     */
    INITIALIZE(7, StockType.WAREHOUSING, "库存初始化", "Inventory initialization"),

    /**
     * 订单取消
     */
    ORDER_CANCEL(8, StockType.WAREHOUSING, "订单取消", "Order Cancel"),

    /**
     * 编辑入库
     */
    EDIT_STORAGE(9, StockType.WAREHOUSING, "编辑入库", "Edit In"),

    /**
     * 盘盈入库
     */
    PROFIT_STORAGE(10, StockType.WAREHOUSING, "盘盈入库", "Inventory"),

    /**
     * 盘亏出库
     */
    LOSS_OUTBOUND(11, StockType.OUT_OF_STOCK, "盘亏出库", "Inventory out"),

    /**
     * 调拨入库
     */
    ALLOT_IN(12, StockType.WAREHOUSING, "调拨入库", "Allot In"),

    /**
     * 调拨出库
     */
    ALLOT_OUT(13, StockType.OUT_OF_STOCK, "调拨出库", "Allot Out"),

    /**
     * 库存模式切换出库
     */
    SWITCH_STATION(14, StockType.OUT_OF_STOCK, "库存模式切换出库", "Swtich Station"),

    /**
     * 库存模式切换入库
     */
    SWITCH_WAREHOUSE(15, StockType.WAREHOUSING, "库存模式切换入库", "Swtich Warehouse"),

    /**
     * 秒杀补充库存
     */
    SECKILL_STOCK(16, StockType.WAREHOUSING, "秒杀补充库存", "seckill stock");

    private final Integer id;

    private final String remark;

    private final String remarkEn;

    private final StockType stockType;

    public Integer value() {
        return id;
    }

    public String text() {
        return remark;
    }

    public String textEn() {
        return remarkEn;
    }

    StockBillType(Integer id, StockType stockType, String remark, String remarkEn) {
        this.id = id;
        this.stockType = stockType;
        this.remark = remark;
        this.remarkEn = remarkEn;
    }

    public static StockBillType instance(Integer value) {
        StockBillType[] enums = values();
        for (StockBillType statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

    public StockType getStockType() {
        return stockType;
    }
}
