plaid/model/
employment_details.rs

1use serde::{Serialize, Deserialize};
2use super::Pay;
3///An object representing employment details found on a paystub.
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct EmploymentDetails {
6    ///An object representing a monetary amount.
7    #[serde(default, skip_serializing_if = "Option::is_none")]
8    pub annual_salary: Option<Pay>,
9    ///Date on which the employee was hired, in the YYYY-MM-DD format.
10    #[serde(default, skip_serializing_if = "Option::is_none")]
11    pub hire_date: Option<chrono::NaiveDate>,
12}
13impl std::fmt::Display for EmploymentDetails {
14    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15        write!(f, "{}", serde_json::to_string(self).unwrap())
16    }
17}