//! [`UuidGenerator`] — production [`IdGenerator`] producing random v4 UUIDs.

use domain::ports::IdGenerator;
use uuid::Uuid;

/// Real id generator producing random (v4) UUIDs.
#[derive(Debug, Default, Clone, Copy)]
pub struct UuidGenerator;

impl UuidGenerator {
    /// Creates a new [`UuidGenerator`].
    #[must_use]
    pub const fn new() -> Self {
        Self
    }
}

impl IdGenerator for UuidGenerator {
    fn new_uuid(&self) -> Uuid {
        Uuid::new_v4()
    }
}
