From 7adaace61a4fe983eba5ded3aaaf624ce6fb9014 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Wed, 16 Oct 2024 18:22:55 +0100 Subject: Refactors some backend stuff to core lib --- backend/app/src/utils/calculate_category_balance.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'backend/app/src/utils/calculate_category_balance.rs') diff --git a/backend/app/src/utils/calculate_category_balance.rs b/backend/app/src/utils/calculate_category_balance.rs index 3c1c62f..e1de57e 100644 --- a/backend/app/src/utils/calculate_category_balance.rs +++ b/backend/app/src/utils/calculate_category_balance.rs @@ -1,4 +1,7 @@ -use crate::models::{budget_update::BudgetUpdate, category::Category}; +use budgeting_app_core::models::{ + budget_update::BudgetUpdate, + category::Category +}; use super::{calculate_budgets_accrual, find_by_id_or}; @@ -19,12 +22,10 @@ pub fn calculate_category_balance( #[cfg(test)] mod test { + use budgeting_app_core::models::{budget_update::BudgetUpdate, category::Category, date_time_utc::DateTimeUtc}; use chrono::{Days, Utc}; - use crate::{ - models::{budget_update::BudgetUpdate, category::Category, date_time_utc::DateTimeUtc}, - utils::calculate_category_balance, - }; + use crate::utils::calculate_category_balance; #[test] fn when_no_data_then_returns_zero() { -- cgit v1.2.3