Skip to content

Commit

Permalink
Merge pull request AY2324S1-CS2103-F13-2#111 from nixonwidjaja/name-c…
Browse files Browse the repository at this point in the history
…onstraint

Improve name constraint
  • Loading branch information
sheryew authored Oct 31, 2023
2 parents f0f77ca + be9b370 commit 96c3a0e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ HR Insight is a **desktop app for HR people, optimized for use via a Line Interf
- Parameters can be in any order.<br>
e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable.

- Parameters given outside the command format will be ignored.<br>
e.g. `list [d/DEPARTMENT]` only accepts `d/` parameter. `list z/all` will be treated the same as `list` since HRInsight will ignore parameters outside the command format.

- We allow all employee names, not limited to alphanumeric names, to accommodate names such as `X AE A-Xii`, `dr. Adam Smith, Ph.D.`, and `$helly`.

- All words in parameters given cannot start with the prefixes in that command.<Br>
e.g. `add` command requires `n/ p/ e/ a/ s/ b/ d/ dob/​` prefixes.<br>
Therefore, names given in `add` command cannot contain these prefixes because they have been reserved for that command.<br>
This constraint applies for all words in all parameters in that command.<Br>
To accommodate names with `s/o` or `d/o`, we recommend to use `S/O` or `D/O` instead.

- If you are using a PDF version of this document, be careful when copying and pasting commands that span multiple lines as space characters surrounding line-breaks may be omitted when copied over to the application.
</div>

Expand Down
Binary file modified src/main/resources/images/address_book_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/test/java/seedu/address/model/person/NameTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void isValidName() {
// valid name
assertTrue(Name.isValidName("^"));
assertTrue(Name.isValidName("peter*"));
assertTrue(Name.isValidName("Muhammad s/o Ali"));
assertTrue(Name.isValidName("Muhammad S/O Ali"));
assertTrue(Name.isValidName("X AE A-12"));
assertTrue(Name.isValidName("Exa Dark Sideræl"));
assertTrue(Name.isValidName("$helly"));
Expand Down

0 comments on commit 96c3a0e

Please sign in to comment.