use crate::domain::dtos::tenant::{Tenant, TenantMetaKey};
use async_trait::async_trait;
use mycelium_base::{
entities::{FetchManyResponseKind, FetchResponseKind},
utils::errors::MappedErrors,
};
use shaku::Interface;
use uuid::Uuid;
#[async_trait]
pub trait TenantFetching: Interface + Send + Sync {
async fn get_tenant_owned_by_me(
&self,
id: Uuid,
owners_ids: Vec<Uuid>,
) -> Result<FetchResponseKind<Tenant, String>, MappedErrors>;
async fn get_tenant_public_by_id(
&self,
id: Uuid,
) -> Result<FetchResponseKind<Tenant, String>, MappedErrors>;
async fn get_tenants_by_manager_account(
&self,
id: Uuid,
manager_ids: Vec<Uuid>,
) -> Result<FetchResponseKind<Tenant, String>, MappedErrors>;
async fn filter_tenants_as_manager(
&self,
name: Option<String>,
owner: Option<Uuid>,
metadata: Option<(TenantMetaKey, String)>,
tag: Option<(String, String)>,
page_size: Option<i32>,
skip: Option<i32>,
) -> Result<FetchManyResponseKind<Tenant>, MappedErrors>;
}