namespace OmsorgCore.Application.Services;

public enum AdminResetPasswordFailureReason
{
    UserNotFound,
    EmployeeEmailMissing,
    InitialPasswordRequired,
    PasswordTooShort
}

public class AdminResetPasswordResult
{
    public bool Success { get; init; }
    public AdminResetPasswordFailureReason? FailureReason { get; init; }

    /// <summary>Nur im Invite-Modus gesetzt - für den Versand der Einladungsmail.</summary>
    public string? Email { get; init; }
    public string? RawInvitePin { get; init; }

    public static AdminResetPasswordResult Fail(AdminResetPasswordFailureReason reason) => new()
    {
        Success = false,
        FailureReason = reason
    };

    public static AdminResetPasswordResult Ok(string? email = null, string? rawInvitePin = null) => new()
    {
        Success = true,
        Email = email,
        RawInvitePin = rawInvitePin
    };
}
