Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UG and DG #156

Merged
merged 11 commits into from
Oct 26, 2020
Merged

Update UG and DG #156

merged 11 commits into from
Oct 26, 2020

Conversation

Criss-Wang
Copy link

No description provided.

Copy link

@jeffreytjs jeffreytjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, UML diagrams will be reviewed in minutes


#### Path Execution of Delete Command

The workflow of an `Delete` Command when it is executed by a user is shown in the activity diagram below:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo, should be "workflow of a" instead

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can consider removing "it is" too

@@ -14,7 +14,7 @@ $spacing-unit: 30px !default;
$table-text-align: left !default;

// Width of the content area
$content-width: 800px !default;
$content-width: 1000px !default;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Expand the width of md?

@@ -83,6 +83,21 @@ public Product getProductByName(Name targetName) throws ProductNotFoundException
return matchedProduct;
}

/**
* Remove a product sold by the Warehouse.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removes

@@ -78,6 +78,21 @@ public Product getProductByName(Name targetName) throws ProductNotFoundException
return matchedProduct;
}

/**
* Remove a product sold by the Supplier.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removes

Copy link

@tohyuting tohyuting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor issues/suggestions you may want to consider! :)


#### Path Execution of Delete Command

The workflow of an `Delete` Command when it is executed by a user is shown in the activity diagram below:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a Delete command

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already fixed, thank!

Comment on lines +177 to +188
1. The target to delete is a `supplier`/`warehouse` <br>
CLI-nic finds the target `supplier`/`warehouse` at the specified `INDEX` of the displayed list, and remove it completely.

1. The `INDEX` specified is invalid (e.g. exceeds the length of the list) <br>
A **`CommandException`** error message wil be thrown.

1. The target to delete is a `product` in a particular 'supplier' <br>
CLI-nic finds the target `supplier` at the specified `INDEX` of the displayed supplier list, and retrieve its product list.<br>
It finds the `product` with specified `PRODUCT_NAME` and remove it from the product list.

1. No `product` has the `PRODUCT_NAME` in the target warehouse/supplier <br>
A **`CommandException`** error message wil be thrown.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the numbering be changed to "1. 2. 3. 4." ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this is the markdown standard actually.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, I didn't know that, sorry about that!:)

<center><i>Figure n. Delete Command Class Diagram</i></center>
<br>

Note that some commonly applied methods (like getter/setter methods for each attribute) are not included to reduce verbosity.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "such as" instead of like would be better in this sentence :)

Comment on lines 211 to 212
CLI-nic's `ClinicParser` will parse the user input and if the `delete` command word is present, the parser will try to parse the
input into a valid `DeleteCommand` via `DeleteCommandParser`. <br>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would "parse the input to generate a valid DeleteCommand" be better rather than "parse the input into a valid DeleteCommand"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right! Thanks for the suggestion!


If multiple entries of `ct/TYPE` or `i/INDEX` are found, the last entry will be used as the argument. <br>

Afterwards, all the valid arguments (`INDEX` and `TYPE`) will form a `DeleteCommand`, which will be executed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"form a DeleteCommand" sounds a bit weird, maybe "will create a new DeleteCommand" is better.


It then locates the warehouse/supplier entry that user wants to delete via the `INDEX` passed in.

Afterwards, `model#deleteWarehouse`/`model#deleteSupplier` will remove the target entry from the list in the `model`, and the `model` will then update the displayed list.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think splitting this long sentence up to shorter sentences would be clearer :) Maybe something along like:

Afterwards, model#deleteWarehouse/model#deleteSupplier will remove the target entry from the list in the model. The model will then update the displayed list.


The parsing workflow is the same except that now an additional field `pd/PRODUCT_NAME` will be checked (with both prefix and argument) and parsed. <br>

Afterwards, all the valid arguments (`INDEX`, `TYPE` and `PRODUCT_NAME`) will form a `DeleteCommand`, which will be executed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above, I think maybe using create would be more appropriate


Base on the classification, the model will again retrieve the relevant displayed list of warehouse/supplier via `model#getFilteredWarehouseList()`/`model#getFilteredSupplierList()`. <br>

It then locates the warehouse/supplier entry from whom the product to delete via the `INDEX` passed in.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a bit unclear to me, maybe "It then locates the respective warehouse/supplier entry at the INDEX passed in for deletion".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I guess my original intention is to establish the link between warehouse/supplier and the product to delete


Next, the product matching the required `PRODUCT_NAME` will be retrieved via `getProductByName`, and an updated target entry with this product removed will be returned through `removeProduct` call.

Afterwards, `model#setWarehouse`/`model#setSupplier` will replace the old entry with the updated target entry from the list in the `model`, and the `model` will then update the displayed list.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps breaking this long sentence up would be clearer as well! "replace the old entry with the updated target entry from the list in model . The model will then update the displayed list." would be better :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -75,6 +75,9 @@ and efficient Graphical User Interface interaction.

* Parameters can be in any order.<br>
e.g. if the command specifies `n/NAME p/PHONE`, `p/PHONE n/NAME` is also acceptable.

* If multiple arguments with same prefixes are in the input and all the values are valid, the last value is chosen. <br>
e.g. if the command specifies `ct/w ct/s`, because both `w` and `s` are valid, there is no error, and the type __s - supplier__ is chosen.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can consider to split up this long sentence as well. Maybe something like:

"if a user's input specifies ct/w ct/s where both w and s are valid, there will be no error thrown. However, the type s - supplier will be chosen instead.

@tohyuting tohyuting added this to the v1.3 milestone Oct 26, 2020
* `delete ct/w i/1` Removes the warehouse at index 1.
* `delete ct/s i/12` Removes supplier at index 12 from the list of suppliers.
* `delete ct/w i/1` Removes the warehouse at index 1 of the list of warehouses.
* `delete ct/s i/12` Removes supplier at index 12 of the list of suppliers.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps can add "the" like you did in warehouse

* The PRODUCT_NAME must be identifiable and starts with alphanumeric character.
* The TYPE specified should be one of these values: `pw` / `ps`.
* The INDEX must be a positive integer, not exceeding the total length of the displayed list.
* The PRODUCT_NAME must be an identifiable full name of the product chosen, and must starts with an alphanumeric character.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"start".
Also "an identifiable full name of the product" sounds a bit off, perhaps can change to "the"

* `delete supplier 12 pd/Aspirin` Removes product with the name _Aspirin_
from the supplier at index 12 of the list of suppliers.
<div markdown="span" class="alert alert-info">:information_source:
**Note:** If additional PRODUCT_NAME behind prefix `pd/` is added when the TYPE `ct/` given is "w" or "s", the PRODUCT_NAME will be ignored

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps can put "an".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I think the word "additional" is unecessary here also

Copy link

@tohyuting tohyuting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will be reading through UG/DG after merging everyone's requests to fix any phrasing/grammatical errors for UG/DG

@tohyuting tohyuting merged commit 2bc605e into AY2021S1-CS2103-W14-4:master Oct 26, 2020
jeffreytjs pushed a commit to jeffreytjs/CLI-nic that referenced this pull request Oct 27, 2020
jeffreytjs pushed a commit to jeffreytjs/CLI-nic that referenced this pull request Oct 27, 2020
jeffreytjs pushed a commit to jeffreytjs/CLI-nic that referenced this pull request Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants