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

Add sales find feature #136

Merged
merged 22 commits into from
Oct 28, 2020
Merged

Conversation

Persdre
Copy link

@Persdre Persdre commented Oct 27, 2020

No description provided.

Persdre and others added 12 commits October 22, 2020 00:22
… into branch-v1.3-DG-WangQian

* 'branch-v1.3-DG-WangQian' of https://github.com/Persdre/tp:
  Update StorageClassDiagram.png
  Update JsonIngredientBookStorageTest.java
  Updated DG
  Update JsonIngredientBookStorageTest.java
  Update SetCommand.java
  Update diagram
  Update to pass CheckStyle
  Add more tests
  Add tests
  Implement Ingredient Storage
  Create IngredientListSequenceDiagram.puml
  Implement ingredient storage

# Conflicts:
#	src/main/java/seedu/address/model/Model.java
#	src/main/java/seedu/address/model/UserPrefs.java
@Persdre Persdre self-assigned this Oct 27, 2020
@Persdre Persdre added priority.Medium Nice to have type.Task Something that needs to be done, but not a story, bug, or an epic. labels Oct 27, 2020
@Persdre Persdre added this to the v1.3 milestone Oct 27, 2020
@codecov-io
Copy link

Codecov Report

Merging #136 into master will increase coverage by 0.10%.
The diff coverage is 59.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #136      +/-   ##
============================================
+ Coverage     62.17%   62.27%   +0.10%     
- Complexity      601      608       +7     
============================================
  Files           111      115       +4     
  Lines          2176     2203      +27     
  Branches        262      265       +3     
============================================
+ Hits           1353     1372      +19     
- Misses          733      738       +5     
- Partials         90       93       +3     
Impacted Files Coverage Δ Complexity Δ
...main/java/seedu/address/commons/core/Messages.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
.../seedu/address/logic/parser/AddressBookParser.java 66.66% <0.00%> (-2.30%) 16.00 <0.00> (ø)
src/main/java/seedu/address/model/Model.java 66.66% <ø> (ø) 4.00 <0.00> (ø)
...el/sales/exception/SalesBookNotFoundException.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
src/main/java/seedu/address/ui/HelpWindow.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
.../address/model/InputContainsKeywordsPredicate.java 42.85% <42.85%> (ø) 1.00 <1.00> (?)
...u/address/logic/parser/SalesFindCommandParser.java 57.14% <57.14%> (ø) 2.00 <2.00> (?)
...seedu/address/logic/commands/SalesFindCommand.java 77.77% <77.77%> (ø) 3.00 <3.00> (?)
...seedu/address/logic/commands/SalesListCommand.java 100.00% <100.00%> (ø) 3.00 <0.00> (ø)
src/main/java/seedu/address/model/UserPrefs.java 71.11% <100.00%> (+0.65%) 11.00 <0.00> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08f015e...cb9f4c3. Read the comment docs.

@Persdre Persdre linked an issue Oct 27, 2020 that may be closed by this pull request
Copy link

@ureshiiYing ureshiiYing left a comment

Choose a reason for hiding this comment

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

Implementation part is LGTM. I have generally left comments about cleaning up code and some suggestions about the UG/DG.

Format: `s-find KEYWORD [MORE_KEYWORDS]`

* The search is case-insensitive. e.g `bsbbt` will match `BSBBT`.
* Only the drink's short form name is searched.

Choose a reason for hiding this comment

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

Instead of saying short form name, abbreviation 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! Changing now:)

* The search is case-insensitive. e.g `bsbbt` will match `BSBBT`.
* Only the drink's short form name is searched.
* Only full words will be matched e.g. `BSB` will not match `BSBBT`.
* Drinks matching at least one keyword will be returned (i.e. `OR` search).

Choose a reason for hiding this comment

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

Saying OR search may not be that user-friendly?

Copy link
Author

Choose a reason for hiding this comment

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

en, yes, I agree. I understand but maybe users' can't. I will give a concrete example in the bracket. Thanks~


##### Aspect: How to find drink's sales data

* **Alternative 1 (current choice):** Obtain the drink's name entered by the user, and use the

Choose a reason for hiding this comment

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

Since you only stated one implementation, calling it Alternative 1 may not be that good? Since there was no other alternatives considered.

Copy link
Author

Choose a reason for hiding this comment

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

hh ok I copied the format from original UG. I will delete alternative one here.

src/main/java/seedu/address/model/UserPrefs.java Outdated Show resolved Hide resolved
Comment on lines 62 to 71
// @Test
// public void execute_multipleKeywords_multipleDrinksFound() {
// String expectedMessage = String.format(MESSAGE_DRINKS_LISTED_OVERVIEW, 3);
// InputContainsKeywordsPredicate predicate = preparePredicate("BSBMT BSPM BSBBT");
// SalesFindCommand command = new SalesFindCommand(predicate);
// expectedModel.updateFilteredSalesList(predicate);
// assertCommandSuccess(command, model, expectedMessage, expectedModel);
// assertEquals(Arrays.asList(), model.getFilteredSalesRecordList());
// }

Choose a reason for hiding this comment

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

Remember to delete this test if unused.

Copy link
Author

Choose a reason for hiding this comment

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

thanks

Diwu-Yi
Diwu-Yi previously approved these changes Oct 28, 2020
Copy link

@Diwu-Yi Diwu-Yi left a comment

Choose a reason for hiding this comment

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

LGTM

yanbingtao
yanbingtao previously approved these changes Oct 28, 2020
Copy link

@yanbingtao yanbingtao left a comment

Choose a reason for hiding this comment

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

LGTM

@Persdre Persdre dismissed stale reviews from yanbingtao and Diwu-Yi via 3d1146d October 28, 2020 11:52
Copy link

@yanbingtao yanbingtao left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@Diwu-Yi Diwu-Yi left a comment

Choose a reason for hiding this comment

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

LGTM

@yanbingtao yanbingtao merged commit a759a03 into AY2021S1-CS2103T-T12-2:master Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority.Medium Nice to have type.Task Something that needs to be done, but not a story, bug, or an epic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As a store manager, I can find a specific drink's sales data
5 participants