SkillRepository

Trait SkillRepository 

Source
pub trait SkillRepository: Send + Sync {
Show 15 methods // Required methods fn create<'life0, 'life1, 'async_trait>( &'life0 self, skill: &'life1 Skill, ) -> Pin<Box<dyn Future<Output = Result<Skill, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_available_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_category<'life0, 'async_trait>( &'life0 self, building_id: Uuid, category: SkillCategory, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_by_expertise<'life0, 'async_trait>( &'life0 self, building_id: Uuid, level: ExpertiseLevel, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_free_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn find_professional_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn update<'life0, 'life1, 'async_trait>( &'life0 self, skill: &'life1 Skill, ) -> Pin<Box<dyn Future<Output = Result<Skill, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count_available_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count_by_category<'life0, 'async_trait>( &'life0 self, building_id: Uuid, category: SkillCategory, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count_by_expertise<'life0, 'async_trait>( &'life0 self, building_id: Uuid, level: ExpertiseLevel, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Repository port for Skill aggregate

Required Methods§

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, skill: &'life1 Skill, ) -> Pin<Box<dyn Future<Output = Result<Skill, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new skill

Source

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find skill by ID

Source

fn find_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all skills for a building

Source

fn find_available_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all available skills for a building (is_available_for_help = true)

Source

fn find_by_owner<'life0, 'async_trait>( &'life0 self, owner_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find all skills by owner

Source

fn find_by_category<'life0, 'async_trait>( &'life0 self, building_id: Uuid, category: SkillCategory, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find skills by category (HomeRepair, Languages, Technology, etc.)

Source

fn find_by_expertise<'life0, 'async_trait>( &'life0 self, building_id: Uuid, level: ExpertiseLevel, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find skills by expertise level (Beginner, Intermediate, Advanced, Expert)

Source

fn find_free_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find free/volunteer skills for a building (hourly_rate_credits IS NULL OR = 0)

Source

fn find_professional_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<Skill>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Find professional skills for a building (Expert level OR has certifications)

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, skill: &'life1 Skill, ) -> Pin<Box<dyn Future<Output = Result<Skill, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update an existing skill

Source

fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete a skill

Source

fn count_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count total skills for a building

Source

fn count_available_by_building<'life0, 'async_trait>( &'life0 self, building_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count available skills for a building

Source

fn count_by_category<'life0, 'async_trait>( &'life0 self, building_id: Uuid, category: SkillCategory, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count skills by category (for statistics)

Source

fn count_by_expertise<'life0, 'async_trait>( &'life0 self, building_id: Uuid, level: ExpertiseLevel, ) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count skills by expertise level (for statistics)

Implementors§