
package com.tmerclub.cloud.flow.constant;

/**
 * 报表项内容
 *
 * @author TRACK
 */
public enum FormItemEnum {
    /**
     * 客单价 (支付金额/支付人数)
     */
    CUSTOMER_UNIT_PRICE(1, "客单价", "Customer Unit Price", 0, "customerUnitPrice"),

    /**
     * 总成交金额
     */
    TOTAL_TRANSACTION_AMOUNT(2, "总成交金额", "Total transaction amount", 0, "totalTransactionAmount"),

    /**
     * 自营客单价 (自营金额/自营下单人数)
     */
    SELF_OPERATED_CUSTOMER_UNIT_PRICE(3, "自营客单价", "Self-employed customer unit price", 1, "selfCustomerUnitPrice"),

    /**
     * 自营金额
     */
    SELF_OPERATED_AMOUNT(4, "自营金额", "Self-employed amount", 1, "selfAmount"),

    /**
     * 自营订单数
     */
    SELF_OPERATED_ORDER_NUMS(5, "自营订单数", "Number of self-operated orders", 1, "selfOrders"),

    /**
     * 自营商品数
     */
    SELF_OPERATED_PRODUCT_NUMS(6, "自营商品数", "Number of self-operated products", 1, "selfProducts"),

    /**
     * 下单金额
     */
    ORDER_AMOUNT(7, "下单金额", "Order amount", 0, "orderAmount"),

    /**
     * 下单人数
     */
    USER_NUMS(8, "下单人数", "Number of people placing orders", 0, "peopleOrderNums"),

    /**
     * 下单笔数
     */
    ORDER_NUMS(9, "下单笔数", "Number of orders", 0, "orderNums"),

    /**
     * 下单商品数
     */
    PRODUCT_NUMS(10, "下单商品数", "Number of products ordered", 0, "orderProducts"),

    /**
     * 支付金额
     */
    PAY_AMOUNT(11, "支付金额", "Payment amount", 0, "paymentAmount"),

    /**
     * 支付人数
     */
    PAY_USER_NUMS(12, "支付人数", "Number of people paid", 0, "payPeopleNums"),

    /**
     * 支付订单数
     */
    PAY_ORDER_NUMS(13, "支付订单数", "Number of paid orders", 0, "payOrderNums"),

    /**
     * 支付商品数
     */
    PAY_PRODUCT_NUMS(14, "支付商品数", "Number of paid products", 0, "payProductNums"),

    /**
     * 成功退款金额
     */
    SUCCESS_REFUND_AMOUNT(15, "成功退款金额", "Successful refund amount", 0, "successRefundAmount"),

    /**
     * 退款订单数量
     */
    REFUND_ORDER_NUMS(16, "退款订单数量", "Number of refund orders", 0, "refundOrderNums"),

    /**
     * 下单-支付转化率 （支付订单数量/下单订单数量）
     */
    ORDER_TO_PAY_RATE(17, "下单-支付转化率", "Order-Payment Conversion Rate", 0, "orderPaymentRate"),

    /**
     * 退款率 （退款订单数量/订单数量）
     */
    REFUND_RATE(18, "退款率", "Refund Rate", 0, "refundRate"),

    /**
     * 自营下单人数
     */
    SELF_OPERATED_NUMS(19, "自营下单人数", "Number of self-operated orders", 1, "selfNums");

    private final Integer num;

    private final String name;

    private final String nameEn;

    /**
     * 0:通用，1：平台  2：商家端
     */
    private final Integer type;

    private final String columnStr;

    public Integer value() {
        return num;
    }

    public String getName() {
        return name;
    }

    public String getNameEn() {
        return nameEn;
    }

    public Integer getType() {
        return type;
    }

    public String getColumnStr() {
        return columnStr;
    }

    FormItemEnum(Integer num, String name, String nameEn, Integer type, String columnStr) {
        this.num = num;
        this.name = name;
        this.nameEn = nameEn;
        this.type = type;
        this.columnStr = columnStr;
    }

    public static FormItemEnum instance(Integer value) {
        FormItemEnum[] enums = values();
        for (FormItemEnum statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static FormItemEnum[] allEnum() {
        return values();
    }
}
