2026-04-14 11:29:49 +02:00
|
|
|
part of 'staff_cubit.dart';
|
|
|
|
|
|
2026-04-26 16:29:31 +02:00
|
|
|
enum StaffStatus { initial, loading, success, error }
|
|
|
|
|
|
2026-04-14 11:29:49 +02:00
|
|
|
class StaffState extends Equatable {
|
2026-04-26 16:29:31 +02:00
|
|
|
final StaffStatus status;
|
2026-04-14 11:29:49 +02:00
|
|
|
final List<StaffMemberModel> allStaff;
|
|
|
|
|
final Map<String, List<StoreModel>> storesByStaff;
|
|
|
|
|
final Map<String, List<StaffMemberModel>> staffByStore;
|
|
|
|
|
final String? error;
|
|
|
|
|
|
|
|
|
|
const StaffState({
|
2026-04-26 16:29:31 +02:00
|
|
|
this.status = StaffStatus.initial,
|
2026-04-14 11:29:49 +02:00
|
|
|
this.allStaff = const [],
|
|
|
|
|
this.storesByStaff = const {},
|
|
|
|
|
this.staffByStore = const {},
|
|
|
|
|
this.error,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
StaffState copyWith({
|
2026-04-26 16:29:31 +02:00
|
|
|
StaffStatus? status,
|
2026-04-14 11:29:49 +02:00
|
|
|
List<StaffMemberModel>? allStaff,
|
|
|
|
|
Map<String, List<StoreModel>>? storesByStaff,
|
|
|
|
|
Map<String, List<StaffMemberModel>>? staffByStore,
|
|
|
|
|
String? error,
|
|
|
|
|
}) {
|
|
|
|
|
return StaffState(
|
2026-04-26 16:29:31 +02:00
|
|
|
status: status ?? this.status,
|
2026-04-14 11:29:49 +02:00
|
|
|
allStaff: allStaff ?? this.allStaff,
|
|
|
|
|
storesByStaff: storesByStaff ?? this.storesByStaff,
|
|
|
|
|
staffByStore: staffByStore ?? this.staffByStore,
|
|
|
|
|
error: error,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
List<Object?> get props => [
|
2026-04-26 16:29:31 +02:00
|
|
|
status,
|
2026-04-14 11:29:49 +02:00
|
|
|
allStaff,
|
|
|
|
|
storesByStaff,
|
|
|
|
|
staffByStore,
|
|
|
|
|
error,
|
|
|
|
|
];
|
|
|
|
|
}
|