2026-04-14 11:29:49 +02:00
|
|
|
part of 'staff_cubit.dart';
|
|
|
|
|
|
2026-04-29 09:20:17 +02:00
|
|
|
enum StaffStatus { initial, loading, success, emailSent, error }
|
2026-04-26 16:29:31 +02:00
|
|
|
|
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;
|
2026-05-03 13:03:50 +02:00
|
|
|
final List<StaffMemberModel> storeStaff;
|
2026-04-14 11:29:49 +02:00
|
|
|
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 {},
|
2026-05-03 13:03:50 +02:00
|
|
|
this.storeStaff = const [],
|
2026-04-14 11:29:49 +02:00
|
|
|
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,
|
2026-05-03 13:03:50 +02:00
|
|
|
List<StaffMemberModel>? storeStaff,
|
2026-04-14 11:29:49 +02:00
|
|
|
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,
|
2026-05-03 13:03:50 +02:00
|
|
|
storeStaff: storeStaff ?? this.storeStaff,
|
2026-04-14 11:29:49 +02:00
|
|
|
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,
|
2026-05-03 13:03:50 +02:00
|
|
|
storeStaff,
|
2026-04-14 11:29:49 +02:00
|
|
|
error,
|
|
|
|
|
];
|
|
|
|
|
}
|