package click.kamil.springstatemachineexporter.analysis.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Builder;
import lombok.Data;
import lombok.extern.jackson.Jacksonized;

import java.util.List;
import java.util.Map;

@Data
@Builder
@Jacksonized
@JsonIgnoreProperties(ignoreUnknown = true)
public class EntryPoint {
    public enum Type { REST, KAFKA, RABBIT, JMS, SQS, SNS, CUSTOM }

    @Data
    @Builder
    @Jacksonized
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Parameter {
        private final String name;
        private final String type;
        private final List<String> annotations;
    }

    private final Type type;
    private String name; // e.g., "POST /orders" or "Kafka Topic: orders"
    private final String className;
    private final String methodName;
    private final String sourceFile;
    private Map<String, String> metadata; // e.g., path, topic, exchange
    @Builder.Default
    private final List<Parameter> parameters = java.util.Collections.emptyList();
}
