Cargo clippy and cargo fmt

This commit is contained in:
Simon Goller 2024-05-09 15:00:50 +02:00
parent b0000c0117
commit ed609cf06c
22 changed files with 286 additions and 94 deletions

View file

@ -1,12 +1,12 @@
use std::sync::Arc;
use std::fmt::Debug;
use std::sync::Arc;
use async_trait::async_trait;
use mockall::automock;
use uuid::Uuid;
use crate::ServiceError;
use crate::permission::Authentication;
use crate::ServiceError;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SalesPerson {
@ -44,9 +44,20 @@ impl From<&SalesPerson> for dao::sales_person::SalesPersonEntity {
pub trait SalesPersonService {
type Context: Clone + Debug + PartialEq + Eq + Send + Sync + 'static;
async fn get_all(&self, context: Authentication<Self::Context>) -> Result<Arc<[SalesPerson]>, ServiceError>;
async fn get(&self, id: Uuid, context: Authentication<Self::Context>) -> Result<SalesPerson, ServiceError>;
async fn exists(&self, id: Uuid, context: Authentication<Self::Context>) -> Result<bool, ServiceError>;
async fn get_all(
&self,
context: Authentication<Self::Context>,
) -> Result<Arc<[SalesPerson]>, ServiceError>;
async fn get(
&self,
id: Uuid,
context: Authentication<Self::Context>,
) -> Result<SalesPerson, ServiceError>;
async fn exists(
&self,
id: Uuid,
context: Authentication<Self::Context>,
) -> Result<bool, ServiceError>;
async fn create(
&self,
item: &SalesPerson,
@ -57,7 +68,11 @@ pub trait SalesPersonService {
item: &SalesPerson,
context: Authentication<Self::Context>,
) -> Result<SalesPerson, ServiceError>;
async fn delete(&self, id: Uuid, context: Authentication<Self::Context>) -> Result<(), ServiceError>;
async fn delete(
&self,
id: Uuid,
context: Authentication<Self::Context>,
) -> Result<(), ServiceError>;
async fn get_assigned_user(
&self,
sales_person_id: Uuid,