feat: with items

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-06-04 11:02:51 +02:00
parent 12c7c8f6ee
commit 534b2e4a23
25 changed files with 517 additions and 111 deletions

View File

@@ -3,18 +3,22 @@ use std::sync::Arc;
use async_trait::async_trait;
use como_domain::{
projects::{mutation::CreateProjectMutation, queries::GetProjectQuery, ProjectDto},
users::User,
Context,
};
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, user: &User) -> anyhow::Result<Vec<ProjectDto>>;
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,
user: &User,
) -> anyhow::Result<ProjectDto>;
}