feat: Add material dimensions with typed properties
Implement TPH inheritance for material dimensions: - MaterialShape enum with display names and parsing - MaterialType enum (Steel, Aluminum, Stainless, etc.) - MaterialDimensions base class with derived types per shape - Auto-generate size strings from typed dimensions - SortOrder field for numeric dimension sorting Each shape has specific dimension properties: - RoundBar: Diameter - RoundTube: OuterDiameter, Wall - FlatBar: Width, Thickness - SquareBar/Tube: Size, Wall - RectangularTube: Width, Height, Wall - Angle: Leg1, Leg2, Thickness - Channel: Height, Flange, Web - IBeam: Height, WeightPerFoot - Pipe: NominalSize, Wall, Schedule Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CutList.Web.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddMaterialSortOrder : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "SortOrder",
|
||||
table: "Materials",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SortOrder",
|
||||
table: "Materials");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user