From 7231c1c9c691498ed4f653c143a0beb57f698203 Mon Sep 17 00:00:00 2001 From: JerryWang0000 Date: Sun, 14 Apr 2024 06:33:23 +0800 Subject: [PATCH 1/3] Update the faculty names to the latest --- docs/UserGuide.md | 25 +++++++++---------- .../staffconnect/model/person/Faculty.java | 3 +-- .../PersonHasFacultyPredicateTest.java | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index bc2f9f33815..0a22dc7caae 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -492,18 +492,18 @@ Therefore, edit the data file only if you are confident that you can update it c ## Attribute summary -Attribute | Prefix | Restrictions | Examples -----------|--------|--------------|--------------------- -Name[^1] | n/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `alex yeoh`, `Bernice Yu`, `test1` -Phone Number[^1] | p/ | Numeric digits only, no special characters, at least 3 digits long. | `123`, `88888888, 12345678` +Attribute | Prefix | Restrictions | Examples +----------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------- +Name[^1] | n/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `alex yeoh`, `Bernice Yu`, `test1` +Phone Number[^1] | p/ | Numeric digits only, no special characters, at least 3 digits long. | `123`, `88888888, 12345678` Email[^1] | e/ | Valid email of the format `local-part@domain`.
1. `local-part` should only contain alphanumeric characters and the special characters `+_.-`
2. `local-part` may not start or end with any special characters.
3. `local-part` must be followed by exactly one `@` and then a `domain` name.
4. `domain` must be made up of at least 2 `domain` labels separated by periods.
5. Each `domain` name must be at least 2 alphanumeric characters long.
6. Each `domain` name must start and end with alphanumeric characters.
7. Each `domain` name can only consist of alphanumeric characters, separated by hyphens, if any. | `e@123.com`, `hello@h-h.com`, `one+two@h-h.hh`, `hello@e-h.e-hh` -Module[^1] | m/ | Case-insensitive.
Valid module consisting of 2-4 letters, followed by exactly 4 numeric digits, with a suffix that is at most 2 characters long. | `gess1025`, `hsi1000`, `cs2103t` -Faculty[^1] | f/ | Case-insensitive.
Restricted set of values (refer to [valid faculty values](#valid-faculty-values) below). | `soc`, `biz`, `School of Business` -Venue[^1] | v/ | Any characters allowed, cannot be empty. | `belobog avenue`, `COM4-02-33`, `LT21`, `Kent Ridge Vale, Tulip Street, #12-34` -Tag | t/ | Case-sensitive.
Only alphanumeric characters allowed.
Person can have any number of tags. | `tutor`, `professor`, `BestProf`, `Number1TA` -Availability | a/ | Valid format of `day start-time end-time`.
Person can have any number of availabilities.
1. `day` should be a valid day of week: `Monday`, `mon`, `Tuesday`, `tue`, `tues`, `Wednesday`, `wednes`, `wed`, `Thursday`, `thurs`, `thur`, `thu`, `Friday`, `fri`, `Saturday`, `satur`, `sat`, `Sunday`, `sun`.
2. `day` is case-insensitive.
3. `start-time` and `end-time` should be in the time format of `HH:mm` where `HH` is in 24 hours (00-23) and `mm` are valid minutes (00-59). | `mon 13:00 14:00`, `monday 13:00 14:00`, `tues 14:00 21:00` -Meeting Description | d/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `Meet for finals`, `Midterm revision` -Meeting Start Time | s/ | Valid date and time format.
1. Valid date formats: `yyyy-MM-dd`, `yyyy-M-d`, `dd-MM-yyyy`, `yyyy-MM-d`, `d-MM-yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `d/MM/yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `dd/MM/yyyy`, `yyyy/MM/dd`, `yyyy/MM/d`, `yyyy/M/dd`, `yyyy/M/d`
where `yyyy` is a 4-digit year (0000-9999), `M` is a single digit month (1-9), `MM` is a valid month (01-12), `d` is a single digit day (1-9), `dd` is a valid day (01-31)
2. Valid time formats: `HH:mm`, `H:mm`, `HHmm`
where `H` is a single digit hour (1-9), `HH` is a valid 24-hour (00-23), `mm` are valid minutes (00-59). | `2002-11-02 19:00`, `1-12-2022 9:00`, `2024/1/1 0000` +Module[^1] | m/ | Case-insensitive.
Valid module consisting of 2-4 letters, followed by exactly 4 numeric digits, with a suffix that is at most 2 characters long. | `gess1025`, `hsi1000`, `cs2103t` +Faculty[^1] | f/ | Case-insensitive.
Restricted set of values (refer to [valid faculty values](#valid-faculty-values) below).
A valid faculty name and its variations(other names) all refer to the same faculty. | `soc`, `biz`, `School of Business` +Venue[^1] | v/ | Any characters allowed.
Cannot be empty. | `belobog avenue`, `COM4-02-33`, `LT21`, `Kent Ridge Vale, Tulip Street, #12-34` +Tag | t/ | Case-sensitive.
Only alphanumeric characters allowed.
Person can have any number of tags. | `tutor`, `professor`, `BestProf`, `Number1TA` +Availability | a/ | Valid format of `day start-time end-time`.
Person can have any number of availabilities.
1. `day` should be a valid day of week: `Monday`, `mon`, `Tuesday`, `tue`, `tues`, `Wednesday`, `wednes`, `wed`, `Thursday`, `thurs`, `thur`, `thu`, `Friday`, `fri`, `Saturday`, `satur`, `sat`, `Sunday`, `sun`.
2. `day` is case-insensitive.
3. `start-time` and `end-time` should be in the time format of `HH:mm` where `HH` is in 24 hours (00-23) and `mm` are valid minutes (00-59). | `mon 13:00 14:00`, `monday 13:00 14:00`, `tues 14:00 21:00` +Meeting Description | d/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `Meet for finals`, `Midterm revision` +Meeting Start Time | s/ | Valid date and time format.
1. Valid date formats: `yyyy-MM-dd`, `yyyy-M-d`, `dd-MM-yyyy`, `yyyy-MM-d`, `d-MM-yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `d/MM/yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `dd/MM/yyyy`, `yyyy/MM/dd`, `yyyy/MM/d`, `yyyy/M/dd`, `yyyy/M/d`
where `yyyy` is a 4-digit year (0000-9999), `M` is a single digit month (1-9), `MM` is a valid month (01-12), `d` is a single digit day (1-9), `dd` is a valid day (01-31)
2. Valid time formats: `HH:mm`, `H:mm`, `HHmm`
where `H` is a single digit hour (1-9), `HH` is a valid 24-hour (00-23), `mm` are valid minutes (00-59). | `2002-11-02 19:00`, `1-12-2022 9:00`, `2024/1/1 0000` [^1]: Mandatory when adding a person into the staff book, as these are important information for students to know when/where to consult their professors/TAs. @@ -516,9 +516,8 @@ Business School | Business, Biz School, Biz School of Computing | Computing, SoC School of Continuing and Lifelong Education | Continuing and Lifelong Education, SCALE Faculty of Dentistry | Dentistry -School of Design and Environment | Design and Environment, SDE +College of Design and Engineering | Design and Engineering, CDE Duke-NUS Medical School | Duke-NUS -Faculty of Engineering, Engineering | FoE Integrative Sciences and Engineering | ISEP Faculty of Law | Law Yong Loo Lin School of Medicine | Medicine diff --git a/src/main/java/staffconnect/model/person/Faculty.java b/src/main/java/staffconnect/model/person/Faculty.java index 2b1d2127bee..65084e73ab5 100644 --- a/src/main/java/staffconnect/model/person/Faculty.java +++ b/src/main/java/staffconnect/model/person/Faculty.java @@ -26,9 +26,8 @@ public enum FacultyName { CONTINUING_AND_LIFELONG_EDUCATION("School of Continuing and Lifelong Education", "Continuing and Lifelong Education", "SCALE"), DENTISTRY("Faculty of Dentistry", "Dentistry"), - DESIGN_AND_ENVIRONMENT("School of Design and Environment", "Design and Environment", "SDE"), + DESIGN_AND_ENGINEERING("College of Design and Environment", "Design and Engineering", "CDE"), DUKE_NUS_MEDICAL_SCHOOL("Duke-NUS Medical School", "Duke-NUS"), - ENGINEERING("Faculty of Engineering", "Engineering", "FoE"), INTEGRATIVE_SCIENCES_AND_ENGINEERING("Integrative Sciences and Engineering", "ISEP"), LAW("Faculty of Law", "Law"), MEDICINE("Yong Loo Lin School of Medicine", "Medicine", "School of Medicine"), diff --git a/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java b/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java index 3db3009ced2..58b17d1c507 100644 --- a/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java +++ b/src/test/java/staffconnect/model/person/predicates/PersonHasFacultyPredicateTest.java @@ -58,7 +58,7 @@ public void test_personDoesNotHaveFaculty_returnsFalse() { @Test public void toStringMethod() { - Faculty faculty = new Faculty("Engineering"); + Faculty faculty = new Faculty("CDE"); PersonHasFacultyPredicate predicate = new PersonHasFacultyPredicate(faculty); String expected = PersonHasFacultyPredicate.class.getCanonicalName() + "{faculty=" + faculty + "}"; From 8437bdce58aaaabf611b715d17f13b29899dc1d3 Mon Sep 17 00:00:00 2001 From: JerryWang0000 Date: Sun, 14 Apr 2024 06:34:22 +0800 Subject: [PATCH 2/3] Fix a typo --- src/main/java/staffconnect/model/person/Faculty.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/staffconnect/model/person/Faculty.java b/src/main/java/staffconnect/model/person/Faculty.java index 65084e73ab5..0c92562f3d5 100644 --- a/src/main/java/staffconnect/model/person/Faculty.java +++ b/src/main/java/staffconnect/model/person/Faculty.java @@ -26,7 +26,7 @@ public enum FacultyName { CONTINUING_AND_LIFELONG_EDUCATION("School of Continuing and Lifelong Education", "Continuing and Lifelong Education", "SCALE"), DENTISTRY("Faculty of Dentistry", "Dentistry"), - DESIGN_AND_ENGINEERING("College of Design and Environment", "Design and Engineering", "CDE"), + DESIGN_AND_ENGINEERING("College of Design and Engineering", "Design and Engineering", "CDE"), DUKE_NUS_MEDICAL_SCHOOL("Duke-NUS Medical School", "Duke-NUS"), INTEGRATIVE_SCIENCES_AND_ENGINEERING("Integrative Sciences and Engineering", "ISEP"), LAW("Faculty of Law", "Law"), From 68d68d2f952eed20963396fe94498cb22ccfeca7 Mon Sep 17 00:00:00 2001 From: JerryWang0000 Date: Sun, 14 Apr 2024 06:44:45 +0800 Subject: [PATCH 3/3] Fix the formating --- docs/UserGuide.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 0a22dc7caae..bce538b8cca 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -492,19 +492,18 @@ Therefore, edit the data file only if you are confident that you can update it c ## Attribute summary -Attribute | Prefix | Restrictions | Examples -----------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------- -Name[^1] | n/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `alex yeoh`, `Bernice Yu`, `test1` -Phone Number[^1] | p/ | Numeric digits only, no special characters, at least 3 digits long. | `123`, `88888888, 12345678` +Attribute | Prefix | Restrictions | Examples +----------|--------|--------------|--------------------- +Name[^1] | n/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `alex yeoh`, `Bernice Yu`, `test1` +Phone Number[^1] | p/ | Numeric digits only, no special characters, at least 3 digits long. | `123`, `88888888, 12345678` Email[^1] | e/ | Valid email of the format `local-part@domain`.
1. `local-part` should only contain alphanumeric characters and the special characters `+_.-`
2. `local-part` may not start or end with any special characters.
3. `local-part` must be followed by exactly one `@` and then a `domain` name.
4. `domain` must be made up of at least 2 `domain` labels separated by periods.
5. Each `domain` name must be at least 2 alphanumeric characters long.
6. Each `domain` name must start and end with alphanumeric characters.
7. Each `domain` name can only consist of alphanumeric characters, separated by hyphens, if any. | `e@123.com`, `hello@h-h.com`, `one+two@h-h.hh`, `hello@e-h.e-hh` -Module[^1] | m/ | Case-insensitive.
Valid module consisting of 2-4 letters, followed by exactly 4 numeric digits, with a suffix that is at most 2 characters long. | `gess1025`, `hsi1000`, `cs2103t` -Faculty[^1] | f/ | Case-insensitive.
Restricted set of values (refer to [valid faculty values](#valid-faculty-values) below).
A valid faculty name and its variations(other names) all refer to the same faculty. | `soc`, `biz`, `School of Business` -Venue[^1] | v/ | Any characters allowed.
Cannot be empty. | `belobog avenue`, `COM4-02-33`, `LT21`, `Kent Ridge Vale, Tulip Street, #12-34` -Tag | t/ | Case-sensitive.
Only alphanumeric characters allowed.
Person can have any number of tags. | `tutor`, `professor`, `BestProf`, `Number1TA` -Availability | a/ | Valid format of `day start-time end-time`.
Person can have any number of availabilities.
1. `day` should be a valid day of week: `Monday`, `mon`, `Tuesday`, `tue`, `tues`, `Wednesday`, `wednes`, `wed`, `Thursday`, `thurs`, `thur`, `thu`, `Friday`, `fri`, `Saturday`, `satur`, `sat`, `Sunday`, `sun`.
2. `day` is case-insensitive.
3. `start-time` and `end-time` should be in the time format of `HH:mm` where `HH` is in 24 hours (00-23) and `mm` are valid minutes (00-59). | `mon 13:00 14:00`, `monday 13:00 14:00`, `tues 14:00 21:00` -Meeting Description | d/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `Meet for finals`, `Midterm revision` -Meeting Start Time | s/ | Valid date and time format.
1. Valid date formats: `yyyy-MM-dd`, `yyyy-M-d`, `dd-MM-yyyy`, `yyyy-MM-d`, `d-MM-yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `d/MM/yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `dd/MM/yyyy`, `yyyy/MM/dd`, `yyyy/MM/d`, `yyyy/M/dd`, `yyyy/M/d`
where `yyyy` is a 4-digit year (0000-9999), `M` is a single digit month (1-9), `MM` is a valid month (01-12), `d` is a single digit day (1-9), `dd` is a valid day (01-31)
2. Valid time formats: `HH:mm`, `H:mm`, `HHmm`
where `H` is a single digit hour (1-9), `HH` is a valid 24-hour (00-23), `mm` are valid minutes (00-59). | `2002-11-02 19:00`, `1-12-2022 9:00`, `2024/1/1 0000` - +Module[^1] | m/ | Case-insensitive.
Valid module consisting of 2-4 letters, followed by exactly 4 numeric digits, with a suffix that is at most 2 characters long. | `gess1025`, `hsi1000`, `cs2103t` +Faculty[^1] | f/ | Case-insensitive.
Restricted set of values (refer to [valid faculty values](#valid-faculty-values) below).
A valid faculty name and its variations(other names) all refer to the same faculty. | `soc`, `biz`, `School of Business` +Venue[^1] | v/ | Any characters allowed.
Cannot be empty. | `belobog avenue`, `COM4-02-33`, `LT21`, `Kent Ridge Vale, Tulip Street, #12-34` +Tag | t/ | Case-sensitive.
Only alphanumeric characters allowed.
Person can have any number of tags. | `tutor`, `professor`, `BestProf`, `Number1TA` +Availability | a/ | Valid format of `day start-time end-time`.
Person can have any number of availabilities.
1. `day` should be a valid day of week: `Monday`, `mon`, `Tuesday`, `tue`, `tues`, `Wednesday`, `wednes`, `wed`, `Thursday`, `thurs`, `thur`, `thu`, `Friday`, `fri`, `Saturday`, `satur`, `sat`, `Sunday`, `sun`.
2. `day` is case-insensitive.
3. `start-time` and `end-time` should be in the time format of `HH:mm` where `HH` is in 24 hours (00-23) and `mm` are valid minutes (00-59). | `mon 13:00 14:00`, `monday 13:00 14:00`, `tues 14:00 21:00` +Meeting Description | d/ | Case-sensitive.
Only alphanumeric characters allowed. Spaces are only allowed between alphanumeric characters. | `Meet for finals`, `Midterm revision` +Meeting Start Time | s/ | Valid date and time format.
1. Valid date formats: `yyyy-MM-dd`, `yyyy-M-d`, `dd-MM-yyyy`, `yyyy-MM-d`, `d-MM-yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `d/MM/yyyy`, `d-M-yyyy`, `dd-M-yyyy`, `dd/MM/yyyy`, `yyyy/MM/dd`, `yyyy/MM/d`, `yyyy/M/dd`, `yyyy/M/d`
where `yyyy` is a 4-digit year (0000-9999), `M` is a single digit month (1-9), `MM` is a valid month (01-12), `d` is a single digit day (1-9), `dd` is a valid day (01-31)
2. Valid time formats: `HH:mm`, `H:mm`, `HHmm`
where `H` is a single digit hour (1-9), `HH` is a valid 24-hour (00-23), `mm` are valid minutes (00-59). | `2002-11-02 19:00`, `1-12-2022 9:00`, `2024/1/1 0000` [^1]: Mandatory when adding a person into the staff book, as these are important information for students to know when/where to consult their professors/TAs. ### Valid `Faculty` values