use crate::event::context::stage_type::StageType;
use crate::StageId;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FlowContext {
pub flow_name: String,
pub flow_id: String,
pub stage_name: String,
pub stage_id: StageId,
pub stage_type: StageType,
}
impl FlowContext {
pub fn new(stage_name: impl Into<String>, stage_id: StageId) -> Self {
Self {
flow_name: "unknown".to_string(),
flow_id: "unknown".to_string(),
stage_name: stage_name.into(),
stage_id,
stage_type: StageType::Transform,
}
}
}
impl Default for FlowContext {
fn default() -> Self {
Self {
flow_name: "unknown".to_string(),
flow_id: "unknown".to_string(),
stage_name: "unknown".to_string(),
stage_id: StageId::default(),
stage_type: StageType::Transform,
}
}
}