Refactor envelope receiver auth flow and state handling
- Introduce IReceiverAuthService and ReceiverAuthService for all envelope receiver authentication and status API calls - Add ReceiverAuthModel as a client-side DTO for API responses - Refactor EnvelopeState to store all relevant fields and update via ApplyApiResponse - Overhaul EnvelopePage.razor to use new service and state, with improved status handling and UI - Enhance ApiResponse and ApiServiceBase to support structured error deserialization - Register IReceiverAuthService in DI container
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
namespace EnvelopeGenerator.ReceiverUI.Client.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Client-seitiges DTO für die Antwort des ReceiverAuthControllers.
|
||||
/// Wird 1:1 aus dem JSON deserialisiert.
|
||||
///
|
||||
/// WARUM ein eigenes Client-Model statt das API-Model zu referenzieren?
|
||||
/// - Das API-Projekt hat Server-Abhängigkeiten (EF Core, SqlClient, etc.)
|
||||
/// - Diese Pakete existieren nicht für browser-wasm → Build-Fehler
|
||||
/// - Die Property-Namen müssen nur zum JSON passen (case-insensitive)
|
||||
/// </summary>
|
||||
public record ReceiverAuthModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Aktueller Status des Empfänger-Flows.
|
||||
/// Werte: "requires_access_code", "requires_tfa", "show_document",
|
||||
/// "already_signed", "rejected", "not_found", "expired", "error"
|
||||
/// </summary>
|
||||
public string Status { get; init; } = string.Empty;
|
||||
|
||||
public string? Title { get; init; }
|
||||
public string? Message { get; init; }
|
||||
public string? SenderEmail { get; init; }
|
||||
public string? ReceiverName { get; init; }
|
||||
public bool TfaEnabled { get; init; }
|
||||
public bool HasPhoneNumber { get; init; }
|
||||
public bool ReadOnly { get; init; }
|
||||
public string? TfaType { get; init; }
|
||||
public DateTime? TfaExpiration { get; init; }
|
||||
public string? ErrorMessage { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user