chronon_core/models/
script.rs1use chrono::{DateTime, Utc};
4use serde::{Deserialize, Serialize};
5use serde_json::Value;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Script {
13 pub script_id: String,
15
16 pub script_name: String,
18
19 pub signature_json: Value,
21
22 pub signature_hash: String,
24
25 pub created_at: DateTime<Utc>,
27}
28
29impl Script {
30 pub fn new(
32 script_name: impl Into<String>,
33 signature_json: Value,
34 signature_hash: String,
35 ) -> Self {
36 Self {
37 script_id: uuid::Uuid::new_v4().to_string(),
38 script_name: script_name.into(),
39 signature_json,
40 signature_hash,
41 created_at: Utc::now(),
42 }
43 }
44}