Basic rest implementation for connecting user to sales-person
This commit is contained in:
parent
e3ec694876
commit
bf94ec33de
10 changed files with 181 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ pub trait PermissionDao {
|
|||
|
||||
async fn create_user(&self, user: &UserEntity, process: &str) -> Result<(), DaoError>;
|
||||
async fn all_users(&self) -> Result<Arc<[UserEntity]>, DaoError>;
|
||||
async fn find_user(&self, username: &str) -> Result<Option<UserEntity>, DaoError>;
|
||||
async fn delete_user(&self, username: &str) -> Result<(), DaoError>;
|
||||
|
||||
async fn create_role(&self, role: &RoleEntity, process: &str) -> Result<(), DaoError>;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ pub struct SalesPersonEntity {
|
|||
pub trait SalesPersonDao {
|
||||
async fn all(&self) -> Result<Arc<[SalesPersonEntity]>, DaoError>;
|
||||
async fn find_by_id(&self, id: Uuid) -> Result<Option<SalesPersonEntity>, DaoError>;
|
||||
async fn find_by_user(&self, user_id: &str) -> Result<Option<SalesPersonEntity>, 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<Option<Arc<str>>, 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>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue