mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 07:13:12 +00:00
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.
This commit is contained in:
parent
c9a80f5c79
commit
4760f3fdd7
3 changed files with 9 additions and 1 deletions
|
|
@ -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 <c>20260730150000_WoIsAddOn</c> (SH-184). This migration is a no-op so
|
||||
/// both PRs can land without a duplicate column.
|
||||
/// </summary>
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20260813193000_SH121_BoardSearchFacets")]
|
||||
public partial class SH121_BoardSearchFacets : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue