Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add email blast marketing email
- Add 3 days left marketing email
- Add check to ensure application creation deadline has not passed yet

### Fixed

Expand Down
7 changes: 4 additions & 3 deletions constants/general.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const HACKER_STATUSES = [
HACKER_STATUS_CHECKED_IN,
HACKER_STATUS_DECLINED
];
// This date is Jan 3, 2020 11:59:59PM EST
const APPLICATION_CLOSE_TIME = 1578070799000;

const SAMPLE_DIET_RESTRICTIONS = [
"None",
Expand Down Expand Up @@ -111,9 +113,7 @@ const MAX_TEAM_SIZE = 4;
const WEEK_OF = "Week Of";

const EMAIL_SUBJECTS = {};
EMAIL_SUBJECTS[
HACKER_STATUS_NONE
] = `Get started on your application!`;
EMAIL_SUBJECTS[HACKER_STATUS_NONE] = `Get started on your application!`;
EMAIL_SUBJECTS[
HACKER_STATUS_APPLIED
] = `Thanks for applying to ${HACKATHON_NAME}!`;
Expand Down Expand Up @@ -160,6 +160,7 @@ module.exports = {
HACKER_STATUS_WITHDRAWN: HACKER_STATUS_WITHDRAWN,
HACKER_STATUS_CHECKED_IN: HACKER_STATUS_CHECKED_IN,
HACKER_STATUSES: HACKER_STATUSES,
APPLICATION_CLOSE_TIME: APPLICATION_CLOSE_TIME,
REQUEST_TYPES: REQUEST_TYPES,
JOB_INTERESTS: JOB_INTERESTS,
SHIRT_SIZES: SHIRT_SIZES,
Expand Down
8 changes: 6 additions & 2 deletions services/hacker.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ const QRCode = require("qrcode");
function createHacker(hackerDetails) {
const TAG = `[Hacker Service # createHacker]:`;

const hacker = new Hacker(hackerDetails);
let hacker;

return hacker.save();
if (Date.now() < Constants.APPLICATION_CLOSE_TIME) {
hacker = new Hacker(hackerDetails);
return hacker.save();
}
throw new Error("Sorry, the application deadline has passed!");
}

/**
Expand Down