# PastReservationNotifyEnum.java

    package cloud.wconnect.frontoffice.cons.pastreservation;

    import cloud.wconnect.commonlib.cons.NotifySubjectI18nCons;
    import lombok.AllArgsConstructor;
    import lombok.Getter;

    import java.util.Arrays;
    import java.util.Optional;

    /**
     * @author: yyt
     * 2024-10-4
     */
    @Getter
    @AllArgsConstructor
    public enum PastReservationNotifyEnum {

        MISSING_REPORT_GUEST_IN_HOUSE(1, NotifySubjectI18nCons.MISSING_REPORT),

        CONSECUTIVE_STAY_NOTICE(2,"past-reservation.notify.consecutive-stay-notice"),

        MISSING_REPORT_CREDIT_LIMIT(4,NotifySubjectI18nCons.MISSING_REPORT);

        private final int code;

        private final String i18nCode;

        public static String getI18nCode(int code) {
            Optional<PastReservationNotifyEnum> optional = Arrays.stream(PastReservationNotifyEnum.values())
                    .filter(item -> item.getCode() == code).findFirst();
            return optional.isPresent() ? optional.get().getI18nCode() : "";
        }

    }