class ContactBucket {
  final String id;
  final String name;
  final String description;
  final CreatedBy createdBy;
  final List<String> employeeIds;
  final int numberOfContacts;

  ContactBucket({
    required this.id,
    required this.name,
    required this.description,
    required this.createdBy,
    required this.employeeIds,
    required this.numberOfContacts,
  });

  factory ContactBucket.fromJson(Map<String, dynamic> json) {
    return ContactBucket(
      id: json['id'],
      name: json['name'],
      description: json['description'],
      createdBy: CreatedBy.fromJson(json['createdBy']),
      employeeIds: List<String>.from(json['employeeIds']),
      numberOfContacts: json['numberOfContacts'],
    );
  }
}

class CreatedBy {
  final String id;
  final String firstName;
  final String lastName;
  final String? photo;
  final String jobRoleId;
  final String jobRoleName;

  CreatedBy({
    required this.id,
    required this.firstName,
    required this.lastName,
    this.photo,
    required this.jobRoleId,
    required this.jobRoleName,
  });

  factory CreatedBy.fromJson(Map<String, dynamic> json) {
    return CreatedBy(
      id: json['id'],
      firstName: json['firstName'],
      lastName: json['lastName'],
      photo: json['photo'],
      jobRoleId: json['jobRoleId'],
      jobRoleName: json['jobRoleName'],
    );
  }
}
