feat(db): add MaterialHeader EF entity and DbSet mapping\n\n- Map to dbo.MaterialHeader with key and relevant columns.\n- Register DbSet in PepDB and configure string columns as non-Unicode.

This commit is contained in:
AJ
2025-10-27 20:08:10 -04:00
committed by AJ Isaacs
parent 2d051fc48b
commit 44a2af7429
2 changed files with 87 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
namespace PepLib.Data
{
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
[Table("MaterialHeader")]
public partial class MaterialHeader
{
[Key]
public int ID { get; set; }
public DateTime? ModifiedDate { get; set; }
[Required]
[StringLength(254)]
public string ModifiedBy { get; set; }
[Required]
[StringLength(32)]
public string CompanyID { get; set; }
[Required]
[StringLength(32)]
public string FacilityID { get; set; }
[Required]
[StringLength(64)]
public string GroupID { get; set; }
// Typically numeric-as-string in PEP data; used as material number in other tables
[Required]
[StringLength(254)]
public string Material { get; set; }
[Required]
[StringLength(254)]
public string MatGrade { get; set; }
public byte AutoAddText { get; set; }
public double Cost { get; set; }
[Required]
[StringLength(254)]
public string Description { get; set; }
public double Density { get; set; }
public byte KeepRemnant { get; set; }
[Required]
[StringLength(16)]
public string KeepRemnantLogic { get; set; }
public double Kfactor { get; set; }
public double MinRemnantArea { get; set; }
public double MinRemnantCost { get; set; }
public double MinRemnantSize { get; set; }
public double MinRemnantWeight { get; set; }
[Required]
[StringLength(254)]
public string OriginalMaterialForStack { get; set; }
public double Thickness { get; set; }
}
}

View File

@@ -18,6 +18,7 @@ public partial class PepDB : DbContext
public virtual DbSet<NestHeader> NestHeaders { get; set; }
public virtual DbSet<PlateDetail> PlateDetails { get; set; }
public virtual DbSet<PlateHeader> PlateHeaders { get; set; }
public virtual DbSet<MaterialHeader> MaterialHeaders { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -159,5 +160,18 @@ public partial class PepDB : DbContext
entity.Property(e => e.Location).IsUnicode(false);
entity.Property(e => e.NestedSize).IsUnicode(false);
});
modelBuilder.Entity<MaterialHeader>(entity =>
{
entity.Property(e => e.ModifiedBy).IsUnicode(false);
entity.Property(e => e.CompanyID).IsUnicode(false);
entity.Property(e => e.FacilityID).IsUnicode(false);
entity.Property(e => e.GroupID).IsUnicode(false);
entity.Property(e => e.Material).IsUnicode(false);
entity.Property(e => e.MatGrade).IsUnicode(false);
entity.Property(e => e.Description).IsUnicode(false);
entity.Property(e => e.KeepRemnantLogic).IsUnicode(false);
entity.Property(e => e.OriginalMaterialForStack).IsUnicode(false);
});
}
}