import 'package:krow_domain/krow_domain.dart';

/// Extensions for [EmergencyContact] to support UI operations.
extension EmergencyContactExtensions on EmergencyContact {
  /// returns a copy of this [EmergencyContact] with the given fields replaced.
  EmergencyContact copyWith({
    String? name,
    String? phone,
    String? relationship,
  }) {
    return EmergencyContact(
      name: name ?? this.name,
      phone: phone ?? this.phone,
      relationship: relationship ?? this.relationship,
    );
  }

  /// Returns an empty [EmergencyContact].
  static EmergencyContact empty() {
    return const EmergencyContact(
      name: '',
      phone: '',
      relationship: 'family',
    );
  }
}
