use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AccountType {
#[serde(rename = "checking")]
Checking,
#[serde(rename = "savings")]
Savings,
#[serde(rename = "cash")]
Cash,
#[serde(rename = "creditCard")]
CreditCard,
#[serde(rename = "lineOfCredit")]
LineOfCredit,
#[serde(rename = "otherAsset")]
OtherAsset,
#[serde(rename = "otherLiability")]
OtherLiability,
#[serde(rename = "mortgage")]
Mortgage,
#[serde(rename = "autoLoan")]
AutoLoan,
#[serde(rename = "studentLoan")]
StudentLoan,
#[serde(rename = "personalLoan")]
PersonalLoan,
#[serde(rename = "medicalDebt")]
MedicalDebt,
#[serde(rename = "otherDebt")]
OtherDebt,
}
impl std::fmt::Display for AccountType {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Checking => write!(f, "checking"),
Self::Savings => write!(f, "savings"),
Self::Cash => write!(f, "cash"),
Self::CreditCard => write!(f, "creditCard"),
Self::LineOfCredit => write!(f, "lineOfCredit"),
Self::OtherAsset => write!(f, "otherAsset"),
Self::OtherLiability => write!(f, "otherLiability"),
Self::Mortgage => write!(f, "mortgage"),
Self::AutoLoan => write!(f, "autoLoan"),
Self::StudentLoan => write!(f, "studentLoan"),
Self::PersonalLoan => write!(f, "personalLoan"),
Self::MedicalDebt => write!(f, "medicalDebt"),
Self::OtherDebt => write!(f, "otherDebt"),
}
}
}
impl Default for AccountType {
fn default() -> AccountType {
Self::Checking
}
}