Add id check for booking
It now checks if sales_person_id and slot_id actually exists.
This commit is contained in:
parent
418a2944f7
commit
bc8a534353
10 changed files with 201 additions and 24 deletions
|
|
@ -22,6 +22,8 @@ pub use permission::User;
|
|||
pub enum ValidationFailureItem {
|
||||
ModificationNotAllowed(Arc<str>),
|
||||
InvalidValue(Arc<str>),
|
||||
IdDoesNotExist(Arc<str>, Uuid),
|
||||
Duplicate,
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ pub trait SalesPersonService {
|
|||
|
||||
async fn get_all(&self, context: Self::Context) -> Result<Arc<[SalesPerson]>, ServiceError>;
|
||||
async fn get(&self, id: Uuid, context: Self::Context) -> Result<SalesPerson, ServiceError>;
|
||||
async fn exists(&self, id: Uuid, context: Self::Context) -> Result<bool, ServiceError>;
|
||||
async fn create(
|
||||
&self,
|
||||
item: &SalesPerson,
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ pub trait SlotService {
|
|||
|
||||
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 exists(&self, id: Uuid, context: Self::Context) -> Result<bool, 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>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue