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

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

/**
 * Reservation Invoice 生成受控异常。错误响应不得包含完整用户 payload、PDF 字节或 OSS 签名 URL。
 */
public class ReservationInvoiceGenerationException extends RuntimeException {

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

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

    public ReservationInvoiceGenerationException(
            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;
    }
}
