0358763601
Removed minimum length constraints from SemifinalistActivity and Notes properties in the EventDefinition class to simplify validation requirements. This change enhances flexibility in data entry while maintaining the maximum length restrictions.
98 lines
3.2 KiB
C#
98 lines
3.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Core.Entities;
|
|
|
|
public class EventDefinition
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100, MinimumLength = 2)]
|
|
[Display(Name = "Event Name")]
|
|
public string Name { get; set; } = null!;
|
|
|
|
[Required]
|
|
[StringLength(40, MinimumLength = 2)]
|
|
[Display(Name = "Event Short Name")]
|
|
public string? ShortName { get; set; }
|
|
|
|
[Required]
|
|
public EventFormat EventFormat { get; set; }
|
|
|
|
[Range(1, 6)]
|
|
public int MinTeamSize { get; set; }
|
|
|
|
[Range(1, 6)]
|
|
public int MaxTeamSize { get; set; }
|
|
|
|
public string TeamSize =>
|
|
MinTeamSize == MaxTeamSize
|
|
? MinTeamSize.ToString()
|
|
: $"{MinTeamSize.ToString()}-{MaxTeamSize.ToString()}";
|
|
|
|
[StringLength(100)]
|
|
public string? SemifinalistActivity { get; set; }
|
|
|
|
public bool InterviewOrPresentation
|
|
=> SemifinalistActivity != null && (SemifinalistActivity.Contains("Interview") || SemifinalistActivity.Contains("Presentation"));
|
|
|
|
public bool OnSiteActivity { get; set; }
|
|
//=> SemifinalistActivity != null
|
|
// && (SemifinalistActivity.Contains("Challenge")
|
|
// || SemifinalistActivity.Contains("Race")
|
|
// || SemifinalistActivity.Contains("Speech")
|
|
// || SemifinalistActivity.Contains("Test")
|
|
// || SemifinalistActivity.Contains("Flight")
|
|
// || Name.Contains("Leadership")
|
|
// || Name.Contains("Forensic")
|
|
// || Name.Contains("Flight")
|
|
// || Name.Contains("Coding")
|
|
// || SemifinalistActivity.Contains("Debate")
|
|
// || SemifinalistActivity.Contains("Photography")
|
|
// || SemifinalistActivity.Contains("Build")
|
|
// || Name.Contains("Chapter")
|
|
// || Name.Contains("Podcast"));
|
|
|
|
[StringLength(1024)]
|
|
public string? Notes { get; set; }
|
|
|
|
[Range(0, 3)]
|
|
public int ChapterEligibilityCountRegionals { get; set; }
|
|
|
|
[Range(1, 3)]
|
|
public int ChapterEligibilityCountState { get; set; }
|
|
|
|
public bool RegionalEvent => ChapterEligibilityCountRegionals > 0;
|
|
|
|
public bool Presubmission { get; set; }
|
|
|
|
|
|
[StringLength(64)]
|
|
public string? Documentation { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(256)]
|
|
public string Eligibility { get; set; } = null!;
|
|
[StringLength(4096)]
|
|
public string? Theme { get; set; }
|
|
[StringLength(1024)]
|
|
public string? Description { get; set; }
|
|
public int? LevelOfEffort { get; set; }
|
|
|
|
public ICollection<Career> RelatedCareers { get; set; } = new List<Career>();
|
|
|
|
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
|
|
public string? RelatedCareersText { get; set; }
|
|
|
|
public override string ToString()
|
|
{
|
|
return Name;
|
|
}
|
|
|
|
public static readonly EventDefinition GeneralSchedule = new(){Name = "General Schedule"};
|
|
public static readonly EventDefinition MeetTheCandidates = new(){Name = "Meet the Candidates"};
|
|
public static readonly EventDefinition ChapterOfficerMeeting = new(){Name = "Chapter Officer Meeting"};
|
|
public static readonly EventDefinition VotingDelegateMeeting = new(){Name = "Voting Delegate Meeting"};
|
|
public static readonly EventDefinition SocialGathering = new(){Name = "Social Gathering"};
|
|
|
|
} |