Enhance staff profile management by updating data structures and repository implementation
- Added new fields to the Staff entity for better profile details. - Updated ProfileRepositoryImpl to fetch staff profiles using a connector. - Refactored GetProfileUseCase to map staff data to UI entities. - Improved dependency injection in StaffProfileModule. - Cleaned up unused mock data references and streamlined profile page logic.
This commit is contained in:
@@ -29,17 +29,21 @@ enum StaffStatus {
|
||||
/// Contains all personal and professional details of a staff member.
|
||||
/// Linked to a [User] via [authProviderId].
|
||||
class Staff extends Equatable {
|
||||
|
||||
const Staff({
|
||||
required this.id,
|
||||
required this.authProviderId,
|
||||
required this.name,
|
||||
required this.email,
|
||||
this.phone,
|
||||
this.avatar,
|
||||
required this.status,
|
||||
this.address,
|
||||
this.avatar,
|
||||
this.livePhoto,
|
||||
this.totalShifts,
|
||||
this.averageRating,
|
||||
this.onTimeRate,
|
||||
this.noShowCount,
|
||||
this.cancellationCount,
|
||||
this.reliabilityScore,
|
||||
});
|
||||
/// Unique identifier for the staff profile.
|
||||
final String id;
|
||||
@@ -56,17 +60,34 @@ class Staff extends Equatable {
|
||||
/// Contact phone number.
|
||||
final String? phone;
|
||||
|
||||
/// Profile picture URL.
|
||||
final String? avatar;
|
||||
|
||||
/// Current workflow status of the staff member.
|
||||
final StaffStatus status;
|
||||
|
||||
/// Physical address string.
|
||||
/// The user's physical address.
|
||||
///
|
||||
/// Can be used for location-based job matching.
|
||||
final String? address;
|
||||
|
||||
/// URL to the avatar image.
|
||||
final String? avatar;
|
||||
/// The total number of shifts completed.
|
||||
final int? totalShifts;
|
||||
|
||||
/// URL to a verified live photo for identity verification.
|
||||
final String? livePhoto;
|
||||
/// The average rating from businesses.
|
||||
final double? averageRating;
|
||||
|
||||
/// The percentage of shifts arrived on time.
|
||||
final int? onTimeRate;
|
||||
|
||||
/// The number of no-shows.
|
||||
final int? noShowCount;
|
||||
|
||||
/// The number of cancellations within 24h.
|
||||
final int? cancellationCount;
|
||||
|
||||
/// The reliability score (0-100).
|
||||
final int? reliabilityScore;
|
||||
|
||||
@override
|
||||
List<Object?> get props => <Object?>[
|
||||
@@ -75,9 +96,14 @@ class Staff extends Equatable {
|
||||
name,
|
||||
email,
|
||||
phone,
|
||||
avatar,
|
||||
status,
|
||||
address,
|
||||
avatar,
|
||||
livePhoto,
|
||||
totalShifts,
|
||||
averageRating,
|
||||
onTimeRate,
|
||||
noShowCount,
|
||||
cancellationCount,
|
||||
reliabilityScore,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user