feat: with create project

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-05-28 16:25:25 +02:00
parent c81a988061
commit 6dc0c24443
8 changed files with 92 additions and 40 deletions

View File

@@ -1,9 +1,9 @@
use std::sync::Arc;
use async_trait::async_trait;
use como_domain::projects::{
queries::{GetProjectQuery, GetProjectsQuery},
ProjectDto,
use como_domain::{
projects::{mutation::CreateProjectMutation, queries::GetProjectQuery, ProjectDto},
users::User,
};
pub type DynProjectService = Arc<dyn ProjectService + Send + Sync>;
@@ -11,5 +11,10 @@ pub type DynProjectService = Arc<dyn ProjectService + Send + Sync>;
#[async_trait]
pub trait ProjectService {
async fn get_project(&self, query: GetProjectQuery) -> anyhow::Result<ProjectDto>;
async fn get_projects(&self, query: GetProjectsQuery) -> anyhow::Result<Vec<ProjectDto>>;
async fn get_projects(&self, user: &User) -> anyhow::Result<Vec<ProjectDto>>;
async fn create_project(
&self,
name: CreateProjectMutation,
user: &User,
) -> anyhow::Result<ProjectDto>;
}