/**
 * All rights Reserved, Designed By www.freemud.cn
 *
 * @Title: AfterSalesStatus
 * @Package com.freemud.application.sdk.api.ordercenter.enums
 * @Description:
 * @author: ping.wu
 * @date: 2019/4/24 14:16
 * @version V1.0
 * @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
 * 注意：本内容仅限于上海非码科技内部传阅，禁止外泄以及用于其他的商业目
 */
package com.freemud.application.sdk.api.ordercenter.enums;

import java.util.Arrays;

public enum  AfterSalesStatus {

    PENDING(1,"待处理"),
    RETURNING(2,"退货中"),
    REJECTED( 3,"拒绝退款"),
    GOODS_RETURNED( 4,"已退货"),
    COMPLETE( 5,"完成"),
    CANCEL( 6,"取消"),
    ;

    private Integer index;
    private String name;

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    AfterSalesStatus(Integer index, String name) {
        this.index = index;
        this.name = name;
    }

    public static AfterSalesStatus getByIndex(byte index) {
        return Arrays.stream(AfterSalesStatus.values())
                .filter(e -> e.index == index)
                .findFirst()
                .orElse(null);
    }
}
