using DigitalData.Core.Abstractions.Interfaces;
using System.ComponentModel.DataAnnotations.Schema;

namespace DigitalData.Core.Tests.Mock;

[Table("USER")]
public class User : UserBase, IEntity
{
    public required int Id { get; init; }

    public override int GetHashCode() => HashCode.Combine(Id, FirstName, Email, Age);

    public override bool Equals(object? obj)
        => (obj is User user && user.GetHashCode() == GetHashCode())
        || (obj is UserBase userBase && userBase.GetHashCode() == base.GetHashCode());
}