package com.emonster.taroaichat.service.dto.sse;

import java.time.Instant;

/**
 * Base class for all SSE events.
 */
public class SseEvent {
    
    private String sessionId;
    private SseEventType type;
    private Instant timestamp;
    private Object data;

    public SseEvent() {
        this.timestamp = Instant.now();
    }

    public SseEvent(String sessionId, SseEventType type, Object data) {
        this();
        this.sessionId = sessionId;
        this.type = type;
        this.data = data;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public SseEventType getType() {
        return type;
    }

    public void setType(SseEventType type) {
        this.type = type;
    }

    public Instant getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Instant timestamp) {
        this.timestamp = timestamp;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}