package com.yc.ship.module.product.enums;

import com.yc.ship.framework.common.core.StringListValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 规格类型枚举，对应字典project_specification_type，用户可自行维护，此处值不完整
 */
@Getter
@AllArgsConstructor
public enum SpecTypeEnum implements StringListValuable {

    COMMON("common", "通用"),
    FULL("full", "全价"),
    HALF("half", "半价"),
    FREE("free", "免票"),
    CARRYING_CHILDREN("carrying_children", "携童票"),
    OTHER("other","其他");
    public static final List<String> ARRAYS = Arrays.stream(values()).map(SpecTypeEnum::getType).collect(Collectors.toList());

    /**
     * 类型
     */
    private final String type;
    /**
     * 类型名
     */
    private final String name;

    @Override
    public List<String> array() {
        return ARRAYS;
    }

}
