using System.ComponentModel.DataAnnotations; namespace Extrudex.API.DTOs.UsageLogs; /// /// Request DTO for recording a filament usage entry. /// public class CreateUsageLogRequest { /// /// The ID of the spool that provided the filament. /// [Required] public Guid SpoolId { get; set; } /// /// The number of grams of filament consumed. /// [Required] [Range(0.01, double.MaxValue, ErrorMessage = "GramsUsed must be a positive value.")] public decimal GramsUsed { get; set; } /// /// The source of the usage data (Mqtt, Moonraker, Manual). /// [Required] public string DataSource { get; set; } = string.Empty; /// /// The ID of the printer that consumed the filament. Optional. /// public Guid? PrinterId { get; set; } /// /// The ID of the print job associated with this usage. Optional. /// public Guid? PrintJobId { get; set; } /// /// The number of millimeters of filament extruded. Optional. /// public decimal? MmExtruded { get; set; } /// /// When the usage occurred (UTC). Defaults to now if not specified. /// public DateTime? UsageTimestamp { get; set; } /// /// Optional notes about this usage entry. /// [MaxLength(2000)] public string? Notes { get; set; } } /// /// Response DTO for a usage log entry. /// public class UsageLogResponse { /// /// Unique identifier for the usage log entry. /// public Guid Id { get; set; } /// /// The spool that provided the filament. /// public Guid SpoolId { get; set; } /// /// The printer that consumed the filament, if applicable. /// public Guid? PrinterId { get; set; } /// /// The print job associated with this usage, if applicable. /// public Guid? PrintJobId { get; set; } /// /// Grams of filament consumed. /// public decimal GramsUsed { get; set; } /// /// Millimeters of filament extruded, if available. /// public decimal? MmExtruded { get; set; } /// /// When the usage occurred (UTC). /// public DateTime UsageTimestamp { get; set; } /// /// Source of the usage data (Mqtt, Moonraker, Manual). /// public string DataSource { get; set; } = string.Empty; /// /// Optional notes about this usage entry. /// public string? Notes { get; set; } /// /// When the record was created (UTC). /// public DateTime CreatedAt { get; set; } /// /// When the record was last updated (UTC). /// public DateTime UpdatedAt { get; set; } }