/// Represents an approval request in the IT0 system.
class Approval {
  final String id;
  final String? taskId;
  final String? taskDescription;
  final String? command;
  final String? riskLevel;
  final String? requestedBy;
  final String status; // pending, approved, rejected, expired
  final DateTime? expiresAt;
  final DateTime? createdAt;

  const Approval({
    required this.id,
    this.taskId,
    this.taskDescription,
    this.command,
    this.riskLevel,
    this.requestedBy,
    required this.status,
    this.expiresAt,
    this.createdAt,
  });

  Approval copyWith({
    String? id,
    String? taskId,
    String? taskDescription,
    String? command,
    String? riskLevel,
    String? requestedBy,
    String? status,
    DateTime? expiresAt,
    DateTime? createdAt,
  }) {
    return Approval(
      id: id ?? this.id,
      taskId: taskId ?? this.taskId,
      taskDescription: taskDescription ?? this.taskDescription,
      command: command ?? this.command,
      riskLevel: riskLevel ?? this.riskLevel,
      requestedBy: requestedBy ?? this.requestedBy,
      status: status ?? this.status,
      expiresAt: expiresAt ?? this.expiresAt,
      createdAt: createdAt ?? this.createdAt,
    );
  }
}
