use async_trait::async_trait;
use crate::domain::location::LocationId;
use crate::domain::location_file::LocationFile;
use crate::infra::error::InfraError;
#[async_trait]
pub trait LocationFileStore: Send + Sync {
async fn upsert(&self, file: &LocationFile) -> Result<(), InfraError>;
async fn get(
&self,
file_id: &str,
location_id: &LocationId,
) -> Result<Option<LocationFile>, InfraError>;
async fn list_by_file(&self, file_id: &str) -> Result<Vec<LocationFile>, InfraError>;
async fn list_by_location(
&self,
location_id: &LocationId,
) -> Result<Vec<LocationFile>, InfraError>;
async fn list_by_files(
&self,
file_ids: &[&str],
) -> Result<std::collections::HashMap<String, Vec<LocationFile>>, InfraError>;
async fn delete(&self, file_id: &str, location_id: &LocationId) -> Result<bool, InfraError>;
async fn count_by_location(&self, location_id: &LocationId) -> Result<usize, InfraError>;
}