using System; using System.Collections.Generic; namespace Yavsc.Api.Client; /// /// A single billable line of an estimate, mirroring the JSON shape of /// the server-side Yavsc.Models.Billing.CommandLine entity. /// public sealed class EstimateLineDto { public long Id { get; set; } public string Name { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public int Count { get; set; } = 1; public decimal UnitaryCost { get; set; } public long EstimateId { get; set; } public string Currency { get; set; } = "EUR"; } /// /// Estimate payload exchanged with the api/v1/estimate routes /// (EstimateApiController). and /// are always initialised: the server-side /// entity reads them from non-nullable string properties and a null /// list would break its serialisation. /// public sealed class EstimateDto { public long Id { get; set; } public long? CommandId { get; set; } public string Title { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public List Bill { get; set; } = new(); public List AttachedGraphics { get; set; } = new(); public List AttachedFiles { get; set; } = new(); public string? OwnerId { get; set; } public string ClientId { get; set; } = string.Empty; public string CommandType { get; set; } = string.Empty; public DateTime ProviderValidationDate { get; set; } public DateTime ClientValidationDate { get; set; } /// /// The provider's signature on this estimate, or null when the /// provider has not signed. Carries the PostIt wire-format /// so the pad can /// repaint a previously drawn signature on reopen without a second /// round-trip. /// public EstimateSignatureDto? SignaturePro { get; set; } /// /// The client's signature on this estimate, or null when the /// client has not signed. /// public EstimateSignatureDto? SignatureClient { get; set; } } /// /// One stored signature on an estimate, mirroring the JSON shape of /// the server-side Yavsc.Models.Billing.Signature entity. The /// are the same PostIt wire-format payload that /// was captured and are loaded back into the pad unchanged. The side /// (Pro/Client) is implicit in which property of /// carries this DTO, so no Type /// field is needed. /// public sealed class EstimateSignatureDto { public long Id { get; set; } public long EstimateId { get; set; } public int CoordinateMax { get; set; } public DateTime CapturedAtUtc { get; set; } public int[]? Strokes { get; set; } } /// /// Response of a successful estimate creation /// (Ok(new { estimate.Id, estimate.Bill })). /// public sealed class EstimateCreatedDto { public long Id { get; set; } public List Bill { get; set; } = new(); }