Skip to content

Commit

Permalink
Merge pull request AY2324S2-CS2103T-T15-1#219 from alfaloo/debug
Browse files Browse the repository at this point in the history
Change data and log file names
  • Loading branch information
Alteqa authored Apr 12, 2024
2 parents ac97d81 + 999218e commit 58afefa
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 328 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/commons/core/LogsCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
public class LogsCenter {
private static final int MAX_FILE_COUNT = 5;
private static final int MAX_FILE_SIZE_IN_BYTES = (int) (Math.pow(2, 20) * 5); // 5MB
private static final String LOG_FILE = "addressbook.log";
private static final String LOG_FILE = "medicli.log";
private static final Logger logger; // logger for this class
private static Logger baseLogger; // to be used as the parent of all other loggers created by this class.
private static Level currentLogLevel = Level.INFO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AddAppointmentCommand extends Command {

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds an appointment to the MediCLI system.\n"
+ "Parameters: "
+ PREFIX_DATE + "DATE "
+ PREFIX_DATE + "DATE-TIME "
+ PREFIX_DOCTORNRIC + "DOCTOR NRIC "
+ PREFIX_PATIENTNRIC + "PATIENT NRIC\n"
+ "Example: " + COMMAND_WORD + " "
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/seedu/address/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import seedu.address.model.person.Phone;




/**
* Editcommand class enables user to edit a doctor or patient in the person list
*/
Expand Down
60 changes: 0 additions & 60 deletions src/main/java/seedu/address/logic/parser/AddCommandParser.java

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/seedu/address/logic/parser/CliSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class CliSyntax {

public static final Prefix PREFIX_EMAIL = new Prefix("e/");
public static final Prefix PREFIX_ADDRESS = new Prefix("a/");
public static final Prefix PREFIX_TAG = new Prefix("t/");

public static final Prefix PREFIX_DATE = new Prefix("ad/");
public static final Prefix PREFIX_PATIENTNRIC = new Prefix("pn/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NRIC;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;

import seedu.address.commons.core.index.Index;
import seedu.address.logic.commands.EditCommand;
Expand All @@ -26,7 +25,7 @@ public class EditCommandParser implements Parser<EditCommand> {
public EditCommand parse(String args) throws ParseException {
requireNonNull(args);
ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_NRIC, PREFIX_DOB, PREFIX_TAG);
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_NRIC, PREFIX_DOB);

Index index;

Expand Down
32 changes: 0 additions & 32 deletions src/main/java/seedu/address/logic/parser/ParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import static java.util.Objects.requireNonNull;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import seedu.address.commons.core.index.Index;
import seedu.address.commons.util.StringUtil;
import seedu.address.logic.parser.exceptions.ParseException;
Expand All @@ -16,7 +12,6 @@
import seedu.address.model.person.Name;
import seedu.address.model.person.Nric;
import seedu.address.model.person.Phone;
import seedu.address.model.tag.Tag;

/**
* Contains utility methods used for parsing strings in the various *Parser classes.
Expand Down Expand Up @@ -152,33 +147,6 @@ public static Email parseEmail(String email) throws ParseException {
return new Email(trimmedEmail);
}

/**
* Parses a {@code String tag} into a {@code Tag}.
* Leading and trailing whitespaces will be trimmed.
*
* @throws ParseException if the given {@code tag} is invalid.
*/
public static Tag parseTag(String tag) throws ParseException {
requireNonNull(tag);
String trimmedTag = tag.trim();
if (!Tag.isValidTagName(trimmedTag)) {
throw new ParseException(Tag.MESSAGE_CONSTRAINTS);
}
return new Tag(trimmedTag);
}

/**
* Parses {@code Collection<String> tags} into a {@code Set<Tag>}.
*/
public static Set<Tag> parseTags(Collection<String> tags) throws ParseException {
requireNonNull(tags);
final Set<Tag> tagSet = new HashSet<>();
for (String tagName : tags) {
tagSet.add(parseTag(tagName));
}
return tagSet;
}

/**
* Parses AppointmentDate from string to return an AppointmentDate object
* @param apptDateTime String to parse
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/UserPrefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class UserPrefs implements ReadOnlyUserPrefs {

private GuiSettings guiSettings = new GuiSettings();
private Path addressBookFilePath = Paths.get("data" , "addressbook.json");
private Path addressBookFilePath = Paths.get("data" , "medicli.json");

/**
* Creates a {@code UserPrefs} with default values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class Appointment {

private static final String MESSAGE_CONSTRAINTS_INVALID_DATE =
"Appointment should be made with a date today onwards";
"Appointment should be made with a date-time today onwards";

// The doctor in charge of the appointment
private Nric doctorNric;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class AppointmentDateTime {

// Message to output in case constraints are not met
public static final String MESSAGE_CONSTRAINTS =
"Appointment date should be in the format of yyyy-MM-dd HH:mm.";
"Appointment date-time should be in the format of yyyy-MM-dd HH:mm.";

// Variable storing appointment date in a local datetime instance
public final LocalDateTime appointmentDateTime;
Expand Down Expand Up @@ -48,8 +48,6 @@ public static boolean isValidDate(String dateStr) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
try {
LocalDateTime temp = LocalDateTime.parse(dateStr, formatter);
//LocalDate today = LocalDate.now();
//return temp.isAfter(today);
} catch (DateTimeParseException e) {
return false;
}
Expand Down
62 changes: 0 additions & 62 deletions src/main/java/seedu/address/model/tag/Tag.java

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/java/seedu/address/model/util/SampleDataUtil.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package seedu.address.model.util;

import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;

import seedu.address.model.AddressBook;
import seedu.address.model.ReadOnlyAddressBook;
import seedu.address.model.person.DoB;
Expand All @@ -12,7 +8,6 @@
import seedu.address.model.person.Patient;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.tag.Tag;

/**
* Contains utility methods for populating {@code AddressBook} with sample data.
Expand Down Expand Up @@ -51,13 +46,4 @@ public static ReadOnlyAddressBook getSampleAddressBook() {
return sampleAb;
}

/**
* Returns a tag set containing the list of strings given.
*/
public static Set<Tag> getTagSet(String... strings) {
return Arrays.stream(strings)
.map(Tag::new)
.collect(Collectors.toSet());
}

}
4 changes: 0 additions & 4 deletions src/main/java/seedu/address/storage/JsonAdaptedPerson.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package seedu.address.storage;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

Expand All @@ -27,7 +24,6 @@ class JsonAdaptedPerson {
private final String name;
private final String dob;
private final String phone;
private final List<JsonAdaptedTag> tags = new ArrayList<>();

/**
* Constructs a {@code JsonAdaptedPerson} with the given person details.
Expand Down
48 changes: 0 additions & 48 deletions src/main/java/seedu/address/storage/JsonAdaptedTag.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NRIC;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG;
import static seedu.address.testutil.Assert.assertThrows;

import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -59,20 +58,14 @@ public class CommandTestUtil {
public static final String DOB_DESC_BOB = " " + PREFIX_DOB + VALID_DOB_BOB;
public static final String PHONE_DESC_AMY = " " + PREFIX_PHONE + VALID_PHONE_AMY;
public static final String PHONE_DESC_BOB = " " + PREFIX_PHONE + VALID_PHONE_BOB;
public static final String TAG_DESC_FRIEND = " " + PREFIX_TAG + VALID_TAG_FRIEND;
public static final String TAG_DESC_HUSBAND = " " + PREFIX_TAG + VALID_TAG_HUSBAND;

public static final String INVALID_NRIC_DESC = " " + PREFIX_NRIC + "A0983";
public static final String INVALID_NAME_DESC = " " + PREFIX_NAME + "James&"; // '&' not allowed in names
public static final String INVALID_DOB_DESC = " " + PREFIX_DOB + "22-03-2009";
public static final String INVALID_PHONE_DESC = " " + PREFIX_PHONE + "911a"; // 'a' not allowed in phones
public static final String INVALID_EMAIL_DESC = " " + PREFIX_EMAIL + "bob!yahoo"; // missing '@' symbol
public static final String INVALID_ADDRESS_DESC = " " + PREFIX_ADDRESS; // empty string not allowed for addresses
public static final String INVALID_TAG_DESC = " " + PREFIX_TAG + "hubby*"; // '*' not allowed in tags

public static final String PREAMBLE_WHITESPACE = "\t \r \n";
public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble";

public static final EditCommand.EditPersonDescriptor DESC_AMY;
public static final EditCommand.EditPersonDescriptor DESC_BOB;

Expand Down
Loading

0 comments on commit 58afefa

Please sign in to comment.