LamJiuFong / pe

0 stars 0 forks source link

Wrong displayed age #5

Open LamJiuFong opened 9 months ago

LamJiuFong commented 9 months ago

original db - 2019-01-01 original da - 2019-02-02

edit 1 db/2019-03-03 allows user to change the db to a later date than the da.

while having the new db as 2019-03-03, the age is wrong, which will mislead the users.

Screenshot 2023-11-17 at 5.07.16 PM.png

nus-pe-script commented 9 months ago

Team's Response

Age is still correct based on the DOB if you calculate it, based on the date of the PE (17 November 2023 / 2023-11-17 (yyyy-MM-dd)). But we are going to accept that you can edit the DOB to be > DOA, which is a duplicate issue.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

Edit command does not check chronologicity for dates

Description

The edit command does not check for chronological error for dates after changing DOA/DOB.

Command used

edit 3 da/2023-11-12 db/2023-11-13 edit 4 db/2023-11-13 da/2023-11-12 edit 2 db/2022-09-10 edit 1 da/2022-09-08

Expected behavior

Error should have shown for chronological error of dates.

Actual behavior

The commands were executed without errors. The following part of logs shows the messages for respective commands.

Nov 17, 2023 4:44:30 PM seedu.address.logic.AnimalLogicManager execute
INFO: ----------------[USER COMMAND][edit 3 da/2023-11-12 db/2023-11-13]
Nov 17, 2023 4:44:30 PM seedu.address.ui.MainWindow executeCommand
INFO: Result: Animal has been edited from:
lmao; ID: 0000; Sex: Male; Species: dog; Breed: Husky; Date of Birth: 2001-01-19; Date of Admission: 2001-01-19 to:
lmao; ID: 0000; Sex: Male; Species: dog; Breed: Husky; Date of Birth: 2023-11-13; Date of Admission: 2023-11-12
Nov 17, 2023 4:47:42 PM seedu.address.logic.AnimalLogicManager execute
INFO: ----------------[USER COMMAND][edit 4 db/2023-11-13 db/2023-11-12]
Nov 17, 2023 4:47:42 PM seedu.address.ui.MainWindow executeCommand
INFO: An error occurred while executing command: edit 4 db/2023-11-13 db/2023-11-12
Nov 17, 2023 4:49:03 PM seedu.address.logic.AnimalLogicManager execute
INFO: ----------------[USER COMMAND][edit 4 db/2023-11-13 da/2023-11-12]
Nov 17, 2023 4:49:03 PM seedu.address.ui.MainWindow executeCommand
INFO: Result: Animal has been edited from:
Pookiejfnewjifernjfienivernvibeniprebnfierbnerbfneibvnweoifewbifewbifbewnifbnewifhnewpoufbewipfewijfewhfjhewwefibwdivhdiwbdviodbviodbvdivhbdivbdeoivbeuovbdihovbo; ID: 1235; Sex: Male; Species: Dog; Breed: Poodle; Date of Birth: 2019-01-01; Date of Admission: 2019-02-02 to:
Pookiejfnewjifernjfienivernvibeniprebnfierbnerbfneibvnweoifewbifewbifbewnifbnewifhnewpoufbewipfewijfewhfjhewwefibwdivhdiwbdviodbviodbvdivhbdivbdeoivbeuovbdihovbo; ID: 1235; Sex: Male; Species: Dog; Breed: Poodle; Date of Birth: 2023-11-13; Date of Admission: 2023-11-12
Nov 17, 2023 4:52:30 PM seedu.address.logic.AnimalLogicManager execute
INFO: ----------------[USER COMMAND][edit 2 db/2022-09-10]
Nov 17, 2023 4:52:30 PM seedu.address.ui.MainWindow executeCommand
INFO: Result: Animal has been edited from:
Bear; ID: 4321; Sex: Female; Species: Bear; Breed: Brown Bear; Date of Birth: 2015-09-09; Date of Admission: 2022-09-09 to:
Bear; ID: 4321; Sex: Female; Species: Bear; Breed: Brown Bear; Date of Birth: 2022-09-10; Date of Admission: 2022-09-09
Nov 17, 2023 4:55:41 PM seedu.address.logic.AnimalLogicManager execute
INFO: ----------------[USER COMMAND][edit 1 da/2022-09-08]
Nov 17, 2023 4:55:41 PM seedu.address.ui.MainWindow executeCommand
INFO: Result: Animal has been edited from:
Pookie; ID: 1234; Sex: Male; Species: Dog; Breed: Golden retriever; Date of Birth: 2022-09-09; Date of Admission: 2022-09-09 to:
Pookie; ID: 1234; Sex: Male; Species: Dog; Breed: Golden retriever; Date of Birth: 2022-09-09; Date of Admission: 2022-09-08

Screenshot

Screenshot 2023-11-17 165956.png Screenshot 2023-11-17 165958.png Screenshot 2023-11-17 170002.png Screenshot 2023-11-17 170002.png


[original: nus-cs2103-AY2324S1/pe-interim#5735] [original labels: type.FunctionalityBug severity.Medium]

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

We do agree that this is a functionality bug, but it is a rare situation to change DOB/DOA. In the case that the user wants to edit the dates, it is likely that the user would not edit either dates to violate the constraints, unless the animal is born and admitted into the shelter with only a few days/weeks gap, which could result in human error. Hence, this only causes minor inconvenience, unlikely to affect normal operations of the product.

Items for the Tester to Verify

:question: Issue duplicate status

Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)

Reason for disagreement: This is not a duplicate to the original bug.

The original bug report argues about how users can use the edit command to make db larger than da, mainly focusing on the behaviour of edit.

However, this bug report argues that the Age component displays the wrong result after editing the db to a new db. It focuses more on the displayed value of Age rather than the behaviour of edit. So it should not be counted as a duplicate bug as they are focusing on two different things.

Quoting Prof Damith's response on https://github.com/nus-cs2103-AY2324S1/forum/issues/542

Screenshot 2023-11-23 at 1.29.31 PM.png

Despite the developer team rejected the bug relate to Age in their response, but they still explicitly accepted as a bug instead of rejecting it. Hence I think this bug report should be accepted.


## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.Medium`] - [ ] I disagree **Reason for disagreement:** [replace this with your explanation]