mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
Merge branch 'feat/stockbit-movements' into fix/mcp-warnings
Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
commit
0aed926f4c
3 changed files with 19 additions and 2 deletions
|
|
@ -1867,10 +1867,18 @@ pub fn print_corporate_calendar(
|
||||||
range: &CalendarRange,
|
range: &CalendarRange,
|
||||||
actions: &[CorporateAction],
|
actions: &[CorporateAction],
|
||||||
) -> Result<(), IdxError> {
|
) -> Result<(), IdxError> {
|
||||||
|
// Offers still open are listed by the day they opened, which can be
|
||||||
|
// before `from`; the title says so rather than claim the range bounds
|
||||||
|
// every row.
|
||||||
|
let earlier = if actions.iter().any(|a| a.date < range.from) {
|
||||||
|
", with offers opened earlier and still open"
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
};
|
||||||
println!(
|
println!(
|
||||||
"{}",
|
"{}",
|
||||||
format!(
|
format!(
|
||||||
"Corporate actions from {} to {} ({})",
|
"Corporate actions from {} to {}{earlier} ({})",
|
||||||
range.from,
|
range.from,
|
||||||
range.to,
|
range.to,
|
||||||
actions.len()
|
actions.len()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
exit: 0
|
exit: 0
|
||||||
--- stdout
|
--- stdout
|
||||||
Corporate actions from 2026-11-03 to 2026-11-12 (17)
|
Corporate actions from 2026-11-03 to 2026-11-12, with offers opened earlier and still open (17)
|
||||||
┌────────────┬────────┬──────────────┬────────────┬──────────────────────────────────────────────────────────────────────────┐
|
┌────────────┬────────┬──────────────┬────────────┬──────────────────────────────────────────────────────────────────────────┐
|
||||||
│ DATE ┆ SYMBOL ┆ KIND ┆ EX ┆ DETAIL │
|
│ DATE ┆ SYMBOL ┆ KIND ┆ EX ┆ DETAIL │
|
||||||
╞════════════╪════════╪══════════════╪════════════╪══════════════════════════════════════════════════════════════════════════╡
|
╞════════════╪════════╪══════════════╪════════════╪══════════════════════════════════════════════════════════════════════════╡
|
||||||
|
|
|
||||||
|
|
@ -540,6 +540,15 @@ mod tests {
|
||||||
] {
|
] {
|
||||||
assert!(is_read_path(path), "{path}");
|
assert!(is_read_path(path), "{path}");
|
||||||
}
|
}
|
||||||
|
// Paths another module builds come from its own builder, so the
|
||||||
|
// allowlist cannot drift from them.
|
||||||
|
let query = MovementQuery::default();
|
||||||
|
for path in [
|
||||||
|
movement::request_path(&query, None, 1),
|
||||||
|
movement::request_path(&query, Some("BBCA"), 3),
|
||||||
|
] {
|
||||||
|
assert!(is_read_path(&path), "{path}");
|
||||||
|
}
|
||||||
for path in [
|
for path in [
|
||||||
"/order/buy",
|
"/order/buy",
|
||||||
"/login/refresh",
|
"/login/refresh",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue