CUB-32: Add usage logging service #11

Merged
Otto merged 1 commits from agent/dex/CUB-32-usage-logging-service into dev 2026-04-29 10:51:37 -04:00
Owner

Summary

Implements the usage logging service for Extrudex.

Changes

  • Domain: Added UsageLog entity with SpoolId, PrinterId, PrintJobId, GramsUsed, MmExtruded, UsageTimestamp, DataSource, and Notes fields
  • Domain: Added IUsageLogService interface with RecordUsageAsync, GetBySpoolAsync, GetByPrinterAsync, GetByPrintJobAsync
  • Infrastructure: Added UsageLogConfiguration EF Core config with snake_case columns, indexes, and FK constraints
  • Infrastructure: Added UsageLogService implementation
  • Infrastructure: Added EF Core migration AddUsageLogTable creating usage_logs table
  • API: Added UsageLogsController with POST (create), GET by spool, GET by printer, GET by print job endpoints
  • API: Added CreateUsageLogRequest and UsageLogResponse DTOs
  • DI: Registered IUsageLogService / UsageLogService as scoped service
  • DbContext: Added UsageLogs DbSet

Validation

  • dotnet build passes with 0 errors

Closes CUB-32

## Summary Implements the usage logging service for Extrudex. ### Changes - **Domain**: Added `UsageLog` entity with SpoolId, PrinterId, PrintJobId, GramsUsed, MmExtruded, UsageTimestamp, DataSource, and Notes fields - **Domain**: Added `IUsageLogService` interface with RecordUsageAsync, GetBySpoolAsync, GetByPrinterAsync, GetByPrintJobAsync - **Infrastructure**: Added `UsageLogConfiguration` EF Core config with snake_case columns, indexes, and FK constraints - **Infrastructure**: Added `UsageLogService` implementation - **Infrastructure**: Added EF Core migration `AddUsageLogTable` creating `usage_logs` table - **API**: Added `UsageLogsController` with POST (create), GET by spool, GET by printer, GET by print job endpoints - **API**: Added `CreateUsageLogRequest` and `UsageLogResponse` DTOs - **DI**: Registered `IUsageLogService` / `UsageLogService` as scoped service - **DbContext**: Added `UsageLogs` DbSet ### Validation - `dotnet build` passes with 0 errors Closes CUB-32
Otto approved these changes 2026-04-26 17:35:02 -04:00
Dismissed
Otto left a comment
Owner

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.

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.
Otto approved these changes 2026-04-26 18:20:38 -04:00
Dismissed
Otto left a comment
Owner

PR review by Otto. Checks passed: base=dev, author=Dex (dex-bot), validation=PASS (dotnet build passes), entity design follows EF Core patterns, migration creates usage_logs table with proper constraints and indexes, service layer implemented, controller endpoints added, DI registration complete. No secrets found in diff.

PR review by Otto. Checks passed: base=dev, author=Dex (dex-bot), validation=PASS (dotnet build passes), entity design follows EF Core patterns, migration creates usage_logs table with proper constraints and indexes, service layer implemented, controller endpoints added, DI registration complete. No secrets found in diff.
Rex dismissed Otto's review 2026-04-27 14:29:16 -04:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Otto approved these changes 2026-04-29 10:11:37 -04:00
Dismissed
Otto left a comment
Owner

APPROVED

base=dev author=dex-bot title format CUB-32 11 changed files match task scope validation evidence present no secrets

APPROVED ✅ base=dev ✅ author=dex-bot ✅ title format CUB-32 ✅ 11 changed files match task scope ✅ validation evidence present ✅ no secrets
Dex added 1 commit 2026-04-29 10:23:43 -04:00
CUB-32: Add usage logging service with EF Core entity, service, controller, and migration
All checks were successful
Dev Build / build-test (pull_request) Successful in 3m11s
57157ad947
Dex force-pushed agent/dex/CUB-32-usage-logging-service from feca1e3ee9 to 57157ad947 2026-04-29 10:23:43 -04:00 Compare
Dex dismissed Otto's review 2026-04-29 10:23:43 -04:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Otto approved these changes 2026-04-29 10:51:34 -04:00
Otto left a comment
Owner

APPROVED

Rebased onto dev base=dev author=dex-bot title format CUB-32 no secrets

APPROVED ✅ Rebased onto dev ✅ base=dev ✅ author=dex-bot ✅ title format CUB-32 ✅ no secrets
Otto merged commit 9112f78641 into dev 2026-04-29 10:51:37 -04:00
Otto deleted branch agent/dex/CUB-32-usage-logging-service 2026-04-29 10:51:37 -04:00
Sign in to join this conversation.
No Reviewers
No Label
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CubeCraft-Creations/Extrudex#11