package com.cool.store.enums.tp;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <p>
 * 十二分制-单据状态 枚举类
 * </p>
 *
 * @author wangff
 * @since 2025/11/5
 */
@Getter
@AllArgsConstructor
public enum TpFormStatusEnum {
    DRAFT("draft", "草稿"),

    PENDING("pending", "审批中"),
    PASS("pass", "审批通过"),
    REJECT("reject", "审批拒绝"),
    // 惩处单改为无需审批，中间状态为待生效
    INEFFECTIVE("ineffective", "待生效"),

    EFFECTIVE("effective", "已生效"),
    CANCEL("cancel", "已作废"),
    ;

    private final String status;

    private final String msg;

    public static String getMsgByStatus(String status) {
        for (TpFormStatusEnum value : values()) {
            if (value.status.equals(status)) {
                return value.msg;
            }
        }
        return null;
    }
}
