package cn.nianxx.thhotel.workflows.reservation.service.impl;

import java.util.Map;
import org.springframework.http.HttpStatus;

/**
 * SuperAgent 查询接口受控异常。用于把参数错误和对象不存在转换为稳定 JSON 响应。
 */
public class ReservationAiQueryException extends RuntimeException {

    private final HttpStatus status;
    private final String errorCode;
    private final Map<String, Object> details;

    public ReservationAiQueryException(HttpStatus status, String errorCode, String message) {
        this(status, errorCode, message, Map.of());
    }

    public ReservationAiQueryException(
            HttpStatus status,
            String errorCode,
            String message,
            Map<String, Object> details) {
        super(message);
        this.status = status;
        this.errorCode = errorCode;
        this.details = details == null ? Map.of() : details;
    }

    public HttpStatus getStatus() {
        return status;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public Map<String, Object> getDetails() {
        return details;
    }
}
