33
src/models/flow.rs
Normal file
33
src/models/flow.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::time::Timestamp;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Flow {
|
||||
/// Job Id set tby the actor which created it
|
||||
id: u32,
|
||||
/// Actor Id who created this job
|
||||
caller_id: u32,
|
||||
/// The context in which this job is executed
|
||||
context_id: u32,
|
||||
/// List of jobs which make up the flow
|
||||
jobs: Vec<u32>,
|
||||
/// Environment variables, passed to every job when executed
|
||||
env_vars: HashMap<String, String>,
|
||||
/// The result of the flow
|
||||
result: HashMap<String, String>,
|
||||
created_at: Timestamp,
|
||||
updated_at: Timestamp,
|
||||
status: FlowStatus,
|
||||
}
|
||||
|
||||
/// The status of a flow
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub enum FlowStatus {
|
||||
Dispatched,
|
||||
Started,
|
||||
Error,
|
||||
Finished,
|
||||
}
|
Reference in New Issue
Block a user