1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Simple deterministic cash flow (e.g., principal redemption, fee).
use crateCashFlow;
use crateDate;
/// A simple deterministic cash flow with a fixed date and amount.
///
/// Typically used for principal bullet redemptions, initial disbursements, or upfront fees.
///
/// # Examples
/// ```
/// use quantlib_rs::cashflows::simple::SimpleCashFlow;
/// use quantlib_rs::cashflows::traits::CashFlow;
/// use quantlib_rs::time::date::{Date, Month};
///
/// let payment_date = Date::from_ymd(2034, Month::May, 15).unwrap();
/// let principal = SimpleCashFlow::new(100.0, payment_date);
///
/// assert_eq!(principal.amount(), 100.0);
/// assert_eq!(principal.date(), payment_date);
/// assert!(!principal.has_occurred(Date::from_ymd(2026, Month::September, 3).unwrap()));
/// ```