juzzztinsoong / pe

0 stars 0 forks source link

Edit command constraints on date of birth not present #1

Open juzzztinsoong opened 10 months ago

juzzztinsoong commented 10 months ago

Add command does not allow animals with a later date of birth than date of admission to be added, but edit command allows the date of birth to be later than date of admission, even though the user guide states that the same constraints for add command applies to edit command

nus-se-script commented 10 months ago

Team's Response

Duplicate. DOB < DOA was a constraint we did not check for the edit command.

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: [replace this with your explanation]