Skip to content

Commit ea0e338

Browse files
committed
Require VideoDuration for video sensor types
1 parent 9aadb8b commit ea0e338

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

backend/api/Controllers/Models/CustomMissionQuery.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
6060
[nameof(AcousticInspectionMetadata), nameof(SensorType)]
6161
);
6262
}
63+
64+
if (
65+
(SensorType == SensorType.Video || SensorType == SensorType.ThermalVideo)
66+
&& VideoDuration is null
67+
)
68+
{
69+
yield return new ValidationResult(
70+
$"{nameof(VideoDuration)} is required when {nameof(SensorType)} is {SensorType}.",
71+
[nameof(VideoDuration), nameof(SensorType)]
72+
);
73+
}
6374
}
6475
}
6576

0 commit comments

Comments
 (0)