From 595e4eed27d3e2016bd154a7bbb584a56ca3ac60 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Sun, 6 Oct 2024 00:53:21 +0200 Subject: [PATCH] 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. --- .../event_apply/EventAppFormData.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/alttd/forms/controlers/event_apply/EventAppFormData.java b/src/main/java/com/alttd/forms/controlers/event_apply/EventAppFormData.java index 0ad47a3..ee49dcd 100644 --- a/src/main/java/com/alttd/forms/controlers/event_apply/EventAppFormData.java +++ b/src/main/java/com/alttd/forms/controlers/event_apply/EventAppFormData.java @@ -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); }