fix(nests): use partial matching for customer filter in SearchParts

The customer parameter on the parts search endpoint was doing exact
equality matching against CustomerName/CustID, so partial values like
"sull" would never match "Sullys". Changed to case-insensitive
Contains matching, consistent with how the search term is handled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-06 12:41:35 -05:00
parent 72cdb32750
commit 955fbc5539

View File

@@ -216,7 +216,12 @@ public class NestsController : ControllerBase
nestsQuery = nestsQuery.Where(n => n.DateProgrammed!.Value.Year == year.Value);
if (!string.IsNullOrWhiteSpace(customer))
nestsQuery = nestsQuery.Where(n => n.CustomerName == customer || n.CustID == customer);
{
var customerUpper = customer.Trim().ToUpper();
nestsQuery = nestsQuery.Where(n =>
(n.CustomerName != null && n.CustomerName.ToUpper().Contains(customerUpper)) ||
(n.CustID != null && n.CustID.ToUpper().Contains(customerUpper)));
}
var nests = await nestsQuery
.Select(n => new