修复退市生效日结算

This commit is contained in:
boris
2026-07-04 14:12:10 +08:00
parent 3e907d8e43
commit 14810708f0
3 changed files with 60 additions and 1 deletions
+5
View File
@@ -40,6 +40,11 @@ impl Instrument {
.is_some_and(|delisted_at| delisted_at < date)
}
pub fn is_delisted_on_or_before(&self, date: NaiveDate) -> bool {
self.delisted_at
.is_some_and(|delisted_at| delisted_at <= date)
}
pub fn is_active_on(&self, date: NaiveDate) -> bool {
self.listed_at.is_none_or(|listed_at| listed_at <= date)
&& !self.is_delisted_before(date)