From 6971048a6b361cbf69e4e62968309a37fdcfa552 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Wed, 29 Oct 2025 15:28:52 -0400 Subject: [PATCH] refactor(models): add required keyword and remove unused imports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add required keyword to string properties across all model classes - Initialize Part.NestedOn array with Array.Empty() - Remove unused using statements from model files This improves null safety and code maintainability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- PepApi.Core/Models/Material.cs | 4 ++-- PepApi.Core/Models/NestDetails.cs | 21 +++++++++------------ PepApi.Core/Models/NestFilterData.cs | 5 ----- PepApi.Core/Models/NestSummary.cs | 21 +++++++++------------ PepApi.Core/Models/Part.cs | 4 ++-- PepApi.Core/Models/Plate.cs | 6 +++--- 6 files changed, 25 insertions(+), 36 deletions(-) diff --git a/PepApi.Core/Models/Material.cs b/PepApi.Core/Models/Material.cs index ef573f7..78ba8c3 100644 --- a/PepApi.Core/Models/Material.cs +++ b/PepApi.Core/Models/Material.cs @@ -4,10 +4,10 @@ namespace PepApi.Core.Models { public int Number { get; set; } - public string Grade { get; set; } + public required string Grade { get; set; } public double Thickness { get; set; } - public string Description { get; set; } + public required string Description { get; set; } } } diff --git a/PepApi.Core/Models/NestDetails.cs b/PepApi.Core/Models/NestDetails.cs index 8a7a03e..dbdddff 100644 --- a/PepApi.Core/Models/NestDetails.cs +++ b/PepApi.Core/Models/NestDetails.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace PepApi.Core.Models { public class NestDetails @@ -11,29 +8,29 @@ namespace PepApi.Core.Models Plates = new List(); } - public string Name { get; set; } + public required string Name { get; set; } public DateTime DateCreated { get; set; } public DateTime DateLastModified { get; set; } - public string Status { get; set; } + public required string Status { get; set; } - public string Comments { get; set; } + public required string Comments { get; set; } - public string Customer { get; set; } + public required string Customer { get; set; } - public string ProgrammedBy { get; set; } + public required string ProgrammedBy { get; set; } - public Material Material { get; set; } + public required Material Material { get; set; } - public string Notes { get; set; } + public required string Notes { get; set; } public bool HasErrors { get; set; } - public string Revision { get; set; } + public required string Revision { get; set; } - public string Application { get; set; } + public required string Application { get; set; } public int NumberOfTestSquares { get; set; } diff --git a/PepApi.Core/Models/NestFilterData.cs b/PepApi.Core/Models/NestFilterData.cs index 4e40763..7960c39 100644 --- a/PepApi.Core/Models/NestFilterData.cs +++ b/PepApi.Core/Models/NestFilterData.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using PepLib; - namespace PepApi.Core.Models { public class NestFilterData diff --git a/PepApi.Core/Models/NestSummary.cs b/PepApi.Core/Models/NestSummary.cs index 9b2b155..e9188d0 100644 --- a/PepApi.Core/Models/NestSummary.cs +++ b/PepApi.Core/Models/NestSummary.cs @@ -1,35 +1,32 @@ -using PepLib; -using System; - namespace PepApi.Core.Models { public class NestSummary { - public string Name { get; set; } + public required string Name { get; set; } public DateTime DateCreated { get; set; } public DateTime DateLastModified { get; set; } - public string Status { get; set; } + public required string Status { get; set; } - public string Comments { get; set; } + public required string Comments { get; set; } - public string Customer { get; set; } + public required string Customer { get; set; } - public string ProgrammedBy { get; set; } + public required string ProgrammedBy { get; set; } public int MaterialNumber { get; set; } - public string MaterialGrade { get; set; } + public required string MaterialGrade { get; set; } - public string Notes { get; set; } + public required string Notes { get; set; } public bool HasErrors { get; set; } - public string Revision { get; set; } + public required string Revision { get; set; } - public string Application { get; set; } + public required string Application { get; set; } } } diff --git a/PepApi.Core/Models/Part.cs b/PepApi.Core/Models/Part.cs index fbfab0a..aebcf99 100644 --- a/PepApi.Core/Models/Part.cs +++ b/PepApi.Core/Models/Part.cs @@ -2,9 +2,9 @@ namespace PepApi.Core.Models { public class Part { - public string Name { get; set; } + public required string Name { get; set; } public int QtyNested { get; set; } public int QtyRequired { get; set; } - public int[] NestedOn { get; set; } + public int[] NestedOn { get; set; } = Array.Empty(); } } diff --git a/PepApi.Core/Models/Plate.cs b/PepApi.Core/Models/Plate.cs index b201f40..84ccb6f 100644 --- a/PepApi.Core/Models/Plate.cs +++ b/PepApi.Core/Models/Plate.cs @@ -2,13 +2,13 @@ namespace PepApi.Core.Models { public class Plate { - public string Name { get; set; } + public required string Name { get; set; } public double Thickness { get; set; } - public Material Material { get; set; } + public required Material Material { get; set; } - public Size Size { get; set; } + public required Size Size { get; set; } public int Qty { get; set; }