35 lines
653 B
Rust
35 lines
653 B
Rust
use crate::entities::Account;
|
|
use chrono::{DateTime, Utc};
|
|
|
|
pub struct Transaction {
|
|
id: i32,
|
|
account_id: i32,
|
|
amount: f64,
|
|
date: DateTime<Utc>,
|
|
description: String,
|
|
type_id: i32,
|
|
|
|
account: Account,
|
|
tr_type: TransactionType,
|
|
}
|
|
|
|
pub struct TransactionType {
|
|
id: i64,
|
|
description: String,
|
|
}
|
|
|
|
impl TransactionType {
|
|
pub fn new(id: i64, desc: String) -> Self {
|
|
TransactionType {
|
|
id: id,
|
|
description: desc,
|
|
}
|
|
}
|
|
pub fn get_id(&self) -> i64 {
|
|
return self.id;
|
|
}
|
|
pub fn get_description(&self) -> String {
|
|
return self.description.clone();
|
|
}
|
|
}
|