1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use serde::{Deserialize, Serialize};

#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
pub struct JobParameters {
    #[serde(rename = "slot-no")]
    pub slot_no: Option<u64>,
    pub tag: Option<String>,
}

impl JobParameters {
    pub fn daily() -> Self {
        Self {
            slot_no: None,
            tag: Some("daily".to_string()),
        }
    }

    pub fn fund<S: Into<String>>(fund: S) -> Self {
        Self {
            slot_no: None,
            tag: Some(fund.into()),
        }
    }
}