/// Represents a server in the IT0 inventory system.
class Server {
  final String id;
  final String hostname;
  final String? ip;
  final String? environment; // dev, staging, prod
  final String? role;
  final String status; // online, offline, degraded
  final DateTime? lastCheckedAt;
  final List<String>? tags;

  const Server({
    required this.id,
    required this.hostname,
    this.ip,
    this.environment,
    this.role,
    required this.status,
    this.lastCheckedAt,
    this.tags,
  });

  Server copyWith({
    String? id,
    String? hostname,
    String? ip,
    String? environment,
    String? role,
    String? status,
    DateTime? lastCheckedAt,
    List<String>? tags,
  }) {
    return Server(
      id: id ?? this.id,
      hostname: hostname ?? this.hostname,
      ip: ip ?? this.ip,
      environment: environment ?? this.environment,
      role: role ?? this.role,
      status: status ?? this.status,
      lastCheckedAt: lastCheckedAt ?? this.lastCheckedAt,
      tags: tags ?? this.tags,
    );
  }
}
