pub struct BudgetUseCases { /* private fields */ }Implementations§
Source§impl BudgetUseCases
impl BudgetUseCases
pub fn new( repository: Arc<dyn BudgetRepository>, building_repository: Arc<dyn BuildingRepository>, expense_repository: Arc<dyn ExpenseRepository>, ) -> Self
Sourcepub async fn create_budget(
&self,
request: CreateBudgetRequest,
) -> Result<BudgetResponse, String>
pub async fn create_budget( &self, request: CreateBudgetRequest, ) -> Result<BudgetResponse, String>
Create a new budget
Sourcepub async fn get_budget(
&self,
id: Uuid,
) -> Result<Option<BudgetResponse>, String>
pub async fn get_budget( &self, id: Uuid, ) -> Result<Option<BudgetResponse>, String>
Get budget by ID
Sourcepub async fn get_by_building_and_fiscal_year(
&self,
building_id: Uuid,
fiscal_year: i32,
) -> Result<Option<BudgetResponse>, String>
pub async fn get_by_building_and_fiscal_year( &self, building_id: Uuid, fiscal_year: i32, ) -> Result<Option<BudgetResponse>, String>
Get budget for a building and fiscal year
Sourcepub async fn get_active_budget(
&self,
building_id: Uuid,
) -> Result<Option<BudgetResponse>, String>
pub async fn get_active_budget( &self, building_id: Uuid, ) -> Result<Option<BudgetResponse>, String>
Get active budget for a building
Sourcepub async fn list_by_building(
&self,
building_id: Uuid,
) -> Result<Vec<BudgetResponse>, String>
pub async fn list_by_building( &self, building_id: Uuid, ) -> Result<Vec<BudgetResponse>, String>
List budgets for a building
Sourcepub async fn list_by_fiscal_year(
&self,
organization_id: Uuid,
fiscal_year: i32,
) -> Result<Vec<BudgetResponse>, String>
pub async fn list_by_fiscal_year( &self, organization_id: Uuid, fiscal_year: i32, ) -> Result<Vec<BudgetResponse>, String>
List budgets by fiscal year
Sourcepub async fn list_by_status(
&self,
organization_id: Uuid,
status: BudgetStatus,
) -> Result<Vec<BudgetResponse>, String>
pub async fn list_by_status( &self, organization_id: Uuid, status: BudgetStatus, ) -> Result<Vec<BudgetResponse>, String>
List budgets by status
Sourcepub async fn list_paginated(
&self,
page_request: &PageRequest,
organization_id: Option<Uuid>,
building_id: Option<Uuid>,
status: Option<BudgetStatus>,
) -> Result<(Vec<BudgetResponse>, i64), String>
pub async fn list_paginated( &self, page_request: &PageRequest, organization_id: Option<Uuid>, building_id: Option<Uuid>, status: Option<BudgetStatus>, ) -> Result<(Vec<BudgetResponse>, i64), String>
List budgets paginated
Sourcepub async fn update_budget(
&self,
id: Uuid,
request: UpdateBudgetRequest,
) -> Result<BudgetResponse, String>
pub async fn update_budget( &self, id: Uuid, request: UpdateBudgetRequest, ) -> Result<BudgetResponse, String>
Update budget amounts (Draft only)
Sourcepub async fn submit_for_approval(
&self,
id: Uuid,
) -> Result<BudgetResponse, String>
pub async fn submit_for_approval( &self, id: Uuid, ) -> Result<BudgetResponse, String>
Submit budget for approval
Sourcepub async fn approve_budget(
&self,
id: Uuid,
meeting_id: Uuid,
) -> Result<BudgetResponse, String>
pub async fn approve_budget( &self, id: Uuid, meeting_id: Uuid, ) -> Result<BudgetResponse, String>
Approve budget (requires meeting_id for legal traceability)
Sourcepub async fn reject_budget(
&self,
id: Uuid,
reason: Option<String>,
) -> Result<BudgetResponse, String>
pub async fn reject_budget( &self, id: Uuid, reason: Option<String>, ) -> Result<BudgetResponse, String>
Reject budget (with optional reason)
Sourcepub async fn archive_budget(&self, id: Uuid) -> Result<BudgetResponse, String>
pub async fn archive_budget(&self, id: Uuid) -> Result<BudgetResponse, String>
Archive budget
Sourcepub async fn get_stats(
&self,
organization_id: Uuid,
) -> Result<BudgetStatsResponse, String>
pub async fn get_stats( &self, organization_id: Uuid, ) -> Result<BudgetStatsResponse, String>
Get budget statistics
Sourcepub async fn get_variance(
&self,
budget_id: Uuid,
) -> Result<Option<BudgetVarianceResponse>, String>
pub async fn get_variance( &self, budget_id: Uuid, ) -> Result<Option<BudgetVarianceResponse>, String>
Get budget variance analysis (budget vs actual expenses)
Auto Trait Implementations§
impl Freeze for BudgetUseCases
impl !RefUnwindSafe for BudgetUseCases
impl Send for BudgetUseCases
impl Sync for BudgetUseCases
impl Unpin for BudgetUseCases
impl !UnwindSafe for BudgetUseCases
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.