use edgar_rs::{Cik, ClientBuilder};

#[tokio::main]
async fn main() -> edgar_rs::Result<()> {
    let client = ClientBuilder::new("edgar-rs-example/0.1.0 test@example.com").build()?;

    // Fetch all tickers and print the count
    let tickers = client.get_tickers().await?;
    println!("Total tickers: {}", tickers.len());

    // Look up Apple by CIK
    let apple_cik = Cik::new(320193);
    let submission = client.get_submission(apple_cik).await?;
    println!("Company: {} (CIK {})", submission.name, submission.cik);
    println!("Tickers: {:?}", submission.tickers);
    println!(
        "Recent filings: {}",
        submission.filings.recent.accession_number.len()
    );

    Ok(())
}
