package cn.nianxx.thhotel.workflows.reservation.common.enums;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * SuperAgent 0711 P0 V3 业务事件类型枚举，集中维护后端可识别的 active event_type。
 */
public enum ReservationAiV3EventType {
    NEW_BOOKING("New Booking"),
    UPDATE_BOOKING_AMENDMENT("Update Booking / Amendment"),
    CANCEL_BOOKING("Cancel Booking"),
    CANCEL_ALLOTMENT("Cancel Allotment"),
    VOUCHER_RECEIVED("Voucher Received"),
    PAYMENT_EVIDENCE("Payment Evidence"),
    ROOMING_LIST("Rooming List"),
    AMEND_GROUP_CODE("AMEND GROUP CODE"),
    INVOICE_GENERATION("Invoice Generation"),
    INVOICE_RECEIVED("Invoice Received"),
    PAYMENT_NOTICE("Payment Notice"),
    TRACE("Trace"),
    MANUAL_RATE_CODE("Manual RateCode"),
    TA_RECORDER("TA RECORDER");

    private final String code;

    ReservationAiV3EventType(String code) {
        this.code = code;
    }

    public String code() {
        return code;
    }

    /**
     * 返回所有 active event_type 代码，供业务入站和外部适配层共享。
     */
    public static Set<String> activeCodes() {
        return Arrays.stream(values())
                .map(ReservationAiV3EventType::code)
                .collect(Collectors.toUnmodifiableSet());
    }
}
