# ServiceRequestCenterStatusEnum.java

    package cloud.wconnect.it.cons.servicerequestcenter;

    import lombok.AllArgsConstructor;
    import lombok.Getter;
    import org.apache.logging.log4j.util.Strings;

    import java.util.Arrays;

    /**
     *
     * @author: yyt
     * 2025-12-17
     */
    @Getter
    @AllArgsConstructor
    public enum ServiceRequestCenterStatusEnum {

        // 1.resolved 2.open 3.in progress 4.closed
        RESOLVED(1, "resolved", "resolve"),
        OPEN(2, "open","open"),
        IN_PROGRESS(3, "in progress","in-progress"),
        CLOSED(4, "closed","close");

        private final int code;
        private final String name;
        private final String i18nCode;

        public static String getI18nCode(int code) {
            return Arrays.stream(ServiceRequestCenterStatusEnum.values())
                    .filter(item -> item.getCode() == code)
                    .findFirst()
                    .map(ServiceRequestCenterStatusEnum::getI18nCode)
                    .orElse(Strings.EMPTY);
        }
    }