55 lines
1.2 KiB
Dart
55 lines
1.2 KiB
Dart
enum InstructionStatus {
|
|
assigned,
|
|
completed,
|
|
overdue,
|
|
cancelled
|
|
}
|
|
|
|
extension InstructionStatusExtension on InstructionStatus {
|
|
String get displayName {
|
|
switch (this) {
|
|
case InstructionStatus.assigned:
|
|
return 'Назначен';
|
|
case InstructionStatus.completed:
|
|
return 'Завершен';
|
|
case InstructionStatus.overdue:
|
|
return 'Просрочен';
|
|
case InstructionStatus.cancelled:
|
|
return 'Отменен';
|
|
}
|
|
}
|
|
}
|
|
|
|
class InstructionLog {
|
|
final String? id;
|
|
final String workerId;
|
|
final String instructionId;
|
|
final InstructionStatus status;
|
|
final String? notes;
|
|
|
|
InstructionLog({
|
|
this.id,
|
|
required this.workerId,
|
|
required this.instructionId,
|
|
required this.status,
|
|
this.notes,
|
|
});
|
|
|
|
InstructionLog copyWith({
|
|
String? id,
|
|
String? workerId,
|
|
String? instructionId,
|
|
InstructionStatus? status,
|
|
String? notes,
|
|
}) {
|
|
return InstructionLog(
|
|
id: id ?? this.id,
|
|
workerId: workerId ?? this.workerId,
|
|
instructionId: instructionId ?? this.instructionId,
|
|
status: status ?? this.status,
|
|
notes: notes ?? this.notes,
|
|
);
|
|
}
|
|
|
|
|
|
} |