#[derive(Debug, new, Clone)]
pub struct InventoryFilter {
    target: Vec<Filter>,
}

pub struct InventorySlice;

impl InventoryFilter {
    pub fn apply(&self, _inventory: &Inventory) -> InventorySlice {
        info!("Applying inventory filter {:?}", self.target);
        todo!("TODO apply inventory filter, refactor as a slice")
    }
}

use derive_new::new;
use log::info;

use super::{
    filter::Filter,
    hardware::{FirewallGroup, HostGroup, Location, SwitchGroup},
};

#[derive(Debug)]
pub struct Inventory {
    pub location: Location,
    pub switch: SwitchGroup,
    // Firewall is really just a host but with somewhat specialized hardware
    // I'm not entirely sure it belongs to its own category but it helps make things easier and
    // clearer for now so let's try it this way.
    pub firewall: FirewallGroup,
    pub worker_host: HostGroup,
    pub storage_host: HostGroup,
    pub control_plane_host: HostGroup,
}

impl Inventory {
    pub fn autoload() -> Self {
        Self {
            location: Location::test_building(),
            switch: SwitchGroup::new(),
            firewall: FirewallGroup::new(),
            worker_host: HostGroup::new(),
            storage_host: HostGroup::new(),
            control_plane_host: HostGroup::new(),
        }
    }
}
