diff --git a/src/Geopilot.Api/ContextExtensions.cs b/src/Geopilot.Api/ContextExtensions.cs index c427502e..51b15d88 100644 --- a/src/Geopilot.Api/ContextExtensions.cs +++ b/src/Geopilot.Api/ContextExtensions.cs @@ -119,7 +119,7 @@ public static void SeedMandates(this Context context) .RuleFor(o => o.Name, f => f.Commerce.ProductName()) .RuleFor(o => o.FileTypes, f => f.PickRandom(knownFileFormats, 4).Distinct().ToArray()) .RuleFor(o => o.EvaluatePrecursorDelivery, f => f.PickRandom()) - .RuleFor(o => o.EvaluatePartial, f => f.PickRandom()) + .RuleFor(o => o.EvaluatePartial, f => f.PickRandom(FieldEvaluationType.NotEvaluated, FieldEvaluationType.Required)) .RuleFor(o => o.EvaluateComment, f => f.PickRandom()) .RuleFor(o => o.SpatialExtent, f => GetExtent()) .Ignore(o => o.Coordinates) diff --git a/src/Geopilot.Api/Models/Mandate.cs b/src/Geopilot.Api/Models/Mandate.cs index b4d3cc03..5a1cbfcb 100644 --- a/src/Geopilot.Api/Models/Mandate.cs +++ b/src/Geopilot.Api/Models/Mandate.cs @@ -1,4 +1,5 @@ using NetTopologySuite.Geometries; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Text.Json.Serialization; @@ -50,6 +51,7 @@ public class Mandate /// Defines how is evaluated. /// [Column(TypeName = "varchar(12)")] + [AllowedValues(FieldEvaluationType.NotEvaluated, FieldEvaluationType.Required)] public FieldEvaluationType EvaluatePartial { get; set; } ///