use std::sync::Arc; use async_trait::async_trait; use mockall::automock; use uuid::Uuid; use crate::DaoError; #[derive(Clone, Debug, PartialEq, Eq)] pub struct SalesPersonEntity { pub id: Uuid, pub name: Arc, pub deleted: Option, pub inactive: bool, pub version: Uuid, } #[automock] #[async_trait] pub trait SalesPersonDao { async fn all(&self) -> Result, DaoError>; async fn find_by_id(&self, id: Uuid) -> Result, DaoError>; async fn find_by_user(&self, user_id: &str) -> Result, DaoError>; async fn create(&self, entity: &SalesPersonEntity, process: &str) -> Result<(), DaoError>; async fn update(&self, entity: &SalesPersonEntity, process: &str) -> Result<(), DaoError>; async fn get_assigned_user(&self, sales_person_id: Uuid) -> Result>, DaoError>; async fn assign_to_user( &self, sales_person_id: Uuid, user_id: &str, process: &str, ) -> Result<(), DaoError>; async fn discard_assigned_user(&self, sales_person_id: Uuid) -> Result<(), DaoError>; }