Skip to content

Commit

Permalink
Merge branch 'main' of github.com:GaloyMoney/cala into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
git committed Feb 7, 2025
2 parents 86f5adc + 82d084c commit 0a4192c
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion cala-ledger/src/entry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ use sqlx::PgPool;

#[cfg(feature = "import")]
use crate::primitives::DataSourceId;
use crate::{ledger_operation::*, outbox::*, primitives::DataSource};
use crate::{
ledger_operation::*,
outbox::*,
primitives::{AccountId, DataSource},
};

pub use entity::*;
use error::*;
pub use repo::entry_cursor::EntriesByCreatedAtCursor;
use repo::*;

#[derive(Clone)]
Expand All @@ -28,6 +33,17 @@ impl Entries {
}
}

pub async fn list_for_account_id(
&self,
account_id: AccountId,
query: es_entity::PaginatedQueryArgs<EntriesByCreatedAtCursor>,
direction: es_entity::ListDirection,
) -> Result<es_entity::PaginatedQueryRet<Entry, EntriesByCreatedAtCursor>, EntryError> {
self.repo
.list_for_account_id_by_created_at(account_id, query, direction)
.await
}

pub(crate) async fn create_all_in_op(
&self,
db: &mut LedgerOperation<'_>,
Expand Down
2 changes: 1 addition & 1 deletion cala-ledger/src/entry/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use super::{entity::*, error::*};
entity = "Entry",
err = "EntryError",
columns(
account_id(ty = "AccountId", list_for, update(persist = false)),
journal_id(ty = "JournalId", update(persist = false)),
account_id(ty = "AccountId", update(persist = false)),
transaction_id(ty = "TransactionId", update(persist = false)),
data_source_id(
ty = "DataSourceId",
Expand Down
4 changes: 4 additions & 0 deletions cala-ledger/src/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ impl CalaLedger {
&self.balances
}

pub fn entries(&self) -> &Entries {
&self.entries
}

pub fn transactions(&self) -> &Transactions {
&self.transactions
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0a4192c

Please sign in to comment.