feat(CUB-28): [Extrudex] Define filament inventory database entities
Add storage_location and is_archived fields to Spool entity to complete the filament inventory entity definition per CUB-28 requirements. Changes: - Spool entity: add IsArchived (bool, default false) and StorageLocation (nullable string, max 200) for physical inventory tracking - SpoolConfiguration: add snake_case column mappings, defaults, and indexes (ix_spools_is_archived, ix_spools_active_archived composite) - FilamentDtos: add IsArchived + StorageLocation to Response, Create, Update - FilamentQueryDtos: add IncludeArchived and StorageLocation query filters - FilamentsController: wire new fields into query, create, update, mapping - FilamentValidators: add StorageLocation max-length validation Build: PASS (0 errors)
This commit is contained in:
@@ -52,6 +52,12 @@ public class CreateFilamentRequestValidator : AbstractValidator<CreateFilamentRe
|
||||
RuleFor(x => x.PurchasePrice!.Value)
|
||||
.GreaterThanOrEqualTo(0).WithMessage("Purchase price must be non-negative.");
|
||||
});
|
||||
|
||||
When(x => x.StorageLocation != null, () =>
|
||||
{
|
||||
RuleFor(x => x.StorageLocation!)
|
||||
.MaximumLength(200).WithMessage("StorageLocation must not exceed 200 characters.");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,5 +110,11 @@ public class UpdateFilamentRequestValidator : AbstractValidator<UpdateFilamentRe
|
||||
RuleFor(x => x.PurchasePrice!.Value)
|
||||
.GreaterThanOrEqualTo(0).WithMessage("Purchase price must be non-negative.");
|
||||
});
|
||||
|
||||
When(x => x.StorageLocation != null, () =>
|
||||
{
|
||||
RuleFor(x => x.StorageLocation!)
|
||||
.MaximumLength(200).WithMessage("StorageLocation must not exceed 200 characters.");
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user