Managing account aliases and profile synchronization for outlook and gmail.

This commit is contained in:
Burak Kaan Köse
2024-08-17 03:43:37 +02:00
parent f1154058ba
commit abff850427
46 changed files with 949 additions and 272 deletions

View File

@@ -32,6 +32,13 @@ namespace Wino.Core.Domain.Entities
/// </summary>
public bool IsPrimary { get; set; }
/// <summary>
/// Whether this alias is the root alias for the account.
/// Root alias means the first alias that was created for the account.
/// It can't be deleted or changed.
/// </summary>
public bool IsRootAlias { get; set; }
/// <summary>
/// Whether the alias is verified by the server.
/// Non-verified aliases will show an info tip to users during sending.
@@ -40,6 +47,11 @@ namespace Wino.Core.Domain.Entities
/// </summary>
public bool IsVerified { get; set; }
/// <summary>
/// Root aliases can't be deleted.
/// </summary>
public bool CanDelete => !IsRootAlias;
public override bool Equals(object obj)
{
if (obj == null || GetType() != obj.GetType())
@@ -51,17 +63,20 @@ namespace Wino.Core.Domain.Entities
AliasAddress == other.AliasAddress &&
ReplyToAddress == other.ReplyToAddress &&
IsPrimary == other.IsPrimary &&
IsVerified == other.IsVerified;
IsVerified == other.IsVerified &&
IsRootAlias == other.IsRootAlias;
}
public override int GetHashCode()
{
int hashCode = -753829106;
int hashCode = 59052167;
hashCode = hashCode * -1521134295 + AccountId.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AliasAddress);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ReplyToAddress);
hashCode = hashCode * -1521134295 + IsPrimary.GetHashCode();
hashCode = hashCode * -1521134295 + IsRootAlias.GetHashCode();
hashCode = hashCode * -1521134295 + IsVerified.GetHashCode();
hashCode = hashCode * -1521134295 + CanDelete.GetHashCode();
return hashCode;
}
}