@jpgilldev / steid

604 BRaw
1use super::RepositoryResult;
2use crate::domain::{OrgId, OrgName, Organization};
3
4/// Persistence for [`Organization`].
5pub trait OrgRepository: Send + Sync {
6 fn find_by_id(
7 &self,
8 id: &OrgId,
9 ) -> impl Future<Output = RepositoryResult<Option<Organization>>> + Send;
10
11 /// Looks an organisation up by handle — the `{owner}` segment of a URL.
12 fn find_by_name(
13 &self,
14 name: &OrgName,
15 ) -> impl Future<Output = RepositoryResult<Option<Organization>>> + Send;
16
17 fn save(&self, org: &Organization) -> impl Future<Output = RepositoryResult<()>> + Send;
18}