use std::sync::Arc; use async_trait::async_trait; use como_domain::{ item::{ queries::{GetItemQuery, GetItemsQuery}, requests::{CreateItemDto, UpdateItemDto}, responses::CreatedItemDto, ItemDto, }, Context, }; pub type DynItemService = Arc; #[async_trait] pub trait ItemService { async fn add_item( &self, context: &Context, item: CreateItemDto, ) -> anyhow::Result; async fn get_item(&self, context: &Context, query: GetItemQuery) -> anyhow::Result; async fn get_items( &self, context: &Context, query: GetItemsQuery, ) -> anyhow::Result>; async fn update_item(&self, context: &Context, item: UpdateItemDto) -> anyhow::Result; }