From aedd3c2efeb068209bb98bc35765bd86e3a55d76 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 12 Dec 2024 11:43:23 +0100 Subject: [PATCH] chore: create credit facility accounts --- Cargo.lock | 126 +++++++++--------- .../ledger/credit_facility_accounts.rs | 27 ++++ lana/app/src/credit_facility/ledger/mod.rs | 85 +++++++++++- lana/app/src/credit_facility/mod.rs | 16 ++- lana/app/src/ledger/credit_facility.rs | 26 +--- 5 files changed, 183 insertions(+), 97 deletions(-) create mode 100644 lana/app/src/credit_facility/ledger/credit_facility_accounts.rs diff --git a/Cargo.lock b/Cargo.lock index 4f327a4612..17c822bdf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,7 +254,7 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.87", + "syn 2.0.90", "thiserror", ] @@ -301,7 +301,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -312,7 +312,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -462,7 +462,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -581,7 +581,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -672,7 +672,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -684,7 +684,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -712,7 +712,7 @@ dependencies = [ [[package]] name = "cala-cel-interpreter" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "cala-cel-parser 0.3.3-dev", "chrono", @@ -737,7 +737,7 @@ dependencies = [ [[package]] name = "cala-cel-parser" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "lalrpop", "lalrpop-util", @@ -746,7 +746,7 @@ dependencies = [ [[package]] name = "cala-ledger" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "cached 0.51.4", "cala-cel-interpreter 0.3.3-dev", @@ -796,7 +796,7 @@ dependencies = [ [[package]] name = "cala-ledger-core-types" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "cala-cel-interpreter 0.3.3-dev", "chrono", @@ -813,7 +813,7 @@ dependencies = [ [[package]] name = "cala-tracing" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "anyhow", "axum-extra", @@ -917,7 +917,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1144,7 +1144,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1155,7 +1155,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1253,7 +1253,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1263,7 +1263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1307,7 +1307,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1384,7 +1384,7 @@ dependencies = [ [[package]] name = "es-entity" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "async-graphql", "async-trait", @@ -1403,7 +1403,7 @@ dependencies = [ [[package]] name = "es-entity-macros" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "convert_case", "darling", @@ -1411,7 +1411,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1573,7 +1573,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2250,7 +2250,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3118,7 +3118,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3204,7 +3204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3242,7 +3242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", - "heck 0.5.0", + "heck 0.4.1", "itertools 0.13.0", "log", "multimap", @@ -3254,7 +3254,7 @@ dependencies = [ "pulldown-cmark", "pulldown-cmark-to-cmark", "regex", - "syn 2.0.87", + "syn 2.0.90", "tempfile", ] @@ -3268,7 +3268,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3301,7 +3301,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a669d5acbe719010c6f62a64e6d7d88fdedc1fe46e419747949ecb6312e9b14" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "prost", "prost-build", "prost-types", @@ -3675,7 +3675,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4010,7 +4010,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4074,7 +4074,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4113,7 +4113,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "sim-time" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "chrono", "serde", @@ -4364,7 +4364,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4387,7 +4387,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.87", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -4571,7 +4571,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4593,9 +4593,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -4625,7 +4625,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4705,7 +4705,7 @@ checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4787,9 +4787,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -4810,7 +4810,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4933,7 +4933,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5015,9 +5015,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -5027,20 +5027,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -5089,9 +5089,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -5099,9 +5099,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -5194,7 +5194,7 @@ checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5403,7 +5403,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -5437,7 +5437,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5784,7 +5784,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -5832,7 +5832,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5852,7 +5852,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -5881,5 +5881,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] diff --git a/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs b/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs new file mode 100644 index 0000000000..a3d261a33f --- /dev/null +++ b/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs @@ -0,0 +1,27 @@ +use serde::{Deserialize, Serialize}; + +use cala_ledger::AccountId as LedgerAccountId; + +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub struct CreditFacilityAccountIds { + pub facility_account_id: LedgerAccountId, + pub disbursed_receivable_account_id: LedgerAccountId, + pub collateral_account_id: LedgerAccountId, + pub interest_receivable_account_id: LedgerAccountId, + pub interest_account_id: LedgerAccountId, + pub fee_income_account_id: LedgerAccountId, +} + +impl CreditFacilityAccountIds { + #[allow(clippy::new_without_default)] + pub fn new() -> Self { + Self { + facility_account_id: LedgerAccountId::new(), + disbursed_receivable_account_id: LedgerAccountId::new(), + collateral_account_id: LedgerAccountId::new(), + interest_receivable_account_id: LedgerAccountId::new(), + interest_account_id: LedgerAccountId::new(), + fee_income_account_id: LedgerAccountId::new(), + } + } +} diff --git a/lana/app/src/credit_facility/ledger/mod.rs b/lana/app/src/credit_facility/ledger/mod.rs index 4deaf4d400..4b975cf9c5 100644 --- a/lana/app/src/credit_facility/ledger/mod.rs +++ b/lana/app/src/credit_facility/ledger/mod.rs @@ -1,21 +1,100 @@ +mod credit_facility_accounts; pub mod error; // mod templates; -use cala_ledger::{CalaLedger, JournalId}; +use cala_ledger::{account::NewAccount, CalaLedger, JournalId}; +use crate::primitives::CreditFacilityId; + +pub use credit_facility_accounts::*; use error::*; #[derive(Clone)] pub struct CreditLedger { - _cala: CalaLedger, + cala: CalaLedger, _journal_id: JournalId, } impl CreditLedger { pub async fn init(cala: &CalaLedger, journal_id: JournalId) -> Result { Ok(Self { - _cala: cala.clone(), + cala: cala.clone(), _journal_id: journal_id, }) } + + pub async fn create_accounts_for_credit_facility( + &self, + op: es_entity::DbOp<'_>, + credit_facility_id: CreditFacilityId, + CreditFacilityAccountIds { + facility_account_id, + disbursed_receivable_account_id, + collateral_account_id, + interest_receivable_account_id, + interest_account_id, + fee_income_account_id, + }: CreditFacilityAccountIds, + ) -> Result<(), CreditLedgerError> { + let mut op = self.cala.ledger_operation_from_db_op(op); + let new_accounts = vec![ + NewAccount::builder() + .id(collateral_account_id) + .name("Credit Facility Collateral Account") + .code(format!("CREDIT_FACILITY.COLLATERAL.{}", credit_facility_id)) + .build() + .expect("new account"), + NewAccount::builder() + .id(facility_account_id) + .name("Off-Balance-Sheet Facility Account for Credit Facility") + .code(format!( + "CREDIT_FACILITY.OBS_FACILITY.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(disbursed_receivable_account_id) + .name("Disbursed Receivable Account for Credit Facility") + .code(format!( + "CREDIT_FACILITY.DISBURSED_RECEIVABLE.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(interest_receivable_account_id) + .name("Interest Receivable Account for Credit Facility") + .code(format!( + "CREDIT_FACILITY.INTEREST_RECEIVABLE.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(interest_account_id) + .name("Interest Income for Credit Facility") + .code(format!( + "CREDIT_FACILITY.INTEREST_INCOME.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(fee_income_account_id) + .name("Fee Income for Credit Facility") + .code(format!("CREDIT_FACILITY.FEE_INCOME.{}", credit_facility_id)) + .build() + .expect("new account"), + ]; + + self.cala + .accounts() + .create_all_in_op(&mut op, new_accounts) + .await?; + + op.commit().await?; + + Ok(()) + } } diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index d2f5b0d4a0..b59fc9c301 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -5,7 +5,7 @@ pub mod error; mod history; mod interest_accrual; mod jobs; -mod ledger; +pub mod ledger; mod processes; mod publisher; mod repo; @@ -59,7 +59,7 @@ pub struct CreditFacilities { disbursal_repo: DisbursalRepo, governance: Governance, gql_ledger: Ledger, - _ledger: CreditLedger, + ledger: CreditLedger, price: Price, config: CreditFacilityConfig, approve_disbursal: ApproveDisbursal, @@ -158,7 +158,7 @@ impl CreditFacilities { disbursal_repo, governance: governance.clone(), gql_ledger: gql_ledger.clone(), - _ledger: ledger, + ledger, price: price.clone(), config, approve_disbursal, @@ -223,12 +223,14 @@ impl CreditFacilities { .credit_facility_repo .create_in_op(&mut db, new_credit_facility) .await?; - self.gql_ledger - .create_accounts_for_credit_facility(credit_facility.id, credit_facility.account_ids) + self.ledger + .create_accounts_for_credit_facility( + db, + credit_facility.id, + credit_facility.account_ids, + ) .await?; - db.commit().await?; - Ok(credit_facility) } diff --git a/lana/app/src/ledger/credit_facility.rs b/lana/app/src/ledger/credit_facility.rs index 83b779112e..3d3b068d5a 100644 --- a/lana/app/src/ledger/credit_facility.rs +++ b/lana/app/src/ledger/credit_facility.rs @@ -2,35 +2,13 @@ use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use crate::{ - primitives::{CollateralAction, LedgerAccountId, LedgerTxId, Satoshis, UsdCents}, + primitives::{CollateralAction, LedgerTxId, Satoshis, UsdCents}, terms::InterestPeriod, }; use super::{cala::graphql::*, error::*, CustomerLedgerAccountIds}; -#[derive(Debug, Copy, Clone, Serialize, Deserialize)] -pub struct CreditFacilityAccountIds { - pub facility_account_id: LedgerAccountId, - pub disbursed_receivable_account_id: LedgerAccountId, - pub collateral_account_id: LedgerAccountId, - pub interest_receivable_account_id: LedgerAccountId, - pub interest_account_id: LedgerAccountId, - pub fee_income_account_id: LedgerAccountId, -} - -impl CreditFacilityAccountIds { - #[allow(clippy::new_without_default)] - pub fn new() -> Self { - Self { - facility_account_id: LedgerAccountId::new(), - disbursed_receivable_account_id: LedgerAccountId::new(), - collateral_account_id: LedgerAccountId::new(), - interest_receivable_account_id: LedgerAccountId::new(), - interest_account_id: LedgerAccountId::new(), - fee_income_account_id: LedgerAccountId::new(), - } - } -} +pub use crate::credit_facility::ledger::CreditFacilityAccountIds; #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub struct CreditFacilityLedgerBalance {