going somewhere.
This commit is contained in:
1 parent
6294814f62
commit
494cdedfc6
9 files changed
+361
-127
No files matched your search
+31
-13
@@ -1,21 +1,39 @@
|
||||
use crate::db::_external_id::ExternalId;
|
||||
use rusqlite::{Result, Transaction};
|
||||
|
||||
use crate::db::_external_id::{AccountId, SecurityId};
|
||||
|
||||
pub struct SecurityEmitterCheque {
|
||||
drawer_user_id: ExternalId,
|
||||
security_id: ExternalId,
|
||||
cheque_number: u32,
|
||||
amount: u32,
|
||||
pub drawer_user_id: AccountId,
|
||||
pub security_id: SecurityId,
|
||||
pub payee_user_id: AccountId,
|
||||
pub cheque_number: u32,
|
||||
pub amount: u32,
|
||||
}
|
||||
|
||||
impl Cheque {
|
||||
pub fn is_valid(self: &Cheque) -> bool {
|
||||
return true;
|
||||
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 {
|
||||
drawer_user_id,
|
||||
security_id,
|
||||
payee_user_id,
|
||||
cheque_number: id_generator(),
|
||||
amount,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
pub fn cash_cheque(&self){
|
||||
|
||||
pub fn assert_valid(&self, tx: &Transaction) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
pub mod test {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_foo() {}
|
||||
}
|
||||
Reference in new issue
Block a user