Skip to content

Commit

Permalink
Limit EvaluatePartial to NotEvaluated and Required (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippluca authored Jan 14, 2025
2 parents 9333691 + 0989d19 commit eb2a5ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Geopilot.Api/ContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FieldEvaluationType>())
.RuleFor(o => o.EvaluatePartial, f => f.PickRandom<FieldEvaluationType>())
.RuleFor(o => o.EvaluatePartial, f => f.PickRandom(FieldEvaluationType.NotEvaluated, FieldEvaluationType.Required))
.RuleFor(o => o.EvaluateComment, f => f.PickRandom<FieldEvaluationType>())
.RuleFor(o => o.SpatialExtent, f => GetExtent())
.Ignore(o => o.Coordinates)
Expand Down
2 changes: 2 additions & 0 deletions src/Geopilot.Api/Models/Mandate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NetTopologySuite.Geometries;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

Expand Down Expand Up @@ -50,6 +51,7 @@ public class Mandate
/// Defines how <see cref="Delivery.Partial"/> is evaluated.
/// </summary>
[Column(TypeName = "varchar(12)")]
[AllowedValues(FieldEvaluationType.NotEvaluated, FieldEvaluationType.Required)]
public FieldEvaluationType EvaluatePartial { get; set; }

/// <summary>
Expand Down

0 comments on commit eb2a5ff

Please sign in to comment.