pub trait UnitOwnerRepository: Send + Sync {
Show 16 methods
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
unit_owner: &'life1 UnitOwner,
) -> Pin<Box<dyn Future<Output = Result<UnitOwner, 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<UnitOwner>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_current_owners_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_current_units_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_all_owners_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_all_units_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
unit_owner: &'life1 UnitOwner,
) -> Pin<Box<dyn Future<Output = Result<UnitOwner, 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 has_active_owners<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_ownership_percentage<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Decimal, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_active_by_unit_and_owner<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UnitOwner>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_active_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, Decimal)>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_active_quota_shares_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, Decimal)>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_voting_holders_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<LotHolder>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_voting_representative<'life0, 'async_trait>(
&'life0 self,
unit_owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_voting_representative<'life0, 'async_trait>(
&'life0 self,
unit_owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
unit_owner: &'life1 UnitOwner,
) -> Pin<Box<dyn Future<Output = Result<UnitOwner, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
unit_owner: &'life1 UnitOwner,
) -> Pin<Box<dyn Future<Output = Result<UnitOwner, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new unit-owner relationship
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find a unit-owner relationship by ID
Sourcefn find_current_owners_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_current_owners_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all current owners of a unit (end_date IS NULL)
Sourcefn find_current_units_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_current_units_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all current units of an owner (end_date IS NULL)
Sourcefn find_all_owners_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_all_owners_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get ownership history of a unit (including past owners)
Sourcefn find_all_units_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_all_units_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get ownership history of an owner (including past units)
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
unit_owner: &'life1 UnitOwner,
) -> Pin<Box<dyn Future<Output = Result<UnitOwner, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
unit_owner: &'life1 UnitOwner,
) -> Pin<Box<dyn Future<Output = Result<UnitOwner, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a unit-owner relationship
Sourcefn 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 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 unit-owner relationship
Sourcefn has_active_owners<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn has_active_owners<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if a unit has any active owners
Sourcefn get_total_ownership_percentage<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Decimal, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_ownership_percentage<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Decimal, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the total ownership percentage for a unit (should be <= 1.0)
Sourcefn find_active_by_unit_and_owner<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_active_by_unit_and_owner<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UnitOwner>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find active unit-owner relationship by unit and owner IDs
Sourcefn find_active_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, Decimal)>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_active_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, Decimal)>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all active unit-owner relationships for a building
Returns tuples of (unit_id, owner_id, ownership_percentage)
Useful for calculating charge distributions
Détentions actives d’un immeuble, avec le pourcentage BRUT de détention
dans le lot (unit_owners.ownership_percentage).
⚠️ Ce pourcentage n’est PAS une quote-part de charge. Un propriétaire
unique d’un lot vaut 1.0 quel que soit le poids de son lot dans
l’immeuble. Ne l’utiliser que pour identifier QUI détient quoi
(autorisations, éligibilité au vote), jamais pour répartir un montant :
voir find_active_quota_shares_by_building.
Quotes-parts de CHARGE des détenteurs actifs d’un immeuble.
Renvoie (unit_id, owner_id, part) où part est la fraction [0, 1] du
montant total qui incombe à ce copropriétaire :
part = (unit.quota / building.total_tantiemes) × ownership_percentageC’est la formule de l’Art. 3.84 CC, déjà implémentée et testée par
ChargeDistribution::resolve_owner_quota. La somme des parts d’un
immeuble conforme vaut 1.
Sourcefn find_voting_holders_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<LotHolder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_voting_holders_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<LotHolder>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Story H17 (Art. 3.87 §1 CC) — titularités actives d’un lot réduites aux
attributs pertinents pour le calcul du droit de vote (ownership_type
is_voting_representative). Consommé par le gate vote (cast_vote) pour rejeter les lots démembrés/indivis sans représentant unique désigné (VOTING_RIGHT_SUSPENDED).
Sourcefn is_voting_representative<'life0, 'async_trait>(
&'life0 self,
unit_owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_voting_representative<'life0, 'async_trait>(
&'life0 self,
unit_owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Story #848 (Art. 3.87 §1 CC) — la ligne unit_owners identifiée
porte-t-elle déjà la désignation de représentant de vote ? Sert à
rendre la désignation idempotente : redésigner le représentant déjà en
place ne doit pas se heurter à la règle du représentant unique contre
elle-même (assert_single_voting_representative).
Sourcefn set_voting_representative<'life0, 'async_trait>(
&'life0 self,
unit_owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_voting_representative<'life0, 'async_trait>(
&'life0 self,
unit_owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Story #848 (Art. 3.87 §1 CC) — écrit la désignation du représentant de
vote pour une ligne unit_owners précise. L’appelant DOIT avoir validé
assert_single_voting_representative sur l’état prospectif AVANT
d’appeler cette méthode : elle écrit, elle ne contrôle rien (cf.
UnitOwnerUseCases::designate_voting_representative).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".