import '../api/types.dart';

class DeliveryContact implements Serializable {
  final String firstName;
  final String? lastName;
  final String fullName;
  final String? phoneNumber;

  const DeliveryContact({
    required this.firstName,
    this.lastName,
    required this.fullName,
    this.phoneNumber,
  });

  factory DeliveryContact.fromJson(Map<String, dynamic> json) {
    return DeliveryContact(
      firstName: json['firstName'] as String,
      lastName: json['lastName'] as String?,
      fullName: json['fullName'] as String,
      phoneNumber: json['phoneNumber'] as String?,
    );
  }

  @override
  Map<String, Object?> toJson() => {
    'firstName': firstName,
    'lastName': lastName,
    'fullName': fullName,
    'phoneNumber': phoneNumber,
  };
}
