change computer.
This commit is contained in:
1 parent
fe32c526eb
commit
358fb19076
10 files changed
+96
-12
No files matched your search
@@ -1,9 +1,10 @@
|
||||
use rusqlite::Connection;
|
||||
use crate::db::accounts::{Account, AccountType, get_checking_accounts_for_sec_id, list_user_accounts};
|
||||
use crate::db::external_id::{Id, SecurityId, UserId};
|
||||
use crate::db::external_id::{AccountId, Id, SecurityId, UserId};
|
||||
use crate::util::{CustomResult, Error};
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use crate::db::accounts;
|
||||
use crate::db::securities::Security;
|
||||
use crate::services::_securities::SecurityDTO;
|
||||
|
||||
@@ -59,6 +60,10 @@ impl AccountService<'_> {
|
||||
pub fn get_checking_accounts_for_security(& self, sec_id: & SecurityId) -> CustomResult<Vec<AccountDTO>>{
|
||||
let ret = get_checking_accounts_for_sec_id(self.conn, sec_id)?;
|
||||
Ok(ret.iter().map(AccountDTO::from_entity).collect())
|
||||
}
|
||||
|
||||
pub fn get_account_by_id(&self, account_id: &AccountId, user_id: &UserId) -> CustomResult<AccountDTO> {
|
||||
let ret = &accounts::get_account_by_id(self.conn, account_id)?;
|
||||
Ok(AccountDTO::from_entity(ret))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user