package com.xingxi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: xingxi
 * @description: 审核状态
 * @author: bao
 * @create: 2025-04-21
 */
@AllArgsConstructor
@Getter
public enum EOrderStatus {
    SAVED("SAVED", "已保存"),
    ORDERED("ORDERED", "已下单"),
    PAYED("PAYED", "已支付"),
    CANCELLED("CANCELLED", "已取消"),
    DELIVERED("DELIVERED", "已发货"),
    RECEIVED("RECEIVED", "已收货"),
    SETTLED("SETTLED", "已结算"),
    FINISHED("FINISHED", "已完成");

    private String val;
    private String desc;

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