package com.erp.report.export.dto;

/**
 * 导出类型枚举
 */
public enum ExportType {
    ORDERS("orders", "订单导出"),
    GOODS("goods", "商品导出"),
    INVENTORY("inventory", "库存导出"),
    SUPPLIERS("suppliers", "供应商导出"),
    STOCK_REPORT("stock_report", "库存报表导出"),
    SALES_REPORT("sales_report", "销售报表导出"),
    ORDER_REPORT("order_report", "订单报表导出"),
    PURCHASE_REPORT("purchase_report", "采购报表导出"),
    FINANCE_REPORT("finance_report", "资金报表导出"),
    API_USAGE_REPORT("api_usage_report", "API使用报表导出");

    private final String code;
    private final String description;

    ExportType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static ExportType fromCode(String code) {
        for (ExportType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        return ORDERS;
    }
}
