diff --git a/pallets/loans/docs/types.md b/pallets/loans/docs/types.md index ee5ef6bc33..3ae87a7ded 100644 --- a/pallets/loans/docs/types.md +++ b/pallets/loans/docs/types.md @@ -86,7 +86,8 @@ package valuation { enum ValuationMethod { DiscountedCashFlows: DiscountedCashFlows - OutstandingDebt + OutstandingDebt, + Cash } ValuationMethod *--> DiscountedCashFlows diff --git a/pallets/loans/src/entities/pricing/internal.rs b/pallets/loans/src/entities/pricing/internal.rs index af78ce7c09..f5e78c53fb 100644 --- a/pallets/loans/src/entities/pricing/internal.rs +++ b/pallets/loans/src/entities/pricing/internal.rs @@ -99,7 +99,7 @@ impl InternalActivePricing { origination_date, )?) } - ValuationMethod::OutstandingDebt => Ok(debt), + ValuationMethod::OutstandingDebt | ValuationMethod::Cash => Ok(debt), } } diff --git a/pallets/loans/src/types/valuation.rs b/pallets/loans/src/types/valuation.rs index b53ac6222c..63d2de67ec 100644 --- a/pallets/loans/src/types/valuation.rs +++ b/pallets/loans/src/types/valuation.rs @@ -106,6 +106,10 @@ pub enum ValuationMethod { DiscountedCashFlow(DiscountedCashFlow), /// Outstanding debt valuation OutstandingDebt, + /// Equal to OutstandingDebt but signals + /// that the given loan is i.e. an account + /// holding cash + Cash, } impl ValuationMethod @@ -115,7 +119,7 @@ where pub fn is_valid(&self) -> bool { match self { ValuationMethod::DiscountedCashFlow(dcf) => dcf.discount_rate.per_year() <= One::one(), - ValuationMethod::OutstandingDebt => true, + ValuationMethod::OutstandingDebt | ValuationMethod::Cash => true, } } }