use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Event {
pub sequence_no: i64,
pub stream: String,
pub event_type: String,
pub payload: serde_json::Value,
pub created_at: DateTime<Utc>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NewEvent {
pub event_type: String,
pub payload: serde_json::Value,
}
impl NewEvent {
pub fn new(event_type: impl Into<String>, payload: serde_json::Value) -> Self {
Self {
event_type: event_type.into(),
payload,
}
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConsumerGroupStatus {
pub consumer_group: String,
pub stream: String,
pub last_acked_seq: i64,
pub updated_at: DateTime<Utc>,
}