Fix equipment creation blocked by maintenance interval validation
RecommendedMaintenanceIntervalDays was a non-nullable int with [Range(1,3650)], so submitting the form without filling it in bound to 0 and failed validation. Made nullable on the entity, both DTOs, and the one controller callsite that calls .AddDays() (now uses .Value). Migration applied. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@ public class Equipment : BaseEntity
|
||||
public string? Location { get; set; }
|
||||
|
||||
// Maintenance Information
|
||||
public int RecommendedMaintenanceIntervalDays { get; set; }
|
||||
public int? RecommendedMaintenanceIntervalDays { get; set; }
|
||||
public DateTime? LastMaintenanceDate { get; set; }
|
||||
public DateTime? NextScheduledMaintenance { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user