From 4760f3fdd7f8ef805770864610f83f2c4485e99e Mon Sep 17 00:00:00 2001 From: Arthur Bassi Date: Tue, 18 Aug 2026 09:19:27 -0300 Subject: [PATCH] fix(work-orders): name Schedule On in PastDueStatusBlocked and register SH-121 no-op The 422 still told dispatchers to update Due Date. Point the remedy at Schedule On and make the SH-121 successor visible to EF so G6 lineage is complete. --- .../Migrations/20260813193000_SH121_BoardSearchFacets.cs | 4 ++++ .../Implementation/WorkOrderBoardUpdateService.cs | 2 +- SeaHavenIndustries.Tests/WorkOrderBoardUpdateServiceTests.cs | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Data.SeaHavenIndustries/Migrations/20260813193000_SH121_BoardSearchFacets.cs b/Data.SeaHavenIndustries/Migrations/20260813193000_SH121_BoardSearchFacets.cs index 3405792..c5fe2cd 100644 --- a/Data.SeaHavenIndustries/Migrations/20260813193000_SH121_BoardSearchFacets.cs +++ b/Data.SeaHavenIndustries/Migrations/20260813193000_SH121_BoardSearchFacets.cs @@ -1,3 +1,5 @@ +using Data.SeaHavenIndustries; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable @@ -10,6 +12,8 @@ namespace Data.SeaHavenIndustries.Migrations /// now live in 20260730150000_WoIsAddOn (SH-184). This migration is a no-op so /// both PRs can land without a duplicate column. /// + [DbContext(typeof(ApplicationDbContext))] + [Migration("20260813193000_SH121_BoardSearchFacets")] public partial class SH121_BoardSearchFacets : Migration { /// diff --git a/SeaHaven.Services/Implementation/WorkOrderBoardUpdateService.cs b/SeaHaven.Services/Implementation/WorkOrderBoardUpdateService.cs index fc81b2c..126d01e 100644 --- a/SeaHaven.Services/Implementation/WorkOrderBoardUpdateService.cs +++ b/SeaHaven.Services/Implementation/WorkOrderBoardUpdateService.cs @@ -63,7 +63,7 @@ namespace SeaHaven.Services.Implementation var isPastDue = WorkOrderDerivedFields.IsPastDue(workOrder.ScheduledDate, workOrder.LifecycleStatus); if (WorkOrderBoardMutationRules.ShouldBlockStatusChangeWhenPastDue(canonicalField, isPastDue)) - throw new WorkOrderBoardValidationException("PastDueStatusBlocked", "Status cannot be changed while work order is past due. Update due date first."); + throw new WorkOrderBoardValidationException("PastDueStatusBlocked", "Status cannot be changed while work order is past due. Update Schedule On first."); _mutationData.SetExpectedWorkOrderVersion(workOrder, workOrderVersion); diff --git a/SeaHavenIndustries.Tests/WorkOrderBoardUpdateServiceTests.cs b/SeaHavenIndustries.Tests/WorkOrderBoardUpdateServiceTests.cs index 69847c5..c76632a 100644 --- a/SeaHavenIndustries.Tests/WorkOrderBoardUpdateServiceTests.cs +++ b/SeaHavenIndustries.Tests/WorkOrderBoardUpdateServiceTests.cs @@ -111,6 +111,8 @@ public class WorkOrderBoardUpdateServiceTests }, "actor-1")); Assert.Equal("PastDueStatusBlocked", ex.Code); + Assert.Contains("Schedule On", ex.Message, StringComparison.Ordinal); + Assert.DoesNotContain("due date", ex.Message, StringComparison.OrdinalIgnoreCase); } [Fact] @@ -187,6 +189,8 @@ public class WorkOrderBoardUpdateServiceTests }, "actor-1")); Assert.Equal("PastDueStatusBlocked", ex.Code); + Assert.Contains("Schedule On", ex.Message, StringComparison.Ordinal); + Assert.DoesNotContain("due date", ex.Message, StringComparison.OrdinalIgnoreCase); } [Fact]