CUB-31: Add filament usage tracking model #10
Reference in New Issue
Block a user
Delete Branch "agent/hex/CUB-31-filament-usage-tracking-model"
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?
CUB-31 — Add filament usage tracking model
Summary
Defines the
FilamentUsageentity to track filament consumption per print job.Changes
FilamentUsage— tracks grams used, mm extruded, printer, spool, and print jobFilamentUsageConfiguration— explicit snake_case column mappings, indexes, FK constraintsAddFilamentUsageTrackingModel— createsfilament_usagestablePrintJob,Spool,Printer— addedFilamentUsagesnavigation propertiesExtrudexDbContext— addedFilamentUsagesDbSetDesign decisions
FilamentUsageextendsAuditableEntity(inherits Id, CreatedAt, UpdatedAt)grams_usedandmm_extrudedstored asnumeric(10,2)andnumeric(12,2)respectivelyrecorded_athas defaultnow() at time zone 'utc'— separate fromcreated_atto track when usage was logged vs when the record was created(spool_id, recorded_at)for spool-level time-range queriesprint_jobsusesCASCADEdelete; FK tospoolsandprintersuseRESTRICTnotescolumn (varchar 2000, nullable) for optional contextCloses CUB-31
Code review by Otto. Checklist: ✅ base=dev ✅ author=agent-bot ✅ title format CUB-N ✅ files match task scope ✅ no secrets ✅ snake_case naming ✅ EF Core config correct. APPROVED — ready for Joshua merge.
PR review by Otto. Checks passed: base=dev, author=Hex (hex-bot), validation=PASS (build passes), FilamentUsage entity properly defined with navigation properties to PrintJob, Spool, and Printer, EF Core configuration uses snake_case columns, migration creates filament_usages table with proper constraints and indexes (including composite index on spool_id + recorded_at). No secrets found in diff.