package com.xingxi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: gululuq
 * @description: 入出库标志
 * @author: 金
 * @create: 2025-03-16
 */
@AllArgsConstructor
@Getter
public enum EInventoryBillReason {
    IN_PURCHASE("IN_PURCHASE", "采购入库"),
    IN_RETURN("IN_RETURN", "退货入库"),
    IN_CHANGE("IN_CHANGE", "换货入库"),
    IN_CANCEL("IN_CANCEL", "取消入库"),
    OUT_SALE("OUT_SALE", "销售出库"),
    OUT_CHANGE("OUT_CHANGE", "换货出库"),
    OTHER("OTHER", "其它");

    private String val;
    private String desc;

    /** 解析 */
    public static EInventoryBillReason parseByVal(String val) {
        for(EInventoryBillReason value : EInventoryBillReason.values()) {
            if(value.getVal().equalsIgnoreCase(val)) {
                return value;
            }
        }
        return EInventoryBillReason.OTHER;
    }
}
