1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct SubTransaction {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "transaction_id")]
pub transaction_id: String,
#[serde(rename = "amount")]
pub amount: i64,
#[serde(rename = "memo", skip_serializing_if = "Option::is_none")]
pub memo: Option<String>,
#[serde(rename = "payee_id", skip_serializing_if = "Option::is_none")]
pub payee_id: Option<String>,
#[serde(rename = "category_id", skip_serializing_if = "Option::is_none")]
pub category_id: Option<String>,
#[serde(rename = "transfer_account_id", skip_serializing_if = "Option::is_none")]
pub transfer_account_id: Option<String>,
#[serde(rename = "deleted")]
pub deleted: bool,
}
impl SubTransaction {
pub fn new(id: String, transaction_id: String, amount: i64, deleted: bool) -> SubTransaction {
SubTransaction {
id,
transaction_id,
amount,
memo: None,
payee_id: None,
category_id: None,
transfer_account_id: None,
deleted,
}
}
}