diff --git a/app.js b/app.js
index 05434539..4184102b 100755
--- a/app.js
+++ b/app.js
@@ -70,7 +70,9 @@ app.use(
name: "session",
keys: [process.env.COOKIE_SECRET],
// Cookie Options
- maxAge: 48 * 60 * 60 * 1000 //Logged in for 48 hours
+ maxAge: 48 * 60 * 60 * 1000, //Logged in for 48 hours
+ sameSite: process.env.COOKIE_SAME_SITE,
+ secureProxy: true
})
);
app.use(passport.initialize());
@@ -89,7 +91,7 @@ Services.log.info("Hacker router activated");
teamRouter.activate(apiRouter);
Services.log.info("Team router activated");
travelRouter.activate(apiRouter);
-Services.log.info("Travel router activated")
+Services.log.info("Travel router activated");
sponsorRouter.activate(apiRouter);
Services.log.info("Sponsor router activated");
volunteerRouter.activate(apiRouter);
diff --git a/assets/email/statusEmail/Accepted.hbs b/assets/email/statusEmail/Accepted.hbs
index cf187496..8e0bc5d3 100644
--- a/assets/email/statusEmail/Accepted.hbs
+++ b/assets/email/statusEmail/Accepted.hbs
@@ -400,11 +400,7 @@
style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#F2463A;text-decoration:none;">hacker
dashboard so we can pass your spot along to someone else.
- In the meantime, follow us on Facebook,
- Twitter,
- and Instagram
for important updates and news about McHacks! If you have any questions,
feel free to reach out at hacker
dashboard until the deadline on January
- 13th at
+ 3rd at
11:59 PM ET.
- In the meantime, follow us on Facebook,
- Twitter,
- and Instagram
for important updates and news about McHacks! If you have any questions,
feel free to reach out at
Don't forget to join the McHacks participants Discord
for announcements, to chat with other hackers, ask questions, and form
teams!
@@ -404,11 +404,7 @@
- Follow us on Facebook,
- Twitter,
- and Instagram
for important updates and news about McHacks! If you have any questions,
feel free to reach out at
- Follow us on Facebook,
- Twitter,
- and Instagram
for important updates about McHacks! If you have any questions,
feel free to reach out at
- Follow us on Facebook,
- Twitter,
- and Instagram
for important updates about McHacks.
diff --git a/assets/email/statusEmail/None.hbs b/assets/email/statusEmail/None.hbs
index 5f4218f0..f31d90f6 100644
--- a/assets/email/statusEmail/None.hbs
+++ b/assets/email/statusEmail/None.hbs
@@ -399,11 +399,7 @@
be sure to
click submit before then to be considered.
- In the meantime, follow us on Facebook,
- Twitter,
- and Instagram
for important updates and news about McHacks! If you have any questions,
feel free to reach out at
Hi {{firstName}},
- Thank you for applying to McHacks. We received a ton of great
+ {{!-- Thank you for applying to McHacks. We received a ton of great
applicants this year and are unfortunately unable to offer you a place
- at McHacks this year.
+ at McHacks this year. --}}
+ Thank you for applying to McHacks. We received a ton of great
+ applications so far and are unfortunately unable to offer an
+ acceptance at this time.
- But don't sweat yet, we've placed you on the waitlist and will let you
- know if a spot opens up!
+ {{!-- But don't sweat yet, we've placed you on the waitlist and will let you
+ know if a spot opens up! --}}
+ But don't sweat yet, we've placed your application among the
+ others to be considered in the final round of applications.
- In the meantime, follow us on Facebook,
- Twitter,
- and Instagram
for important updates and news about McHacks! If you have any questions,
feel free to reach out at
- Follow us on Facebook,
- Twitter,
- and Instagram
for important updates and news about McHacks.
diff --git a/middlewares/travel.middleware.js b/middlewares/travel.middleware.js
index ad268b3f..5bde789b 100644
--- a/middlewares/travel.middleware.js
+++ b/middlewares/travel.middleware.js
@@ -5,7 +5,7 @@ const mongoose = require("mongoose");
const Services = {
Travel: require("../services/travel.service"),
Hacker: require("../services/hacker.service"),
- Account: require("../services/account.service"),
+ Account: require("../services/account.service")
};
const Middleware = {
Util: require("./util.middleware")
@@ -28,7 +28,6 @@ function parsePatch(req, res, next) {
return next();
}
-
/**
* @function parseTravel
* @param {{body: {accountId: ObjectId, hackerId: ObjectId, authorization: string}}} req
@@ -57,7 +56,7 @@ function parseTravel(req, res, next) {
/**
* @function addRequestFromHacker
- * @param {{body: {travelDetails: {request: Number}}}} req
+ * @param {{body: {travelDetails: {request: {amount: number, reason: string}}}}} req
* @param {JSON} res
* @param {(err?)=>void} next
* @return {void}
@@ -66,7 +65,9 @@ function parseTravel(req, res, next) {
* req.body.travelDetails
*/
async function addRequestFromHacker(req, res, next) {
- const hacker = await Services.Hacker.findById(req.body.travelDetails.accountId);
+ const hacker = await Services.Hacker.findById(
+ req.body.travelDetails.accountId
+ );
if (!hacker) {
return next({
status: 500,
@@ -77,6 +78,7 @@ async function addRequestFromHacker(req, res, next) {
}
});
}
+ // eslint-disable-next-line require-atomic-updates
req.body.travelDetails.request = hacker.application.accommodation.travel;
return next();
}
diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js
index 37b1f705..50078261 100644
--- a/middlewares/validators/hacker.validator.js
+++ b/middlewares/validators/hacker.validator.js
@@ -126,16 +126,24 @@ module.exports = {
),
VALIDATOR.integerValidator(
"body",
- "application.accommodation.travel",
+ "application.accommodation.travel.amount",
true,
- 0,
- 100
+ 0
+ ),
+ VALIDATOR.stringValidator(
+ "body",
+ "application.accommodation.travel.reason",
+ true
),
VALIDATOR.mongoIdValidator("body", "application.team", true),
- VALIDATOR.stringValidator("body", "application.location.timeZone", true),
+ VALIDATOR.stringValidator(
+ "body",
+ "application.location.timeZone",
+ true
+ ),
VALIDATOR.stringValidator("body", "application.location.country", true),
VALIDATOR.stringValidator("body", "application.location.city", true),
- VALIDATOR.mongoIdValidator("body", "teamId", true),
+ VALIDATOR.mongoIdValidator("body", "teamId", true)
],
updateConfirmationValidator: [
@@ -257,15 +265,23 @@ module.exports = {
),
VALIDATOR.integerValidator(
"body",
- "application.accommodation.travel",
+ "application.accommodation.travel.amount",
true,
- 0,
- 100
+ 0
+ ),
+ VALIDATOR.stringValidator(
+ "body",
+ "application.accommodation.travel.reason",
+ true
),
VALIDATOR.mongoIdValidator("body", "application.team", true),
- VALIDATOR.stringValidator("body", "application.location.timeZone", true),
+ VALIDATOR.stringValidator(
+ "body",
+ "application.location.timeZone",
+ true
+ ),
VALIDATOR.stringValidator("body", "application.location.country", true),
- VALIDATOR.stringValidator("body", "application.location.city", true),
+ VALIDATOR.stringValidator("body", "application.location.city", true)
],
updateStatusValidator: [
VALIDATOR.enumValidator(
diff --git a/models/hacker.model.js b/models/hacker.model.js
index f59f8087..f6e8d611 100644
--- a/models/hacker.model.js
+++ b/models/hacker.model.js
@@ -126,7 +126,16 @@ const HackerSchema = new mongoose.Schema({
enum: Constants.SHIRT_SIZES,
required: true
},
- travel: { type: Number, default: 0 },
+ travel: {
+ amount: {
+ type: Number,
+ default: 0
+ },
+ reason: {
+ type: String,
+ default: ""
+ }
+ },
attendancePreference: {
type: String,
enum: Constants.ATTENDANCE_PREFERENCES,
@@ -155,7 +164,7 @@ const HackerSchema = new mongoose.Schema({
teamId: {
type: mongoose.Schema.Types.ObjectId,
ref: "Team"
- },
+ }
});
HackerSchema.methods.toJSON = function() {
@@ -171,9 +180,18 @@ HackerSchema.methods.isApplicationComplete = function() {
const jobInterestDone = !!hs.application.general.jobInterest;
const question1Done = !!hs.application.shortAnswer.question1;
const question2Done = !!hs.application.shortAnswer.question2;
- const previousHackathonsDone = !!hs.application.shortAnswer.previousHackathons;
- const attendancePreferenceDone = !!hs.application.accommodation.attendancePreference;
- return portfolioDone && jobInterestDone && question1Done && question2Done && previousHackathonsDone && attendancePreferenceDone;
+ const previousHackathonsDone = !!hs.application.shortAnswer
+ .previousHackathons;
+ const attendancePreferenceDone = !!hs.application.accommodation
+ .attendancePreference;
+ return (
+ portfolioDone &&
+ jobInterestDone &&
+ question1Done &&
+ question2Done &&
+ previousHackathonsDone &&
+ attendancePreferenceDone
+ );
};
/**
diff --git a/models/travel.model.js b/models/travel.model.js
index 8e7999e4..e22f196a 100644
--- a/models/travel.model.js
+++ b/models/travel.model.js
@@ -3,33 +3,45 @@ const Constants = require("../constants/general.constant");
const mongoose = require("mongoose");
//describes the data type
const TravelSchema = new mongoose.Schema({
- accountId: { // The account this travel data is associated with
+ accountId: {
+ // The account this travel data is associated with
type: mongoose.Schema.Types.ObjectId,
ref: "Account",
required: true
},
- hackerId: { // The hacker this travel data is associated with
+ hackerId: {
+ // The hacker this travel data is associated with
type: mongoose.Schema.Types.ObjectId,
ref: "Hacker",
required: true
},
- status: { // Has this hacker been approved for funds, etc.
+ status: {
+ // Has this hacker been approved for funds, etc.
type: String,
enum: Constants.TRAVEL_STATUSES,
required: true,
default: "None"
},
- request: { // Amount of money hacker has requested for travel
- type: Number,
- required: true
+ request: {
+ // Amount of money hacker has requested for travel
+ amount: {
+ type: Number,
+ required: true
+ },
+ reason: {
+ type: String,
+ required: true,
+ default: ""
+ }
},
- offer: { // Amount of money we have offered hacker for travel
+ offer: {
+ // Amount of money we have offered hacker for travel
type: Number,
default: 0
}
});
-TravelSchema.methods.toJSON = function () {
+TravelSchema.methods.toJSON = function() {
const hs = this.toObject();
delete hs.__v;
hs.id = hs._id;
diff --git a/package.json b/package.json
index 067b22be..0b02c5d5 100644
--- a/package.json
+++ b/package.json
@@ -3,8 +3,8 @@
"version": "3.1.4",
"private": true,
"scripts": {
- "start": "DEBUG=hackboard:* NODE_ENV=test nodemon --ignore gcp_creds.json ./bin/www.js",
- "start-windows": "set DEBUG=hackboard:* && set NODE_ENV=test && nodemon --ignore gcp_creds.json ./bin/www.js",
+ "start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js",
+ "start-windows": "set DEBUG=hackboard:* && set NODE_ENV=development && nodemon --ignore gcp_creds.json ./bin/www.js",
"deploy": "NODE_ENV=deployment node ./bin/www.js",
"debug": "DEBUG=hackboard:* NODE_ENV=test nodemon --ignore gcp_creds.json ./bin/www.js",
"test": "DEBUG=hackboard:* NODE_ENV=test mocha -r dotenv/config --reporter spec tests/**.js --exit",