Add validation for service methods

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-08-22 14:08:41 +02:00
parent bc6cb16732
commit 7ce19f8b6d
9 changed files with 1089 additions and 154 deletions

View File

@@ -7,25 +7,25 @@ use crate::{models::ScriptType, time::Timestamp};
#[derive(Clone, Serialize, Deserialize)]
pub struct Job {
/// Job Id, this is given by the actor who created the job
id: u32,
pub id: u32,
/// Actor ID which created this job
caller_id: u32,
pub caller_id: u32,
/// Context in which the job is executed
context_id: u32,
script: String,
script_type: ScriptType,
pub context_id: u32,
pub script: String,
pub script_type: ScriptType,
/// Timeout in seconds for this job
timeout: u32,
pub timeout: u32,
/// Max amount of times to retry this job
retries: u8,
env_vars: HashMap<String, String>,
result: HashMap<String, String>,
prerequisites: Vec<String>,
pub retries: u8,
pub env_vars: HashMap<String, String>,
pub result: HashMap<String, String>,
pub prerequisites: Vec<String>,
/// Ids of jobs this job depends on, i.e. this job can't start until those have finished
depends: Vec<u32>,
created_at: Timestamp,
updated_at: Timestamp,
status: JobStatus,
pub depends: Vec<u32>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
pub status: JobStatus,
}
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug)]