WP-10: contract and failing tests for OS and package inventory
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@ -3,6 +3,7 @@ use async_trait::async_trait;
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::auth::{AccessClaims, AuthEvent, RefreshToken};
|
||||
use crate::host::{Inventory, OsInfo, Package};
|
||||
use crate::jobs::{JobKind, JobRun, JobStatus};
|
||||
use crate::settings::SmtpSettings;
|
||||
use crate::user::{User, UserUpdate};
|
||||
@ -76,3 +77,16 @@ pub trait JobRunRepository: Send + Sync {
|
||||
async fn find_running(&self, kind: JobKind) -> Result<Option<JobRun>, DomainError>;
|
||||
async fn last_finished(&self, kind: JobKind) -> Result<Option<JobRun>, DomainError>;
|
||||
}
|
||||
|
||||
/// Reads the state of the Debian host.
|
||||
#[async_trait]
|
||||
pub trait HostInspector: Send + Sync {
|
||||
async fn os_info(&self) -> Result<OsInfo, DomainError>;
|
||||
async fn packages(&self) -> Result<Vec<Package>, DomainError>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait InventoryRepository: Send + Sync {
|
||||
async fn save(&self, inventory: &Inventory) -> Result<(), DomainError>;
|
||||
async fn load(&self) -> Result<Option<Inventory>, DomainError>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user