nus-cs2103-AY2425S1 / pe-dev-response

0 stars 0 forks source link

Able to create appointments outside restricted timings and days via json modification #715

Open nus-se-script opened 1 week ago

nus-se-script commented 1 week ago

Issue

Via the modification of addressbook.json, user is able to add appointments that are during weekends and outside the allowed timing range of 0900-1600. However via schedule command the restrictions apply as per normal. user guide also mentioned The given date and time must fall on a weekday and on the hour between 0900 and 1600 inclusive. Example addressbook.json

{
  "persons" : [ {
    "name" : "john doe",
    "phone" : "98765432",
    "email" : "johnd@example.com",
    "address" : "311, Clementi Ave 2, #02-25",
    "schedules" : [ {
      "dateTime" : "2024-01-01 1601",
      "note" : "aaa",
      "isPaid" : false,
      "payment" : false
    }, {
      "dateTime" : "2024-01-01 1700",
      "note" : "aaa",
      "isPaid" : false,
      "payment" : false
    }, {
      "dateTime" : "2024-01-01 1600",
      "note" : "aaa",
      "isPaid" : false,
      "payment" : false
    }, {
      "dateTime" : "2024-11-16 1000",
      "note" : "aaa",
      "isPaid" : false,
      "payment" : false
    }, {
      "dateTime" : "2024-01-01 1559",
      "note" : "aaa",
      "isPaid" : false,
      "payment" : false
    } ],
    "reminderTime" : "1 day",
    "tags" : [ "arm pain" ]
  }, {
    "name" : "john",
    "phone" : "98765432",
    "email" : "johnd@example.com",
    "address" : "311, Clementi Ave 2, #02-25",
    "schedules" : [ {
      "dateTime" : "2024-11-29 0900",
      "note" : "a",
      "isPaid" : false,
      "payment" : false
    } ],
    "reminderTime" : "",
    "tags" : [ "leg pain" ]
  }, {
    "name" : "doe",
    "phone" : "98765432",
    "email" : "johnd@example.com",
    "address" : "311, Clementi Ave 2, #02-25",
    "schedules" : [ {
      "dateTime" : "2024-11-29 1000",
      "note" : "p",
      "isPaid" : false,
      "payment" : false
    } ],
    "reminderTime" : "",
    "tags" : [ "back pain", "ankle sprain" ]
  }, {
    "name" : "pleb",
    "phone" : "98765432",
    "email" : "johnd@example.com",
    "address" : "311, Clementi Ave 2, #02-25",
    "schedules" : [ {
      "dateTime" : "2024-11-29 1200",
      "note" : "o",
      "isPaid" : false,
      "payment" : false
    } ],
    "reminderTime" : "",
    "tags" : [ "back pain", "ankle sprain" ]
  } ]
}

image.png


[original: nus-cs2103-AY2425S1/pe-interim#262] [original labels: severity.Low type.FunctionalityBug]

jasmiinee commented 5 days ago

Team's Response

image.png Thank you for raising this issue.

As per our User Guide, manual editing of the addressbook.json file is only recommended for advanced users who understand the implications. We explicitly caution users that incorrect modifications may result in undefined behavior. When using the schedule command, all restrictions are enforced as specified, ensuring that appointments adhere to the allowed range (weekdays, 0900-1600). This demonstrates that the core functionality is intact and follows the documented behavior. Allowing users to bypass certain checks via direct file modification is not a bug, as it involves tampering with the internal data structure outside the controlled environment of the application. Since our app is designed to handle data within the expected flow, external changes cannot be accounted for automatically.

The User Guide warns users that editing the data file comes with risks. If they proceed to alter the file manually, they assume full responsibility for any deviations from expected app behavior. This issue is not within the scope of our app's intended usage. We consider this a non-issue rather than a bug, as our app behaves correctly when used as documented.

Duplicate status (if any):

--