Add account type

This commit is contained in:
2025-04-14 23:25:45 +02:00
parent 342af2c443
commit 5a51dee8b0
16 changed files with 176 additions and 6 deletions

View File

@ -1,5 +1,7 @@
//! # Project constants
use crate::models::accounts::AccountType;
/// Length of generated tokens
pub const TOKENS_LEN: usize = 50;
@ -24,3 +26,30 @@ pub const MAX_UPLOAD_FILE_SIZE: usize = 15 * 1024 * 1024;
/// Minimum elapsed time before a file can be deleted by garbage collector (2 hours)
pub const MIN_FILE_LIFETIME: u64 = 3600 * 2;
/// Description of an account type
#[derive(serde::Serialize, Debug)]
pub struct AccountTypeDesc {
label: &'static str,
code: AccountType,
icon: &'static str,
}
/// Enumeration of accounts types
pub const ACCOUNT_TYPES: [AccountTypeDesc; 3] = [
AccountTypeDesc {
label: "Cash",
code: AccountType::Cash,
icon: include_str!("../assets/cash.svg"),
},
AccountTypeDesc {
label: "Bank",
code: AccountType::Bank,
icon: include_str!("../assets/credit-card.svg"),
},
AccountTypeDesc {
label: "Saving",
code: AccountType::Saving,
icon: include_str!("../assets/saving.svg"),
},
];