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)
40 lines
1.6 KiB
C#
40 lines
1.6 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Extrudex.API.DTOs.Filaments;
|
|
|
|
/// <summary>
|
|
/// Query parameters for filtering and paginating the filament list endpoint.
|
|
/// All parameters are optional — defaults are applied when not provided.
|
|
/// </summary>
|
|
public class FilamentQueryParameters
|
|
{
|
|
/// <summary>Page number (1-based). Defaults to 1.</summary>
|
|
[Range(1, int.MaxValue, ErrorMessage = "PageNumber must be at least 1.")]
|
|
public int PageNumber { get; set; } = 1;
|
|
|
|
/// <summary>Number of items per page. Defaults to 20, max 100.</summary>
|
|
[Range(1, 100, ErrorMessage = "PageSize must be between 1 and 100.")]
|
|
public int PageSize { get; set; } = 20;
|
|
|
|
/// <summary>Optional filter by material base ID.</summary>
|
|
public Guid? MaterialBaseId { get; set; }
|
|
|
|
/// <summary>Optional filter by material finish ID.</summary>
|
|
public Guid? MaterialFinishId { get; set; }
|
|
|
|
/// <summary>Optional filter by material modifier ID.</summary>
|
|
public Guid? MaterialModifierId { get; set; }
|
|
|
|
/// <summary>Optional filter by brand name (case-insensitive partial match).</summary>
|
|
public string? Brand { get; set; }
|
|
|
|
/// <summary>Optional filter by active status. True = active only, False = inactive only.</summary>
|
|
public bool? IsActive { get; set; }
|
|
|
|
/// <summary>Whether to include archived spools in results. Defaults to false (excludes archived).
|
|
/// </summary>
|
|
public bool? IncludeArchived { get; set; }
|
|
|
|
/// <summary>Optional filter by storage location (case-insensitive partial match).</summary>
|
|
public string? StorageLocation { get; set; }
|
|
} |