// ignore_for_file: public_member_api_docs, sort_constructors_first
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

import 'package:wyatt_authentication_bloc/src/domain/entities/account.dart';

class AccountModel extends Account {
  @override
  final String uid;

  @override
  final String? email;

  @override
  final DateTime? creationTime;

  @override
  final bool emailVerified;

  @override
  final bool isAnonymous;

  @override
  final bool? isNewUser;

  @override
  final DateTime? lastSignInTime;

  @override
  final String? phoneNumber;

  @override
  final String? photoURL;

  @override
  final String providerId;

  AccountModel({
    required this.uid,
    required this.emailVerified,
    required this.isAnonymous,
    required this.providerId,
    this.lastSignInTime,
    this.creationTime,
    this.isNewUser,
    this.email,
    this.phoneNumber,
    this.photoURL,
  });

  AccountModel copyWith({
    String? uid,
    String? email,
    DateTime? creationTime,
    bool? emailVerified,
    bool? isAnonymous,
    bool? isNewUser,
    DateTime? lastSignInTime,
    String? phoneNumber,
    String? photoURL,
    String? providerId,
  }) =>
      AccountModel(
        uid: uid ?? this.uid,
        email: email ?? this.email,
        creationTime: creationTime ?? this.creationTime,
        emailVerified: emailVerified ?? this.emailVerified,
        isAnonymous: isAnonymous ?? this.isAnonymous,
        isNewUser: isNewUser ?? this.isNewUser,
        lastSignInTime: lastSignInTime ?? this.lastSignInTime,
        phoneNumber: phoneNumber ?? this.phoneNumber,
        photoURL: photoURL ?? this.photoURL,
        providerId: providerId ?? this.providerId,
      );
}
