Skip to content

Commit

Permalink
fix: template param in deposit & disbursal templates (#1220)
Browse files Browse the repository at this point in the history
* fix: param name in deposit & disbursal templates

* refactor: rename template param to 'credit_omnibus_account'
  • Loading branch information
vindard committed Jan 13, 2025
1 parent 0c7ac5f commit e70a924
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lana/app/src/credit_facility/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl CreditLedger {
templates::APPROVE_CREDIT_FACILITY_CODE,
templates::ApproveCreditFacilityParams {
journal_id: self.journal_id,
credit_omnibus_account_id: self.credit_omnibus_account,
credit_omnibus_account: self.credit_omnibus_account,
credit_facility_account: credit_facility_account_ids.facility_account_id,
facility_disbursed_receivable_account: credit_facility_account_ids
.disbursed_receivable_account_id,
Expand Down Expand Up @@ -436,7 +436,7 @@ impl CreditLedger {
templates::CREDIT_FACILITY_DISBURSAL_CODE,
templates::CreditFacilityDisbursalParams {
journal_id: self.journal_id,
credit_omnibus_account_id: self.credit_omnibus_account,
credit_omnibus_account: self.credit_omnibus_account,
credit_facility_account: credit_facility_account_ids.facility_account_id,
facility_disbursed_receivable_account: credit_facility_account_ids
.disbursed_receivable_account_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const APPROVE_CREDIT_FACILITY_CODE: &str = "APPROVE_CREDIT_FACILITY";
#[derive(Debug)]
pub struct ApproveCreditFacilityParams {
pub journal_id: JournalId,
pub credit_omnibus_account_id: AccountId,
pub credit_omnibus_account: AccountId,
pub credit_facility_account: AccountId,
pub facility_disbursed_receivable_account: AccountId,
pub facility_fee_income_account: AccountId,
Expand Down Expand Up @@ -90,7 +90,7 @@ impl From<ApproveCreditFacilityParams> for Params {
fn from(
ApproveCreditFacilityParams {
journal_id,
credit_omnibus_account_id,
credit_omnibus_account,
credit_facility_account,
facility_disbursed_receivable_account,
facility_fee_income_account,
Expand All @@ -104,7 +104,7 @@ impl From<ApproveCreditFacilityParams> for Params {
let mut params = Self::default();
params.insert("journal_id", journal_id);
params.insert("credit_facility_account", credit_facility_account);
params.insert("credit_omnibus_account_id", credit_omnibus_account_id);
params.insert("credit_omnibus_account", credit_omnibus_account);
params.insert(
"facility_disbursed_receivable_account",
facility_disbursed_receivable_account,
Expand Down Expand Up @@ -144,7 +144,7 @@ impl ApproveCreditFacility {
.build()
.expect("Couldn't build entry"),
NewTxTemplateEntry::builder()
.account_id("params.credit_omnibus_account_id")
.account_id("params.credit_omnibus_account")
.units("params.facility_amount")
.currency("params.currency")
.entry_type("'APPROVE_CREDIT_FACILITY_CR'")
Expand All @@ -153,7 +153,7 @@ impl ApproveCreditFacility {
.build()
.expect("Couldn't build entry"),
NewTxTemplateEntry::builder()
.account_id("params.credit_omnibus_account_id")
.account_id("params.credit_omnibus_account")
.units("params.structuring_fee_amount")
.currency("params.currency")
.entry_type("'APPROVE_CREDIT_FACILITY_DISBURSEMENT_DRAWDOWN_DR'")
Expand Down
8 changes: 4 additions & 4 deletions lana/app/src/credit_facility/ledger/templates/disburse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub const CREDIT_FACILITY_DISBURSAL_CODE: &str = "CREDIT_FACILITY_DISBURSAL";
#[derive(Debug)]
pub struct CreditFacilityDisbursalParams {
pub journal_id: JournalId,
pub credit_omnibus_account_id: AccountId,
pub credit_omnibus_account: AccountId,
pub credit_facility_account: AccountId,
pub facility_disbursed_receivable_account: AccountId,
pub checking_account: AccountId,
Expand Down Expand Up @@ -78,12 +78,12 @@ impl From<CreditFacilityDisbursalParams> for Params {
checking_account,
disbursed_amount,
external_id,
credit_omnibus_account_id,
credit_omnibus_account,
}: CreditFacilityDisbursalParams,
) -> Self {
let mut params = Self::default();
params.insert("journal_id", journal_id);
params.insert("credit_omnibus_account_id", credit_omnibus_account_id);
params.insert("credit_omnibus_account", credit_omnibus_account);
params.insert("facility_account", credit_facility_account);
params.insert(
"facility_disbursed_receivable_account",
Expand Down Expand Up @@ -112,7 +112,7 @@ impl CreditFacilityDisbursal {

let entries = vec![
NewTxTemplateEntry::builder()
.account_id("params.credit_omnibus_account_id")
.account_id("params.credit_omnibus_account")
.units("params.disbursed_amount")
.currency("'USD'")
.entry_type("'CREDIT_FACILITY_DISBURSAL_DRAWDOWN_DR'")
Expand Down

0 comments on commit e70a924

Please sign in to comment.