40 lines
938 B
Rust
40 lines
938 B
Rust
use rusqlite::{Result, Transaction};
|
|
|
|
use crate::db::_external_id::{AccountId, SecurityId, UserId};
|
|
|
|
pub type Drawer = (UserId, AccountId, SecurityId);
|
|
pub type Payee = (UserId, SecurityId);
|
|
|
|
#[derive(Debug)]
|
|
pub struct SecurityEmitterCheque {
|
|
pub drawer_user_id: UserId,
|
|
pub drawer_account_id: AccountId,
|
|
pub security_id: SecurityId,
|
|
pub payee_user_id: UserId,
|
|
pub cheque_number: u32,
|
|
pub amount: u32,
|
|
}
|
|
|
|
impl SecurityEmitterCheque {
|
|
pub fn new(drawer: Drawer,
|
|
payee: Payee,
|
|
amount: u32,
|
|
cheque_number: u32) -> SecurityEmitterCheque {
|
|
SecurityEmitterCheque {
|
|
drawer_user_id: drawer.0,
|
|
drawer_account_id: drawer.1,
|
|
security_id: drawer.2,
|
|
payee_user_id: payee.0,
|
|
cheque_number,
|
|
amount,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[cfg(test)]
|
|
pub mod test {
|
|
use super::*;
|
|
|
|
#[test]
|
|
fn test_foo() {}
|
|
} |