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

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

class ReservationAiRouteDefinitionTest {

    @Test
    void shouldKeepFortyM002V3P01RouteDefinitions() {
        assertThat(ReservationAiRouteDefinition.values()).hasSize(40);
    }

    @Test
    void shouldResolveSourceMessageAndBusinessRoutesByStableKeys() {
        assertThat(ReservationAiRouteDefinition.findByRouteCode("S10"))
                .contains(ReservationAiRouteDefinition.SOURCE_MESSAGE_S10);
        assertThat(ReservationAiRouteDefinition.findByTriplet(
                "normal_task",
                "New Booking",
                "new_fit_reservation"))
                .contains(ReservationAiRouteDefinition.NEW_FIT_RESERVATION_NORMAL);
        assertThat(ReservationAiRouteDefinition.findByTriplet(
                "manual_review",
                "Payment Evidence",
                "payment_evidence"))
                .contains(ReservationAiRouteDefinition.PAYMENT_EVIDENCE_REVIEW);
        assertThat(ReservationAiRouteDefinition.findByTriplet(
                "normal_task",
                "Cancel Allotment",
                "cancel_allotment_control_block"))
                .contains(ReservationAiRouteDefinition.CANCEL_ALLOTMENT_CONTROL_BLOCK_NORMAL);
        assertThat(ReservationAiRouteDefinition.findByTriplet(
                "normal_task",
                "Cancel Booking",
                "linked_parent_release_after_child_split"))
                .isEmpty();
    }
}
