going somewhere.
This commit is contained in:
1 parent
494cdedfc6
commit
64e9be8b5a
12 files changed
+203
-76
No files matched your search
+13
-16
@@ -1,36 +1,33 @@
|
||||
use rusqlite::{Result, Transaction};
|
||||
|
||||
use crate::db::_external_id::{AccountId, SecurityId};
|
||||
use crate::db::_external_id::{AccountId, SecurityId, UserId};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SecurityEmitterCheque {
|
||||
pub drawer_user_id: AccountId,
|
||||
pub drawer_user_id: UserId,
|
||||
pub security_id: SecurityId,
|
||||
pub payee_user_id: AccountId,
|
||||
pub payee_user_id: UserId,
|
||||
pub cheque_number: u32,
|
||||
pub amount: u32,
|
||||
}
|
||||
|
||||
impl SecurityEmitterCheque {
|
||||
fn new_safe(tx: &Transaction,
|
||||
drawer_user_id: AccountId,
|
||||
security_id: SecurityId,
|
||||
payee_user_id: AccountId,
|
||||
amount: u32,
|
||||
id_generator: fn() -> u32) -> Result<SecurityEmitterCheque> {
|
||||
Ok(SecurityEmitterCheque {
|
||||
pub fn new(drawer_user_id: UserId,
|
||||
security_id: SecurityId,
|
||||
payee_user_id: UserId,
|
||||
amount: u32,
|
||||
cheque_number: u32) -> SecurityEmitterCheque {
|
||||
SecurityEmitterCheque {
|
||||
drawer_user_id,
|
||||
security_id,
|
||||
payee_user_id,
|
||||
cheque_number: id_generator(),
|
||||
cheque_number,
|
||||
amount,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn assert_valid(&self, tx: &Transaction) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test {
|
||||
use super::*;
|
||||
|
||||
|
||||
Reference in new issue
Block a user