import '../../entities/profile/emergency_contact.dart';

/// Adapter for [EmergencyContact] to map data layer values to domain entity.
class EmergencyContactAdapter {
  /// Maps primitive values to [EmergencyContact].
  static EmergencyContact fromPrimitives({
    required String id,
    required String name,
    required String phone,
    String? relationship,
  }) {
    return EmergencyContact(
      id: id,
      name: name,
      phone: phone,
      relationship: EmergencyContact.stringToRelationshipType(relationship),
    );
  }
}
