package com.fs.erp.dto.sdk.wangdian.enums;

/**
 * 支付状态枚举类
 */
public enum PaymentStatus {
    UNPAID(0, "未付款"),
    PARTIALLY_PAID(1, "部分付款"),
    FULLY_PAID(2, "已付款");

    private final int value;
    private final String description;

    PaymentStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

     /**
     * 根据状态值获取枚举实例
     *
     * @param value 状态值
     * @return 对应的枚举实例，如果找不到则返回 null
     */
    public static PaymentStatus fromValue(int value) {
        for (PaymentStatus status : PaymentStatus.values()) {
            if (status.value == value) {
                return status;
            }
        }
        return null;
    }
}
