using System.ComponentModel.DataAnnotations;
namespace ROLAC.API.DTOs.Invitations;
///
/// Admin request to generate a first-login invitation link for a member. If the member has no
/// account yet, one is auto-created (no password) using or the member's email.
///
public class CreateInvitationRequest
{
[Required]
public int MemberId { get; set; }
/// Optional override for the login email when the member has none on file.
public string? Email { get; set; }
/// Roles to assign when an account is created. Defaults to ["member"].
public List? Roles { get; set; }
}
/// Result of generating an invitation — the raw token is returned ONCE.
public class CreateInvitationResult
{
public string Token { get; set; } = null!;
public DateTime ExpiresAt { get; set; }
}
/// Admin request to e-mail an already-generated invitation link to the member.
public class SendInvitationRequest
{
[Required]
public int MemberId { get; set; }
[Required]
public string Link { get; set; } = null!;
}
/// Public result describing whether an invitation token can still be used.
public class ValidateInvitationResult
{
public bool Valid { get; set; }
public bool Expired { get; set; }
public string? MemberName { get; set; }
public string? Email { get; set; }
}
/// Public request to consume an invitation and set the account password.
public class AcceptInvitationRequest
{
[Required]
public string Token { get; set; } = null!;
[Required]
[StringLength(128, MinimumLength = 8)]
public string NewPassword { get; set; } = null!;
}