pub struct JournalEntryUseCases { /* private fields */ }Implementations§
Source§impl JournalEntryUseCases
impl JournalEntryUseCases
pub fn new(journal_entry_repo: Arc<dyn JournalEntryRepository>) -> Self
Sourcepub async fn create_manual_entry(
&self,
organization_id: Uuid,
building_id: Option<Uuid>,
journal_type: Option<String>,
entry_date: DateTime<Utc>,
description: Option<String>,
document_ref: Option<String>,
lines: Vec<(String, f64, f64, String)>,
) -> Result<JournalEntry, String>
pub async fn create_manual_entry( &self, organization_id: Uuid, building_id: Option<Uuid>, journal_type: Option<String>, entry_date: DateTime<Utc>, description: Option<String>, document_ref: Option<String>, lines: Vec<(String, f64, f64, String)>, ) -> Result<JournalEntry, String>
Create a manual journal entry with multiple lines
This follows the Noalyss approach where each journal entry can have multiple lines with debit and credit columns. The total debits must equal total credits.
§Arguments
organization_id- Organization IDbuilding_id- Optional building ID for building-specific entriesjournal_type- Type of journal (ACH, VEN, FIN, ODS)entry_date- Date of the accounting operationdescription- Description of the operationreference- Optional reference number (invoice, receipt, etc.)lines- Vector of journal entry lines with account_code, debit, credit, description
Sourcepub async fn list_entries(
&self,
organization_id: Uuid,
building_id: Option<Uuid>,
journal_type: Option<String>,
start_date: Option<DateTime<Utc>>,
end_date: Option<DateTime<Utc>>,
limit: i64,
offset: i64,
) -> Result<Vec<JournalEntry>, String>
pub async fn list_entries( &self, organization_id: Uuid, building_id: Option<Uuid>, journal_type: Option<String>, start_date: Option<DateTime<Utc>>, end_date: Option<DateTime<Utc>>, limit: i64, offset: i64, ) -> Result<Vec<JournalEntry>, String>
List journal entries for an organization
§Arguments
organization_id- Organization IDbuilding_id- Optional building ID filterjournal_type- Optional journal type filterstart_date- Optional start date filterend_date- Optional end date filterlimit- Maximum number of entries to returnoffset- Number of entries to skip
Sourcepub async fn get_entry_with_lines(
&self,
entry_id: Uuid,
organization_id: Uuid,
) -> Result<(JournalEntry, Vec<JournalEntryLine>), String>
pub async fn get_entry_with_lines( &self, entry_id: Uuid, organization_id: Uuid, ) -> Result<(JournalEntry, Vec<JournalEntryLine>), String>
Get a single journal entry with its lines
§Arguments
entry_id- Journal entry IDorganization_id- Organization ID for authorization
Sourcepub async fn delete_manual_entry(
&self,
entry_id: Uuid,
organization_id: Uuid,
) -> Result<(), String>
pub async fn delete_manual_entry( &self, entry_id: Uuid, organization_id: Uuid, ) -> Result<(), String>
Delete a manual journal entry
Only manual entries (not auto-generated from expenses/contributions) can be deleted.
§Arguments
entry_id- Journal entry IDorganization_id- Organization ID for authorization
Auto Trait Implementations§
impl Freeze for JournalEntryUseCases
impl !RefUnwindSafe for JournalEntryUseCases
impl Send for JournalEntryUseCases
impl Sync for JournalEntryUseCases
impl Unpin for JournalEntryUseCases
impl !UnwindSafe for JournalEntryUseCases
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.