Add context reqruied later for authentication

This commit is contained in:
Simon Goller 2024-05-03 19:01:26 +02:00
parent 9a367c9260
commit 20828fb4a1
14 changed files with 463 additions and 330 deletions

View file

@ -82,12 +82,14 @@ impl From<&Slot> for dao::slot::SlotEntity {
}
}
#[automock]
#[automock(type Context=();)]
#[async_trait]
pub trait SlotService {
async fn get_slots(&self) -> Result<Arc<[Slot]>, ServiceError>;
async fn get_slot(&self, id: &Uuid) -> Result<Slot, ServiceError>;
async fn create_slot(&self, slot: &Slot) -> Result<Slot, ServiceError>;
async fn delete_slot(&self, id: &Uuid) -> Result<(), ServiceError>;
async fn update_slot(&self, slot: &Slot) -> Result<(), ServiceError>;
type Context: Clone + Send + Sync + 'static;
async fn get_slots(&self, context: Self::Context) -> Result<Arc<[Slot]>, ServiceError>;
async fn get_slot(&self, id: &Uuid, context: Self::Context) -> Result<Slot, ServiceError>;
async fn create_slot(&self, slot: &Slot, context: Self::Context) -> Result<Slot, ServiceError>;
async fn delete_slot(&self, id: &Uuid, context: Self::Context) -> Result<(), ServiceError>;
async fn update_slot(&self, slot: &Slot, context: Self::Context) -> Result<(), ServiceError>;
}