refactor: introduce HomeDashboardData entity, convert ClientHomePage to StatelessWidget, and update deprecated color methods in the client home feature.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/// The Shared Domain Layer.
|
||||
///
|
||||
///
|
||||
/// This package contains the core business entities and rules.
|
||||
/// It is pure Dart and has no dependencies on Flutter or Firebase.
|
||||
///
|
||||
///
|
||||
/// Note: Repository Interfaces are now located in their respective Feature packages.
|
||||
|
||||
// Users & Membership
|
||||
@@ -55,3 +55,6 @@ export 'src/entities/support/addon.dart';
|
||||
export 'src/entities/support/tag.dart';
|
||||
export 'src/entities/support/media.dart';
|
||||
export 'src/entities/support/working_area.dart';
|
||||
|
||||
// Home
|
||||
export 'src/entities/home/home_dashboard_data.dart';
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Entity representing dashboard data for the home screen.
|
||||
///
|
||||
/// This entity provides aggregated metrics such as spending and shift counts
|
||||
/// for both the current week and the upcoming 7 days.
|
||||
class HomeDashboardData extends Equatable {
|
||||
/// Total spending for the current week.
|
||||
final double weeklySpending;
|
||||
|
||||
/// Projected spending for the next 7 days.
|
||||
final double next7DaysSpending;
|
||||
|
||||
/// Total shifts scheduled for the current week.
|
||||
final int weeklyShifts;
|
||||
|
||||
/// Shifts scheduled for the next 7 days.
|
||||
final int next7DaysScheduled;
|
||||
|
||||
/// Total workers needed for today's shifts.
|
||||
final int totalNeeded;
|
||||
|
||||
/// Total workers filled for today's shifts.
|
||||
final int totalFilled;
|
||||
|
||||
/// Creates a [HomeDashboardData] instance.
|
||||
const HomeDashboardData({
|
||||
required this.weeklySpending,
|
||||
required this.next7DaysSpending,
|
||||
required this.weeklyShifts,
|
||||
required this.next7DaysScheduled,
|
||||
required this.totalNeeded,
|
||||
required this.totalFilled,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
weeklySpending,
|
||||
next7DaysSpending,
|
||||
weeklyShifts,
|
||||
next7DaysScheduled,
|
||||
totalNeeded,
|
||||
totalFilled,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user