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

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

/**
 * Reservation 任务工作流受控异常。用于详情、队列状态、人工转换和任务确认接口。
 */
public class ReservationTaskWorkflowException extends RuntimeException {

    private final HttpStatus status;
    private final String errorCode;
    private final List<String> details;

    public ReservationTaskWorkflowException(HttpStatus status, String errorCode, String message) {
        this(status, errorCode, message, List.of());
    }

    public ReservationTaskWorkflowException(
            HttpStatus status,
            String errorCode,
            String message,
            List<String> details) {
        super(message);
        this.status = status;
        this.errorCode = errorCode;
        this.details = details == null ? List.of() : List.copyOf(details);
    }

    public HttpStatus getStatus() {
        return status;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public List<String> getDetails() {
        return details;
    }
}
