using System.ComponentModel.DataAnnotations;

namespace Govor.Core.Models.Users;

public class User
{
    public Guid Id {get; set;}
    public string Username {get; set;} 
    public string Description {get; set;} 
    public string PasswordHash {get; set;}
    public Guid IconId {get; set;} 
    public DateOnly CreatedOn {get; set;}
    public DateTime WasOnline {get; set;}
    public Guid InviteId {get; set;}
    public Invitation? Invite { get; set; }
    public List<Friendship> SentFriendRequests { get; set; } = new();
    public List<Friendship> ReceivedFriendRequests { get; set; } = new();

    public override bool Equals(object? obj)
    {
        var user = obj as User;
        
        return Id == user.Id &&
               Username == user.Username &&
               Description == user.Description &&
               PasswordHash == user.PasswordHash &&
               IconId == user.IconId &&
               CreatedOn == user.CreatedOn &&
               WasOnline == user.WasOnline &&
               InviteId == user.InviteId &&
               Invite == user.Invite &&
               SentFriendRequests == user.SentFriendRequests &&
               ReceivedFriendRequests == user.ReceivedFriendRequests;
    }
}