package click.kamil.service;

import click.kamil.domain.IEvent;
import click.kamil.domain.IState;

public interface StateMachineService {
    <S extends IState, T extends IEvent> void sendMessage(T event);

    <S extends IState, T extends IEvent, A extends OutboxAction<T>> void sendMessageWithOutbox(T event, A action);

    // Quirky pattern: Bounded generic supplier instead of reflection
    <T extends click.kamil.domain.OrderEvent> void sendMessageWithProvider(java.util.function.Supplier<T> eventProvider);

    // Quirky pattern 2: Generic Varargs
    <T extends IEvent> void sendEventsVarargs(T... events);

    // Functional quirks: passing functions and method references
    <T extends IEvent> void executeFunctionalTransition(java.util.function.Supplier<T> eventSupplier, 
                                                        java.util.function.Function<T, Void> transitionAction);

    // Child class of Spring's GenericMessage with a generic payload
    <T extends click.kamil.domain.OrderEvent, P> void sendCustomMessage(click.kamil.domain.CustomStateMachineMessage<T, P> customMessage);

    // Quirky pattern 3: Multiple generic bounds (Intersection Types)
    <T extends IEvent & java.io.Serializable & Cloneable> T processQuirkyEvent(T event);
}
