From d9ebe09e5947c3b88e300dbbce77f7d6fc96d870 Mon Sep 17 00:00:00 2001 From: Guan Quan <76832850+guanquann@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:58:55 +0800 Subject: [PATCH 1/2] Add input constraints to UG --- docs/UserGuide.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 392d8af317c..8c7ca68e232 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -10,6 +10,7 @@ pageNav: 3 - [Introduction](#introduction) - [About](#about) - [Quick Start](#quick-start) +- [Input Constraints](#input-constraints) - [Features](#features) - [Adding a contact : add](#adding-a-contact-add) - [Listing all contacts : list](#listing-all-contacts-list) @@ -94,6 +95,30 @@ This user guide provides in-depth documentation on GourmetGrid's installation pr -------------------------------------------------------------------------------------------------------------------- +## Input Constraints + +* Name and company should only contain alphanumeric characters, spaces, hyphens and/or apostrophes, and should not be blank. + +* Phone number should only contain numbers and should be at least 3 digits long. + +* Emails should be of the format `local-part@domain` and adhere to the following constraints: + + * The local-part should only contain alphanumeric characters and these special characters, excluding the parentheses, `(+_.-)`. The local-part may not start or end with any special characters. + + * This is followed by a `@` and then a domain name. The domain name is made up of domain labels separated by periods. + + * The domain name must: + + * end with a domain label at least 2 characters long. + + * have each domain label start and end with alphanumeric characters. + + * have each domain label consist of alphanumeric characters, separated only by hyphens, if any. + +* Address and remark should not contain any words that begin with reserved terms such as `n/`, `p/`, `d/` that indicate other parameters. + +* Date should be in the format `YYYY-MM-DD`, where `YYYY` is the year (all the digits, i.e. 2012), `MM` is the month (01 to 12) and `DD` is the day (01 to 31). + ## Features @@ -134,12 +159,6 @@ Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS c/COMPANY [t/TAG]…​` **Notes:** -* Name and company should only contain alphanumeric characters, spaces, hyphens and/or apostrophes, and should not be blank. - -* Phone number should only contain numbers and should be at least 3 digits long. - -* Address should not contain any words that begin with reserved terms (`n/`, `p/`, `e/`, `c/`, `t/`) that indicate other parameters. - * A contact can have any number of tags (including 0). * Two contacts cannot share the same name, as names are used to uniquely identify individuals within the system. @@ -354,8 +373,6 @@ Format: `addorder INDEX d/DATE r/REMARK` * A contact can have any number of orders (including 0). * You can add multiple orders with identical remarks and dates to the same contact. This functionality is designed to accommodate the need for duplicating orders efficiently during periods of high demand, eliminating the need to delete and re-enter the original order. - -* Remark should not contain any words that begin with reserved term (`d/`) that indicate the date parameter. Examples: From 518392e6246fee32535de8e3b04389c07eb280af Mon Sep 17 00:00:00 2001 From: Guan Quan <76832850+guanquann@users.noreply.github.com> Date: Mon, 15 Apr 2024 23:07:01 +0800 Subject: [PATCH 2/2] Make constraint message for UG clearer --- docs/UserGuide.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 8c7ca68e232..eade50ebc1f 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -101,7 +101,7 @@ This user guide provides in-depth documentation on GourmetGrid's installation pr * Phone number should only contain numbers and should be at least 3 digits long. -* Emails should be of the format `local-part@domain` and adhere to the following constraints: +* Email should be of the format `local-part@domain` and adhere to the following constraints: * The local-part should only contain alphanumeric characters and these special characters, excluding the parentheses, `(+_.-)`. The local-part may not start or end with any special characters. @@ -115,7 +115,9 @@ This user guide provides in-depth documentation on GourmetGrid's installation pr * have each domain label consist of alphanumeric characters, separated only by hyphens, if any. -* Address and remark should not contain any words that begin with reserved terms such as `n/`, `p/`, `d/` that indicate other parameters. +Address should not contain any words that begin with reserved terms (`n/`, `p/`, `e/`, `c/`, `t/`) that indicate other parameters. + +Remark should not contain any words that begin with reserved terms (`d/`) that indicate the date parameter. * Date should be in the format `YYYY-MM-DD`, where `YYYY` is the year (all the digits, i.e. 2012), `MM` is the month (01 to 12) and `DD` is the day (01 to 31).