-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch model applicant #49
Branch model applicant #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one small comment. I think we can just stick to dates first? Or do you guys want to include timings as well.
public class ApplicationStatus { | ||
public static final String MESSAGE_CONSTRAINTS = | ||
"Application Status should only contain the words: processing, accepted, rejected. It should not be blank"; | ||
public static final String[] POSSIBLE_STATUSES = {"processing", "accepted", "rejected"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include pre-interview? I think processing means after the interview but no update yet right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Royce. Maybe we can use an enum or separate class for this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes would be good to have but not necessary as we do not have a standardised way of doing things yet. Good job!
protected Optional<InterviewDate> interviewDate; | ||
protected ApplicationStatus applicationStatus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, but maybe it could be private instead of protected? Since we would just use getter methods to access these fields.
public static boolean isValidInterviewDate(String date) { | ||
try { | ||
if (date.length() != 8) { | ||
return false; | ||
} else { | ||
parseDate(date); | ||
return true; | ||
} | ||
} catch (DateTimeException e) { | ||
return false; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can make use of the regex method used by the other classes in model? In this case the validation format would be "^(3[01]|[12][0-9]|0[1-9])/(1[0-2]|0[1-9])/[0-9]{4}$" for dd/mm/yyyy. I believe it would make our code seem more in line with the existing code from AB-3.
public class ApplicationStatus { | ||
public static final String MESSAGE_CONSTRAINTS = | ||
"Application Status should only contain the words: processing, accepted, rejected. It should not be blank"; | ||
public static final String[] POSSIBLE_STATUSES = {"processing", "accepted", "rejected"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Royce. Maybe we can use an enum or separate class for this as well.
* @param status | ||
*/ | ||
public ApplicationStatus(String status) { | ||
requireNonNull(status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of existing functions.
protected final Name name; | ||
protected final Phone phone; | ||
protected final Email email; | ||
|
||
// Data fields | ||
private final Address address; | ||
private final Set<Tag> tags = new HashSet<>(); | ||
protected final Address address; | ||
protected final Set<Tag> tags = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for these. Don't think it should be protected.
Yeah, I think we can stick to dates first and build upon timings at a later stage. |
LGTM |
Added necessary classes to represent the Applicants.