import 'package:freezed_annotation/freezed_annotation.dart';

part 'shift_contact.g.dart';

@JsonSerializable(fieldRename: FieldRename.snake)
class Contact {
  final String id;
  final String firstName;
  final String? avatar;
  final String lastName;
  final String title;
  final AuthInfo authInfo;

  Contact({
    required this.id,
    required this.firstName,
    required this.lastName,
    required this.title,
    required this.avatar,
    required this.authInfo,
  });
  
  factory Contact.fromJson(Map<String, dynamic> json) {
      return _$ContactFromJson(json);
    }
  
  Map<String, dynamic> toJson() => _$ContactToJson(this);
}

@JsonSerializable(fieldRename: FieldRename.snake)
class AuthInfo {
  final String email;
  final String phone;

  AuthInfo({
    required this.email,
    required this.phone,
  });

  factory AuthInfo.fromJson(Map<String, dynamic> json) {
      return _$AuthInfoFromJson(json);
    }
  
  Map<String, dynamic> toJson() => _$AuthInfoToJson(this);
}
