package de.avatic.lcc.model.db.error;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Represents a system error with detailed information about the error occurrence,
 * including user context, error type, and stack trace.
 */
public class SysError {

    /**
     * The unique identifier of the system error.
     */
    private Integer id;

    /**
     * The identifier of the user associated with this error.
     */
    private Integer userId;

    /**
     * The title or brief description of the error.
     */
    private String title;

    /**
     * The detailed error message.
     */
    private String message;

    /**
     * The error code identifier.
     */
    private String code;

    /**
     * The Pinia store state related to this error.
     */
    private String pinia;

    /**
     * The type classification of the system error.
     */
    private SysErrorType type;

    /**
     * The identifier of the calculation job associated with this error.
     */
    private Integer calculationJobId;

    /**
     * The identifier of the bulk operation associated with this error.
     */
    private Integer bulkOperationId;

    /**
     * The list of stack trace items providing error location details.
     */

    private List<SysErrorTraceItem> trace;

    private LocalDateTime createdAt;

    private String request;

    /**
     * Gets the unique identifier of the system error.
     *
     * @return the error ID
     */
    public Integer getId() {
        return id;
    }

    /**
     * Sets the unique identifier of the system error.
     *
     * @param id the error ID to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * Gets the identifier of the user associated with this error.
     *
     * @return the user ID
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * Sets the identifier of the user associated with this error.
     *
     * @param userId the user ID to set
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * Gets the title or brief description of the error.
     *
     * @return the error title
     */
    public String getTitle() {
        return title;
    }

    /**
     * Sets the title or brief description of the error.
     *
     * @param title the error title to set
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Gets the detailed error message.
     *
     * @return the error message
     */
    public String getMessage() {
        return message;
    }

    /**
     * Sets the detailed error message.
     *
     * @param message the error message to set
     */
    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * Gets the error code identifier.
     *
     * @return the error code
     */
    public String getCode() {
        return code;
    }

    /**
     * Sets the error code identifier.
     *
     * @param code the error code to set
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * Gets the Pinia store state related to this error.
     *
     * @return the Pinia store state
     */
    public String getPinia() {
        return pinia;
    }

    /**
     * Sets the Pinia store identifier related to this error.
     *
     * @param pinia the Pinia store identifier to set
     */
    public void setPinia(String pinia) {
        this.pinia = pinia;
    }

    /**
     * Gets the type classification of the system error.
     *
     * @return the error type
     */
    public SysErrorType getType() {
        return type;
    }

    /**
     * Sets the type classification of the system error.
     *
     * @param type the error type to set
     */
    public void setType(SysErrorType type) {
        this.type = type;
    }

    /**
     * Gets the identifier of the calculation job associated with this error.
     *
     * @return the calculation job ID
     */
    public Integer getCalculationJobId() {
        return calculationJobId;
    }

    /**
     * Sets the identifier of the calculation job associated with this error.
     *
     * @param calculationJobId the calculation job ID to set
     */
    public void setCalculationJobId(Integer calculationJobId) {
        this.calculationJobId = calculationJobId;
    }

    /**
     * Gets the identifier of the bulk operation associated with this error.
     *
     * @return the bulk operation ID
     */
    public Integer getBulkOperationId() {
        return bulkOperationId;
    }

    /**
     * Sets the identifier of the bulk operation associated with this error.
     *
     * @param bulkOperationId the bulk operation ID to set
     */
    public void setBulkOperationId(Integer bulkOperationId) {
        this.bulkOperationId = bulkOperationId;
    }

    /**
     * Gets the list of stack trace items providing error location details.
     *
     * @return the list of trace items
     */
    public List<SysErrorTraceItem> getTrace() {
        return trace;
    }

    /**
     * Sets the list of stack trace items providing error location details.
     *
     * @param trace the list of trace items to set
     */
    public void setTrace(List<SysErrorTraceItem> trace) {
        this.trace = trace;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }
}
