use crate::{
ad::scalar::Scalar, instruments::cashflows::{cashflow::Cashflow, payoffops::PayoffOps}, time::date::Date,
utils::errors::Result,
};
pub trait LinearCoupon<T>: Cashflow<T>
where
T: Scalar,
{
fn accrued_amount(&self, start_date: Date, end_date: Date) -> Result<T>;
fn accrual_start_date(&self) -> Date;
fn accrual_end_date(&self) -> Date;
fn notional(&self) -> f64;
}
pub trait NonLinearCoupon<T> {
fn payoff_description(&self) -> PayoffOps;
fn accrued_amount(&self, start_date: Date, end_date: Date) -> Result<T>;
fn accrual_start_date(&self) -> Date;
fn accrual_end_date(&self) -> Date;
fn notional(&self) -> f64;
fn payment_date(&self) -> Date;
}