como/crates/como_core/src/projects/mod.rs
kjuulh 6e16fc6b2b
feat: move project to crates
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-10-21 11:14:58 +02:00

25 lines
657 B
Rust

use std::sync::Arc;
use async_trait::async_trait;
use como_domain::{
projects::{mutation::CreateProjectMutation, queries::GetProjectQuery, ProjectDto},
Context,
};
pub type DynProjectService = Arc<dyn ProjectService + Send + Sync>;
#[async_trait]
pub trait ProjectService {
async fn get_project(
&self,
context: &Context,
query: GetProjectQuery,
) -> anyhow::Result<ProjectDto>;
async fn get_projects(&self, context: &Context) -> anyhow::Result<Vec<ProjectDto>>;
async fn create_project(
&self,
context: &Context,
name: CreateProjectMutation,
) -> anyhow::Result<ProjectDto>;
}