//-----------------------------------------------------------------------
//
// Copyright (c) lanedirt. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//
//-----------------------------------------------------------------------
namespace AliasServerDb;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
///
/// UserEmailClaim object. This object is used to reserve an email address for a user.
///
[Index(nameof(Address), IsUnique = true)]
public class UserEmailClaim
{
///
/// Gets or sets the ID.
///
[Key]
public Guid Id { get; set; }
///
/// Gets or sets user ID foreign key. This can be null if the email claim was associated with a user that has since been deleted.
/// Email claims are meant to be preserved even if the user is deleted to prevent re-use of the email address.
///
[StringLength(255)]
public string? UserId { get; set; }
///
/// Gets or sets foreign key to the AliasVaultUser object. This can be null if the email claim was associated with a user that has since been deleted.
/// Email claims are meant to be preserved even if the user is deleted to prevent re-use of the email address.
///
[ForeignKey("UserId")]
public virtual AliasVaultUser? User { get; set; }
///
/// Gets or sets the full email address.
///
[StringLength(255)]
public string Address { get; set; } = null!;
///
/// Gets or sets the email adress local part.
///
[StringLength(255)]
public string AddressLocal { get; set; } = null!;
///
/// Gets or sets the email adress domain part.
///
[StringLength(255)]
public string AddressDomain { get; set; } = null!;
///
/// Gets or sets created timestamp.
///
public DateTime CreatedAt { get; set; }
///
/// Gets or sets updated timestamp.
///
public DateTime UpdatedAt { get; set; }
}