using System.ComponentModel.DataAnnotations; namespace Extrudex.API.DTOs.PrintJobs; /// /// Response DTO for cost-per-print calculation. Contains the full cost /// breakdown and any warnings about missing or incomplete data. /// public class CostPerPrintResponse { /// The print job identifier this result belongs to. public Guid PrintJobId { get; set; } /// Human-readable name of the print job. public string PrintName { get; set; } = string.Empty; /// The spool identifier that provided filament. public Guid SpoolId { get; set; } /// Serial number of the spool. public string SpoolSerial { get; set; } = string.Empty; /// Total millimeters of filament extruded. public decimal MmExtruded { get; set; } /// Derived grams consumed for this print. public decimal GramsDerived { get; set; } /// The spool's purchase price. Null if not recorded. public decimal? PurchasePrice { get; set; } /// The spool's total weight in grams when full. public decimal? WeightTotalGrams { get; set; } /// Cost per gram of filament. Null if purchase price or total weight is missing. public decimal? CostPerGram { get; set; } /// Calculated cost of this print job. Null if cost data is incomplete. public decimal? CostPerPrint { get; set; } /// /// Warnings about missing or incomplete data. Empty when all data is available /// and the calculation succeeded. /// public List Warnings { get; set; } = new(); } /// /// Request DTO for batch cost calculation by spool. Returns cost breakdowns /// for all print jobs associated with the specified spool. /// public class SpoolCostRequest { /// The unique identifier of the spool to calculate costs for. [Required(ErrorMessage = "SpoolId is required.")] public Guid SpoolId { get; set; } } /// /// Response DTO for spool-level cost calculation. Contains cost breakdowns /// for all print jobs on the spool, plus a total cost summary. /// public class SpoolCostResponse { /// The spool identifier. public Guid SpoolId { get; set; } /// Serial number of the spool. public string SpoolSerial { get; set; } = string.Empty; /// The spool's purchase price. Null if not recorded. public decimal? PurchasePrice { get; set; } /// The spool's total weight in grams when full. public decimal? WeightTotalGrams { get; set; } /// Cost per gram of filament. Null if cost data is incomplete. public decimal? CostPerGram { get; set; } /// Total grams consumed across all print jobs on this spool. public decimal TotalGramsConsumed { get; set; } /// Total calculated cost across all print jobs. Null if any job has missing data. public decimal? TotalCost { get; set; } /// Number of print jobs included in this calculation. public int JobCount { get; set; } /// /// Individual cost breakdowns per print job. Jobs with missing data /// will have null cost fields and populated warnings. /// public List Jobs { get; set; } = new(); /// /// Aggregate warnings about missing data across all jobs. /// public List Warnings { get; set; } = new(); }