package com.ycwl.basic.pricing.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 商品类型枚举
 */
@Getter
@AllArgsConstructor
public enum ProductType {
    
    VLOG_VIDEO("VLOG_VIDEO", "Vlog视频"),
    RECORDING_SET("RECORDING_SET", "录像集"),
    PHOTO_SET("PHOTO_SET", "照相集"),
    PHOTO_PRINT("PHOTO_PRINT", "照片打印"),
    MACHINE_PRINT("MACHINE_PRINT", "一体机打印");
    
    private final String code;
    private final String description;
    
    /**
     * 根据代码获取枚举
     */
    public static ProductType fromCode(String code) {
        for (ProductType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown product type code: " + code);
    }
}