diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 59385b70713..d5ce1e231cf 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1098,6 +1098,15 @@ Team size: 5 * **Sample Input:** User enters: `sort` * **Expected Output:** The result display box shows `Unknown Command. Did you mean: list, find, clear, add, edit, delete, exit, or help?` +2. **Modify date parsing to check for leap years** +* **Flaw:** When a user enters February 29 for a non-leap year, the date automatically adjusts to February + 28, which may be confusing. +* **Enhancement:** Modify the date parsing logic to check for leap years. + * If the user enters February 29 for a non-leap year, display an error message indicating that the date is invalid. + * If the user enters February 29 for a leap year, the date is accepted. +* **Sample Input:** User enters `2023-02-29` for an appointment date. +* **Expected Output:** The result display box shows `Invalid date: 2023 is not a leap year, so February 29 is not valid.` +
-------------------------------------------------------------------------------------------------------------------- diff --git a/docs/UserGuide.md b/docs/UserGuide.md index c40158b3cc0..e3677c40a9e 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -579,13 +579,13 @@ Note that this will also clear the appointment data. An **appointment** is defined by several fields. The fields and their corresponding prefixes are as follows: -| Field | Prefix | Optional | Multiple | Acceptable Inputs | -|---------------------|--------|----------|----------|---------------------------------------| -| **Person ID** | `i/` | No | No | Existing person ID | -| **Appointment Type**| `ty/` | No | No | Any value | -| **Date and Time** | `d/` | No | No | `yyyy-MM-dd HH:mm`. Refer to 1. below | -| **Sickness** | `s/` | Yes | No | At least one alphabetic character | -| **Medicine** | `m/` | Yes | No | At least one alphabetic character | +| Field | Prefix | Optional | Multiple | Acceptable Inputs | +|----------------------|--------|----------|----------|-------------------------------------------| +| **Person ID** | `i/` | No | No | Existing person ID | +| **Appointment Type** | `ty/` | No | No | Any value | +| **Date and Time** | `d/` | No | No | `yyyy-MM-dd HH:mm`. Refer to **1.** below | +| **Sickness** | `s/` | Yes | No | At least one alphabetic character | +| **Medicine** | `m/` | Yes | No | At least one alphabetic character |
@@ -604,6 +604,18 @@ margin-right: auto;"> You can manage the appointments through different commands, which can be seen in the table below: + + +**Notes:** + +**1.** Acceptable inputs for **Date and Time**: +* The time is in 24-hour format, i.e. `HH:mm` should be between `00:00` and `23:59`. +* The date and time inputs are resolved "smartly" - meaning that certain incorrect dates will be allowed.
_**Example:**`2025-02-29 12:00` will be parsed as `2025-02-28 12:00`._ + +
+ +
+ | Action | Format | Examples | |--------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------| | **[Add appointment](#adding-an-appointment-add-appt)** | `add appt i/PERSON_ID d/DATE_TIME ty/APPOINTMENT_TYPE [s/SICKNESS] [m/MEDICINE]`

| `add appt i/1 d/2024-12-01 09:30 ty/Consulation s/Diabetes m/Insulin` | @@ -620,7 +632,6 @@ You can manage the appointments through different commands, which can be seen in You can add an appointment to DocTrack. **Format**: `add appt i/PERSON_ID ty/APPOINTMENT_TYPE d/DATE_TIME [s/SICKNESS] [m/MEDICINE]` -- The format of `DATE_TIME` is `yyyy-MM-dd HH:mm`. For example, `2025-03-20 10:30`. @@ -635,7 +646,7 @@ You can add an appointment to DocTrack. **Note:** Although you type `DATE_TIME` in the format `yyyy-MM-dd HH:mm`, you will see it displayed as `Month Date, Year, Time`.
-_**Example:** You will see `2024-12-10 12:30` displayed as `December 10, 2024, 12:30 PM`._ +_**Example:** You will see `2024-12-10 14:30` displayed as `December 10, 2024, 2:30 PM`._
@@ -987,6 +998,14 @@ computer?
**A**: Since the data is saved in the `addressbook.json` and `appointmentbook.json` files in the `data` folder, you can copy these files to another location as a backup. +
+ +**Q**: How many patients and appointments does DocTrack support?
+**A**: DocTrack technically supports up to 4 billion total **historical** patients and appointments. However, +depending on your system, it might lag with larger numbers of patients and appointments. +We recommend that you do not exceed 10,000 total patients and appointments. + +

--- diff --git a/src/main/java/seedu/address/model/AppointmentBook.java b/src/main/java/seedu/address/model/AppointmentBook.java index e12151a4482..2df21aa14b0 100644 --- a/src/main/java/seedu/address/model/AppointmentBook.java +++ b/src/main/java/seedu/address/model/AppointmentBook.java @@ -129,7 +129,6 @@ public Appointment addAppointment(Person person, AppointmentDescriptor appointme */ public void setAppointment(Appointment target, Appointment editedAppointment) { requireNonNull(editedAppointment); - appointments.setAppointment(target, editedAppointment); } diff --git a/src/main/java/seedu/address/model/appointment/UniqueAppointmentList.java b/src/main/java/seedu/address/model/appointment/UniqueAppointmentList.java index 5ef02a397a3..256b5652e5b 100644 --- a/src/main/java/seedu/address/model/appointment/UniqueAppointmentList.java +++ b/src/main/java/seedu/address/model/appointment/UniqueAppointmentList.java @@ -125,7 +125,7 @@ public void setAppointments(List appointments) { */ public void removeAppointmentsForPerson(Person toRemove) { requireNonNull(toRemove); - internalList.removeIf(appointment -> appointment.getPerson().equals(toRemove)); + internalList.removeIf(appointment -> appointment.getPersonId() == toRemove.getPersonId()); } /**