pub trait OwnerCreditBalanceRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
balance: &'life1 OwnerCreditBalance,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_owner_and_building<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnerCreditBalance>, 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<OwnerCreditBalance>, 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<OwnerCreditBalance>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_or_create<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
balance: &'life1 OwnerCreditBalance,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_leaderboard<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: i32,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnerCreditBalance>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_active_participants<'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 get_total_credits_in_circulation<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Repository trait for OwnerCreditBalance entity (SEL credit tracking)
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
balance: &'life1 OwnerCreditBalance,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
balance: &'life1 OwnerCreditBalance,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new credit balance (starts at 0)
Sourcefn find_by_owner_and_building<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnerCreditBalance>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_owner_and_building<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnerCreditBalance>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find a credit balance by owner and building
Sourcefn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnerCreditBalance>, 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<OwnerCreditBalance>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all balances for a building
Sourcefn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnerCreditBalance>, 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<OwnerCreditBalance>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all balances for an owner (across all buildings)
Sourcefn get_or_create<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_or_create<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get or create a balance (ensures balance exists)
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
balance: &'life1 OwnerCreditBalance,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
balance: &'life1 OwnerCreditBalance,
) -> Pin<Box<dyn Future<Output = Result<OwnerCreditBalance, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a credit balance
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a credit balance
Sourcefn get_leaderboard<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: i32,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnerCreditBalance>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_leaderboard<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
limit: i32,
) -> Pin<Box<dyn Future<Output = Result<Vec<OwnerCreditBalance>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get leaderboard (top contributors by balance)