diff --git a/src/main/java/seedu/address/logic/Messages.java b/src/main/java/seedu/address/logic/Messages.java index da94ca1e6be..1d4e88daf55 100644 --- a/src/main/java/seedu/address/logic/Messages.java +++ b/src/main/java/seedu/address/logic/Messages.java @@ -47,6 +47,10 @@ public static String format(Person person) { .append(person.getGrade()) .append("; Subject: ") .append(person.getSubject()) + .append("; Attendance: ") + .append(person.getAttendance()) + .append("; Payment: ") + .append(person.getPayment()) .append("; DateTime: "); person.getDateTimes().forEach(builder::append); builder.append("; Tags: "); diff --git a/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 1c24880dc93..82406f864a3 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -2,10 +2,12 @@ import static java.util.Objects.requireNonNull; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ATTENDANCE; import static seedu.address.logic.parser.CliSyntax.PREFIX_DATETIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; +import static seedu.address.logic.parser.CliSyntax.PREFIX_PAYMENT; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_SUBJECT; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; @@ -31,6 +33,8 @@ public class AddCommand extends Command { + PREFIX_ADDRESS + "ADDRESS " + "[" + PREFIX_GRADE + "GRADE] " + "[" + PREFIX_SUBJECT + "SUBJECT] " + + "[" + PREFIX_GRADE + "ATTENDANCE] " + + "[" + PREFIX_SUBJECT + "PAYMENT] " + "[" + PREFIX_DATETIME + "DATETIME] " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " " @@ -40,6 +44,8 @@ public class AddCommand extends Command { + PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " + PREFIX_GRADE + "A " + PREFIX_SUBJECT + "Mathematics " + + PREFIX_ATTENDANCE + "Present " + + PREFIX_PAYMENT + "Paid " + PREFIX_DATETIME + "2024-03-02 1800" + PREFIX_TAG + "friends " + PREFIX_TAG + "owesMoney"; diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 63119d4dca2..6a5f0aacb8e 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -2,10 +2,12 @@ import static java.util.Objects.requireNonNull; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ATTENDANCE; import static seedu.address.logic.parser.CliSyntax.PREFIX_DATETIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; +import static seedu.address.logic.parser.CliSyntax.PREFIX_PAYMENT; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_SUBJECT; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; @@ -25,10 +27,12 @@ import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; import seedu.address.model.person.Address; +import seedu.address.model.person.Attendance; import seedu.address.model.person.DateTime; import seedu.address.model.person.Email; import seedu.address.model.person.Grade; import seedu.address.model.person.Name; +import seedu.address.model.person.Payment; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; import seedu.address.model.person.Subject; @@ -51,6 +55,8 @@ public class EditCommand extends Command { + "[" + PREFIX_ADDRESS + "ADDRESS] " + "[" + PREFIX_GRADE + "GRADE] " + "[" + PREFIX_SUBJECT + "SUBJECT] " + + "[" + PREFIX_ATTENDANCE + "PAYMENT] " + + "[" + PREFIX_PAYMENT + "ATTENDANCE] " + "[" + PREFIX_DATETIME + "DATETIME] " + "[" + PREFIX_TAG + "TAG]...\n" + "Example: " + COMMAND_WORD + " 1 " @@ -109,12 +115,14 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail()); Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress()); Grade updatedGrade = personToEdit.getGrade(); + Attendance updatedAttendance = personToEdit.getAttendance(); + Payment updatedPayment = personToEdit.getPayment(); Subject updatedSubject = personToEdit.getSubject(); Set updatedDateTime = editPersonDescriptor.getDateTime().orElse(personToEdit.getDateTimes()); Set updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags()); return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, - updatedGrade, updatedSubject, updatedDateTime, updatedTags); + updatedGrade, updatedSubject, updatedAttendance, updatedPayment, updatedDateTime, updatedTags); } @Override diff --git a/src/main/java/seedu/address/logic/parser/AddCommandParser.java b/src/main/java/seedu/address/logic/parser/AddCommandParser.java index 7532a841661..a0250a4868c 100644 --- a/src/main/java/seedu/address/logic/parser/AddCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/AddCommandParser.java @@ -2,10 +2,12 @@ import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; +import static seedu.address.logic.parser.CliSyntax.PREFIX_ATTENDANCE; import static seedu.address.logic.parser.CliSyntax.PREFIX_DATETIME; import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; import static seedu.address.logic.parser.CliSyntax.PREFIX_GRADE; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; +import static seedu.address.logic.parser.CliSyntax.PREFIX_PAYMENT; import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; import static seedu.address.logic.parser.CliSyntax.PREFIX_SUBJECT; import static seedu.address.logic.parser.CliSyntax.PREFIX_TAG; @@ -16,10 +18,12 @@ import seedu.address.logic.commands.AddCommand; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.person.Address; +import seedu.address.model.person.Attendance; import seedu.address.model.person.DateTime; import seedu.address.model.person.Email; import seedu.address.model.person.Grade; import seedu.address.model.person.Name; +import seedu.address.model.person.Payment; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; import seedu.address.model.person.Subject; @@ -38,7 +42,7 @@ public class AddCommandParser implements Parser { public AddCommand parse(String args) throws ParseException { ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG, - PREFIX_GRADE, PREFIX_SUBJECT, PREFIX_DATETIME); + PREFIX_GRADE, PREFIX_SUBJECT, PREFIX_ATTENDANCE, PREFIX_PAYMENT, PREFIX_DATETIME); if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL) || !argMultimap.getPreamble().isEmpty()) { @@ -46,7 +50,7 @@ public AddCommand parse(String args) throws ParseException { } argMultimap.verifyNoDuplicatePrefixesFor(PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, - PREFIX_GRADE, PREFIX_SUBJECT); + PREFIX_GRADE, PREFIX_SUBJECT, PREFIX_ATTENDANCE, PREFIX_PAYMENT); Name name = ParserUtil.parseName(argMultimap.getValue(PREFIX_NAME).get()); Phone phone = ParserUtil.parsePhone(argMultimap.getValue(PREFIX_PHONE).get()); Email email = ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get()); @@ -59,10 +63,20 @@ public AddCommand parse(String args) throws ParseException { if (argMultimap.getValue(PREFIX_SUBJECT).isPresent()) { subject = ParserUtil.parseSubject(argMultimap.getValue(PREFIX_SUBJECT).get()); } + Attendance attendance = new Attendance(); + if (argMultimap.getValue(PREFIX_ATTENDANCE).isPresent()) { + attendance = ParserUtil.parseAttendance(argMultimap.getValue(PREFIX_ATTENDANCE).get()); + } + + Payment payment = new Payment(); + if (argMultimap.getValue(PREFIX_PAYMENT).isPresent()) { + payment = ParserUtil.parsePayment(argMultimap.getValue(PREFIX_PAYMENT).get()); + } Set dateTimeList = ParserUtil.parseDateTimes(argMultimap.getAllValues(PREFIX_DATETIME)); Set tagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_TAG)); - Person student = new Person(name, phone, email, address, grade, subject, dateTimeList, tagList); + Person student = new Person(name, phone, email, address, grade, subject, + attendance, payment, dateTimeList, tagList); return new AddCommand(student); } diff --git a/src/main/java/seedu/address/logic/parser/CliSyntax.java b/src/main/java/seedu/address/logic/parser/CliSyntax.java index 99ed37079fc..befc35e9cb8 100644 --- a/src/main/java/seedu/address/logic/parser/CliSyntax.java +++ b/src/main/java/seedu/address/logic/parser/CliSyntax.java @@ -13,5 +13,7 @@ public class CliSyntax { public static final Prefix PREFIX_TAG = new Prefix("t/"); public static final Prefix PREFIX_GRADE = new Prefix("g/"); public static final Prefix PREFIX_SUBJECT = new Prefix("s/"); + public static final Prefix PREFIX_ATTENDANCE = new Prefix("at/"); + public static final Prefix PREFIX_PAYMENT = new Prefix("pa/"); public static final Prefix PREFIX_DATETIME = new Prefix("d/"); } diff --git a/src/main/java/seedu/address/logic/parser/ParserUtil.java b/src/main/java/seedu/address/logic/parser/ParserUtil.java index b79f098d007..4cfe931e822 100644 --- a/src/main/java/seedu/address/logic/parser/ParserUtil.java +++ b/src/main/java/seedu/address/logic/parser/ParserUtil.java @@ -10,10 +10,12 @@ import seedu.address.commons.util.StringUtil; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.person.Address; +import seedu.address.model.person.Attendance; import seedu.address.model.person.DateTime; import seedu.address.model.person.Email; import seedu.address.model.person.Grade; import seedu.address.model.person.Name; +import seedu.address.model.person.Payment; import seedu.address.model.person.Phone; import seedu.address.model.person.Subject; import seedu.address.model.tag.Tag; @@ -98,6 +100,36 @@ public static Email parseEmail(String email) throws ParseException { return new Email(trimmedEmail); } + /** + * Parses a {@code String grade} into an {@code Grade}. + * Leading and trailing whitespaces will be trimmed. + * + * @throws ParseException if the given {@code grade} is invalid. + */ + public static Attendance parseAttendance(String attendance) throws ParseException { + requireNonNull(attendance); + String trimmedAttendance = attendance.trim(); + if (!Attendance.isValidAttendance(trimmedAttendance)) { + throw new ParseException(Attendance.MESSAGE_CONSTRAINTS); + } + return new Attendance(trimmedAttendance); + } + + /** + * Parses a {@code String grade} into an {@code Grade}. + * Leading and trailing whitespaces will be trimmed. + * + * @throws ParseException if the given {@code grade} is invalid. + */ + public static Payment parsePayment(String payment) throws ParseException { + requireNonNull(payment); + String trimmedPayment = payment.trim(); + if (!Payment.isValidPayment(trimmedPayment)) { + throw new ParseException(Payment.MESSAGE_CONSTRAINTS); + } + return new Payment(trimmedPayment); + } + /** * Parses a {@code String tag} into a {@code Tag}. * Leading and trailing whitespaces will be trimmed. diff --git a/src/main/java/seedu/address/model/person/Attendance.java b/src/main/java/seedu/address/model/person/Attendance.java new file mode 100644 index 00000000000..edec7576636 --- /dev/null +++ b/src/main/java/seedu/address/model/person/Attendance.java @@ -0,0 +1,61 @@ +package seedu.address.model.person; + +import static java.util.Objects.requireNonNull; +import static seedu.address.commons.util.AppUtil.checkArgument; + +/** + * Represents a Student's attendance status in the address book. + * + */ +public class Attendance { + + public static final String MESSAGE_CONSTRAINTS = + "Attendance should only be 'Present' or 'Absent', and it should not be blank"; + public static final String VALIDATION_REGEX = "(?i)(present|absent)"; + public final String value; + + /** + * Creates an undefined attendance status for the student. + */ + public Attendance() { + value = "-"; + } + + /** + * Creates an attendance status for a student. + * + * @param status Attendance status ('Present' or 'Absent'). + */ + public Attendance(String status) { + requireNonNull(status); + checkArgument(isValidAttendance(status), MESSAGE_CONSTRAINTS); + value = status; + } + + /** + * Returns true if a given string is a valid attendance status. + */ + public static boolean isValidAttendance(String test) { + return test.matches(VALIDATION_REGEX); + } + + @Override + public String toString() { + return value; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + // instanceof handles nulls + if (!(other instanceof Attendance)) { + return false; + } + + Attendance otherAttendance = (Attendance) other; + return value.equalsIgnoreCase(otherAttendance.value); + } +} diff --git a/src/main/java/seedu/address/model/person/Payment.java b/src/main/java/seedu/address/model/person/Payment.java new file mode 100644 index 00000000000..d4ae7f1c122 --- /dev/null +++ b/src/main/java/seedu/address/model/person/Payment.java @@ -0,0 +1,60 @@ +package seedu.address.model.person; + +import static java.util.Objects.requireNonNull; +import static seedu.address.commons.util.AppUtil.checkArgument; + +/** + * Represents a Student's payment status in the address book. + * Guarantees: immutable; is always valid + */ +public class Payment { + public static final String MESSAGE_CONSTRAINTS = + "Payment should only be 'Paid' or 'Not Paid', and it should not be blank"; + public static final String VALIDATION_REGEX = "(?i)(paid|not paid)"; + public final String value; + + /** + * Creates an undefined payment status for the student. + */ + public Payment() { + value = "-"; + } + + /** + * Creates a payment status for a student. + * + * @param status Payment status ('Paid' or 'Not Paid'). + */ + public Payment(String status) { + requireNonNull(status); + checkArgument(isValidPayment(status), MESSAGE_CONSTRAINTS); + value = status; + } + + /** + * Returns true if a given string is a valid payment status. + */ + public static boolean isValidPayment(String test) { + return test.matches(VALIDATION_REGEX); + } + + @Override + public String toString() { + return value; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + + // instanceof handles nulls + if (!(other instanceof Payment)) { + return false; + } + + Payment otherPayment = (Payment) other; + return value.equalsIgnoreCase(otherPayment.value); + } +} diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java index 51f2924ca6c..9e29e584ab7 100644 --- a/src/main/java/seedu/address/model/person/Person.java +++ b/src/main/java/seedu/address/model/person/Person.java @@ -25,6 +25,8 @@ public class Person { private final Address address; private final Grade grade; private final Subject subject; + private final Attendance attendance; + private final Payment payment; private final Set dateTimes = new HashSet<>(); private final Set tags = new HashSet<>(); @@ -32,14 +34,16 @@ public class Person { * Every field must be present and not null. */ public Person(Name name, Phone phone, Email email, Address address, Grade grade, Subject subject, - Set dateTimes, Set tags) { - requireAllNonNull(name, phone, email, address, grade, subject, dateTimes, tags); + Attendance attendance, Payment payment, Set dateTimes, Set tags) { + requireAllNonNull(name, phone, email, address, grade, subject, attendance, payment, dateTimes, tags); this.name = name; this.phone = phone; this.email = email; this.address = address; this.grade = grade; this.subject = subject; + this.attendance = attendance; + this.payment = payment; this.dateTimes.addAll(dateTimes); this.tags.addAll(tags); } @@ -67,6 +71,13 @@ public Grade getGrade() { public Subject getSubject() { return subject; } + public Attendance getAttendance() { + return attendance; + } + + public Payment getPayment() { + return payment; + } public Set getDateTimes() { return Collections.unmodifiableSet(dateTimes); } @@ -131,6 +142,8 @@ public String toString() { .add("address", address) .add("grade", grade) .add("subject", subject) + .add("attendance", attendance) + .add("payment", payment) .add("dateTimes", dateTimes) .add("tags", tags) .toString(); diff --git a/src/main/java/seedu/address/model/util/SampleDataUtil.java b/src/main/java/seedu/address/model/util/SampleDataUtil.java index 5ed405aef2f..35992a394d2 100644 --- a/src/main/java/seedu/address/model/util/SampleDataUtil.java +++ b/src/main/java/seedu/address/model/util/SampleDataUtil.java @@ -7,10 +7,12 @@ import seedu.address.model.AddressBook; import seedu.address.model.ReadOnlyAddressBook; import seedu.address.model.person.Address; +import seedu.address.model.person.Attendance; import seedu.address.model.person.DateTime; import seedu.address.model.person.Email; import seedu.address.model.person.Grade; import seedu.address.model.person.Name; +import seedu.address.model.person.Payment; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; import seedu.address.model.person.Subject; @@ -28,21 +30,27 @@ public static Person[] getSamplePersons() { return new Person[] { new Person(new Name("Alex Yeoh"), new Phone("87438807"), new Email("alexyeoh@example.com"), new Address("Blk 30 Geylang Street 29, #06-40"), EMPTY_GRADE, EMPTY_SUBJECT, + new Attendance("Present"), new Payment("Paid"), getDateTimeSet("2024-03-02 1800"), getTagSet("friends")), new Person(new Name("Bernice Yu"), new Phone("99272758"), new Email("berniceyu@example.com"), new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), EMPTY_GRADE, EMPTY_SUBJECT, + new Attendance("Present"), new Payment("Paid"), getDateTimeSet("2024-03-02 1800", "2024-03-04 2000"), getTagSet("colleagues", "friends")), new Person(new Name("Charlotte Oliveiro"), new Phone("93210283"), new Email("charlotte@example.com"), new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), EMPTY_GRADE, EMPTY_SUBJECT, + new Attendance("Present"), new Payment("Paid"), getDateTimeSet("2024-03-02 1800", "2024-03-21 1600"), getTagSet("neighbours")), new Person(new Name("David Li"), new Phone("91031282"), new Email("lidavid@example.com"), new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), EMPTY_GRADE, EMPTY_SUBJECT, + new Attendance("Present"), new Payment("Paid"), getDateTimeSet("2024-03-14 2100"), getTagSet("family")), new Person(new Name("Irfan Ibrahim"), new Phone("92492021"), new Email("irfan@example.com"), new Address("Blk 47 Tampines Street 20, #17-35"), EMPTY_GRADE, EMPTY_SUBJECT, + new Attendance("Present"), new Payment("Paid"), getDateTimeSet("2024-03-18 2200"), getTagSet("classmates")), new Person(new Name("Roy Balakrishnan"), new Phone("92624417"), new Email("royb@example.com"), new Address("Blk 45 Aljunied Street 85, #11-31"), EMPTY_GRADE, EMPTY_SUBJECT, + new Attendance("Present"), new Payment("Paid"), getDateTimeSet("2024-03-28 2300"), getTagSet("colleagues")) }; } diff --git a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java index 2207370fffa..fc4816987b2 100644 --- a/src/main/java/seedu/address/storage/JsonAdaptedPerson.java +++ b/src/main/java/seedu/address/storage/JsonAdaptedPerson.java @@ -11,10 +11,12 @@ import seedu.address.commons.exceptions.IllegalValueException; import seedu.address.model.person.Address; +import seedu.address.model.person.Attendance; import seedu.address.model.person.DateTime; import seedu.address.model.person.Email; import seedu.address.model.person.Grade; import seedu.address.model.person.Name; +import seedu.address.model.person.Payment; import seedu.address.model.person.Person; import seedu.address.model.person.Phone; import seedu.address.model.person.Subject; @@ -33,6 +35,8 @@ class JsonAdaptedPerson { private final String address; private final String grade; private final String subject; + private final String attendance; + private final String payment; private final List dateTimes = new ArrayList<>(); private final List tags = new ArrayList<>(); @@ -43,6 +47,7 @@ class JsonAdaptedPerson { public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone, @JsonProperty("email") String email, @JsonProperty("address") String address, @JsonProperty("grade") String grade, @JsonProperty("subject") String subject, + @JsonProperty("attendance") String attendance, @JsonProperty("payment") String payment, @JsonProperty("dateTimes") List dateTimes, @JsonProperty("tags") List tags) { this.name = name; @@ -51,6 +56,8 @@ public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone this.address = address; this.grade = grade; this.subject = subject; + this.attendance = attendance; + this.payment = payment; if (tags != null) { this.dateTimes.addAll(dateTimes); } @@ -69,6 +76,8 @@ public JsonAdaptedPerson(Person source) { address = source.getAddress().value; grade = source.getGrade().value; subject = source.getSubject().value; + attendance = source.getAttendance().value; + payment = source.getPayment().value; dateTimes.addAll(source.getDateTimes().stream() .map(JsonAdaptedDateTime::new) .collect(Collectors.toList())); @@ -140,11 +149,28 @@ public Person toModelType() throws IllegalValueException { throw new IllegalValueException(Subject.MESSAGE_CONSTRAINTS); } final Subject modelSubject = new Subject(subject); + if (attendance == null) { + throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, + Attendance.class.getSimpleName())); + } + if (!Attendance.isValidAttendance(attendance)) { + throw new IllegalValueException(Attendance.MESSAGE_CONSTRAINTS); + } + final Attendance modelAttendance = new Attendance(attendance); + + if (payment == null) { + throw new IllegalValueException(String.format(MISSING_FIELD_MESSAGE_FORMAT, + Attendance.class.getSimpleName())); + } + if (!Payment.isValidPayment(payment)) { + throw new IllegalValueException(Payment.MESSAGE_CONSTRAINTS); + } + final Payment modelPayment = new Payment(payment); final Set modelDateTimes = new HashSet<>(personDateTimes); final Set modelTags = new HashSet<>(personTags); return new Person(modelName, modelPhone, modelEmail, modelAddress, modelGrade, modelSubject, - modelDateTimes, modelTags); + modelAttendance, modelPayment, modelDateTimes, modelTags); } } diff --git a/src/main/java/seedu/address/ui/PersonCard.java b/src/main/java/seedu/address/ui/PersonCard.java index 95201467405..919e7755230 100644 --- a/src/main/java/seedu/address/ui/PersonCard.java +++ b/src/main/java/seedu/address/ui/PersonCard.java @@ -44,6 +44,9 @@ public class PersonCard extends UiPart { private Label grade; @FXML private Label subject; + private Label attendance; + @FXML + private Label payment; @FXML private FlowPane dateTimes; @FXML @@ -62,6 +65,8 @@ public PersonCard(Person person, int displayedIndex) { email.setText(person.getEmail().value); grade.setText(person.getGrade().value); subject.setText(person.getSubject().value); + attendance.setText(person.getAttendance().value); + payment.setText(person.getPayment().value); dateTimes.setHgap(5); person.getDateTimes().stream() .sorted(Comparator.comparing(dateTime -> dateTime.value)) diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml index 51d79475371..1f29500d43e 100644 --- a/src/main/resources/view/PersonListCard.fxml +++ b/src/main/resources/view/PersonListCard.fxml @@ -33,6 +33,8 @@