Add fields for good builds, bad builds, and technical aspects

These new fields enhance the event application form data by capturing more detailed information about the applicant's building experience and technical skills. This update includes new validations and ensures these fields are incorporated into the `toString` and `toHtml` methods.
This commit is contained in:
Teriuihi 2024-10-06 00:53:21 +02:00
parent a3fcab1c4b
commit 595e4eed27

View File

@ -13,7 +13,7 @@ public class EventAppFormData extends Form implements Mailable {
public EventAppFormData() {}
public EventAppFormData(String username, String email, String discord, int age, String pronoun, int avg_time, String event_experience, String discord_vc, String other) {
public EventAppFormData(String username, String email, String discord, int age, String pronoun, int avg_time, String event_experience, String discord_vc, String good_builds, String bad_builds, String technical_aspects, String other) {
this.username = username;
this.email = email;
this.discord = discord;
@ -22,6 +22,9 @@ public class EventAppFormData extends Form implements Mailable {
this.avg_time = avg_time;
this.event_experience = event_experience;
this.discord_vc = discord_vc;
this.good_builds = good_builds;
this.bad_builds = bad_builds;
this.technical_aspects = technical_aspects;
this.other = other;
}
@ -59,6 +62,18 @@ public class EventAppFormData extends Form implements Mailable {
@Pattern(regexp = "(?i)^(yes|no)$", message = "Yes or no")
public String discord_vc;
@NotEmpty(message = "Good build experience is required")
@Length(min = 2, max = 2000, message = "Good build experience should be between 2 and 2000 characters")
public String good_builds;
@NotEmpty(message = "Event experience is required")
@Length(min = 2, max = 2000, message = "Bad build experience between 2 and 2000 characters")
public String bad_builds;
@NotEmpty(message = "Technical aspects are required")
@Length(min = 2, max = 2000, message = "Technical aspects should be between 2 and 2000 characters")
public String technical_aspects;
@Length(max = 2000, message = "Text can't be longer than 2000 characters")
public String other;
@ -74,6 +89,9 @@ public class EventAppFormData extends Form implements Mailable {
", avg_time=" + avg_time +
", event_experience='" + event_experience + '\'' +
", discord_vc='" + discord_vc + '\'' +
", good_builds='" + good_builds + '\'' +
", bad_builds='" + bad_builds + '\'' +
", technical_aspects='" + technical_aspects + '\'' +
", other='" + other + '\'' +
'}';
}
@ -105,8 +123,8 @@ public class EventAppFormData extends Form implements Mailable {
@JsonIgnore
@Override
public String toHtml() {
String[] fields = {"Username", "Email", "Discord", "Age", "Pronoun", "Avg time", "Event experience", "Discord VC", "Other"};
String[] values = {username, email, discord, String.valueOf(age), pronoun, String.valueOf(avg_time), event_experience, discord_vc, other};
String[] fields = {"Username", "Email", "Discord", "Age", "Pronoun", "Avg time", "Event experience", "Discord VC", "Good builds", "Bad builds", "Technical aspects", "Other"};
String[] values = {username, email, discord, String.valueOf(age), pronoun, String.valueOf(avg_time), event_experience, discord_vc, good_builds, bad_builds, technical_aspects, other};
return toHtml(fields, values);
}