package com.xingxi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: xingxi
 * @description: 审核状态
 * @author: bao
 * @create: 2025-04-21
 */
@AllArgsConstructor
@Getter
public enum EOrderDetailStatus {
    SAVED("SAVED", "已保存"),
    ORDERED("ORDERED", "已下单"),
    PAYED("PAYED", "已支付"),
    CANCELLED("CANCELLED", "已取消"),
    REJECTED("REJECTED", "已驳回"),
    APPROVED("APPROVED", "已审核"),
    DELIVERED("DELIVERED", "已发货"),
    RECEIVED("RECEIVED", "已收货"),
    FINISHED("FINISHED", "已完成"),
    AFTERSALES("AFTERSALES", "售后中");

    private String val;
    private String desc;

    /** 解析 */
    public static EOrderDetailStatus parseByVal(String val) {
        for(EOrderDetailStatus type : EOrderDetailStatus.values()) {
            if(type.getVal().equalsIgnoreCase(val)) {
                return type;
            }
        }
        return EOrderDetailStatus.ORDERED;
    }
}
