CUB-37: Implement cost-per-print calculation service #18
Reference in New Issue
Block a user
Delete Branch "agent/dex/CUB-37-cost-per-print"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement cost-per-print (COGS) calculation service for Extrudex.
New files
Domain/Interfaces/ICostPerPrintService.cs— Interface +CostPerPrintResultdomain modelInfrastructure/Services/CostPerPrintService.cs— Implementation with graceful handling of missing cost dataAPI/DTOs/PrintJobs/CostPerPrintDtos.cs— Request/response DTOs for cost endpointsAPI/Controllers/CostAnalysisController.cs— Spool-level cost analysis endpoint (POST /api/cost-analysis/spool)Modified files
API/Controllers/PrintJobsController.cs— AddedPOST /api/printjobs/{id}/costendpoint + injectedICostPerPrintServiceProgram.cs— RegisteredICostPerPrintServicein DIAPI contracts for Rex
POST /api/printjobs/{id}/cost→CostPerPrintResponsePOST /api/cost-analysis/spool→SpoolCostResponseDesign decisions
cost_per_print = grams_derived × (purchase_price / weight_total_grams)Linear
Closes CUB-37