1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde::{Deserialize, Serialize};
use std::fmt;

/// Represents a Split, which is basically a portion of a transaction
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct QifSplit<'a> {
    pub category: &'a str,
    pub memo: &'a str,
    pub amount: f64,
    pub number_of_the_check: &'a str,
}

impl<'a> fmt::Display for QifSplit<'a> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{} {} {}", self.amount, self.memo, self.category)
    }
}