LamJiuFong / pe

0 stars 0 forks source link

Allow to edit date of birth to a later date than date of admission #3

Open LamJiuFong opened 1 year ago

LamJiuFong commented 1 year 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

Screenshot 2023-11-17 at 5.08.18 PM.png

nus-se-bot commented 12 months ago

Team's Response

Duplicated. Edit command does not check for the DOB < DOA constraint, which was an oversight on our part.

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]


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