pub struct PostgresAccountRepository { /* private fields */ }Expand description
PostgreSQL implementation of AccountRepository
Manages accounts in the Belgian PCMN (Plan Comptable Minimum Normalisé). Inspired by Noalyss PostgreSQL schema and repository pattern.
Implementations§
Trait Implementations§
Source§impl AccountRepository for PostgresAccountRepository
impl AccountRepository for PostgresAccountRepository
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<Account, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<Account, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new account in the chart of accounts Read more
Source§fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find account by ID Read more
Source§fn find_by_code<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_code<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find account by code within an organization Read more
Source§fn find_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_organization<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all accounts for an organization Read more
Source§fn find_by_type<'life0, 'async_trait>(
&'life0 self,
account_type: AccountType,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_type<'life0, 'async_trait>(
&'life0 self,
account_type: AccountType,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find accounts by type within an organization Read more
Source§fn find_by_parent_code<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_code: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_parent_code<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_code: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find child accounts of a parent account Read more
Source§fn find_direct_use_accounts<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_direct_use_accounts<'life0, 'async_trait>(
&'life0 self,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find accounts that can be used directly in transactions Read more
Source§fn search_by_code_pattern<'life0, 'life1, 'async_trait>(
&'life0 self,
code_pattern: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_by_code_pattern<'life0, 'life1, 'async_trait>(
&'life0 self,
code_pattern: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search accounts by code pattern Read more
Source§fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<Account, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
account: &'life1 Account,
) -> Pin<Box<dyn Future<Output = Result<Account, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing account Read more
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete an account Read more
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
code: &'life1 str,
organization_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an account code exists within an organization Read more
Auto Trait Implementations§
impl Freeze for PostgresAccountRepository
impl !RefUnwindSafe for PostgresAccountRepository
impl Send for PostgresAccountRepository
impl Sync for PostgresAccountRepository
impl Unpin for PostgresAccountRepository
impl !UnwindSafe for PostgresAccountRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.