CUB-30: Implement PUT /filaments/{id} update endpoint #4
Reference in New Issue
Block a user
Delete Branch "agent/dex/CUB-30-put-filament-endpoint"
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-30: Implement PUT /filaments/{id} update endpoint
Summary
The PUT /filaments/{id} endpoint was already implemented in
FilamentsController.cswith full validation, 404 handling, FK checks, serial uniqueness, and weight constraints. This PR adds the missing FluentValidation layer for consistent pipeline-level validation.Changes
FilamentValidators.cs— FluentValidation validators forCreateFilamentRequestandUpdateFilamentRequestwith comprehensive rules:^#[0-9A-Fa-f]{6}$)FluentValidationFilter.cs— Action filter that auto-runs FluentValidation validators for all API controller actions, returning 400 Bad Request with structured error details on validation failureProgram.cs— Registered FluentValidationFilter in DI and added it to MVC filtersExisting PUT endpoint (already working)
PUT /api/filaments/{id}— Updates a filament spoolFilamentResponsewith denormalized material namesBuild
dotnet build— 0 errors, 0 new warningsTesting
New commits pushed, approval review dismissed automatically according to repository settings