Add endpoint to get sales_person for current user
This commit is contained in:
parent
42ebce15e8
commit
bd887cfd7b
12 changed files with 108 additions and 5 deletions
|
|
@ -66,7 +66,7 @@ pub trait BookingService {
|
|||
) -> Result<Booking, ServiceError>;
|
||||
async fn get_for_week(
|
||||
&self,
|
||||
calendar_week: i32,
|
||||
calendar_week: u8,
|
||||
year: u32,
|
||||
context: Authentication<Self::Context>,
|
||||
) -> Result<Arc<[Booking]>, ServiceError>;
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ impl<Context: Clone + Debug + PartialEq + Eq + Send + Sync + 'static> From<Conte
|
|||
pub trait PermissionService {
|
||||
type Context: Clone + PartialEq + Eq + Debug + Send + Sync + 'static;
|
||||
|
||||
async fn current_user_id(
|
||||
&self,
|
||||
context: Authentication<Self::Context>,
|
||||
) -> Result<Option<Arc<str>>, ServiceError>;
|
||||
async fn check_permission(
|
||||
&self,
|
||||
privilege: &str,
|
||||
|
|
|
|||
|
|
@ -84,4 +84,13 @@ pub trait SalesPersonService {
|
|||
user_id: Option<Arc<str>>,
|
||||
context: Authentication<Self::Context>,
|
||||
) -> Result<(), ServiceError>;
|
||||
async fn get_sales_person_for_user(
|
||||
&self,
|
||||
user_id: Arc<str>,
|
||||
context: Authentication<Self::Context>,
|
||||
) -> Result<Option<SalesPerson>, ServiceError>;
|
||||
async fn get_sales_person_current_user(
|
||||
&self,
|
||||
context: Authentication<Self::Context>,
|
||||
) -> Result<Option<SalesPerson>, ServiceError>;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue