pub struct PostgresUnitOwnerRepository { /* private fields */ }Implementations§
Trait Implementations§
Source§impl UnitOwnerRepository for PostgresUnitOwnerRepository
impl UnitOwnerRepository for PostgresUnitOwnerRepository
Source§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 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
Source§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_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
Source§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_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)
Source§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_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)
Source§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_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)
Source§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 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)
Source§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 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
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,
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
Source§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 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
Source§fn get_total_ownership_percentage<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, 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<f64, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the total ownership percentage for a unit (should be <= 1.0)
Source§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_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
Source§fn find_active_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<(Uuid, Uuid, f64)>, 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, f64)>, 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
Auto Trait Implementations§
impl Freeze for PostgresUnitOwnerRepository
impl !RefUnwindSafe for PostgresUnitOwnerRepository
impl Send for PostgresUnitOwnerRepository
impl Sync for PostgresUnitOwnerRepository
impl Unpin for PostgresUnitOwnerRepository
impl !UnwindSafe for PostgresUnitOwnerRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.