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

@@ -8,25 +8,25 @@ use crate::{
#[derive(Clone, Serialize, Deserialize)]
pub struct Message {
/// Unique ID for the message, set by the caller
id: u32,
pub id: u32,
/// Id of the actor who sent this message
caller_id: u32,
pub caller_id: u32,
/// Id of the context in which this message was sent
context_id: u32,
message: String,
message_type: ScriptType,
message_format_type: MessageFormatType,
pub context_id: u32,
pub message: String,
pub message_type: ScriptType,
pub message_format_type: MessageFormatType,
/// Seconds for the message to arrive at the destination
timeout: u32,
pub timeout: u32,
/// Seconds for the receiver to acknowledge receipt of the message
timeout_ack: u32,
pub timeout_ack: u32,
/// Seconds for the receiver to send us a reply
timeout_result: u32,
job: Vec<Job>,
logs: Vec<Log>,
created_at: Timestamp,
updated_at: Timestamp,
status: MessageStatus,
pub timeout_result: u32,
pub job: Vec<Job>,
pub logs: Vec<Log>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
pub status: MessageStatus,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -36,7 +36,7 @@ pub enum MessageType {
Mail,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub enum MessageStatus {
Dispatched,
Acknowledged,