//! Result of a domain availability check

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

use crate::types::check_status::CheckStatus;

pub mod constructors;

/// Result of a domain availability check
///
/// Contains all information about a domain check including status,
/// registrar information (if taken), and any error messages.
///
/// # Examples
///
/// ```
/// use lazydomain::types::CheckResult;
///
/// let result = CheckResult::available("example", "com");
/// assert_eq!(result.domain, "example");
/// ```
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CheckResult {
    /// The domain name checked
    pub domain: String,
    /// The TLD checked
    pub tld: String,
    /// The availability status
    pub status: CheckStatus,
    /// Optional registrar information (if taken)
    pub registrar: Option<String>,
    /// Optional expiry date (if taken)
    pub expiry_date: Option<DateTime<Utc>>,
    /// Optional error message (if error)
    pub error_message: Option<String>,
    /// Timestamp of the check
    pub checked_at: DateTime<Utc>,
}
