Add basic models

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-08-20 14:04:08 +02:00
parent b769fa63f7
commit acf875ed33
10 changed files with 225 additions and 0 deletions

33
src/models/flow.rs Normal file
View 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,
}