namespace EnvelopeGenerator.ReceiverUI.Web.Client.Api.Models;
///
/// Client-side DTOs for envelope display. These mirror the server-side
/// EnvelopeReceiverDto / EnvelopeDto / DocumentDto used by the existing
/// API endpoints, but expose only the fields the receiver UI actually needs.
/// JSON serialization is camelCase by default (System.Text.Json).
///
public class EnvelopeReceiverDto
{
public long EnvelopeId { get; set; }
public long ReceiverId { get; set; }
public string? Name { get; set; }
public bool HasPhoneNumber { get; set; }
public EnvelopeDto? Envelope { get; set; }
public ReceiverDto? Receiver { get; set; }
}
public class EnvelopeDto
{
public long Id { get; set; }
public string? Uuid { get; set; }
public string? Title { get; set; }
public string? Message { get; set; }
public bool ReadOnly { get; set; }
public bool UseAccessCode { get; set; }
public bool TFAEnabled { get; set; }
public DateTime AddedWhen { get; set; }
public SenderUserDto? User { get; set; }
public List? Documents { get; set; }
}
public class SenderUserDto
{
public string? Email { get; set; }
public string? Prename { get; set; }
public string? Name { get; set; }
}
public class ReceiverDto
{
public long Id { get; set; }
public string? EmailAddress { get; set; }
public string? Signature { get; set; }
public string? Prename { get; set; }
public string? Name { get; set; }
}
public class DocumentDto
{
public long Id { get; set; }
public string? Name { get; set; }
public List? Elements { get; set; }
}
///
/// Signature placement on a PDF document. Pixel/inch units follow the same
/// convention as the legacy PSPDFKit pipeline.
///
public class DocumentElementDto
{
public int Id { get; set; }
public int Page { get; set; }
public double Left { get; set; }
public double Top { get; set; }
}
///
/// Body for POST /api/readonly (share read-only link with another e-mail).
///
public class ReadOnlyShareRequest
{
public string ReceiverMail { get; set; } = string.Empty;
public DateTime DateValid { get; set; }
}
///
/// Returned by GET /api/annotation/elements. Each item describes a
/// signature placeholder the authenticated receiver must sign on the
/// current envelope. Coordinates are in PDF points relative to the page.
///
public class SignatureElementDto
{
public int Id { get; set; }
public int Page { get; set; }
public double X { get; set; }
public double Y { get; set; }
public double Width { get; set; }
public double Height { get; set; }
public bool Required { get; set; }
public string? Tooltip { get; set; }
}
///
/// Body of POST /api/annotation/blazor — mirrors the API-side
/// BlazorSignaturePayload.
///
public class BlazorSignaturePayload
{
public List Signatures { get; set; } = new();
}
public class BlazorSignatureEntry
{
public int ElementId { get; set; }
/// Image as data URL (e.g. data:image/png;base64,...).
public string SignatureDataUrl { get; set; } = string.Empty;
public string? Position { get; set; }
public string? City { get; set; }
public DateTime SignedAt { get; set; }
}
///
/// Response of GET /api/tfa/{envelopeReceiverId}. The API serializes
/// the anonymous type in TfaRegistrationController.RegisterAsync; the
/// shape mirrored here is the camelCased JSON that crosses the wire.
///
public class TfaRegistrationResponse
{
public int EnvelopeId { get; set; }
public string? Uuid { get; set; }
public string? Signature { get; set; }
public DateTime? TfaRegDeadline { get; set; }
/// Base64-encoded PNG suitable for data:image/png;base64,....
public string? TotpQR64 { get; set; }
}