Introduced EnvelopeDtos.cs and ReceiverAuthDtos.cs under EnvelopeGenerator.ReceiverUI.Web.Client.Api.Models. These files define client-side DTOs that mirror server-side models, exposing only the fields required by the receiver UI. EnvelopeDtos.cs covers envelopes, documents, receivers, and signature elements, while ReceiverAuthDtos.cs handles authentication responses and requests. All DTOs are documented and structured for camelCase JSON serialization, improving maintainability and clarity for API interactions in the receiver UI.
54 lines
1.8 KiB
C#
54 lines
1.8 KiB
C#
namespace EnvelopeGenerator.ReceiverUI.Web.Client.Api.Models;
|
|
|
|
/// <summary>
|
|
/// Mirrors <c>EnvelopeGenerator.API.Models.ReceiverAuthResponse</c>.
|
|
/// The Status string determines which fields are relevant.
|
|
/// Possible values:
|
|
/// requires_access_code, requires_tfa, show_document,
|
|
/// already_signed, rejected, not_found, expired, error.
|
|
/// </summary>
|
|
public class ReceiverAuthResponse
|
|
{
|
|
public string Status { get; set; } = string.Empty;
|
|
public string? Title { get; set; }
|
|
public string? Message { get; set; }
|
|
public string? SenderEmail { get; set; }
|
|
public string? ReceiverName { get; set; }
|
|
public bool TfaEnabled { get; set; }
|
|
public bool HasPhoneNumber { get; set; }
|
|
public bool ReadOnly { get; set; }
|
|
|
|
/// <summary>"sms" or "authenticator" when Status == "requires_tfa".</summary>
|
|
public string? TfaType { get; set; }
|
|
public DateTime? TfaExpiration { get; set; }
|
|
public string? ErrorMessage { get; set; }
|
|
}
|
|
|
|
public class AccessCodeRequest
|
|
{
|
|
public string AccessCode { get; set; } = string.Empty;
|
|
public bool PreferSms { get; set; }
|
|
}
|
|
|
|
public class TfaCodeRequest
|
|
{
|
|
public string Code { get; set; } = string.Empty;
|
|
/// <summary>"sms" or "authenticator".</summary>
|
|
public string Type { get; set; } = "authenticator";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Status strings returned by <see cref="ReceiverAuthResponse.Status"/>.
|
|
/// </summary>
|
|
public static class ReceiverAuthStatus
|
|
{
|
|
public const string RequiresAccessCode = "requires_access_code";
|
|
public const string RequiresTfa = "requires_tfa";
|
|
public const string ShowDocument = "show_document";
|
|
public const string AlreadySigned = "already_signed";
|
|
public const string Rejected = "rejected";
|
|
public const string NotFound = "not_found";
|
|
public const string Expired = "expired";
|
|
public const string Error = "error";
|
|
}
|