RachelChua / pe

0 stars 0 forks source link

Wrong behaviour of the edit command #4

Open RachelChua opened 1 year ago

RachelChua commented 1 year ago

image.png

The uid i tried to edit was a nurse, instead of the patient. Yet, the error message says uid gives a patient. I should be able to edit the unavailable dates of a nurse stated in the userguide but was unable to do so.

nus-pe-script commented 1 year ago

Team's Response

This both errors are caused by the same part of the code. Thus, duplication.

    if (isNurse && (hasDateSlotIndexes || hasDatesSlots)) {
        throw new CommandException(MESSAGE_NURSE_INVALID_DATESLOT_EDIT);
    }
    if (hasUnavailableDates || hasUnavailableDateIndexes) {
        throw new CommandException(MESSAGE_PATIENT_INVALID_UNAVAILABLE_DATE_EDIT);
    }

The 'Original' Bug

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

Unavailable date not working as expected

image.png

Steps To Reproduce

  1. Add a nurse
  2. Add an unavailable date to nurse

Expected Behaviour

Adds the unavailable date to nurse.

Actual Behaviour

Displays an error message indicating that user is a patient, even though UID points to valid nurse.

Other Remarks

  1. None

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

Their Response to the 'Original' Bug

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

No details provided by team.

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.Medium] Originally [severity.Low]

Reason for disagreement: [replace this with your explanation]