package com.erp.purchase.enums;

/**
 * 采购退货单状态
 */
public enum PurchaseReturnStatus {
    PENDING("pending", "待退货"),
    PARTIAL("partial", "部分退货"),
    COMPLETED("completed", "已完成"),
    CANCELLED("cancelled", "已取消");

    private final String code;
    private final String desc;

    PurchaseReturnStatus(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() { return code; }
    public String getDesc() { return desc; }

    public static PurchaseReturnStatus fromCode(String code) {
        for (PurchaseReturnStatus s : values()) {
            if (s.code.equals(code)) return s;
        }
        throw new IllegalArgumentException("未知状态: " + code);
    }
}
