package cn.iocoder.yudao.module.asset.enums.returnorder;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 还车原因枚举
 */
@Getter
@AllArgsConstructor
public enum ReturnReasonEnum {

    CONTRACT_EXPIRED("CONTRACT_EXPIRED", "合同到期"),
    CUSTOMER_REQUEST("CUSTOMER_REQUEST", "客户申请"),
    CONTRACT_TERMINATED("CONTRACT_TERMINATED", "合同终止");

    private final String code;
    private final String name;

    public static ReturnReasonEnum valueOfCode(String code) {
        return Arrays.stream(values())
                .filter(item -> item.getCode().equals(code))
                .findFirst()
                .orElse(null);
    }

}
