pub struct UnitOwnerUseCases { /* private fields */ }Implementations§
Source§impl UnitOwnerUseCases
impl UnitOwnerUseCases
pub fn new( unit_owner_repository: Arc<dyn UnitOwnerRepository>, unit_repository: Arc<dyn UnitRepository>, owner_repository: Arc<dyn OwnerRepository>, ) -> Self
Sourcepub async fn add_owner_to_unit(
&self,
unit_id: Uuid,
owner_id: Uuid,
ownership_percentage: f64,
is_primary_contact: bool,
) -> Result<UnitOwner, String>
pub async fn add_owner_to_unit( &self, unit_id: Uuid, owner_id: Uuid, ownership_percentage: f64, is_primary_contact: bool, ) -> Result<UnitOwner, String>
Add an owner to a unit with specified ownership percentage
Sourcepub async fn remove_owner_from_unit(
&self,
unit_id: Uuid,
owner_id: Uuid,
) -> Result<UnitOwner, String>
pub async fn remove_owner_from_unit( &self, unit_id: Uuid, owner_id: Uuid, ) -> Result<UnitOwner, String>
Remove an owner from a unit (sets end_date to now)
Sourcepub async fn update_ownership_percentage(
&self,
unit_owner_id: Uuid,
new_percentage: f64,
) -> Result<UnitOwner, String>
pub async fn update_ownership_percentage( &self, unit_owner_id: Uuid, new_percentage: f64, ) -> Result<UnitOwner, String>
Update the ownership percentage for a unit-owner relationship
Sourcepub async fn transfer_ownership(
&self,
from_owner_id: Uuid,
to_owner_id: Uuid,
unit_id: Uuid,
) -> Result<(UnitOwner, UnitOwner), String>
pub async fn transfer_ownership( &self, from_owner_id: Uuid, to_owner_id: Uuid, unit_id: Uuid, ) -> Result<(UnitOwner, UnitOwner), String>
Transfer ownership from one owner to another
Sourcepub async fn get_unit_owners(
&self,
unit_id: Uuid,
) -> Result<Vec<UnitOwner>, String>
pub async fn get_unit_owners( &self, unit_id: Uuid, ) -> Result<Vec<UnitOwner>, String>
Get all current owners of a unit
Sourcepub async fn get_owner_units(
&self,
owner_id: Uuid,
) -> Result<Vec<UnitOwner>, String>
pub async fn get_owner_units( &self, owner_id: Uuid, ) -> Result<Vec<UnitOwner>, String>
Get all current units owned by an owner
Sourcepub async fn get_unit_ownership_history(
&self,
unit_id: Uuid,
) -> Result<Vec<UnitOwner>, String>
pub async fn get_unit_ownership_history( &self, unit_id: Uuid, ) -> Result<Vec<UnitOwner>, String>
Get ownership history for a unit (including past owners)
Sourcepub async fn get_owner_ownership_history(
&self,
owner_id: Uuid,
) -> Result<Vec<UnitOwner>, String>
pub async fn get_owner_ownership_history( &self, owner_id: Uuid, ) -> Result<Vec<UnitOwner>, String>
Get ownership history for an owner (including past units)
Sourcepub async fn set_primary_contact(
&self,
unit_owner_id: Uuid,
) -> Result<UnitOwner, String>
pub async fn set_primary_contact( &self, unit_owner_id: Uuid, ) -> Result<UnitOwner, String>
Set a unit-owner relationship as primary contact
Sourcepub async fn get_unit_owner(
&self,
id: Uuid,
) -> Result<Option<UnitOwner>, String>
pub async fn get_unit_owner( &self, id: Uuid, ) -> Result<Option<UnitOwner>, String>
Get a specific unit-owner relationship by ID
Auto Trait Implementations§
impl Freeze for UnitOwnerUseCases
impl !RefUnwindSafe for UnitOwnerUseCases
impl Send for UnitOwnerUseCases
impl Sync for UnitOwnerUseCases
impl Unpin for UnitOwnerUseCases
impl !UnwindSafe for UnitOwnerUseCases
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.