using System.Text.Json.Serialization;
using TakeoutSaaS.Domain.Identity.Enums;
using TakeoutSaaS.Shared.Abstractions.Serialization;
namespace TakeoutSaaS.Application.Identity.Contracts;
///
/// 用户列表项 DTO。
///
public sealed record UserListItemDto
{
///
/// 用户 ID。
///
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long UserId { get; init; }
///
/// 租户 ID。
///
[JsonConverter(typeof(SnowflakeIdJsonConverter))]
public long TenantId { get; init; }
///
/// 登录账号。
///
public string Account { get; init; } = string.Empty;
///
/// 展示名称。
///
public string DisplayName { get; init; } = string.Empty;
///
/// 手机号。
///
public string? Phone { get; init; }
///
/// 邮箱。
///
public string? Email { get; init; }
///
/// 用户状态。
///
public IdentityUserStatus Status { get; init; }
///
/// 是否处于锁定状态。
///
public bool IsLocked { get; init; }
///
/// 是否已删除。
///
public bool IsDeleted { get; init; }
///
/// 角色编码列表。
///
public string[] Roles { get; init; } = Array.Empty();
///
/// 创建时间(UTC)。
///
public DateTime CreatedAt { get; init; }
///
/// 最近登录时间(UTC)。
///
public DateTime? LastLoginAt { get; init; }
}